query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
0c84300c4a84c648c3fd6be15126365c
Tedious main handler method.
[ { "docid": "485bdc67e307f07681268afc66629932", "score": "0.0", "text": "def render(root)\r\n\t$dimension = maxdepth(root) * ($DISTANCE + $FONTSIZE)\r\n\t\r\n\t#image junkiness\r\n\t$img = Magick::Image.new($dimension, $dimension) { self.background_color = 'white' }\r\n\t$canvas = Magick::Draw.new\r\n\t$canvas.font_family \"Courier\" #Monospace\r\n\t$canvas.pointsize $FONTSIZE #14-pt font\r\n\t$canvas.font_weight 600\r\n\t$canvas.stroke_width 2\r\n\t#$canvas.gravity Magick::CenterGravity\r\n\t\r\n\tdrawtree(root, [($dimension / 2).to_i,($dimension / 2).to_i], 4, root)\r\n\t\r\n\t#more graphical library junkiness\r\n\t$canvas.draw($img)\r\n\t#$img.resize!(120, 120, Magick::GaussianFilter, 1)\r\n\t$img.display\r\n\t$img.write(\"lewis.png\")\r\nend", "title": "" } ]
[ { "docid": "e95cfad9c46711f2a05857f5bcaad7b7", "score": "0.7589196", "text": "def main\n\n end", "title": "" }, { "docid": "e95cfad9c46711f2a05857f5bcaad7b7", "score": "0.7589196", "text": "def main\n\n end", "title": "" }, { "docid": "efa7967c369e2852cbce412d933637df", "score": "0.7400346", "text": "def main; end", "title": "" }, { "docid": "efa7967c369e2852cbce412d933637df", "score": "0.7400346", "text": "def main; end", "title": "" }, { "docid": "efa7967c369e2852cbce412d933637df", "score": "0.7400346", "text": "def main; end", "title": "" }, { "docid": "c821ff4ec859b1dd0f587dc9e2ae4730", "score": "0.7320032", "text": "def main\n end", "title": "" }, { "docid": "6bab742ecf47900b74a25496b4caa524", "score": "0.71451694", "text": "def handlers; end", "title": "" }, { "docid": "c3db4e3ba396c45aa76c8eb91c62621b", "score": "0.70291865", "text": "def main\n\t\nend", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.7029173", "text": "def run; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.6985326", "text": "def handle; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.6985326", "text": "def handle; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.6985326", "text": "def handle; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.6985326", "text": "def handle; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.6985326", "text": "def handle; end", "title": "" }, { "docid": "9fbec9b2bcd97ad59997b3cbc61b2258", "score": "0.6985326", "text": "def handle; end", "title": "" }, { "docid": "1534ac6ca27621262c7e0de67a05c53f", "score": "0.68470025", "text": "def run\n\n\tend", "title": "" }, { "docid": "2a006c0105921e24ea012ff030164e2c", "score": "0.6826191", "text": "def main\n\nend", "title": "" }, { "docid": "adaf5790b2481b56dc786b1bf29d871d", "score": "0.6810087", "text": "def run\n\n end", "title": "" }, { "docid": "5d804175f6c1933f94ff09f46eddfedd", "score": "0.68081766", "text": "def main()\n\n\nend", "title": "" }, { "docid": "e9cd853f591171bbbc814e48cde80903", "score": "0.67848545", "text": "def run\n end", "title": "" }, { "docid": "e9cd853f591171bbbc814e48cde80903", "score": "0.67848545", "text": "def run\n end", "title": "" }, { "docid": "e9cd853f591171bbbc814e48cde80903", "score": "0.67848545", "text": "def run\n end", "title": "" }, { "docid": "e9cd853f591171bbbc814e48cde80903", "score": "0.67848545", "text": "def run\n end", "title": "" }, { "docid": "e9cd853f591171bbbc814e48cde80903", "score": "0.67848545", "text": "def run\n end", "title": "" }, { "docid": "e9cd853f591171bbbc814e48cde80903", "score": "0.67848545", "text": "def run\n end", "title": "" }, { "docid": "e9cd853f591171bbbc814e48cde80903", "score": "0.67848545", "text": "def run\n end", "title": "" }, { "docid": "e9cd853f591171bbbc814e48cde80903", "score": "0.67848545", "text": "def run\n end", "title": "" }, { "docid": "e9cd853f591171bbbc814e48cde80903", "score": "0.67848545", "text": "def run\n end", "title": "" }, { "docid": "72c2066115edb677a48e584e7e523768", "score": "0.67828625", "text": "def start_handler\n\tend", "title": "" }, { "docid": "72c2066115edb677a48e584e7e523768", "score": "0.67828625", "text": "def start_handler\n\tend", "title": "" }, { "docid": "c376309f69511ff11b1194127d783fa1", "score": "0.67428344", "text": "def run\n end", "title": "" }, { "docid": "c376309f69511ff11b1194127d783fa1", "score": "0.67428344", "text": "def run\n end", "title": "" }, { "docid": "c376309f69511ff11b1194127d783fa1", "score": "0.67428344", "text": "def run\n end", "title": "" }, { "docid": "c376309f69511ff11b1194127d783fa1", "score": "0.67428344", "text": "def run\n end", "title": "" }, { "docid": "bc3e0880d8b9c0c44e60030e2f8d8933", "score": "0.67422944", "text": "def run\n\n\t\tend", "title": "" }, { "docid": "1c9c08652ac159a03e23f73ac1a84d94", "score": "0.67303157", "text": "def run\n end", "title": "" }, { "docid": "1c9c08652ac159a03e23f73ac1a84d94", "score": "0.67303157", "text": "def run\n end", "title": "" }, { "docid": "1c9c08652ac159a03e23f73ac1a84d94", "score": "0.67303157", "text": "def run\n end", "title": "" }, { "docid": "1c9c08652ac159a03e23f73ac1a84d94", "score": "0.67303157", "text": "def run\n end", "title": "" }, { "docid": "1c9c08652ac159a03e23f73ac1a84d94", "score": "0.67303157", "text": "def run\n end", "title": "" }, { "docid": "1c9c08652ac159a03e23f73ac1a84d94", "score": "0.67303157", "text": "def run\n end", "title": "" }, { "docid": "1c9c08652ac159a03e23f73ac1a84d94", "score": "0.67303157", "text": "def run\n end", "title": "" }, { "docid": "1c9c08652ac159a03e23f73ac1a84d94", "score": "0.67303157", "text": "def run\n end", "title": "" }, { "docid": "dbf9d4c3d7943ad687492d9f34bc977c", "score": "0.66989267", "text": "def main_end ; end", "title": "" }, { "docid": "3aeefa00b5cb38d1108e892038bc3a61", "score": "0.66926587", "text": "def handle(*args)\n end", "title": "" }, { "docid": "25b3fcfcf33ffae73848158244a8d93b", "score": "0.6660665", "text": "def run_internal; end", "title": "" }, { "docid": "888cb32b1f2cbc9aa9d27f2835a2c894", "score": "0.6549222", "text": "def main_handle()\n @main_handle\n end", "title": "" }, { "docid": "90d02ee5ee7260a0742c2e82dea82b8a", "score": "0.6539977", "text": "def run!; end", "title": "" }, { "docid": "90d02ee5ee7260a0742c2e82dea82b8a", "score": "0.6539977", "text": "def run!; end", "title": "" }, { "docid": "08d440b67a39928ad88d52a61e072407", "score": "0.653773", "text": "def main?; false end", "title": "" }, { "docid": "b08da84628cfe5da0322541f89263059", "score": "0.65359616", "text": "def handler_executed(handler); end", "title": "" }, { "docid": "b08da84628cfe5da0322541f89263059", "score": "0.65359616", "text": "def handler_executed(handler); end", "title": "" }, { "docid": "4da8b4c3bd5770e60b33f86f7d85b9b4", "score": "0.64980936", "text": "def run\n end", "title": "" }, { "docid": "1782742ef727b7c36e3d394cd07606d3", "score": "0.64889276", "text": "def _run!; end", "title": "" }, { "docid": "3dc387716e7f2b1d9e0edea25af32d1f", "score": "0.6486954", "text": "def runner; end", "title": "" }, { "docid": "3dc387716e7f2b1d9e0edea25af32d1f", "score": "0.6486954", "text": "def runner; end", "title": "" }, { "docid": "ff07ae0af6cf831bd0dffaf6e5679adc", "score": "0.64592683", "text": "def run!\n end", "title": "" }, { "docid": "b5b20075d5d5c127f6ac8722e8bcbf74", "score": "0.64473146", "text": "def run(*args); end", "title": "" }, { "docid": "b5b20075d5d5c127f6ac8722e8bcbf74", "score": "0.64473146", "text": "def run(*args); end", "title": "" }, { "docid": "b5b20075d5d5c127f6ac8722e8bcbf74", "score": "0.64473146", "text": "def run(*args); end", "title": "" }, { "docid": "b5b20075d5d5c127f6ac8722e8bcbf74", "score": "0.64473146", "text": "def run(*args); end", "title": "" }, { "docid": "b5b20075d5d5c127f6ac8722e8bcbf74", "score": "0.64473146", "text": "def run(*args); end", "title": "" }, { "docid": "b5b20075d5d5c127f6ac8722e8bcbf74", "score": "0.64473146", "text": "def run(*args); end", "title": "" }, { "docid": "0fc17705d870e61934986ca1f5161e96", "score": "0.6444575", "text": "def handlers=(_arg0); end", "title": "" }, { "docid": "021191e151f84dee7fe60cd1df20e62a", "score": "0.641665", "text": "def run!\n end", "title": "" }, { "docid": "9255eaf4b8901bca51572204ff2f3705", "score": "0.6385907", "text": "def main\n ## main method of program. run first\n\nend", "title": "" }, { "docid": "20d92ec0e7b654b4bbfe598598b52793", "score": "0.6377571", "text": "def run(context)\n\t\t# nothing to do here\n\tend", "title": "" }, { "docid": "41a0a3b53e721d6ee12e038bf45ec423", "score": "0.63729894", "text": "def run\n setup\n main\n ensure\n shutdown\n end", "title": "" }, { "docid": "769a6f334db614b9783eb971e9ee404e", "score": "0.6353421", "text": "def entrypoint() ; info[:entrypoint] ; end", "title": "" }, { "docid": "769a6f334db614b9783eb971e9ee404e", "score": "0.6353421", "text": "def entrypoint() ; info[:entrypoint] ; end", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.63207746", "text": "def executor; end", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.63207746", "text": "def executor; end", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.63207746", "text": "def executor; end", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.63207746", "text": "def executor; end", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.63207746", "text": "def executor; end", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.63207746", "text": "def executor; end", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.63207746", "text": "def executor; end", "title": "" }, { "docid": "f14db66a546f7bd1b89ef1ed7fd10bec", "score": "0.63144207", "text": "def server; end", "title": "" }, { "docid": "f14db66a546f7bd1b89ef1ed7fd10bec", "score": "0.63144207", "text": "def server; end", "title": "" }, { "docid": "f14db66a546f7bd1b89ef1ed7fd10bec", "score": "0.63144207", "text": "def server; end", "title": "" }, { "docid": "f14db66a546f7bd1b89ef1ed7fd10bec", "score": "0.63144207", "text": "def server; end", "title": "" }, { "docid": "f14db66a546f7bd1b89ef1ed7fd10bec", "score": "0.63144207", "text": "def server; end", "title": "" }, { "docid": "301680d01fd7a0a12e79a13c009adef6", "score": "0.6290125", "text": "def run\n header\n main\n end", "title": "" }, { "docid": "3d36511b10d5611e7c5873a098ca98a4", "score": "0.62838537", "text": "def run\nend", "title": "" }, { "docid": "6c0ebf7fe5b7c8b604725de35bc78740", "score": "0.6279219", "text": "def main()\n\n\t#check flags from command line (currently statically implemented)\n\tpage_to_crawl = BASE_URL[1]\n\n\t#create file for reporting to\n\twrite_headers_to_file()\n\n\t#determine function to call for page crawling\n\tcase page_to_crawl\n\t\twhen BASE_URL[0]\n\t\t\tfetch_squirrelmail()\n\t\twhen BASE_URL[1]\n\t\t\tfetch_wordpress(BASE_URL[1])\n\tend\n\t\nend", "title": "" }, { "docid": "7adcce2b3b7339af5e9da44685665c2a", "score": "0.6271464", "text": "def main()\n\n #check flags from command line (currently statically implemented)\n page_to_crawl = BASE_URL[3]\n\n #create file for reporting to\n write_headers_to_file()\n\n #determine function to call for page crawling\n case page_to_crawl\n when BASE_URL[0]\n fetch_squirrelmail(BASE_URL[0])\n when BASE_URL[1]\n fetch_wordpress(BASE_URL[1])\n when BASE_URL[2]\n fetch_media_wiki(BASE_URL[2])\n when BASE_URL[3]\n fetch_modx(BASE_URL[3])\n end\n\nend", "title": "" }, { "docid": "6a6e25a84c5958d6d41208bc65b5151c", "score": "0.62628055", "text": "def run\n raise \"not implemented\"\n end", "title": "" }, { "docid": "0fc0deae25c6d28d9553658ee03f01f3", "score": "0.62444013", "text": "def main\n data.main\n end", "title": "" }, { "docid": "90f1ae7b7f3fee9e049b30bf83a0d985", "score": "0.6225391", "text": "def run\n raise 'Not implemented'\n end", "title": "" } ]
0b57445b2ea9d4ca69ef00d1a50a4e27
The logo of the application that will be displayed to users that perform a share with it.
[ { "docid": "7db0c7ff97ca4c105a58c5b4d52067a6", "score": "0.7987194", "text": "def logo\n get_attribute(Yoti::Attribute::APPLICATION_LOGO)\n end", "title": "" } ]
[ { "docid": "14fce93f162cb29e057d06128949fd24", "score": "0.77277964", "text": "def get_logo\n Oneclick::Application.config.ui_logo\n end", "title": "" }, { "docid": "804e396d85e495d589d0eb0e50ddb7f4", "score": "0.7170889", "text": "def logo\n\t\ts = image_tag('rails.png', :alt => \"Online Orders Application\")\n\t\treturn s\n\tend", "title": "" }, { "docid": "ce2303be8cd4bb4e0b0a28be7bd15de5", "score": "0.71381193", "text": "def logo_builder\n ManifestBuilder::LogoBuilder\n end", "title": "" }, { "docid": "d1c0fe151055724c734359b6cfc88fc3", "score": "0.6831033", "text": "def get_logo_display\n\t\tif !logged_in?\n\t\t\treturn \"City Produce\"\n\t\tend\n\t\tif current_user.admin?\n\t\t\treturn \"Admin\"\n\t\tend\n\t\treturn \"Home\"\n\tend", "title": "" }, { "docid": "85d5ffe0adaa0f2ab47fa4ad74522735", "score": "0.6799638", "text": "def application_logo(classes)\n if cookies[:layout] == 'application' || cookies[:layout].nil?\n image_tag(asset_pack_path('media/images/duszek-awesome.svg'), class:\"#{classes}\")\n else\n image_tag(asset_pack_path('media/images/duszki.png'), class:\"#{classes}\")\n end\n end", "title": "" }, { "docid": "9eb19f08c68ef365f84fcab2ed1bfce3", "score": "0.679797", "text": "def logo\n return @logo\n end", "title": "" }, { "docid": "45768fb9d0166a38ead64c4a1e000d21", "score": "0.679249", "text": "def logo\n image_tag(\"logo.png\", :alt => \"Sample App\", :class => \"round\")\n end", "title": "" }, { "docid": "45768fb9d0166a38ead64c4a1e000d21", "score": "0.679249", "text": "def logo\n image_tag(\"logo.png\", :alt => \"Sample App\", :class => \"round\")\n end", "title": "" }, { "docid": "c6ee2891d52dcf63bfed4e922840c81d", "score": "0.67629325", "text": "def settings_logo\n @page_title = _('Logo_settings')\n @logo = Confline.get_value(\"Logo_Picture\")\n end", "title": "" }, { "docid": "e93fb5ccfa366123ed9d9be2c869ec2d", "score": "0.67328584", "text": "def application_logo=(value)\n @children['application-logo'][:value] = value\n end", "title": "" }, { "docid": "0580ba5ca8050fc1789d7e1f051e6adc", "score": "0.6731449", "text": "def sp_logo\n sp.logo || DEFAULT_LOGO\n end", "title": "" }, { "docid": "a0ecf7b9d4ee8521bbad92103c39a495", "score": "0.6567628", "text": "def logo\n logo=image_tag(\"rails.png\" , :alt=>\"Sample app\" ,:class=>\"round\")\n end", "title": "" }, { "docid": "e64262d2426a1e29da67f308d31e8996", "score": "0.65553", "text": "def logo\n raw_team['team_logo']\n end", "title": "" }, { "docid": "44efcebedbcea1cdb8392c84b24875ce", "score": "0.6505325", "text": "def logo\n content_tag(:span, \"HASTINGS FINE HOMES\", class: \"logo\")\n end", "title": "" }, { "docid": "fa8c0a186d670e12b0d24be125abf25e", "score": "0.6498172", "text": "def logo\n\t\timage_tag(\"logo.png\", :alt => \"jobradar\", :class => \"round\")\n\tend", "title": "" }, { "docid": "32a86a8734fa3bfc3c85cf1c7c34b5cd", "score": "0.6498063", "text": "def logo\n image_tag('rubyLogo.png', alt: 'Ruby on Rails Sample App', class: 'round', height: \"50px\")\n end", "title": "" }, { "docid": "b6468811c6b2e88eb2c2215c68d8aeec", "score": "0.64481175", "text": "def logo_link\n root_path\n end", "title": "" }, { "docid": "70bca9b6e9ab81469afd1dd7222d3525", "score": "0.64404684", "text": "def logo\r\n \tlogo = image_tag(\"logo.png\", :alt => \"mens fashion today\", :class => \"round\")\r\n end", "title": "" }, { "docid": "309ebf5f342a22f8dcb68e3e5b990fef", "score": "0.6418893", "text": "def logo\n rand_num = Random.rand(76) + 1\n \"http://www.biz-logo.com/examples/#{ rand_num < 10 ? \"00\" : \"0\" }#{rand_num}.gif\"\n end", "title": "" }, { "docid": "3b98468934acc9e72e43814c1b47a590", "score": "0.64125067", "text": "def display_course_logo(course)\n content_tag(:span, class: ['image']) do\n image_tag(course.logo.medium.url || 'course_default_logo.svg')\n end\n end", "title": "" }, { "docid": "23f6dc0e566998da7504e7b2531747bb", "score": "0.6394565", "text": "def logo; end", "title": "" }, { "docid": "23f6dc0e566998da7504e7b2531747bb", "score": "0.6394565", "text": "def logo; end", "title": "" }, { "docid": "da783c419929c38a5f0e4aa0f2a3de24", "score": "0.63718784", "text": "def logo=(value)\n @logo = value\n end", "title": "" }, { "docid": "70838d37ee85ba6f9819832eafaff7ff", "score": "0.6324054", "text": "def logo_path\n root_path\n end", "title": "" }, { "docid": "70838d37ee85ba6f9819832eafaff7ff", "score": "0.6324054", "text": "def logo_path\n root_path\n end", "title": "" }, { "docid": "70838d37ee85ba6f9819832eafaff7ff", "score": "0.6324054", "text": "def logo_path\n root_path\n end", "title": "" }, { "docid": "7002fbfc14f3f3f9586380940869e97d", "score": "0.62899894", "text": "def logo_url\n @attributes[:logo_url]\n end", "title": "" }, { "docid": "73955f9a616dd8aa88f695745ce7e67c", "score": "0.628502", "text": "def commenter_logo(commenter)\n if commenter.provider && commenter.provider == 'weibo'\n link_to image_tag(commenter.profile_image_url, :alt => commenter.name), \"http://weibo.com/#{commenter.profile_url}\", :target => '_blank', :rel => 'nofollow'\n else\n link_to image_tag(commenter.logo.url, :alt => commenter.name), APP_CONFIG['site_url']\n end\n end", "title": "" }, { "docid": "962d329f371e53be4f7c31f0bd825f7c", "score": "0.6283064", "text": "def g_home_logo(page_title)\n if page_title.empty?\n '<a href=\"#\"><img class=\"brand\" width=\"26\" src=\"/assets/botflip-logo.svg\"></a><a href=\"#\" class=\"brand\">Miniflip</a>'.html_safe\n # link_to \"MiniFeed\", \"#\", class: \"brand\"\n else\n '<a href=\"/\"><img class=\"brand\" width=\"26\" src=\"/assets/botflip-logo.svg\"></a><a href=\"/\" class=\"brand\">Miniflip</a>'.html_safe\n end\n end", "title": "" }, { "docid": "e52ba6f70d305c2bfa9d7b4db1d25e52", "score": "0.6272846", "text": "def logo_url\n logo? ? h.image_tag(logo.thumb_medium, alt: 'Logo', width: 90) :\n h.content_tag(:span, initial, class: 'brand_img_holder', style: 'width:43px; height:43px;')\n end", "title": "" }, { "docid": "53346e17990e72e63eb7a51ac66bdbfa", "score": "0.62492645", "text": "def user_logo(user)\n image_tag(user.avatar_url)\n end", "title": "" }, { "docid": "e0d4eb672c834969fb2d20a98c6ff47c", "score": "0.6229069", "text": "def logo_tag\n image_tag \"rails.png\", :alt => @page_title\n end", "title": "" }, { "docid": "c6862250842354162769e3cb1e0264b7", "score": "0.6218433", "text": "def logo_url\n if user_signed_in?\n current_user\n elsif admin_signed_in?\n current_admin_user\n else\n root_url\n end\n end", "title": "" }, { "docid": "dca5b91ced513a4bf3d980d560465252", "score": "0.6190747", "text": "def logo\n \"This is a cool logo !\"\n end", "title": "" }, { "docid": "73525e6751d1476206ae8a27c4a9c135", "score": "0.61767894", "text": "def logo_url style = :original\n logo.url(style, timestamp: false)\n end", "title": "" }, { "docid": "e28761e88acff45b277f359780e0db58", "score": "0.61688524", "text": "def casein_config_logo\n 'casein/casein.png'\n end", "title": "" }, { "docid": "cf89e68c002ab15d9f216c2f806b4998", "score": "0.61668354", "text": "def default_image\n if instance.platform.name =~ /^(.*)-([^-]*)$/\n \"#{$1}:#{$2}\"\n else\n instance.platform.name\n end\n end", "title": "" }, { "docid": "cd67a1a4a082df30446e5e9acbbfcbe1", "score": "0.61426085", "text": "def logo\n logo = image_tag(\"background.png\", :alt => \"background\")\n end", "title": "" }, { "docid": "775230f2b6b0b5c9dcdf31ce090ba872", "score": "0.6125632", "text": "def organisation_logo\n session[:organisation][:name]\n end", "title": "" }, { "docid": "2949b38cdf4932af5a7ce88a609a37e0", "score": "0.6116627", "text": "def logo_link\n link_to(logo_img, view_context.root_path)\n end", "title": "" }, { "docid": "5de69bccc3fcf64ac1aa92e493c3ea31", "score": "0.6100336", "text": "def og_image\n if @user && @user.image?\n @user.image.url\n elsif @person && @person.image?\n @person.image\n else\n root_url.chomp('/') + image_path('logo.png')\n end\n end", "title": "" }, { "docid": "a8bac053c3b9d9f38c29ef03b3398d94", "score": "0.60561734", "text": "def platform_icon(software, size=17)\n img = case software.platform.to_s\n when /windows/i\n \"icons/windows_#{size}.png\"\n when /mac/i\n \"icons/mac_#{size}.png\"\n when /linux/i\n \"icons/tux_#{size}.png\"\n when /ios/i\n \"icons/iOS_#{size}.png\"\n when /android/i\n \"icons/android_#{size}.png\"\n else\n \"icons/none_#{size}.png\"\n end\n image_tag img, style: \"vertical-align: middle\"\n end", "title": "" }, { "docid": "210042f9634f2453dbd97d1a7bd2832f", "score": "0.60509443", "text": "def logo\n rand_num = rand(1..13)\n \"https://pigment.github.io/fake-logos/logos/medium/color/#{rand_num}.png\"\n end", "title": "" }, { "docid": "c1b202714e97159ac4973ce9b4a069e8", "score": "0.6035648", "text": "def show_logo\n\tcompany = company_from_subdomain\n\tclient = Customer.find(params[:id], :conditions => [\"company_id = ?\", company.id])\n\n unless client.logo?\n render :nothing => true\n return\n end\n\n image = Magick::Image.read( client.logo_path ).first\n if image\n send_file client.logo_path, :filename => \"logo\", :type => image.mime_type, :disposition => 'inline'\n else\n render :nothing => true\n end\n image = nil\n GC.start\n end", "title": "" }, { "docid": "bf15be132f94b62b13e611b56cb3b621", "score": "0.6021002", "text": "def casein_config_logo\n \t'/images/logo_ss.jpg'\n end", "title": "" }, { "docid": "a56c7b5fdb5351c103dd80603f2ee224", "score": "0.6015915", "text": "def logo_path(ngo)\n if ngo.image.attached?\n Rails.application.routes.url_helpers.rails_blob_path(ngo.image, only_path: true)\n else\n ActionController::Base.helpers.image_path('image_not_found.png')\n end\n end", "title": "" }, { "docid": "a2612c325576c557e46bd1a676fdb45e", "score": "0.6002316", "text": "def platform_icon(software, size=17)\n img = case software.platform.to_s\n when /windows/i\n \"icons/windows_#{size}.png\"\n when /mac/i\n \"icons/mac_#{size}.png\"\n when /linux/i\n \"icons/tux_#{size}.png\"\n when /ios/i\n \"icons/iOS_#{size}.png\"\n when /android/i\n \"icons/android_#{size}.png\"\n else\n \"icons/download_#{size}.png\"\n end\n image_tag img, style: \"vertical-align: middle\", alt: \"platform icon\"\n\tend", "title": "" }, { "docid": "2e488f2727ad2e2c6fa8ce5f9e4d0e45", "score": "0.5988942", "text": "def image\n meta_og_image\n end", "title": "" }, { "docid": "7d1e09ae4b8dc09143c8c3d16c3039cc", "score": "0.59759086", "text": "def facebook_icon\n image_tag('facebook.png', border: 0)\n end", "title": "" }, { "docid": "990e0e4c5b05c17bae189433df8e5905", "score": "0.597507", "text": "def logo=(_arg0); end", "title": "" }, { "docid": "519b6e95ccc78746449fd550b114fddc", "score": "0.5940328", "text": "def beer_logo_path\n self.logo_path.url(:medium)\n end", "title": "" }, { "docid": "8a992ac611058a3709fa413a33dedb6a", "score": "0.5938669", "text": "def social_title(image)\n name = image.name\n if !name.blank?\n name\n elsif domain = product_domain(image)\n \"LifeSizer image on #{domain}\"\n else\n \"LifeSizer image\"\n end\n end", "title": "" }, { "docid": "2c6212d045a3c7a3d943e25b30261bdd", "score": "0.59179175", "text": "def logo\n image_tag(\"boulder.png\", :width => \"100\", \n :height => \"75\",\n :alt => \"Learning RoR\", \n :class => \"round\")\n end", "title": "" }, { "docid": "85ea6ba878c2477dc4ea18dd0953f4df", "score": "0.59169364", "text": "def logo_base_64\n 'data:image/png;base64, ' + Base64.encode64(File.open(\"#{Rails.root}/app/assets/images/logo_orgao.png\", 'rb').read).to_s\n end", "title": "" }, { "docid": "2c93249669064ef808fc7670e3c83b80", "score": "0.58768696", "text": "def interchange_logo\n q = []\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (default)]\"\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (large)]\"\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (medium)]\"\n q << \"[#{image_path(\"#{website.folder}/logo-sm.png\")}, (only screen and (max-width: 720px))]\"\n\n image_tag('', #\"#{website.folder}/logo.png\",\n class: \"no-resize no-resize-for-small\",\n alt: Setting.site_name(website),\n data: { interchange: q.join(\", \") })\n end", "title": "" }, { "docid": "2c93249669064ef808fc7670e3c83b80", "score": "0.58768696", "text": "def interchange_logo\n q = []\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (default)]\"\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (large)]\"\n q << \"[#{image_path(\"#{website.folder}/logo.png\")}, (medium)]\"\n q << \"[#{image_path(\"#{website.folder}/logo-sm.png\")}, (only screen and (max-width: 720px))]\"\n\n image_tag('', #\"#{website.folder}/logo.png\",\n class: \"no-resize no-resize-for-small\",\n alt: Setting.site_name(website),\n data: { interchange: q.join(\", \") })\n end", "title": "" }, { "docid": "b6c4f2f0298c8d1c0639bd0f60e7b6f3", "score": "0.58297205", "text": "def image\n meta['og:image'] || meta['twitter:image']\n end", "title": "" }, { "docid": "7c4890ddfebd649d9141d6245aca2a82", "score": "0.58096504", "text": "def link_to_powered_by_logo\n link_to(content_tag(:div, '', :class => \"poweredByLogo fl ml10\"), home_page_url, {:popup => true})\n end", "title": "" }, { "docid": "2da87b8a878d3cc863b24c07089d4647", "score": "0.5807086", "text": "def company_customization_primary_logo\n @company && @company.customizations&.primary_header_logo\n end", "title": "" }, { "docid": "d77fbd53c03b4ceb6a8b7d0d14aea760", "score": "0.57963645", "text": "def select_logo_title\n\t\tdefine_area\n\t\tif @area == 'model'\n\t\t\tlogo_title = t('layouts.main_filters.collection')\n\t\telsif @area == 'creation'\n\t\t\tlogo_title = t('layouts.main_filters.creation')\n\t\telsif @area == 'accessory' || @area == 'fabric' || @area == 'workshop'\n\t\t\tlogo_title = t('layouts.main_filters.shop')\n\t\tend\n\tend", "title": "" }, { "docid": "82a81e7f4e48efd07a5dae186e996203", "score": "0.57850915", "text": "def favicon\n \"hammer/hammer.png\"\n end", "title": "" }, { "docid": "89965931c7db081060d3b5d113ece670", "score": "0.5782719", "text": "def get_logo_for_season_type\n if object.season_type && object.season_type.code =~ /CSI/i\n h.image_tag( 'logo_csi.png', size: '25x16' )\n elsif object.season_type && object.season_type.code =~ /FIN/i\n h.image_tag( 'logo_fin.png', size: '40x16' )\n elsif object.season_type && object.season_type.code =~ /UISP/i\n h.image_tag( 'logo_uisp.png', size: '40x16' )\n elsif object.season\n object.season.get_season_type\n else\n ''\n end\n end", "title": "" }, { "docid": "97c0dcef05ce64b0d989bcb4a6cda551", "score": "0.578195", "text": "def header\n image \"#{Rails.root}/app/assets/images/giftgardensmall.jpg\", \n width: 40, height: 40\n move_up 30\n text \"Activities Report\", size: 24, style: :bold, :align => :center\n end", "title": "" }, { "docid": "154c20aa5694983787721dc0b8d7b110", "score": "0.57771647", "text": "def mobile_badge_image\n badge_type.image_url + year.to_s + \"mobile.png\"\n end", "title": "" }, { "docid": "b03dedc6e25ce33bdd6f4d0a4d913f99", "score": "0.57689387", "text": "def logo=(v)\n @logo = v ? URI.parse(v) : nil\n end", "title": "" }, { "docid": "af7bc10b74d858c735cb53717142e8c8", "score": "0.57630825", "text": "def icon\n @manifest_options[:icon] || \"\"\n end", "title": "" }, { "docid": "cb4fbfa5cef2fbeacf66f8973a04388f", "score": "0.57588446", "text": "def image\n meta_og_image || meta_twitter_image\n end", "title": "" }, { "docid": "416e40fe4b158f59c84b8f067d946c46", "score": "0.57198024", "text": "def image\n 'gh.png'\n end", "title": "" }, { "docid": "221de484707a0004fbaa75eeba6c7092", "score": "0.5717791", "text": "def nav_logo_stamp\n nav_logo.blob.created_at.to_i if nav_logo.attached?\n end", "title": "" }, { "docid": "472934429b0034ec9d09c7713866aecc", "score": "0.5700496", "text": "def build_logo\n if @logo && !@logo.empty?\n bottom = @document.note.empty? ? 75 : (75 + note_height)\n @pdf.image(@logo, at: [0, bottom], fit: [x(200), y(50)])\n end\n end", "title": "" }, { "docid": "16cc2427633682f870754bbd81080be0", "score": "0.56901807", "text": "def url_for_co_hbrand_image(company)\n \"#{I18n.t('shf_medlemssystem_url')}/hundforetag/#{company.id}/company_h_brand\"\n end", "title": "" }, { "docid": "6a9b4ce66ee07ea862ba414e48c2d906", "score": "0.5686271", "text": "def attach_logo(image_name)\n path = File.join(Rails.root.to_s, '/app/assets/images/', image_name)\n attachments.inline['logo.png'] = File.read(path)\n end", "title": "" }, { "docid": "840ac84ebf8b1874ac95be6af76c9d59", "score": "0.5684832", "text": "def get_team_logo(team) \n doc = getHTML(\"http://espn.go.com/mens-college-basketball/team/_/id/#{team.webExt}\") \n logo = doc.xpath(\"//meta[@property='og:image']/@content\").text\n team.update(logo: logo)\n end", "title": "" }, { "docid": "51c9b6a27cf646328a29a37b4adc1146", "score": "0.5654736", "text": "def logo_url\n @shop.dig('logo_url','url')\n end", "title": "" }, { "docid": "9d00754c8bb8548fc290bce8e0e0171b", "score": "0.56517476", "text": "def cli_icon_prefix\n ((/darwin/ =~ RUBY_PLATFORM) != nil) ? \"#{FOLDER_SYMBOL} \" : \"\"\n end", "title": "" }, { "docid": "4f0f604e45f77ab7fed9387e99b1bb52", "score": "0.5647977", "text": "def logo_url\n logo? ? logo.url : profile_img\n end", "title": "" }, { "docid": "2f3b048c3bc73cb1bbcb54f43bbea230", "score": "0.56429344", "text": "def icon4share\r\n icon_path = self.display_icon.original\r\n icon4share_path = icon_path + \"4share.jpg\"\r\n unless File.exist?('public'+icon4share_path)\r\n back = Magick::Image.read('public/images/back4share.jpg').first\r\n icon = Magick::Image.read('public'+icon_path).first\r\n result = back.composite(icon, Magick::CenterGravity, Magick::OverCompositeOp)\r\n result.write('public'+icon4share_path)\r\n end\r\n icon4share_path\r\n end", "title": "" }, { "docid": "f1add43744b7ce0187bdff75fdfc4672", "score": "0.5608034", "text": "def image_filename(mobile = false)\n mobile ? mobile_image_filename : desktop_image_filename\n end", "title": "" }, { "docid": "1e317206f32dea3a80225bdc47fe197b", "score": "0.5583165", "text": "def long_logo_web_url_for_light_theme\n return @long_logo_web_url_for_light_theme\n end", "title": "" }, { "docid": "31b181e7bf7fe42df90a99bb3aeb4523", "score": "0.55820733", "text": "def app_meta_tags(options={})\n if website\n default_options = { folder: website.folder, title: (website.brand.present?) ? website.brand.name : website.site_name, status_bar_color: \"black\" }\n else\n default_options = { folder: \"\", title: \"\", status_bar_color: \"black\" }\n end\n options = default_options.merge options\n\n ret = tag(:meta, name: \"apple-mobile-web-app-capable\", content: \"yes\")\n ret += tag(:meta, name: \"apple-mobile-web-app-status-bar-style\", content: options[:status_bar_color])\n ret += tag(:meta, name: \"apple-mobile-web-app-title\", content: options[:title] )\n ret += tag(:meta, name: \"format-detection\", content: \"telephone=no\")\n\n # only one dimension needed, half-size (non-retina) sizes.\n sizes = [29, 40, 50, 57, 60, 72, 76].sort.reverse\n\n sizes.each do |size|\n # retina versions:\n if File.exists?(Rails.root.join(\"app\", \"assets\", \"images\", options[:folder], \"AppIcon#{size}x#{size}@2x.png\"))\n ret += tag(:link, rel: \"apple-touch-icon\", sizes: \"#{size*2}x#{size*2}\", href: image_path(\"#{options[:folder]}/AppIcon#{size}x#{size}@2x.png\") )\n end\n end\n sizes.each do |size|\n if File.exists?(Rails.root.join(\"app\", \"assets\", \"images\", options[:folder], \"AppIcon#{size}x#{size}.png\"))\n ret += tag(:link, rel: \"apple-touch-icon\", sizes: \"#{size}x#{size}\", href: image_path(\"#{options[:folder]}/AppIcon#{size}x#{size}.png\") )\n end\n end\n\n ret.html_safe\n end", "title": "" }, { "docid": "acb46fc3c4434705a6b6038df557ce16", "score": "0.5574207", "text": "def get_logo_route\n\t\tif !logged_in?\n\t\t\treturn root_path\n\t\tend\n\t\tif current_user.admin?\n\t\t\treturn admin_path\n\t\tend\n\t\treturn current_user\n\tend", "title": "" }, { "docid": "8e574e2e1cb9c572f8487b726f25959d", "score": "0.5560462", "text": "def header\n\t\tlogo_path = Rails.root.join('app','assets','images','longbourn_logo.png')\n\t\timage logo_path, :width => 70, :height => 45\n\t\tdraw_text \"Informe de Desempeño de Alumnos\", :at => [100,25], size:12\n\t\tdraw_text \"Longbourn Institute\", :at => [100,10], size:12\n\tend", "title": "" }, { "docid": "4045baccaebab4d2d3f9f6faee1fa5c5", "score": "0.5529331", "text": "def set_image_title\n controller_name == 'temp_listings' ? '' : 'Pin it @ Pinterest'\n end", "title": "" }, { "docid": "157a867e0eef871e6d25c12754846046", "score": "0.55267334", "text": "def long_logo_web_url_for_dark_theme\n return @long_logo_web_url_for_dark_theme\n end", "title": "" }, { "docid": "433f3d7bc46d701606aeed5989a90ee1", "score": "0.5514797", "text": "def logo(options={})\n @logo ||= (\n if file = output.glob_relative('**/logo.*').first\n file #.relative_path_from(output)\n else\n keyword = options[:keyword]\n directory = options[:directory]\n keyword ||= (metadata.search || metadata.title || metadata.name)\n logo_search(keyword, directory)\n end\n )\n end", "title": "" }, { "docid": "8a8da18ba0ee66ce147290a6cf3f8344", "score": "0.54697394", "text": "def configure_logo\n actual_path = \"app/javascript/svgs/logo.svg\"\n favicon_fallback_path = \"app/assets/images/perlmutterapp.svg\"\n favicon_path = \"app/assets/images/favicon.svg\"\n apple_icon_path = \"app/assets/images/favicon.png\"\n webpack_path = \"media/svgs/logo.svg\"\n if @args.empty?\n while @config[\"config\"][\"logo_path\"].nil?\n File.delete(actual_path) if File.exist?(actual_path)\n File.delete(favicon_path) if File.exist?(favicon_path)\n begin\n case @prompt.select(prompt_box(\"You may optionally provide your organization's logo in SVG format to use for branding. Please select an option to provide an SVG, or select from our presets:\"), %W[URL Filepath Presets Skip])\n when \"URL\"\n TTY::File.download_file(@prompt.ask(prompt_box(\"What is the URL for the SVG?\"), required: true), actual_path)\n TTY::File.copy_file(actual_path, favicon_path)\n @config[\"config\"][\"logo_path\"] = webpack_path\n when \"Filepath\"\n TTY::File.copy_file(@prompt.ask(prompt_box(\"What is the filepath for the SVG?\"), required: true), actual_path)\n TTY::File.copy_file(actual_path, favicon_path)\n @config[\"config\"][\"logo_path\"] = webpack_path\n when \"Presets\"\n emoji_map = JSON.parse(File.open(\"emoji.json\", \"rb\").read).to_h { |h| [h[\"name\"], h[\"codes\"].gsub(' ', '-').downcase] }\n code = @prompt.select(prompt_box(\"Select from online presets to be your logo! If unavailable, try another:\"), emoji_map, filter: true, required: true)\n TTY::File.download_file(\"https://twemoji.maxcdn.com/svg/#{code}.svg\", actual_path)\n TTY::File.copy_file(actual_path, favicon_path)\n @config[\"config\"][\"logo_path\"] = webpack_path\n else\n success_prompt(\"Setting logo skipped.\")\n TTY::File.copy_file(favicon_fallback_path, favicon_path)\n break\n end\n unless @config[\"config\"][\"logo_path\"].nil?\n success_prompt(\"Logo set.\")\n end\n rescue StandardError\n error_box(\"Setting logo failed. Please try again. If this persists, please reach out to the developers.\")\n end\n end\n else\n File.delete(actual_path) if File.exist?(actual_path)\n File.delete(favicon_path) if File.exist?(favicon_path)\n logo = get_argument_value(\"logo\", false, nil)\n option = get_argument_value(\"logo_option\", false, nil)\n if !logo.nil? && !option.nil?\n begin\n case option\n when \"url\"\n TTY::File.download_file(logo, actual_path)\n else\n TTY::File.copy_file(logo, actual_path)\n end\n TTY::File.copy_file(actual_path, favicon_path)\n @config[\"config\"][\"logo_path\"] = webpack_path\n success_prompt(\"Logo set.\")\n rescue StandardError\n error_box(\"Setting logo failed.\")\n raise ArgumentError\n end\n else\n success_prompt(\"Setting logo skipped.\")\n TTY::File.copy_file(favicon_fallback_path, favicon_path)\n end\n end\n write_png_from_svg(favicon_path, apple_icon_path, 180, 180)\nend", "title": "" }, { "docid": "69254018b439dcddaa3087907c7a1009", "score": "0.54538864", "text": "def set_logo\n @logo = Logo.find(@company.logo_id) # NOTE: this raises a 404 if there's no logo,\n # which is what we want here.\n end", "title": "" }, { "docid": "e2df6f9bfff59a76f4c9d975e2359671", "score": "0.5452788", "text": "def kiosk_app_display_name\n return @kiosk_app_display_name\n end", "title": "" }, { "docid": "653b872a921ed014cb852085ba5985f5", "score": "0.5452639", "text": "def logo_dimensions_string\n \"#{LOGO_WIDTH}x#{LOGO_HEIGHT}\"\n end", "title": "" }, { "docid": "5de7e2879803a224dde3fecf7d2d2c42", "score": "0.5401832", "text": "def square_logo_web_url_for_light_theme\n return @square_logo_web_url_for_light_theme\n end", "title": "" }, { "docid": "f55fef37e7dff8f0ed1e0f86ee710f17", "score": "0.5400932", "text": "def default_url\n ActionController::Base.helpers.asset_path(\"logos/\" + [version_name, \"missing.png\"].compact.join('/'))\n end", "title": "" }, { "docid": "7247df52db385cf653ebb2d23762d64d", "score": "0.53850263", "text": "def create_logo(text)\n tag = 'h1' if item.identifier == '/'\n tag ||= 'div'\n\n \"<\" + tag + \" id=\\\"logo\\\"><a href=\\\"/\\\">\" + text + \"</a></\" + tag + \">\"\n end", "title": "" }, { "docid": "14b24eb46a0375b2ecf0c0e39775f8e6", "score": "0.53795844", "text": "def share_media_url\n if share_representative_derivative\n url = share_representative_derivative.url(public: true)\n\n # Make sure it's absolute not relative, for /public files instead of S3\n parsed = Addressable::URI.parse(url)\n if parsed.relative?\n url = Addressable::URI.parse(main_app.root_url).join(parsed).to_s\n end\n\n url\n elsif work.is_oral_history?\n # if no representative, give em the generic OH thumb\n asset_url(\"scihist_oral_histories_thumb.jpg\")\n end\n end", "title": "" }, { "docid": "b24da6a28432f66e889d5005c844d8bf", "score": "0.5373561", "text": "def link_to_root_logo\n link_to(content_tag(:span, '', { class: 'navbarLogo', alt: 'Sky Logo' }), root_path, class: 'navbar-brand')\n end", "title": "" }, { "docid": "2e5be29232c5312cca31b6ea2c9cdb72", "score": "0.53719205", "text": "def icon; Settings::LOCATION_WINDOW_ICON; end", "title": "" }, { "docid": "b65370b2632648cadc8c926ebb2ba05d", "score": "0.5367136", "text": "def promo_image\n pm = Setting::get('Facebook promotional image path')\n if pm.blank?\n unless @restaurant.blank?\n pm = \"https://bingstreeteats.com#{@restaurant.img.url}\"\n end\n end\n pm\n end", "title": "" }, { "docid": "89e6c7dd1b78fcf0889ed027faf0604e", "score": "0.53665465", "text": "def images_path\n \tmain_app.send(Auth::OmniAuth::Path.create_or_index_path(Auth.configuration.image_class))\n end", "title": "" }, { "docid": "5e619c40e7ca31f1094e81603d6301c7", "score": "0.53648466", "text": "def get_linked_full_name_with_logo\n h.link_to( get_logo_for_season_type + ' ' + get_full_name, meeting_show_full_path(id: object.id), { 'data-toggle'=>'tooltip', 'title'=>I18n.t('meeting.show_results_tooltip') } )\n end", "title": "" }, { "docid": "e950d419334eb7b3829e93fde5b38108", "score": "0.53499615", "text": "def get_logo_for_season_type( season_type_code )\r\n if season_type_code =~ /CSI/i\r\n h.image_tag( 'logo_csi.png', size: '20x16' )\r\n elsif season_type_code =~ /FIN/i\r\n h.image_tag( 'logo_fin.png', size: '40x16' )\r\n elsif season_type_code =~ /UISP/i\r\n h.image_tag( 'logo_uisp.png', size: '40x16' )\r\n else\r\n season_type_code\r\n end\r\n end", "title": "" }, { "docid": "0475871383a401f9edec4e213a645c5a", "score": "0.5345481", "text": "def og_image(image)\n\t\tbase_image = \"http://i.imgur.com/DfYlA.png\"\n\t\tif image.empty?\n\t\t\tbase_image\n\t\telse\n\t\t\timage\n\t\tend\n\tend", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "f33587afbd3fdd398f61c465edabc1c3", "score": "0.0", "text": "def exopto_params\n params.require(:exopto).permit(:exam_id, :status, :optq01, :optq02, :optq03, :optq04, :optq05, :optq06, :optq07, :optq08, :optq09, :optq10, :optq11, :optq12, :optq13, :optq14, :optq15, :optq16)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69225836", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68929327", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67848456", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.674347", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6682223", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6636527", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.66291976", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66258276", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.65625846", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491194", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64526874", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.64001405", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.63810205", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63634825", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.633783", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6336759", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6325718", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.631947", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.63146484", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.63137317", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6306224", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.6301168", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.63000035", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.629581", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6280713", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6271388", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6266194", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.6256044", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62550515", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.62525266", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6234781", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62278074", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.6226693", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.6226605", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.6226114", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6200643", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.61913997", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.61835426", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6179986", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.61630195", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6160931", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6155551", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61542404", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.61356604", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.61342114", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.61188847", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61140966", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61107725", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.60860336", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60855556", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.608446", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6076753", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.60742563", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60677326", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60666215", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6065763", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60655254", "text": "def need_params\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6064794", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.6062697", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60562736", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.60491294", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.6046521", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041768", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.60346854", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030552", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6024842", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6021606", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6019679", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017253", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60145336", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60074294", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006753", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60048765", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.60009843", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6000161", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.599852", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.59947807", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5993962", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.5992739", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59911275", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59906775", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
d63f18e8be4fede234d926a8c0d5f68a
def tableView(tableView, didEndDisplayingCell:cell, forRowAtIndexPath:indexPath) callback(tableView, indexPath, :on_end_display, cell, true) end TODO: Implement footer/header display callbacks if someone requests it def tableView(tableView, willDisplayHeaderView:view, forSection:section) end def tableView(tableView, willDisplayFooterView:view, forSection:section) end def tableView(tableView, didEndDisplayingHeaderView:view, forSection:section) end def tableView(tableView, didEndDisplayingFooterView:view, forSection:section) end Variable height support
[ { "docid": "6436781a95d9791f235225de88b6da3b", "score": "0.5713901", "text": "def tableView(tableView, heightForRowAtIndexPath:indexPath)\n sections[indexPath.section][:cells][indexPath.row][:height] || default_cell_style[:height] || UITableViewAutomaticDimension\n end", "title": "" } ]
[ { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "8dd120af7299389bff60afa5fb42ec8b", "score": "0.63825583", "text": "def tableView(tableView, heightForFooterInSection:section)\n return 0.01\n end", "title": "" }, { "docid": "71a12b73007194e9ac0f06dc273f1d35", "score": "0.6111957", "text": "def tableView(tableView, willDisplayCell: cell, forRowAtIndexPath: index_path)\n puts \"display row:#{index_path.row}, section:#{index_path.section}\"\n end", "title": "" }, { "docid": "f3c81bf964a9a041aeaf99c2c599f803", "score": "0.607951", "text": "def tableView(tableView, heightForRowAtIndexPath: indexPath)\n\t\t100\n\tend", "title": "" }, { "docid": "df70ad09b02268a498830ff21f9baa50", "score": "0.60489416", "text": "def tableView(table_view, heightForRowAtIndexPath: index_path)\n return index_path.row == 0 ? 50.0 : 22.0\n end", "title": "" }, { "docid": "0820a0bb878f2326c507476ac1489672", "score": "0.59906524", "text": "def tableView(tableView, heightForRowAtIndexPath:indexPath)\n if tableView == self.centerView\n (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad ? 2 : 1) * case indexPath.section\n when 0\n 220\n when 1\n 160\n when 2\n 140\n else\n 140\n end\n else\n 44\n end\n end", "title": "" }, { "docid": "6a35503333132352377913248c6485bf", "score": "0.5879863", "text": "def tableView(table_view, heightForRowAtIndexPath: index_path)\n tasks_list_empty? ? tableView.frame.size.height : 75\n end", "title": "" }, { "docid": "e192646da29ac2e14e30d5f7473bace4", "score": "0.5807458", "text": "def tableView(tableView, heightForRowAtIndexPath:path)\n 30\n end", "title": "" }, { "docid": "e192646da29ac2e14e30d5f7473bace4", "score": "0.5807458", "text": "def tableView(tableView, heightForRowAtIndexPath:path)\n 30\n end", "title": "" }, { "docid": "81de156666b4b35d398e4de8f683f0a8", "score": "0.57536304", "text": "def tableView(table_view, heightForRowAtIndexPath: indexPath)\n table_view.rowHeight\n end", "title": "" }, { "docid": "1885d192685c3e4e90cafa45133d99c3", "score": "0.553103", "text": "def tableView(_, viewForFooterInSection: index)\n section = promotion_table_data.section(index)\n view = section[:footer_view]\n view = section[:footer_view].new if section[:footer_view].respond_to?(:new)\n view.on_load if view.respond_to?(:on_load)\n view.title = section[:footer] if view.respond_to?(:title=)\n view\n end", "title": "" }, { "docid": "683c13360f9bc5477c677985ef98035f", "score": "0.55205053", "text": "def tableView tableView,heightForRowAtIndexPath:indexPath\n \t85\n end", "title": "" }, { "docid": "8251ca1fb9fa090a394f127d72e27c0c", "score": "0.542851", "text": "def scrollViewDidEndDecelerating(scrollView)\n case scrollView\n when self.tableView\n self.subTablesScrollable = true\n tableView.reloadData\n else\n self.tableView.scrollEnabled = true\n end\n end", "title": "" }, { "docid": "e71411339d84107005eba8d66750d00e", "score": "0.5317855", "text": "def end_column; end", "title": "" }, { "docid": "85dea654f409a14dbe75fe82cc2f3751", "score": "0.5076853", "text": "def header_cells; end", "title": "" }, { "docid": "85dea654f409a14dbe75fe82cc2f3751", "score": "0.5076853", "text": "def header_cells; end", "title": "" }, { "docid": "1024bd03319917781e4fb2b61e1bda86", "score": "0.5006552", "text": "def individual_footer_table(table, stream)\n stream.puts <<FOOTER\n end\n\n def self.down\n drop_table \"#{table}\"\n end\nend\nFOOTER\n end", "title": "" }, { "docid": "eafffc4fd055e3785a78174ae7b4b987", "score": "0.49335396", "text": "def individual_footer(table, stream)\n stream.puts <<FOOTER\n end\n\n def self.down\n drop_table \"#{table}\"\n end\nend\nFOOTER\n end", "title": "" }, { "docid": "d2b300e1daa64b8143d62d64e62603b9", "score": "0.4923057", "text": "def display\n\t\tdisplay_headers\n\t\t@rows.each do |row|\n\t\t\tdisplay_row(row)\n\t\tend\n\tend", "title": "" }, { "docid": "a8c614dbefda2efc1122ba20cf232117", "score": "0.49199867", "text": "def statistics_table(datapoints=nil, options={})\n return if datapoints.blank?\n max_value = datapoints.collect{|dp| dp.value.to_f }.max\n total = BareDatapoint.new(:value => datapoints.inject(0.0){|sum, dp| sum + dp.value.to_f }, :muid_format => datapoints.first.muid_format, :muid_type => datapoints.first.muid_type)\n content = []\n show_more_info = options[:show_more_info]\n bg_pos_multiplier = show_more_info ? 7.1 : 7.7 #width of description cell is either 700px or 760px + 5px padding either side\n \n content << content_tag(:caption, options[:caption])\n # header row\n content << content_tag(:tr) do\n content_tag(:th, options[:description].to_s.titleize) + \n content_tag(:th, 'Value', :class => \"value\") +\n (show_more_info&&content_tag(:th, 'More info', :class => 'more_info')).to_s\n end \n # table body\n content << datapoints.collect do |datapoint|\n css_class = (datapoint == options[:selected] ? 'selected datapoint' : 'datapoint')\n bg_position = (100.0/max_value)*bg_pos_multiplier*datapoint.value.to_f\n content_tag :tr, :class => css_class do \n content_tag(:td, basic_link_for(datapoint.send(options[:description])), :class => 'description', :style => \"background-position:#{bg_position}px\") + \n content_tag(:td, formatted_datapoint_value(datapoint), :class => 'value') + \n (show_more_info&&content_tag(:td, link_to(image_tag('inspect.gif', :alt => 'See breakdown of this figure', :class => 'icon'), [datapoint.area, datapoint.subject].compact), :class => 'more_info')).to_s\n end\n end\n # optional total\n if options[:show_total]\n content << content_tag(:tr, :class => \"total\") do\n content_tag(:td, \"Total\", :class => \"description\") +\n content_tag(:td, formatted_datapoint_value(total), :class => \"value\") + \n (show_more_info&&content_tag(:td)).to_s\n end\n end\n \n content_tag(:table, :class => 'datapoints statistics') { content.flatten.compact } +\n content_tag(:div, \"<strong>Source</strong> #{breadcrumbs(options[:source])}\", :class => \"source attribution\")\n end", "title": "" }, { "docid": "2bd9f3129b0b0e39333d2b38db91a8e3", "score": "0.48978192", "text": "def __table_column_headings__(pdf, pos, max_width, height, descender, gap, size, y)\n mx = second_go = 0\n start_page = pdf.pageset.size\n\n # y is the position at which the top of the table should start, so the\n # base of the first text, is y-height-gap-descender, but ezText starts\n # by dropping height.\n\n # The return from this function is the total cell height, including\n # gaps, and y is adjusted to be the postion of the bottom line.\n tg = Transaction::Simple::Group.new(pdf, self)\n tg.start_transaction(:column_headings)\n\n ok = false\n y -= gap\n loop do\n break if ok\n @cols.each do |name, column|\n pdf.pointer = y\n\n if column.heading\n justification = column.heading.justification\n bold = column.heading.bold\n title = column.heading.title\n end\n\n justification ||= :left\n bold ||= @bold_headings\n title ||= column.name\n\n title = \"<b>#{title}</b>\" if bold\n\n pdf.text(title, :font_size => size, :absolute_left => pos[name],\n :absolute_right => (max_width[name] + pos[name]),\n :justification => justification)\n dy = y - pdf.y\n mx = dy if dy > mx\n end\n\n y -= (mx + gap) - descender # y = y - mx - gap + descender\n\n # If this has been moved to a new page, then abort the transaction;\n # move to a new page, and put it there. Do not check on the second\n # time around to avoid an infinite loop.\n if (pdf.pageset.size != start_page and not second_go)\n tg.rewind_transaction(:column_headings)\n\n pdf.start_new_page\n save_state\n y = @y - gap - descender\n ok = false\n second_go = true\n mx = 0\n else\n tg.commit_transaction(:column_headings)\n ok = true\n end\n end\n\n return [mx + gap * 2 - descender, y]\n rescue Exception => ex\n begin\n tg.abort_transaction(:column_headings) if tg.transaction_open?(:column_headings)\n rescue\n nil\n end\n raise ex\n end", "title": "" }, { "docid": "9eeca15940f5011105643ff9920243f3", "score": "0.48766622", "text": "def footer_height\n 55\n end", "title": "" }, { "docid": "7d623b630f61466d21d20baa0e35a659", "score": "0.4857647", "text": "def numberOfSectionsInTableView tableView\n @data.size\n end", "title": "" }, { "docid": "05f618dc4bf189dc04d52ccad647f784", "score": "0.48363575", "text": "def display_table_block(data, column_width=200)\n current_table = make_table data,\n column_widths: { 0 => column_width },\n cell_style: {\n :border_width => 0,\n :padding => [0, 0, 2, 0],\n :inline_format => true\n }\n\n real_margin_bottom = 30\n start_new_page if (cursor - current_table.height - real_margin_bottom).negative?\n current_table.draw\n end", "title": "" }, { "docid": "c51070b4d380b7a342a7639faf7bb32f", "score": "0.48263887", "text": "def show_table(content = nil, &block)\n content_tag :table, class:\"show-table\" do\n content || yield\n end\n end", "title": "" }, { "docid": "3fdffbde108f7ca6389d7f13fac45c52", "score": "0.47911495", "text": "def footer; end", "title": "" }, { "docid": "3fdffbde108f7ca6389d7f13fac45c52", "score": "0.47911495", "text": "def footer; end", "title": "" }, { "docid": "047655b53f43a35abd4770d7159f1fce", "score": "0.4786834", "text": "def Footer\n end", "title": "" }, { "docid": "658557d467339680681696979a66089d", "score": "0.47484666", "text": "def table_end\n @io << @templates[:table_end].result(binding)\n end", "title": "" }, { "docid": "e8d4c967da97587d3984a84962e5fb7d", "score": "0.47159123", "text": "def display_table\n tab_count = prep_headers_tab_count\n prep_header_border(tab_count)\n prep_rows\n end", "title": "" }, { "docid": "627040ba9882e28681e644f41b2ee4a3", "score": "0.47156498", "text": "def associate_data_cells_with_header_cells(table)\n # Interface method\n end", "title": "" }, { "docid": "0d3590e15ce30b50a63119de01b55eb0", "score": "0.47055835", "text": "def is_footer?\n @row.is_footer?\n end", "title": "" }, { "docid": "8759e0b0aa29db463ac940a57605a1ea", "score": "0.46935195", "text": "def display\r\n add_header_to_display\r\n add_horizontal_line_to_display\r\n\r\n @grid.each_with_index do |row, index|\r\n add_row_to_display(row, index)\r\n end\r\n end", "title": "" }, { "docid": "2c62efa4208074f6e448f5d9c4ca9f11", "score": "0.46912608", "text": "def display\n ### TODO: add configuration process here.\n @columns = []\n @records_per_page = 10\n\n yield self if block_given?\n\n #nil\n render\n end", "title": "" }, { "docid": "ea43a9839fced5ab32d742827fb0664d", "score": "0.46904862", "text": "def numberOfSectionsInTableView(table_view)\n 1\n end", "title": "" }, { "docid": "a196e8a00ecadfd2fa9bb81e45e4ce2e", "score": "0.46893543", "text": "def cellDidEndEditing(editing_cell)\n visible_cells = table_view.visibleCells\n \n visible_cells.each do |cell|\n UIView.animateWithDuration(0.3,\n animations: proc {\n cell.transform = CGAffineTransformIdentity\n cell.alpha = 1.0 if cell != editing_cell\n self.performSelector(\"reload_table_after_edit\", \n withObject: nil, \n afterDelay: 0.4) \n }\n )\n end\n \n return decision_deleted(editing_cell.decision) if editing_cell.decision.title == \"\"\n end", "title": "" }, { "docid": "821213e5c1a9a650c3be3c98526d8992", "score": "0.46769553", "text": "def footer\n end", "title": "" }, { "docid": "4080ad230750222e679428206f5dcc9f", "score": "0.4656232", "text": "def footer\n raise NotImplementedError, 'This must be implemented in a subclass.'\n end", "title": "" }, { "docid": "eb0857541c7bd148b9332da0b1a26d83", "score": "0.46458402", "text": "def render_body_rows(h)\n h.tbody {\n @rows.each do |r|\n h.tr {\n @column_order.each do |col|\n r[col.to_s] = @calculated[col].call(col, r) unless @calculated[col].nil?\n if @each_cell[col].nil?\n h.td(r[col.to_s])\n else\n h.td(@each_cell[col].call(col, r) || r[col.to_s])\n end\n end\n }\n end\n } \n end", "title": "" }, { "docid": "1909528826d8be0fb2a424066e9a72ed", "score": "0.4599915", "text": "def table\n @table ||= scroll_view(\n :layout => {:expand => [:width, :height]},\n :column_resize => :last_column_only,\n :vertical_scroller => true, :horizontal_scroller => false) do |scroll|\n mytable = table_view(\n :columns => [\n column(:id => :timestamp, :title => \"When\"), \n column(:id => :text, :title => \"What\")\n ]\n )\n # A single line is 17 pixels by default, these are 3 lines.\n mytable.setRowHeight(51)\n mytable.setUsesAlternatingRowBackgroundColors(true)\n mytable.setHeaderView(nil)\n scroll << mytable\n end\n end", "title": "" }, { "docid": "8e08074fadd4f5685b40b38279339d77", "score": "0.45904666", "text": "def define_footer(&block)\n @footer_block = block\n end", "title": "" }, { "docid": "6964c4d4c5279150400e951946828d66", "score": "0.45648503", "text": "def associate_all_data_cells_with_header_cells\n # Interface method\n end", "title": "" }, { "docid": "967933cae9766d50c980ee0cd8641ae5", "score": "0.45629478", "text": "def header_cells_count; end", "title": "" }, { "docid": "335969bb2ccf53621ddb19c001d6812c", "score": "0.45623052", "text": "def add_headers_end_handler\n if block_given?\n return @j_del.java_method(:addHeadersEndHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })\n end\n raise ArgumentError, \"Invalid arguments when calling add_headers_end_handler()\"\n end", "title": "" }, { "docid": "2900192e55bee5b1a78f199df6639dc2", "score": "0.45589462", "text": "def header_height\n 50\n end", "title": "" }, { "docid": "14b75db4c6493c597854ab9d4590ff48", "score": "0.4555257", "text": "def table_rows; end", "title": "" }, { "docid": "f64afab6742353fb4cd7b0ac986e8b9e", "score": "0.45489106", "text": "def height\n cells.height\n end", "title": "" }, { "docid": "aab61e5962b2f9ffe555b6f7d45753f1", "score": "0.4542073", "text": "def dynamic_height\n @dynamic_height ||= (dynamic_height_stty.nonzero? || dynamic_height_tput)\n end", "title": "" }, { "docid": "a428332d580d781c3483a9a0c5dd8dc5", "score": "0.45390427", "text": "def on_headers_complete(&block)\n @settings[:on_headers_complete] = Callback.new(&block)\n end", "title": "" }, { "docid": "caf6191a7462a9c3c96ce14821efe9cd", "score": "0.4538427", "text": "def print_foot\n return unless @print_footer\n ha = @_header_adjustment\n # ha takes into account whether there are headers or not\n footer = \"#{@current_index+1-ha} of #{@list.length-ha} \"\n @graphic.printstring( @row + @height -1 , @col+2, footer, @color_pair || $datacolor, @footer_attrib)\n @repaint_footer_required = false\n end", "title": "" }, { "docid": "b7da7b461df3fba6902168f3a6706e34", "score": "0.45366693", "text": "def hidden_table_info(g,start,_end,col,idx,ws)\n # iterate through all rows and columns\n pag_row = start # pag_row is the row number of web page table\n while (start <= _end)\n j = 1\n while (j <= col)\n case j\n when 1\n while g.param_descr(idx,pag_row,j).visible? ==false # skip the rows if invisible\n pag_row += 1\n end\n parameter = g.param_descr(idx,pag_row,j).text\n ws.Range(\"bc#{start+1}\")['Value'] = parameter\n when 2\n description = g.param_descr(idx,pag_row,j).text\n ws.Range(\"bd#{start+1}\")['Value'] = description\n end\n j += 1\n end\n start += 1\n pag_row += 1\n end\nend", "title": "" }, { "docid": "e35624fb40de32c5c825b676f0feef18", "score": "0.4535799", "text": "def render_footer( duration, example_count, failure_count, pending_count )\n\t\ttemplate = self.load_template( FOOTER_TEMPLATE )\n\t\treturn template.result( binding() )\n\tend", "title": "" }, { "docid": "57ef631c9e72ee6606a3b016a79d2015", "score": "0.4529717", "text": "def tableView tableView, numberOfRowsInSection:section\n @datasource.size\n end", "title": "" }, { "docid": "c7e5716c88a2cc0677938851952e93db", "score": "0.45284536", "text": "def row_heights\n@natural_row_heights ||=\nbegin\nheights_by_row = Hash.new(0)\ncells.each do |cell|\nnext if cell.is_a?(Cell::SpanDummy)\n# Split the height of row-spanned cells evenly by rows\nheight_per_row = cell.height.to_f / cell.rowspan\ncell.rowspan.times do |i|\nheights_by_row[cell.row + i] =\n[heights_by_row[cell.row + i], height_per_row].max\nend\nend\nheights_by_row.sort_by { |row, _| row }.map { |_, h| h }\nend\nend", "title": "" }, { "docid": "9fe02c64c43b2017777685daa768fbbe", "score": "0.4525053", "text": "def end_rows\n end", "title": "" }, { "docid": "551440c945a1bf6d9b9acaaa93cecf8a", "score": "0.45210445", "text": "def should_render_col_az?\n true\nend", "title": "" }, { "docid": "674b74077359dde2c61c9e8f88662410", "score": "0.45088145", "text": "def content_columns; end", "title": "" }, { "docid": "e213ccccc9b8102cd1f9c09143f6a9fd", "score": "0.45041177", "text": "def position_after(&block)\n t = Table.new\n yield(t)\n t.report\nend", "title": "" }, { "docid": "b081686ddd2d17d32ee026ae58d48615", "score": "0.44967285", "text": "def scroll_bottom\n @current_row = max_row\n\n noutrefresh\n end", "title": "" }, { "docid": "708802f1859d1bd63b19e3423b529fce", "score": "0.4496488", "text": "def content\n table do\n thead do\n tr do\n column_definitions.each do |column_def|\n th do\n if column_def.name.is_a?(Proc)\n self.instance_exec(column_def.id, &column_def.name)\n else\n text column_def.name\n end\n end\n end\n end\n end\n tbody do\n @row_objects.each_with_index do |object, index|\n row object, index\n end\n end\n end\n end", "title": "" }, { "docid": "2272ef5992cf6ef9555308a288fd0666", "score": "0.4495319", "text": "def pagination_display(items, item_name, columns, paginate_opts)\n # show a row before the column header row, which contains a \"wordy total\" of the displayed results\n #(note: we don't include the %head in this partial, because it needs to be put in the calling file)\n src = ''\n src << \"<tr>\"\n # try to go half_way (in the case of odd column totals, this will yeild the integer closest to half way)\n half_way = (columns.to_i)/2\n src << \"<th colspan = '#{half_way}'>\"\n src << (will_paginate(items, paginate_opts) || \"\")\n src << \"</th>\"\n src << \"<th colspan = '#{half_way + columns.to_i.remainder(2)}', style = 'text-align: right'>\"\n src << page_entries_info(items, :entry_name => item_name)\n src << \"</th>\"\n src << \"</tr>\"\n src\n end", "title": "" }, { "docid": "b90190015ab4e8f95e5d67affb365294", "score": "0.4494977", "text": "def collection_index_display(column_titles, items, item_name, row_partial, row_partial_local_opts = {}, pagination_opts = {})\n src = ''\n src << \"<table id=\\\"#{item_name.downcase.pluralize}\\\" class='data'>\"\n src << '<thead>'\n #src << pagination_display(items, item_name, column_titles.size, pagination_opts) unless items.nil?\n src << '<tr>'\n for title in column_titles do\n src << \"<th>#{title}</th>\"\n end\n src << '</tr>'\n src << '</thead>'\n if (!items.blank?) then\n src << '<tbody>'\n src << render(:partial => row_partial, :collection => items, :locals => row_partial_local_opts)\n src << '</tbody>'\n \n src << '<tfoot>'\n #src << pagination_display(items, item_name, column_titles.size, pagination_opts)\n src << '</tfoot>'\n end\n src << '</table>'\n src\n end", "title": "" }, { "docid": "3318595c02d30425fc76278ea23801e9", "score": "0.44794315", "text": "def numberOfSectionsInTableView(tableView)\n # Return the number of sections.\n 0\n end", "title": "" }, { "docid": "2aeb76f67ad3faed74a37b9f6c14d9c7", "score": "0.44720614", "text": "def row_heights\n # number of rows is the number of days in the event strips divided by 7\n num_cal_rows = options[:event_strips].first.size / 7\n # the row will be at least this big\n min_height = (options[:height] - options[:day_names_height]) / num_cal_rows\n row_heights = []\n num_event_rows = 0\n # for every day in the event strip...\n 1.upto(options[:event_strips].first.size+1) do |index|\n num_events = 0\n # get the largest event strip that has an event on this day\n options[:event_strips].each_with_index do |strip, strip_num|\n num_events = strip_num + 1 unless strip[index-1].blank?\n end\n # get the most event rows for this week\n num_event_rows = [num_event_rows, num_events].max\n # if we reached the end of the week, calculate this row's height\n if index % 7 == 0\n total_event_height = options[:event_height] + options[:event_margin]\n calc_row_height = (num_event_rows * total_event_height) + options[:day_nums_height] + options[:event_margin]\n row_height = [min_height, calc_row_height].max\n row_heights << row_height\n num_event_rows = 0\n end\n end\n row_heights\n end", "title": "" }, { "docid": "c11f780f122a527bf344779c84d2e5bc", "score": "0.4462621", "text": "def row_height(day)\n days_events = events_in_day(day)\n all_day_events = all_day_events_in_day(day)\n all_day_events_height = all_day_events.length * @event_height <= @default_day_height ? @default_day_height : all_day_events.length * @event_height\n height = days_events.length * @event_height <= @default_day_height ? @default_day_height : days_events.length * @event_height\n height = all_day_events_height if all_day_events_height > height\n return height\n end", "title": "" }, { "docid": "a67c1cdcf86bdc451080ffae031640e3", "score": "0.44565383", "text": "def table_header; end", "title": "" }, { "docid": "804581d4885338a38fc33bd539820735", "score": "0.4454267", "text": "def is_footer_shown\n return @is_footer_shown\n end", "title": "" }, { "docid": "56e373b7bd528081eeaeafeef460ec5d", "score": "0.44525754", "text": "def after_cell_render_styling(column_name,cell_value,record)\n '</font>'\n \n end", "title": "" }, { "docid": "56e373b7bd528081eeaeafeef460ec5d", "score": "0.44525754", "text": "def after_cell_render_styling(column_name,cell_value,record)\n '</font>'\n \n end", "title": "" }, { "docid": "56e373b7bd528081eeaeafeef460ec5d", "score": "0.44525754", "text": "def after_cell_render_styling(column_name,cell_value,record)\n '</font>'\n \n end", "title": "" }, { "docid": "42bd4f1514908ce50868dedbcc2a8def", "score": "0.44451156", "text": "def numberOfSectionsInTableView(tableView)\n # Return the number of sections.\n 1\n end", "title": "" }, { "docid": "7a0be18833d6b30bc41bf86103ff07db", "score": "0.4442554", "text": "def show_footer\n unless @cmd[:brief]\n duration = Time.now - @metrics[:start_time]\n print_log \"\\n\\nUpdates completed in \", show_time(duration).cyan\n print_metrics\n end\n print_log \" \\n\\n\"\n # close the log file now as we are done, just to be sure ...\n @log.close\n end", "title": "" }, { "docid": "d59c14c0d52d53d395e9121fa029bfc6", "score": "0.44410706", "text": "def controllerWillChangeContent(controller)\n self.tableView.beginUpdates\n end", "title": "" }, { "docid": "13072e7390af15fce48218b47d73882f", "score": "0.4437003", "text": "def after_render_field(record, column); end", "title": "" }, { "docid": "a830ef6e19deface6b4fc950bc53eb1d", "score": "0.44318557", "text": "def individual_footer_view(view, stream)\n stream.puts <<FOOTER\n end\n\n def self.down\n drop_view \"#{view}\"\n end\nend\nFOOTER\n end", "title": "" }, { "docid": "86334e7919f8da81dac83c002f5701c6", "score": "0.4431712", "text": "def no_subtotals_on_headers; end", "title": "" }, { "docid": "6368619d283e13af0ed7bb72c4e1c27e", "score": "0.44316572", "text": "def footer?\r\n\t\ttrue\r\n\tend", "title": "" }, { "docid": "6c97bca7fce33f49e4268c89c1cf16cb", "score": "0.44281045", "text": "def report_table(output, sort, options = {}, &block)\n output.puts\n\n top_categories = output.slice_results(sorted_by(sort))\n output.with_style(:top_line => true) do \n output.table(*statistics_header(:title => options[:title],:highlight => sort)) do |rows|\n top_categories.each { |(cat, info)| rows.push(statistics_row(cat)) }\n end\n end\n output.puts\n end", "title": "" }, { "docid": "319ec325b47fc79b466b5bba0530d1d2", "score": "0.4426458", "text": "def td_h(method_or_value = nil, options = {}, &block)\n count_cell\n value_tag_h(:td, method_or_value, options, &block)\n end", "title": "" }, { "docid": "6b9deea7d9a2dcac1128b1e31b35f903", "score": "0.44260338", "text": "def height_with_span\n aggregate_cell_values(:row, :height, :max)\n end", "title": "" }, { "docid": "e7048daaf8d235884186a018e84823b4", "score": "0.4421537", "text": "def header_height\n 0\n end", "title": "" }, { "docid": "a181907e17b8e9ae53deb065e1279fcd", "score": "0.44214338", "text": "def after_row(&block)\n @after_row_handler = block\n end", "title": "" }, { "docid": "7050e006096033c3dfab07d594f76296", "score": "0.44200093", "text": "def footer(*args)\n args.empty? ? @footer : @footer.cell(*args)\n end", "title": "" }, { "docid": "b4c6beeac530904de1776994c9ebb328", "score": "0.44175914", "text": "def ntfy_state_on_table_game_end\n end", "title": "" }, { "docid": "804b314ce4ac0c56b87f25a5e6930a2d", "score": "0.44175", "text": "def content\n table do\n thead do\n tr do\n column_definitions.each do |column_def|\n th column_def.options do\n if column_def.name.is_a?(Proc)\n self.instance_exec(column_def.id, &column_def.name)\n else\n text column_def.name\n end\n end\n end\n end\n end\n tbody do\n @collection.each_with_index do |object, index|\n row object, index\n end\n end\n end\n text! pagination(@collection)\n end", "title": "" }, { "docid": "d94380532da12660f35e67686e30b717", "score": "0.44162625", "text": "def cal_row_heights(options)\n # number of rows is the number of days in the event strips divided by 7\n num_cal_rows = options[:event_strips].first.size / 7\n # the row will be at least this big\n min_height = (options[:height] - options[:day_names_height]) / num_cal_rows\n row_heights = []\n num_event_rows = 0\n # for every day in the event strip...\n 1.upto(options[:event_strips].first.size+1) do |index|\n num_events = 0\n # get the largest event strip that has an event on this day\n options[:event_strips].each_with_index do |strip, strip_num|\n num_events = strip_num + 1 unless strip[index-1].blank?\n end\n # get the most event rows for this week\n num_event_rows = [num_event_rows, num_events].max\n # if we reached the end of the week, calculate this row's height\n if index % 7 == 0\n total_event_height = options[:event_height] + options[:event_margin]\n calc_row_height = (num_event_rows * total_event_height) + options[:day_nums_height] + options[:event_margin]\n row_height = [min_height, calc_row_height].max\n row_heights << row_height\n num_event_rows = 0\n end\n end\n row_heights\n end", "title": "" }, { "docid": "0bacb69bf95ad1f5a3c6070a291c9005", "score": "0.44119677", "text": "def render(output_builder)\n output_builder.document_header_started\n output_builder.document_header_finished\n header_rows.each do |header_row|\n output_builder.header_row(header_row, self.has_secondary_row_uris?)\n end\n table_rows.each do |table_row|\n output_builder.table_row(\n row_uri: table_row.uri,\n row_label: table_row.label,\n secondary_row_uri: table_row.secondary_uri,\n secondary_row_label: table_row.secondary_label,\n values: table_row.values\n )\n end\n end", "title": "" }, { "docid": "db513b05f91dd7b1082b3a3ae0aa3294", "score": "0.44109243", "text": "def after_build(cell)\n end", "title": "" }, { "docid": "fd88afb52401edf5586bb148d347e79e", "score": "0.44070375", "text": "def numberOfSectionsInTableView(tableView)\n result = 1\n end", "title": "" }, { "docid": "34dfc67ab8b3d887b2c1d1d83c56319c", "score": "0.44069242", "text": "def header_table_size; end", "title": "" } ]
503eece9b20f814b06b332a9e78b25ef
DELETE /errors/1 DELETE /errors/1.json
[ { "docid": "8268d044743f95ae4caf09a47b3d2c04", "score": "0.7434295", "text": "def destroy\n @error = Error.find(params[:id])\n @error.destroy\n\n respond_to do |format|\n format.html { redirect_to errors_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "47379be64dc6a4b2e4efd757e41368b9", "score": "0.7503068", "text": "def destroy\n @error = Error.find(params[:id])\n @error.destroy\n\n respond_to do |format|\n format.html { redirect_to errors_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2972a2a321b21eacce3e507359f0d9dc", "score": "0.7269927", "text": "def destroy\n @errors = Errors.find(params[:id])\n @errors.destroy\n\n respond_to do |format|\n format.html { redirect_to(errors_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "30f9915bc61b4025a49b9c30779d5177", "score": "0.7189428", "text": "def destroy\n @client_error.destroy\n respond_to do |format|\n format.html { redirect_to client_errors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "13a990f893cd89eb101233af0b9ca9e2", "score": "0.70392436", "text": "def delete\n ClientError.delete_similar(params[:id])\n\n fetch_errors\n render(:partial => \"errors\", :layout => false)\n end", "title": "" }, { "docid": "cba8fadb8d40b75321715fc0716aa503", "score": "0.7028465", "text": "def destroy\n # @error.destroy\n # respond_to do |format|\n # format.html { redirect_to errors_url, notice: 'Error was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n end", "title": "" }, { "docid": "5df0f46057bf97b13d699284b6fe55d4", "score": "0.6941631", "text": "def delete\n status 404\n nil\n end", "title": "" }, { "docid": "b972ab73e9d33f8a1039320c232965b1", "score": "0.6886943", "text": "def delete id\n wrap_errors { delete_one(id) }\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.68545806", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "baa2a0790c46ecf69aaa26e63d906852", "score": "0.6793492", "text": "def destroy\n @scerror = Scerror.find(params[:id])\n @scerror.destroy\n\n respond_to do |format|\n format.html { redirect_to scerrors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6590f617b71e84f910190401ab0eb319", "score": "0.6786345", "text": "def test_delete\n\n put_toto_doc\n\n doc = @s.get('errors', 'toto')\n\n r = @s.delete(doc)\n\n assert_equal nil, r\n\n doc = @s.get('errors', 'toto')\n\n assert_equal nil, doc\n end", "title": "" }, { "docid": "b77bbd2c41ed6de45f54bb2bcbb96988", "score": "0.6732345", "text": "def destroy\n @system_error = SystemError.find(params[:id])\n @system_error.destroy\n\n respond_to do |format|\n format.html { redirect_to system_errors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "899512a00d6ddda0b1cde0cb0194f563", "score": "0.6691003", "text": "def destroy\n @errorlog.destroy\n respond_to do |format|\n format.html { redirect_to errorlogs_url, notice: 'Errorlog was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d0e7bd8f3b1244bd3393a37702220772", "score": "0.666016", "text": "def destroy\n @error_message.destroy\n\n respond_to do |format|\n format.html { redirect_to error_messages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f2db394bdf44ae96fa550a1afae19c24", "score": "0.66463083", "text": "def destroy\n @otg_err.destroy\n respond_to do |format|\n format.html { redirect_to otg_errs_url, notice: 'Otg err was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8b31f5d64a81e21f7c22cc55436f9f43", "score": "0.6644197", "text": "def destroy\n @app_error.destroy\n respond_to do |format|\n format.html { redirect_to app_errors_url, notice: 'App error was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "48079a2a0e81f5b230cbcab10eeec67e", "score": "0.6623514", "text": "def del\n @status1 = Status1.find(params[:id])\n @status1.destroy\n\n respond_to do |format|\n format.html { redirect_to(status1s_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c3bf7dfd53c58f6d3631e7f79e6308e", "score": "0.65729284", "text": "def destroy\n @import_error = ImportError.find(params[:id])\n @import_error.destroy\n\n respond_to do |format|\n format.html { redirect_to import_errors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e7b5509a83e9ab2c47403e8daea79de0", "score": "0.65591794", "text": "def delete_errors\n @c.get_data(:delete_errors)\n end", "title": "" }, { "docid": "5ba913aabbd40778ab9965f4cc181366", "score": "0.6542139", "text": "def destroy\n @error_report = ErrorReport.find(params[:id])\n @error_report.destroy\n\n respond_to do |format|\n format.html { redirect_to error_reports_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b471892d6d93c6d9a6478d0306a2701b", "score": "0.6528796", "text": "def test_delete_unsuccessfully\n expected = 3001\n comment_id = \"wrong-id\"\n uri = URI.parse('http://localhost:3000/v1/posts/'+comment_id.to_s)\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Delete.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end", "title": "" }, { "docid": "99734a3032a40a60811266622785f8e7", "score": "0.6488335", "text": "def destroy\n @errquest.destroy\n respond_to do |format|\n format.html { redirect_to errquests_url, notice: 'Errquest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5781d8cfa6b907e4f6252d607e567318", "score": "0.64834505", "text": "def destroy\n @client_reported_error = ClientReportedError.find(params[:id])\n @client_reported_error.destroy\n\n respond_to do |format|\n format.html { redirect_to(client_reported_errors_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d2375b11675de0e152de07976b50e9c7", "score": "0.6473834", "text": "def delete_request(url, queries)\n results = @@client.delete url, queries\n results.to_json\nend", "title": "" }, { "docid": "678e148a2cfec22286118e81ae2a9c07", "score": "0.6472292", "text": "def destroy\n @req = Req.find(params[:id])\n @req.destroy\n\n respond_to do |format|\n format.html { redirect_to reqs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.64709985", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "33ae3fbaabb68170de9f95477c22d5d1", "score": "0.6458578", "text": "def delete_json(path)\n retries = 0\n begin\n return resource(path).delete()\n rescue => e\n if e.kind_of?(RestClient::Exception) and e.http_code == 503 and retries < RETRY_503_MAX\n # the G5K REST API sometimes fail with error 503. In that case we should just wait and retry\n puts(\"G5KRest: DELETE #{path} failed with error 503, retrying after #{RETRY_503_SLEEP} seconds\")\n retries += 1\n sleep RETRY_503_SLEEP\n retry\n end\n handle_exception(e)\n end\n end", "title": "" }, { "docid": "9106867cee9e8775ba817195d3bc2020", "score": "0.6454585", "text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end", "title": "" }, { "docid": "d3c373c42468e623306081d6adc131c6", "score": "0.6454366", "text": "def test_trying_to_delete_non_item\n r = delete \"/groceries\", name: \"not a thing\"\n assert_equal 404, r.status\n end", "title": "" }, { "docid": "76716298c48802c5d41d9a388307c782", "score": "0.64446324", "text": "def destroy\n @claim_error.destroy\n respond_to do |format|\n format.html { redirect_to claim_errors_url, notice: 'Claim error was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "681902b52cabe762dced640f449f38a6", "score": "0.6433175", "text": "def delete(path)\n req = Net::HTTP::Delete.new(@basic_path + path)\n res = @http.request(req)\n validate_status(res, ['204', '301'])\n end", "title": "" }, { "docid": "d8f1f2d88968b44a910269f924ab3f70", "score": "0.6431373", "text": "def destroy\n @machine_error.destroy\n respond_to do |format|\n format.html { redirect_to machine_errors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a3048c5445248a859f898bd8b3af2af6", "score": "0.6426162", "text": "def destroy\n @status = Status.find_by_id(params[:id])\n @status.delete\n\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n\n end", "title": "" }, { "docid": "ff2fd19311ee834084ed5682ac133457", "score": "0.6412222", "text": "def destroy\n @status.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4988625ad5e961de9a788b2ca8238053", "score": "0.6409222", "text": "def destroy\n @v1_request.destroy\n respond_to do |format|\n format.html { redirect_to v1_requests_url, notice: 'Request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "506137a58ad6413fb16d318992b0859b", "score": "0.64068633", "text": "def _delete_ path\n @resource[path].delete{|response, request, result| [result, response] }\n rescue Exception => e\n [ OpenStruct.new(:code => \"500\"), e.message =~ /getaddrinfo/ ? \"Unable to locate #{hostname}\" : e.message]\n end", "title": "" }, { "docid": "0be1724d2d3bbe84176a97ee0d7059cc", "score": "0.6400242", "text": "def destroy\n @failed_request.destroy\n respond_to do |format|\n format.html { redirect_to failed_requests_url, notice: 'Failed request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47a3c9c28e1fcd0fcae5ea58416b42bd", "score": "0.63957953", "text": "def delete(path)\n api :delete, path\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.6380922", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "15fd32ad53a8239590c11f2ce5cbbf77", "score": "0.6380066", "text": "def destroy\n @admin_client.delete( name )\n @admin_client.delete( name+\"_errors\" )\n end", "title": "" }, { "docid": "fab99cd71e7fcaf2de39a1efe1b13841", "score": "0.6379143", "text": "def destroy\n @rescue.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "df131b95688dc37b6fc4769eeb61ed09", "score": "0.6360353", "text": "def destroy\n render :json => {:code => \"400\", :status => \"Error\", :message => \"Action not supported.\" }\n end", "title": "" }, { "docid": "59888e9e931d026dfea2a824e8aefe6b", "score": "0.63554615", "text": "def destroy\n @status = Status.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n \nend", "title": "" }, { "docid": "5b00b5d767f4a4a5406ef9cf1deba95f", "score": "0.63537633", "text": "def destroy\n @err.update(get_delete_columns)\n respond_to do |format|\n format.html { redirect_to project_errs_path(@project), notice: 'Err was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "03dc5e0774ee3097c9e0e082c44a81a8", "score": "0.63314646", "text": "def destroy\n @lead_error.destroy\n respond_to do |format|\n format.html { redirect_to lead_errors_url, notice: \"Lead error was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "15c23a1d4b7dfb445210bc9e5e713e8b", "score": "0.63302743", "text": "def destroy\n @example1.destroy\n respond_to do |format|\n format.html { redirect_to example1s_url, notice: 'Example1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "29c8c6f61727e4022558ba8014f03c42", "score": "0.63267106", "text": "def destroy\n @fail = current_user.fails.find(params[:id])\n @fail.destroy\n\n respond_to do |format|\n format.html { redirect_to fails_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bd01fcddd805114c1933e338e0450d81", "score": "0.6326286", "text": "def destroy\n @faillog = Faillog.find(params[:id])\n @faillog.destroy\n\n respond_to do |format|\n format.html { redirect_to faillogs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "14b6f1f92ddb7b9e9b354c96543a678e", "score": "0.6325444", "text": "def destroy\n @single_action.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aab40e915a983b19a00c602b76a1ae9a", "score": "0.6315422", "text": "def delete\n RestClient.delete \"#{@uri}/api/requests/request/#{@data['requestId']||@data['id']}\"\n puts ' Deleted request: '.red + \"#{@data['requestId']||@data['id']}\".light_blue\n end", "title": "" }, { "docid": "6b59f5e4edb06c3b99ec7c358b23e15e", "score": "0.6305881", "text": "def destroy\n @status = Status.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\nend", "title": "" }, { "docid": "371af186f1ea95460d1aebb8990abc0c", "score": "0.62912124", "text": "def destroy\n @failure = Failure.find(params[:id])\n @failure.destroy\n\n respond_to do |format|\n format.html { redirect_to failures_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "371af186f1ea95460d1aebb8990abc0c", "score": "0.62912124", "text": "def destroy\n @failure = Failure.find(params[:id])\n @failure.destroy\n\n respond_to do |format|\n format.html { redirect_to failures_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9f6d505da6f520b687fca715532e4be0", "score": "0.6280309", "text": "def destroy\n @rest = Rest.find(params[:id])\n @rest.destroy\n\n respond_to do |format|\n format.html { redirect_to @rest.report, notice: t(\"activerecord.models.rest\") + t(\"message.destroy\") }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.6276484", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "a93139d773ff4eef2d4de23ed6786b9d", "score": "0.6274515", "text": "def destroy\n @violation.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6fd29b7b02e7cd48720ddd5cd51592cf", "score": "0.6273549", "text": "def restHttpDelete(id, format = @format, sessionId = @sessionId)\n sessionId.should_not be_nil\n\n urlHeader = makeUrlAndHeaders('delete',id,sessionId,format)\n #@res = RestClient.delete(urlHeader[:url], urlHeader[:headers]){|response, request, result| response }\n\n @res = RestClient::Request.execute(:method => :delete, :url => urlHeader[:url], :headers => urlHeader[:headers],\n :timeout => 500){|response, request, result| response }\n\n puts(@res.code,@res.body,@res.raw_headers) if $SLI_DEBUG\nend", "title": "" }, { "docid": "92ac56a794bfd973253be2e85349f8e9", "score": "0.62661666", "text": "def destroy\n @single.destroy\n respond_to do |format|\n format.html { redirect_to singles_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "57b799133d29316426c358002043baa2", "score": "0.62648326", "text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.6258224", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "067f266d0d91bcce2ee618d7dedc5b60", "score": "0.62509286", "text": "def destroy\n @error_report = ErrorReport.find(params[:id])\n @error_report.destroy\n\n respond_to do |format|\n format.html { redirect_to error_reports_url, notice: t(\"destroyed\", model: t(\"activerecord.models.#{controller_name.singularize.gsub(\" \", \"\")}\").downcase) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a92716c0641572728f2bcd2948f016b1", "score": "0.6249756", "text": "def destroy\n @status_check = StatusCheck.find(params[:id])\n @status_check.destroy\n\n respond_to do |format|\n format.html { redirect_to status_checks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1", "score": "0.6247903", "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": "496bc5d13c9fe057a50ac41628861cc2", "score": "0.62312627", "text": "def destroy\n begin \n todo = Todo.find(params[:id])\n todo.destroy\n result = { notice: 'Successfully deleted.' }\n status = 200\n rescue => ex\n result = { notice: 'The task cannot be deleted!!' }\n staus = 400\n end\n \n respond_to do |format|\n format.html { render :json => result, :status => status }\n format.json { render :json => result, :status => status }\n end\n end", "title": "" }, { "docid": "057f1c4cd1b80a1a17a7861d99eee5a6", "score": "0.6221319", "text": "def destroy\n # @spelling_error = current_user.sites.spelling_error.find(params[:id])\n # @spelling_error.destroy\n\n # respond_to do |format|\n # format.html { redirect_to spelling_errors_url }\n # format.json { head :no_content }\n # end\n end", "title": "" }, { "docid": "78a21318142d6fdcfc07ce50a8d62bd1", "score": "0.6212409", "text": "def destroy\n @step1 = Step1.find(params[:id])\n @step1.destroy\n\n respond_to do |format|\n format.html { redirect_to step1s_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.6212314", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "d46b6e5f0020a8723938854af13fb1e6", "score": "0.6208875", "text": "def destroy\n @httpstatus = Httpstatus.find(params[:id])\n @httpstatus.destroy\n\n respond_to do |format|\n format.html { redirect_to httpstatuses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "238677eb1c7e6c98d70d640739d1abda", "score": "0.62042165", "text": "def destroy\n @req.destroy\n respond_to do |format|\n format.html { redirect_to reqs_url, notice: 'Req was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "25c2fde20a2670114bf1370f5bdd9d4d", "score": "0.62016124", "text": "def test_delete_successfully\n expected = 200\n comment_id = 1\n uri = URI.parse('http://localhost:3000/v1/posts/'+comment_id.to_s)\n http = Net::HTTP.new(uri.host,uri.port)\n request = Net::HTTP::Delete.new(uri.path)\n request.set_form_data(data)\n response = http.request(request)\n actual = JSON.parse(response.body)\n result = assert_equal(expected,actual['meta']['code'])\n puts this_method_name + \" - \" + result.to_s\n end", "title": "" }, { "docid": "f1d45c5b0479019bde72c86fd9607931", "score": "0.6200362", "text": "def destroy\n\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3f0ef499d3659b8bcfb80d1df24a2827", "score": "0.6197312", "text": "def destroy\n @request1.destroy\n respond_to do |format|\n format.html { redirect_to request1s_url, notice: 'Request1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "841817d0089f0431b538b7c5b68195ae", "score": "0.6196047", "text": "def destroy\n @status = Status.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "841817d0089f0431b538b7c5b68195ae", "score": "0.6196047", "text": "def destroy\n @status = Status.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "841817d0089f0431b538b7c5b68195ae", "score": "0.6196047", "text": "def destroy\n @status = Status.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "841817d0089f0431b538b7c5b68195ae", "score": "0.6196047", "text": "def destroy\n @status = Status.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "841817d0089f0431b538b7c5b68195ae", "score": "0.6196047", "text": "def destroy\n @status = Status.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "841817d0089f0431b538b7c5b68195ae", "score": "0.6196047", "text": "def destroy\n @status = Status.find(params[:id])\n @status.destroy\n\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbf5d05334d25163840735e196fbdf8a", "score": "0.61957276", "text": "def destroy\n @question.destroy\n render json: { message: 'Question deleted successfully!' }, 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": "b5c01c5ba51eec015aeb408add0cfa74", "score": "0.619491", "text": "def destroy\n @recuest = Recuest.find(params[:id])\n @recuest.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "09f6303f18ce5612216026bdd448d644", "score": "0.61924636", "text": "def api_delete(path)\n api_request(Net::HTTP::Delete.new(path))\n end", "title": "" }, { "docid": "3ef781c26f445168a16f8e1e121dc043", "score": "0.61908525", "text": "def destroy\n @url_example.destroy\n respond_to do |format|\n format.html { redirect_to url_examples_url, notice: I18n.t('messages.destroy') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e527e1c38691f08b2b48304de1d91acf", "score": "0.6188608", "text": "def delete(e)\n response = @http.delete(e)\n msg response, Logger::DEBUG\n return response\n end", "title": "" }, { "docid": "718fd485f95a30a8c897e2403defb29f", "score": "0.6188334", "text": "def delete(path, params={}); make_request(:delete, host, port, path, params); end", "title": "" }, { "docid": "87e20dc906b523fdaa39bfea16283975", "score": "0.6185827", "text": "def delete\n begin\n # If everything goes well we can just return the results\n render status: 200, json: Chain.delete_chain(params)\n rescue Exceptions::TPException => e\n # One of the exceptions we anticipated - return the embedded status and message\n render status: e.code, json: { message: e.message }\n rescue => e\n # Something else went wrong, log it\n p e\n # Return a 500 error with generic message\n render status: 500, json: { message: \"Internal Server Error\" }\n end\n end", "title": "" }, { "docid": "0b07a9010287842e2d8ffcec7c166e42", "score": "0.61844164", "text": "def destroy\n @status.destroy\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0b07a9010287842e2d8ffcec7c166e42", "score": "0.61844164", "text": "def destroy\n @status.destroy\n respond_to do |format|\n format.html { redirect_to statuses_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "31e5a51b98ea334a62b796835e31f04b", "score": "0.6175682", "text": "def destroy\n response = RestClient.delete $api_service+\"/claim_issues/\"+params['id']\n redirect_to :action => \"index\"\n end", "title": "" }, { "docid": "fdfa5f023a5b91de7150a7231284ceb6", "score": "0.6172346", "text": "def delete(name)\n validate_path_elements(name)\n\n client.request(\n method: :delete,\n path: name,\n expected: 204\n )\n end", "title": "" }, { "docid": "6db99aaa4f6bcb0e893e5a0bb8fffa4c", "score": "0.6165294", "text": "def destroy\n @notfound.destroy\n respond_to do |format|\n format.html { redirect_to notfounds_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0387aa3c568d857184e97a214e580a14", "score": "0.61585", "text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end", "title": "" }, { "docid": "9c8ef0b4313fef9d26c4290371bc530d", "score": "0.6157555", "text": "def delete!\n client.delete(:path => base_path)\n nil\n end", "title": "" }, { "docid": "80217442803457cecd2cfb0337759e62", "score": "0.61541486", "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": "9d467889bde0290e69b47547ca9330c2", "score": "0.61495155", "text": "def destroy\n @failure.destroy\n respond_to do |format|\n format.html { redirect_to failures_url, notice: 'Failure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a49db061722fbfea9d603f70a67dc0ab", "score": "0.6148001", "text": "def test_delete_not_exist_metric\n not_exist_id = '10000'\n output = `curl -X DELETE http://localhost:8080/metrics/metrics/#{not_exist_id}`\n assert_match \"<html>\", output, \"TEST 5: delete not existing metric - FAILED\"\n end", "title": "" }, { "docid": "6d23fae51f1913672553af1d4d555ad6", "score": "0.61381406", "text": "def destroy\n @path.destroy\n respond_to do |format|\n format.html { redirect_to paths_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6d23fae51f1913672553af1d4d555ad6", "score": "0.61381406", "text": "def destroy\n @path.destroy\n respond_to do |format|\n format.html { redirect_to paths_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2fe3696eaf6e2f7a967637f6f79e34d2", "score": "0.61359644", "text": "def destroy\n render nothing: true, status: 404\n end", "title": "" }, { "docid": "010438c6de61514971be51393f2c08c6", "score": "0.6134176", "text": "def delete\n OK\n end", "title": "" }, { "docid": "a7b0fc49ebc54a4d64ffe475ba6d1714", "score": "0.61329466", "text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "a7b0fc49ebc54a4d64ffe475ba6d1714", "score": "0.61329466", "text": "def destroy\n @request = Request.find(params[:id])\n @request.destroy\n\n respond_to do |format|\n format.html { redirect_to requests_url }\n format.json { head :ok }\n end\n end", "title": "" } ]
d7a217c2d48987d418c60e5b7487c732
Find the nearest parent node from the specified index. If one or more types are provided, find the nearest node whose type is in the list.
[ { "docid": "ebe6a5c105b8faa8c2439ffe33d0c32d", "score": "0.83032465", "text": "def parent_node_from(index, *types)\r\n arr = tree_at(index)\r\n arr.each { |a|\r\n if a.kind_of?(AST::Node) and (types.empty? or types.include?(a.type))\r\n return a\r\n end\r\n }\r\n @node\r\n end", "title": "" } ]
[ { "docid": "0205424fd35542983d85e3ef00e7a14a", "score": "0.6496373", "text": "def parent\n parent_index = index - 1\n return nil if parent_index < 0\n parent = at parent_index\n parent = parent.parent if parent.uncommon?\n parent\n end", "title": "" }, { "docid": "5eac58e16fd8d10da14aafa9fcd64573", "score": "0.6367023", "text": "def parent_node_from(line, column, *types)\n arr = tree_at(line, column)\n arr.each { |a|\n if a.kind_of?(AST::Node) and (types.empty? or types.include?(a.type))\n return a\n end\n }\n nil\n end", "title": "" }, { "docid": "e7a502b404c2b329a19e7ebae9d6db44", "score": "0.63114476", "text": "def find_parent_index(node_index)\n return ((node_index-1)/2).floor\n end", "title": "" }, { "docid": "bbf7ff23bf96f047186080da28ade607", "score": "0.6121494", "text": "def parent_tree_locate(t, nid)\n\n return nil if t == nil\n\n _, i, d = nid.split('_', 3)\n\n return [ t, nil ] if i == nil\n return [ t, i.to_i ] if d == nil\n parent_tree_locate(t[1][i.to_i], [ i, d ].join('_'))\n end", "title": "" }, { "docid": "bb4d2a6403f41efbfe0636732af5a36f", "score": "0.6084123", "text": "def get_parent(idx) \n\n\t\tif idx == 0\n\t\t\treturn nil\n\t\tend\n\n\t\tparent = ((idx - 1)/2).round() # compute the parent index\n\n\t\treturn parent\n\tend", "title": "" }, { "docid": "6bd438b4bd735c75b131d6f53f3cd2a4", "score": "0.6083988", "text": "def find_parent(heap_array, index)\n parent_index = (index - 1) / 2\n return nil if parent_index < 0\n heap_array[parent_index]\n end", "title": "" }, { "docid": "562cc9d4a7a56414c6f0abe2812a0d69", "score": "0.6026282", "text": "def node_at(index)\r\n tree_at(index).first\r\n end", "title": "" }, { "docid": "562cc9d4a7a56414c6f0abe2812a0d69", "score": "0.6026282", "text": "def node_at(index)\r\n tree_at(index).first\r\n end", "title": "" }, { "docid": "f30bf53e6092225de61d4656792a533d", "score": "0.601226", "text": "def parent(index)\n\t\tif index.nil? || index.length == 1\n\t\t\traise ArgumentError, \"Root has no parent or index: #{index.nil? ? nil : index} was nil\"\n\t\tend\n\n\t\tindex[0...-1]\n\tend", "title": "" }, { "docid": "2aad6d724d124d22adb4dca8f1bd156a", "score": "0.59486526", "text": "def parent(index)\n d = depth(index)\n index - d\nend", "title": "" }, { "docid": "615975400421c2084ae58eef212d8645", "score": "0.58874655", "text": "def parent(child_index)\n parent_index = child_index/2\n return if max_possible_index < parent_index\n\n @collection[parent_index]\n end", "title": "" }, { "docid": "369608ed58853e04b3da7af3ecc79dbe", "score": "0.5870742", "text": "def get_parent(*ignore)\n if params[:parent_type].blank? || params[:parent_id].blank?\n find_parent(ignore)\n else\n klass = params[:parent_type].to_s.constantize\n klass.find(params[:parent_id])\n end\n end", "title": "" }, { "docid": "acecf0397cb84400b02aff93b97b8e0a", "score": "0.5759808", "text": "def find_using_index(index)\n node = @head.next\n position = 0\n until position == index - 1\n node = node.next\n position += 1\n end\n node\n end", "title": "" }, { "docid": "c26248021373f46908eee046b72bb634", "score": "0.5743629", "text": "def parent(type = '*')\r\n @node.at_xpath(\"./parent::#{type}\")\r\n end", "title": "" }, { "docid": "c26248021373f46908eee046b72bb634", "score": "0.5743629", "text": "def parent(type = '*')\r\n @node.at_xpath(\"./parent::#{type}\")\r\n end", "title": "" }, { "docid": "4288fcb92b88df9e29f08f504e9e07c4", "score": "0.56471264", "text": "def parent(index)\n return nil if index == 0\n (index-1) / @n\n end", "title": "" }, { "docid": "a1be89657850283d388fd49298a6f9f6", "score": "0.5646093", "text": "def tree_locate(t, nid)\n\n st, i = parent_tree_locate(t, nid)\n\n return nil if st == nil\n return st if i == nil\n st[1][i]\n end", "title": "" }, { "docid": "f9846e8f0dafb201d8608db65dcc0545", "score": "0.5634455", "text": "def root(index)\n if @find_array[index] == index\n return index\n else\n root(@find_array[index])\n end\n end", "title": "" }, { "docid": "0c5f4f97f0ba984376a951f22caf07f0", "score": "0.562747", "text": "def get_parent(args = {})\n if params[:parent_type].blank? || params[:parent_id].blank?\n find_parent(args)\n else\n klass = params[:parent_type].to_s.constantize\n if args.has_key?(:scope)\n klass.find(params[:parent_id], :scope => args[:scope])\n else\n klass.find(params[:parent_id])\n end\n end\n end", "title": "" }, { "docid": "df0865408b9b8cb8322a745b33967883", "score": "0.561917", "text": "def get_parent(args = {})\n if params[:parent_type].blank? || params[:parent_id].blank?\n find_parent(args)\n else\n klass = params[:parent_type].to_s.constantize\n if args.has_key?(:scope)\n klass.find(params[:parent_id], :scope => args[:scope])\n else\n klass.find(params[:parent_id])\n end\n end\n end", "title": "" }, { "docid": "47ca66790555806756444a3648ed6c1e", "score": "0.55791414", "text": "def item(index)\n # n-ary tree search\n discovered_item = @root\n\n loop do\n if discovered_item.id == index then\n found_item = discovered_item\n break\n end\n break if discovered_item.right_entry.nil?\n\n discovered_item = discovered_item.right_entry\n end\n found_item\n end", "title": "" }, { "docid": "86f62b56dd78591b36503d8aa66718c2", "score": "0.5545711", "text": "def parent_at(i)\n @parents.keys.sort.collect {|p| [p] * @parents[p].length }.flatten[i]\n end", "title": "" }, { "docid": "9c70dac67e93a87cedfcd8437eced288", "score": "0.55395794", "text": "def at(index)\r\n each_node_with_index { |node, i| return node if i == index }\r\n return nil\r\n end", "title": "" }, { "docid": "07609a17851b5b9352863c0cdc2de72e", "score": "0.5536416", "text": "def nearest\n @tree.leaves(parent) - [self]\n end", "title": "" }, { "docid": "24d81345ac24f20962e6241da08aad5e", "score": "0.5512119", "text": "def first_parent(type, exact=false)\n model = site.model_by_plural_name(type.to_s.downcase.pluralize)\n \n if exact\n match = parents.find {|record| record.model == model}\n else\n match = parents.find {|record| record.model.parents_and_mixins.include?(model)}\n end\n\n if block_given?\n yield match\n else\n match\n end\n end", "title": "" }, { "docid": "3fc660d4fd8f665b8311648361e3e247", "score": "0.5493817", "text": "def fast_parent\n check_path = self.dirname.gsub(/^.*?#{@app.config[:source]}\\/?/, '') + \"/#{@app.config[:index_file]}\"\n if !self.directory_index?\n parent = @app.sitemap.find_resource_by_path(check_path)\n return parent if parent.present?\n end\n\n parent = nil\n while parent.blank? && check_path.length > 0 && check_path != @app.config[:index_file]\n check_path = (check_path.gsub(/[a-zA-Z0-9\\-_\\.]{1,}?\\/?$/,'').gsub(/[a-zA-Z0-9\\-_\\.]*?\\/?$/,'') + '/').gsub('//', '/') + \"#{@app.config[:index_file]}\"\n next if check_path == self.path || check_path == @app.config[:index_file]\n parent = @app.sitemap.find_resource_by_path(check_path)\n end\n return parent\n end", "title": "" }, { "docid": "a5fea1acb599659f6a4c2aed07f92c81", "score": "0.5488431", "text": "def at(index)\n begin\n current_node = @head\n count = 1\n until count == index do\n if current_node.nil?\n return nil\n else\n current_node = current_node.next_node # move through list\n count += 1\n end\n end\n rescue NoMethodError => e\n current_node = nil\n end\n current_node\n end", "title": "" }, { "docid": "7133896a7e73b67394e2972c4f8703b7", "score": "0.54849815", "text": "def nearest_child\n c = nil\n children.each do |n|\n c=n if not c or distance(n)<distance(c)\n end\n c\n end", "title": "" }, { "docid": "8abc76aee5b3430a53e959d8ae066793", "score": "0.54736036", "text": "def find_parent(&block)\n\t\treturn nil unless parent\n\t\tparent.ascend do |node|\n\t\t\treturn node if block.call(node)\n\t\tend\n\t\tnil\n\tend", "title": "" }, { "docid": "fc748a7eb20051bc8927d6cdeed588ba", "score": "0.5429637", "text": "def fetch_node(index)\n # Return nil if there's no such index\n return nil if index > length - 1\n # Handle negative indexes\n return fetch_node(length + index) if index.negative?\n\n # Step through nodes until we reach the given index\n current_node = head\n until index.zero?\n index -= 1\n current_node = current_node.next\n end\n current_node\n end", "title": "" }, { "docid": "c4b385c3da6b8eafca6819898cb6c298", "score": "0.54264706", "text": "def node_at_index(index)\n return nil if out_of_range(index)\n current_node = @head\n index.times do\n current_node = current_node.next_node\n end\n current_node\n end", "title": "" }, { "docid": "cc436e8e55b4a2931f3caab0f6680d74", "score": "0.54204977", "text": "def nearest(view, skip=nil, &test)\n return nil if view.nil?\n\n if test.call(view)\n return view\n end\n\n children = MotionKit.children(view)\n siblings = MotionKit.siblings(view)\n parent = MotionKit.parent(view)\n\n found = nil\n\n # only check the children starting at the \"root\", e.g. nearest hasn't been\n # called recursively.\n if !skip || skip == parent\n children.each do |child|\n found = nearest(child, &test)\n break if found\n end\n return found if found\n end\n\n # siblings are closer than parents\n # passing 'parent' means only check self and children\n unless skip == parent\n siblings.each do |sibling|\n found = (sibling != view && nearest(sibling, parent, &test))\n break if found\n end\n end\n\n if found\n found\n elsif skip != parent\n nearest(parent, true, &test)\n end\n end", "title": "" }, { "docid": "3f9371cc8a4cfd2d9466f0a58c8aa097", "score": "0.54179054", "text": "def find_parent_idx_from_idx(idx)\n if idx < 2\n return 0\n end\n\n if idx % 2 == 0\n ((idx - 1.0) / 2).floor\n else\n ((idx - 2.0) / 2).ceil\n end\n end", "title": "" }, { "docid": "dac1c79e69d996ac24acb09d5c091ef3", "score": "0.54154104", "text": "def find_parent(*ignore)\n ignore.flatten!\n params.each do |name, value|\n if name =~ /(.+)_id$/\n if !ignore.include?($1)\n return $1.classify.constantize.find(value)\n end\n end\n end\n nil\n end", "title": "" }, { "docid": "a503a5388a21d4a666f088522f593a11", "score": "0.54149973", "text": "def get_node_by_index_from(node, i)\n if node\n lcount = node.left&.count || 0\n\n if i - lcount < 0\n get_node_by_index_from(node.left, i)\n elsif i - lcount < node.itself_count\n node\n else\n get_node_by_index_from(node.right, i - lcount - node.itself_count)\n end\n end\n end", "title": "" }, { "docid": "d274c81b0e085f3f08f955ba23a35278", "score": "0.5410051", "text": "def compute_child_node_index_from_parent\n # The node must have a type to check against parent structure\n if node_type\n parent_node.child_node_structure.index do |s|\n s['label'] == node_type['label']\n end\n # If not, return false -- we cannot use the parent structure\n else\n nil\n end\n end", "title": "" }, { "docid": "e82f798a20a3f4f660f82226fab4218c", "score": "0.54078305", "text": "def find(index)\n crawler_location = 0\n current_node = @head\n\n until crawler_location == index\n\n break if current_node == nil\n\n #puts \"#{current_node.to}: #{current_node.weight} at index #{crawler_location}\"\n current_node = current_node.next\n crawler_location += 1\n\n end\n\n current_node unless current_node == nil\n end", "title": "" }, { "docid": "6cd60d81140644df943f14ca983b998b", "score": "0.5401575", "text": "def getNode(type, index)\n nodes = @nodes[type]\n k = nodes.keys\n reqdNode = nodes[k[index-1]]\n return hashToNode(k[index-1], reqdNode)\n end", "title": "" }, { "docid": "c9abcbd53f67a0cbb797f9ff1661c746", "score": "0.539178", "text": "def find(index)\n current_node = @head\n i = 0\n until i == index\n current_node = current_node.next\n i += 1\n end\n current_node\n end", "title": "" }, { "docid": "c4bbd73a978543bd48cd92193eaf261d", "score": "0.53889114", "text": "def getNode(index)\n count = 0\n @nodes.each { |n|\n return n if count == index\n count = count + 1\n }\n return nil\n end", "title": "" }, { "docid": "aa09a7eba340d5765f4fdbe314af3e71", "score": "0.53698397", "text": "def find_parent(args = {})\n ignore = args.delete(:ignore) || []\n ignore.flatten!\n params.each do |name, value|\n if name =~ /(.+)_id$/\n if !ignore.include?($1)\n if args.has_key?(:scope)\n return $1.classify.constantize.find(value, :scope => args[:scope])\n else\n return $1.classify.constantize.find(value)\n end\n end\n end\n end\n nil\n end", "title": "" }, { "docid": "fab3e44f8fda900d1e1ad80745bfc96b", "score": "0.5362574", "text": "def parent\n @parent ||= self.parent_type.constantize.find_by_id(self.parent_id) unless self.parent_type.nil? || self.parent_id.nil?\n end", "title": "" }, { "docid": "7a5497547386155361268342c6bfcd50", "score": "0.5348568", "text": "def find_node(index)\n # start at the head\n counter = 0\n current_node = @head\n\n # crawl to the index position\n # outputs each node value for visibility\n while counter < index && (index > 0)\n current_node = current_node.next\n counter += 1\n end\n current_node\n end", "title": "" }, { "docid": "7a5497547386155361268342c6bfcd50", "score": "0.5348568", "text": "def find_node(index)\n # start at the head\n counter = 0\n current_node = @head\n\n # crawl to the index position\n # outputs each node value for visibility\n while counter < index && (index > 0)\n current_node = current_node.next\n counter += 1\n end\n current_node\n end", "title": "" }, { "docid": "cb5f5bdae4718b8aa8b864a3b9278bbe", "score": "0.5336314", "text": "def find_parent(args = {})\n ignore = args.delete(:ignore) || []\n ignore.flatten!\n params.each do |name, value|\n if name =~ /(.+)_id$/\n if !ignore.include?($1)\n if args.has_key?(:scope)\n return $1.classify.constantize.find(value, :scope => args[:scope])\n else\n return $1.classify.constantize.find(value)\n end\n end\n end\n end\n nil\n end", "title": "" }, { "docid": "9dfa222813c1ed2f0be2f9499dd6d4a2", "score": "0.5324582", "text": "def parent\n return if root?\n query = query_for_reference(reference[0, depth-1])\n query[:depth] = depth - 1\n scoped_find.first(query)\n end", "title": "" }, { "docid": "66a1f4ffc87cf446a6db29dd98d69614", "score": "0.5311689", "text": "def get_node(index)\n count = 0\n current_node = @head\n \n while !current_node.nil? do\n if count == index\n return current_node\n else\n count = count + 1\n current_node = current_node.next_node\n end\n end\n end", "title": "" }, { "docid": "df81ce304272373f927ecd42869855d8", "score": "0.53059113", "text": "def find( sets, index)\n p = sets[index].parent\n while (p != index)\n index = p\n p = sets[index].parent\n end\n return index\n end", "title": "" }, { "docid": "2fdcb01222dc822e427b4e956493ec72", "score": "0.52960426", "text": "def parent_which(children_type, &block)\n Sunspot::Util.ensure_child_documents_support\n @query.add_function(\n block_join_query(children_type, Query::BlockJoin::ParentWhich, &block)\n )\n end", "title": "" }, { "docid": "c1ff23314aa091bb42cb36ecd627ea72", "score": "0.5293902", "text": "def best_parent(step)\n if start_index <= step.start_index && end_index >= step.end_index\n # Return a matching child if there is one.\n children.each_value do |child|\n result = child.best_parent(step)\n return result if result\n end\n # No children match, so it's our child.\n return self\n end\n end", "title": "" }, { "docid": "381b71c86644a7802caffe7d2039dfe9", "score": "0.529251", "text": "def getNodeByIndex(index)\n count = 0\n @nodes.each { |n|\n return n if count == index\n count = count + 1\n }\n return nil\n end", "title": "" }, { "docid": "0723f65561b47da05c6d0f495d9ae42a", "score": "0.5279201", "text": "def get_node(index)\n count = 0\n current_node = @head\n \n while !current_node.nil? do\n if count == index\n return current_node\n else\n count = count + 1\n current_node = current_node.next_node\n end\n end\n end", "title": "" }, { "docid": "0723f65561b47da05c6d0f495d9ae42a", "score": "0.5279201", "text": "def get_node(index)\n count = 0\n current_node = @head\n \n while !current_node.nil? do\n if count == index\n return current_node\n else\n count = count + 1\n current_node = current_node.next_node\n end\n end\n end", "title": "" }, { "docid": "efa7db778c7aeedeb80556a985e1d989", "score": "0.52721775", "text": "def get_node(index)\n find_cursor(index)\n end", "title": "" }, { "docid": "bbedad5406e051394a3b47f9e7b012e8", "score": "0.52707905", "text": "def get_nearest_parent(item_identifier)\n if @config[:debug]\n puts item_identifier\n end\n\n if (item_identifier.nil? || (item_identifier.to_s.end_with?('README.md', 'index.md') && item_identifier.to_s.split('/').length == 3))\n return\n elsif item_identifier.to_s.end_with?('README.md', 'index.md')\n parent_dir = item_identifier.sub(/[^\\/]+$/, '').chop\n return get_nearest_parent(parent_dir)\n else\n parent_dir = item_identifier.sub(/[^\\/]+$/, '').chop\n parent = @items[parent_dir + '/README.*']\n alt_parent = @items[parent_dir + '/index.*']\n if (parent.nil? && alt_parent.nil?)\n get_nearest_parent(parent_dir)\n elsif alt_parent.nil?\n return parent\n else\n return alt_parent\n end\n end\n end", "title": "" }, { "docid": "a3c044c2e98499c936271d71322ac168", "score": "0.52608913", "text": "def find_spot(parent_node, value)\n case value <=> parent_node.value\n when 1\n if parent_node.right.nil?\n parent_node.right = BSTNode.new(value)\n parent_node.right.parent = parent_node\n else\n find_spot(parent_node.right, value)\n end\n when -1, 0\n if parent_node.left.nil?\n parent_node.left = BSTNode.new(value)\n parent_node.left.parent = parent_node\n else\n find_spot(parent_node.left, value)\n end\n end\n end", "title": "" }, { "docid": "ec3b0f85ae4af83d86d579c1c40448ef", "score": "0.52383184", "text": "def loc(index)\n find.with_index { |node, i| i == index }\n end", "title": "" }, { "docid": "cab2493655bd94ca5add514365cf3019", "score": "0.52148443", "text": "def find(parent, val)\n if parent.nil? || (comparator(val, parent) == 0)\n return parent\n elsif comparator(val, parent) == -1\n # node is less than parent\n\tfind(parent.left, val)\n elsif comparator(val, parent) == 1\n # node is more than parent\n\tfind(parent.right, val)\n end\n end", "title": "" }, { "docid": "a5a2849a358c93c19ba9f692a7f3a4b2", "score": "0.52005893", "text": "def parent\n self.class.find(indexed_path.last) if path.present?\n end", "title": "" }, { "docid": "0568133499cb6b9e340dca31902d8e88", "score": "0.5196861", "text": "def find_parent\r\n parent_node = @parent_node\r\n while parent = parent_node\r\n break unless(@layouts.include? parent.item)\r\n parent_node = parent_node.parent\r\n end\r\n parent ? parent.item : nil\r\n end", "title": "" }, { "docid": "7bc5b5825a89d1a4b2e32b8801f01df7", "score": "0.5196262", "text": "def at(index)\n current_index = 0\n current_node = @head\n\n until current_index.equal? index\n current_node = current_node.next_node unless current_node.nil?\n current_index += 1\n end\n\n current_node.nil? ? nil : current_node\n end", "title": "" }, { "docid": "375375d7c23d01fe07bff106a8aa3880", "score": "0.51960254", "text": "def _find_common_parent_reverse entry_points, total_travel_time, conveyors, entry_point, target\n conveyor = conveyors.select {|cs| cs.node2 == entry_point}.first\n if conveyor\n if conveyor.node1 == target\n puts \"!!found common parent: #{target}\"\n return target\n else\n puts \"..keep looking: #{conveyor.node1}, #{target}\"\n _find_common_parent_reverse entry_points, total_travel_time, conveyors, conveyor.node1, target\n end\n end\n end", "title": "" }, { "docid": "0f2ad3356a1f75d960a2b0606c88ea6d", "score": "0.51903003", "text": "def find_parent(value)\n find = lambda do |node|\n if value < node.value\n # go left\n if node.left.color.nil?\n # no more to go\n [node, :LEFT]\n else\n find.call node.left\n end\n elsif value > node.value\n # go right\n if node.right.color.nil?\n # no more to go\n [node, :RIGHT]\n else\n find.call node.right\n end\n end\n end\n\n find.call @root\n end", "title": "" }, { "docid": "eb67158394785e9c3e6f3d68fee69ee8", "score": "0.51869524", "text": "def find_node_at(index)\n current_index = 0\n node = @head\n until current_index == index\n puts current_index\n node = node.next\n current_index += 1\n end\n puts \"returning node at #{current_index}\"\n node\n end", "title": "" }, { "docid": "eb67158394785e9c3e6f3d68fee69ee8", "score": "0.51869524", "text": "def find_node_at(index)\n current_index = 0\n node = @head\n until current_index == index\n puts current_index\n node = node.next\n current_index += 1\n end\n puts \"returning node at #{current_index}\"\n node\n end", "title": "" }, { "docid": "6730426a9dc79664bb51c658899800e3", "score": "0.51774734", "text": "def parent\n \tget_nodes(parent_node_rid.size, parent_node_rid, subject, dimesion, category).find_by(rid: parent_node_rid)\n end", "title": "" }, { "docid": "af99333744daf02e3fe17e337f23f36c", "score": "0.51572263", "text": "def find_parent(children_list, child)\n \n children_list.each do |parent_candidate|\n parent_path = parent_candidate[acts_as_materialized_path_options[:path_column]]\n \n if(parent_candidate.level == child.level - 1 && child[acts_as_materialized_path_options[:path_column]].to_s.match(\"^\"+parent_path+\"\\\\.\"))\n return parent_candidate;\n elsif(child[acts_as_materialized_path_options[:path_column]].to_s.match(\"^\"+parent_path+\"\\\\.\"))\n return find_parent(parent_candidate.children_list, child)\n end\n end\n return nil;\n end", "title": "" }, { "docid": "e672ba70eaff53164d96b14dd8506839", "score": "0.51536447", "text": "def get_node_at(index)\n if index < @size and index >= 0\n node = @head\n index.times do\n node = node.next_node\n end\n node\n else\n nil\n end\n end", "title": "" }, { "docid": "b3e45c4f91ebf92286f7e0bfc515ce61", "score": "0.5152117", "text": "def parent\n return nil if parent_id == 0 || parent_id.blank?\n begin\n return RequestType.find(parent_id)\n rescue ActiveRecord::RecordNotFound\n return nil\n end\n end", "title": "" }, { "docid": "1ba5d4bd83634eb6d37f76afa2830d7a", "score": "0.51506764", "text": "def parent_index\n (@index-1) / 2 if @index > 0\n end", "title": "" }, { "docid": "21a66fb6cd905d95b452d567ddeb7166", "score": "0.5150478", "text": "def get_type_path_node(parent_node, type_path)\n # SystemUtils.debug_output( :get_type_path_node, type_path.to_s)\n # STDERR.puts('get_type_path NODE' + type_path.to_s)\n type_path = type_path[:type_path] if type_path.is_a?(Hash)\n if type_path.is_a?(String)\n unless type_path.include?('/')\n parent_node[type_path]\n else\n sub_paths = type_path.split('/')\n sub_node = parent_node\n sub_paths.each do |sub_path|\n sub_node = sub_node[sub_path]\n break if sub_node.nil?\n # return log_error_mesg('Subnode not found for ' + type_path + 'under node ', parent_node) if sub_node.nil?\n end\n sub_node\n end\n end\n end", "title": "" }, { "docid": "4faca710de2ef9e1570519d56e6baec1", "score": "0.5143434", "text": "def index\n return nil unless parent\n NodeList.new(`Array.prototype.slice.call(#{@el}.parentNode.children)`).index self\n end", "title": "" }, { "docid": "1f86914f697997146c3caa970c0908e5", "score": "0.5134249", "text": "def polynom_parent(name, options = {})\n parent_name = if name =~ /\\s+×\\s+/\n name.split.first\n else\n name.split[0..-2].join(' ')\n end\n return nil if parent_name.blank?\n parent = if options[:ancestor]\n Taxon.where( options[:ancestor].descendant_conditions ).\n where( \"name = ?\", parent_name ).\n where( \"rank IN (?)\", [Taxon::GENUS, Taxon::SPECIES] ).first\n else\n Taxon.where( \"rank IN (?)\", [Taxon::GENUS, Taxon::SPECIES] ).\n where( name: parent_name ).first\n end\n if parent.blank? && options[:external_parent]\n names = find(parent_name)\n if match = names.detect{|n| n.taxon.name == parent_name}\n match.save\n parent = match.taxon\n parent.graft_silently\n end\n end\n parent\n end", "title": "" }, { "docid": "2809fce9d3195780243e1c54446c20ea", "score": "0.5114318", "text": "def find_parent path=nil, parms=nil\n path ||= request.path\n parms ||= params\n if parms[:parent].nil? #or params[:parent_id].nil?\n paths=path.split(\"/\")\n paths.pop if %w{new edit show create update delete index}.include? paths[-1]\n return nil if (paths.size < 3) #or (paths.size==4 and %w{edit new}.include?( parms[:action]))\n recognise_path paths.join(\"/\")\n else\n parms[:parent].classify.constantize.find(parms[:parent_id])\n end\n end", "title": "" }, { "docid": "930506c700965b6a198244978830f683", "score": "0.5109579", "text": "def format_node_with_parent_index\n proc do |node|\n next(node.to_s) if node.parent.nil?\n parent_index = heads[node.parent.item].nodes.to_a.index(node.parent)\n \"#{node}->#{node.parent.item}[#{parent_index}]\"\n end\n end", "title": "" }, { "docid": "47ba948c0bac68f83ab76caecd389f22", "score": "0.5096809", "text": "def at(index)\n\t\tif self.size > index\n\t\t\tif @head.next_node\n\t\t\t\tnode = @head.next_node\n\t\t\t\ti = 0\n\t\t\t\tuntil i == index\n\t\t\t\t\tnode = node.next_node\n\t\t\t\t\ti += 1\n\t\t\t\tend\n\t\t\t\treturn node\n\t\t\telse\n\t\t\t\treturn nil\n\t\t\tend\n\t\tend\n\t\treturn nil\n\tend", "title": "" }, { "docid": "eae9aec81bb5a8e6b5b8607baf6c23ce", "score": "0.50948143", "text": "def nearest_sibling(direction)\r\n case direction\r\n when :left\r\n self.class.find(:first, :conditions=>[\"lft < :lft and parent_id #{self.parent_id.nil? ? 'is' : '='} :parent_id\", {:lft=>self.lft, :parent_id=>self.parent_id}], :order=>'lft desc')\r\n when :right\r\n self.class.find(:first, :conditions=>[\"lft > :lft and parent_id #{self.parent_id.nil? ? 'is' : '='} :parent_id\", {:lft=>self.lft, :parent_id=>self.parent_id}], :order=>'lft')\r\n else\r\n raise ArgumentError\r\n end\r\n end", "title": "" }, { "docid": "d00dfee86c3a04dcef826f711bf85e91", "score": "0.5094737", "text": "def find_node(index)\n \tcounter = 0\n \tcurrent_node = @head\n\n \twhile counter < index\n \t\t#p \"Traversing list, now at index #{counter}\"\n \t\tcurrent_node = current_node.next\n \t\tcounter += 1\n \tend\n\n \t#puts \"Found node at index #{index} with definition: #{current_node.definition}\"\n \tcurrent_node\n \tend", "title": "" }, { "docid": "f7ec506eb200aa8a8ecb7b7dbd737051", "score": "0.5094007", "text": "def find(index)\n # if negative index, compensate to yield correct value\n index = self.length - (-index) if index < 0\n if index > 0\n if index > self.length - 1\n return nil\n else\n count = 1\n node = @head.next_node\n until count == index ##REMOVE REMOVE REMOVE\n node = node.next_node\n count += 1\n end\n node\n end\n elsif index == 0\n return @head\n else\n #WRITE EXCEPTION FOR INCORRECT INPUT\n end\n end", "title": "" }, { "docid": "9aa797b9c2e0fd65bad4ea53ec64ab72", "score": "0.5092958", "text": "def prepare_parent\n\t\tcase params[:parent_type]\n\t\twhen \"NewsArticle\"\n\t\t\tpolymorph_parent NewsArticle.find(params[:parent_id])\n\t\tend\t\t\n\tend", "title": "" }, { "docid": "94b7f5437f66dea462c81fd9f7b2dc21", "score": "0.50877684", "text": "def go_to_parent\n unless @parent.nil?\n @parent\n else\n puts \"Error: No parent for this node!\"\n end\n end", "title": "" }, { "docid": "9889f07ab3f7eaf9bc695fead4a6bac4", "score": "0.50827825", "text": "def at(index)\n node = @head\n index.times do\n break if node.nil?\n node = node.next_node\n end\n node\n end", "title": "" }, { "docid": "44f84c49ddd72bc7ccdc0fa352d83ef3", "score": "0.50820816", "text": "def find_outer_element_of_type type, current_ast_path, inclusive = false\n # puts \"find_outer_element_of_type -- #{caller[0..2].join \" : \"} -- #{type.inspect}\"\n curr_path = current_ast_path.dup\n first = true\n type = [type] unless type.is_a? Array\n found = loop {\n sexp = @crawler.find_path_sexp curr_path\n break true if (type.include? sexptype(sexp)) and ((inclusive and first) or (!first))\n curr_path.slice! -1\n break false if curr_path.empty?\n first = false\n }\n (found ? curr_path : nil)\n end", "title": "" }, { "docid": "5cb64fa0eb0b9178aa9b8227064a4eb6", "score": "0.5079198", "text": "def at(index)\n if index >= size\n return nil\n else\n i = 1\n temp_node = @head\n while i != index do\n temp_node = temp_node.get_next_node\n i += 1\n end\n return temp_node\n end\n end", "title": "" }, { "docid": "705ecd99ba3690c9b7137d76abb7edce", "score": "0.5073601", "text": "def left_child(index)\n tree[2 * index]\n end", "title": "" }, { "docid": "68a4a0ae75f0957fd2181246281d82a7", "score": "0.50611925", "text": "def lowest_rank_coordinated_taxon\n list = [self] + list_of_coordinated_names\n if list.count == 1\n self\n else\n parents = list.collect{|i| i.parent.id}\n list.detect{|t| !parents.include?(t.id)}\n end\n end", "title": "" }, { "docid": "547bd79f21c15e42c8e1bea3de04dc16", "score": "0.5055661", "text": "def find(parent, vertex)\n # find root and make root as parent of i (path compression)\n if parent[vertex-1][0] != vertex\n parent[vertex-1][0] = find(parent, parent[vertex-1][0])\n else\n \treturn vertex\n end\nend", "title": "" }, { "docid": "8cfdc04de3c99a423c1df70313b20ba6", "score": "0.5050221", "text": "def find(value, find_parent = false)\n node_to_find = Node.new(data: value)\n parent = self.root\n node = Node.new(data: nil)\n\n until parent.leaf?\n\n node = parent.left if node_to_find < parent\n node = parent.right if node_to_find > parent\n return parent if node_to_find == parent\n\n return find_parent ? parent : node if node == node_to_find \n\n parent = node\n end\n end", "title": "" }, { "docid": "42b30d7a4c1f7784182d3dc226d17509", "score": "0.5047604", "text": "def get_kth_ancestor(node, k)\n return node if k == 0\n return -1 if node.nil? || k <= 0 || node == 0 && k > 0\n @parents.dig(node, k) ? @parents[node][k] : get_kth_ancestor(@parents[node].last, k + 1 - @parents[node].size)\n rescue => e\n -1\n end", "title": "" }, { "docid": "98b80a97a875cf3256401e828e2e21f0", "score": "0.50474507", "text": "def parent\n parts = path.split(\"/\")\n if path.include?(app.index_file)\n parts.pop\n end\n \n return nil if parts.length < 1\n \n parts.pop\n parts.push(app.index_file)\n \n parent_path = \"/\" + parts.join(\"/\")\n \n if store.exists?(parent_path)\n store.page(parent_path)\n else\n nil\n end\n end", "title": "" }, { "docid": "84c11ebdb926e6f518619017611b0287", "score": "0.5039558", "text": "def at(index)\n node = @head\n index.times do\n node = node.next_node\n end\n return node unless node == nil\n\n 'no node exists at this index'\n end", "title": "" }, { "docid": "4930aefe8058342fa0abc3d2f65ec3a9", "score": "0.50387305", "text": "def index\n parent ? parent.index_of(self) : 0\n end", "title": "" }, { "docid": "15b3f1c0b418ebcc320e54fcaf60dfb9", "score": "0.5037084", "text": "def find(*types)\n children.find { |c| types.include?(c.try(:type)) }\n end", "title": "" }, { "docid": "15b3f1c0b418ebcc320e54fcaf60dfb9", "score": "0.5037084", "text": "def find(*types)\n children.find { |c| types.include?(c.try(:type)) }\n end", "title": "" }, { "docid": "e382852c7736adabd58add0179d86cd6", "score": "0.5027171", "text": "def find_parent\n q = Queue.new\n discovered = Set.new\n discovered << root\n q.push root\n\n while !q.empty?\n t = q.pop\n return t unless t.children.size == 2\n t.each_child do |u|\n if !discovered.include?(u)\n discovered << u\n q.push u\n end\n end\n end\n end", "title": "" }, { "docid": "faa77b6dab0c71772c384796d8e4ba54", "score": "0.50231725", "text": "def find_child_or_create_parent_category(category_names, category_name, index)\n child_category = Category.find_or_create_by(name: category_name)\n\n unless child_category_present?(category_names, child_category, index)\n return child_category\n end\n\n parent_category = Category.find_or_create_by(name: category_names[index + 1])\n child_category.update(parent: parent_category)\n child_category\n end", "title": "" }, { "docid": "906e32cb3aab11a286f9c1f8b082f8d2", "score": "0.50165725", "text": "def find(node_index)\n root_index = node_index\n while root_index != tracking_array[root_index]\n root_index = tracking_array[root_index] # finding top-element/ the root of the group\n end\n\n compress_path(node_index, root_index)\n\n root_index\n end", "title": "" }, { "docid": "680c13e3b6f649bddae37c020e39044f", "score": "0.5016079", "text": "def at(index)\n cur = @head\n index.times { cur = cur.next_node }\n return cur unless cur.nil?\n end", "title": "" }, { "docid": "f642298a1b0f983dff34a01abafce2c8", "score": "0.5014325", "text": "def find(type)\n nodes = find_all(type)\n nodes.first\n end", "title": "" } ]
69834046e38f557c4fdc29d8f33cd031
author:Noha hesham Description: finds the project by its id then destroys it params: none success: a pop up appears and makes sure the user wants to delete the project by choosing ok the project is successfully deleted failure: project is not deleted
[ { "docid": "5b5b7c854166091b0c24ed6c6c93dc3c", "score": "0.7633386", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "deaecc62b871f25fda515558e50fe5f1", "score": "0.8473078", "text": "def destroy\n bad_request(\"Missing project key\") unless params[:id].present?\n \n project = Project.by_key(params[:id])\n bad_request(\"Not valid project\") unless project\n access_denied unless is_admin?(project)\n bad_request(\"Not valid project\") unless java_facade.getResourceTypeBooleanProperty(project.qualifier, 'deletable')\n \n Project.delete_resource_tree(project)\n render_success(\"Project deleted\")\n end", "title": "" }, { "docid": "fdfef9ceea6d421b10ea710013fba6be", "score": "0.8442788", "text": "def destroy\n #find the project from the Model: Project where id of the project is equal id in the params and assign it to variable “@project”\n @project = Project.where(id: params[:id]).first\n #if @project is blank\n if @project.blank?\n #redirect to project list page with an error message\n return redirect_to projects_path, error: \"Specified project is not found\"\n end\n #call the \"destroy\" method with object, if object is successfully deleted\n if @project.destroy\n #redirect to project list page with an success message\n return redirect_to projects_path, notice: \"project destroyed successfully\"\n else\n #redirect to project list page with an error message\n return redirect_to projects_path, notice: \"project could not destroyed\"\n end\n end", "title": "" }, { "docid": "acae97f828f2c2967632d58de6669411", "score": "0.8243364", "text": "def destroy\n @project = Project.find(params[:id])\n # If project has describe then cannot delete!\n @describe = Describe.find_by_project_id(params[:id])\n if @describe\n render :json => {:failure => true}\n else\n @project.destroy\n render :json => {:success => true}\n end\n \n end", "title": "" }, { "docid": "cb63694fe9dedbbd24a523ab67ab516f", "score": "0.82372606", "text": "def destroy\n begin\n Project.find(params[:id]).destroy\n render response: { :message => \"Project deleted.\"}\n\trescue\n\t render response: { :message => \"Project with specified id not found!\"}\n\tend\n end", "title": "" }, { "docid": "e3c874fa045dc2b225d53c7b54259bd3", "score": "0.8107608", "text": "def destroy\n # find the project by id\n Project.destroy(params[:id])\n\n render json: {\n message: 'ok'\n }\n\n\n # deleted_project.destroy\n\n # redirect_back(fallback_location: root_path)\n end", "title": "" }, { "docid": "d47674b6e73b0a09e4294ed92b047dcc", "score": "0.80794305", "text": "def destroy\n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.destroy\n format.html { redirect_to projects_url,\n notice: (crud_notice('destroyed', @project) + \"#{undo_link(@project)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { redirect_to projects_url, alert: \"#{@project.errors[:base].to_s}\".gsub('[\"', '').gsub('\"]', '') }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac6a7b709c570963bea2242151ca7a19", "score": "0.8073245", "text": "def destroy\n Project.find(params[:id]).destroy\n flash[:success] = \"A record has been successfully deleted\"\n redirect_to projects_path\n \n end", "title": "" }, { "docid": "6cd2e4d2fa787f3200c178cdb583387a", "score": "0.8063649", "text": "def destroy\n @project = Project.find(params[:id])\n temp_projects = Project.where(owner_id: current_developer.id)\n if !temp_projects.include?(@project)\n flash[:error] = t(:developer_cant_see_project)\n redirect_to projects_path\n return\n end\n @project.destroy\n respond_to do |format|\n format.html { redirect_to action: \"index\",controller: \"projects\"}\n format.json { head :no_content }\n flash[:success] = t(:project_delete)\n end\n end", "title": "" }, { "docid": "493eccbb97e04a553b7fe4a2f5c5406e", "score": "0.80427706", "text": "def delete project_id\n service.delete_project project_id\n true\n end", "title": "" }, { "docid": "ab4ef2e8c5c266cf46b967e7bb9d2149", "score": "0.80052876", "text": "def destroy\n @project = Project.find(params[:id]) if params[:id].present?\n @project.destroy\n log_admin(\"AdminLog: Projekt destroyed\")\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "55b4e0be80f6f94f30bd2aed5c92d5aa", "score": "0.80050606", "text": "def destroy\n @project = Project.where(\"id = ?\",params[:id])\n @project.destroy\n redirect_to(projects_url)\n end", "title": "" }, { "docid": "94cb073d4b6ffa4cd773d934ff3fbf6b", "score": "0.80003", "text": "def destroy\n @project = Project.find(params[:id])\n @title = \"Delete \" + project.name\n if self.current_project == @project\n @project.destroy\n self.current_project = self.current_user.projects.last\n\n if self.current_project.nil?\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n format.mobile { redirect_to root_url }\n end\n else\n respond_to do |format|\n format.html { redirect_to projects_path }\n format.json { head :no_content }\n format.mobile { redirect_to projects_path }\n end\n end\n else\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_path }\n format.json { head :no_content }\n format.mobile { redirect_to projects_path }\n end\n end\n end", "title": "" }, { "docid": "ce6bfd7c863e5114638bf3cd738d5a80", "score": "0.80001366", "text": "def destroy\n\t\t@project = Project.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tunless @project.nil?\n\t\t\t\tif @project.destroy\n\t\t\t\t\tflash[:notice] = t(:ctrl_object_deleted, :typeobj => t(:ctrl_project), :ident => @project.ident)\n\t\t\t\t\tformat.html { redirect_to(projects_url) }\n\t\t\t\t\tformat.xml { head :ok }\n\t\t\t\telse\n\t\t\t\t\tflash[:error] = t(:ctrl_object_not_deleted, :typeobj => t(:ctrl_project), :ident => @project.ident)\n\t\t\t\t\tindex_\n\t\t\t\t\tformat.html { render :action => \"index\" }\n\t\t\t\t\tformat.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tflash[:error] = t(:ctrl_object_not_deleted, :typeobj => t(:ctrl_project), :ident => @project.ident)\n\t\t\tend\n\t\tend\n\n\tend", "title": "" }, { "docid": "58e58634c2b8547f5776f1b8a924a0a3", "score": "0.79938626", "text": "def delete\n service.delete_project project_id\n reload!\n true\n end", "title": "" }, { "docid": "c990588e89cea955f41f63b1de1daec4", "score": "0.7984664", "text": "def destroy\n standard_destroy(Project, params[:id])\n end", "title": "" }, { "docid": "598ffac332153f43b5903755b6b5d895", "score": "0.7978911", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy if @project.state == \"pending\"\n \n #respond_to do |format|\n # format.html { redirect_to projects_url }\n # format.xml { head :ok }\n #end\n render :update do |page|\n page.remove \"item_#{params[:id]}\"\n #page.replace_html 'flash_notice', \"project was deleted\"\n end\n end", "title": "" }, { "docid": "1034447c105f4b492a522a0488dafc3b", "score": "0.7960549", "text": "def destroy\n if @project.try_to_destroy\n @project.destroy\n else\n flash[:alert] = \"The project cannot be delete because it has phase attached.\"\n end\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ba6a2d569e967057fa4053902399ceb7", "score": "0.7933214", "text": "def destroy\n @project.destroy\n flash[:success] = \"项目删除成功!\"\n respond_to do |format|\n format.html { redirect_to projects_url }\n end\n end", "title": "" }, { "docid": "7e4b60629e3e704205c5a4a7377b83a0", "score": "0.7925934", "text": "def destroy\n if @project.destroy\n flash[:notice] = \"Successfully deleted project!\"\n redirect_to projects_path\n else\n flash[:alert] = \"Error updating project!\"\n end\n end", "title": "" }, { "docid": "22f624ca095350d42ec6cd862e562bdd", "score": "0.7925829", "text": "def destroy\n @project = Project.find(params[:id])\n if @project.destroy\n flash[:notice] = \"Trabalho apagado\"\t\t\t\n else\t\t\t\t\t\t\t\t\t\t\t\n flash[:error] = \"Houve um problema ao apagar o trabalho\"\t\n end\t\t\t\t\t\t\t\t\t\t\t\t\n redirect_to projects_path\n end", "title": "" }, { "docid": "806d6e1e49f37dd88b20d61304b481e8", "score": "0.7913308", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n flash.now[:success] = \"Project was sucessfully deleted.\"\n redirect_to projects_url\n end", "title": "" }, { "docid": "335026ae15589da2fb8a9f6b444c29ef", "score": "0.7909652", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "c407d8ba511ceba3f37385fec60bdccf", "score": "0.7896168", "text": "def destroy\n @project = self.current_uzytkownik.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(uzytkownik_projects_path(self.current_uzytkownik)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fa8e493c4806616aad00a5c22581f2c3", "score": "0.7894311", "text": "def destroy\n @title = \"Уничтожение проекта\"\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ae49a6e24b9bdae48e76ef0b765d33f", "score": "0.7862583", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n redirect_to projects_path\n end", "title": "" }, { "docid": "c730619a7991376885d16cbd7b34af50", "score": "0.78555477", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n render json: {success: \"ok\"}\n\n end", "title": "" }, { "docid": "10ca27b92fad24afb197886dca6c4e5e", "score": "0.7855186", "text": "def destroy\n name = @project.name\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"项目 #{name} 删除成功\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "30e8870ecd4342094ff22d6d14ea2318", "score": "0.7846124", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n redirect_to projects_path, :notice => 'Project deleted'\n end", "title": "" }, { "docid": "d7bcf9766578c04a7b7ba98d7aba437f", "score": "0.7841805", "text": "def destroy\n @project = Project.find(params[:id])\n project_name = @project.name\n begin\n respond_to do |format|\n if developer?\n @project.destroy\n flash[:notice] = \"Project #{project_name} was successfully updated.\"\n format.html { redirect_to current_iterations_url }\n format.xml { head :ok }\n else\n format.xml { render :xml => XML_ERRORS[:not_authorized] }\n end\n end\n rescue ActiveRecord::StatementInvalid \n respond_to do |format| \n format.xml { render :xml => XML_ERRORS[:foreign_key_problem] } \n end\n end\n end", "title": "" }, { "docid": "d5eb643b926d9f071cfb2e2e5042e13d", "score": "0.78324604", "text": "def destroy\n @project.destroy\n redirect_to root_url, flash: {success: t('controllers.projects.destroy.deleted', name: @project.name)}\n end", "title": "" }, { "docid": "0ddadbf7371f33397ab54ac2892d6972", "score": "0.7832292", "text": "def destroy_project id\n delete_request \"projects/#{id}\"\n true\n end", "title": "" }, { "docid": "f75e39df6ff0f92d23c70305b2b81a37", "score": "0.7799656", "text": "def destroy\n @project.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "a8df7f1375a12faae4a8b0f412d27cb8", "score": "0.7793395", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n redirect_to user_path(current_user), notice: 'Project was successfully deleted.'\n end", "title": "" }, { "docid": "51d190eb06a617d7a1661c4e9d4cecfc", "score": "0.77895015", "text": "def destroy\n \n\t\n\t\n\t@project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => 'index' }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "29b69608158145fe5164f01701b9b99f", "score": "0.77783847", "text": "def destroy\n @project.destroy\n render json: { message: I18n.t('project.destroy.success') }, status: 200\n end", "title": "" }, { "docid": "b0b1cb32172d892650667b4d5537f43b", "score": "0.7774084", "text": "def destroy\n @project = Project.find(params[:id])\n name = @project.name\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url, notice: \"#{name}が削除されました.\" }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f48f45a6e21f95b4623233eae3e78be9", "score": "0.7759439", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n flash[:notice] = \"This project was successfully deleted!\"\n redirect_to root_path\n end", "title": "" }, { "docid": "f12ecbf35f6070918d6f11ec90300150", "score": "0.77542955", "text": "def destroy\n @project = Project.find(params[:id])\n project_name = @project.name\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url(:notice => \"You have successfully deleted the #{project_name} project. I hope you meant to do that.\") }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fefc2f3f36cacc8e43b3c967204fd594", "score": "0.7751697", "text": "def destroy\n @project = Project.find(params[:id])\n project_clean() #needs @project\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "eadbd01494fbad9880ba875d8bd2c42a", "score": "0.77466774", "text": "def destroy\n\t @project = Project.find(params[:id])\n\t @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0e2b95593ca09e8b30baded7cd706a68", "score": "0.7744072", "text": "def destroy\n @project = Project.find_by_id(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4526eeb1272388b4599beb60a7a37a8d", "score": "0.774081", "text": "def destroy\n project = Project.editable(current_user).find_by_name(params[:id])\n raise \"There is no such project.\" unless project.present?\n\n priority = project.jobs.unfinished.count\n delayed_job = Delayed::Job.enqueue DestroyProjectJob.new(project), priority: priority, queue: :general\n Job.create({name:'Destroy project', project_id:project.id, delayed_job_id:delayed_job.id})\n\n respond_to do |format|\n format.html {redirect_to projects_path, status: :see_other, notice: \"The project, #{@project.name}, is being deleted.\"}\n format.json {head :no_content }\n end\n end", "title": "" }, { "docid": "896688ec873d905f8b83a2b113a96912", "score": "0.7730319", "text": "def delete\n # check if the project belongs to the organization before deleting it\n project = Project.find(params[:delete_project_id], session[:organization][:cartodb_id])\n if project # yay! the project belongs to the org, so we can delete it\n Project.destroy(params[:delete_project_id])\n else\n flash[:notice] = \"You can't delete the selected project\"\n end\n redirect_to '/dashboard'\n end", "title": "" }, { "docid": "f6335f86deaec0e015ed24541209fb17", "score": "0.7729327", "text": "def destroy\n @project = Project.find(params[:id])\n redirect_to(@project, alert: \"Only owner '#{@project.owner.email}' can delete this project\") and return if @project.owner != current_user\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b84dafe8a21fbeede16bb95bf32aabc9", "score": "0.77289176", "text": "def destroy\n @project.destroy\n head :no_content\n end", "title": "" }, { "docid": "810d5f06fe6c1b8b16746b93730a17d8", "score": "0.7721448", "text": "def delete\n @project = Project.where(:scope => params[:scope], :name => params[:name]).first\n can_access? @project\n session[:selected_project] = nil if @project.id == session[:selected_project].to_i\n flash[:notice] = \"Project was successfuly deleted!\"\n redirect_to ({:action => 'list'}) if @project.delete\n flash[:notice] = \"Something went wrong\"\n end", "title": "" }, { "docid": "41b0689d5c93eb3ea86fd046faa4ddb2", "score": "0.77176297", "text": "def destroy\n\t\tproject = Project.editable(current_user).find_by_name(params[:id])\n\t\traise \"There is no such project.\" unless project.present?\n\n\t\tDestroyProjectJob.perform_later(project)\n\n\t\trespond_to do |format|\n\t\t\tformat.html {redirect_to projects_path, status: :see_other, notice: \"The project, #{@project.name}, will be deleted soon.\"}\n\t\t\tformat.json {head :no_content }\n\t\tend\n\tend", "title": "" }, { "docid": "afaaf60371f864342866bcbdaa74d82c", "score": "0.7714835", "text": "def destroy\n session[:project_id] = nil if session[:project_id]==@project.id\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6f176f7257b3778c02195fa43b63efdd", "score": "0.77137387", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n \n redirect_to dashboard_path\n end", "title": "" }, { "docid": "aaf8a4fc9fbdf145cc03d158c75d91d4", "score": "0.7710285", "text": "def project_delete\n delete_project.click\n confirm = modal.find('a[data-method=delete]')\n confirm.click\n end", "title": "" }, { "docid": "c37e4a4266e7ee395418131a470f1923", "score": "0.7706698", "text": "def delete\n @project = Project.find(:first, :conditions => {:id => params[:project_id], :user_id => @current_user.id})\n\n # Delete collection from eXist database\n adapter = ExistAdapter.new(@project.id)\n adapter.delete_collection(@project.id)\n\n # Delete folder in directory\n project_path = Rails.root.join(\"public\", \"projects\", @project.id.to_s).to_s\n\n FileUtils.rm_rf(project_path) if File.exists?(project_path)\n\n # Delete project from database\n @project.delete()\n\n render :status => 200, :text => \"Project deleted\"\n end", "title": "" }, { "docid": "ec3e899ec51602c7b9e4d5728520a95c", "score": "0.76984596", "text": "def destroy\n\t\tproject = Project.editable(current_user).find_by_name(params[:id])\n\t\traise \"There is no such project.\" unless project.present?\n\n\t\tsproject = Project.find_by_name('system-maintenance')\n\n\t\tpriority = project.jobs.unfinished.count\n\t\tdelayed_job = Delayed::Job.enqueue DestroyProjectJob.new(project), priority: priority, queue: :general\n\t\tJob.create({name:'Destroy project', project_id:sproject.id, delayed_job_id:delayed_job.id})\n\n\t\trespond_to do |format|\n\t\t\tformat.html {redirect_to projects_path, status: :see_other, notice: \"The project, #{@project.name}, will be deleted soon.\"}\n\t\t\tformat.json {head :no_content }\n\t\tend\n\tend", "title": "" }, { "docid": "cedcf22bfd863fc7759dd352d905477a", "score": "0.7698342", "text": "def destroy\n program = @project.program\n if is_admin?(program)\n flash[:notice] = \"Project record for #{@project.project_title} was successfully deleted\"\n @project.destroy\n else\n admin = is_admin?(program) ? 'Yes' : 'No'\n flash[:alert] = \"Project record for #{@project.project_title} could not be deleted; admin: #{admin};\"\n end\n respond_to do |format|\n project = program.projects.first\n project = Project.first if project.blank?\n set_current_project(project)\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a6e3abc3d29ade98b74d1220fa0c9331", "score": "0.76935476", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n redirect_to '/administrator/projects'\n end", "title": "" }, { "docid": "966ce26fc9ab8c602a4080ab3790e68e", "score": "0.7690123", "text": "def delete_project\n Task.where(:project_id => params['project_id']).each do |delete|\n delete.destroy\n end\n Project.find(params['project_id']).destroy\n render json: {success: true}\n end", "title": "" }, { "docid": "6d26e2aa881f83800589d73eb250b1b6", "score": "0.76827514", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "56fedee2b7d54ac5af4e11e779b71a2c", "score": "0.76813287", "text": "def destroy\n if @project.destroy\n redirect_to group_projects_path(@group.permalink), notice: \"Project has been deleted.\"\n else\n redirect_to group_project_path(@group.permalink, @project.id), alert: \"There was en error deleting this project. Try again.\"\n end\n end", "title": "" }, { "docid": "82c766f24b4d4e88819754eaf9ed0810", "score": "0.76774615", "text": "def destroy\n ClassProject.find(params[:id]).delete\n redirect_to class_projects_path\n end", "title": "" }, { "docid": "c3b43673b601246bcf48612263f323e1", "score": "0.7674085", "text": "def destroy\n @project = current_person.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8b865855704020915b18557cb9f51fa0", "score": "0.7667212", "text": "def destroy\n @admin_project = Admin::Project.find(params[:id])\n @admin_project.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f2ada34f4687bc860c111c3b3e648fa8", "score": "0.7664108", "text": "def destroy\n # TODO: verify access\n # TODO: delete associated tasks \n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/project_thanks\", :notice => 'Project was successfully deleted.') }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "3524d3ce61f5e05e88947732354575f3", "score": "0.76635", "text": "def destroy\n @project = Project.find(params[:id])\n UserProjectRole.remove_roles_for_project(@project.id)\n @project.destroy\n \n\t clearSessionProjectInfo()\n\t\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2f47e8c7e096e9032251a9eada4b1176", "score": "0.7661727", "text": "def destroy\n @project = Project.find(params[:id])\n if Entry.find_by_project_id(params[:id]) == nil\n @project.destroy\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n else\n flash[:error] = 'This project has active entries!'\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab0ee2a49192e46e7a10ba7bdbdf077d", "score": "0.76617026", "text": "def destroy\n @project.destroy\n\n end", "title": "" }, { "docid": "46f0c12e2f06a700f0bcc43e53725598", "score": "0.76565075", "text": "def destroy\n @project = current_user.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f94f5218c36466b26c738798976810cb", "score": "0.7655633", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to mrta_projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ce10449f9ce0fd62fdc6ce11492b8372", "score": "0.7655132", "text": "def destroy\n @root = \"projects\"\n \n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb7c17df3c8fdcadb56015602ee33d91", "score": "0.76538736", "text": "def destroy\n @new_project = NewProject.find(params[:id])\n @new_project.destroy\n\n respond_to do |format|\n format.html { redirect_to new_projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "81fbf88e586f585e291788dd2676e698", "score": "0.7653524", "text": "def destroy\n @project = Project.find(params[:id])\n \n # prevent unauthorized access\n unless full_access_project_member?(@project) \n redirect_to(@project) \n return\n end\n \n @project.remove_from_index\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n end\n end", "title": "" }, { "docid": "db1223a6f4bd73c20ce5919738ce84c2", "score": "0.765125", "text": "def destroy\n \t@project = Project.find(params[:id])\n \t@project.destroy\n\n \trespond_to do |format|\n \t\tformat.html { redirect_to projects_url }\n \t\tformat.json { head :no_content }\n \tend\n end", "title": "" }, { "docid": "dc6a55ecb1fd2a191cdeee120195e009", "score": "0.7649979", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n flash[:notice] = 'Project was successfully deleted.'\n format.html { redirect_to projects_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e03477019476d8aad0e14a091703cb7f", "score": "0.7646742", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n flash[:notice] = 'Project was successfully destroyed.'\n respond_with(@project)\n end", "title": "" }, { "docid": "5d97adfef9755200b02524c17ec0b050", "score": "0.76401615", "text": "def destroy\n if @project.zabbix_server_id.present?\n with_zabbix\n end\n go = -> { redirect_to(projects_path(client_id: @project.client_id)) }\n begin\n @project.destroy!\n rescue StandardError => ex\n flash[:alert] = ex.message\n ws_send(t('projects.msg.deleted', name: ex.message), false)\n return 404\n end\n\n ws_send(t('projects.msg.deleted', name: @project.name), true)\n go.call and return\n end", "title": "" }, { "docid": "09b672934b0867e86d17a79bf0581b35", "score": "0.7638474", "text": "def destroy\n @project = Project.find( params[:id] )\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e7627d7f1b5ecc8cee443585a1ded3fe", "score": "0.7635761", "text": "def destroy\n authorize(@project)\n\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url,\n notice: t('removed') + \" #{ make_undo_link }\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3d0fd938b23e86dfc9fb07e9d6a8c24f", "score": "0.7634709", "text": "def destroy\n\n @project = Project.find(params[:id])\n authorize! :manage, @project\n\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.76304954", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.76304954", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.76304954", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.76304954", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.76304954", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.76304954", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.76304954", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.76304954", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "972e5129619f20952c5c2d58e404dbcd", "score": "0.7625931", "text": "def destroy\n @project = Project.find(params[:id])\n check_authorization @project\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "013d0ae09425200f8edab4ec9ff6d4a5", "score": "0.76254123", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fa863f5f5bee9fbc7e14e9145195e695", "score": "0.76226664", "text": "def destroy\n authorize(@project)\n\n @project.destroy\n respond_to do |format|\n format.html {\n redirect_to projects_url,\n notice: t(\"removed\") + \" #{make_undo_link}\"\n }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1dc746ef37040103748cf80ba71a478e", "score": "0.7618755", "text": "def delete()\n\n client.delete(\"/projects/#{id}\") && true\n end", "title": "" }, { "docid": "82b686c9ca5c7c3498cbc91b90a7b48c", "score": "0.76161927", "text": "def destroy\n @capital_project.destroy\n flash[:success]='Capital Project was successfully deleted.'\n\n redirect_to capital_projects_url\n end", "title": "" }, { "docid": "cd18a2f4694d79db8d60436702b552ad", "score": "0.76127803", "text": "def destroy\n @project = Project.find(params[:project_id])\n @project.destroy\n redirect_to project_path(params[:course_id])\n end", "title": "" }, { "docid": "442c6ab1d29dfcab5ec7d3232b7c8788", "score": "0.7611807", "text": "def destroy\n if is_admin?(@project.program)\n flash[:notice] = \"Project record for #{@project.project_title} was successfully deleted\"\n @project.destroy \n else\n flash[:errors] = \"Project record for #{@project.project_title} could not be deleted; admin: #{is_admin? ? 'Yes' : 'No'};\"\n end\n respond_to do |format|\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8dde2db777f98d209d5d428021334212", "score": "0.76082504", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_path, notice: 'Project was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1162672b317cee4513388927b6ea108b", "score": "0.7607041", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1162672b317cee4513388927b6ea108b", "score": "0.7607041", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "15df4e0085d85f96ea9d5319d48638d8", "score": "0.7603568", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_path, :flash => { :success => \"Your project has been deleted.\" }}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7602437", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7602437", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7602437", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7602437", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7602437", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
a0fa74c2aabf5499025e6418c6245952
Client proof algorithm implementation.
[ { "docid": "a97b90fe56ec73f5b9750a36042df92d", "score": "0.65482914", "text": "def client_proof(key, signature)\n @client_proof ||= Base64.encode64(xor(key, signature)).gsub(\"\\n\",'')\n end", "title": "" } ]
[ { "docid": "b718a1a74d083c8470fd8aa02f04c5bc", "score": "0.7199365", "text": "def proof_of_work(client)\n value = SecureRandom.hex(16)\n work = Digest::SHA2.hexdigest value\n client.puts \"Please provide proof of work for: SHA2(????#{value[4..-1]}) == #{work}\"\n client.print '? '\n pow = Digest::SHA2.hexdigest client.gets.chomp\n return true if pow == work\n\n # Show source as implementation reference if PoW fails\n client.puts File.read __FILE__\n client&.close\nend", "title": "" }, { "docid": "43975121c89f6ffe5d103bc321c5dea6", "score": "0.6688311", "text": "def proof\n return @proof\n end", "title": "" }, { "docid": "43975121c89f6ffe5d103bc321c5dea6", "score": "0.6688311", "text": "def proof\n return @proof\n end", "title": "" }, { "docid": "c4e46cee96ac5d94be1d966fe345e46a", "score": "0.63644475", "text": "def client_proof(key, signature)\n @client_proof ||= Base64.strict_encode64(xor(key, signature))\n end", "title": "" }, { "docid": "433057ae2412b03c3d3069e6c0bc5371", "score": "0.6319829", "text": "def prove_hpk\n reportCommonErrors(\"prove_hpk error\") do\n # We expect 4 lines, base64 each:\n # 1: h₂(client_token): client_token used to receive a relay session pk\n # 2: a_temp_pk : client temp session key\n # 3: nonce_outter: timestamped nonce\n # 4: crypto_box(JSON, nonce_inner, relay_session_pk, client_temp_sk): Outer crypto-text\n\n @body = request.body.read PROVE_BODY\n l1, l2, l3, l4 = _check_body_lines @body, 4, 'prove hpk'\n\n # check and decrypt h2(client_token)\n @h2_ct = _check_client_token l1\n\n # load @client_token, @relay_token, @session_key from redis\n check_session_state\n\n # client_temp_pk\n @client_temp_pk = l2.from_b64\n\n # check that nonce timestamp is within range\n nonce_outer = _check_nonce l3.from_b64\n\n # decode outter cyphertext\n ctext = l4.from_b64\n\n # decypher it\n outer_box = RbNaCl::Box.new(@client_temp_pk, @session_key)\n inner = JSON.parse outer_box.decrypt(nonce_outer, ctext)\n\n # decode values from base64 and make keys symbols\n inner = Hash[inner.map { |k, v| [k.to_sym, v.from_b64] }]\n\n # check inner nonce timestamp\n _check_nonce inner[:nonce]\n\n # inner[:pub_key] is the key that is supposed to hash into hpk\n # dechypher inner ctext\n inner_box = RbNaCl::Box.new(inner[:pub_key], @session_key)\n sign = inner_box.decrypt(inner[:nonce], inner[:ctext])\n\n # construct the hash that depends on the session\n # token pair and on the temp key client sent\n proof_sign = h2(@client_temp_pk + @relay_token + @client_token)\n\n fail HPKError.new(self, msg:'HPK prove: Signature mismatch') unless sign &&\n proof_sign && proof_sign.length == TOKEN_LEN && sign.eql?(proof_sign)\n\n # Set HPK to the hash of idenitity key we just decrypted with\n @hpk = h2(inner[:pub_key])\n\n # --- No exceptions so far - now it is the proof success path ---\n save_hpk_session\n delete_handshake_keys\n mailbox = Mailbox.new @hpk.to_b64\n render plain: \"#{mailbox.count}\", status: :ok\n end\n end", "title": "" }, { "docid": "f712d49ec6c615538b2e2aa846391fda", "score": "0.627769", "text": "def challenge; end", "title": "" }, { "docid": "1d8a56f750d943b353fcb0818f8aff79", "score": "0.6164489", "text": "def proof=(value)\n @proof = value\n end", "title": "" }, { "docid": "1d8a56f750d943b353fcb0818f8aff79", "score": "0.6164489", "text": "def proof=(value)\n @proof = value\n end", "title": "" }, { "docid": "9c87bfaded8d5e5ad5b9ba746d98f4e7", "score": "0.6113459", "text": "def proof_of_work(previous_proof)\n # Find a number that when multiplied by the previous proof,\n # the hash has 4 leading 0s\n proof = 0\n\n while validate_proof(previous_proof, proof) == false\n proof += 1\n end\n\n return proof\n\n end", "title": "" }, { "docid": "ce13cdc311c17978cf37cab76555386d", "score": "0.5970839", "text": "def challenge\n end", "title": "" }, { "docid": "9186e730fe6a2e5c3edf94ad91e5e2d5", "score": "0.5890325", "text": "def verify_session proof, client_M\n @A = proof[:A]\n @B = proof[:B]\n @b = proof[:b].to_i(16)\n username = proof[:I]\n xsalt = proof[:s]\n v = proof[:v].to_i(16)\n\n @u = SRP.calc_u(@A, @B, @N)\n # SRP-6a safety check\n return false if @u == 0\n\n # calculate session key\n @S = '%x' % SRP.calc_server_S(@A.to_i(16), @b, v, @u, @N)\n @K = SRP.sha1_hex(@S)\n\n # calculate match\n @M = '%x' % SRP.calc_M(username, xsalt, @A, @B, @K, @N, @g)\n\n if @M == client_M\n # authentication succeeded\n @H_AMK = '%x' % SRP.calc_H_AMK(@A, @M, @K, @N, @g)\n return @H_AMK\n end\n return false\n end", "title": "" }, { "docid": "52bdc95074aeca89e0e92f7798948553", "score": "0.58897936", "text": "def compute_proof_of_work(last_proof)\n proof = 0\n until valid_proof?(last_proof: last_proof, proof: proof)\n proof += 1\n end\n\n proof\n end", "title": "" }, { "docid": "00f24ef4bbe765eaeca0899622293e32", "score": "0.58545816", "text": "def proof_of_work(last_proof)\n proof = 0\n while !valid_proof?(last_proof: last_proof, proof: proof) do\n proof += 1\n end\n proof\n end", "title": "" }, { "docid": "02c849ee4f52b2f15b5ae44a0d39aa04", "score": "0.5771904", "text": "def proof_of_work(last_proof)\n proof = -1\n proof += 1 until valid_proof(last_proof, proof)\n info(\"Valid proof found! #{proof}\")\n return proof\n end", "title": "" }, { "docid": "3aad6c76d11ba84e6a73164ef436684d", "score": "0.57320124", "text": "def proof_of_work(last_proof)\n proof = 0\n proof += 1 until self.valid_proof?(last_proof, proof, @difficulty)\n proof\n end", "title": "" }, { "docid": "7a93504380db49ac9784da4652485820", "score": "0.567406", "text": "def proof_of_work(last_proof)\n proof = 0\n\n while valid_proof(last_proof, proof) == false\n proof += 1\n end\n\n return proof\n end", "title": "" }, { "docid": "44f54d32b55ef34c2ef6968536508af7", "score": "0.56577855", "text": "def prove_no_saved \n hash = params['theorem']\n formula = hash['formula']\n prove(formula) \n end", "title": "" }, { "docid": "6710276ce35678c0d7ee7618ed43ab1c", "score": "0.5652334", "text": "def get_challenge_and_proof username, xverifier, xsalt\n generate_B(xverifier)\n return {\n :challenge => {:B => @B, :salt => xsalt},\n :proof => {:B => @B, :b => '%x' % @b, :I => username, :s => xsalt, :v => xverifier}\n }\n end", "title": "" }, { "docid": "e255198003f352687068d65fc3f8c697", "score": "0.5530582", "text": "def client_final_message\n BSON::Binary.new(\"#{without_proof},p=#{client_final}\")\n end", "title": "" }, { "docid": "8ad149f24784530ece033a0c360607c3", "score": "0.55195606", "text": "def valid_proof?(proof)\n proof_hash = Digest::SHA2.hexdigest \"#{@prev_hash}#{proof}\"\n proof_hash.start_with?(@@dificulty) \n end", "title": "" }, { "docid": "ddbfdd85c37fedf7f44bf10354c9fafc", "score": "0.55175275", "text": "def proof_params\n params.require(:proof).permit(:content, :problem_id)\n end", "title": "" }, { "docid": "03499f6ed6786c0375dd4eb4049e444c", "score": "0.5511681", "text": "def verify_membership_proof(proof)\n\n\t\t# Steps:\n\t\t# \ta. Compute the digest of a parent given the labels of its children (hash)\n\t\t# \t\t\t- The proof will have labels of the nodes (no indices?... should there be a proof class?)\n\t\t# \tb. Compute the digest of each node given its label\n\t\t# \tc. The digests of a. and b. should be consistent\n\n\t\t(proof.length - 1).times do |i|\n\n\t\t\tlabel_child_1, label_child_2, reverse_flag = proof[i]\n\t\t\thashed_digest = hash(label_child_1, label_child_2, reverse_flag)\n\n\t\t\tparent_label = proof[i + 1][0]\n\n\t\t\tmatched = check_radix_label(parent_label, hashed_digest)\n\n\t\t\tif not matched\n\t\t\t\t# puts \"check_radix_label(#{parent_label}, #{hashed_digest}) failed.\"\n\t\t\t\t# puts \"Checking proof[#{i}] pair against parent\"\n\t\t\t\treturn false\n\t\t\tend\n\n\t\tend\n\n\t\t# d. Check the root digest is equivalent with the known digest\n\t\t\t# Check the hash of the last siblings is the root digest\n\t\troot_child_1, root_child_2, reverse_flag = proof.last\n\n\t\tif hash(root_child_1, root_child_2, reverse_flag) == @root_digest\n\n\t\t\treturn true\n\t\telse\n\t\t\tputs \"Root digest did not match.\"\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "892a8f6d05f6278c7fa39d5a6358edf0", "score": "0.5471253", "text": "def correct\n raise VerdictException.new(1, 'Accepted')\n end", "title": "" }, { "docid": "9bd8a71a4e464b222bf58909b0c50aab", "score": "0.54415625", "text": "def solve()\n\t\twhile(isSolved == false)\n\t\t\twhile (crossHatch())\n\t\t\t\tpopulateCandidates()\n\t\t\tend\n\t\t\n\t\t\twhile(SingleCandidate())\n\t\t\t\twhile (crossHatch())\n\t\t\t\t\tpopulateCandidates()\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\twhile (numberClaim())\n\t\t\t\twhile(crossHatch)\n\t\t\t\t\tpopulateCandidates\n\t\t\t\tend\n\t\t\t\tSingleCandidate()\n\t\t\tend\n\t\t\tif(pairs())\n\t\t\t\twhile(crossHatch)\n\t\t\t\t\tpopulateCandidates\n\t\t\t\tend\n\t\t\t\tSingleCandidate()\n\t\t\t\tnumberClaim()\n\t\t\tend\n\t\t\tif(triples())\n\t\t\t\twhile(crossHatch)\n\t\t\t\t\tpopulateCandidates\n\t\t\t\tend\n\t\t\t\tSingleCandidate()\n\t\t\t\tnumberClaim()\n\t\t\t\tpairs\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "d95a4398abca59d235dcee28fceed729", "score": "0.5440574", "text": "def challenge=(p0) end", "title": "" }, { "docid": "309f2c467e055c2cff4e47ce0cd0b69e", "score": "0.5419303", "text": "def client_final_message\n BSON::Binary.new(\"#{without_proof},p=#{client_final}\")\n end", "title": "" }, { "docid": "dc9ece5b09db574b98b923bbfaed159c", "score": "0.53512937", "text": "def verify_with_human()\n\n puts \"\\nYou can help the Tramice 721 to solve false synonyms and homonyms by answering a few questions.\\n\"\n puts \"\\n (At any time, to quit, type : Quit)\\n\\n\"\n \n# First, the more obvious…\n\n find_ambivalent_synonyms # Function call…\n\n ambivalent_synonyms = $ambivalent_synonyms.dup # We will work on a copy, because there may be deletions.\n \n# Let's now ask the user what they think…\n \n ambivalent_synonyms.each do |s|\n answer_ok = true\n begin\n\n print ' - Are \"' + $lexicon[s['a']] + '\" and \"' + $lexicon[s['b']] + '\"' + \\\n \" synonyms ? (Yes/No/Pass)\\n\\n\"\n \n answer = gets.chomp.capitalize[0,1]\n\n case answer\n\n\t when 'Y'\n\t \n\t # This case is promptly solved.\n\n\t $ambivalent_synonyms -= [s]\n\t \n\t # We nonetheless keep log of the user action.\n\t \n\t # $users[user]['infos'] << { 'ACTION' => 'confirmed', \\\n\t # 'WHAT' => s, \\\n\t # 'DATE' => Time.now }\n\n\t when 'N'\n\n\t # We simply split the element in its two obvious parts.\n\t \n\t complete = completeness( s['#a'].length, s['~a'].length )\n\t \n\t $elements[s['k']] = \\\n\t { 'k' => s['k'], \\\n\t '~' => s['~a'], \\\n\t '#' => s['#a'], \\\n\t '@' => s['@a'], \\\n\t '%' => complete }\n\t \n\t s['~a'].each do |lexeme|\n\t $lexicon_infos[lexeme]['e'] -= [s['b']]\n\t end\n\t \n\t complete = completeness( s['#b'].length, s['~b'].length )\n\t \n\t $elements << { 'k' => $elements.length, \\\n\t '~' => s['~b'], \\\n\t '#' => s['#b'], \\\n\t '@' => s['@b'], \\\n\t '%' => complete }\n\t \n\t s['~b'].each do |lexeme|\n\t $lexicon_infos[lexeme]['e'] -= [s['a']]\n\t $lexicon_infos[lexeme]['e'] << $elements.length - 1\n\t end\n\n\t # We also remove the faulty synonyms from the $lexicon_infos.\n\t \n\t $lexicon_infos[s['a']]['~'] -= [s['b']]\n\t $lexicon_infos[s['b']]['~'] -= [s['a']]\n\t \n\t # And then we consider this case filed.\n\n\t $ambivalent_synonyms -= [s]\n\t \n\t # The user's action is logged.\n\t \n\t # $users[user]['infos'] << { 'ACTION' => 'infirmed', \\\n\t # 'WHAT' => s, \\\n\t # 'DATE' => Time.now }\n\n\t # Can we also backtrace to the faulty wish and remove it ?\n\t # And also inform its author ?\n\t when 'P'\n\t next\n\t when 'Q'\n\t return\n else\n answer_ok = false\n end\n end until answer_ok\n end\n \n\n# When ambivalents synonyms are all treated, we may always check some potential badly formed elements, due to homonymy.\n\n find_suspected_homonyms # First, call the function.\n\n suspected_homonyms = $suspected_homonyms.dup # We will work on a copy, because there may very well be deletions.\n \n suspected_homonyms.each do |h|\n k = h[0]['k'] # This is the key (ID) of this element that is suspected of being actually… many.\n l = h[0]['l'] # This is the number of the lexeme that may have different meanings.\n synonymous_subsets = []\n\n # So, let's ask the user to compare dubious pairs of synonyms, and reshape lexicon & elements accordingly.\n \n h.each_with_index do |sub_constellation_a, a|\n h.each_with_index do |sub_constellation_b, b|\n \n if b >= a then\n next\n end\n\n answer_ok = true\n \n begin # asking the folowwing question to the user, and ask until a correct answer is given.\n\n # But first, let's see if this potential pair has been resolved already.\n \n all_subsets_containing_either_one_of_the_two_constellations = []\n \n constellations_already_merged = false\n \n synonymous_subsets.each_with_index do |subset, s|\n \n if [sub_constellation_a, sub_constellation_b] - subset.flatten == [] then\n \n constellations_already_merged = true\n break # Skip this one, it is unnecessary.\n \n end\n \n # For this, we collect all subsets containing either one of the two presently considered contellations.\n\n if [sub_constellation_a] - subset.flatten == [] then\n all_subsets_containing_either_one_of_the_two_constellations << s\n end\n \n if [sub_constellation_b] - subset.flatten == [] then\n all_subsets_containing_either_one_of_the_two_constellations << s\n end\n end\n \n if constellations_already_merged then next end\n \n # We may now ask the question.\n\n print ' - Are { '\n sub_constellation_a['~'].each { |lexeme| print '\"' + $lexicon[lexeme] + '\" ' }\n print '} and { '\n sub_constellation_b['~'].each { |lexeme| print '\"' + $lexicon[lexeme] + '\" ' }\n print \"} synonymous sets ? (Yes/No/Pass)\\n\\n\"\n \n answer = gets.chomp.capitalize[0,1]\n\n case answer\n\n\t when 'Y'\n\n\t # If no synonymous subset contains either one of the two constellations, append both.\n\t \n if all_subsets_containing_either_one_of_the_two_constellations == [] then\n \n\t # …add the two of them in a separate synonymous subset.\n\n\t synonymous_subsets << [sub_constellation_a, sub_constellation_b]\n\t \n\t else\n\t \n\t # Otherwise, merge the subsets containing either one of the two currently tested constellations.\n\t \n\t merged_synonymous_subsets = [sub_constellation_a, sub_constellation_b]\t \n\t all_subsets_containing_either_one_of_the_two_constellations.reverse.each do |s| \n\t \n\t merged_synonymous_subsets |= synonymous_subsets[s] \n\t synonymous_subsets.delete_at(s) # ^reverse^ because we delete\n\t \n\t end\n\t \n\t synonymous_subsets << merged_synonymous_subsets\n\t \t \n\t end\t \n\t \n\t # And we also update $lexicon_infos with these new synonyms.\n\t \n\t $suspected_homonyms -= [h]\n\t \n\t # $users[user]['infos'] << { 'ACTION' => 'confirmed', \\\n\t # 'WHAT' => [sub_constellation_a, sub_constellation_b], \\\n\t # 'DATE' => Time.now }\n\t \n\n\t when 'N' # No, the two subsets aren't synonymous.\n\n\t if [sub_constellation_a] - synonymous_subsets.flatten != [] then\n\t synonymous_subsets << [sub_constellation_a]\n\t end\n\n\t if [sub_constellation_b] - synonymous_subsets.flatten != [] then\n\t synonymous_subsets << [sub_constellation_b]\n\t end\n\n\t # Let's remove the faulty synonymous_subsets from $lexicon_infos.\n\t \n\t sub_constellation_a['~'].each do |lexeme|\n\t $lexicon_infos[lexeme]['~'] -= (sub_constellation_b['~'] - [l])\n\t $lexicon_infos[lexeme]['e'] -= [k]\n\t end\n\t \n\t sub_constellation_b['~'].each do |lexeme|\n\t $lexicon_infos[lexeme]['~'] -= (sub_constellation_a['~'] - [l])\n\t $lexicon_infos[lexeme]['e'] -= [k]\n\t end\n\t \n\t # And clear this case.\n\n\t $suspected_homonyms -= [h]\n\t \n\t # Now, log the user's action.\n\t \n\t # $users[user]['infos'] << { 'ACTION' => 'infirmed', \\\n\t # 'WHAT' => [subset1, subset2], \\\n\t # 'DATE' => Time.now }\n\n\t when 'P'\n\t next\n\t when 'Q'\n\t return\n else\n answer_ok = false\n end\n end until answer_ok\n \n end # h.each_with_index\n end # h.each_with_index\n \n \n # If all the subsets are synonymous, we leave the element as it is.\n \n if synonymous_subsets.length == 1 then \n next\n else\n \n # Otherwise, we first report the homonymous lexeme and mark off the faulty element.\n \n $homonyms << { 'l' => l, \\\n\t 'h' => $lexicon[l], \\\n\t 'x' => k, \\\n\t 'e' => [] }\n\n\t $elements[k]['HOMONYMY MAP'] = l\t \n\t \n\n # Then we create separated, complete elements.\n\n synonymous_subsets.each do |subset|\n total_lexemes = []\n total_map = []\n total_strength = 0\n \n # First, we add the constellation's pairs to the total map.\n \n subset.each do |constellation|\n total_lexemes |= constellation['~'] # join\n\n\t constellation['#'].each do |pair|\n\t \n matched_pair = total_map.index {|p| p['-'] - pair['-'] == []}\n \n if not matched_pair then # add it to the map\n \n total_map << { '-' => pair['-'], '@' => 1 }\n \n else # strengthen the matched pair\n \n total_map[matched_pair]['@'] += 1\n \n end # — in both cases, strengthen the map strength.\n \n total_strength += 1\t \n\t end \n end # subset.each\n\t \n # Then, we add the total interconnection of these newly joined synonyms to the total map.\n \n total_lexemes.each_with_index do |lexeme1, l1|\n total_lexemes.each_with_index do |lexeme2, l2|\n \n if l2 >= l1 then next end\n \n matched_pair = total_map.index {|pair| (pair['-'] - [lexeme1]) - [lexeme2] == []}\n \n if not matched_pair then # add it to the map\n \n total_map << { '-' => [lexeme1, lexeme2], '@' => 1 }\n \n else # strengthen the matched pair\n \n total_map[matched_pair]['@'] += 1\n \n end # — in both cases, increase the map strength.\n \n total_strength += 1\n \n end\n end\n \n # Finally let's add this separated, complete element to the list !\n \n complete = completeness( total_map.length, total_lexemes.length )\n \n $elements << { 'k' => $elements.length, \\\n '~' => total_lexemes, \\\n '#' => total_map, \\\n '@' => total_strength, \\\n '%' => complete } # Should be 1.0 (100 %).\n \n # Oh, yeah, let's also update the other tables… \n \n total_lexemes.each_with_index do |lex1, l1|\n \n $lexicon_infos[lex1]['e'] << $elements.length - 1\n \n total_lexemes.each_with_index do |lex2, l2|\t\n if l2 >= l1 then\n next\n end \n $lexicon_infos[lex1]['~'] |= [lex2]\n $lexicon_infos[lex2]['~'] |= [lex1]\n end\n end\n \n $homonyms.last['e'] << $elements.length - 1\n \n end # synonymous_subsets.each\n end # if synonymous_subsets.length == 1 (else)\n end # suspected_homonyms.each\n \n \n# After having resolved the previous external cases, let's try to find synonyms ~inside~ our lexemes…\n\n find_suspected_synonyms # The usual function call…\n \n print \"\\n There is no more synonyms to check.\\n\\n\"\n \n suspected_homonyms.clear\n \nend", "title": "" }, { "docid": "246f28db0a5c53add2abfb7fd006486a", "score": "0.5329081", "text": "def algo_negotiation cl\n # let's prepare our packet first\n our_cookie = Random.bytes(16).bytes\n\n payload = [20] # SSH_MSG_KEXINIT\n payload += our_cookie\n\n # those are our algorithm preferences\n payload += ssh_string \"diffie-hellman-group14-sha256\" # key exchange\n payload += ssh_string \"ssh-rsa\" # server host key\n payload += ssh_string \"aes256-ctr\" # c2s encryption\n payload += ssh_string \"aes256-ctr\" # s2c ^\n payload += ssh_string \"hmac-sha2-256\" # c2s mac\n payload += ssh_string \"hmac-sha2-256\" # s2c ^\n payload += ssh_string \"none\" # c2s compression\n payload += ssh_string \"none\" # s2c ^\n payload += ssh_string \"\" # c2s languages\n payload += ssh_string \"\" # s2c ^\n\n payload += [0] # no kex packet follows\n payload += ssh_uint32 0 # reserved\n \n cl.send_packet payload\n\n\n # parsing the client's packet\n # basically, we get a bunch of name_lists of the supported algorithms\n #\n # all we have to do in this implementation is to verify that the client\n # supports the algos which we use\n packet = cl.read_packet\n packet_copy = packet.dup\n\n assert packet.shift == 20 # SSH_MSG_KEXINIT\n client_cookie = packet.shift 16\n\n\n # key exchange method\n assert packet.name_list.include? \"diffie-hellman-group14-sha256\"\n\n # server host key type\n assert packet.name_list.include? \"ssh-rsa\"\n\n # encryption algo\n assert packet.name_list.include? \"aes256-ctr\" # c2s\n assert packet.name_list.include? \"aes256-ctr\" # s2c\n\n # MAC algo\n assert packet.name_list.include? \"hmac-sha2-256\" # c2s\n assert packet.name_list.include? \"hmac-sha2-256\" # s2c\n\n # compression algo\n assert packet.name_list.include? \"none\" # c2s\n assert packet.name_list.include? \"none\" # s2c\n\n # we don't care about those\n _languages_c2s = packet.name_list\n _languages_s2c = packet.name_list\n\n\n first_kex_packet_follows = packet.shift != 0\n raise \"unsupported\" if first_kex_packet_follows # TODO\n\n _reserved = packet.uint32\n\n\n # ok, we've \"negotiated\" the algortihms used\n # one last thing - we return the combined client + server payloads\n # we need those in the key exchange\n\n ssh_string(packet_copy.map(&:chr).join) +\n ssh_string(payload.map(&:chr).join)\nend", "title": "" }, { "docid": "2d5eee70cd716c5b5f420f596dfffd9e", "score": "0.53168344", "text": "def valid_proof(last_proof, proof)\n guess = \"#{last_proof}#{proof}\"\n guess_hash = Digest::SHA256.hexdigest(guess)\n return guess_hash[0..(@difficulty - 1)] == ('0' * @difficulty)\n end", "title": "" }, { "docid": "4ae42d54039f24959754a431df369b4a", "score": "0.5239722", "text": "def find( last_proof, last_hash )\n\t\tproof = 0\n\n\t\tproof += 1 until Blockchain::ProofOfWork.valid_proof?( last_proof, last_hash, proof )\n\n\t\treturn proof\n\tend", "title": "" }, { "docid": "ea08075ad54cff6f611f3a26624a0e43", "score": "0.52369547", "text": "def verify(p0) end", "title": "" }, { "docid": "ea08075ad54cff6f611f3a26624a0e43", "score": "0.52369547", "text": "def verify(p0) end", "title": "" }, { "docid": "ea08075ad54cff6f611f3a26624a0e43", "score": "0.52369547", "text": "def verify(p0) end", "title": "" }, { "docid": "ea08075ad54cff6f611f3a26624a0e43", "score": "0.52369547", "text": "def verify(p0) end", "title": "" }, { "docid": "159d0b4738f69ae118bfdc17f51d41b5", "score": "0.5229006", "text": "def valid_proof?(a, b)\n\t\treturn false if current_user.proved.find_by(val_a: a, val_b: b)\n\t\tret = false\n\t\tif nodes_adjacent?(a, b)\n\t\t\tif a * 2 == b || b * 2 == a\n\t\t\t\t# send_status('testing 2x connection')\n\t\t\t\tcase valid_for_2x?(a)\n\t\t\t\twhen true\n\t\t\t\t\tret = true\n\t\t\t\twhen false\n\t\t\t\t\tif valid_for_2x?(b)\n\t\t\t\t\t\tret = true\n\t\t\t\t\tend\n\t\t\t\twhen nil\n\t\t\t\t\tvalid_b = valid_for_2x?(b)\n\t\t\t\t\tif valid_b || valid_b.nil?\n\t\t\t\t\t\tret = true\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tif !ret\n\t\t\t\t\tsend_error('you must make other proofs first')\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t# send_status('normal connection')\n\t\t\t\tret = true\n\t\t\tend\n\t\telse\n\t\t\tsend_error('nodes arn\\'t adjacent')\n\t\tend\n\t\tret\n\tend", "title": "" }, { "docid": "a305214259e974f5e2a90e93bf3ef5bc", "score": "0.5228587", "text": "def valid_proof?(last_proof, proof)\n guess = \"#{last_proof}#{proof}\".encode\n guess_hash = Digest::MD5.hexdigest(guess)\n guess_hash[0..3] == \"0000\"\n end", "title": "" }, { "docid": "f30fd01b7eec9ae3e82dd20f41e754c6", "score": "0.52243227", "text": "def verify(base, exp, result, proof, modulus)\n l = compute_challenge(base, exp, result)\n r = exp % l\n w = (proof.pow(l, modulus) * base.pow(r, modulus)) % modulus\n w == result\n end", "title": "" }, { "docid": "3cc46a9ce2d32e38ed48dab72b1751bf", "score": "0.52216244", "text": "def solve_2\n grammatic_time = Time.now\n grammatic = Grammatic.new(@rules, @terminals)\n pp \"Gramatic bilding: #{Time.now - grammatic_time}\"\n\n found_correct = 'ababababbbaaaaaaababbbbbbbbabbab'\n\n # res = AlgorithmCYK.new(grammatic, found_correct).call\n # pp res\n\n # byebug\n\n # res\n\n # algorithm_time = Time.now\n # res = AlgorithmCYK.new(grammatic, 'aaaabbaaaabbbbaaaaababba').call\n # pp \"Algorithm time: #{Time.now - algorithm_time}\"\n # res\n\n # bababbabaabaaababbbaabab\n # aaababbbaaabbbaaaaabbbab\n # aabaaaaabbbabaababaaaaab\n # bbaababbbbababbaaaababaa\n # baaaaaaabbaabbbbbaabaaba\n # bbabbaaaaaaabaaaaabbabbb\n # aabbaababababbabbaabbaba\n # ababaaabaabaabbbbaaaabba\n # abaaaaaabbbababbbaaaabba\n\n sorted = @messages.sort_by(&:size)\n # byebug\n\n # assert_equal true, AlgorithmCYK.new(grammatic, 'ababbb').call\n # assert_equal true, AlgorithmCYK.new(grammatic, 'abbbab').call\n # assert_equal true, AlgorithmCYK.new(grammatic, 'abbbab').call\n\n res = sorted.each_with_index.sum do |message, index|\n # # check = AlgorithmCYK.new(grammatic, message).call\n # # byebug\n # # check == true ? 1 : 0\n\n # puts \"\\n\\n\\n\"\n # pp message\n # puts \"One to go... #{index + 1}\"\n ress = AlgorithmCYK.new(grammatic, message).call ? 1 : 0\n pp [message, ress]\n ress\n end\n\n res\n\n # pp @rules\n # result\n end", "title": "" }, { "docid": "dfaa0052620ab936c74ad63ee0c8a4e6", "score": "0.52204514", "text": "def answer(assoc); end", "title": "" }, { "docid": "1e7f80a2ad9bf18f465a72828c805025", "score": "0.5186691", "text": "def set_proof\n @proof = Proof.find(params[:id])\n end", "title": "" }, { "docid": "72f5ee7df3c869722b2245316ff9e8c3", "score": "0.51852834", "text": "def set_proof\n @proof = Proof.find(params[:id])\n end", "title": "" }, { "docid": "4d92438d6af7c8ee1146ed7df096b184", "score": "0.5177634", "text": "def verify_withdraw!\n tx = CKB.load_tx\n # verify inputs\n # 1. first input must be withdarw plasma token\n # 2. second input must be UDT which lock script references to this contract.\n if tx[\"inputs\"].size != 2\n raise \"challenge inputs size must be 2\"\n end\n c = PLASMAToken.new(CKB::Source::INPUT, 0)\n if c.read_type_hash != contract_type_hash\n raise \"Inputs type must equals to contract_type_hash\"\n end\n if c.read_status != :withdraw\n raise \"withdraw inputs must be withdraw status\"\n end\n # 3. verify that challenge period is ended\n start_withdraw_block_height = CKB.load_block(tx[\"inputs\"][0][\"block_hash\"])[\"height\"]\n if start_withdraw_block_height + CHALLENGE_PERIOD >= tx[\"valid_since\"]\n raise \"can't withdraw, because challenge period is not end\"\n end\n withdraw_ptoken_count = c.read_token_count\n # 4. verify signature to proof token ownership\n if !c.verify_signature(ARGV[2])\n raise \"error signature, withdraw failed\"\n end\n c = UDT.new(CKB::Source::INPUT, 1)\n if c.read_type_hash != udt_type_hash\n raise \"Inputs type must equals to udt_type_hash\"\n end\n if c.read_lock_hash != contract_type_hash\n raise \"Inputs lock must equals to contract_type_hash\"\n end\n withdraw_udt_count = c.read_token_count\n if withdraw_ptoken_count != withdraw_udt_count\n raise \"PLASMAToken count must equals to UDT count\"\n end\n # 5. verify chain congestion\n available_blocks = 0\n tx[\"block_deps\"].each do |block_hash|\n block = Ckb.load_tx(block_hash)\n if block[\"height\"] > start_withdraw_block_height && block[\"txs_cycles\"] * 100 / BLOCK_MAX_CYCLES < 95\n available_blocks += 1\n end\n end\n if available_blocks < 50\n raise \"must provide 50 blocks to proof chain congestion status\"\n end\n # verify outputs\n if tx[\"outputs\"].size != 1\n raise \"only support 1 outputs for now\"\n end\n c = UDT.new(CKB::Source::OUTPUT, 0)\n if c.read_type_hash != udt_type_hash\n raise \"Outputs type must equals to udt_type_hash\"\n end\n output_udt_count = c.read_token_count\n\n # withdraw token count is correct\n if withdraw_udt_count != output_udt_count\n raise \"withdraw UDT must equals to input\"\n end\n true\nend", "title": "" }, { "docid": "92118982afc22c371b99fd87aab455d9", "score": "0.5163701", "text": "def prove(base, exp, result, modulus)\n l = compute_challenge(base, exp, result)\n q = exp / l\n base.pow(q, modulus)\n end", "title": "" }, { "docid": "c72badb0023c9a26e302ab10f88d6dde", "score": "0.51572484", "text": "def send_new_proof_notifications\n notify_problem_followers_of_new_proof\n notify_followers_of_new_proof\n end", "title": "" }, { "docid": "2b51fabc4af263e340a53712602cdc1d", "score": "0.5154229", "text": "def crack(message, precision)\n\trealFreq = Array[8.1, 1.5, 2.8, 4.3, 13.0, 2.2, 2.0, 6.1, 7.0, 0.15, 0.77, 7.0, 2.4,6.8, 7.5, 1.9, 0.095, 6.0, 6.3, 9.1, 2.8, 0.98, 2.4, 0.15, 2.0, 0.074]\n\t#Step 1 Calculate letter frequencies of encrypted message\n\tpseudoFreq = calculateLetterFrequencies(message)\n\n\tdiffArray = Array.new\n\trotated = Array.new\n\trotated.replace(pseudoFreq)\n\tfor i in (0..realFreq.length) do\n\t\t#Step 2: check difference with ideal letter frequency distribution\n\t\tdiffArray << checkDiff(realFreq, rotated)\n\t\t#Step 3: rotate pseudoFreq by 1 position\n\t\trotated = rotated.rotate\n\tend\n\t#Step 5: find the array with the smallest difference\n\trot = diffArray.index(diffArray.min)\n\t\n\tguessKeys = getBestGuesses(precision, diffArray)\n\n\tguesses = Array.new\n\tfor k in guessKeys\n\t\tguesses << codeMessage(k, message)\n\tend\n\treturn guesses\nend", "title": "" }, { "docid": "ede80876b56caa01eb136953d546007e", "score": "0.51340425", "text": "def test_challenge16\n c1 = f1(\":admin<true\")\n refute admin?(c1)\n\n blocks = c1.bytes.each_slice(16).to_a\n\n blocks[1][0] = blocks[1][0] ^ 1\n blocks[1][6] = blocks[1][6] ^ 1\n\n c2 = blocks.flatten.pack(\"C*\")\n\n assert admin?(c2)\n end", "title": "" }, { "docid": "c69bfd01151922ab3c109faada868a5b", "score": "0.51298577", "text": "def solve\n end", "title": "" }, { "docid": "91fce937f9726b0312e80c1f46cc5e50", "score": "0.5128197", "text": "def compute_challenge(*params)\n hash_to_prime(params.map{|p|even_hex(p)}.join)\n end", "title": "" }, { "docid": "a8509357ef9396d62609f4487b8e1af9", "score": "0.51271147", "text": "def test_challenge_27\n ciphertext = f1(\"\")\n c0 = ciphertext[0...16]\n attack_ciphertext = [c0, \"\\x00\" * 16, c0, \"A\" * 256].join\n error_text = admin?(attack_ciphertext)\n\n p1, _, p3 = error_text.bytes.each_slice(16).take(3)\n found_key = p1.zip(p3).map { |l, r| l ^ r }.pack(\"C*\")\n\n refute admin?(ciphertext)\n assert_equal KEY27, found_key\n end", "title": "" }, { "docid": "313ff4a170fca744eeb4fc873595a23b", "score": "0.5124258", "text": "def picky_procipher(sentence, hash)\n procipher(sentence, hash, true)\nend", "title": "" }, { "docid": "3b0a36c76e81eea8132986a070583f59", "score": "0.5114773", "text": "def challenge_response; end", "title": "" }, { "docid": "cd674a91d33bc0c4ae6e288231a8fb0c", "score": "0.5111447", "text": "def valid_proof(last_proof, proof)\n guess = \"#{last_proof}#{proof}\"\n guess_hash = Digest::SHA256.hexdigest guess\n\n return guess_hash[-MINING_DIFFICULTY.size..-1] == MINING_DIFFICULTY\n end", "title": "" }, { "docid": "ab719741d27af8745d634d47990cbe2e", "score": "0.5109864", "text": "def explain_benefits pb\n\ttext_reply(pb, \"Studies have shown that cultivating thankfulness\n\t on a daily basis can improve people's quality of life.\")\n\ttext_reply(pb, \"Here are some links to different articles and papers, so you\n\t can see the results and assess the benefits for yourself.\")\n\ttext_reply(pb, 'https://www.health.harvard.edu/newsletter_article/in-praise-of-gratitude')\n\ttext_reply(pb, 'https://www.ncbi.nlm.nih.gov/pubmed/12585811')\n\ttext_reply(pb, 'https://www.ncbi.nlm.nih.gov/pubmed/20515249')\nend", "title": "" }, { "docid": "0357691594299e869210d16ac475eecf", "score": "0.508533", "text": "def verify(base, result, proof, modulus)\n g = RSA::Accumulator::RSA2048_UNKNOWN_ELEM\n l = compute_challenge(base, result, proof.z)\n alpha = blake2_hash(base, result, proof.z, l)\n lhs = (proof.q.pow(l, modulus) * ((base * g.pow(alpha, modulus) % modulus)).pow(proof.r, modulus)) % modulus\n rhs = (result * proof.z.pow(alpha, modulus) % modulus)\n lhs == rhs\n end", "title": "" }, { "docid": "9eaacee9d1b44ac1948bc3d48ed48474", "score": "0.5085177", "text": "def explain_benefits pb\n text_reply(pb, \"Studies have shown that cultivating thankfulness on a daily basis can improve people's quality of life.\")\n text_reply(pb, \"Here are some links to different articles and papers, so you can see the results and assess the benefits for yourself.\")\n text_reply(pb, 'https://www.health.harvard.edu/newsletter_article/in-praise-of-gratitude')\n text_reply(pb, 'https://www.ncbi.nlm.nih.gov/pubmed/12585811')\n text_reply(pb, 'https://www.ncbi.nlm.nih.gov/pubmed/20515249')\n end", "title": "" }, { "docid": "5e4b8763b61e94e9eefb2ea0dc60cca1", "score": "0.5076708", "text": "def set_challenge\n \n end", "title": "" }, { "docid": "cbc4441aa7cddd555fe511bc4fc06068", "score": "0.50712645", "text": "def valid_proof?( last_proof, last_hash, proof )\n\t\tdigest = Digest::SHA2.new( Blockchain::ProofOfWork::DIGEST_SIZE )\n\t\tdigest << \"%d:%s:%d\" % [ last_proof, last_hash, proof ]\n\n\t\treturn digest.hexdigest.end_with?( '0000' )\n\tend", "title": "" }, { "docid": "797dfc3fa234313e07632d5bc34f7c58", "score": "0.50706756", "text": "def surveyorship(refractive, glyptologist_shakil, uninwoven_discrepantly)\n end", "title": "" }, { "docid": "64d1467228340a0f620b2a8fceb055c3", "score": "0.5070614", "text": "def process_challenge identity, password, salt_str, b_str\n\n b_int = b_str.to_i(16)\n # SRP-6a safety check\n return false if (b_int % @N) == 0\n\n u = SRP.sha256( @A.to_s(16) + b_str ).hex\n x = SRP.sha256( salt_str + SRP.sha256( identity + \":\" + password ) ).hex\n\n # SRP-6a safety check\n return false if u == 0\n\n # calculate session key\n kgx = k * SRP.modpow(@g, x, @N)\n aux = @a + ( u * x )\n @S = SRP.modpow( b_int - kgx, aux, @N)\n\n # calculate match\n @M = SRP.sha256( @A.to_s(16) + b_str + @S.to_s(16) )\n\n # calculate verifier\n @HAMK = SRP.sha256( @A.to_s(16) + @M + @S.to_s(16) )\n\n return @M\n end", "title": "" }, { "docid": "ac961bf36fcab85fc8e14171c1137c1e", "score": "0.50641525", "text": "def pharmacopedic(muddleproof_cucullately, liturgiologist_panspermia)\n end", "title": "" }, { "docid": "195cf42db01f5be50aba54f08a7adaf0", "score": "0.50623155", "text": "def knifeman()\n euryalida_pedantocrat_reply(scrappingly, thucydidean_compressible, coeffluent)\n scolopax_bluffable_taistril(mongolian, discounter, udic_jobber)\n saponacity(compresence_shapely)\n end", "title": "" }, { "docid": "f144fe2beff61261d3f5c0a81df434d2", "score": "0.5047983", "text": "def torchon_fellage_postappendicular()\n confirmatory(unmoisten, ulysses, keratocentesis_thongy)\n end", "title": "" }, { "docid": "342a3b0c1730c31a20d78d9a81280ce6", "score": "0.5047085", "text": "def foreign_propose(action)\n proposer = action.entity\n corporation = action.corporation\n company = action.company\n price = foreign_price(corporation, company)\n\n responder_list = build_responder_list(proposer, corporation, company)\n\n raise GameError, \"no possible responders for #{company.sym}\" if responder_list.empty?\n return acquire_company(corporation, company, price) if responder_list.one?\n\n responder = responder_list[0].owner\n\n offer = {\n proposer: proposer,\n corporation: corporation,\n company: company,\n responder: responder,\n responder_list: responder_list,\n }\n @round.offers << offer\n\n @log << \"#{corporation.name} (#{proposer.name}) proposes to purchase #{company.sym} from the Foreign Investor \"\\\n \"for #{@game.format_currency(price)}\"\n @log << \"#{responder_list[0].name} (#{responder.name}) has the right to intervene\"\n end", "title": "" }, { "docid": "4851a1ae51f75f46e68d65527f34a098", "score": "0.50452733", "text": "def challenge(_request, _response)\n end", "title": "" }, { "docid": "9cef41859b306e584ef516e29b47398f", "score": "0.50449014", "text": "def pe59s3()\n\tct = File.open(\"cipher1.txt\").read.gsub(/\\n/,\"\").split(\",\").map {|x| x.to_i}\n\tpwLength = 3\n\tprintf \"cipher text = %s\\n\", ct\n\tpw = ('a'..'z').to_a\n\tpw = pw.product(pw,pw).map {|x| x.join}\n\twl = {} # try to use hash for performance\n\tFile.open(\"shortWordList.txt\").read.split.map {|word| wl[word] = 1}\n\tpw.each_with_index do |e, index|\n\t\tc = 0\n\t\tdecode = []\n\t\tct.each do |x|\n\t\t\tif(c == pwLength) then c = 0 end\n\t\t\td = (x ^ e[c][0].ord).chr\n\t\t\tdecode.push(d)\n\t\t\tc += 1\n\t\tend\n\t\t\n\t\tdecode = decode.join\n\t\tdecode2 = decode.split(' ')\n\t\tpassrate,matches = 15,0 \n\t\tdecode2.each do |t|\n\t\t\tif(wl.has_key?(t)) then\n\t\t\t\tmatches += 1\n\t\t\t\tif(matches == passrate) then\n\t\t\t\t\tprintf \"found solution - key = %s\\nDecode = %s\\n\",e, decode\n\t\t\t\t\tasciiTotal = 0\n\t\t\t\t\t0.upto(decode.length - 1) do |z|\n\t\t\t\t\t\tasciiTotal += decode[z][0].ord\n\t\t\t\t\tend\n\t\t\t\t\tprintf \"total acsii values = %d\\n\", asciiTotal\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\tend\n\t\tend\t\t\n\tend\n printf \"password not found\\n\"\nend", "title": "" }, { "docid": "0e9b55f221cfbcb2f692a434af35a9ae", "score": "0.5036086", "text": "def verifier; end", "title": "" }, { "docid": "0e9b55f221cfbcb2f692a434af35a9ae", "score": "0.5036086", "text": "def verifier; end", "title": "" }, { "docid": "0e9b55f221cfbcb2f692a434af35a9ae", "score": "0.5036086", "text": "def verifier; end", "title": "" }, { "docid": "0e9b55f221cfbcb2f692a434af35a9ae", "score": "0.5036086", "text": "def verifier; end", "title": "" }, { "docid": "b2709038c24bcfdd62ae72651f34ca88", "score": "0.5033472", "text": "def mp(proof)\n p = proof[-1]\n if p.is_a?(Array) && p[0] == :IMP\n # lookup hypothesis\n if proof.member?(p[1])\n proof << p[2]\n return proof\n else\n raise \"Could not find #{formula_to_s(p[1])}\"\n end\n end\n raise \"Invalid application of MP for #{formula_to_s(p)}\"\nend", "title": "" }, { "docid": "a37b07f175a49b94f89061e780f4699c", "score": "0.50306165", "text": "def cmp_issuer(p0) end", "title": "" }, { "docid": "184ed78766dc71221ecc5a96f0869383", "score": "0.5029574", "text": "def verify(*) end", "title": "" }, { "docid": "381959f7bee024febc4375da1dfe7bf0", "score": "0.50275296", "text": "def tussore_hallucinative_effluvial()\n wheyish_aerotactic()\n preobviously_ziphian_decidedly()\n end", "title": "" }, { "docid": "23c97d6de88c7cc6cd2dc60f078f40a9", "score": "0.5012238", "text": "def solve\n end", "title": "" }, { "docid": "fab8e76d86701e016c7e9a0b68818d45", "score": "0.50116235", "text": "def solve!\n end", "title": "" }, { "docid": "8152c93071b6bf71d017cf08d9df094f", "score": "0.50105554", "text": "def prove(base, exp, result, modulus)\n g = RSA::Accumulator::RSA2048_UNKNOWN_ELEM\n z = g.pow(exp, modulus)\n l = compute_challenge(base, result, z)\n alpha = blake2_hash(base, result, z, l)\n q, r = exp.divmod(l)\n RSA::ACC::PoKE2Proof.new(z, ((base * g.pow(alpha, modulus)) % modulus).pow(q, modulus), r)\n end", "title": "" }, { "docid": "fa433772252a91aeffff2cb85466232a", "score": "0.50037986", "text": "def pe59s4()\n\tct = File.open(\"cipher1.txt\").read.gsub(/\\n/,\"\").split(\",\").map {|x| x.to_i}\n\tpwLength = 3\n\tpw = ('a'..'z').to_a\n\tpw = pw.product(pw,pw).map {|x| x.join}\n\twl = {} # try to use hash for performance\n\tFile.open(\"shortWordList.txt\").read.split.map {|word| wl[word] = 1}\n\tpw.each_with_index do |e, index|\n\t\tc = 0\n\t\tdecode = []\n\t\tct.each do |x|\n\t\t\tif(c == pwLength) then c = 0 end\n\t\t\td = (x ^ e[c][0].ord).chr\n\t\t\tdecode.push(d)\n\t\t\tc += 1\n\t\tend\n\t\t#p decode\t\n\t\tdecode2 = decode.join.split(' ')\n\t\t#decode2 = decode.split(' ')\n\t\tpassrate,matches= 15,0\n\t\tdecode2.each_with_index do |t, index|\n\t\t\tif(wl.has_key?(t)) then\n\t\t\t\tmatches += 1\n\t\t\t\tif(matches > passrate) then\n\t\t\t\t\tprintf \"found solution - key = %s\\nDecode = %s\\n\",e, decode2\n\t\t\t\t\tasciiTotal = 0\n\t\t\t\t\tasciiTotal = decode.map {|z| z[0].ord}.reduce(:+)\n\t\t\t\t\tprintf \"total acsii values = %d\\n\", asciiTotal\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\tend\n\t\tend\t\t\n\tend\n printf \"password not found\\n\"\nend", "title": "" }, { "docid": "34924ba1eac9b84c3f9513aa9432766e", "score": "0.50014997", "text": "def punishmentproof(nachani_prewelcome, ultradignified_reinvade, relevy)\n oxycalorimeter_putrefactiveness_hobbyhorsically(photoceramics, glochis, rhytisma_undetermining)\n end", "title": "" }, { "docid": "eff4930090d774a39c6f12fccbca32c7", "score": "0.50003797", "text": "def verify(p0, p1, p2) end", "title": "" }, { "docid": "1aee855196ffbe7783906f307e83165d", "score": "0.49942034", "text": "def without_proof\n @without_proof ||= \"c=biws,r=#{rnonce}\"\n end", "title": "" }, { "docid": "275017b1dd86360c2afaa01174715cc4", "score": "0.49898526", "text": "def generate_challenge\n encrypt(generate_code)\n end", "title": "" }, { "docid": "d3c7478086c73fd46cc3985607868af1", "score": "0.4983701", "text": "def uselessness_chirpling_distinction(corymbiferous_epicardial)\n end", "title": "" }, { "docid": "d0845a545d96c81f2c6122b313730f28", "score": "0.4979203", "text": "def affirmative?\n ACCEPTED == decision\n end", "title": "" }, { "docid": "e55e7e3bdf2f8c6b8d1170f6356a4b8c", "score": "0.49765795", "text": "def compute(transcript, bf, v)\n raise ArgumentError, \"v grater than 2^64\" if v > 2.pow(UPPER_EXP)\n raise ArgumentError, \"v lower than 0\" if v.negative?\n\n commitment = Commitment.create(bf, v)\n\n # convert value to binary\n binary = v.to_s(2).each_char.to_a.reverse.map(&:to_i)\n binary << 0 until binary.length == POWERS.length\n a_L = binary\n a_R = binary.map { |b| FIELD.mod(b - 1) }\n\n unless a_L.zip(a_R).map { |a, b| a * b }.sum.zero?\n raise Error, \"a_L * a_R has to be 0\"\n end\n\n transcript.points << commitment\n\n # generate vector pedersen commitment\n a_bf = SecureRandom.random_number(ORDER)\n a_com = Commitment.create_vector_pedersen(a_L, a_R, a_bf)\n transcript.points << a_com\n\n # Prove 3 statements.\n # <a_L, POWERS> = v\n # <a_L, a_R> = 0\n # (a_L - 1) - a_R = 0\n\n # generate blind vector commitment\n s_L = POWERS.length.times.map { SecureRandom.random_number(ORDER) }\n s_R = POWERS.length.times.map { SecureRandom.random_number(ORDER) }\n s_bf = SecureRandom.random_number(ORDER)\n s_com = Commitment.create_vector_pedersen(s_L, s_R, s_bf)\n transcript.points << s_com\n\n # Calculate challenge y and z by H(st, A, S)\n y = transcript.challenge_scalar(\"y\")\n y_n = a_L.length.times.map { |i| FIELD.power(y, i) }\n\n z = transcript.challenge_scalar(\"z\")\n # z^2\n zz = FIELD.power(z, 2)\n zz_powers = POWERS.map { |p| FIELD.mod(p * zz) }\n\n # unblinded\n a_R_z = a_R.map { |r| FIELD.mod(r + z) }\n l0 = a_L.map { |l| FIELD.mod(l - z) }\n r0 =\n y_n\n .zip(a_R_z)\n .map { |a, b| FIELD.mod(a * b) }\n .zip(zz_powers)\n .map { |a, b| FIELD.mod(a + b) }\n\n # l(x) = l0 + l1x = (aL + sLx) - z\n l =\n lambda do |x|\n s_L_x = s_L.map { |s| FIELD.mod(s * x) }\n a_L\n .zip(s_L_x)\n .map { |a, b| FIELD.mod(a + b) }\n .map { |a| FIELD.mod(a - z) }\n end\n # r(x) = r0 + r1x = y^n * ((aR + sRx) + z) + z^2 * 2^n\n r =\n lambda do |x|\n s_R_x = s_R.map { |s| FIELD.mod(s * x) }\n tmp = a_R.zip(s_R_x).map { |a, b| FIELD.mod(a + b + z) }\n y_n\n .zip(tmp)\n .map { |a, b| FIELD.mod(a * b) }\n .zip(zz_powers)\n .map { |a, b| FIELD.mod(a + b) }\n end\n\n # t(x) = <l(x), r(x)> = t0 + t1x + t2x^2\n t =\n lambda do |x|\n FIELD.mod(\n l.call(x).zip(r.call(x)).map { |a, b| FIELD.mod(a * b) }.sum\n )\n end\n\n l1 = s_L.dup\n r1 = y_n.zip(s_R).map { |a, b| FIELD.mod(a * b) }\n t0 = FIELD.mod(l0.zip(r0).map { |a, b| FIELD.mod(a * b) }.sum)\n t2 = FIELD.mod(l1.zip(r1).map { |a, b| FIELD.mod(a * b) }.sum)\n t1 =\n FIELD.mod(\n l0\n .zip(l1)\n .map { |a, b| FIELD.mod(a + b) }\n .zip(r0.zip(r1).map { |a, b| FIELD.mod(a + b) })\n .map { |a, b| FIELD.mod(a * b) }\n .sum - t0 - t2\n )\n\n t1_bf = SecureRandom.random_number(ORDER)\n t2_bf = SecureRandom.random_number(ORDER)\n\n t1_com = Commitment.create(t1_bf, t1)\n t2_com = Commitment.create(t2_bf, t2)\n transcript.points << t1_com\n transcript.points << t2_com\n\n x = transcript.challenge_scalar(\"x\")\n xx = FIELD.power(x, 2)\n tx = FIELD.mod(t0 + t1 * x + t2 * xx)\n tx_bf = FIELD.mod(zz * bf + x * t1_bf + xx * t2_bf)\n\n raise Error, \"t(x) not match tx\" unless t.call(x) == tx\n\n e = FIELD.mod(a_bf + x * s_bf)\n\n Uncompressed.new(\n commitment.to_affine,\n a_com.to_affine,\n s_com.to_affine,\n t1_com.to_affine,\n t2_com.to_affine,\n tx,\n tx_bf,\n e,\n l.call(x),\n r.call(x),\n dst: transcript.dst\n )\n end", "title": "" }, { "docid": "2a73cecfccc2a9ea7f80fd47569d4b82", "score": "0.4975729", "text": "def phase_one\n\tvoted_out_array = Array.new\n\t8.times do\n\tvoted_out = @borneo.immunity_challenge.tribal_council(no_immune: nil) # Returns the voted out member\n\tvoted_out_array << voted_out \n\tend\n\tprint_losers(voted_out_array)\n\tvoted_out_array.length \nend", "title": "" }, { "docid": "60f3322b77728e8b5011eabe32afa4dc", "score": "0.49721533", "text": "def eugenics_program(candidate)\n\tcandidate_genetic_code = mating_algorithm(candidate).reduce(:+) #284\n\tideal_partner_genetic_code = mating_algorithm(candidate_genetic_code).reduce(:+) #220\n\n\t# Can't mate with yourself, buddy - you'll go blind!\n\treturn if candidate_genetic_code == ideal_partner_genetic_code\n\n\treturn candidate_genetic_code, ideal_partner_genetic_code if we_were_fucking_MADE_for_each_other?(ideal_partner_genetic_code, candidate)\nend", "title": "" }, { "docid": "a64bac42d7a2ac6c4e7bec42c1db60fb", "score": "0.497043", "text": "def evaluate\n # get @problemlem, and therefore its answers\n @problem = Problem.find(params[:id])\n # determine if problem is makeup, assign hint penalty\n makeup = Graph.find_by(file_id: @problem.id, typ: 'prob').makeup\n if makeup\n penalty = SCORES_PER_MAKEUP\n else\n penalty = SCORES_PER_PROBLEM\n end\n # process user answer (non-standard parameters: so its needed)\n @userAnswers = process_user_answers\n # answer.evaluate_list returns: results[0] as bool, results[1..-1] as\n # indicies\n results = @problem.answer.evaluate_list(@userAnswers)\n # mark @problem as answered\n score = Score.find_by(user_id: current_user.id, problem_id: @problem.id)\n score.update_attribute(:ip, false)\n # get amount of hints seen by user for this @problem\n hint_count = SeenHint.hints_count(current_user.id, @problem.id)\n @feedback = \"\"\n # create @feedback based on how many hints were requested and correctness\n #\n # if correct\n if results[0] == true\n if (hint_count > penalty.length) or (penalty[hint_count] == 0)\n # answers correct but too many hints asked for\n score.update_attribute(:score, 0)\n @feedback = \"Too many hints requested to reward any points.\"\n else\n # answers correct and score awarded\n score.update_attribute(:score, penalty[hint_count])\n @feedback = \"Your answer was correct.\"\n @feedback += \" #{hint_count.to_s} hint(s) were requested.\"\n @feedback += \" You were deducted \"\n @feedback += \" #{(penalty[0]-penalty[hint_count]).to_s} point(s).\"\n end\n # else incorrect\n else\n score.update_attribute(:score, 0)\n @feedback = \"You missed #{penalty[0]} points because not all the values\n were correct.\"\n end\n # move user's progression\n marker = current_user.markers.find_by(curriculum: @problem.curriculum)\n marker.set_next_problem(@problem.id)\n # render results page\n render 'results'\n end", "title": "" }, { "docid": "801d04de0c5c6bf8e5c952e3e9877531", "score": "0.49697268", "text": "def compute_response_for_empty_cryptogram_proof(commitment_scalar_string, challenge_string, secret_string)\n commitment_scalar = hex_to_bn(commitment_scalar_string)\n challenge = hex_to_bn(challenge_string)\n secret = hex_to_bn(secret_string)\n\n response = Crypto::DiscreteLogarithmMultipleProof.compute_response(commitment_scalar, challenge, secret)\n\n bn_to_hex(response)\n end", "title": "" }, { "docid": "0a3a2c06df1bfe35ad461b0c38f9ff99", "score": "0.49696052", "text": "def listen\n # I don't know how to seperate Candidates by party\n case @candidates.include?('')\n when \"Republican\"\n @voters.each do |voter|\n # Verbal Argument will be in stump speach lol\n if voter[1] == \"Libertarian\" && rand < 0.90\n puts \"Voting Republican\"\n true\n elsif voter[1] = \"Conservative\" && rand < 0.75\n puts \"Voting Republican\"\n true\n elsif voter[1] = \"Independent\" && rand < 0.50\n puts \"Voting Republican\"\n true\n elsif voter[1] = \"Progressive\" && rand < 0.25\n puts \"Voting Republican\"\n true\n elsif voter[1] = \"Massachusetts Democrat\" && rand < 0.10\n puts \"Voting Republican\"\n true\n else\n false\n end\n end\n when \"Democrat\"\n @voters.each do |voter|\n # Verbal Argument will be in stump speach lol\n if voter[1] == \"Libertarian\" && rand > 0.90\n puts \"Voting Democrat\"\n true\n elsif voter[1] = \"Conservative\" && rand > 0.75\n puts \"Voting Democrat\"\n true\n elsif voter[1] = \"Independent\" && rand > 0.50\n puts \"Voting Democrat\"\n true\n elsif voter[1] = \"Progressive\" && rand > 0.25\n puts \"Voting Democrat\"\n true\n elsif voter[1] = \"Massachusetts Democrat\" && rand > 0.10\n puts \"Voting Democrat\"\n true\n else\n false\n end\n end\n else\n puts \"Not valid.\"\n listen\n end\nend", "title": "" }, { "docid": "bd77180c68877091f38f06c7eb1e564d", "score": "0.49670258", "text": "def earnestness_cephaloclasia_preposterous()\n end", "title": "" }, { "docid": "5b65b0236027c90469b931c13bab442c", "score": "0.49637705", "text": "def antisymmetric?; end", "title": "" }, { "docid": "11b373376c6298bc79836110ec03c363", "score": "0.49602354", "text": "def encrypt(message, key)\t\t\t# Handles both encryption and decryption, assuming you know the key.\n\tresult = ''\n\t\n\t# MODE 1: Take an array of integers (the message's 'ord' values).\n\tif message.is_a? Array \t\t\t\n\t\t(message.length).times do | i |\n\t\t\t# Using the bitwise XOR operator (^), we'll get our new ASCII value, turn it into a character, and add it to our result variable.\n\t\t\tresult += (message[i].to_i ^ key[i % key.length].ord).chr\n\t\tend\n\t# MODE 2: Take the message straight-up, as a string. Not used in the Euler problem, but more generally useful.\n\telsif message.is_a? String\t\t\n\t\t(message.length).times do | i |\n\t\t\tresult += (message[i].ord ^ key[i % key.length].ord).chr\n\t\tend\n\n\treturn result\nend\n\ndef get_file_array(path)\t# Takes a comma-separated string from a file and returns an array\n\tmsg = File.open(path)\n\tmsg.gets.split(\",\")\nend\n\n# There are 17.5k (26**3) possible lowercase combinations from aaa to zzz. We're brute-force checking all of them. 'n' is our minimum requirement\n# for a 'solved' decryption; we must find at least n words in the decoded message for it to be considered decoded.\ndef brute_solve(msg, common, n)\n\twords_found = 0\n\n\t97.upto(122) do | l1 |\t\t\t# 97.chr = 'a'. 122.chr = 'z'. These numbers represent the range of lowercase letters.\t\n\t\t97.upto(122) do | l2 |\n\t\t\t97.upto(122) do | l3 |\n\t\t\t\t\n\t\t\t\t# Combine our three iterated letters into a string, and try it as the key.\n\t\t\t\tkey = l1.chr + l2.chr + l3.chr\n\t\t\t\tdecrypted = encrypt(msg, key)\n\n\t\t\t\t# See how many common words are in our new solved message\n\t\t\t\tcommon.each do | word |\n\t\t\t\t\twords_found += 1 if decrypted.scan(word).length > 0\n\t\t\t\tend\n\n\t\t\t\treturn decrypted if words_found >= n\n\n\t\t\t\twords_found = 0 \t# reset our count on every iteration.\n\t\t\tend\n\t\tend\n\tend\nend\n\n# Once we've found our decoded message, add up the sum of the ASCII values, as per the Euler Problem request.\ndef add_em_up(msg)\n\ttotal = 0\n\tmsg.split(\"\").each { |l| total += l.ord }\n\treturn total\nend\n\n############# TIME TO SOLVE #############\n\n# To evaluate if we've correctly discovered the key, we'll use an array of the most common dictionary words. A proper solution should\n# have at least n of these words (probably all 5 in this circumstance) \ncommon_words = ['the','be','to','of','and'] \n\n# Grab our encrypted message from file\nmsg = get_file_array('cipher1.txt')\n\n\n# Get our decrypted method.\ndecrypted = brute_solve(msg, common_words, 5)\n\n# Solve the Euler problem by getting the sum of the ASCII values\nputs add_em_up(decrypted)\n\n\n# yay! =D", "title": "" }, { "docid": "17c4abd642995b70b371391b2fa11420", "score": "0.49556133", "text": "def message_verifier(verifier_name); end", "title": "" }, { "docid": "ee1e04a5dfc4f69cc08792c48aa924e3", "score": "0.4954632", "text": "def policy; end", "title": "" }, { "docid": "06150c1b44513062febdb4f12a4bbb21", "score": "0.49518007", "text": "def crock(normocyte, scarless)\n end", "title": "" }, { "docid": "a90bab341f653c6f68a025cbb1fd8f5d", "score": "0.49489656", "text": "def verify_empty_cryptogram_proof(proof_string, empty_cryptogram_string, encryption_key_string)\n dlm_proof = DiscreteLogarithmMultipleProof.from_s(proof_string)\n empty_cryptogram = ElGamalPointCryptogram.from_s(empty_cryptogram_string)\n encryption_key = hex_to_point(encryption_key_string)\n\n generators = [CURVE.group.generator, encryption_key]\n points = [empty_cryptogram.randomness, empty_cryptogram.ciphertext]\n\n dlm_proof.verify_without_challenge(generators, points)\n end", "title": "" }, { "docid": "139e966916c83b72e449445bf9461fe5", "score": "0.49449956", "text": "def verify\n \n end", "title": "" }, { "docid": "251d0fc3421a65a1971e16deabe71202", "score": "0.4939512", "text": "def correctors\n end", "title": "" }, { "docid": "91cd4994a5dadef9318c41f8377f59b3", "score": "0.4928418", "text": "def pe59s2()\n\ttext = \"simple test hello world\"\n\tpwLength = 3\n\tct = cipher(text,'jha')\n\tprintf \"cipher text = %s\\n\", ct\n\tpw = ('a'..'z').to_a\n\tpw = pw.product(pw,pw).map {|x| x.join}\n\twl = {} # try to use hash for performance\n\tFile.open(\"wordList.txt\").read.split.map {|word| wl[word] = 1}\n\tpw.each_with_index do |e, index|\n\t\tc = 0\n\t\tdecode = []\n\t\tct.each do |x|\n\t\t\tif(c == pwLength) then c = 0 end\n\t\t\tprintf \"password index = %d, password ascii = %d cypt-acsill = %d\\n\",index,e[c][0].ord,x#e[]\n\t\t\td = (x ^ e[c][0].ord).chr\n\t\t\tdecode.push(d)\n\t\t\tc += 1\n\t\tend\n\t\t\n\t\tdecode = decode.join\n\t\tdecode = decode.split(' ')\n\t\tdecode.each do |t|\n\t\t\tif(wl.has_key?(t)) then\n\t\t\t\tprintf \"found solution - key = %s\\nDecode = %s\\n\",e, decode \n\t\t\t\treturn\n\t\t\tend\n\t\tend\t\t\n\tend\n printf \"password not found\\n\"\nend", "title": "" }, { "docid": "aaba21042057855a84cfc8b687e98938", "score": "0.49279717", "text": "def affirmation_preamble\n response = \"\"\n clear\n typew(\"We are now going to do an affirmation exercise\")\n typew(\"By broadening the basis of our self-worth, affirmations can help us regulate our emotions.\")\n typew(\"Would you like to do this exercise, #{name}?(Y/N)\")\n response = gets.strip.downcase\n return response\n end", "title": "" } ]
43dbbbb4c503643aa5ba51803960550b
PUT /businessbooks/1 PUT /businessbooks/1.json
[ { "docid": "b2f9d851bc898529f28a6633ae476e4d", "score": "0.69470376", "text": "def update\n @businessbook = Businessbook.find(params[:id])\n\n respond_to do |format|\n if @businessbook.update_attributes(params[:businessbook])\n format.html { redirect_to @businessbook, :notice => 'Businessbook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @businessbook.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "872659a166a13bbd04d1cff0026745bc", "score": "0.6816322", "text": "def update\n @api_book = Api::Book.find(params[:id])\n\n if @api_book.update(api_book_params)\n head :no_content\n else\n render json: @api_book.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b80bded52d24d8d2fccc11f5506654a8", "score": "0.68015784", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n \n format.json { render json: @book, status: :created, location: @book }\n else\n \n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8509b585ac8f7501ecde8b5c9ae9311e", "score": "0.6615512", "text": "def update\n\t\trespond_to do |format|\n\t\t\tclient = Goodreads::Client.new(api_key: \"rSkvvZY8Wx27zcj4AfHA\", api_secret: \"S5WOpmY8pVtaEu1IwNn51DBafjoEIbjuxZdE6sNM\")\n\t\t\tbook = client.book_by_isbn(book_params[:isbn])\n\t\t\t@book.titlelong = book.title\n\t\t\t@book.description = strip_tags(book.description)\n\t\t\t@book.title = book.work.original_title\n\t\t\t@book.pages = book.num_pages\n\t\t\t@book.bookrating = book.average_rating\n\t\t\t@book.author = book.authors.author.name\n\t\t\t@book.publisher = book.publisher\n\t\t\t@book.save\n\t\t\tformat.html { redirect_to @book, notice: 'Book was successfully updated.' }\n\t\t\tformat.json { render :show, status: :ok, location: @book }\n\t\tend\n end", "title": "" }, { "docid": "7f153d3d5cebe6ce98c1211ea05f664e", "score": "0.64487374", "text": "def update\n @book = Book.find(params[:id])\n @book.attributes = params[:book]\n # a break point for debugging:\n # debugger\n client = Goodreads.new\n book_info = client.book_by_isbn(params[:book][:isbn])\n @book.title = book_info.title if @book.title.blank?\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5421db91f9af2df0e3e2bdd86eb7ba6c", "score": "0.64161587", "text": "def update\n @business = Business.find(params[:id])\n\n respond_to do |format|\n if @business.update_attributes(params[:business])\n format.html { redirect_to aciton: \"index\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39d7a8729300cdcc00d380a39ac430f7", "score": "0.6367759", "text": "def update\n @book = Book.find_by_id(params[:id])\n\n if @book.present?\n if @book.update(book_params)\n render json: {\n type: 'success',\n result: @book\n }, status: :created\n else\n render json: {\n type: 'failed',\n message: @book.errors,\n result: {}\n }, status: :bad_request\n end\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": "e79ad65974dd91ef5b7631449343b27a", "score": "0.63424164", "text": "def update\n @business = Business.find(params[:id])\n\n respond_to do |format|\n if @business.update_attributes(business_params)\n format.html { redirect_to businesses_path, notice: I18n.t('commons.successfully_updated') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48f8b3026bbeef5ef1c661bfcec24b05", "score": "0.6319049", "text": "def update\n @book = @collection.books.find(params[:id])\n #original: @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to book_series_collection_books_url(@book_series, @collection), notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a35d59e84a3667495168546aa7402c48", "score": "0.6302526", "text": "def update\n @business = Business.find(params[:id])\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b09fe5e935ad2691f1666a4e616975cd", "score": "0.6262543", "text": "def update\n @booking = Booking.find(params[:id])\n\n if @booking.update(booking_params)\n head :no_content\n else\n render json: @booking.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0bcfe24ce2ff90a39755bddd577cbc5b", "score": "0.6261328", "text": "def update\n\n if params[:action] == \"RETURN_BOOK\" \n @book.return()\n elseif params[:action] == \"BORROW_BOOK\"\n @book.borrow()\n end\n \n if @book.update(book_params)\n head :no_content\n else\n render json: @book.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "51a6f6510be66bc73fefb638ba0d0f62", "score": "0.6230062", "text": "def update\r\n @book = Book.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @book.update_attributes(params[:book])\r\n format.html { redirect_to books_url }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @book.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "23f108174d419082bffe767edaa0288c", "score": "0.6225963", "text": "def putBusiness( name, building_number, branch_name, address1, address2, address3, district, town, county, province, postcode, country, latitude, longitude, timezone, telephone_number, additional_telephone_number, email, website, category_id, category_type, do_not_display, referrer_url, referrer_name, destructive, delete_mode, master_entity_id)\n params = Hash.new\n params['name'] = name\n params['building_number'] = building_number\n params['branch_name'] = branch_name\n params['address1'] = address1\n params['address2'] = address2\n params['address3'] = address3\n params['district'] = district\n params['town'] = town\n params['county'] = county\n params['province'] = province\n params['postcode'] = postcode\n params['country'] = country\n params['latitude'] = latitude\n params['longitude'] = longitude\n params['timezone'] = timezone\n params['telephone_number'] = telephone_number\n params['additional_telephone_number'] = additional_telephone_number\n params['email'] = email\n params['website'] = website\n params['category_id'] = category_id\n params['category_type'] = category_type\n params['do_not_display'] = do_not_display\n params['referrer_url'] = referrer_url\n params['referrer_name'] = referrer_name\n params['destructive'] = destructive\n params['delete_mode'] = delete_mode\n params['master_entity_id'] = master_entity_id\n return doCurl(\"put\",\"/business\",params)\n end", "title": "" }, { "docid": "f4ba48332fa280d22df7081433fe24d8", "score": "0.62095773", "text": "def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to businesses_path, notice: 'Business was successfully updated.' }\n format.json { render :index, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d1858a12dce698b618c9fe8a887dec11", "score": "0.6199712", "text": "def update\n @business_object = BusinessObject.find(params[:id])\n\n respond_to do |format|\n if @business_object.update_attributes(params[:business_object])\n format.html { redirect_to @business_object, :notice => 'Business object was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @business_object.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1920bbd3a4cf6928af6c9f294c9f9f9c", "score": "0.6150143", "text": "def update\n params[:book_shelf]['user'] = User.where(:id => params[:book_shelf]['user']).first\n params[:book_shelf]['book'] = Book.where(:id => params[:book_shelf]['book']).first\n @book_shelf = BookShelf.find(params[:id])\n respond_to do |format|\n if @book_shelf.update_attributes(params[:book_shelf])\n format.html { redirect_to @book_shelf, notice: 'Book shelf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book_shelf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec0a0f8efb9c1b28c4944995120dcb25", "score": "0.6147326", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62cf2a8d0e589ed4c6bea3fa839d7c46", "score": "0.61428815", "text": "def update\n @book = Book.find(params[:id])\n \n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e4bd702458bb168778b2f7124e3d81d", "score": "0.6136365", "text": "def update\n respond_to do |format|\n if @boc.update(boc_params)\n format.html { redirect_to @boc, notice: 'Boc was successfully updated.' }\n format.json { render :show, status: :ok, location: @boc }\n else\n format.html { render :edit }\n format.json { render json: @boc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb742dbc968cc03643047297110cfd72", "score": "0.61291105", "text": "def update\n @book = Book.find_by_sql(\"SELECT * FROM Books B WHERE B.id = \" + params[:id]).first()\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to '/books', notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47a7ad42e5c847ce7175e8440c364660", "score": "0.61208934", "text": "def update\n req = ActiveSupport::JSON.decode(request.body)\n @bookmark = Bookmark.find(req)\n\n respond_to do |format|\n if @bookmark.update_attributes(params[:id])\n format.html { redirect_to @bookmark, notice: 'Bookmark was successfully updated.' }\n format.json { render json: @bookmark, status: :created, location: @bookmarks }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bookmark.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d131470ed402858fd3314900ef8ff74", "score": "0.6119501", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, :notice => 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @book.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6d944cd6fc389dd13592c2102b18a4fd", "score": "0.61129636", "text": "def update\n if @boat.update(boat_params)\n head :no_content\n else\n render json: @boat.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "55dc679e8ae9ab08f7fe5756be21b439", "score": "0.61098146", "text": "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6104201", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6104201", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6104201", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6104201", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6104201", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6104201", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6104201", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6104201", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ee0edf4c2dfc340471a7d5443cff6f7", "score": "0.6104201", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cb7c54d85f972976cd9c357e6e611860", "score": "0.6095832", "text": "def update\n @business = @user.businesses.find(params[:id])\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to edit_user_business_path(@user, @business), notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15a07ce5492b1f03897edeebae64796b", "score": "0.60797", "text": "def update\n @book = Book.find(params[:id])\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a87acf72a875bf6cb352867b9ea78e2c", "score": "0.6070015", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66e89d334c658d61f7fbde583aa59330", "score": "0.6068675", "text": "def ajax_book_update\r\n @book = Book.find(params[:id])\r\n @book.isbn = params[:isbn]\r\n @book.title = params[:title]\r\n @book.save\r\n end", "title": "" }, { "docid": "553652075c350f0644eb8f7a0dfeebfc", "score": "0.60555243", "text": "def update\n @business = Business.find(params[:id])\n authorize! :update, @business\n\n respond_to do |format|\n if @business.update_attributes(business_params || {})\n format.html { redirect_to business_path(@business), notice: 'Business was successfully updated.' }\n format.json do\n respond_with_bip(@business.becomes(Business), param: param_key)\n end\n else\n format.html { render action: \"edit\" }\n format.json do\n respond_with_bip(@business.becomes(Business), param: param_key)\n end\n end\n end\n end", "title": "" }, { "docid": "8829e385fa27a121011b26dc7118c8d5", "score": "0.6044873", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to manage_books_path, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "591dac39e0089d44be17cfd47811a656", "score": "0.60379666", "text": "def update\n @booking = Booking.find(params[:id])\n @booking.update_attributes(params[:booking])\n respond_with(@booking)\n end", "title": "" }, { "docid": "66e1b1e1d76c1dfe8b13d1fcc2c640b6", "score": "0.6021931", "text": "def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66e1b1e1d76c1dfe8b13d1fcc2c640b6", "score": "0.6021931", "text": "def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66e1b1e1d76c1dfe8b13d1fcc2c640b6", "score": "0.6021931", "text": "def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66e1b1e1d76c1dfe8b13d1fcc2c640b6", "score": "0.6021931", "text": "def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66e1b1e1d76c1dfe8b13d1fcc2c640b6", "score": "0.60213566", "text": "def update\n respond_to do |format|\n if @business.update(business_params)\n format.html { redirect_to @business, notice: 'Business was successfully updated.' }\n format.json { render :show, status: :ok, location: @business }\n else\n format.html { render :edit }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b73cd865e3b363ddc34021f5fd7a7120", "score": "0.5975859", "text": "def update\n @book = Book.find(params[:id])\n \n respond_to do |format|\n if @book.update_attributes_and_index(params[:book])\n flash[:notice] = 'Book was successfully updated.'\n format.html { redirect_to(@book) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @book.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "157e37c9d8145f6f371e6acb0ad0ee89", "score": "0.5973296", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.xml { head :ok }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @book.errors, status: :unprocessable_entity}\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f272b1dd558c4e14bc5ac21dd3a077e", "score": "0.5969223", "text": "def update\n @business = Business.find(params[:id])\n\n respond_to do |format|\n if @business.update_attributes(params[:business])\n format.html { redirect_to admin_business_path(@business), notice: 'Business was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b04b58a085d05e3fd2c2d84bd88cf3c6", "score": "0.5968278", "text": "def update\n\t\t@book = Book.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @book.update_attributes(params[:book])\n\t\t\t\tformat.html { redirect_to @book, :notice => 'Book was successfully updated.' }\n\t\t\t\tformat.json { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.json { render :json => @book.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "ccdfead8c36a2e3748c78571df2933f0", "score": "0.5951959", "text": "def update\n @library_book = LibraryBook.find(params[:id])\n\n respond_to do |format|\n if @library_book.update_attributes(params[:library_book])\n format.html { redirect_to @library_book, notice: 'Library book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @library_book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a2affe4724c379b4402f38441f8bd34", "score": "0.5941086", "text": "def update\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4eecb44518f6daf11dd266815fa46c3a", "score": "0.5937685", "text": "def update\n @business_type = BusinessType.find(params[:id])\n\n respond_to do |format|\n if @business_type.update_attributes(params[:business_type])\n format.html { redirect_to @business_type, notice: 'Business type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @business_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "358dc1a0e9b1990682d8964e3192e76c", "score": "0.5919043", "text": "def update\n @cookbook = Cookbook.find(params[:id])\n\n respond_to do |format|\n if @cookbook.update_attributes(params[:cookbook])\n format.html { redirect_to @cookbook, notice: 'Cookbook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "64f73358e037e396c0330a44cf9dcc99", "score": "0.59186155", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: \"Book was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "64f73358e037e396c0330a44cf9dcc99", "score": "0.59186155", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: \"Book was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b6d50da8883485709e045a2eb995929", "score": "0.5916843", "text": "def update\n @book = Book.find(params[:id])\n @book.update(book_params)\n redirect_to root_path\n end", "title": "" }, { "docid": "74014bdf1b8df46429ad80b5dfba8d9d", "score": "0.5915652", "text": "def set_api_v1_booking\n @api_v1_booking = Booking.find(params[:id])\n end", "title": "" }, { "docid": "855f81d29ee8ff100cfefb3479cedcdd", "score": "0.5913509", "text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "title": "" }, { "docid": "66d915e66ac9e02025797fddf34f9596", "score": "0.5908636", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render layout: 'form', action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3cf65c4dfa6e0fff128ae6dbb971851c", "score": "0.5908382", "text": "def update\n respond_to do |format|\n if @boat_document.update(boat_document_params)\n format.html { redirect_to @boat_document, notice: 'Boat document was successfully updated.' }\n format.json { render :show, status: :ok, location: @boat_document }\n else\n format.html { render :edit }\n format.json { render json: @boat_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a96764b6236ff25e3872e05452e31b42", "score": "0.58988166", "text": "def update\n @book = Book.find(params[:id])\n\n respond_to do |format|\n if @book.update_attributes(params[:book])\n format.html { redirect_to [current_user, @book], notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0efe1b1512f00bbc25fdaf3f906fbef5", "score": "0.5893364", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5d412e517e30427eb0e587be64f45a1", "score": "0.58922476", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book,\n notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n\n @books = Book.all\n ActionCable.server.broadcast 'books',\n html: render_to_string('library/index', layout: false)\n else\n format.html { render :edit }\n format.json { render json: @book.errors,\n status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "845e7f3e12fe39da785f9da239216277", "score": "0.5889895", "text": "def update\n book = Book.find(params[:id])\n book.update_attributes(params[:book])\n redirect_to(book)\n end", "title": "" }, { "docid": "5ff1483484d05fbd019d1f906eee2ba2", "score": "0.58749235", "text": "def update\n @user_book = UserBook.find(params[:id])\n\n respond_to do |format|\n if @user_book.update_attributes(params[:user_book])\n format.html { redirect_to new_user_book_path, notice: 'Your book was successfully updated. You can add more or go back to your shelf' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "699e0794ba17eb99de465956fae7c6f9", "score": "0.586139", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: t('common.message.updated_success')}\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "acd777139955347ec7cec7a36f418f90", "score": "0.5857807", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: \"Book was successfully updated.\" }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.5853388", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a20f406522b66b2a1e2ead307ebd7e3", "score": "0.58517957", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "181a932321397e03d94b49b8a2b63c46", "score": "0.58516085", "text": "def update\n respond_to do |format|\n if @library_book.update(library_book_params)\n format.html { redirect_to @library_book, notice: 'Library book was successfully updated.' }\n format.json { render :show, status: :ok, location: @library_book }\n else\n format.html { render :edit }\n format.json { render json: @library_book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a797e60ced09d92ffdf3d22b741ab6bc", "score": "0.584871", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n add_title_to_book\n end", "title": "" }, { "docid": "ab889d0ec6dab2acdd30b1f5107f169a", "score": "0.5845522", "text": "def update\n respond_to do |format|\n if @library_book.update(library_book_params)\n format.html { redirect_to @library_book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @library_book }\n else\n format.html { render :edit }\n format.json { render json: @library_book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3feab321cfbfb523ead0bf5a8ded9249", "score": "0.58354735", "text": "def update\n @businesstype = Businesstype.find(params[:id])\n\n respond_to do |format|\n if @businesstype.update_attributes(params[:businesstype])\n format.html { redirect_to @businesstype, notice: 'Businesstype was successfully updated.' }\n format.json { render :show, status: :ok, location: @businesstype }\n else\n format.html { render :edit }\n format.json { render json: @businesstype.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46e63738c96527c0781f91db75126cc9", "score": "0.5834295", "text": "def update\n\n respond_to do |format|\n if @company_business.update_attributes(params[:company_business])\n format.html { redirect_to @company_business, notice: 'Company business was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company_business.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "107b78e2cc606ec92b42af2952247e4c", "score": "0.5819901", "text": "def update\r\n respond_to do |format|\r\n if @book.update(book_params)\r\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @book }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @book.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "8b124337527ebe4831166325221ccf17", "score": "0.5811182", "text": "def update\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
982f5516152fcba753f7b6947efa5645
lexer rule t__80! (T__80) (in Mig.g)
[ { "docid": "033a3d7a6e943d12989d9daa0d5be801", "score": "0.5660029", "text": "def t__80!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 41 )\n\n\n\n type = T__80\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 47:9: 'ValueOf'\n match( \"ValueOf\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 41 )\n\n\n end", "title": "" } ]
[ { "docid": "95d4d89e8e03fbc9abefcdef312b032f", "score": "0.74614346", "text": "def t__80!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 58)\n\n type = T__80\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 64:9: '^'\n match(?^)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 58)\n\n end", "title": "" }, { "docid": "b75304115337e44c38549e98b18a3daf", "score": "0.7013748", "text": "def t__80!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 25 )\n\n type = T__80\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 31:9: ','\n match( 0x2c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 25 )\n\n end", "title": "" }, { "docid": "a31665535ad69b4a4f95ffcc62dba933", "score": "0.6936787", "text": "def t__65!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 43)\n\n type = T__65\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 49:9: '!'\n match(?!)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 43)\n\n end", "title": "" }, { "docid": "2b4276c58e29f996d877797cca1da0c7", "score": "0.67428046", "text": "def symbol!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 43 )\n\n \n # - - - - main rule block - - - -\n # at line 71:16: ( '!' | '#' .. '/' | ':' .. '@' | '[' .. '`' | '{' .. '~' | '\\\\\\\\\\\\\\\"' | 'á' | 'é' | 'í' | 'ó' | 'ú' | 'ñ' )\n alt_8 = 12\n alt_8 = @dfa8.predict( @input )\n case alt_8\n when 1\n # at line 71:18: '!'\n match( 0x21 )\n\n when 2\n # at line 71:24: '#' .. '/'\n match_range( 0x23, 0x2f )\n\n when 3\n # at line 71:35: ':' .. '@'\n match_range( 0x3a, 0x40 )\n\n when 4\n # at line 71:46: '[' .. '`'\n match_range( 0x5b, 0x60 )\n\n when 5\n # at line 71:57: '{' .. '~'\n match_range( 0x7b, 0x7e )\n\n when 6\n # at line 71:68: '\\\\\\\\\\\\\\\"'\n match( \"\\\\\\\"\" )\n\n when 7\n # at line 71:77: 'á'\n match( 0xe1 )\n\n when 8\n # at line 71:82: 'é'\n match( 0xe9 )\n\n when 9\n # at line 71:87: 'í'\n match( 0xed )\n\n when 10\n # at line 71:92: 'ó'\n match( 0xf3 )\n\n when 11\n # at line 71:98: 'ú'\n match( 0xfa )\n\n when 12\n # at line 71:103: 'ñ'\n match( 0xf1 )\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 43 )\n\n end", "title": "" }, { "docid": "d9edcfa87e4295adb35e3d619a1aa8a8", "score": "0.65311617", "text": "def t__68!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 46)\n\n type = T__68\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 52:9: '%='\n match(\"%=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 46)\n\n end", "title": "" }, { "docid": "477c5361be2ab0bc87da71d4437faa16", "score": "0.6515653", "text": "def t__86!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 64)\n\n type = T__86\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 70:9: '>='\n match(\">=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 64)\n\n end", "title": "" }, { "docid": "2ae528e8887e366f4e7283a3bc5e2872", "score": "0.64794207", "text": "def t__85!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 63)\n\n type = T__85\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 69:9: '<='\n match(\"<=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 63)\n\n end", "title": "" }, { "docid": "d0a304f6c1d76df5a9b514cf77e3bb3e", "score": "0.63987625", "text": "def t__83!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 61)\n\n type = T__83\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 67:9: '<'\n match(?<)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 61)\n\n end", "title": "" }, { "docid": "ff88354e9a6b2715a2918d76120c3ed6", "score": "0.6375734", "text": "def t__82!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 60)\n\n type = T__82\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 66:9: '!='\n match(\"!=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 60)\n\n end", "title": "" }, { "docid": "abb2a5ff382b0e659a7fd29e9e2da63a", "score": "0.6367464", "text": "def t__74!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 52)\n\n type = T__74\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 58:9: '^='\n match(\"^=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 52)\n\n end", "title": "" }, { "docid": "4143033f840974260973d2cfb9457322", "score": "0.63595706", "text": "def t__73!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 51)\n\n type = T__73\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 57:9: '&='\n match(\"&=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 51)\n\n end", "title": "" }, { "docid": "e75985559f9e3ac57fffa2a9d6566dfb", "score": "0.6307395", "text": "def t__75!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 53)\n\n type = T__75\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 59:9: '|='\n match(\"|=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 53)\n\n end", "title": "" }, { "docid": "a804009bc0bd8540b0bbfc589c5ade10", "score": "0.62712383", "text": "def t__88!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 33 )\n\n type = T__88\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 39:9: '<'\n match( 0x3c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 33 )\n\n end", "title": "" }, { "docid": "488d1ef72e797d8a93589280de27aaba", "score": "0.6223891", "text": "def t__63!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 41)\n\n type = T__63\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 47:9: '&'\n match(?&)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 41)\n\n end", "title": "" }, { "docid": "8791909cb510750566bdff09157cd993", "score": "0.62176174", "text": "def t__86!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n\n type = T__86\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 37:9: '=>'\n match( \"=>\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 31 )\n\n end", "title": "" }, { "docid": "4bc95db0d95a5d4f4f6894ae2330e968", "score": "0.6196599", "text": "def t__90!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = T__90\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 41:9: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n end", "title": "" }, { "docid": "3e7f543a92b3dfb919a3705f7c4ad198", "score": "0.61934525", "text": "def t__66!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 44)\n\n type = T__66\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 50:9: '*='\n match(\"*=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 44)\n\n end", "title": "" }, { "docid": "59830b092151844869023d89c1bef8ec", "score": "0.6169611", "text": "def t__37!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 29 )\n\n type = T__37\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 35:9: '&'\n match(0x26)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 29 )\n\n end", "title": "" }, { "docid": "3b38c7ec7b3cd6a1be816d9a1213f4e1", "score": "0.61686033", "text": "def t__79!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 57)\n\n type = T__79\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 63:9: '|'\n match(?|)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 57)\n\n end", "title": "" }, { "docid": "17a65414feada36be5f524d03f9b6349", "score": "0.6166126", "text": "def t__87!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 32 )\n\n type = T__87\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 38:9: '~'\n match( 0x7e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 32 )\n\n end", "title": "" }, { "docid": "e15eec513fe2b0f2b9cecc0dbd1630d9", "score": "0.6160186", "text": "def t__29!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n\n type = T__29\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 27:9: '%'\n match(0x25)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 21 )\n\n end", "title": "" }, { "docid": "3a07fa6baddf3248ddf169438a248907", "score": "0.61587346", "text": "def t__26!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 4)\n\n type = T__26\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 10:9: '='\n match(?=)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 4)\n\n end", "title": "" }, { "docid": "3b86fe2d7e50802272a0be821786f285", "score": "0.61389637", "text": "def t__81!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n\n type = T__81\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 32:9: '('\n match( 0x28 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n end", "title": "" }, { "docid": "01f0e3c8c22ca0e87698867fbb05dd80", "score": "0.612874", "text": "def noncontrol_char!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 36 )\n\n \n # - - - - main rule block - - - -\n # at line 64:25: ( LETTER | DIGIT | SYMBOL | SPACE )\n alt_7 = 4\n case look_7 = @input.peek( 1 )\n when 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a then alt_7 = 1\n when 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 then alt_7 = 2\n when 0x21, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x7b, 0x7c, 0x7d, 0x7e, 0xe1, 0xe9, 0xed, 0xf1, 0xf3, 0xfa then alt_7 = 3\n when 0x9, 0x20 then alt_7 = 4\n else\n raise NoViableAlternative( \"\", 7, 0 )\n end\n case alt_7\n when 1\n # at line 64:27: LETTER\n letter!\n\n when 2\n # at line 64:36: DIGIT\n digit!\n\n when 3\n # at line 64:44: SYMBOL\n symbol!\n\n when 4\n # at line 64:53: SPACE\n space!\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 36 )\n\n end", "title": "" }, { "docid": "0d6af4778dcd5b86d2a9a947efedd8bd", "score": "0.61241287", "text": "def t__70!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 48)\n\n type = T__70\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 54:9: '-='\n match(\"-=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 48)\n\n end", "title": "" }, { "docid": "6ff258aae64d41acb4c957e6dde7a660", "score": "0.6097861", "text": "def t__76!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 54)\n\n type = T__76\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 60:9: '?'\n match(??)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 54)\n\n end", "title": "" }, { "docid": "f057aa06b17bcd9eeb4d3465ea3dc852", "score": "0.6087811", "text": "def t__88!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 66)\n\n type = T__88\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 72:9: '>>'\n match(\">>\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 66)\n\n end", "title": "" }, { "docid": "b7d25cf3c004f68861f6108b01919c11", "score": "0.608035", "text": "def synpred_88_c!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 154)\n\n # at line 311:13: '*' IDENTIFIER\n match(T__52, TOKENS_FOLLOWING_T__52_IN_synpred88_C_1408)\n match(IDENTIFIER, TOKENS_FOLLOWING_IDENTIFIER_IN_synpred88_C_1410)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 154)\n\n end", "title": "" }, { "docid": "90162e2f2d8b0bf20c57ad289141835d", "score": "0.6073324", "text": "def t__93!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 38 )\n\n type = T__93\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 44:9: '$'\n match( 0x24 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 38 )\n\n end", "title": "" }, { "docid": "1b13d956dff6cd40013542aee9c3e29d", "score": "0.6029413", "text": "def t__64!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 42)\n\n type = T__64\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 48:9: '~'\n match(?~)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 42)\n\n end", "title": "" }, { "docid": "b1e497d05e77643ee2b3ce8a76a17274", "score": "0.6025496", "text": "def t__89!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 34 )\n\n type = T__89\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 40:9: '>'\n match( 0x3e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 34 )\n\n end", "title": "" }, { "docid": "e191346fcf8da921cd08ec72cc03b55c", "score": "0.6022355", "text": "def t__57!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 35)\n\n type = T__57\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 41:9: '%'\n match(?%)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 35)\n\n end", "title": "" }, { "docid": "2abfdedc4f8fd44c43c2672ad87c4f94", "score": "0.5996477", "text": "def t__81!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 59)\n\n type = T__81\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 65:9: '=='\n match(\"==\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 59)\n\n end", "title": "" }, { "docid": "dafc404a6d983b07106dae92a8b008a9", "score": "0.59830135", "text": "def tilde!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 106 )\n\n\n\n type = TILDE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 266:9: '~'\n match( 0x7e )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 106 )\n\n\n end", "title": "" }, { "docid": "9a656f798203f8aa168368e22c451a26", "score": "0.59765446", "text": "def chunk_char!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 13)\n\n \n # - - - - main rule block - - - -\n # at line 62:3: (~ ( '>' | '<' | '#' | '`' | '\\\"' | '\\\\'' | '|' | '(' | ')' | '$' | ';' | ' ' | '?' | '*' | '~' | '\\\\\\\\' | '\\\\t' | '{' | '}' | '\\\\n' | '\\\\r' ) | '\\\\\\\\' . )\n alt_20 = 2\n look_20_0 = @input.peek(1)\n\n if (look_20_0.between?(0x0000, ?\\b) || look_20_0.between?(0x000B, ?\\f) || look_20_0.between?(0x000E, 0x001F) || look_20_0 == ?! || look_20_0.between?(?%, ?&) || look_20_0.between?(?+, ?:) || look_20_0 == ?= || look_20_0.between?(?@, ?[) || look_20_0.between?(?], ?_) || look_20_0.between?(?a, ?z) || look_20_0.between?(0x007F, 0xFFFF)) \n alt_20 = 1\n elsif (look_20_0 == ?\\\\) \n alt_20 = 2\n else\n nvae = NoViableAlternative(\"\", 20, 0)\n raise nvae\n end\n case alt_20\n when 1\n # at line 62:5: ~ ( '>' | '<' | '#' | '`' | '\\\"' | '\\\\'' | '|' | '(' | ')' | '$' | ';' | ' ' | '?' | '*' | '~' | '\\\\\\\\' | '\\\\t' | '{' | '}' | '\\\\n' | '\\\\r' )\n if @input.peek(1).between?(0x0000, ?\\b) || @input.peek(1).between?(0x000B, ?\\f) || @input.peek(1).between?(0x000E, 0x001F) || @input.peek(1) == ?! || @input.peek(1).between?(?%, ?&) || @input.peek(1).between?(?+, ?:) || @input.peek(1) == ?= || @input.peek(1).between?(?@, ?[) || @input.peek(1).between?(?], ?_) || @input.peek(1).between?(?a, ?z) || @input.peek(1).between?(0x007F, 0x00FF)\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n\n when 2\n # at line 64:5: '\\\\\\\\' .\n match(?\\\\)\n match_any\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 13)\n\n end", "title": "" }, { "docid": "a07dcd6b696de1c3ff43c71e7d688157", "score": "0.5971392", "text": "def t__28!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = T__28\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 26:9: '@'\n match(0x40)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n end", "title": "" }, { "docid": "1cda880a543ffe3f2f63c6fec31980ac", "score": "0.59711", "text": "def t__65!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 1 )\n\n type = T__65\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 7:9: '\\\\r'\n match( 0xd )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 1 )\n\n end", "title": "" }, { "docid": "b4ab7a88b79221c852dfce835281f10c", "score": "0.59623355", "text": "def t__91!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 36 )\n\n type = T__91\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 42:9: '?'\n match( 0x3f )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 36 )\n\n end", "title": "" }, { "docid": "d22c2253c1dc1077789f620f062b77da", "score": "0.5953698", "text": "def t__84!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 62)\n\n type = T__84\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 68:9: '>'\n match(?>)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 62)\n\n end", "title": "" }, { "docid": "a79b9706984669d827a3f851d59a0358", "score": "0.59531164", "text": "def t__96!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 74)\n\n type = T__96\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 80:9: 'for'\n match(\"for\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 74)\n\n end", "title": "" }, { "docid": "b428df990bc41510447af9b43269ba37", "score": "0.5949994", "text": "def t__39!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n\n type = T__39\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 37:9: '-'\n match(0x2d)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 31 )\n\n end", "title": "" }, { "docid": "05653a9b916e40b1275616bf9cb6b4ed", "score": "0.5939002", "text": "def tilde!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = TILDE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 174:9: '~'\n match( 0x7e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n end", "title": "" }, { "docid": "a4196b5e403d3c1b7aceb070ea3d94bd", "score": "0.59254164", "text": "def synpred_65_c!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 131)\n\n # at line 258:67: abstract_declarator_suffix\n @state.following.push(TOKENS_FOLLOWING_abstract_declarator_suffix_IN_synpred65_C_1047)\n abstract_declarator_suffix\n @state.following.pop\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 131)\n\n end", "title": "" }, { "docid": "7a5156e88761a7fd9ce0d80051ae30e7", "score": "0.58965915", "text": "def t__38!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 30 )\n\n type = T__38\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 36:9: '/'\n match(0x2f)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 30 )\n\n end", "title": "" }, { "docid": "6bfe2ae009e9ffac363fe1dc4601fed6", "score": "0.58897394", "text": "def t__95!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 56 )\n\n\n\n type = T__95\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 62:9: 'in'\n match( \"in\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 56 )\n\n\n end", "title": "" }, { "docid": "fdc1e2c5db2af0192b4a3e83d92ed6b8", "score": "0.58860034", "text": "def t__78!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 23 )\n\n type = T__78\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 29:9: ':'\n match( 0x3a )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 23 )\n\n end", "title": "" }, { "docid": "40f859a044802eaf9b08cd5dc6d382c9", "score": "0.5884668", "text": "def t__97!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 58 )\n\n\n\n type = T__97\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 64:9: 'intran'\n match( \"intran\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 58 )\n\n\n end", "title": "" }, { "docid": "911abcd58dd3e107270c73b97775208b", "score": "0.5881771", "text": "def t__68!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 4 )\n\n type = T__68\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 10:9: ']'\n match( 0x5d )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 4 )\n\n end", "title": "" }, { "docid": "40bc0e606cdde47bf420a64cd1d66c4b", "score": "0.58816004", "text": "def t__82!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n\n type = T__82\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 33:9: '|'\n match( 0x7c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n end", "title": "" }, { "docid": "0e541b5407f579c544db0f522cb161d7", "score": "0.58759046", "text": "def t__58!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 36)\n\n type = T__58\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 42:9: '++'\n match(\"++\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 36)\n\n end", "title": "" }, { "docid": "3cd225064c8002ce12e0ce919f4fd29b", "score": "0.58562934", "text": "def t__96!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 57 )\n\n\n\n type = T__96\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 63:9: 'inout'\n match( \"inout\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 57 )\n\n\n end", "title": "" }, { "docid": "70472003efac88d4ee937ec389521d42", "score": "0.58496773", "text": "def t__32!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 10)\n\n type = T__32\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 16:9: 'char'\n match(\"char\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 10)\n\n end", "title": "" }, { "docid": "42839fed2690418edcb0107444837e9a", "score": "0.58438057", "text": "def t__50!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 28)\n\n type = T__50\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 34:9: '['\n match(?[)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 28)\n\n end", "title": "" }, { "docid": "42dc19ff1de799a6c7a57d1f2adf062d", "score": "0.5835351", "text": "def t__78!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 56)\n\n type = T__78\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 62:9: '&&'\n match(\"&&\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 56)\n\n end", "title": "" }, { "docid": "5db3ae0e8de0b6af77fd96615cdf863d", "score": "0.58340126", "text": "def t__83!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 28 )\n\n type = T__83\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 34:9: ')'\n match( 0x29 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 28 )\n\n end", "title": "" }, { "docid": "46ebc837fe46e9bb4d43726ff2a43839", "score": "0.5832167", "text": "def t__87!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 48 )\n\n\n\n type = T__87\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 54:9: 'ctype'\n match( \"ctype\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 48 )\n\n\n end", "title": "" }, { "docid": "81ec381385e07847525cf541bfb612ea", "score": "0.58203304", "text": "def synpred_83_c!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 149)\n\n # at line 301:5: 'sizeof' unary_expression\n match(T__60, TOKENS_FOLLOWING_T__60_IN_synpred83_C_1297)\n @state.following.push(TOKENS_FOLLOWING_unary_expression_IN_synpred83_C_1299)\n unary_expression\n @state.following.pop\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 149)\n\n end", "title": "" }, { "docid": "28686605a8cac8fbf37e5e5935c64229", "score": "0.5807685", "text": "def t__93!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 54 )\n\n\n\n type = T__93\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 60:9: 'iimport'\n match( \"iimport\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 54 )\n\n\n end", "title": "" }, { "docid": "125eb01d6b43301da20a37d81b790660", "score": "0.5788142", "text": "def t__40!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = T__40\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 29:9: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n end", "title": "" }, { "docid": "dda23626ce2ce11eb79b103f82242feb", "score": "0.5772577", "text": "def t__22!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n type = T__22\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 20:9: '<'\n match(0x3c)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n end", "title": "" }, { "docid": "6425d3d1054b877f7e9306980ea4dbe3", "score": "0.5769901", "text": "def t__23!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n type = T__23\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 21:9: '>'\n match(0x3e)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n end", "title": "" }, { "docid": "d079b6c8d4c1f474fd3445de52d5f5a6", "score": "0.57690924", "text": "def t__66!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n type = T__66\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 8:9: '\\\\n'\n match( 0xa )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n end", "title": "" }, { "docid": "3db1850e0d19512c6b5de63cede86228", "score": "0.5754992", "text": "def t__77!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 55)\n\n type = T__77\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 61:9: '||'\n match(\"||\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 55)\n\n end", "title": "" }, { "docid": "80d7fb7481344f5c1f13799ba003e778", "score": "0.575075", "text": "def t__30!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n\n type = T__30\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 28:9: '_'\n match(0x5f)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 22 )\n\n end", "title": "" }, { "docid": "a54f3856f83c814ca07810a9aa61fc09", "score": "0.5741973", "text": "def t__34!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n\n type = T__34\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 32:9: '~'\n match(0x7e)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n end", "title": "" }, { "docid": "c9aad51030e6dfe950c1542fe94794f7", "score": "0.57400584", "text": "def t__35!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n\n type = T__35\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 33:9: '#'\n match(0x23)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n end", "title": "" }, { "docid": "7dcf1e47c1be542ccf5532eb1c2c6af3", "score": "0.57374173", "text": "def t__26!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n type = T__26\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 15:9: 'void'\n match( \"void\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end", "title": "" }, { "docid": "73b870d4cfa98c4520f723713fb1689d", "score": "0.57362306", "text": "def t__74!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 19 )\n\n type = T__74\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 25:9: '*'\n match( 0x2a )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 19 )\n\n end", "title": "" }, { "docid": "dade0b4858a7abe620de80eea9e310dd", "score": "0.5726369", "text": "def t__128!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 89 )\n\n\n\n type = T__128\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 95:10: 'ureplyport'\n match( \"ureplyport\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 89 )\n\n\n end", "title": "" }, { "docid": "1062db061051037552c9352091aa6760", "score": "0.5710504", "text": "def t__48!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 26)\n\n type = T__48\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 32:9: '('\n match(?()\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 26)\n\n end", "title": "" }, { "docid": "bac7d092c400102d9f2ca7d5c3380c01", "score": "0.57029986", "text": "def t__73!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n\n type = T__73\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 24:9: '::'\n match( \"::\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 18 )\n\n end", "title": "" }, { "docid": "b243fa59a39f39c6d051b2cfaf84da00", "score": "0.56925076", "text": "def t__59!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 37)\n\n type = T__59\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 43:9: '--'\n match(\"--\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 37)\n\n end", "title": "" }, { "docid": "caeb910549efb3a257873a0116f7569b", "score": "0.56876355", "text": "def exp!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n type = EXP\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 26:7: '^'\n match( 0x5e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end", "title": "" }, { "docid": "29d980c3a8b0fb570db533d8ffb51986", "score": "0.56794846", "text": "def t__39!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 19 )\n\n type = T__39\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 28:9: '='\n match( 0x3d )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 19 )\n\n end", "title": "" }, { "docid": "efd6b885e6d08130a9d23abe4b5c0202", "score": "0.56781304", "text": "def t__72!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 50)\n\n type = T__72\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 56:9: '>>='\n match(\">>=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 50)\n\n end", "title": "" }, { "docid": "226db3b8c2ad825878a9b310e2591e31", "score": "0.56769764", "text": "def mod!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 34 )\n\n\n\n type = MOD\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 94:6: '%'\n match( 0x25 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 34 )\n\n\n end", "title": "" }, { "docid": "a305caf4f17eafebe60b2cbe18bc2f1e", "score": "0.5668724", "text": "def t__127!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 88 )\n\n\n\n type = T__127\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 94:10: 'uimport'\n match( \"uimport\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 88 )\n\n\n end", "title": "" }, { "docid": "ce8fb5367d18493c133e0f5e8bcff530", "score": "0.5666593", "text": "def t__10!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n type = T__10\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 8:9: ';'\n match( 0x3b )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n end", "title": "" }, { "docid": "1b202974e694d139c73558723e87f380", "score": "0.5654219", "text": "def t__31!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 23 )\n\n type = T__31\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 29:9: '\\\\\\\\'\n match(0x5c)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 23 )\n\n end", "title": "" }, { "docid": "569d14b372c6069c3ce13bfc82fa41d9", "score": "0.565265", "text": "def t__87!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 65)\n\n type = T__87\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 71:9: '<<'\n match(\"<<\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 65)\n\n end", "title": "" }, { "docid": "425502ab6fa28e121e874f5b4574f7f4", "score": "0.5649658", "text": "def mod!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 55 )\n\n type = MOD\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 433:7: '%'\n match( 0x25 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 55 )\n\n end", "title": "" }, { "docid": "1a9108fad92342c199261666110dd59a", "score": "0.56468815", "text": "def t__38!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 16)\n\n type = T__38\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 22:9: 'signed'\n match(\"signed\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 16)\n\n end", "title": "" }, { "docid": "ed1e923be99d48f306f1b19724bbd10f", "score": "0.56459314", "text": "def t__71!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n\n type = T__71\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 22:9: ';'\n match( 0x3b )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n end", "title": "" }, { "docid": "f39aea7330917e98823dfab5fd07ef18", "score": "0.56428474", "text": "def t__40!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 18)\n\n type = T__40\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 24:9: '{'\n match(?{)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 18)\n\n end", "title": "" }, { "docid": "ed564c35370e8ab34811dc6d07886a9e", "score": "0.56389844", "text": "def mod!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n\n type = MOD\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 25:7: '%'\n match( 0x25 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 5 )\n\n end", "title": "" }, { "docid": "70916af4e3cee39bafe16631899b6cf9", "score": "0.5638836", "text": "def t__61!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 39)\n\n type = T__61\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 45:9: '.'\n match(?.)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 39)\n\n end", "title": "" }, { "docid": "6b77f2a560a6893a9bee511afc6f22df", "score": "0.5635551", "text": "def synpred30_Alias\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 48 )\n\n # at line 198:24: ~ ( ')' )\n if @input.peek( 1 ).between?( 0x0, 0x28 ) || @input.peek( 1 ).between?( 0x2a, 0xff )\n @input.consume\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 48 )\n\n end", "title": "" }, { "docid": "081b13169fdc1a6d3680b1a2c79b0d1b", "score": "0.5635072", "text": "def literal_char!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 43 )\n\n \n # - - - - main rule block - - - -\n # at line 482:2: ( ESC | ~ ( '\\\\'' | '\\\\\\\\' ) )\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0 == 0x5c )\n alt_6 = 1\n elsif ( look_6_0.between?( 0x0, 0x26 ) || look_6_0.between?( 0x28, 0x5b ) || look_6_0.between?( 0x5d, 0xffff ) )\n alt_6 = 2\n else\n raise NoViableAlternative( \"\", 6, 0 )\n end\n case alt_6\n when 1\n # at line 482:4: ESC\n esc!\n\n when 2\n # at line 483:4: ~ ( '\\\\'' | '\\\\\\\\' )\n if @input.peek( 1 ).between?( 0x0, 0x26 ) || @input.peek( 1 ).between?( 0x28, 0x5b ) || @input.peek( 1 ).between?( 0x5d, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 43 )\n\n end", "title": "" }, { "docid": "831847c988f5179ff59385406c430e6d", "score": "0.5621398", "text": "def t__55!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 33)\n\n type = T__55\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 39:9: '-'\n match(?-)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 33)\n\n end", "title": "" }, { "docid": "d341a3a8687dff935e85168a5546b85d", "score": "0.56167513", "text": "def esc!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 46 )\n\n \n # - - - - main rule block - - - -\n # at line 495:7: '\\\\\\\\' ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n match( 0x5c )\n # at line 496:3: ( 'n' | 'r' | 't' | 'b' | 'f' | '\\\"' | '\\\\'' | '\\\\\\\\' | '>' | 'u' XDIGIT XDIGIT XDIGIT XDIGIT | . )\n alt_9 = 11\n alt_9 = @dfa9.predict( @input )\n case alt_9\n when 1\n # at line 496:5: 'n'\n match( 0x6e )\n\n when 2\n # at line 497:5: 'r'\n match( 0x72 )\n\n when 3\n # at line 498:5: 't'\n match( 0x74 )\n\n when 4\n # at line 499:5: 'b'\n match( 0x62 )\n\n when 5\n # at line 500:5: 'f'\n match( 0x66 )\n\n when 6\n # at line 501:5: '\\\"'\n match( 0x22 )\n\n when 7\n # at line 502:5: '\\\\''\n match( 0x27 )\n\n when 8\n # at line 503:5: '\\\\\\\\'\n match( 0x5c )\n\n when 9\n # at line 504:5: '>'\n match( 0x3e )\n\n when 10\n # at line 505:5: 'u' XDIGIT XDIGIT XDIGIT XDIGIT\n match( 0x75 )\n xdigit!\n xdigit!\n xdigit!\n xdigit!\n\n when 11\n # at line 506:5: .\n match_any\n\n end\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 46 )\n\n end", "title": "" }, { "docid": "9c132f7c7fd6109968083c0874aa5d08", "score": "0.56157607", "text": "def synpred_54_c!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 120)\n\n # at line 227:5: '*' ( type_qualifier )+ ( pointer )?\n match(T__52, TOKENS_FOLLOWING_T__52_IN_synpred54_C_881)\n # at file 227:9: ( type_qualifier )+\n match_count_80 = 0\n while true\n alt_80 = 2\n look_80_0 = @input.peek(1)\n\n if (look_80_0.between?(T__46, T__47)) \n alt_80 = 1\n\n end\n case alt_80\n when 1\n # at line 0:0: type_qualifier\n @state.following.push(TOKENS_FOLLOWING_type_qualifier_IN_synpred54_C_883)\n type_qualifier\n @state.following.pop\n\n else\n match_count_80 > 0 and break\n @state.backtracking > 0 and raise(ANTLR3::Error::BacktrackingFailed)\n\n eee = EarlyExit(80)\n\n\n raise eee\n end\n match_count_80 += 1\n end\n\n # at line 227:25: ( pointer )?\n alt_81 = 2\n look_81_0 = @input.peek(1)\n\n if (look_81_0 == T__52) \n alt_81 = 1\n end\n case alt_81\n when 1\n # at line 0:0: pointer\n @state.following.push(TOKENS_FOLLOWING_pointer_IN_synpred54_C_886)\n pointer\n @state.following.pop\n\n end\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 120)\n\n end", "title": "" }, { "docid": "f53973e3f3eca0d775160f8148c7652c", "score": "0.56120896", "text": "def bang!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n type = BANG\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 12:8: '!'\n match( 0x21 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end", "title": "" }, { "docid": "396ec161269831f2a08dd3d13a50b301", "score": "0.56053185", "text": "def t__56!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 34)\n\n type = T__56\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 40:9: '/'\n match(?/)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 34)\n\n end", "title": "" }, { "docid": "f8690fd87b3ab4fc2132999cb5107324", "score": "0.5596591", "text": "def t__43!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = T__43\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 41:9: '\\\\''\n match(0x27)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n end", "title": "" }, { "docid": "2b77b1928df435e49c98b7e7b4275303", "score": "0.55946046", "text": "def t__71!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 49)\n\n type = T__71\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 55:9: '<<='\n match(\"<<=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 49)\n\n end", "title": "" }, { "docid": "d285d5278538e869d435662c18b5b361", "score": "0.5583812", "text": "def synpred_78_c!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 144)\n\n # at line 292:5: '(' type_name ')' cast_expression\n match(T__48, TOKENS_FOLLOWING_T__48_IN_synpred78_C_1242)\n @state.following.push(TOKENS_FOLLOWING_type_name_IN_synpred78_C_1244)\n type_name\n @state.following.pop\n match(T__49, TOKENS_FOLLOWING_T__49_IN_synpred78_C_1246)\n @state.following.push(TOKENS_FOLLOWING_cast_expression_IN_synpred78_C_1248)\n cast_expression\n @state.following.pop\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 144)\n\n end", "title": "" }, { "docid": "4d25c9caad9b7d1e3ea355787b34b1a2", "score": "0.557919", "text": "def t__81!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 42 )\n\n\n\n type = T__81\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 48:9: 'array'\n match( \"array\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 42 )\n\n\n end", "title": "" }, { "docid": "ca70616f40bfa14fa8197b8ca4ac58c8", "score": "0.5569758", "text": "def t__20!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n type = T__20\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 16:9: ')'\n match( 0x29 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n end", "title": "" }, { "docid": "1a214bb2493190aee8bee802cb0b345a", "score": "0.5565025", "text": "def token!\n # at line 1:8: ( PLUS | MINUS | MULT | DIV | MOD | EXP | LPAREN | RPAREN | T__19 | INT | FLOAT | MODVAR | UNMODVAR | WHITESPACE )\n alt_3 = 14\n alt_3 = @dfa3.predict( @input )\n case alt_3\n when 1\n # at line 1:10: PLUS\n plus!\n\n when 2\n # at line 1:15: MINUS\n minus!\n\n when 3\n # at line 1:21: MULT\n mult!\n\n when 4\n # at line 1:26: DIV\n div!\n\n when 5\n # at line 1:30: MOD\n mod!\n\n when 6\n # at line 1:34: EXP\n exp!\n\n when 7\n # at line 1:38: LPAREN\n lparen!\n\n when 8\n # at line 1:45: RPAREN\n rparen!\n\n when 9\n # at line 1:52: T__19\n t__19!\n\n when 10\n # at line 1:58: INT\n int!\n\n when 11\n # at line 1:62: FLOAT\n float!\n\n when 12\n # at line 1:68: MODVAR\n modvar!\n\n when 13\n # at line 1:75: UNMODVAR\n unmodvar!\n\n when 14\n # at line 1:84: WHITESPACE\n whitespace!\n\n end\n end", "title": "" }, { "docid": "3264b6789590f05617c100650e208bd8", "score": "0.5561699", "text": "def t__98!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 76)\n\n type = T__98\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 82:9: 'continue'\n match(\"continue\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 76)\n\n end", "title": "" } ]
278bec699decbc381645c2407b2e77c0
if value is a float, will check that it is no more than two decimal places
[ { "docid": "2e3990bd8c88790ed2130e102d4a4b15", "score": "0.6476016", "text": "def validate_2dp(value)\n # turn into string, split by decimal, check length of right hand side.\n string_value = value.to_s\n if string_value.include? '.'\n if string_value.split('.')[1].length > 2\n return invalid_input\n else\n return value\n end\n else\n return value\n end\nend", "title": "" } ]
[ { "docid": "27240c5a231819b5703e50b64e2eea85", "score": "0.7031489", "text": "def is_float?(number)\n number.include?(\".\") ? true : false\n # if number.include?(\".\")\n # true\n # else\n # false\n # end\nend", "title": "" }, { "docid": "3d77c222f8ee048a9c8c05afd457e4c5", "score": "0.7018882", "text": "def is_f?(value)\n /\\A\\d+\\.\\d+\\z/ === value\n end", "title": "" }, { "docid": "c66cc226dca3d761854cbe6b28d6a6c8", "score": "0.6950545", "text": "def force_2decimals(value)\n '%.2f' % value\nend", "title": "" }, { "docid": "c66cc226dca3d761854cbe6b28d6a6c8", "score": "0.6950545", "text": "def force_2decimals(value)\n '%.2f' % value\nend", "title": "" }, { "docid": "c66cc226dca3d761854cbe6b28d6a6c8", "score": "0.6950334", "text": "def force_2decimals(value)\n '%.2f' % value\nend", "title": "" }, { "docid": "5012765d0008846f1dfe333d4ddeea98", "score": "0.69193566", "text": "def is_f?(value)\n /\\A\\d+\\.\\d+\\z/ =~ value.to_s\n end", "title": "" }, { "docid": "1fbf9d6469625ece684122ec6d393767", "score": "0.69051707", "text": "def is_float?(val)\n val.to_f.to_s == val.to_s || is_numerical?(val)\nend", "title": "" }, { "docid": "9eeaf9f1cd8ac3907b57ee5af6a622b1", "score": "0.6871489", "text": "def float?(first_num)\n first_num.include? \".\"\nend", "title": "" }, { "docid": "477eed93e61e38faef84ed8f557fb038", "score": "0.68595773", "text": "def validate_float(v); end", "title": "" }, { "docid": "cf59c34c8351154a2675806bbb3d6f2b", "score": "0.6785868", "text": "def float_check(num)\n if num.include?(\".\")\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "11a1844e625548f8e7329606a7227f99", "score": "0.67769754", "text": "def float_check(num)\n\tif num.include?(\".\")\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend", "title": "" }, { "docid": "faf20d58145070a72c59e9e1b27feb7b", "score": "0.67567647", "text": "def valid_float?(num)\n num.to_f.to_s == num\nend", "title": "" }, { "docid": "2bad9e170d088eb7016b4475705c6390", "score": "0.67456037", "text": "def float?(input)\n input[/\\A[\\d]+[\\.]?[\\d]*\\z/] == input\n end", "title": "" }, { "docid": "e544f5a5fc08ae2d1cdb382be6a792f9", "score": "0.67225456", "text": "def check_float(t) \n t.gsub(/[^\\d\\.]+/, '').squeeze(\".\")\n dot_acc = 0\n for i in 0...(t.length) do\n if t[i] == '.'\n if dot_acc >= 1\n t[i] = ''\n end\n dot_acc += 1\n end\n end\n return t\n end", "title": "" }, { "docid": "e0c350a182568038cc45a559f75533c4", "score": "0.67185223", "text": "def check(x)\n if x.class == Float\n return x.round\n else\n return x\n end\n end", "title": "" }, { "docid": "2893eb0fbbbe468efc0215361013e6a9", "score": "0.671593", "text": "def float?\n return false if !self.numeric?\n self.split('.').length > 1\n end", "title": "" }, { "docid": "f9c53d0278835491579b0839a957395b", "score": "0.6700396", "text": "def float?(value)\n true if Float(value)\n rescue StandardError\n false\n end", "title": "" }, { "docid": "e7242c9bd849bbc312935d788b458b4f", "score": "0.6678231", "text": "def float_equal(a, b)\n (a - b).abs < Utils.precision\n end", "title": "" }, { "docid": "c02d792445fee5aa5e7d868c7b66b508", "score": "0.66550887", "text": "def check_double_precision(value,type_definition=nil,column_name=nil)\n if value.is_a?(Float) == false && value.is_a?(Integer) == false\n raise_exception(column_name,value,type_definition,\"Float or Integer\")\n end\n\n return value\n end", "title": "" }, { "docid": "3af7291915bc635c6295eefaeedf5dda", "score": "0.66468173", "text": "def float? value\n begin\n true if Float(value)\n rescue\n false\n end\n end", "title": "" }, { "docid": "78a3f061e5608b2cc52303e711838ac0", "score": "0.66277736", "text": "def float?(num)\n num.to_f.to_s == num\nend", "title": "" }, { "docid": "78a3f061e5608b2cc52303e711838ac0", "score": "0.66277736", "text": "def float?(num)\n num.to_f.to_s == num\nend", "title": "" }, { "docid": "78a3f061e5608b2cc52303e711838ac0", "score": "0.66277736", "text": "def float?(num)\n num.to_f.to_s == num\nend", "title": "" }, { "docid": "99fe4e127fd662ab1c2d3379336140e3", "score": "0.6627478", "text": "def float?(input)\n input.to_f.to_s == input\nend", "title": "" }, { "docid": "43b71a0e1ceb87741e2d9be0ed53ca2c", "score": "0.6557363", "text": "def decimals_or_floaters(number)\n number.to_i == number.to_f ? number= \"%.1f\" % [number] : number= \"%.2f\" % [number];\n end", "title": "" }, { "docid": "6686d8996c0dc5d67c15c65f714edfcd", "score": "0.6543954", "text": "def safe_float (num)\n return num.round(2)\n end", "title": "" }, { "docid": "7332e7349e3381a1c13ae9b37583182a", "score": "0.65319085", "text": "def check_float(a, b)\n tolerance = Math::TOLERANCE\n a = a.to_f\n b = b.to_f\n if a.finite? and b.finite?\n (a-b).abs < tolerance\n else\n true\n end\nend", "title": "" }, { "docid": "7332e7349e3381a1c13ae9b37583182a", "score": "0.65319085", "text": "def check_float(a, b)\n tolerance = Math::TOLERANCE\n a = a.to_f\n b = b.to_f\n if a.finite? and b.finite?\n (a-b).abs < tolerance\n else\n true\n end\nend", "title": "" }, { "docid": "0703a25df8a429eeef8c59ebb007d89c", "score": "0.6526945", "text": "def test_float?(data)\r\n return data.to_f.to_s == data\r\n end", "title": "" }, { "docid": "993f23c6bd4d42ec4e896cf761e5ddde", "score": "0.65253145", "text": "def test_float_numbers_less_than_1000_are_rounded_off_and_not_delimited\n property_of do\n Rantly { range(1, 999.00) { float } }\n end.check do |input|\n assert_equal '%.2f' % input, Helper.format_money(input)\n end\n end", "title": "" }, { "docid": "9be179b5e59a59ee01212f79998e4397", "score": "0.6466051", "text": "def float?(input)\n /\\d/.match(input) && /^\\d*\\.?\\d*$/.match(input)\nend", "title": "" }, { "docid": "119e61aedef590052f8bd3354ef43a9f", "score": "0.6447321", "text": "def validate_float_type(field)\n if field.is_a?(Float) && field >= 0\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "68b33adebfcf200c28bf9a679111d9e5", "score": "0.64455247", "text": "def float?\n pat = /^[-+]?[1-9]([0-9]*)?\\.[0-9]+$/\n return true if self=~pat \n return false \n end", "title": "" }, { "docid": "dd0317b51e1651bb362059f31d2ff73c", "score": "0.6444515", "text": "def is_float?\n return is_numeric? unless is_integer?\n false\n end", "title": "" }, { "docid": "181fb85d1c3a9c9a8c371b202db3f00b", "score": "0.64361244", "text": "def validate_float(input)\n begin\n value = Float(input)\n rescue\n return invalid_input\n end\n return validate_2dp(value)\nend", "title": "" }, { "docid": "684ee42a78cdd9b215765f763836997a", "score": "0.6397309", "text": "def float?\n return true\n end", "title": "" }, { "docid": "7dc54b4da301da6e5be37743564602ef", "score": "0.6395068", "text": "def decimal?(value)\n\t\t\tis_decimal = coerce_bool (value =~ /[+-]?[\\d_]+\\.[\\d_]+(e[+-]?[\\d_]+)?\\b|[+-]?[\\d_]+e[+-]?[\\d_]+\\b/i)\n\t\t\tunless is_decimal\n\t\t\t\t@error = \"Error, expected value to be a decimal, got: #{value}\"\n\t\t\tend\n\t\t\tis_decimal\n\t\tend", "title": "" }, { "docid": "2287500c484ea4ac874b6e0b4733b254", "score": "0.63901174", "text": "def float?\n return false\n end", "title": "" }, { "docid": "8c054e83dc0c5b227f854d396ede40de", "score": "0.6385487", "text": "def represents_a_whole_number?(float)\n float.to_i == float\nend", "title": "" }, { "docid": "94318d660438a7cceb82031cb42d3746", "score": "0.6350829", "text": "def is_float(sentence)\n true if Float(sentence) rescue false\nend", "title": "" }, { "docid": "a06f9e4b32651ed309626e0a16032e06", "score": "0.63300794", "text": "def integer_and_float(num)\n num = two_decimals(num) \n num.include?(\".00\") ? num = num.to_i : num = num.to_f.round(1)\nend", "title": "" }, { "docid": "8f37733761138e6f2e06de54970c9eb5", "score": "0.63285744", "text": "def valid_percentage?(value)\n !!(/^[0,1](\\.\\d{1,2})?$/ =~ value)\n end", "title": "" }, { "docid": "7b3d2c9970fc71a2a8c5a71fb006ab80", "score": "0.63125885", "text": "def float?\n !!Float(self) rescue false\n end", "title": "" }, { "docid": "071b04fa3b29850498b6546ef0ae37e1", "score": "0.6307422", "text": "def float?(input)\n Float(input) rescue false\nend", "title": "" }, { "docid": "071b04fa3b29850498b6546ef0ae37e1", "score": "0.6307422", "text": "def float?(input)\n Float(input) rescue false\nend", "title": "" }, { "docid": "28378504da8024a9fe3b3116f298f2a0", "score": "0.6295162", "text": "def value_condition\n value.present? && value > 0.01\n end", "title": "" }, { "docid": "a047cade0c848c8d7790ea65fa880858", "score": "0.6286626", "text": "def float?(input)\n Float(input) rescue false #following previous lesson's suggestion\nend", "title": "" }, { "docid": "f178fc0d232f1f0852c3f4c1f6cb78c7", "score": "0.62789756", "text": "def value_condition\n value.present? && value < 0.01\n end", "title": "" }, { "docid": "aebc95b629242d18e31ece447df85cec", "score": "0.6265548", "text": "def float?\n to_f.to_s == self\n end", "title": "" }, { "docid": "d29996c5e3b1248bb8e1e39102fc93ab", "score": "0.6224258", "text": "def has_decimal_point?\n self.include?('.')\n end", "title": "" }, { "docid": "f2f866c3d407ee2412e7601598a38e03", "score": "0.62082666", "text": "def decimal_or_float?\n column.type == :float || column.type == :decimal\n end", "title": "" }, { "docid": "cb835490bfd0b08a3409ec4fe7ce24c0", "score": "0.6201587", "text": "def test_float_numbers_greater_than_1000_are_delimited\n property_of do\n Rantly { range(1000.00, 9999.00) { float } }\n end.check do |input|\n expected_string = '%.2f' % input\n expected_string = expected_string.gsub(/(\\d)(?=(\\d{3})+(?!\\d))/, '\\\\1 ')\n assert_equal expected_string, Helper.format_money(input)\n end\n end", "title": "" }, { "docid": "2ff337bb118e14624ce52c61c693fd18", "score": "0.6194686", "text": "def two_decimals(f)\n sprintf('%.2f', f).gsub(/(\\d)(?=\\d{3}+(?:\\.|$))(\\d{3}\\..*)?/, '\\1,\\2')\n end", "title": "" }, { "docid": "8200fbe0b987e0873adaff9e5a7700f2", "score": "0.61916554", "text": "def floating?(ctx)\n value.floating?(ctx)\n end", "title": "" }, { "docid": "efd4966afbbdd15e0a8ecab35b53c603", "score": "0.61870587", "text": "def valid_side?(value)\n value.is_a?(Float) && value.finite? && value > 0\n end", "title": "" }, { "docid": "39c82c54bebb2bee8379141b541f0351", "score": "0.61751056", "text": "def compareFloat( a , exp )\n d = a - exp \n if (d < 0.0 )\n d = 0.0 - d\n end\n maxD = exp * 1.0e-14 \n ok = d < maxD\n if (ok)\n # ok\n else\n nil.pause\n end\n ok\nend", "title": "" }, { "docid": "660de1f9ebf5370e77137c9a1763b823", "score": "0.6171014", "text": "def test_exit_on_non_int_input_float\n assert_equal valid?(2.0), 0\n end", "title": "" }, { "docid": "2eaac72abde12b612a53cf6f26e7307a", "score": "0.6155582", "text": "def nonblank_float?\n return false if blank?\n !!to_f_or_nil\n end", "title": "" }, { "docid": "4d05b602ac83b8c1a8a65781d9091115", "score": "0.61472225", "text": "def is_valid_price?(price)\n price > 0.00\n end", "title": "" }, { "docid": "65a0185f68b53020781bba14bf712c9c", "score": "0.61362183", "text": "def blank_or_float?\n return true if blank?\n !!to_f_or_nil\n end", "title": "" }, { "docid": "0e97b759152c356fdeb27cd7b6182c63", "score": "0.6135584", "text": "def test_float\n\t\t42.12345\n\tend", "title": "" }, { "docid": "acb6a362e341dc62c2cfc842edbb3ab9", "score": "0.61131036", "text": "def apr_valid?(apr_number)\n apr_number = apr_number.to_f\n if apr_number == 0 || apr_number < 0.09\n false\n else \n apr_number /= 100\n end\nend", "title": "" }, { "docid": "a26c6d97334095c1181399643bb4d5ad", "score": "0.61095935", "text": "def fixed(value, places = 2)\r\n value = value.to_s.to_f unless value.is_a?(Float)\r\n sprintf(\"%0.#{places}f\", value.round(places))\r\n end", "title": "" }, { "docid": "bbe68a4373f398d0c11baa38c8234e6c", "score": "0.60989296", "text": "def verify_two_digit_currency_field(field, text)\n assert_match(/\\d\\.\\d\\d$/, text, \"#{field} should have two decimal places\")\n end", "title": "" }, { "docid": "d4e122b02b4e7628d3b5aa53672766e2", "score": "0.6086532", "text": "def is_f?\n !!(self =~ /^[-+]?[0-9,]+\\.[0-9]+$/)\n end", "title": "" }, { "docid": "d4e122b02b4e7628d3b5aa53672766e2", "score": "0.6086532", "text": "def is_f?\n !!(self =~ /^[-+]?[0-9,]+\\.[0-9]+$/)\n end", "title": "" }, { "docid": "711a3026aca14198ef13ec8887c13b88", "score": "0.6083456", "text": "def round_float(value)\n (value * 100).round / 100.0\n end", "title": "" }, { "docid": "37766589af9bfdaa267bbd6b21ca939d", "score": "0.6061201", "text": "def add_two_decimals(value)\n ('%.2f' % value)\n end", "title": "" }, { "docid": "2a13b34d72b79f8cc365c655b20985e1", "score": "0.60466504", "text": "def two_decimals(num)\n '%.2f' % num\nend", "title": "" }, { "docid": "9ec4c9e5c003f9517fcff595adfd5d1f", "score": "0.6041126", "text": "def is_f?\n return false if nil?\n\n to_s =~ /^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$/\n end", "title": "" }, { "docid": "7f0727bd90fea5b7c510e61d8a0ba7a3", "score": "0.60119194", "text": "def fractional_qty?\n issuage == 'F'\n end", "title": "" }, { "docid": "268771ef5eece84bcf2e674a37c35389", "score": "0.5994713", "text": "def number_test(number)\n return Float(number) != nil rescue false\nend", "title": "" }, { "docid": "20ba2a9c35c401553e831a2c086b4410", "score": "0.59847134", "text": "def decimals\n return @item_value if @decimals==\"INF\"\n return BigDecimal(@item_value).round(@decimals.to_i).to_s(\"F\")\n end", "title": "" }, { "docid": "b28bcfa273a87ea161bfdd05844e6a24", "score": "0.5979562", "text": "def float?\n properties.include? 'float'\n end", "title": "" }, { "docid": "4d4a43278e80759cbb7e1322f2a7c3f2", "score": "0.5977078", "text": "def format_float(value)\n value.is_a?(String) ? value : ('%0.1f' % value)\n end", "title": "" }, { "docid": "fbe734759210a963cece2ebc74b4fec6", "score": "0.59615415", "text": "def in_range(value)\n\t\treturn 2.375 if value > 2.375\n\t\treturn 0 if value < 0\n\t\treturn value\n\tend", "title": "" }, { "docid": "439684ca784660ba1e1dcf6f64e3e8f7", "score": "0.5949948", "text": "def e?\n return @record[5].to_f > 79.99\n end", "title": "" }, { "docid": "5ca51175eaa891f864b60911bb44f1a5", "score": "0.5948598", "text": "def test_number_float\n b = @my_bc.number?(\"123.123456789\")\n assert_equal true, b\n end", "title": "" }, { "docid": "3192aeaa044b8f91da29653a7e91bc3c", "score": "0.5944683", "text": "def to_decimals decimals = 2\n \"%.#{decimals}f\" % self\n end", "title": "" }, { "docid": "9486a64340ef1ace92bd9050308ef5c6", "score": "0.5938206", "text": "def value_to_float(value); end", "title": "" }, { "docid": "9486a64340ef1ace92bd9050308ef5c6", "score": "0.5938206", "text": "def value_to_float(value); end", "title": "" }, { "docid": "87d56d0cfb850594e55ea61f2e43a2b0", "score": "0.5936191", "text": "def num_is_float?(num_string)\n !(num_string !~ /^\\s*[+-]?((\\d+_?)*\\d+(\\.(\\d+_?)*\\d+)?|\\.(\\d+_?)*\\d+)(\\s*|([eE][+-]?(\\d+_?)*\\d+)\\s*)$/)\nend", "title": "" }, { "docid": "db6edefded2b1fb3d083abcb3fee9fea", "score": "0.59331083", "text": "def more_expensive_than?(other_price)\n Float(self.price) > Float(other_price)\n end", "title": "" }, { "docid": "1d7e6a1516dcf083ab5d7982f39b67d5", "score": "0.5932754", "text": "def float?\n @kind == :float_lit || @kind == :float_exp_lit\n end", "title": "" }, { "docid": "8ef7a059d9df09957c6e968b6cabaf35", "score": "0.5918198", "text": "def test_assert_float_equal_success\n assert_float_equal 1.0, 1.0\n end", "title": "" }, { "docid": "accd604b1330c6344bd08b86adf834a7", "score": "0.5917284", "text": "def float_with_precision(val, options)\n number_with_precision(val.to_f, :precision => 1)\n end", "title": "" }, { "docid": "151a177439e5d7f8a117222e5766ac4a", "score": "0.59121776", "text": "def what_you_would_get_if_not_full\n what_you_would_get_if_not_full_raw.round(2)\n end", "title": "" }, { "docid": "2e8171fbd3a2394a09c2096a123f8a5c", "score": "0.59116274", "text": "def valid_number?(number)\n number.to_i.to_s == number || number.to_f.to_s == number\n # Shortcoming #1: 1.0000 converted to 1.0 => false\n # Shortcoming #2: 1. is converted to 1.0 => false\nend", "title": "" }, { "docid": "a2dc378561fa08f0ab3927b04d6915bf", "score": "0.5907518", "text": "def is_float?(string)\n if string !~ /^\\s*[+-]?((\\d+_?)*\\d+(\\.(\\d+_?)*\\d+)?|\\.(\\d+_?)*\\d+)(\\s*|([eE][+-]?(\\d+_?)*\\d+)\\s*)$/\n return false\n else\n return true\n end\n end", "title": "" }, { "docid": "53202b3da5add6d7eeff019abcbdb223", "score": "0.5906882", "text": "def l?\n return @record[5].to_f < 10.01\n end", "title": "" }, { "docid": "0da874d77cfb189aa42008ddf0fa37a0", "score": "0.5906483", "text": "def is_f?\n !!(self =~ /^[-+]?\\d+.\\d+$/)\n end", "title": "" }, { "docid": "cdbf63a41af47a0c95366fd30000fed3", "score": "0.59034383", "text": "def is_discounted\n price.to_f <= 2\n end", "title": "" }, { "docid": "d3e77f6e1e05723ad6cf8e094af084db", "score": "0.58932847", "text": "def number?(value)\n !Float(value).nil?\n rescue TypeError, ArgumentError\n false\n end", "title": "" }, { "docid": "92405abb7bc5554e7512d0822d70b779", "score": "0.5889732", "text": "def is_valid_money_amount?(money)\n return money.class == Float && (money == 0.0 || money >= 0.01)\n end", "title": "" }, { "docid": "d0d56bf5f05dc1adefe4b9159922afcf", "score": "0.58824533", "text": "def additional_precision(amount)\n _, decimals = amount.to_s.split(\".\")\n decimals&.length || 0\n end", "title": "" }, { "docid": "a0a3619e1071216746a2ae9e2b3318b4", "score": "0.5877676", "text": "def is_float?(value, decimal_separator = POINT)\n if decimal_separator == POINT\n return value.\n gsub(COMMA_SPACE_REGEX, EMPTY) if !(value =~ DECIMAL_POINT_REGEX).nil?\n else\n return value.\n gsub(POINT_SPACE_REGEX, EMPTY).\n gsub(COMMA, POINT) if !(value =~ DECIMAL_COMMA_REGEX).nil?\n end\n end", "title": "" }, { "docid": "196c77bbdd81d5d9fdfb3c0f1e0dfc40", "score": "0.58650327", "text": "def numeric_check(first_num)\n Float(first_num) != nil rescue false\nend", "title": "" }, { "docid": "9baddd6de11b37288e6977f08c4bbd94", "score": "0.5864499", "text": "def float?\n return @def.float?\n end", "title": "" }, { "docid": "4177374b28a42ae2155e164c8d9eb5ea", "score": "0.58625877", "text": "def discounted?\n return price.to_f < 200 \n end", "title": "" }, { "docid": "2b38569c9fedbc1d9f68b69905631521", "score": "0.58490366", "text": "def valid_number?(num)\n num =~ /^\\d*\\.?\\d*$/\nend", "title": "" } ]
e758976ed4a2553c212f26444c976259
gets the match history of the player refered by account_id on region_name server
[ { "docid": "650df06e1c7a6fcaad6123fec1a56cdc", "score": "0.60275525", "text": "def get_recent_games(account_id, region_name)\n client = get_check_client(region_name)\n return client.game.recent(account_id)\n end", "title": "" } ]
[ { "docid": "2d8b303abf01d0dda44935277c5a9de7", "score": "0.6488691", "text": "def history(options = {})\n response = run_request('GetMatchHistory', options)['result']\n History.new(response) if response\n end", "title": "" }, { "docid": "3c411dcd395214469325b22d6e8fec94", "score": "0.6049909", "text": "def get_file_history(account_id, region_name, lightApiConsumption = false)\n games = get_recent_games(account_id, region_name)\n parsed_games = []\n names = nil\n if lightApiConsumption == false\n names = get_parsed_games_player_names(games, account_id, region_name)\n end\n games.each do |game| \n parsed_games.push(get_parsed_game(game, account_id, region_name, names))\n end\n\n return parsed_games\n end", "title": "" }, { "docid": "2da2635db80cd9cc598189a6c857331e", "score": "0.6028829", "text": "def find_game_ids\n matches = RestClient.get(\"https://na1.api.riotgames.com/lol/match/v4/matchlists/by-account/#{self.acc_id}?endIndex=10&beginIndex=0&api_key=#{self.key}\")\n @matches = JSON.parse(matches)\n @game_ids = @matches[\"matches\"].map do |id|\n id[\"gameId\"]\n end\n end", "title": "" }, { "docid": "f4bb76008d50d0d7486f2cff3a225944", "score": "0.60201097", "text": "def replay_history\n game.players(true).each { |p| @queue.push(p) }\n game.cards(true).each { |c| @queue.push(c) }\n # game.game_events(true).where('mid' => { '$gt' => @last_mid }).each do |event|\n # @queue.push(event)\n # end\n end", "title": "" }, { "docid": "f22d4133ed9db400986489965084ff22", "score": "0.5891538", "text": "def get_match(region, id, retrys = 0)\n if retrys == 0\n # print \"Getting match from riot\\n\"\n end\n match_path1 = \"/api/lol/\"\n match_path2 = \"/v2.2/match/\"\n key = get_key(region)\n match_uri = URI::HTTPS.build(host: region + REQUEST_BASE,\n path: match_path1 + region + match_path2 + id.to_s,\n query: {api_key: key}.to_query)\n json = HTTParty.get(match_uri)\n if json.code != 200\n if retrys < 3\n print \"retrying match #{{region: region, id: id, key: key, code: json.code}}\\n\"\n @failed_api_keys[key] += 1\n sleep(RETRY_SLEEP_TIME * retrys)\n return get_match(region, id, retrys + 1)\n else\n print \"get match failed: #{{region: region, id: id, key: key, code: json.code}}\\n\"\n @failed_api_keys[key] += 1\n @errors << \"There was an error retreiving match data {id: #{id}}\"\n return false\n end\n end\n summoners = []\n ActiveRecord::Base.connection_pool.with_connection do\n json[\"participantIdentities\"].each do |participant|\n participant = participant[\"player\"]\n summoner = Summoner.where(summoner_id: participant[\"summonerId\"])[0]\n if summoner\n summoner.update(username: participant[\"summonerName\"],\n stripped_username: participant[\"summonerName\"].gsub(/\\s+/, \"\").downcase)\n summoners << summoner\n else\n summoners << Summoner.create(username: participant[\"summonerName\"],\n stripped_username: participant[\"summonerName\"].gsub(/\\s+/, \"\").downcase,\n region: region, summoner_id: participant[\"summonerId\"])\n end\n # summoners << Summoner.find_or_create_by(username: participant[\"summonerName\"],\n # stripped_username: participant[\"summonerName\"].gsub(/\\s+/, \"\").downcase,\n # region: region, summoner_id: participant[\"summonerId\"])\n end\n unless summoners.count == 10 || summoners.count == 6\n @errors << {message: \"bad match not right number of summoners\",\n summoners_count: summoners.count,\n match: json[\"participantIdentities\"]}\n end\n begin\n Game.create(game_id: id, summoners: summoners)\n rescue ActiveRecord::RecordNotUnique => e\n Game.includes(:summoners).find_by(game_id: id)\n end\n end\n end", "title": "" }, { "docid": "845f4ece5f732b8690025505046e0194", "score": "0.5873018", "text": "def getMyGameHistory\n \n end", "title": "" }, { "docid": "57fdaa8ac1de7e55b6bea4e08bbd0686", "score": "0.582285", "text": "def set_player_history\n @player_history = PlayerHistory.find(params[:id])\n end", "title": "" }, { "docid": "bb3977faed31950b5b4363e19434fcc6", "score": "0.5738043", "text": "def all_player_matches(player)\n result = Match.joins(:results).where(:results => {:player_id => player})\n @player_matches = Array.new\n result.each do |m|\n @player_matches << m.id\n end\n return @player_matches\n end", "title": "" }, { "docid": "50999b87866d5927171cb87e19b69eba", "score": "0.571566", "text": "def matchlist_recent(account_id: )\n response_for MATCHLIST_RECENT_V3, {accountId: account_id}\n end", "title": "" }, { "docid": "bb5c42f2253827cc7e7eb9b99037ad09", "score": "0.570886", "text": "def history\n game = Terra::GameState.find(params[:id])\n @history = {:events=>game.history_events(params[:after_turn].to_i)}\n unless params[:after_turn]\n @history[:originalPlayers] = (game.players - game.created_players).map{|q| q.to_hash}\n @history[:originalLocations] = (game.locations).map{|q| q.to_hash}\n end\n #@bs = @history.map {|q| {:id=>q[:id], :created_at=>q[:created_at]} }\n respond_to do |format|\n format.html\n format.amf {render :amf => @history}\n end\n end", "title": "" }, { "docid": "e5d55ab318035c930e11abf4ea8dd2fe", "score": "0.5698994", "text": "def recent_game_stats_for(usr)\n #refined = []\n processed = []\n begin\n #processed = []\n account_id = usr.hon_id #TODO make this better. Use user id for everything.\n full_history = match_history_for(usr.nickname) #returns an array whose 0th element is a comma-separated string of all matches played since 2011\n history_split = full_history[0][\"history\"].split(',') #separate the matches, which are further separated into \"<match-id>| 2 | <date>\"\n #recent_string_25 = history_split[-25].split('|')[0] \n #history_split[-24,24].each do |frag| #string of the last 25 match ids separated by a \"+\"\n # recent_string_25 << \"+\" << frag.split('|')[0]\n #end\n arr_25 = history_split.collect {|match| match.split('|')[0]}\n arr_25 = arr_25[-25,25] if arr_25.size >= 25\n recent_string_25 = arr_25.join(\"+\")\n #logger.debug \"Recent String: #{recent_string_25}\"\n multimatch_raw = match_stats_multimatch_for(recent_string_25)\n multimatch_raw[1].each do |inv_summ|\n if inv_summ[\"account_id\"]==account_id\n #add the inv data to the proper array entry \n processed.push(inv_summ)\n end\n end\n slot = 0\n #@TODO Make this less icky\n multimatch_raw[2].each do |stats|\n if stats.value?(account_id)\n processed.each do |part|\n if part.value?(stats[\"match_id\"])\n part.merge!(stats)\n end\n end\n end\n end\n # This is a pain TODO fix it\n #refined = processed.inject([]) do |r, p|kroy\n #refined = processed.collect do |p|\n\n #TODO outsource this to MatchStat model\n #refined = MatchStat.parse_match(multimatch_raw)\n #@refined = @stats.select {|s| s[\"hon_id\"]==account_id}\n \n rescue Exception => e\n logger.debug e\n #@refined = false\n processed = false\n end\n \n return processed\n end", "title": "" }, { "docid": "82fdc236343bc31aae1631b88e15868e", "score": "0.56745315", "text": "def recent_matches\n\t\tMatch.where(\"(team1_id=? OR team2_id=?) AND result<>?\",self.id, self.id,-2).order(id: :desc).limit(4)\n\tend", "title": "" }, { "docid": "294be00578919dce5d514bd4f9181047", "score": "0.56704795", "text": "def account_history\n get('account/history')\n end", "title": "" }, { "docid": "4eb6b90c22abe7db57732da1c8fb0f73", "score": "0.5652324", "text": "def get_match_by_id(match_id)\n\t\tresult = perform_request(\"https://euw.api.pvp.net/api/lol/euw/v2.2/match/\"+match_id.to_s+\"?includeTimeline=true&api_key=\"+Rails.application.secrets.riot_api_key.to_s)\t\n\t\tif check_http_error_code(result)\n\t\t\tjsonMatch = JSON.parse(result)\n\t\t\tif jsonMatch\n\t\t\t\t# Add new match in the match DB Table\n\t\t\t\tnewDbMatch = Match.find_or_create_by(riot_id: jsonMatch['matchId'])\n\t\t\t\tnewDbMatch.match_date = Time.at(jsonMatch['matchCreation']/1000)\n\t\t\t\tnewDbMatch.team_type = TeamType.find_by(key: jsonMatch['queueType'])\n\t\t\t\tnewDbMatch.version = jsonMatch['matchVersion'].to_s\n\t\t\t\tnewDbMatch.duration = jsonMatch['matchDuration']\n\t\t\t\tnewDbMatch.season = Season.find_by(riot_key: jsonMatch['season'])\n\t\t\t\tnewDbMatch.save\n\n\t\t\t\t# Add the two team in the match_teams table\n\t\t\t\tteams = jsonMatch['teams']\n\t\t\t\tteam100 = \"\"\n\t\t\t\tteam200 = \"\"\n\t\t\t\tteams.each do |team|\n\t\t\t\t\tmatchTeam = MatchTeam.find_or_create_by({ match_id: newDbMatch.id, riot_id: team['teamId']})\n\t\t\t\t\tmatchTeam.riot_id = team['teamId']\n\t\t\t\t\tmatchTeam.won = team['winner']\n\t\t\t\t\tmatchTeam.first_blood = team['firstBlood']\n\t\t\t\t\tmatchTeam.first_tower = team['firstTower']\n\t\t\t\t\tmatchTeam.first_inhibitor = team['firstInhibitor']\n\t\t\t\t\tmatchTeam.first_baron = team['firstBaron']\n\t\t\t\t\tmatchTeam.first_dragon = team['firstDragon']\n\t\t\t\t\tmatchTeam.tower_kills = team['towerKills']\n\t\t\t\t\tmatchTeam.inhibitor_kills = team['inhibitorKills']\n\t\t\t\t\tmatchTeam.baron_kills = team['baronKills']\n\t\t\t\t\tmatchTeam.dragon_kills = team['dragonKills']\n\t\t\t\t\tmatchTeam.vilemaw_kills = team['vilemawKills']\n\t\t\t\t\tmatchTeam.save\n\t\t\t\t\tif matchTeam.riot_id == 100\n\t\t\t\t\t\tteam100 = matchTeam\n\t\t\t\t\telse\n\t\t\t\t\t\tteam200 = matchTeam\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t# Get all participants_event from match\n\t\t\t\tparticipants_events_array = get_participants_event_from_match_by_json(jsonMatch)\n\n\t\t\t\t# Add all participants in the match_participants table\n\t\t\t\tparticipants = jsonMatch['participants']\n\t\t\t\tparticipants.each do |participant|\n\t\t\t\t\tsummoners = jsonMatch['participantIdentities']\n\t\t\t\t\tdb_summoner = nil\n\t\t\t\t\tsummoners.each do |summoner|\n\t\t\t\t\t\tif summoner['participantId'] == participant['participantId']\n\t\t\t\t\t\t\tdb_summoner = Summoner.find_by(id: summoner['player']['summonerId'].to_i)\n\t\t\t\t\t\t\tif db_summoner== nil || db_summoner.name == \"\"\n\t\t\t\t\t\t\t\tdb_summoner = Summoner.new(LolApiHelper.get_summoner_by_id(summoner['player']['summonerId']))\n\t\t\t\t\t\t\t\tdb_summoner.generate_token\n\t\t\t\t\t\t\t\tdb_summoner.save\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tdb_summoner.region = Region.find_by(name: \"euw\") # BEFORE REGION MIGRATION\n\t\t\t\t\t\t\tdb_summoner.save\n\t\t\t\t\t\t\tdb_summoner.get_tier_and_division\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\tif participant['teamId'] == 100\n\t\t\t\t\t\tdbParticipant = MatchParticipant.find_or_create_by({ match_team_id: team100.id, summoner_id: db_summoner.id, participant_number: participant['participantId']})\n\t\t\t\t\telse\n\t\t\t\t\t\tdbParticipant = MatchParticipant.find_or_create_by({ match_team_id: team200.id, summoner_id: db_summoner.id, participant_number: participant['participantId']})\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\t# Set MatchParticipant stats\n\t\t\t\t\tdbParticipant.league_tier = db_summoner.league_tier\n\t\t\t\t\tdbParticipant.league_division = db_summoner.league_division\n\t\t\t\t\tdbParticipant.summoner_level = db_summoner.summonerLevel\n\t\t\t\t\tdbParticipant.spell1_id = participant['spell1Id']\n\t\t\t\t\tdbParticipant.spell2_id = participant['spell2Id']\n\t\t\t\t\tdbParticipant.champion_id = participant['championId']\n\t\t\t\t\tdbParticipant.champion_level = participant['stats']['champLevel']\n\t\t\t\t\tdbParticipant.item0_id = participant['stats']['item0']\n\t\t\t\t\tdbParticipant.item1_id = participant['stats']['item1']\n\t\t\t\t\tdbParticipant.item2_id = participant['stats']['item2']\n\t\t\t\t\tdbParticipant.item3_id = participant['stats']['item3']\n\t\t\t\t\tdbParticipant.item4_id = participant['stats']['item4']\n\t\t\t\t\tdbParticipant.item5_id = participant['stats']['item5']\n\t\t\t\t\tdbParticipant.item6_id = participant['stats']['item6']\n\t\t\t\t\tdbParticipant.kills = participant['stats']['kills']\n\t\t\t\t\tdbParticipant.double_kills = participant['stats']['doubleKills']\n\t\t\t\t\tdbParticipant.triple_kills = participant['stats']['tripleKills']\n\t\t\t\t\tdbParticipant.quadra_kills = participant['stats']['quadraKills']\n\t\t\t\t\tdbParticipant.penta_kills = participant['stats']['pentaKills']\n\t\t\t\t\tdbParticipant.unreal_kills = participant['stats']['unrealKills']\n\t\t\t\t\tdbParticipant.largest_killing_spree = participant['stats']['largestKillingSpree']\n\t\t\t\t\tdbParticipant.deaths = participant['stats']['deaths']\n\t\t\t\t\tdbParticipant.assists = participant['stats']['assists']\n\t\t\t\t\tdbParticipant.total_damage_dealt = participant['stats']['totalDamageDealt']\n\t\t\t\t\tdbParticipant.total_damage_dealt_to_champions = participant['stats']['totalDamageDealtToChampions']\n\t\t\t\t\tdbParticipant.total_damage_taken = participant['stats']['totalDamageTaken']\n\t\t\t\t\tdbParticipant.largest_critical_strike = participant['stats']['largestCriticalStrike']\n\t\t\t\t\tdbParticipant.total_heal = participant['stats']['totalHeal']\n\t\t\t\t\tdbParticipant.minions_killed = participant['stats']['minionsKilled']\n\t\t\t\t\tdbParticipant.neutral_minions_killed = participant['stats']['neutralMinionsKilled']\n\t\t\t\t\tdbParticipant.neutral_minions_killed_team_jungle = participant['stats']['neutralMinionsKilledTeamJungle']\n\t\t\t\t\tdbParticipant.neutral_minions_killed_enemy_jungle = participant['stats']['neutralMinionsKilledEnemyJungle']\n\t\t\t\t\tdbParticipant.gold_earned = participant['stats']['goldEarned']\n\t\t\t\t\tdbParticipant.gold_spent = participant['stats']['goldSpent']\n\t\t\t\t\tdbParticipant.combat_player_score = participant['stats']['combatPlayerScore']\n\t\t\t\t\tdbParticipant.objective_player_score = participant['stats']['objectivePlayerScore']\n\t\t\t\t\tdbParticipant.total_player_score = participant['stats']['totalPlayerScore']\n\t\t\t\t\tdbParticipant.total_score_rank = participant['stats']['totalScoreRank']\n\t\t\t\t\tdbParticipant.magic_damage_dealt_to_champions = participant['stats']['magicDamageDealtToChampions']\n\t\t\t\t\tdbParticipant.physical_damage_dealt_to_champions = participant['stats']['physicalDamageDealtToChampions']\n\t\t\t\t\tdbParticipant.true_damage_dealt_to_champions = participant['stats']['trueDamageDealtToChampions']\n\t\t\t\t\tdbParticipant.vision_wards_bought_in_game = participant['stats']['visionWardsBoughtInGame']\n\t\t\t\t\tdbParticipant.sight_wards_bought_in_game = participant['stats']['sightWardsBoughtInGame']\n\t\t\t\t\tdbParticipant.magic_damage_dealt = participant['stats']['magicDamageDealt']\n\t\t\t\t\tdbParticipant.physical_damage_dealt = participant['stats']['physicalDamageDealt']\n\t\t\t\t\tdbParticipant.true_damage_dealt = participant['stats']['trueDamageDealt']\n\t\t\t\t\tdbParticipant.magic_damage_taken = participant['stats']['magicDamageTaken']\n\t\t\t\t\tdbParticipant.physical_damage_taken = participant['stats']['physicalDamageTaken']\n\t\t\t\t\tdbParticipant.true_damage_taken = participant['stats']['trueDamageTaken']\n\t\t\t\t\tdbParticipant.first_blood_kill = participant['stats']['firstBloodKill']\n\t\t\t\t\tdbParticipant.first_blood_assist = participant['stats']['firstBloodAssist']\n\t\t\t\t\tdbParticipant.first_tower_kill = participant['stats']['firstTowerKill']\n\t\t\t\t\tdbParticipant.first_tower_assist = participant['stats']['firstTowerAssist']\n\t\t\t\t\tdbParticipant.first_inhibitor_kill = participant['stats']['firstInhibitorKill']\n\t\t\t\t\tdbParticipant.first_inhibitor_assist = participant['stats']['firstInhibitorAssist']\n\t\t\t\t\tdbParticipant.inhibitor_kills = participant['stats']['inhibitorKills']\n\t\t\t\t\tdbParticipant.tower_kills = participant['stats']['towerKills']\n\t\t\t\t\tdbParticipant.wards_placed = participant['stats']['wardsPlaced']\n\t\t\t\t\tdbParticipant.wards_killed = participant['stats']['wardsKilled']\n\t\t\t\t\tdbParticipant.largest_multi_kill = participant['stats']['largestMultiKill']\n\t\t\t\t\tdbParticipant.killing_sprees = participant['stats']['killingSprees']\n\t\t\t\t\tdbParticipant.total_units_healed = participant['stats']['totalUnitsHealed']\n\t\t\t\t\tdbParticipant.total_time_crowd_control_dealt = participant['stats']['totalTimeCrowdControlDealt']\n\t\t\t\t\tdbParticipant.player_lane = PlayerLane.find_by(key: participant['timeline']['lane'])\n\t\t\t\t\tdbParticipant.player_role = PlayerRole.find_by(key: participant['timeline']['role'])\n\t\t\t\t\tif dbParticipant.save\n\t\t\t\t\t\t# Store every event linked to a match_participant\n\t\t\t\t\t\tparticipants_events_array.each do |participant_event|\n\t\t\t\t\t\t\tif participant_event['participantId'] == participant['participantId']\n\t\t\t\t\t\t\t\tmatch_participant_event_db = MatchParticipantEvent.find_or_create_by({match_participant_id: dbParticipant.id, timing: participant_event['timing']})\n\t\t\t\t\t\t\t\tif participant_event['position']\n\t\t\t\t\t\t\t\t\tmatch_participant_event_db.position_x = participant_event['position']['x']\n\t\t\t\t\t\t\t\t\tmatch_participant_event_db.position_y = participant_event['position']['y']\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\tmatch_participant_event_db.current_gold = participant_event['currentGold']\n\t\t\t\t\t\t\t\tmatch_participant_event_db.total_gold = participant_event['totalGold']\n\t\t\t\t\t\t\t\tmatch_participant_event_db.level = participant_event['level']\n\t\t\t\t\t\t\t\tmatch_participant_event_db.xp = participant_event['xp']\n\t\t\t\t\t\t\t\tmatch_participant_event_db.minions_killed = participant_event['minionsKilled']\n\t\t\t\t\t\t\t\tmatch_participant_event_db.jungle_minions_killed = participant_event['jungleMinionsKilled']\n\t\t\t\t\t\t\t\tmatch_participant_event_db.timing = participant_event['timing']\n\t\t\t\t\t\t\t\tmatch_participant_event_db.match_participant = dbParticipant\n\t\t\t\t\t\t\t\tmatch_participant_event_db.save\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn newDbMatch\n\t\telse\n\t\t\tcheck_query_resut(result, \"get_match_by_id\", match_id)\n\t\tend\n\tend", "title": "" }, { "docid": "d5f444ea5fe98054fb97921fdab8da82", "score": "0.56496423", "text": "def matches\n Match.where(\"winning_player_id = ? OR losing_player_id = ?\", self.id, self.id).order(created_at: :desc)\n end", "title": "" }, { "docid": "4b916be0e384cf6819eefa9318028149", "score": "0.56377804", "text": "def replay_history\n game.game_events(true).where('mid' => { '$gt' => @last_mid }).each do |event|\n puts \"replaying event #{event.id}\"\n @queue.push(event)\n end\n end", "title": "" }, { "docid": "53936b578860077036f35ac8d4d0a1ca", "score": "0.56020105", "text": "def get summoner_id\n perform_request(api_url(\"matchhistory/#{summoner_id}\"))\n end", "title": "" }, { "docid": "a4a21fc51df8ae5839943aa4f3b5952a", "score": "0.55859387", "text": "def get_grpc_history\n add_breadcrumb \"GRPC History\", :order_to_payments_get_grpc_history_path\n @past_grpc = PurchaseOrder\n .order(\"updated_at desc\")\n .where(\"grpc_number like ? and order_type like ?\", \"%#{@grpc.grpc_number}%\", \"%#{GRPC}%\")\n .page(params[:page])\n .per(params[:row] ? params[:row] : 5)\n not_found if @past_grpc.blank?\n end", "title": "" }, { "docid": "0807d0a5e1a56ee084926abaf624f391", "score": "0.557723", "text": "def recent(summoner, optional={})\n region = optional[:region] || @sightstone.region\n id = if summoner.is_a? Summoner\n summoner.id\n else\n summoner\n end\n uri = \"https://prod.api.pvp.net/api/lol/#{region}/v1.3/game/by-summoner/#{id}/recent\"\n \n response = _get_api_response(uri)\n _parse_response(response) { |resp|\n data = JSON.parse(resp)\n history = MatchHistory.new(data)\n if block_given?\n yield history\n else\n return history\n end\n }\n end", "title": "" }, { "docid": "08e8b97e5b6efaed117ee1d2cefaeeab", "score": "0.5569539", "text": "def get_device_camera_analytics_zone_history(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'serial' => options['serial'],\r\n 'zone_id' => options['zone_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/devices/{serial}/camera/analytics/zones/{zoneId}/history'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'serial' => options['serial'],\r\n 'zoneId' => options['zone_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_builder = APIHelper.append_url_with_query_parameters(\r\n _query_builder,\r\n {\r\n 't0' => options['t0'],\r\n 't1' => options['t1'],\r\n 'timespan' => options['timespan'],\r\n 'resolution' => options['resolution'],\r\n 'objectType' => options['object_type']\r\n },\r\n array_serialization: Configuration.array_serialization\r\n )\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "title": "" }, { "docid": "b74d5c22467ce9a61843a5ab157c63a1", "score": "0.5547286", "text": "def all_player_matches(player)\n result = Match.joins(:results).where(:results => {:user_id => player})\n @player_matches = Array.new\n result.each do |m|\n @player_matches << m.id\n end\n return @player_matches\nend", "title": "" }, { "docid": "94cf4e029960376735db79bbb6fb931f", "score": "0.5533295", "text": "def all_player_matches(player)\n result = Match.joins(:results).where(:results => {:user_id => player})\n @player_matches = Array.new\n result.each do |m|\n @player_matches << m.id\n end\n return @player_matches\n end", "title": "" }, { "docid": "eb5db3db969e3c99aa05bedb8ef952e9", "score": "0.5445134", "text": "def getHistoryEntries\n\t\thistory = getDataFromJson(File.join(@repoDir, \"history\"))\n\tend", "title": "" }, { "docid": "67e596030a3f12d731b4c10899aa63c5", "score": "0.5404167", "text": "def history(id)\n @simplegeo.records_dispatch(:get_history, id)\n end", "title": "" }, { "docid": "286b6ae67cca397cfd3f0ad795aae86e", "score": "0.53672355", "text": "def get_username_history(username)\n response = get(\"http://api.fishbans.com/history/#{username}\")\n response['data']['history']\n end", "title": "" }, { "docid": "7fe8e0904859448dc4511c9c513f2097", "score": "0.53515303", "text": "def rooms_history(room_id, date, timezone)\n self.class.get(hipchat_api_url_for('rooms/history'), :query => {:auth_token => @token, :room_id => room_id, :date => date,\n :timezone => timezone})\n end", "title": "" }, { "docid": "e0e908d653f1553b23a9bc29b3c9e26e", "score": "0.5328899", "text": "def show\n @player = Player.find( params[:id] )\n @matches = Match.order( 'time DESC, id DESC ' ).where( 'winner_id = ? or loser_id = ?', @player.id, @player.id )\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end", "title": "" }, { "docid": "7af98f6ba7fbbe33bcd809d898c6eac3", "score": "0.5328249", "text": "def history(opposing_player)\n {\n \"win_percentage\": self.win_percentage_vs(opposing_player),\n \"avg_total_points\": self.avg_total_points_vs(opposing_player),\n \"total_games\": self.total_games_vs(opposing_player)\n }\n end", "title": "" }, { "docid": "3bda60aec18537923ce38b1c9f5bc672", "score": "0.53169084", "text": "def add_3game_match\n @players = Player.find(:all, :order => \"username\").map {|u| [u.username]} \n end", "title": "" }, { "docid": "d328c3b034811d329f6ed8569f31cea9", "score": "0.5306149", "text": "def past_games_by_user db, username\n sql = %q[SELECT * FROM games WHERE player1 = $1 OR player2 = $1 AND game_winner IS NOT NULL]\n result = db.exec(sql, [username])\n result.entries\n end", "title": "" }, { "docid": "29cd46932ba66285b279e2931b36afd6", "score": "0.5303671", "text": "def get(match_id, includeTimeline)\n perform_request(api_url(\"match/#{match_id}\", { includeTimeline: includeTimeline }))\n end", "title": "" }, { "docid": "8a9f29810765465b6324992e07effffb", "score": "0.5300816", "text": "def history\n options = { :query => { :email => @email_address } }\n response = cs_get \"/subscribers/#{@list_id}/history.json\", options\n response.map{|item| Hashie::Mash.new(item)}\n end", "title": "" }, { "docid": "e4045c305f3075f470d91d73dc326b90", "score": "0.5295778", "text": "def add_1game_match\n @players = Player.find(:all, :order => \"username\").map {|u| [u.username]} \n end", "title": "" }, { "docid": "a3b263bac0b7ce1c308ec1cd5cc50d7a", "score": "0.52923983", "text": "def history(options={})\n param = { :uniq_id => @uniq_id }.merge options\n Storm::Base::SODServer.remote_list '/Storm/Server/history', param do |i|\n notification = Notification.new\n notification.from_hash i\n notification\n end\n end", "title": "" }, { "docid": "4914fc497d9774fc4d30b710f550a918", "score": "0.52797556", "text": "def matches_for_player(player_id)\n all_matches(player1_id: player_id)\n .to_a\n .push(*all_matches(player2_id: player_id).to_a)\n .uniq(&:id)\n .sort { |a, b| b.created_at <=> a.created_at }\n end", "title": "" }, { "docid": "9d3a0d9020ff3a8cc354297abb0b390e", "score": "0.52722895", "text": "def get_game_history(gamertag, variant_class = 'Unknown', page = 0)\n get_game_history_uri = \"player/gamehistory/#{@token}/#{msftize(gamertag)}/#{variant_class}/#{page}\"\n self.class.get(@api_url + get_game_history_uri) \n end", "title": "" }, { "docid": "66b7ed983d0341796f84b6369d4fab25", "score": "0.52645487", "text": "def get_team5v5_recent_match_ids(team)\n\t\tresult = perform_request(\"https://euw.api.pvp.net/api/lol/euw/v2.4/team/\"+team.key.to_s+\"?api_key=\"+Rails.application.secrets.riot_api_key.to_s)\t\n\t\tif check_http_error_code(result)\n\t\t\thistoryJsonArray = JSON.parse(result).first[1]['matchHistory']\n\t\t\tmatches_ids_array = []\n\t\t\tif(historyJsonArray)\n\t\t\t\thistoryJsonArray.each do |match|\n\t\t\t\t\tmatches_ids_array << match['gameId']\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn matches_ids_array\n\t\telse\n\t\t\tcheck_query_resut(result, \"get_team5v5_recent_match_ids\", team)\n\t\tend\n\tend", "title": "" }, { "docid": "68c3706a9cf49b268ec5b7b74c8fcf99", "score": "0.5261987", "text": "def find_history; end", "title": "" }, { "docid": "68c3706a9cf49b268ec5b7b74c8fcf99", "score": "0.5261987", "text": "def find_history; end", "title": "" }, { "docid": "0b5e31ab7eb70ed7e38c72fd807ba7f8", "score": "0.5253104", "text": "def api_stats_elo(player_id, league_id, limit = nil)\n database do |db|\n db.results_as_hash = true\n games = db.execute 'SELECT * FROM EloHistory\n JOIN (\n SELECT PlayerID, GameID, Timestamp FROM Game\n )\n USING (PlayerID, GameID)\n WHERE PlayerID = :player_id\n AND LeagueID = :league_id\n ORDER BY Timestamp DESC', player_id, league_id\n\n games = games.first(limit) if limit\n\n return games.collect do |game|\n {\n gameID: game['GameID'],\n timestamp: game['Timestamp'],\n elo: game['Elo']\n }\n end\n end\nend", "title": "" }, { "docid": "610e2d3fdd65ec7a6762ea25ffefae6c", "score": "0.52471745", "text": "def get_history(filename,repo)\n http = curl_get(\"repos/#{repo}/file/history/?p=#{filename}\")\n JSON.parse(http.body_str)\n end", "title": "" }, { "docid": "610e2d3fdd65ec7a6762ea25ffefae6c", "score": "0.52471745", "text": "def get_history(filename,repo)\n http = curl_get(\"repos/#{repo}/file/history/?p=#{filename}\")\n JSON.parse(http.body_str)\n end", "title": "" }, { "docid": "18ebabc96f1b0df1254821c45ea82543", "score": "0.52421474", "text": "def history\n return @history if @history\n\n path = self.class.get_path\n path = [path, id, 'history'].join '/'\n last_response = self.class.get(path)\n data = last_response['history'].try(:[], 'historyItem')\n @history = CapsuleCRM::HistoryItem.init_many(self, data)\n end", "title": "" }, { "docid": "ceba108c063313a86307fc80bdbb89f4", "score": "0.52338237", "text": "def get_account_txhistory(account,offset=0)\n if offset.nil?\n offset = 0\n end\n query = \"SELECT * FROM txhistory ORDER BY ledgerseq DESC LIMIT 300 OFFSET #{offset}\"\n #txhistory = get_db(query)\n result = get_db(query,1)\n hash = {\"txhistory\"=>[]}\n index = offset\n result.each do |row|\n puts \"index: #{index}\"\n puts \"row[txbody]: #{row[\"txbody\"]}\"\n txbody = envelope_to_hash(row[\"txbody\"])\n source_address = txbody[\"source_address\"]\n puts \"source_address: #{source_address}\"\n puts \"account: #{account}\"\n if txbody[\"source_address\"] == account\n txbody[\"txresults\"] = txresult_resultcode(row[\"txresult\"])\n txbody[\"index\"] = index\n txbody.delete(\"txmeta\")\n txbody.delete(\"txindex\")\n hash[\"txhistory\"].push(txbody)\n puts \"hash: #{hash}\"\n index = index + 1\n end\n if (index - offset) > 10\n return hash\n end\n end\n return hash\nend", "title": "" }, { "docid": "c380722e9f0135d9926f60ae93df7d38", "score": "0.52113706", "text": "def history\n\t\tsynchronized do\n\t\t\tJSON.generate(@playlist.history.reverse.map { |m| m.to_h })\n\t\tend\n\tend", "title": "" }, { "docid": "ec93abc81cc3f4fe4820f1bb68154866", "score": "0.5209096", "text": "def show\n #@accounts = current_user.accounts\n #@trackgroups = current_user.trackgroups\n @historyModules = []\n @modules = @dashboard.match_history_modules\n @modules.each do |hm|\n @historyModules << {module: hm, history: LOL_WRAPPER.get_file_history(hm.account.idLoL, hm.account.region, true)}\n end\n end", "title": "" }, { "docid": "e96bef123e0c5a332ca28d96f77bbcdf", "score": "0.52052337", "text": "def fetch_matches\n if params[:id].present?\n @phase = Phase.find_by_id(params[:id])\n @competetion = @phase.competetion if @phase\n else\n @competetion = Competetion.first\n @phase = @competetion.phases.current_phase.try(:first) if @competetion\n end\n if @phase\n @matches = @phase.matches.order(:match_time).includes(:home_team, :away_team, :user_predictions)\n @count = UserPrediction.where(match_id: @matches.pluck(:id)).group(:match_id).count(:id)\n end\n end", "title": "" }, { "docid": "e77e45c59f47c8379cfe874dad04a70f", "score": "0.51990044", "text": "def other_matches( this_match=self )\n this_match.game.matches.select {|match|match.id!=this_match.id}.each {|current_match| }\n end", "title": "" }, { "docid": "9741e5b7554a088b844cfed75b6d2383", "score": "0.5196076", "text": "def wallet_history options={}\n options[:currency] ||= 'BTC'\n post('/api/1/generic/wallet/history', options)['return']['result']\n end", "title": "" }, { "docid": "fba7a5902ec71b5992c408322b77b861", "score": "0.51953095", "text": "def context_matches(project_id: @project_id, match_id:)\n path = \"/context-api/v2/projects/#{project_id}/match/#{match_id}\"\n get(path)\n end", "title": "" }, { "docid": "369f9bade07ec14180334ff2fff01844", "score": "0.51894635", "text": "def players(rcon_password = nil)\n update_player_info(rcon_password) if @player_hash.nil?\n @player_hash\n end", "title": "" }, { "docid": "0731a143ee1f4ad54b882a3ba39577d5", "score": "0.5182683", "text": "def history\n\t\t@partner = User.find_by_nickname(params[:nickname], :include => [:lead_photo, {:profile => :profile_text}])\n\n\t\tif @partner.nil?\n\t\t\tflash[:error] = \"There was a problem receiving the nickname of the member.\"\n\t\t\tredirect_to :action => :list\n\t\tend\n\n\t\t@received_messages = current_user.received_messages.find_all_by_user_id(@partner.id, :order => \"messages.created_at DESC\")\n\t\t@sent_messages = current_user.sent_messages.find_all_by_recipient_id(@partner.id, :order => \"messages.created_at DESC\")\n\t\t@received_winks = current_user.received_winks.find_all_by_user_id(@partner.id, :order => \"winks.created_at DESC\")\n\t\t@sent_winks = current_user.sent_winks.find_all_by_recipient_user_id(@partner.id, :order => \"winks.created_at DESC\")\n\t\t@favorites = current_user.favorite_users.find_all_by_favorite_user_id(@partner.id, :order => \"favorites.created_at DESC\")\n\tend", "title": "" }, { "docid": "151d797a9042364b2c691ed3336d4366", "score": "0.51703626", "text": "def scores_history\n render json: ScoreLog.all_cached\n end", "title": "" }, { "docid": "4a0f9a99b15771db582068ef29968569", "score": "0.5169876", "text": "def fetch_matches\n if params[:p_id].present?\n @phase = Phase.find_by_id(params[:p_id])\n @competetion = @phase.competetion if @phase\n else\n @competetion = Competetion.first\n @phase = @competetion.phases.current_phase.try(:first) if @competetion\n end\n if @phase\n @matches = @phase.matches.order(:match_time).includes(:home_team, :away_team, :user_predictions)\n end\n end", "title": "" }, { "docid": "b143ce85c963f52e2fbe25f644c0ccaf", "score": "0.51624167", "text": "def match_url\n profile_url + \"matches\"\n end", "title": "" }, { "docid": "293374185d12981c5e06bca18e8c94f4", "score": "0.5160458", "text": "def match_stats\n data = self.leg_data\n data[:player_id] = @match[:player]\n avgs = self.generate_averages\n data.merge!(avgs)\n end", "title": "" }, { "docid": "5623d437ce410efdf49efc68be986712", "score": "0.51437855", "text": "def get_history(type, id)\n api_call_with_type(type, id, \"#{type}/#{id}/history\")\n end", "title": "" }, { "docid": "0ecf89abdd6dee039a1c97a80b0c2331", "score": "0.5136718", "text": "def get_history_from_api(api=OSMLib::API::Client.new)\n api.get_history(type, self.id.to_i)\n end", "title": "" }, { "docid": "7dbf4245a87454738487dc7f85dafeab", "score": "0.513559", "text": "def current_matches\n my_current_matches = Set.new\n\n leagues.each do |league|\n \n if !league.matches.empty?\n\n # In each league's set of matches, find the match where the \n # current_user is either player 1 or 2 and where the current\n # round is equal to the league's current round and the current\n # season is equals to the league's current season.\n current_match = league.matches.where(\n \"round_number = ? AND season_number = ? AND (p1_id = ? OR p2_id = ?)\", \n league.current_round, league.current_season.number, id, id).first\n\n unless current_match == nil \n my_current_matches.add(current_match)\n end\n end\n\n end\n\n my_current_matches\n end", "title": "" }, { "docid": "f9b828a2ed9bcfdf757347750793d0c3", "score": "0.51293176", "text": "def show\n @match = Match.new\n @round = Round.find(params[:id])\n @schedule = @round.schedule\n @players = @round.players\n @pre_round = @round.created_at - 16.hours\n @after_round = @round.created_at + 16.hours\n @last_time_players_ajax = []\n @players.each do |player|\n if player.statistic_last_times.any?\n player.statistic_last_times.each do |statistic|\n # matching statistic created in time between of pre_round and after_round\n if ((statistic.created_at > @pre_round) && (statistic.created_at < @after_round)) \n @last_time_players_ajax.push({\"player\" => player, \"player_stats\" => player.statistic_last_times.last, \"player_balance\" => player.statistic_last_times.last.balance})\n end\n end\n end\n end\n @last_time_players_sorted_ajax = @last_time_players_ajax.sort_by { |k| k[\"player_balance\"] }.reverse\n end", "title": "" }, { "docid": "120df594ebe9737dd747991679515b21", "score": "0.5115985", "text": "def http_get_history( req )\n\n history = @history[ req[:challenge] ]\n\n unless history\n return { :status => STATUS_NOT_FOUND, :error => \"Could not find history (#{req[:challenge]}).\" }\n end\n\n { :status => STATUS_OK, :history => history }\n end", "title": "" }, { "docid": "ed71d8d8024b6b8a089468e78e3fe068", "score": "0.5113186", "text": "def refresh_matches\n\t\tConnector.refresh_matches(self.id)\t\n\tend", "title": "" }, { "docid": "f055d99867cc890d0fe5893f92dc93c3", "score": "0.51122135", "text": "def upcoming_matches\n\t\tMatch.where(\"(team1_id=? OR team2_id=?) AND result=?\", self.id,self.id, -2).limit(4)\n\tend", "title": "" }, { "docid": "e9ed782fd7bb90cba51d9c74b2c5f353", "score": "0.5109894", "text": "def history\n\t\tcurrent = getCurrentEntry\n\t\thash = current[\"hash\"]\n\t\tversions = getHistoryEntries\n\t\twhile not hash.nil?\n\t\t\tversions.each do |version|\n\t\t\t\tif version[\"hash\"] == hash\n\t\t\t\t\tputs \"#{version[\"hash\"]}\\n#{version[\"message\"]}\\n\\n\"\n\t\t\t\t\thash = version[\"parent\"]\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "538c8e1137d321b7b07131fa8c623eeb", "score": "0.5106386", "text": "def get_history_from_api(api=OSM::API.new)\n api.get_history(type, self.id.to_i)\n end", "title": "" }, { "docid": "b59c592de301039c9bb26fbd69999db2", "score": "0.50975037", "text": "def add_match(tournament, match)\n winner = get_player(match[\"winner\"].to_s)\n loser = get_player(match[\"loser\"].to_s)\n \n game = winner.elo.wins_from(loser.elo)\n \n winner.tournaments[tournament] << \"defeated #{loser.id_string} (#{loser.elo.rating})\"\n loser.tournaments[tournament] << \"lost to #{winner.id_string} (#{winner.elo.rating})\"\n \n winner.wins += 1\n loser.loss += 1\n \n end", "title": "" }, { "docid": "5da01b865a65ae856cf67672fbef7fab", "score": "0.5097465", "text": "def show_player_info\n #First, get the player and their teams.\n @player = Player.get_player(params[:username])\n self_team = Team.get_self_team(@player)\n \n # Second, map the games to all of the scores.\n game_to_scores = Hash.new\n scores = GameScore.get_score_with_team(self_team)\n for score in scores\n game = Game.get_game_with_id(score.game_id)\n game_scores = GameScore.get_scores_with_id(game.id)\n game_to_scores[game] = game_scores\n end\n \n #Third, map the scores to a contest\n contest_to_scores = Hash.new\n game_to_scores.each { |game, scores| \n contest = Contest.get_contest_with_id(game.contest_id)\n if contest_to_scores[contest] == nil\n contest_to_scores[contest] = scores\n else\n mappedScores = contest_to_scores[contest]\n for score in scores\n if mappedScores.index(score) == nil\n mappedScores.insert(-1, score)\n end\n end\n contest_to_scores[contest] = mappedScores\n end\n }\n \n #Finally, sorted the contest information by time.\n sorted_contest_to_scores = contest_to_scores.sort {|a,b| a[0].created_at <=> b[0].created_at }\n @contestHistories = Array.new\n for i in 0..sorted_contest_to_scores.length - 1\n inner_array = sorted_contest_to_scores[i]\n for j in 0..inner_array.length - 1\n @contestHistories.insert(-1, ContestHistory.new(@player, inner_array[0], inner_array[1]))\n break;\n end\n end\n end", "title": "" }, { "docid": "a89cdfdbeaf74e91878d471d92583bea", "score": "0.50913346", "text": "def find_match_with_bot(match_request)\n account = self.session[:account]\n bots = 2.times.map { |x| Entities::Game::Bots::Anarki.new(self) }\n\n start_match([account] + bots)\n end", "title": "" }, { "docid": "29e13749e2931c1f86e40143e6059996", "score": "0.50777113", "text": "def get_division_matches_played(division,player_id)\n results = Match.joins(:results).where(:results => {:player_id => player_id}).where(:matches => {:division_id => division})\n @oppo_result = Array.new #Get the opposition names in an active record relation\n results.each do |m|\n @oppo_result << Result.where(:match_id => m).where('player_id != ?', player_id)\n end\n #return @oppo_result\n #Get the player_id out of the relation for each.\n @opposition = Array.new\n unless @oppo_result.blank?\n @oppo_result.each do |o|\n @opposition << o.first.player_id\n end\n end\n return @opposition\n end", "title": "" }, { "docid": "78d5c8cb85f15dd4c30a6e67fba64caa", "score": "0.50755966", "text": "def get match_id\n perform_request(api_url(\"match/#{match_id}\"))\n end", "title": "" }, { "docid": "f4a45e8448d84a660a51eb9da4b1efb3", "score": "0.50755405", "text": "def index\n @player_of_team_matches = PlayerOfTeamMatch.all\n end", "title": "" }, { "docid": "6fccd06672654f5320a8d0f26413f628", "score": "0.5069756", "text": "def candidate_matches\n @jobs = Job.job_matched_list(current_candidate).page(params[:page])\n tracker = Mixpanel::Tracker.new(ENV['NT_MIXPANEL_TOKEN'])\n tracker.track('candidate-' + current_candidate.email, 'viewed matches')\n end", "title": "" }, { "docid": "2bdd1caa13281dfe12a613a436c4438f", "score": "0.5067241", "text": "def show\n @matches = @phase.matches.not_deleted.includes(:home_team, :away_team)\n end", "title": "" }, { "docid": "78c15e408b904fcdd5e659730d532e9a", "score": "0.5063677", "text": "def records\n\t\t\tRecord.in match_id: matches.map(&:id)\n\t\tend", "title": "" }, { "docid": "26bdf25c3e5ff2c4d3e8aa6679ffad3b", "score": "0.50590885", "text": "def set_account_history\n @account_history = AccountHistory.find(params[:id])\n end", "title": "" }, { "docid": "2bed44932595b2dc87401dc73b121ac2", "score": "0.50549114", "text": "def generate_matches\n \n if self.partner_api_track\n params = {:track_id=>self.partner_api_track.id, \n :track_set_id=>\"drop_boxes\",\n :result_delivery_method=>'postback',\n :post_back_url=>\"#{AppConfig.root_url}/xrays/#{self.id}/match_postback\"}\n begin \n MusicXrayApi::TrackMatchRequest.create(params) \n rescue\n nil\n end\n else\n nil\n end\n end", "title": "" }, { "docid": "dd075d00191cc7081890552b8098da08", "score": "0.50544065", "text": "def link_history(client)\n response = Faraday.get(\"#{BASE_URL}#{END_POINT[:link_history]}?access_token=#{client.access_token}\")\n parsed_response = JSON.parse(response.body)\n links = parsed_response[\"data\"][\"link_history\"]\n end", "title": "" }, { "docid": "4e0c9295b9df9d1c54f81d222862b807", "score": "0.5054286", "text": "def matches\n Match.all.select do |match|\n match.home_team_id == self.api_id || match.away_team_id == self.api_id\n end\n end", "title": "" }, { "docid": "a785e857f1880b3ea806c20f5129f8bb", "score": "0.50531507", "text": "def get_history_rxs\n Common::Collection.fetch(::Prescription, cache_key: cache_key('gethistoryrx'), ttl: CACHE_TTL) do\n perform(:get, 'prescription/gethistoryrx', nil, token_headers).body\n end\n end", "title": "" }, { "docid": "43f40fb35208a75e33b584c282cf3f5e", "score": "0.5042196", "text": "def history(filter_options = {})\n call_options = {}\n call_options['StatusList'] = Array(filter_options.delete(:status)).map(&:to_s) if filter_options[:status]\n call_options['LocalUriList'] = Array(filter_options.delete(:local_uri)).map(&:to_s) if filter_options[:local_uri]\n call_options['PeriodStart'] = filter_options.delete(:start).to_s(:rfc3339) if filter_options[:start]\n call_options['PeriodEnd'] = filter_options.delete(:end).to_s(:rfc3339) if filter_options[:end]\n raise ArgumentError, \"Invalid filter option(s): #{filter_options.inspect}\" unless filter_options.empty?\n\n return_hash @server.call(\"samurai.HistoryGetByDate\", call_options)\n end", "title": "" }, { "docid": "82a8f4e43cb13a3b9cac73c5677ecb71", "score": "0.5041197", "text": "def extract_round_history(turn_data)\n if turn_data.has_key? 'round_history'\n round_history = turn_data['round_history']\n history = ''\n\n round_history.each do |match|\n history << ' ' << match['stack_change'].to_s unless match['stack_change'].nil?\n end\n\n @@logger.info('round_history: ' + history) unless history.empty?\n end\nend", "title": "" }, { "docid": "269b8940a1fdbbb82bcbe3b1bf88748b", "score": "0.5039083", "text": "def index\n @matches = @ladder.matches.order(\"updated_at desc\")\n render json: @matches, root: false\n end", "title": "" }, { "docid": "8bc6976072639756860c82a187c7ae65", "score": "0.5023445", "text": "def history_list(id, opt = {})\n validate_id(id)\n\n opt2 = {}\n limit_phrase = ListQuery.parse_page_opts(opt, opt2)\n\n @db.query(\"SELECT hid, ts, user_id FROM `#{@name}_h` WHERE _id=#{id} ORDER BY ts DESC, hid DESC #{limit_phrase};\")\n end", "title": "" }, { "docid": "8a9c5b1d3d405a9f74fb61ff2d30e9ce", "score": "0.5023402", "text": "def set_zone_history\n @zone_history = ZoneHistory.find(params[:id])\n end", "title": "" }, { "docid": "1c77cba1ddb17e9ac10e2e3fb9bca080", "score": "0.5015362", "text": "def get_history\n if Rails.configuration.mediawiki_session\n if self.wiki_page_name.present?\n name = self.wiki_page_name.gsub(\" \", \"_\")\n else\n name = self.title.strip.gsub(\" \", \"_\")\n end\n\n # Get history\n begin\n history = RestClient.get(\"#{Project.load_mediawiki_api_base_url}api.php?action=weserve&method=history&page=#{URI.escape(name)}&format=json\", {:cookies => Rails.configuration.mediawiki_session})\n return JSON.parse(history.body)[\"response\"]\n rescue\n return nil\n end\n else\n nil\n end\n end", "title": "" }, { "docid": "7b968165b5969f4889654fbb6b512038", "score": "0.5013987", "text": "def match_data\n record = {\n legs_won: 0,\n legs_lost: 0,\n match_won: false,\n season_id: @season,\n week: @week\n }\n @match[:legs].each do |leg|\n if leg[1][:result] == 'Win'\n record[:legs_won] += 1\n else\n record[:legs_lost] += 1\n end\n record[:match_won] = true if record[:legs_won] >= 2\n end\n [record.merge({player_id: @match[:player_1] }), record.merge({player_id: @match[:player_2] }) ]\n end", "title": "" }, { "docid": "9f14fc12e4ef1230f8065dd679e0a953", "score": "0.5013682", "text": "def chat_history(options = {})\n debug \"accessing chat history with #{options}\"\n\n history = []\n\n Storage.with_storage do |store|\n if options.has_key?(:chat)\n # history for some other chat\n history = store[KEY][options[:chat]]\n else\n # history for this chat\n history = store[KEY][@msg.chat]\n end\n\n if options.has_key?(:from)\n # messages from someone\n history = history.select do |msg|\n msg.from_name =~ /#{options[:from]}/i\n end\n end\n\n if options.has_key?(:to)\n # messages to someone\n history = history.select do |msg|\n msg.to =~ /#{options[:to]}/i\n end\n end\n end\n\n history || []\n end", "title": "" }, { "docid": "d7c8bcfc72245e17cd3241aec75e9bbb", "score": "0.5013455", "text": "def get_next_match(tournament_id)\n response = RestClient.get(match_get(tournament_id), {\n params: {\n api_key: API_KEY,\n state: \"open\"\n }\n })\n rescue RestClient::ExceptionWithResponse => e\n puts e.response\n response.each do |message|\n puts message\n end\n return response\n end", "title": "" }, { "docid": "4ef1915d1b79466ac8c7f36cc7d2fc38", "score": "0.50093764", "text": "def history(offset = 0, limit = 100)\n api.get('history', offset: offset, limit: limit)\n end", "title": "" }, { "docid": "bf22ffaa9f50efa8ade87792e2583f7c", "score": "0.50090414", "text": "def searchPlayers(_query)\n\tbegin\n\t\tdbc = Mysql.new(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE)\n\t\trs = dbc.query(\"SELECT id FROM accounts WHERE username \\\n\t\t\tLIKE '#{_query}%';\")\n\t\tresults = Array.new\n\t\twhile row = rs.fetch_row do\n\t\t\tresults.push(row[0])\n\t\tend\n\t\trs = dbc.query(\"SELECT id FROM accounts WHERE firstname \\\n\t\t\tLIKE '#{_query}%';\")\n\t\tfirstnames = Array.new\n\t\twhile row = rs.fetch_row do\n\t\t\tfirstnames.push(row[0])\n\t\tend\n\t\tif firstnames != nil then\n\t\t\tfor i in 0..(firstnames.size - 1)\n\t\t\t\tunique = true\n\t\t\t\tfor j in 0..(results.size - 1)\n\t\t\t\t\tif firstnames[i].eql?results[j] then\n\t\t\t\t\t\tunique = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tif unique then\n\t\t\t\t\tresults.push(firstnames[i])\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\trs = dbc.query(\"SELECT id FROM accounts WHERE lastname \\\n\t\t\tLIKE '#{_query}%';\")\n\t\tlastnames = Array.new\n\t\twhile row = rs.fetch_row do\n\t\t\tlastnames.push(row[0])\n\t\tend\n\t\tif lastnames != nil then\n\t\t\tfor i in 0..(lastnames.size - 1)\n\t\t\t\tunique = true\n\t\t\t\tfor j in 0..(results.size - 1)\n\t\t\t\t\tif lastnames[i].eql?results[j] then\n\t\t\t\t\t\tunique = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tif unique then\n\t\t\t\t\tresults.push(lastnames[i])\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tif results == nil then\n\t\t\treturn nil\n\t\tend\n\t\tmatches = Array.new(results.size)\n\t\tfor i in 0..(results.size - 1)\n\t\t\tmatches[i] = getFriend(results[i])\n\t\tend\n\t\treturn matches\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": "8bbab18949dcd13e22ff4a739cf207ab", "score": "0.50051403", "text": "def history(options = {})\n\n merged_options = {\n :date => 'recent',\n :timezone => 'UTC',\n :format => 'JSON',\n :'max-results' => 100,\n :'start-index' => 0,\n :'end-date' => nil\n }.merge options\n\n response = self.class.get(@api.history_config[:url],\n :query => {\n :room_id => room_id,\n :date => merged_options[:date],\n :timezone => merged_options[:timezone],\n :format => merged_options[:format],\n :'max-results' => merged_options[:'max-results'],\n :'start-index' => merged_options[:'start-index'],\n :'end-date' => merged_options[:'end-date'],\n :auth_token => @token\n }.reject!{|k,v| v.nil?},\n :headers => @api.headers\n )\n\n ErrorHandler.response_code_to_exception_for :room, room_id, response\n response.body\n end", "title": "" }, { "docid": "378bf4c453f8764354be0d5d321ab258", "score": "0.5001858", "text": "def set_sim_historys\n @sim = Sim.find(params[:sim_id])\n @sims_historys = @sim.versions\n end", "title": "" }, { "docid": "2126fc828227fed77f49dc807273d251", "score": "0.49869654", "text": "def set_play_history\n @play_history = PlayHistory.find(params[:id])\n end", "title": "" }, { "docid": "00e29ecd5b83925cfed74d9adb3d59f2", "score": "0.49845973", "text": "def set_game_history\n @game_history = GameHistory.find(params[:id])\n end", "title": "" }, { "docid": "064aa6d620ebe56009fbce74fe3e86ac", "score": "0.49806294", "text": "def domain_ad_history(params)\n send_get \"domain_ad_history\", params\n end", "title": "" }, { "docid": "297f27aada4751ccbd10aa57872a5088", "score": "0.4979651", "text": "def match_winners()\n return @matches.map { |match| match.winner}\n end", "title": "" }, { "docid": "760b6bbcbb3ef3f2cc8161d23f5ff275", "score": "0.49777204", "text": "def checkin_history(params={})\n self.class.get(\"http://api.foursquare.com/v1/history.json\", :query=>params)\n end", "title": "" }, { "docid": "819cab537606ed6b31f9d7263fb6ac4f", "score": "0.49764448", "text": "def show\n if params[:match_id]\n @match = Match.find(params[:match_id])\n # @matchplayers = @match.matchplayers.find(params[:match_id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @matchplayer }\n end\n end", "title": "" }, { "docid": "d76fb8a86ab3319d3ea9e584e3d1470a", "score": "0.49565706", "text": "def log_in_get_player_info(mechanize)\n latest_account = TeamsnapScanAccount.order('created_at DESC').first\n @players = Array.new\n league_roster_url = 'https://go.teamsnap.com/16139/league_roster/list'\n if !latest_account.nil?\n login_results = login_to_teamsnap(mechanize, latest_account)\n\n if is_login_successful?(login_results)\n players = Array.new\n league_page = login_results.link_with(:href => \"/team/set_division/16139\").click\n @players = fetch_league_roster(league_page)\n else\n puts \"Web Scrapper has failed\"\n end\n end\n @players\n end", "title": "" }, { "docid": "69c6de2f1ac38c9bc9eed72b26808184", "score": "0.49553493", "text": "def load_match_by_id(match_id)\n connect(\"matches/#{match_id}\")\nend", "title": "" } ]
b57b0a4ffb4470da3e7dfbbdc5077400
Insert an value into a subTrie, creating one if necessary. Internal method called by Trie.insert.
[ { "docid": "b58795d831084df2b9a2ae0da1d12343", "score": "0.6586462", "text": "def insert_in_child(key, value)\n (@children[key[0]] ||= self.class.new).insert(key[1..-1], value)\n end", "title": "" } ]
[ { "docid": "adebdfc6f5ecb6db2d6b619a61d78188", "score": "0.668694", "text": "def insert(val)\n if @parent.nil?\n return @parent = ANode.new(val)\n end\n\n # find where the val belongs\n new_node = ANode.new(val)\n recurse_insert(@parent, new_node)\n end", "title": "" }, { "docid": "9bfbf0d5136ba51ab4ae5359e48a9445", "score": "0.66861314", "text": "def s_insert(value)\n # Find where the given value would go in the tree\n parent_node = @root.nil? ? nil : @root.s_find_node(value)\n # If that would repeat a value, return nil\n return nil if !parent_node.nil? && parent_node.value == value\n\n # Else, we're adding a node\n new_node = Node.new(value)\n # If no root, put the new node there\n return @root = new_node if @root.nil?\n\n # Else place the node in the relevant child position\n value < parent_node.value ? parent_node.left = new_node : parent_node.right = new_node\n end", "title": "" }, { "docid": "0c8124727541ebae5467f189d6a4d4ac", "score": "0.66503155", "text": "def insert(key, value)\n # key = key.split('') if key.is_a?(String)\n key = key.chars.to_a if key.is_a?(String)\n if key != @compressed_key\n @compressed_values.each {|v| insert_in_child(@compressed_key, v) }\n @compressed_values.clear\n @compressed_key.clear\n end\n if key.empty?\n @values.add(value)\n elsif (@values.empty? and @children.empty?) or key == @compressed_key\n @compressed_key = key.dup\n @compressed_values.add(value)\n else\n insert_in_child(key, value)\n end\n self\n end", "title": "" }, { "docid": "78798db0b1c8ccbcc7369884c301f220", "score": "0.65003663", "text": "def insert(key, value)\n node = myself\n\n # Traverse the tree to find the right node to add or replace the value.\n while node\n # All nodes that we find on the way that are full will be split into\n # two half-full nodes.\n node = node.split_node if node.keys.size >= @tree.node_size\n\n # Once we have reached a leaf node we can insert or replace the value.\n return node.insert_element(key, value) if node.is_leaf?\n\n # Descend into the right child node to add the value to.\n node = node.children[node.search_key_index(key)]\n end\n\n PEROBS.log.fatal 'Could not find proper node to insert into'\n end", "title": "" }, { "docid": "0e3cd46104aab4465c0498e85e7f600f", "score": "0.6499434", "text": "def add(key, value)\n node = @root\n key.each_char do |char|\n node.children[char] ||= TrieNode.new(@default_value)\n node = node.walk(char)\n end\n node.value = value\n @size += 1 unless node.terminal\n node.terminal = true\n value\n end", "title": "" }, { "docid": "f0504b990e2083326b79144c3b119e95", "score": "0.64689785", "text": "def insert(dn, value = nil)\n dn = LDAP::Server::DN.new(dn || '') if not dn.is_a? LDAP::Server::DN\n dn.reverse_each do |component|\n @children[component] = Trie.new(self) if @children[component].nil?\n dn.dname.pop\n if dn.any?\n @children[component].insert dn, value\n else\n @children[component].value = value\n end\n end\n end", "title": "" }, { "docid": "3c81e4c24edce71a8bb499db30a972dd", "score": "0.6457166", "text": "def insert(value)\n @root = insert_into_tree(value, @root)\n end", "title": "" }, { "docid": "3d3b339d55329ce1cac5434973485c83", "score": "0.6438698", "text": "def insert(value)\n return @root = TreeNode.new(value) if !@root\n find_insert_position(@root, value)\n end", "title": "" }, { "docid": "959a2b6e56e3ca2a4ada1bcd180ee5cc", "score": "0.6425322", "text": "def insert(key, value)\n node = self\n\n # Traverse the tree to find the right node to add or replace the value.\n while node do\n # All nodes that we find on the way that are full will be split into\n # two half-full nodes.\n if node.keys.size >= @tree.order\n node = node.split_node\n end\n\n # Once we have reached a leaf node we can insert or replace the value.\n if node.is_leaf\n return node.insert_element(key, value)\n else\n # Descend into the right child node to add the value to.\n node = node.children[node.search_key_index(key)]\n node = node.get_node if node\n end\n end\n\n PEROBS.log.fatal 'Could not find proper node to add to'\n end", "title": "" }, { "docid": "349ff86681bae9e4dd2a280fd2131483", "score": "0.63953996", "text": "def insert(val, root=@root)\n parent, link, found = _search(val, root, root, nil)\n #\n _create_node(val, parent, link) unless found\n end", "title": "" }, { "docid": "929b9fb5bb8881f60601583e364882b4", "score": "0.6344633", "text": "def insert(value)\n if @root[:value].nil?\n @root[:value] = value\n return true\n end\n return false if contains(value)\n recursive_insert(value, @root)\n end", "title": "" }, { "docid": "54c8b5eb538410317b61d625e5039f1f", "score": "0.6315828", "text": "def insert(value)\n if @root == nil\n @root = Node.new(value)\n else\n append_value(root, value)\n end\n end", "title": "" }, { "docid": "ed5fa670b4c30019e3725578dbc679d7", "score": "0.6298159", "text": "def insert_subtrie(parts, trie)\n raise ArgumentError.new(\"trie must be a trie\") unless trie.is_a? self.class\n raise ArgumentError.new(\"cannot insert a subtrie at the root\") if parts.empty?\n parent, * = traverse(@root, parts[0...-1], true)\n parent[parts.last] = trie.root\n self\n end", "title": "" }, { "docid": "08d2ab9f5257b88eb1c27960d894097f", "score": "0.6279101", "text": "def insert(str:, val:)\n if str.empty?\n raise \"Empty string given\"\n end\n\n i = 0\n n = str.length\n\n # Now lets Walk tree to find node w/ character as key\n node = @root\n while i < n\n child = node.get_child(str[i])\n break if child.nil?\n node = child\n i = i + 1\n end\n\n # Otherwise, we found leaf node. Now we add new path of remaining chars to trie\n while i < n\n new_leaf = Node.new(key: str[i])\n node.add_child(new_leaf)\n node = new_leaf\n i = i + 1\n end\n\n node.value = val\n\n end", "title": "" }, { "docid": "688eb42dc80ff4539203734c9e6093d1", "score": "0.6264164", "text": "def insert(value)\n @data.push value\n child = @data.size-1\n parent = parent_index(child)\n\n while parent >= 0 and !relation(parent,child)\n @data[child], @data[parent] = @data[parent], @data[child]\n child = parent\n parent = parent_index(child)\n end\n self\n end", "title": "" }, { "docid": "611b17c5e04afff181ec4d595f43373d", "score": "0.625877", "text": "def put!(key, value)\n index = index_for(key)\n entry = @entries[index]\n if !entry\n @size += 1\n key = key.dup.freeze if key.is_a?(String) && !key.frozen?\n @entries[index] = [key, value].freeze\n elsif entry[0].eql?(key)\n key = key.dup.freeze if key.is_a?(String) && !key.frozen?\n @entries[index] = [key, value].freeze\n else\n child = @children[index]\n if child\n old_child_size = child.size\n @children[index] = child.put!(key, value)\n @size += child.size - old_child_size\n else\n @children[index] = Trie.new(@bitshift + 5).put!(key, value)\n @size += 1\n end\n end\n self\n end", "title": "" }, { "docid": "c444016cebca97957876ed82e3de2a18", "score": "0.62499166", "text": "def insert_element(key, child_or_value)\n if @keys.size >= @tree.node_size\n PEROBS.log.fatal \"Cannot insert into a full BigTreeNode: #{@keys.size}\"\n end\n\n i = search_key_index(key)\n if @keys[i] == key\n # Overwrite existing entries\n @keys[i] = key\n if is_leaf?\n @values[i] = child_or_value\n else\n @children[i + 1] = child_or_value\n end\n else\n # Create a new entry\n @keys.insert(i, key)\n if is_leaf?\n @values.insert(i, child_or_value)\n @tree.entry_counter += 1\n else\n @children.insert(i + 1, child_or_value)\n end\n end\n end", "title": "" }, { "docid": "7031fdcfda46c8751c8b79b5396ab8b5", "score": "0.62363243", "text": "def insert(key, value)\n if @root.insert(key, value)\n @size += 1\n @node_cache.flush\n end\n end", "title": "" }, { "docid": "05e3c33c737ca9e46dcca3b7ac2e62f3", "score": "0.62022465", "text": "def insert(value)\n unless find(value).nil?\n puts 'Value already exists in tree.'\n return\n end\n\n new_node = Node.new(value)\n current_node = @root\n until (current_node.left_child.nil? && value < current_node.data) || (current_node.right_child.nil? && value > current_node.data)\n current_node = if value < current_node.data && !current_node.left_child.nil?\n current_node.left_child\n else\n current_node.right_child\n end\n end\n\n if value < current_node.data\n current_node.left_child = new_node\n else\n current_node.right_child = new_node\n end\n new_node\n end", "title": "" }, { "docid": "26f3c713578c97bec96716a1bf84b3c1", "score": "0.6198903", "text": "def insert(value)\n new_node = Node.new(value)\n place_node(new_node, @root)\n end", "title": "" }, { "docid": "100157e25a383d925e9cfc052d34374b", "score": "0.61775047", "text": "def insert(index, value)\n node = self\n cidx = nil\n\n # Traverse the tree to find the right node to add or replace the value.\n while node\n # All nodes that we find on the way that are full will be split into\n # two half-full nodes.\n if node.size >= @tree.node_size\n # Re-add the index from the last parent node since we will descent\n # into one of the split nodes.\n index += node.parent.offsets[cidx] if node.parent\n node = node.split_node\n end\n\n # Once we have reached a leaf node we can insert or replace the value.\n if node.is_leaf?\n node.values.insert(index, value)\n node.parent&.adjust_offsets(node, 1)\n return\n else\n # Descend into the right child node to add the value to.\n cidx = node.search_child_index(index)\n if (index -= node.offsets[cidx]).negative?\n node.fatal \"Index (#{index}) became negative\"\n end\n node = node.children[cidx]\n end\n end\n\n node.fatal 'Could not find proper node to insert the value while ' \\\n \"looking for index #{index}\"\n end", "title": "" }, { "docid": "f1797c8c493db64d59e6d7e3400c6edd", "score": "0.61761737", "text": "def insert(value)\n return @root = Node.new(value) if @root.nil?\n\n node = find(value)\n\n if value < node.value\n node.left = Node.new(value)\n elsif value > node.value\n node.right = Node.new(value)\n else\n puts \"Unable to insert #{value} because it already exists.\"\n end\n end", "title": "" }, { "docid": "b72c74696c4af710f3eb177650974efa", "score": "0.6161605", "text": "def insert(value)\n if @root\n insert_child(value, @root)\n else\n @root = BinaryNode.new(value)\n end\n @length += 1\n end", "title": "" }, { "docid": "3c1ba9269f36034d42e8ce1b847dd740", "score": "0.6156307", "text": "def insert(key, val)\n @root = insert_r(@root, key, val, 0)\n end", "title": "" }, { "docid": "84a55466b596fa48e2c745fedafae2e5", "score": "0.61389726", "text": "def insert(val, root=@root, splay=false)\n node, link, found = _search(val, root)\n #\n # may change the root of the tree:\n _create_node(val, node, link) unless found\n _splay(root, node) if splay\n end", "title": "" }, { "docid": "f2cf640abd5df9a99f662e14683baebb", "score": "0.6125278", "text": "def insert(value)\n # if the tree already contains the value return\n return if contains?(value)\n\n new_node = Node.new(value)\n current_node = @root\n # While the next node in the list is not nil\n until current_node.nil?\n # Check if the value is greater than or less than the root\n previous_node = current_node\n if current_node > new_node\n # If less send it to the left else send it to the right\n current_node = previous_node.left_child\n elsif current_node < new_node\n current_node = previous_node.right_child\n end\n end\n # Check the previous node to see what side to set it\n previous_node > new_node ? previous_node.left_child = new_node : previous_node.right = new_node\n end", "title": "" }, { "docid": "0f99962d5c1bd19e1da56f1dc7854a98", "score": "0.6076113", "text": "def insert(key, value)\n if empty?\n @root = SplayNode.new(key, value)\n return\n end\n \n # Splay on the key to move the last node on the search path for\n # the key to the root of the tree.\n splay(key)\n if (@root.key == key)\n return\n end\n \n node = SplayNode.new(key, value)\n if key > @root.key \n node.left = @root\n node.right = @root.right\n @root.right = nil\n else\n node.right = @root\n node.left = @root.left\n @root.left = nil\n end\n @root = node\n end", "title": "" }, { "docid": "a0e7a6b4249f4c4da8cf70b65d251ff3", "score": "0.6059107", "text": "def insert(value)\n check = find(value)\n\n unless check.is_a? Node\n @known = @known_prev if @known.nil?\n\n if @known > value\n @known.left_child = Node.new(value)\n p \"#{value} now left_child of #{@known.value}.\"\n elsif @known < value\n @known.right_child = Node.new(value)\n p \"#{value} now right_child of #{@known.value}.\"\n end \n else\n p \"#{value} exists at #{check}.\"\n end\n @known = \"N/A\"; @known_prev = \"N/A\"\n end", "title": "" }, { "docid": "c848c50762171a0fafe9e79bec9c19c4", "score": "0.60564274", "text": "def insert(key, value)\n @store.transaction do\n @root.insert(key, value)\n end\n end", "title": "" }, { "docid": "ed052888068dbe3ceecedb5654c103d6", "score": "0.60523295", "text": "def insert(key, val)\n idx = self.cidx(key)\n if @children[idx]\n @children[idx].insert(key, val)\n else\n @children[idx] = self.class.new(val, key: key,\n children: @children.size,\n duplicates: @duplicates)\n end\n end", "title": "" }, { "docid": "27b441ec1df2e6bd385027128ddc957f", "score": "0.60390055", "text": "def insert(new_val)\n return self if val == new_val # value already exists, abort\n lr = new_val < val ? :left : :right\n self[lr] = self[lr] ? self[lr].insert(new_val) : AvlTree.new(new_val)\n rebalance\n end", "title": "" }, { "docid": "aca4a1b0c57a1950d1175ff1690bff09", "score": "0.6025072", "text": "def put(key, value)\n @root = insert(@root, key, value)\n @size += 1\n end", "title": "" }, { "docid": "dd1256143f636d1f6482d0988ef0dcd6", "score": "0.59968597", "text": "def insert(leaf, value)\n if @value == nil\n @value = value\n return self\n elsif @value == value\n return leaf\n elsif value < @value\n insert(leaf.left, value)\n elsif value > @value\n insert(leaf.right, value)\n end\n end", "title": "" }, { "docid": "6c0d9aedbd05f35a0a0c68c7082500ab", "score": "0.59912556", "text": "def insert(value)\n @root = insert_nodes(@root, value)\n end", "title": "" }, { "docid": "1ab92c9030a1200657f25cf23c74ffba", "score": "0.5989336", "text": "def insert(value, root)\n if root.nil?\n root = Node.new(value, nil, nil)\n return\n end\n\n insert_helper(root, value)\n end", "title": "" }, { "docid": "9d41dfba69fdb31bca75ed8659991c67", "score": "0.5960626", "text": "def insert(value)\n # Create the node, then work out where it goes\n new_node = Node.new(value)\n # If there's no root, it should be the root\n return @root = new_node if @root.nil?\n\n # As in BF order (below), we'll use a queue to iterate through the tree\n queue = MyQueue.new\n queue.enqueue(@root)\n\n until queue.empty?\n current = queue.dequeue\n return current.left = new_node if current.left.nil?\n return current.right = new_node if current.right.nil?\n\n queue.enqueue(current.left)\n queue.enqueue(current.right)\n end\n end", "title": "" }, { "docid": "9a2b45d4137ddb404aea40ca94809da3", "score": "0.5929005", "text": "def insert(index, value)\n insert_tree index, Tree.new(self, value)\n end", "title": "" }, { "docid": "3b248e5d90d4fb3fd28cd7107beef380", "score": "0.59267306", "text": "def insert(word)\n current_node = @root\n\n word.chars.each do |ch|\n if !current_node.children.has_key?(ch)\n current_node.children[ch] = TrieNode.new\n end\n\n current_node = current_node.children[ch]\n end\n\n current_node.children['$'] = true\n end", "title": "" }, { "docid": "d709bc48442880a95282234c34ca7861", "score": "0.5917909", "text": "def insert(value)\n if @root == nil\n @root = Node.new(value, nil, nil)\n return\n end\n\n return insert_helper(@root, value) # use a helper method. this approch prevents root from being exposed outside the class. (encapsulation)\n end", "title": "" }, { "docid": "907249de717d7b12450c8514a6c45933", "score": "0.58976537", "text": "def insert(value)\n if @root == nil\n @root = Node.new(value, nil, nil)\n return\n end\n\n return insert_helper(@root, value) # use a helper method. this approach prevents root from being exposed outside the class. (encapsulation)\n end", "title": "" }, { "docid": "db869182416d1a5d3f03f32b1ce5ca6e", "score": "0.5897104", "text": "def insert_at(value, index)\n if @head.nil? || index > @@entries\n append(value)\n elsif index == 1\n prepend(value)\n else\n prev, cur = search_for(index)\n prev.next_node = value\n value.next_node = cur\n @@entries += 1\n end\n end", "title": "" }, { "docid": "d58f102026bf4970646e8789c330570b", "score": "0.5882921", "text": "def insert(word)\n curr = @root\n word.each_char do |char|\n curr = (curr[char] ||= TrieNode.new)\n end\n curr[:_] = true\n end", "title": "" }, { "docid": "5a129e07868a800b70b9ddcfb8c1b0cf", "score": "0.5876222", "text": "def insert_element(key, value_or_child)\n if @keys.size >= @tree.order\n PEROBS.log.fatal \"Cannot insert into a full BTreeNode\"\n end\n\n i = search_key_index(key)\n @tree.node_cache.insert(self)\n if @keys[i] == key\n # Overwrite existing entries\n @keys[i] = key\n if is_leaf\n @values[i] = value_or_child\n else\n @children[i + 1] = link(value_or_child)\n end\n\n return false\n else\n # Create a new entry\n @keys.insert(i, key)\n if is_leaf\n @values.insert(i, value_or_child)\n else\n @children.insert(i + 1, link(value_or_child))\n end\n\n return true\n end\n end", "title": "" }, { "docid": "b2f87bb83388fa67bcd05fbe9017d1ca", "score": "0.58482367", "text": "def insert(value)\n new_node = Node.new(value)\n unless(@root)\n @root = new_node\n else\n temp_node = @root\n traverse = true\n while(traverse)\n if(new_node.value < temp_node.value)\n unless(temp_node.left)\n traverse = false\n temp_node.left = new_node\n end\n temp_node = temp_node.left\n else\n unless(temp_node.right)\n traverse = false\n temp_node.right = new_node\n end\n temp_node = temp_node.right\n end\n end\n end\n end", "title": "" }, { "docid": "3d2d493bc73e5e9cd9616b4c769e8eaa", "score": "0.5842195", "text": "def insert(value, cur = @root)\n return @root = Node.new(value) if @root.nil?\n raise StandardError, 'Value already exist' if value == cur.value\n\n if value < cur.value\n cur.left ? insert(value, cur.left) : cur.left = Node.new(value)\n elsif value > cur.value\n cur.right ? insert(value, cur.right) : cur.right = Node.new(value)\n end\n end", "title": "" }, { "docid": "3f534162bddc9ac7406a000ec3c4dee6", "score": "0.5837898", "text": "def insert(value)\n case @type\n when :empty\n Tree.leaf(value)\n when :leaf\n if value <= @value\n Tree.node(@value, Tree.leaf(value), Tree.empty)\n else\n Tree.node(@value, Tree.empty, Tree.leaf(value))\n end \n when :node\n if value <= @value\n Tree.node(@value, @left_tree.insert(value), @right_tree)\n else\n Tree.node(@value, @left_tree, @right_tree.insert(value))\n end \n end \n end", "title": "" }, { "docid": "7e86c0bebade619364218389f956a5fd", "score": "0.58304274", "text": "def insert(index, value)\n index = validate_index_range(index)\n\n if index < @entry_counter\n # Insert in between existing elements\n @store.transaction do\n @root.insert(index, value)\n self.entry_counter += 1\n end\n else\n self[index] = value\n end\n end", "title": "" }, { "docid": "b5f18dac84a51d31d8a63294f951f21d", "score": "0.5828597", "text": "def insert_at(value, index)\n new_node = Node.new(value)\n @ary.insert(index, new_node)\n\n update_nodes\n end", "title": "" }, { "docid": "a71d80a521a4669cfe9ab3f6c7d8bd58", "score": "0.580911", "text": "def add_to(root, key, value)\n if root.nil?\n @size = @size + 1\n root = TreeNode.new(key, value, nil, nil)\n elsif key == root.key\n root.value = value\n elsif (key <=> root.key) < 0\n root.left = add_to(root.left, key, value)\n else\n root.right = add_to(root.right, key, value)\n end\n\n root\n end", "title": "" }, { "docid": "0f5f061827d4250f6d1931ccc0cf2895", "score": "0.5809095", "text": "def insert(value)\n node_to_insert = Node.new(value, nil, nil)\n\n if @root == nil\n @root = node_to_insert\n return\n end\n\n # find the right parent to insert the new node under\n current = @root\n parent = nil\n while current != nil\n parent = current\n if (value <= current.data)\n # value to insert is less than or equal to value in current node\n # explore the left subtree\n current = current.left\n else # right subtree\n current = current.right\n end\n end\n\n # parent has been located\n # determine whether the new node should left or right child\n if value <= parent.data\n parent.left = node_to_insert\n else\n parent.right = node_to_insert\n end\n end", "title": "" }, { "docid": "a132ea6daaaaed4661e58fd41d77fe65", "score": "0.57892084", "text": "def insert(value)\n raise(ArgumentError, 'value cannot be nil') if value.nil?\n\n if empty?\n @root = Node.new(value, nil)\n else\n target = @root\n while target\n last_node = target\n target = target.value >= value ? target.left : target.right\n end\n\n item = Node.new(value, last_node)\n if last_node.value >= value\n last_node.left = item\n else\n last_node.right = item\n end\n end\n end", "title": "" }, { "docid": "6e8fb9884919fe854c170265b6edd806", "score": "0.5780334", "text": "def insert(value, node = @root)\n return 'Value already exists.' if node.data == value\n\n if value < node.data\n if node.left.nil?\n node.left = Node.new(value)\n else\n insert(value, node.left)\n end\n elsif value > node.data\n if node.right.nil?\n node.right = Node.new(value)\n else\n insert(value, node.right)\n end\n end\n end", "title": "" }, { "docid": "4e105b12e917cf929db78094cc6c5b6f", "score": "0.5752449", "text": "def insert_value(value, node = nil, left = nil, right = nil)\n find_result = if node.nil? then find_value(value) else {:find => false} end #find node\n unless find_result[:find]\n node ||= @nodes[find_result[:node]]\n node.add(value)\n\n if left || right #add subtrees\n node.add_sub_tree(left)\n node.add_sub_tree(right)\n end\n\n if node.size>@max\n middle = node.keys[node.size/2] #find middle value\n left_node = Node.new\n right_node = Node.new\n add(left_node)\n add(right_node)\n\n node.keys.each do |item| #make new subtrees(copy value and value's subtrees)\n if item<middle\n left_node.add(item)\n left_node.add_sub_tree(@nodes[node.sub_trees[node.keys.index(item)]]) unless node.sub_trees[node.keys.index(item)].nil?\n end\n if item>middle\n right_node.add(item)\n right_node.add_sub_tree(@nodes[node.sub_trees[node.keys.index(item)+1]]) unless node.sub_trees[node.keys.index(item)+1].nil?\n end\n end\n\n # add middle_value's subtrees to left and right subtrees\n left_node.add_sub_tree(@nodes[node.sub_trees[node.keys.index(middle)]]) unless node.sub_trees[node.keys.index(middle)].nil?\n right_node.add_sub_tree(@nodes[node.sub_trees[node.keys.index(middle)+1]]) unless node.sub_trees[node.keys.index(middle)+1].nil?\n\n # add value to parent node or split if parent is root\n unless node.id==@root\n insert_value(middle, @nodes[node.parent], left_node, right_node)\n else\n new_root_node = Node.new\n add(new_root_node)\n new_root_node.add(middle)\n new_root_node.add_sub_tree(left_node)\n new_root_node.add_sub_tree(right_node)\n @root = new_root_node.id\n end\n node.id = -1 #delete old node\n end\n else\n false\n end\n end", "title": "" }, { "docid": "7fd2c46e25d791e67185cbdad16e7330", "score": "0.57478416", "text": "def insert(key, value, __level = nil)\n @container.insert(key, value, __level)\n end", "title": "" }, { "docid": "b3ce339eb5bd1d2595224d7aa2aebf77", "score": "0.574269", "text": "def insert(value)\n\t\tif @head == nil\n\t\t\t@head = Node.new(value)\n\t\telse\n\t\t\tcurrent_node = @head\n\t\t\twhile current_node.next do\n\t\t\t\tcurrent_node = current_node.next\n\t\t\tend\n\t\t\tcurrent_node.next = Node.new(value)\n\t\tend\t\n\tend", "title": "" }, { "docid": "f3537da733c8c8cc882911bf2020a913", "score": "0.571881", "text": "def insert(str, value=nil, index=0, len=str.size)\n\t\t\t\tk = str[index]\n\n\t\t\t\t@key = k if @key.nil?\n\n\t\t\t\tif k == @key then\n\t\t\t\t\tif (index + 1) < len then\n\t\t\t\t\t\t@ref = Structures::TST::Node.new unless @ref\n\t\t\t\t\t\t@ref.insert(str, value, index+1, len)\n\t\t\t\t\telse\n\t\t\t\t\t\t@value = value\n\t\t\t\t\tend\n\t\t\t\telsif k < @key then\n\t\t\t\t\t@left = Structures::TST::Node.new unless @left\n\t\t\t\t\t@left.insert(str, value, index, len)\n\t\t\t\telse\n\t\t\t\t\t@right = Structures::TST::Node.new unless @right\n\t\t\t\t\t@right.insert(str, value, index, len)\n\t\t\t\tend\n\n\t\t\tend", "title": "" }, { "docid": "c4bfcf7daad983e1eb6de96e8364b18b", "score": "0.57145905", "text": "def add(value)\n if @root == nil\n @root = Node.new(value)\n @count = 1\n end\n @count += 1 unless contains?(value)\n @root.add(value)\n end", "title": "" }, { "docid": "98029d7577385121cd3752c15ef1010e", "score": "0.569923", "text": "def insert(word)\n trie_ptr = self\n word.each_char.with_index do |ch, idx|\n if !trie_ptr.map_of_children[ch]\n trie_ptr.map_of_children[ch] = Trie.new\n end\n if idx == word.length-1\n trie_ptr.map_of_children[ch].end_of_word = true\n end\n trie_ptr = trie_ptr.map_of_children[ch]\n end\n end", "title": "" }, { "docid": "de4463f40bba49ec75b53e4bedf7ef7a", "score": "0.56958926", "text": "def insert_value(node, value)\r\n # If the provided value is lower than the current node's value, search the\r\n # left side for an empty spot.\r\n if value < node.value\r\n # If there's no value to the left of the current node, insert the\r\n # provided value there.\r\n if (node.left == nil)\r\n node.left = Node.new(value)\r\n return nil\r\n end\r\n\r\n # Otherwise, dig deeper\r\n return self.insert_value(node.left, value)\r\n\r\n # If the provided value is higher than the value of the current node, look\r\n # for an empty spot on the right side of the node.\r\n elsif value > node.value\r\n # If there's no value to the right of the current node, insert the\r\n # provided value there.\r\n if (node.right == nil)\r\n node.right = Node.new(value)\r\n return nil\r\n end\r\n\r\n # Otherwise, dig deeper\r\n return insert_value(node.right, value)\r\n end\r\n end", "title": "" }, { "docid": "3d391f90fac4003976496867998a6457", "score": "0.5687465", "text": "def insert value\r\n current_head = @head\r\n new_node = Node.new value, current_head, nil\r\n\r\n if current_head != nil\r\n current_head.set_prev_node new_node\r\n end\r\n\r\n @head = new_node\r\n #return a pointer to the new node so you can access it quickly (e.g. for reading, updating or deleting)\r\n return new_node\r\n end", "title": "" }, { "docid": "a4cce6de81f28445f9d198e39a6e5857", "score": "0.5665881", "text": "def add trie_node\n case\n when trie_node.heap_index != -1\n @nodes[trie_node.heap_index].occurs += 1\n heapify_down_from(trie_node.heap_index)\n when @nodes.length == @capacity\n replace_root_with(trie_node) if trie_node.occurs > @nodes[0].occurs\n else\n @nodes.push(HeapNode.new(trie_node, @nodes.length))\n heapify_up_from((@nodes.length-1))\n end\n end", "title": "" }, { "docid": "a736fa9e3be058a846802752abe4d261", "score": "0.5665494", "text": "def insert_value(key, value)\n @redis.rpush key, value\n end", "title": "" }, { "docid": "e0c5e005252bc4fdc4484ce176405cf9", "score": "0.5655201", "text": "def insert(word)\n node = @root\n word.chars.each do |char|\n if !node.children[char]\n node.children[char] = TrieNode.new\n end\n\n node = node.children[char]\n end\n node.word = true\n end", "title": "" }, { "docid": "ddce88ee1eeca943d4d11404fbb5e29d", "score": "0.5649485", "text": "def insert(val)\n return false if includes?(val)\n set[val] = true\n true\n end", "title": "" }, { "docid": "0ed82e1bc23beaf348086a24e9e45c1b", "score": "0.56475943", "text": "def insert(val)\n notContained = @h[val].empty?\n \n @h[val] << @a.length\n @a << val\n\n notContained\n end", "title": "" }, { "docid": "dc4535c49312afb30067ce1f2086525b", "score": "0.56460214", "text": "def put(_key, value)\n value = value.to_s\n index = value.size\n\n @table[index].insert(value)\n end", "title": "" }, { "docid": "c9d8cb58d77e3ad3245dc5fb92d20661", "score": "0.56433856", "text": "def insert (position, value)\r\n\t\tif(position.instance_of? Node)\r\n\t\t\tfound = false\r\n\t\t\taux = @head\r\n\t\t\twhile (aux != nil) && !found\r\n\t\t\t\tif(aux == position)\r\n\t\t\t\t\tif(aux != @head)\r\n\t\t\t\t\t\taux.prev = aux.prev.next = Node.new(value, aux, aux.prev)\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\taux.prev = @head = Node.new(value, aux, nil)\r\n\t\t\t\t\tend\r\n\t\t\t\t\tfound = true\r\n\t\t\t\tend\r\n\t\t\t\taux = aux.next\r\n\t\t\tend\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "11ee440dbaab141ccc5990a5798a93c1", "score": "0.5637598", "text": "def insert(value, root)\n temp = Node.new(value, nil, nil)\n if root.nil?\n root = temp\n return\n end\n\n current = root\n parent = nil\n\n until current.nil?\n parent = current\n current = if value <= current.data\n current.left\n else\n current.right\n end\n end\n\n if value <= parent.data\n parent.left = temp\n else\n parent.right = temp\n end\n end", "title": "" }, { "docid": "520cda4aa5888078f9a224538a6c5205", "score": "0.5633322", "text": "def store(key, value)\n\t\tint_max = 2 ** (1.size * 8) # OMG!\n\t\t@tree = insert @tree, Node.new(key, value, rand(int_max))\n\t\t@size += 1\t\t# OMG: check it out\n\t\treturn value\n\tend", "title": "" }, { "docid": "51344772b641d28a6cda2fdc3045ab3c", "score": "0.5630967", "text": "def insert(full_path, value = nil)\n node = create_all_nodes_if_needed(full_path)\n node.value = value\n node\n end", "title": "" }, { "docid": "3c672d90ca9199378dfa68cff0c8170f", "score": "0.5630275", "text": "def insert(value, node=@root)\n return if node.data == value\n\n value > node.data ? insert_right(value, node) : insert_left(value, node)\n end", "title": "" }, { "docid": "4e72338cae8c46189262afaf3562e5bb", "score": "0.5629213", "text": "def insert(key,value)\n\t\tnode_args = {:key => key, :value => value,:left => nil, :right => nil, :parent => nil}\n\t\tnew_node = BstNode::Node.new(node_args)\n\t\tif @root_node.nil?\n\t\t\t@root_node = new_node\n\t\t\t@size += 1\n\t\t\treturn value\n\t\tend\n\t\treturn insert_at_node(@root_node, new_node).value\n\tend", "title": "" }, { "docid": "8a2c6f961ae97c305b8e8134ec2602df", "score": "0.5629022", "text": "def insert_at(value, index)\n temp = @head\n count = 0\n\n if index == 0\n self.prepend(value)\n return 0\n end\n\n until temp.nil? do\n if count == index - 1\n new_node = Node.new(value)\n new_node.next_node = temp.next_node\n temp.next_node = new_node\n return 0\n end\n\n count += 1\n temp = temp.next_node\n end\n\n return nil\n end", "title": "" }, { "docid": "32ac88c0ead9255ed9cb3910cd2b347f", "score": "0.5615352", "text": "def push(value)\n\t\tputs \"Pushing #{value}\" if @debug\n\t\tkey = value.keys.first\n\t\tvalue = value.values_at(key).first\n\n\t\tif key.nil?\n\t\t\t@data = TreeNode.new(key, value, 0)\n\t\telse\n\t\t\t# If the depth is 0 then don't add anything to the tree\n\t\t\treturn if @max_depth == 0\n\t\t\tif key == @data.value\n\t\t\t\tchild = Tree.new(key, value, @data.depth + 1, @debug)\n\t\t\t\t@children << child\n\t\t\telse\n\t\t\t\t@children.each { |node|\n\t\t\t\t\tif node.data.value == key && node.data.depth<@max_depth\n\t\t\t\t\t\tchild = Tree.new(key, value, node.data.depth + 1, @debug)\n\t\t\t\t\t\t@children << child\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "97b1badef43f3ce746b73c3a5be61e97", "score": "0.56150573", "text": "def insert_at(value, index)\n new_node = Node.new(value)\n previous_node = at(index-1)\n new_node.next_node = previous_node.next_node\n previous_node.next_node = new_node\n @size += 1\n end", "title": "" }, { "docid": "ead7d3da85ce4b5411b62912e99c5bee", "score": "0.5614826", "text": "def insert(value)\n current_node = self\n\n while true\n if value < current_node.value\n if current_node.left.nil?\n current_node.left = Node.new(value)\n break\n else\n current_node = current_node.left\n end\n else\n if current_node.right.nil?\n current_node.right = Node.new(value)\n break\n else\n current_node = current_node.right\n end\n end\n end\n\n return self\n end", "title": "" }, { "docid": "24d5bde8b4a204b1a1ef24e42df9e1aa", "score": "0.56095225", "text": "def insert(value, index)\n\t\tinserted = false\n\t\tif index == 0\n\t\t\tself.unshift(value)\n\t\t\treturn true\n\t\tend\n\t\tnew_node = Node.new(value)\n\t\tpos = 1\n\t\tself.each_node do |node|\n\t\t\tif pos == index\n\t\t\t\tnew_node.link_to = node.link_to\n\t\t\t\tnode.link_to = new_node\n\t\t\t\tinserted = true\n\t\t\tend\n\t\t\tpos += 1\n\t\tend\n\t\tinserted\n\tend", "title": "" }, { "docid": "8345f88c194ee142eef08b62bb3e0aa1", "score": "0.5607538", "text": "def insert(new_value)\n node = [nil, new_value, nil]\n starting_index = determine_index(new_value)\n tree.each_with_index do |value, index|\n next if value.nil? || index < starting_index\n binding.pry\n value = find_child(new_value, value) if is_array?(value)\n comparison_value = comparison_value(value)\n binding.pry\n if new_value <= comparison_value\n index == 0 ? value[0] = node : tree[index - 1] = node\n break\n else\n tree[index + 1] = node\n break\n end\n end\n end", "title": "" }, { "docid": "bc41bd950f6a0bece2a456943e9d0643", "score": "0.56024575", "text": "def insert_at(index, value)\n return nil if index > size\n return prepend(value) if index == 0\n node = Node.new(value)\n current = at(index-1)\n node.next_node = current.next_node\n current.next_node = node\n end", "title": "" }, { "docid": "9c8d81be439a624e4d8ecc8d825a6931", "score": "0.559348", "text": "def insert(word)\n node = root\n word.chars do |char|\n if node[char].nil?\n node[char] = Trie::Node.new\n end\n node = node[char]\n end\n node.mark_as_ended\n nil\n end", "title": "" }, { "docid": "412cb5275e200d1b8786ed2e6f37db14", "score": "0.55928314", "text": "def insert(value)\n node = Node.new(value)\n\n if node.value == value\n return node\n elsif value < node.value\n insert(node.left, value)\n elsif value > node.value\n insert(node.right, value)\n else\n return node = Node.new(value)\n end\n end", "title": "" }, { "docid": "253c358b8381cd3c569f7aa58838382a", "score": "0.5592184", "text": "def add(value)\n node = get_node value\n\n # if node doesn't exist\n # add to correct place to cur node\n if node.nil?\n node = Node.new(value, self)\n @children[value.to_sym] = node\n end\n node\n end", "title": "" }, { "docid": "d5fa0b4415be38553be6b2246a3eeb25", "score": "0.5591143", "text": "def insert_at(index, value)\n return nil if index < 0 || index > @size - 1\n\n case index \n when 0 then prepend(value)\n when @size - 1 then append(value)\n\n else\n node = at(index - 1)\n new_node = Node.new\n new_node.value = value\n new_node.next_node = node.next_node\n node.next_node = new_node\n @size += 1\n update_index\n end\n end", "title": "" }, { "docid": "198b272bf0289165cfcdfe48d0e1f99f", "score": "0.55906934", "text": "def insert_at_start(key,value)\n replace(OrderedHash[self.to_a.insert(0,[key,value])])\n end", "title": "" }, { "docid": "97cd0c96bf904de6ea36f95f8cf42c21", "score": "0.5589338", "text": "def insert(word)\n node = root\n word.chars.each do |c|\n node.children[c] = TrieNode.new unless node.children.key?(c)\n node = node.children[c]\n end\n node.word = true\n end", "title": "" }, { "docid": "879a49603c7b4db23b15b30a322d2177", "score": "0.5584173", "text": "def insert_at(value, index)\n # First, traverse the list to the given index\n @location = 0\n @start = @head\n until @start.nil? || @location == index - 1\n @location += 1\n @start = @start.next_node\n end\n\n # Unless the index is out of the list, insert a new node with the given value\n if @start.nil?\n 'Index out of bounds'\n else\n @new_node = Node.new(value, @start.next_node)\n @start.next_node = @new_node\n end\n end", "title": "" }, { "docid": "81317da76a29081af2b1de73809c3c6c", "score": "0.5579519", "text": "def insert(value)\n if value < self.value\n if self.left.nil?\n self.left = BST.new(value)\n else\n self.left.insert(value)\n end\n else\n if self.right.nil?\n self.right = BST.new(value)\n else\n self.right.insert(value)\n end\n end\n end", "title": "" }, { "docid": "43f3a55add5f37e645d1658d09a2fa0c", "score": "0.5576631", "text": "def put(key, value)\n node = Node.new(key, value)\n left = search(node)\n if (left <=> node) == 0\n left.value = value\n else\n node.right, node.left = left.right, left\n left.right.left = node\n left.right = node\n end\n @size += 1\n end", "title": "" }, { "docid": "614dbb94f2d5e0ffbd1b3ba1cdbd2e90", "score": "0.55759346", "text": "def add_value(value) #private\n\t\tnode = BinaryTreeNode.new(value)\n\t\tif @root == nil then\n\t\t\t@root = node\n\t\telse\n\t\t\tadd_to_tree(node, @root)\n\t\tend\n\t\t@count += 1\n\tend", "title": "" }, { "docid": "a3b339549ac2093b59ad0722cda15a95", "score": "0.5566492", "text": "def insert_at(value, index)\n if index == 0\n prepend(value)\n elsif index >= @size\n append(value)\n else\n previous = nil\n runner = @head\n index.times do |i|\n previous = runner\n runner = runner.next\n end\n\n node = Node.new(value)\n previous.next = node\n node.next = runner\n\n @size += 1\n end\n end", "title": "" }, { "docid": "87c3ee03e02fe53a83497449c2233469", "score": "0.55659753", "text": "def add(key, value)\n if key.nil? || value.nil?\n return nil\n end\n\n if @root.nil?\n @root = TreeNode.new(key, value)\n return\n end\n\n insert_node = TreeNode.new(key, value)\n current_root = @root\n\n while !current_root.nil?\n trailing_node = current_root\n\n if key <= current_root.key\n current_root = current_root.left\n else \n current_root = current_root.right\n end\n end\n\n if key <= trailing_node.key\n trailing_node.left = insert_node\n else\n trailing_node.right = insert_node\n end\n end", "title": "" }, { "docid": "0ee8769a7f394d12ad2600f8a358a12a", "score": "0.55616087", "text": "def insert(value)\n new_node = Node.new(value)\n\n temp = @head\n @head = new_node\n new_node.next = temp\n end", "title": "" }, { "docid": "8ce4c4b66b5ef9658b40a3a716cb216f", "score": "0.5555832", "text": "def insert_at(value, index)\n if index == 0\n prepend(Node.new(value))\n elsif self.size == 0 or index - 1 > self.size\n return \"Out of Range\"\n else\n current_node = @head\n current_index = 0\n\n until current_node == nil\n if current_index == index - 1\n old_next = current_node.next\n new_node = Node.new(value, old_next)\n current_node.next = new_node\n break\n end\n current_node = current_node.next\n current_index += 1\n end\n end\n end", "title": "" }, { "docid": "b42a739539689bf52bc5195c8dc71341", "score": "0.5549718", "text": "def insert(word)\n @trie[word] = true \n end", "title": "" }, { "docid": "dafac09dcaf0cfdc27652ce7c693dcab", "score": "0.55462027", "text": "def insert(val)\n new_node = Node.new(val)\n new_node.next = @tail\n new_node.prev = @tail.prev\n @tail.prev.next = new_node\n @tail.prev = new_node\n new_node\n end", "title": "" }, { "docid": "f9082ab95b6d1468586dae3fce171ead", "score": "0.5542416", "text": "def insert(value)\n\n node = Node.new(value, nil, @tail)\n\n @head = node if @head.nil?\n @tail.next = node unless @tail.nil?\n\n @tail = node\n\n end", "title": "" }, { "docid": "8bb930740b50316e1fc857afb7f9d489", "score": "0.5540965", "text": "def register(key, subkey, value = nil)\n if value.nil?\n value = subkey\n subkey = key\n key = :root\n end\n resources(key)[subkey] = value\n end", "title": "" }, { "docid": "252a41850e8b3083bd72ff4d6e17bde5", "score": "0.5540601", "text": "def insert(word)\n ptr = @trie\n word.each_char do |char|\n ptr[char] ? ptr = ptr[char] : ptr = (ptr[char] = {})\n end\n ptr[nil] = true\n end", "title": "" }, { "docid": "8ad65744673cc22d42ba9b97c6697177", "score": "0.55389935", "text": "def put(key, value)\n @root = insert(@root, key, value)\n @root.color = Node::BLACK\n @size += 1\n end", "title": "" }, { "docid": "43d8902936ca7e99665d32a8e1cf6a0c", "score": "0.5538567", "text": "def insert_at(position,value)\n\t\tpre_insert_at(position,value)\n\t\t@values_hash[position] = value\n\t\tpost_insert_at(position,value)\n\tend", "title": "" } ]
95c4077ac2f7021853fa5358166655ce
Check if object with a given key is stale
[ { "docid": "30f4add61569e8da18c86a35c11c2951", "score": "0.68290895", "text": "def stale?(*args)\n alloc(*args).stale?\n end", "title": "" } ]
[ { "docid": "b33c4b8d4969cd949738acf22dfc48bd", "score": "0.74955994", "text": "def stale?\n unlocked? and item.has_attribute?(:updated_at) and updated_at < item.updated_at\n end", "title": "" }, { "docid": "4b9146ac1f727c5be475d77fe1172f11", "score": "0.7365694", "text": "def stale!\n if stale?\n update\n true\n else\n false\n end\n end", "title": "" }, { "docid": "c6e98bc29422787e8a01f55a6e3e578b", "score": "0.71817344", "text": "def stale?(time = Time.now)\n updated_at < time\n end", "title": "" }, { "docid": "f3b3e4f0b216bb344d19e2f377f37e80", "score": "0.71093976", "text": "def stale?(thing)\n not fresh?(thing)\n end", "title": "" }, { "docid": "04bcbd17e6e65d3f9cbc3134f84781df", "score": "0.7075669", "text": "def stale?\n !fresh?\n end", "title": "" }, { "docid": "04bcbd17e6e65d3f9cbc3134f84781df", "score": "0.7075669", "text": "def stale?\n !fresh?\n end", "title": "" }, { "docid": "04bcbd17e6e65d3f9cbc3134f84781df", "score": "0.7075669", "text": "def stale?\n !fresh?\n end", "title": "" }, { "docid": "8c7d8157613b09459daecb5e622fb33e", "score": "0.69885767", "text": "def stale?\n digest != current_digest\n end", "title": "" }, { "docid": "86292275c4bff7ae052dd86970fcbeba", "score": "0.6893089", "text": "def stale?\n @stale ||= Time.now.to_i - timestamp.to_i > MaximumAge\n end", "title": "" }, { "docid": "d1b6d7c27795905163372d24ade8efe5", "score": "0.6868305", "text": "def stale?\n prices.empty? || prices.keys.last - Time.now < 25_200\n end", "title": "" }, { "docid": "cbbf24c7319f5f8fdc54867842054d7e", "score": "0.68673855", "text": "def stale?\n updated_at < 2.hours.ago\n end", "title": "" }, { "docid": "afb1abb4bb65c7d81a54e5789c90233a", "score": "0.6735182", "text": "def stale?(object = T.unsafe(nil), **freshness_kwargs); end", "title": "" }, { "docid": "4f8b1163e214cc009cf55c681ca808cc", "score": "0.67351705", "text": "def fresh?\n not stale?\n end", "title": "" }, { "docid": "149090a2b273fb3a258965e3d33ed8b3", "score": "0.6715203", "text": "def stale?\n updated_at < 2.weeks.ago || json == '{}'\n end", "title": "" }, { "docid": "7b93433c4169afd1147dd8f3643f01a5", "score": "0.66994596", "text": "def keep_alive_key(key)\n return false unless @keys.key? key\n @mutex.synchronize do\n @keys[key][:st] = Time.now.to_i\n puts \"Keep Alive called for Key: #{key}\"\n end\n true\n end", "title": "" }, { "docid": "378db3036e77191bccf743cde4d6e3e5", "score": "0.6576852", "text": "def is_stale?\n remaining() > @lifetime\n end", "title": "" }, { "docid": "75ce3fbaa2876e094bda825ca30dff3e", "score": "0.65410733", "text": "def exists?(key, dirty: false)\n rec = @hash[key]\n if expired?(key) && !dirty && !@dirty\n @hash.delete(key)\n rec = nil\n end\n !rec.nil?\n end", "title": "" }, { "docid": "8e22dd1b28182e37f7d2ff37bbf478b9", "score": "0.65051097", "text": "def fresh?\n !stale?\n end", "title": "" }, { "docid": "be952025872d5a8b19d8275a0ac216a1", "score": "0.6472921", "text": "def expired?(key)\n rec = @hash[key]\n !rec.nil? && rec[:start] < Time.now - rec[:lifetime]\n end", "title": "" }, { "docid": "4cb385f4e891af7ab4c3e2fca391c5c0", "score": "0.6461356", "text": "def stale?\n cost < self.class.cost\n end", "title": "" }, { "docid": "1064983a4715714d149558c03d23d19a", "score": "0.63847905", "text": "def stale?\n if config.cache.is_a?(Proc)\n proc_timestamp != mem_timestamp\n else\n file_timestamp != mem_timestamp\n end\n end", "title": "" }, { "docid": "53c3e09702b7090e05b75d16dace4643", "score": "0.6375018", "text": "def stale?\n (last_updated_at || Time.at(0)) < 5.minutes.ago\n end", "title": "" }, { "docid": "0e0481849e054dc4aa6bec170b7db854", "score": "0.63514155", "text": "def stale?(object = nil, **freshness_kwargs)\n fresh_when(object, **freshness_kwargs)\n !request.fresh?(response)\n end", "title": "" }, { "docid": "e4acb6886258e1f07188be2ec61b9b54", "score": "0.63410056", "text": "def changed?(key)\n changed.has_key?(key)\n end", "title": "" }, { "docid": "e4acb6886258e1f07188be2ec61b9b54", "score": "0.63410056", "text": "def changed?(key)\n changed.has_key?(key)\n end", "title": "" }, { "docid": "5f9f591bb5fe67d74c18dd05aabe533e", "score": "0.63384557", "text": "def stale?\n return false if failed\n return false if en_route\n return false if received\n return false unless assigned\n time_alive > max_age || force_stale\n end", "title": "" }, { "docid": "0a2ea7ddfa9568eb71981ef4494dff22", "score": "0.6330283", "text": "def key?(key)\n @mutex.synchronize do\n if @entries.key?(key) && (@entries[key].nil? || @entries[key].expired?)\n @entries.delete(key)\n end\n @entries.key?(key)\n end\n end", "title": "" }, { "docid": "6a74345a935b62d30810352b0b3a95fb", "score": "0.63156074", "text": "def movies_stale?\n Time.new - self.movies.last.updated_at >= 900\n end", "title": "" }, { "docid": "23e9d493e108ec7e00f32e3d140328b8", "score": "0.6294562", "text": "def is_stale?\n frequency = dispatchable.frequency.name\n created_at < time_for_interval(frequency)\n end", "title": "" }, { "docid": "51022491b595074261c59d2a0e285639", "score": "0.62883306", "text": "def valid?\n @stale == false\n end", "title": "" }, { "docid": "a8d3f3b569e1ef123a0cde3a3257e9d5", "score": "0.62802833", "text": "def stale?(environment)\n !fresh?(environment)\n end", "title": "" }, { "docid": "1e336d8de3e88b65532e8f422dc23529", "score": "0.62194943", "text": "def hasChanged?(key)\n\t\treturn self[key] != @oldConfig[key]\n\tend", "title": "" }, { "docid": "6b3c932ffac00a7a745c2a696561bd2f", "score": "0.62124467", "text": "def stale_date?(val)\n _to_date(val) < Time.now() - (3600 * 30 + 10)\n end", "title": "" }, { "docid": "a35a6886f579a84ed5902aab467572e5", "score": "0.62002426", "text": "def get(key)\n if @memory[key]\n if @memory[key].isAlive(currentTime: Time.now)\n @memory[key]\n else\n @memory.delete(key)\n false\n end\n else\n false\n end\n end", "title": "" }, { "docid": "4e545ead12fb2fc13f590da8f76f26d4", "score": "0.6141122", "text": "def expired_kalive?(key, time)\n if !@keys.key?(key)\n return false\n end\n \n if Time.now.to_i - @keys[key][:st] > time\n puts \"Expired key due to not received keepalive within #{time} seconds : #{key}\"\n return true\n end\n\n false\n end", "title": "" }, { "docid": "31985bf27fb07fcca11f31b7799ed69c", "score": "0.6136571", "text": "def stale?\n forecasts.empty? || (Time.now - data_file.mtime) > 14_400\n end", "title": "" }, { "docid": "efac5981931c9ee6a0066594c0378919", "score": "0.60752726", "text": "def stale(value)\n unless (['ok', 'update_after'].include?(value.to_s))\n raise \"View#stale can only be set with 'ok' or 'update_after'.\"\n end\n update_query(:stale => value.to_s)\n end", "title": "" }, { "docid": "aa91a0267d73841919b7b4dd50d355f8", "score": "0.6055274", "text": "def not_expired(widget, key, options)\n with_instance_content(widget, options) do |instance_key|\n valid_keys = retrieve(instance_key)\n begin\n if valid_keys.blank? || !valid_keys[:keys].include?(key)\n return false\n end\n rescue\n return false\n end\n end\n true\n end", "title": "" }, { "docid": "a15b643d447cfa653838dbd7350cf5c1", "score": "0.60154396", "text": "def if_stale?(record, options = {})\n options = StaleOptions.create(record, **options)\n\n if stale?(**options)\n block_given? ? yield(record) : true\n end\n end", "title": "" }, { "docid": "0ffbff1e097dffff39837d6c49c71dc3", "score": "0.6000754", "text": "def verify\n @cache[:last_accessed] = nil if\n @cache.has_key?(:last_accessed) &&\n @cache[:last_accessed].to_date != Date.today\n end", "title": "" }, { "docid": "86f1e06573fdddf1dfce1703eedd100e", "score": "0.5993725", "text": "def mark_overflowed(key)\n key = key.to_s unless key.is_a?(String)\n i = 0\n while i < MAX_ATTEMPTS\n tat_from_store, now = @store.get_with_time(key)\n new_value = now + @delay_variation_tolerance\n ttl = @delay_variation_tolerance\n updated = if tat_from_store.nil?\n @store.set_if_not_exists_with_ttl(key, new_value, ttl)\n else\n @store.compare_and_set_with_ttl(key, tat_from_store, new_value, ttl)\n end\n if updated\n return true\n end\n i += 1\n end\n\n raise StoreUpdateFailed.new(\n \"Failed to store updated rate limit data for key '#{key}' after #{MAX_ATTEMPTS} attempts\"\n )\n end", "title": "" }, { "docid": "c649bd762da75e62ac2473745e1b3f08", "score": "0.59857893", "text": "def stale?\n return true if expired?\n if header['Cache-Control']\n return true if header['Cache-Control'].include?('must-revalidate')\n return true if header['Cache-Control'].include?('no-cache')\n end\n\n false\n end", "title": "" }, { "docid": "997a6b9a6bf79fbd3c488f20656e4027", "score": "0.59399474", "text": "def outdated?(obj)\n outdatedness_reasons_for(obj).any?\n end", "title": "" }, { "docid": "fc33f96be4aa67e960327a48797e8dec", "score": "0.5936063", "text": "def fresh_at?(time)\n time >= updated_at\n end", "title": "" }, { "docid": "cfcda59921b6ca51468ab934d015e54d", "score": "0.59355056", "text": "def getObjectHasBeenChecked(object)\n return object[\"attrs\"][\"last_check\"] > 0\n end", "title": "" }, { "docid": "a1b23da543f4c60fe828e6e416f61677", "score": "0.59320873", "text": "def ensure_cache_up_to_date\n self.last_update_timestamp = self.redis.get(\"bluster:last_update_timestamp\").to_i\n if self.last_update_timestamp.nil?\n update_object_cache\n elsif self.last_update_timestamp != File.new(self.objects_path).mtime.to_i\n update_object_cache\n end\n end", "title": "" }, { "docid": "3f86a3c6ab7b56d5b55d307753083b3e", "score": "0.5906085", "text": "def attr_dirty?(key)\n @dirty_attribute_keys ||= []\n @dirty_attribute_keys.include?(key.to_sym)\n end", "title": "" }, { "docid": "af046972315839394dcc27feeb852244", "score": "0.5899506", "text": "def content_changed_since?(last_updated)\n stale?(:last_modified => last_updated)\n end", "title": "" }, { "docid": "ad5f97d6d46a60d488e21d067ab50764", "score": "0.58984363", "text": "def stale_state\n end", "title": "" }, { "docid": "571230e3fd49d0d354adbad824959305", "score": "0.58538336", "text": "def state(key, refetch_time, invalid_time)\n if @store.exists?(key)\n if !@store.expired?(key, refetch_time)\n :current\n elsif (invalid_time == :forever) || !@store.expired?(key, invalid_time)\n :refetch\n else\n :invalid\n end\n else\n :missing\n end\n end", "title": "" }, { "docid": "ce739ebafc1550f1d8c367d81cb9dc64", "score": "0.5853639", "text": "def has_eventually?(key, accessor, expected)\n Timeout::timeout(@timeout_seconds) do \n loop do \n break if JFrame::Widget_map.has_key?(key)\n TestLogger.debug \"Driver: No #{key}\"\n sleep 0.1\n end\n\n loop do \n actual = JFrame::Widget_map[key].send(accessor)\n break if actual == expected\n TestLogger.debug \"Driver: #{key} not set to #{expected}. Still #{actual}.\"\n sleep 0.1\n end\n true\n end\n rescue Timeout::Error\n false\n end", "title": "" }, { "docid": "434137f3c792ca82e529afb365a026ac", "score": "0.58522815", "text": "def stale_target?\n loaded? && @stale_state != stale_state\n end", "title": "" }, { "docid": "434137f3c792ca82e529afb365a026ac", "score": "0.58522815", "text": "def stale_target?\n loaded? && @stale_state != stale_state\n end", "title": "" }, { "docid": "434137f3c792ca82e529afb365a026ac", "score": "0.58522815", "text": "def stale_target?\n loaded? && @stale_state != stale_state\n end", "title": "" }, { "docid": "ed08041c4e2f1e20fa98adaf6fbbe1e6", "score": "0.5849701", "text": "def cached?(key)\n false\n end", "title": "" }, { "docid": "fc761b126a029e0de145c5b89f25581b", "score": "0.58495635", "text": "def key_held?(key)\n @held_interval[key] == G.kb_held_interval\n end", "title": "" }, { "docid": "582b9d51d6957cf4d8765f99469002b2", "score": "0.58416474", "text": "def outdated?\n (Time.now - self.time_of_last_ok) > threshold_for_oldest_ok\n end", "title": "" }, { "docid": "6673e155be7d9471cc6eb9fb55e17d2f", "score": "0.5837788", "text": "def expire_match(key)\n true\n end", "title": "" }, { "docid": "14d1a4122dd639b52c72f0661d6a7387", "score": "0.5824905", "text": "def denormalized_value_stale?(attribute_name)\n attribute_name = attribute_name.to_s.to_sym\n self.class.denormalized_attribute?(attribute_name) &&\n (\n (\n self.class.denormalized_attributes_invalid_when_nil.present? &&\n self.class.denormalized_attributes_invalid_when_nil.include?(attribute_name) &&\n self.send(attribute_name).nil?\n ) ||\n denormalized_value_stale_by_field?(attribute_name) ||\n denormalized_value_stale_by_association?(attribute_name)\n )\n end", "title": "" }, { "docid": "d001ee1c86502b315fad291f6553c814", "score": "0.5821344", "text": "def bustable_stale?(object = nil, **kwd_args)\n etag_disabled? || stale?(object, strong_etag: bustable_etag(kwd_args[:strong_etag]), **kwd_args)\n end", "title": "" }, { "docid": "0fc16bf022bd4afa92fbf59d1df38931", "score": "0.58164716", "text": "def isStale?(file, old_files)\n\t\treturn true unless File.exist?(file)\n\t\tnew_time = File.mtime(file)\n\t\told_files.each do |old|\n\t\t\tif File.exist?(old)\n\t\t\t\t#debug \"New Time: #{new_time}\"\n\t\t\t\t#debug \"Old Time: #{File.mtime(old)}\"\n\t\t\t\treturn true if new_time < File.mtime(old)\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend", "title": "" }, { "docid": "063044a1692e33871bc4e07b866b8f0b", "score": "0.58147687", "text": "def old?\n\t\t@mutex.synchronize {\n\t\t\t@old\n\t\t}\n\tend", "title": "" }, { "docid": "104eed18513431c17ab094a71bb03131", "score": "0.5793099", "text": "def is_cache_expired?(key)\n raise 'The is_cache_expired method must be implemented'\n end", "title": "" }, { "docid": "b22af124e9d4786ffaf43928c58b8196", "score": "0.5784045", "text": "def expire_match(key)\n @mutex.synchronize do\n @cache.delete_if do |k,v| k.match(/#{key}/) end\n end\n Merb.logger.info(\"cache: expired matching (#{key})\")\n true\n end", "title": "" }, { "docid": "8ac69567d111c8a2d9ab711ae02a70f7", "score": "0.5779896", "text": "def expired? key\n return false if timeout.nil?\n mtime = read_cache_mtime(key)\n return (mtime.nil? || mtime+timeout <= Time.now)\n end", "title": "" }, { "docid": "a40174f54a132eb262a04c45314f643f", "score": "0.5757012", "text": "def fresh?(cached_response)\n age = cached_response_age(cached_response)\n max_age = cached_response_max_age(cached_response)\n\n if age && max_age # Always stale without these values\n age <= max_age\n end\n end", "title": "" }, { "docid": "b956701ad2c3b2d0c1678d529e014e84", "score": "0.57552475", "text": "def stale\n stale = stats.keep_if do |pid, stats|\n # Zombies that were not successfully killed don't have :sessions etc.\n stats[:sessions].to_i > 0 and\n stats[:processed].to_i < 10 and\n stats[:uptime].to_i >= @options[:stale]\n end\n\n kill stale, \"Stale\", :SIGABRT\n end", "title": "" }, { "docid": "ce11b2935b0a3be49ed5a41d9a53b336", "score": "0.5739695", "text": "def up_to_date_for?(timestamp)\n keys.sort.last >= timestamp\n end", "title": "" }, { "docid": "f5731c57e5e86d9a63060a061556762e", "score": "0.5719923", "text": "def key?(key)\n self.reload if @should_reload\n return @data.key?(key.to_sym)\n end", "title": "" }, { "docid": "b448dce58289d4a6b92bcf542901a898", "score": "0.5719651", "text": "def has_changed?\n updated_at > 8.hours.ago\n end", "title": "" }, { "docid": "d829114587fc70c144307880b8657db3", "score": "0.5701754", "text": "def regenerate?\n outdated? ||\n updated_at < sheet.updated_at ||\n updated_at < sheet.design.updated_at ||\n updated_at < sheet.project.updated_at ||\n updated_at < Time.zone.today - 1.hour\n end", "title": "" }, { "docid": "11d7f142c05d2ae53e92331749506167", "score": "0.5699822", "text": "def dirty?(attr=nil)\n _mon.synchronize do\n if(attr)\n dirty.has_key?(attr)\n else\n if(@_checksum)\n !dirty.empty? ||\n @_checksum != Digest::SHA256.hexdigest(MultiJson.dump(data.inspect).to_s)\n else\n true\n end\n end\n end\n end", "title": "" }, { "docid": "1b6943f229e5d2dc282f8db91f2a2580", "score": "0.5679953", "text": "def has_key?(key)\n @cache.has_key?(key)\n end", "title": "" }, { "docid": "ff0599bc8704bf35924ddc2d0fb52b6d", "score": "0.5667652", "text": "def seen?(ticket, old_cache)\n !old_cache.key?(ticket[:spacekey]) or \n old_cache[ticket[:spacekey]] < ticket[:id]\n end", "title": "" }, { "docid": "8b526e8db6fecb950654cc9bcdbb7864", "score": "0.5660665", "text": "def stale_approval?\n ActsAsApprovable.stale_check? and update? and stale?\n end", "title": "" }, { "docid": "4210a751d8b243314add5d997d03eecf", "score": "0.56581193", "text": "def fresh?\n ttl && ttl > 0\n end", "title": "" }, { "docid": "2e6729e6f614c408af6dd7554bcaec33", "score": "0.5651734", "text": "def changed?(attr=nil)\n @_hr_changed ||= Hash.new(false)\n return @_hr_changed[attr.to_sym] if attr\n return @_hr_changed.keys.count > 0\n end", "title": "" }, { "docid": "2e6729e6f614c408af6dd7554bcaec33", "score": "0.5651734", "text": "def changed?(attr=nil)\n @_hr_changed ||= Hash.new(false)\n return @_hr_changed[attr.to_sym] if attr\n return @_hr_changed.keys.count > 0\n end", "title": "" }, { "docid": "e60bd8f5a976a302d318639dcd437ce0", "score": "0.5637067", "text": "def queued_method_stale?(data)\n queued_method_expired?(data) or ((data[:stale_at].class.name =~ /Time/) and data[:stale_at] < Time.now)\n end", "title": "" }, { "docid": "00f6bb85dc72d1f0f9b68588abe213cc", "score": "0.5636687", "text": "def has key, expire_time = nil\n return false unless CACHE.has_key? key\n return true unless expire_time\n return false if Time.at(CACHE[key][1]) < (Time.now - expire_time)\n true\n end", "title": "" }, { "docid": "0998fa498146f9b8708a5ce8bd721fec", "score": "0.5629374", "text": "def gets_updated?\n for p in all_periods\n return true if p.keep_updated?\n end\n return false\n end", "title": "" }, { "docid": "5c87758c1ea56e0877a29f7b6efaf734", "score": "0.5624673", "text": "def store_changed?(before, after)\n HashDiff.diff(before, after).count > 0\nend", "title": "" }, { "docid": "af929a5bbc6b6f0d83f2483f74e740c6", "score": "0.56230056", "text": "def locked? key\n ! ! data(key, LOCKED)\n end", "title": "" }, { "docid": "7f9bb5c182f138f0251c3ace5f0da9a6", "score": "0.56210536", "text": "def need_update?\n return true unless @lastread\n @lastread < File::stat(@path).mtime\n end", "title": "" }, { "docid": "48dd5fb14bb3fd118daf0790f9fae7ad", "score": "0.56209254", "text": "def clean\n synchronized { @hash.delete_if { |_key, value| expired?(value) } }\n end", "title": "" }, { "docid": "b9da9a5de19afb8cd7760bb58ace3f92", "score": "0.55996317", "text": "def fresh?\n fresh_by_time? || fresh_by_etag?\n end", "title": "" }, { "docid": "6951e32856db192bb7d9a19bb4770e06", "score": "0.5596675", "text": "def changed?(key = nil)\n if key.nil?\n changes.any?\n else\n changes.include?(key)\n end\n end", "title": "" }, { "docid": "6951e32856db192bb7d9a19bb4770e06", "score": "0.5596675", "text": "def changed?(key = nil)\n if key.nil?\n changes.any?\n else\n changes.include?(key)\n end\n end", "title": "" }, { "docid": "3815ba97f89fdc5f21678cdcd99b4ed4", "score": "0.55922496", "text": "def is_cache_expired?(key)\n time_stamp_position = 1;\n fname = _find_file_key(key)\n return true if fname.nil?\n\n fname_a = fname.split('-')\n if Time.now.to_i > fname_a[time_stamp_position].to_i\n return true\n end\n\n return false;\n end", "title": "" }, { "docid": "7d4391c9285d726e14d67b312ce89341", "score": "0.5585881", "text": "def has_key? key\n @lock.read_sync{ @data.has_key? key }\n end", "title": "" }, { "docid": "aef899cd9dfa91639ac5a7e317f223aa", "score": "0.55735284", "text": "def _update_check_needed\n (Time.now - @last_update_check) > UPDATE_VALID_PERIOD\n end", "title": "" }, { "docid": "cdfa2918f295bd9c84637b83e3d99d26", "score": "0.5570241", "text": "def changed?(key=nil)\n if key\n # return the changed values for the keys\n changed_attributes.key?(key)\n else\n changed_attributes.present?\n end\n end", "title": "" }, { "docid": "e0384321eef92b7db44caabc2920d0f9", "score": "0.55619043", "text": "def stale_state\n nil\n end", "title": "" }, { "docid": "e0384321eef92b7db44caabc2920d0f9", "score": "0.55619043", "text": "def stale_state\n nil\n end", "title": "" }, { "docid": "250417d4df7b0754f76819b7283ce983", "score": "0.55581546", "text": "def reload\n\t\t\t\t@keyed.each_value(&:clear!)\n\t\t\t\t\n\t\t\t\tyield\n\t\t\t\t\n\t\t\t\tdirty = false\n\t\t\t\t\n\t\t\t\t@keyed.delete_if do |key, value|\n\t\t\t\t\tvalue.stop? && (dirty = true)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\treturn dirty\n\t\t\tend", "title": "" }, { "docid": "4776097f5e0dc2074cd36f84886eeccc", "score": "0.5557463", "text": "def dirty?\n return !self.headers.first(:name => :dirty).nil?\n end", "title": "" }, { "docid": "d102408905e716c905048319eb9cc1fb", "score": "0.5557108", "text": "def dirty?(key=nil, **opts)\n if key.nil?\n !@dirty.empty?\n else\n @dirty.key?(key.to_sym)\n end\n end", "title": "" }, { "docid": "bd65e14e9060d2dda136fd17e7d518ab", "score": "0.55563384", "text": "def force_get(key)\n # Return nothing if not in the cache or it has expired.\n return if key.nil?\n\n entry = @cache[key]\n return unless entry\n entry.object\n end", "title": "" }, { "docid": "fac6917274b086756b39ce161bfc4724", "score": "0.555477", "text": "def update?\n if @w_up_to_date && true #all up_to_date-caches!!!\n @up_to_date = true\n return @up_to_date\n end\n false\n end", "title": "" }, { "docid": "f590683d98c1ed41338f03f541a076a3", "score": "0.5553187", "text": "def valid_cache_key?(key, expires = nil)\n cache_valid_from\n rv = @cache[key] && (@cache[key][:inserted_at] > cache_valid_from) && (expires.nil? || (@cache[key][:inserted_at] < expires)) ? true : false\n rv\n end", "title": "" } ]
9142587730cce547c877a7b04be9a7e9
GET /resource/sign_in def new super end POST /resource/sign_in def create super end DELETE /resource/sign_out def destroy super end
[ { "docid": "884e0503375bb69c4c1ff0dd3a487efa", "score": "0.0", "text": "def index\n @users = User.all.page(params[:page])\n end", "title": "" } ]
[ { "docid": "f9faf8644d2e0cadf045e870c9943753", "score": "0.73311436", "text": "def signin\n signin_get if request.get?\n signin_post if request.post?\n end", "title": "" }, { "docid": "c18bf8d6db417642bc865363f39bc381", "score": "0.7212876", "text": "def sign_in; end", "title": "" }, { "docid": "ef3000192755b0792dcc104c35775548", "score": "0.70910233", "text": "def signin\n end", "title": "" }, { "docid": "4bc9a8abda8cf4a5d086a2a8a2e92de8", "score": "0.6947524", "text": "def create\n resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in, user: resource) if is_navigational_format?\n sign_in(resource_name, resource)\n respond_with resource, :location => after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "0118ef88b5bc57c574d0cfc635475ff8", "score": "0.6935774", "text": "def resource_for_signin\n @user_for_signin ||= User.new_with_session({}, session)\n end", "title": "" }, { "docid": "e9df1eaa55dca094b802cc03dd15fafb", "score": "0.69023204", "text": "def sign_in\n post auth_session_path({ session: { email: users(:regular_user).email, password: '12345678' } })\n end", "title": "" }, { "docid": "2d4d41ac6e424b4812e06975351b9c8f", "score": "0.68797386", "text": "def sign_up(resource_name, resource)\n # sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "0f06fb51084380a31e5eea006607f484", "score": "0.6844813", "text": "def sign_in\n user = users :user\n sign_in_with user.email, \"password\"\n end", "title": "" }, { "docid": "54ba362d0120666f6bdce6fa55bcf6ff", "score": "0.6822475", "text": "def create\n sign_in_params = get_sign_in_params\n result = do_sign_in(sign_in_params)\n\n if result.nil?\n response_wrapper(\n :unauthorized,\n nil,\n 'Incorrect user name, email, or password. Alternatively, you may need to confirm your account or it may be locked.',\n [:confirm, :reset_password, :resend_unlock]\n )\n else\n response_wrapper(\n :ok,\n {\n auth_token: sign_in_params[:resource].authentication_token,\n #email: sign_in_params[:resource].email,\n user_name: sign_in_params[:resource].user_name,\n message: I18n.t('devise.sessions.signed_in')\n }\n )\n end\n end", "title": "" }, { "docid": "a9b4eb0d4f8f9d435e46eaa458633235", "score": "0.67952883", "text": "def create\n sign_out(:user) if current_user\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_flashing_format?\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource, location: after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "a4e3da0afc5d620e2e72462c54c2cc98", "score": "0.67723614", "text": "def sign_in\n @user = User.new\n render \"login\"\n end", "title": "" }, { "docid": "a1f0ec6ed1cc0bd08bfd60f8831b6426", "score": "0.6765781", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_navigational_format?\n sign_in(resource_name, resource)\n if resource.errors.empty?\n render json: payload(resource)\n else\n render json: {errors: resource.errors}, status: :unauthorized\n end\n end", "title": "" }, { "docid": "5ab60b21a090c1ee367152562ab4679a", "score": "0.67559135", "text": "def resource_params\n params.require(:sign_in).permit(:login, :password)\n end", "title": "" }, { "docid": "8c090e3716c7dda46ecac690c2c06982", "score": "0.6728297", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:success, :signed_in) if is_navigational_format?\n sign_in(resource_name, resource)\n if !session[:return_to].blank?\n redirect_to session[:return_to]\n session[:return_to] = nil\n else\n respond_with resource, :location => after_sign_in_path_for(resource)\n end\n end", "title": "" }, { "docid": "7d38649c31e6ff6455af5766d3f2840b", "score": "0.67275405", "text": "def create\n session_resource_name = controller_name.singularize\n\n respond_to do |format|\n # Remap the session information to the Devise scope name, which will be picked up on for authentication purposes.\n format.json do\n request.params[resource_name] = request.params[session_resource_name]\n request.params.delete(session_resource_name)\n end\n\n format.all {}\n end\n\n # Copied from `Devise::SessionsController`.\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_flashing_format?\n redirect_path = after_sign_in_path_for(resource_name)\n sign_in(resource_name, resource)\n yield resource if block_given?\n\n respond_to do |format|\n format.any(*navigational_formats) { redirect_to redirect_path }\n\n format.json do\n render json: session_resource(0, find_message(:signed_in), resource)\n end\n\n format.all { head :no_content }\n end\n end", "title": "" }, { "docid": "cf935aa81ca16e76b365390ad238bf6e", "score": "0.6708753", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_flashing_format?\n # render text: \"HAI\"\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource, location: profile_path\n end", "title": "" }, { "docid": "db9c4506812f41bed4607ed77da4b8a7", "score": "0.6683985", "text": "def sign_up(resource_name, resource)\n # angular is doing the login on its own\n #sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "d58ca37f80c858ed220acf633b20ad37", "score": "0.66756785", "text": "def new\n\t\tif (session[:request_format].present? && session[:request_format] == \"json\")\n\n\t\telse\n\t\t\tself.resource = resource_class.new(sign_in_params)\n\t \tclean_up_passwords(resource)\n\t\tend\n\n\t\tyield resource if block_given?\t\n\t\trespond_to do |format|\n\t\t\tformat.json {\n\n\t\t\t\trender json: {:status => 200, :success => true, :info => \"Logged in\"}\n\t\t\t}\n\t\t\tformat.html {respond_with resource, location: serialize_options(resource)}\n\t\tend\n\t\t#respond_with(resource, serialize_options(resource))\n\tend", "title": "" }, { "docid": "be65b33f5cde62fe80258784ddcce6a6", "score": "0.6660983", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in, :username => resource.full_name) if is_flashing_format?\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource, location: after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "41cb52179dc561016dd465106d20a9c9", "score": "0.6658045", "text": "def sign_up(resource_name, resource)\n\t\tsign_in(resource_name, resource)\n\tend", "title": "" }, { "docid": "c4731dd83e82cfce6efcd77e2dbd2f2a", "score": "0.6606237", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource, location: after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "e344ac5a39ebff66d15ad1b728dbd828", "score": "0.66015106", "text": "def sign_in(resource_name, user, *args)\n create_token(user)\n session['api_token'] = token ? token['token'] : nil\n super\n end", "title": "" }, { "docid": "197009171c157d2edac9ac26cb7a6aed", "score": "0.659481", "text": "def sign_in\n @user = User.new\n end", "title": "" }, { "docid": "197009171c157d2edac9ac26cb7a6aed", "score": "0.659481", "text": "def sign_in\n @user = User.new\n end", "title": "" }, { "docid": "d1586abd8cb3cea528415fe3034076d0", "score": "0.65935934", "text": "def create\n respond_to do |format|\n format.html { super }\n format.json do\n sign_in_via_api\n end\n end\n end", "title": "" }, { "docid": "1456badb09b298e4ef2b60278ee0da3c", "score": "0.6583573", "text": "def signIn\n @user = User.new\n end", "title": "" }, { "docid": "9a0ef9e443acfd57850d92c2b43cc32b", "score": "0.6578454", "text": "def sign_in(*_)\n super.tap { controller.current_comable_user.after_set_user }\n end", "title": "" }, { "docid": "9a0ef9e443acfd57850d92c2b43cc32b", "score": "0.6578454", "text": "def sign_in(*_)\n super.tap { controller.current_comable_user.after_set_user }\n end", "title": "" }, { "docid": "c2f08763d17cf892101377050187fc85", "score": "0.65735644", "text": "def sign_up(resource_name, resource)\r\n sign_in(resource_name, resource)\r\n end", "title": "" }, { "docid": "d4e6ef9665c8985b54b91b44c23341fd", "score": "0.65724015", "text": "def sign_up(resource_name, resource) #para que no se auto sign_in cuando se sign up\n end", "title": "" }, { "docid": "22c391e0065205e3f8bf22d1b29de4d9", "score": "0.6565332", "text": "def new\n self.resource = resource_class.new(sign_in_params)\n logger.debug(\"SSSSSSSSSSSSSSSSS\" + \"ssss\")\n logger.debug(resource)\n clean_up_passwords(resource)\n yield resource if block_given?\n respond_with(resource, serialize_options(resource))\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "862b066c0d9f7dd56a5901fda02b7081", "score": "0.6559103", "text": "def sign_up(resource_name, resource)\n sign_in(resource_name, resource)\n end", "title": "" }, { "docid": "84c7aadedad17bd1fcea1c37e6bae1ee", "score": "0.655626", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n if self.resource.deleted_flg?\n set_flash_message!(:danger, :deleted_account)\n redirect_to root_path and return\n end\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource, location: after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "d6d1b25bc4c62dc742cffd849d9d9457", "score": "0.6549216", "text": "def sign_in(user:, password:)\n post user_session_path \\\n 'user[email]' => user.email,\n 'user[password]' => password\n end", "title": "" }, { "docid": "3750904b26d4c6d0331f3892c708baa5", "score": "0.6549156", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n respond_with resource_json, location: after_sign_in_path_for(resource)\n end", "title": "" }, { "docid": "b274311f8565209cd4effe85e03a333d", "score": "0.65473205", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n yield resource if block_given?\n if resource.nil?\n render json: {\n error: 'User not found'\n }, status: 441\n else\n render json: {\n name: current_user.name,\n phone: current_user.phone,\n id: current_user.id,\n role: current_user.role,\n token: current_user.token,\n meteors: current_user.meteors\n }\n end\n end", "title": "" }, { "docid": "b4cc98ef3ce99065230c737d5b562501", "score": "0.65464395", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n set_flash_message!(:notice, :signed_in)\n sign_in(resource_name, resource)\n respond_to do |format|\n format.html { redirect_to(after_sign_in_path_for(resource)) }\n format.json { render json: resource.from_json(on_page: params[:on_page]) }\n end\n end", "title": "" }, { "docid": "ec76030f5169cc1b47732516f5504bba", "score": "0.6545466", "text": "def admin_sign_in\n self.resource = resource_class.new(sign_in_params)\n clean_up_passwords(resource)\n yield resource if block_given?\n respond_with(resource, serialize_options(resource))\n end", "title": "" }, { "docid": "ac84bad0f8945780c1701ae82dd60380", "score": "0.6542391", "text": "def sign_in\n User.delete_all\n User.create({name: 'MyString', email: 'MyString', password: '1234567a'})\n post login_url, params: { session: {email: 'MyString', password: '1234567a'} }\n end", "title": "" }, { "docid": "2880667c6b51c08a5a0755dcb982fbdb", "score": "0.653741", "text": "def create\n super do |resource|\n @after_sign_in_path = after_sign_in_path_for(resource)\n end\n end", "title": "" }, { "docid": "49a26fe2b2090e7452a0a5dcb49e8677", "score": "0.6522358", "text": "def create\n @user = User.new(user_params)\n\n if @user.save\n sign_in @user\n redirect_to '/'\n else\n render 'new'\n end\n\n end", "title": "" }, { "docid": "f5f3b02f0da130f426a6771c51e9028a", "score": "0.6498965", "text": "def new\n @user_sign_in = UserSignIn.new\n end", "title": "" }, { "docid": "6cdf28f81ced8e76d3c784f9aa7f4a27", "score": "0.6497658", "text": "def sign_in(user)\n post user_session_path \\\n \"user[email]\" => user.email,\n \"user[password]\" => user.password\nend", "title": "" }, { "docid": "9ff8910a51a810f09c68b341eb8a4580", "score": "0.649566", "text": "def create\n #Checks to see if request is coming from JSON\n if request.headers[\"ACCEPT\"] == \"application/json\"\n self.resource = warden.authenticate!(auth_options)\n set_flash_message(:notice, :signed_in) if is_flashing_format?\n sign_in(resource_name, resource)\n yield resource if block_given?\n\n # Generate auth_token and render JSON after authenticating\n token = AuthToken.issue_token({ user: resource.id })\n respond_with resource, location: after_sign_in_path_for(resource) do |format|\n format.json { render json: { user: resource.email, token: token } }\n end\n else\n super\n end\n end", "title": "" }, { "docid": "d498622c2b5ffdca386f093ae50d8bb5", "score": "0.6485288", "text": "def new\n self.resource = resource_class.new(sign_in_params)\n clean_up_passwords(resource)\n yield resource if block_given?\n respond_with(resource, serialize_options(resource))\n end", "title": "" }, { "docid": "31a033b817f1ad62a073f038673b79df", "score": "0.6441197", "text": "def create\n # super\n respond_to do |format|\n format.html {\n\n super\n }\n format.json {\n resource = User.find_for_database_authentication(:email=>params[:email])\n return invalid_login_attempt unless resource\n\n if resource.valid_password?(params[:password])\n sign_in(\"user\", resource)\n render :json=> {:success=>true}\n return\n end\n invalid_login_attempt\n\n }\n end\n end", "title": "" }, { "docid": "59bfaeac0389688240b74fdb0a570d97", "score": "0.6428172", "text": "def sign_in\n current_session || sign_user_in\nend", "title": "" }, { "docid": "dd049d4195550bb1241e5b7416732609", "score": "0.6408098", "text": "def sign_in\n CrossAppSession.clear_sessions_for_user(self)\n CrossAppSession.new_for_user(self).save\n end", "title": "" }, { "docid": "cc9bec6d6ac957f3d621315c3d813787", "score": "0.6393163", "text": "def create\n @user = User.new(params[:user])\n if @user.save\n sign_in @user\n redirect_to @user\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "61aec16e108942a36d5c133b4d46b4eb", "score": "0.6392159", "text": "def sign_in user\n login_as user\n\n user\n end", "title": "" }, { "docid": "f86227bb07cef562ec80b48edc912488", "score": "0.6382981", "text": "def sign_in(email:, password:)\n post login_path, params: {session: {email: email, password: password}}\n end", "title": "" }, { "docid": "8862219e45e021e2c5df81399d8f6a21", "score": "0.6382577", "text": "def create\n build_resource\n\n if resource.save\n if resource.active_for_authentication?\n set_flash_message :notice, :signed_up if is_navigational_format?\n #sign_in(resource_name, resource)\n respond_with resource, :location => after_sign_up_path_for(resource)\n else\n set_flash_message :notice, :\"signed_up_but_#{resource.inactive_message}\" if is_navigational_format?\n expire_session_data_after_sign_in!\n respond_with resource, :location => after_inactive_sign_up_path_for(resource)\n end\n else\n clean_up_passwords resource\n respond_with resource\n end\n end", "title": "" }, { "docid": "87c81d6d15482eca31fa5e9b9a961122", "score": "0.63793963", "text": "def sign_in \n current_session || sign_user_in\nend", "title": "" }, { "docid": "73bb55562a0ec8612079e31c39771e56", "score": "0.6371228", "text": "def signin\n if request.get?\n \n else\n #render plain: params\n user = User.sign_in(params)\n if user == \"404\"\n flash[:error] = 'Either Email or Contact is incorrect!'\n redirect_to users_signin_path\n return\n elsif user == \"405\"\n flash[:error] = \"Account is Deactivated!\"\n redirect_to users_signin_path\n return\n elsif user == \"406\"\n flash[:error] = \"Password is incorrect!\"\n redirect_to users_signin_path\n return\n else\n session[:user_id] = user\n session[:authenticate] = true\n session[:expires_at] = Time.current + 20.minutes\n flash[:success] = \"You have been logged in.\"\n redirect_to users_path\n end\n end\n end", "title": "" }, { "docid": "3ab833dd0028a048398e4f9d33375169", "score": "0.6355324", "text": "def sign_in\n post login_path, params: { user_name: \"User\" }\n end", "title": "" }, { "docid": "3d4398f7a251ac98ea7349e34fc0d33d", "score": "0.6349513", "text": "def new\n self.resource = resource_class.new(sign_in_params)\n store_location_for(resource, params[:redirect_to])\n super\n end", "title": "" }, { "docid": "1479f79c30738f4453d4ec8cf411f955", "score": "0.63459677", "text": "def new\n # 查测到是微信登录,则跳过登录,\n return if before_login_by_wx_pub # TODO:还要考虑强制非微信登录的情况\n # super\n # session[:user_return_to] = request.referer unless request.referer && (request.referer.include?(\"/sign_in\"))\n self.resource = resource_class.new(sign_in_params)\n clean_up_passwords(resource)\n end", "title": "" }, { "docid": "94cdea9987d5179a7266c9669e89070e", "score": "0.634523", "text": "def sign_in(resource)\n login_as(resource, scope: warden_scope(resource))\n end", "title": "" }, { "docid": "30f7e5c976d02cfdfbf03d0a4b4acaa9", "score": "0.63347304", "text": "def signin\n if signin?\n redirect_to_home_page(@current_user)\n else\n if request.get?\n else\n email = params[:email]\n password = params[:password]\n @user = User.authenticate(email, password)\n if !@user.nil?\n # 20141211: HuyenDT change\n # session[:user_id] = @user.id\n start_user_session(@user)\n @current_user = @user\n\n #redirect user's home page\n redirect_to_home_page(@current_user)\n else\n flash.now[:error] = t('signin.msg_signin_fail')\n render :signin\n end\n end\n end\n end", "title": "" }, { "docid": "292858465019b463baec07157fa44509", "score": "0.6322392", "text": "def sign_in(user)\n session.sign_in(user)\n end", "title": "" }, { "docid": "ec1ce07c74d2756f037eda78bddedf1e", "score": "0.63181627", "text": "def create\n self.resource = warden.authenticate!(auth_options)\n sign_in(resource_name, resource)\n \n current_user.update authentication_token: nil\n \n render :json => current_user, \n :meta => { :auth_token => current_user.authentication_token }\n end", "title": "" }, { "docid": "fe7312e85dfb0970dba04647393b4dda", "score": "0.63170886", "text": "def create\n respond_to do |format|\n format.html { super }\n format.json do\n self.resource = warden.authenticate!(auth_options)\n resource.reset_authentication_token\n sign_in(resource_name, resource)\n data = {\n user_token: resource.authentication_token,\n user_email: resource.email\n }\n render json: data, status: 201\n end\n end\n end", "title": "" }, { "docid": "70c96d77eed15b96285e10ab59d98b44", "score": "0.6316097", "text": "def login\n sign_in User.first\n end", "title": "" } ]
2990c791bb4cb6ca90e9c44102c5c22d
remove input notes. takes a single note or an array of notes
[ { "docid": "dace4c6b947fae04379c79871c92e9a3", "score": "0.7767767", "text": "def remove(notes, options = {})\n notes = [notes].flatten\n notes = sanitize_input_notes(notes, MIDIMessage::NoteOff, options)\n @sequence.remove(notes)\n end", "title": "" } ]
[ { "docid": "025471fe926049b7daabf4aef028ef87", "score": "0.7466605", "text": "def clean_notes\n for note in notes\n if note.comment.blank?\n note.destroy\n end\n end\n\n end", "title": "" }, { "docid": "d3fda5eb2571238bfd7344d26d64ba78", "score": "0.6655864", "text": "def strip_note!(data_array)\n data_array.pop\n end", "title": "" }, { "docid": "8f82a017cff9e63e4cc3e9f883f5eb59", "score": "0.63744587", "text": "def remove_notes(remove_list)\n \n remove_list.each do |upload_id|\n upload = Upload.find(upload_id)\n if ( @document.uploads.include?(upload) )\n @document.uploads.delete(upload)\n end\n end\n end", "title": "" }, { "docid": "e663304076ad9e867c763549d9ac87c5", "score": "0.6237155", "text": "def destroy_notes\n notes = Note.where('username = ? OR username IS ?', current_user.name, nil)\n notes.each do |note|\n if note.is_public == true\n note.update(username: nil)\n note.update(is_anon: true)\n else\n note.destroy\n end\n end\n end", "title": "" }, { "docid": "741f3463a1f9da713562cd0ebeae9415", "score": "0.6157676", "text": "def remove_note_list()\n remove_upload_ids = []\n @document.uploads.each do |upload|\n remove_upload_ids << upload\n end\n \n return remove_upload_ids\n end", "title": "" }, { "docid": "1cb064d37959c4deab812b03418e3ebf", "score": "0.6074062", "text": "def remove_note_list()\n remove_upload_ids = []\n @collection.uploads.each do |upload|\n remove_upload_ids << upload\n end\n \n return remove_upload_ids\n end", "title": "" }, { "docid": "f17bac16b309864aaf05e57eecc48833", "score": "0.59755325", "text": "def destroy\n @note.destroy\n end", "title": "" }, { "docid": "f17bac16b309864aaf05e57eecc48833", "score": "0.59755325", "text": "def destroy\n @note.destroy\n end", "title": "" }, { "docid": "334a0680a938c0c2a3e40ead7fed4394", "score": "0.59685284", "text": "def remove_notes_collection(remove_list)\n \n remove_list.each do |upload_id|\n upload = Upload.find(upload_id)\n if ( @collection.uploads.include?(upload) )\n @collection.uploads.delete(upload)\n end\n end\n end", "title": "" }, { "docid": "7ab7efc78c2a611a6867b291dbc276ca", "score": "0.59659433", "text": "def destroyNoteFromCollection\n @note=params[:id]\n\t @collection=params[:name]\n CollectionNote.where('id_note LIKE ? AND id_collection LIKE ? ', \"#{@note}\", \"#{@collection}\").destroy_all\n redirect_back(fallback_location: root_path)\n end", "title": "" }, { "docid": "b9bd4afb3558e5c28c63b02735683c48", "score": "0.59390223", "text": "def remove(input, string); end", "title": "" }, { "docid": "c6a2688cc699f94af26e277e668e00a2", "score": "0.5900416", "text": "def each_with_rescue(notes)\n delete_me = []\n\n notes.each do |note|\n begin\n yield note\n rescue Exception => e\n # Discard note if it has a problem\n log_error(\"Footnotes #{note.to_s.camelize}Note Exception\", e)\n delete_me << note\n next\n end\n end\n\n delete_me.each{ |note| notes.delete(note) }\n end", "title": "" }, { "docid": "869ace5c1daf8ac8258749b7969c638b", "score": "0.58838564", "text": "def my_array_deletion_method(source, thing_to_delete)\n\tsource.each do |word| if word.to_s.split(\"\").include? thing_to_delete\n\t\tsource.delete word\n\tend\nend\n\t source \nend", "title": "" }, { "docid": "af724cec45e51902ebb4bdc9fa02b639", "score": "0.5880611", "text": "def my_array_deletion_method(source, thing_to_delete)\n\t\tsource.delete_if { |i| i =~ /#{thing_to_delete}/}\n\t\tprint source\nend", "title": "" }, { "docid": "394f0429b118eb94f9465c74f0f1f974", "score": "0.58676374", "text": "def unlink_notes \n if self.notes\n self.notes.each do | note | \n note.objects[:Group].delete(self.id.to_s)\n note.save\n end\n end\n end", "title": "" }, { "docid": "c92588db9f570ec9ff04fac250468920", "score": "0.58460146", "text": "def my_array_deletion_method(source, thing_to_delete)\t\n\tsource.delete_if {|x| x.class.to_s == \"String\" && x.include?(thing_to_delete) == true}\n\t\nend", "title": "" }, { "docid": "63c7783d54356f2c288670a1ddd4a505", "score": "0.5840681", "text": "def destroy\n \t@user=User.find_by name: session[:user]\n \n\tif UserNote.where('id_note LIKE ?', \"#{@note.id}\").count == 1\n \tCollectionNote.where('id_note LIKE ?', \"#{@note.id}\" ).destroy_all\n \t@note.destroy\n\tend\n\n\tUserNote.where('id_note LIKE ? AND id_user LIKE ?', \"#{@note.id}\" , \"#{@user.id}\" ).destroy_all\n\tredirect_to :notes\n \n end", "title": "" }, { "docid": "950237b67eb0f860ebbdb3c5e3067a02", "score": "0.58395994", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.reject! {|user_string| user_string.to_s.index(thing_to_delete) != nil}\nend", "title": "" }, { "docid": "e92506cbb1023f64e55f84204a90bd3b", "score": "0.5837335", "text": "def delete_note id\n @nimble.delete \"contact/notes/#{id}\"\n end", "title": "" }, { "docid": "68fc18b758a12aebd401b1681a32bdfa", "score": "0.58340645", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.delete_if { |word| word.to_s.include? thing_to_delete }\nend", "title": "" }, { "docid": "d5c800f403afbb5eeefc4cff733d595d", "score": "0.581447", "text": "def remove_footnotes(elements); end", "title": "" }, { "docid": "7351867c875b20fcb85ef70953c1e791", "score": "0.58142495", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.reject! {|word| word.to_s.rindex(thing_to_delete) != nil}\n return source\nend", "title": "" }, { "docid": "3c071deb5362fbf3e9d1bccf260265ac", "score": "0.5813773", "text": "def note_contents=(notes)\n notes.each do |content|\n if content.strip != '' # => ignores blank notes\n self.notes.build(content: content) \n end\n end\n end", "title": "" }, { "docid": "278534deab3757db3c2c5c88169edc83", "score": "0.5810599", "text": "def remove_attachments_from_new_note(note, attachments)\n attachments.each do |attach|\n logger.info \"Removing attachment '#{attach.file_name}' from an unsaved note\"\n wait_for_update_and_click new_note_attachment_delete_button(attach)\n new_note_attachment_delete_button(attach).when_not_visible Utils.short_wait\n note.attachments.delete attach\n note.updated_date = Time.now\n end\n end", "title": "" }, { "docid": "dd8d49194b7065c1bbaad17752b43bcd", "score": "0.5800061", "text": "def my_array_deletion_method(source, thing_to_delete)\n\nsource = source.delete_if {|element| element.class == String && element.include?(thing_to_delete)\n}\nend", "title": "" }, { "docid": "a99c87662ccd0fca3e7ccaedaca3ea13", "score": "0.5797388", "text": "def noteboard_delete(line_number)\n \n\n end", "title": "" }, { "docid": "d10127a31ead9073d8f3758dda18c167", "score": "0.5797317", "text": "def remove_from_collection\n # CollectionNote.where('id_note LIKE ? AND id_collection LIKE ? ', \"#{@note.id}\", \"#{@collection.id}\").destroy_all\n# redirect_to :collections\n @note=params[:id]\n @collection=params[:name]\n CollectionNote.where('id_note LIKE ? AND id_collection LIKE ? ', \"#{@note}\", \"#{@collection}\").destroy_all\n redirect_to :collections\n\n end", "title": "" }, { "docid": "92785f2e8f4459ba51c0f0c8feed145e", "score": "0.57887363", "text": "def my_array_deletion_method(source, thing_to_delete)\n source.delete_if { |word| word.to_s.include?(thing_to_delete) }\nend", "title": "" }, { "docid": "7c7e840bc442308d2683ef82420d8481", "score": "0.57696944", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.reject! {|user_string| user_string.to_s.index(thing_to_delete) != nil}\n return source\nend", "title": "" }, { "docid": "a1255299e742a81b8bafbf613740c83d", "score": "0.5735458", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.delete_if {|item| item.is_a?(String) && item.include?(thing_to_delete)}\nend", "title": "" }, { "docid": "63e5c1b5918f048128b3b094dc23a190", "score": "0.5727846", "text": "def my_array_deletion_method!(source, thing_to_delete)\n\n var_to_delete = thing_to_delete\n\n source.map! {|str| str.to_s}\n p source.delete_if {|str| str.include?(var_to_delete)}\n\nend", "title": "" }, { "docid": "49876c31a04725b7e3bfcbb98cb3af7a", "score": "0.57253635", "text": "def my_array_deletion_method!(i_want_pets, letter)\n i_want_pets.delete_if { |item| item.to_s.include?(letter) }\nend", "title": "" }, { "docid": "079f1ba8895641c03e19f75cacc6e534", "score": "0.57016206", "text": "def remove(*names); end", "title": "" }, { "docid": "fde8dc12c23585b95be6537b4b09d99e", "score": "0.56773067", "text": "def my_array_deletion_method(source, thing_to_delete)\n p source.delete_if {|thing_to_modify| thing_to_modify.to_s.include? (thing_to_delete)}\nend", "title": "" }, { "docid": "c928324cdc44ccb28ef30bcf2a0f5ac1", "score": "0.5676402", "text": "def my_array_deletion_method(source, thing_to_delete)\n\tsource.delete_if {|i| i.to_s.include? thing_to_delete}\nend", "title": "" }, { "docid": "603ddbc710c3ee50c17b88d86e05b9e5", "score": "0.5675268", "text": "def my_array_deletion_method(source, thing_to_delete)\n source.each do |x|\n \tif x.to_s.split(\"\").include?(thing_to_delete) \n \t\tsource.delete(x)\n\tend\n end\nend", "title": "" }, { "docid": "24b38d403baf024cccfefdea1f465d7d", "score": "0.5655494", "text": "def my_array_deletion_method(source, thing_to_delete)\n source.reject!{ |x| x.to_s.include?(thing_to_delete) }\nend", "title": "" }, { "docid": "caf2c11e6bd898c9b2bcd078ea0e9b88", "score": "0.56538814", "text": "def notes_orphaned_parts(user)\n return [] if notes.blank?\n\n # Change spaces to underscores in order to subtract template parts from\n # stringified keys because keys have underscores instead of spaces\n template_parts_underscored = user.notes_template_parts.each do |part|\n part.tr!(\" \", \"_\")\n end\n notes.keys.map(&:to_s) - template_parts_underscored - [other_notes_part]\n end", "title": "" }, { "docid": "8e48f18d3ddb20786e47d6e3f53d52cc", "score": "0.5650607", "text": "def inferred_notes\n if scrubbed_notes?\n Rails.logger.debug \"not replacing scrubbed notes\"\n head_notes\n notes\n elsif head_notes.present?\n head_notes\n elsif notes.present? && ff?\n Rails.logger.debug \"not deleting old ff notes\"\n head_notes\n notes\n else\n head_notes\n end\n end", "title": "" }, { "docid": "89158b0085f98e960909757c56c3ddb1", "score": "0.5642355", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.reject! {|s| s.to_s.include?(thing_to_delete.to_s) }\nend", "title": "" }, { "docid": "711fb49362ac8c1de4da564fade50385", "score": "0.5642221", "text": "def my_array_deletion_method!(source, thing_to_delete)\r\n words_to_delete = source.find_all { |f| f.to_s.include?(thing_to_delete)}\r\n words_to_delete.each do |word|\r\n source.delete(word)\r\n end\r\n p source\r\nend", "title": "" }, { "docid": "986977e4ca0c200de8737886a093b1c2", "score": "0.56385267", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.each {|word| remove_word = word.to_s\n if remove_word.include?(thing_to_delete) == true\n source.delete(string)\n p source\n end\n }\nend", "title": "" }, { "docid": "7624a958dcd97bd31e06c3cb4ecf3147", "score": "0.56277776", "text": "def note_contents=(notes)\n notes.each do |content|\n if content.strip != ''\n self.notes.build(content: content)\n end\n end\n end", "title": "" }, { "docid": "cc0d7c33d9bd65ccd1f1a0e6f460762a", "score": "0.56172603", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.each {|x| \n source.delete(x) if (x.is_a?(String) && x.index(thing_to_delete) != nil)\n }\n p source\nend", "title": "" }, { "docid": "3168e751dcd629e57f773979556a0647", "score": "0.5616022", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.each do |substring|\n if substring.class == thing_to_delete.class && substring.include?(thing_to_delete) == true\n source.delete(substring)\n end\n end\n return source\n end", "title": "" }, { "docid": "f878325e08355e941bd965e29a0f7597", "score": "0.5613969", "text": "def delete(note)\n args = {id: note.id}\n return @client.api_helper.command(args, \"note_delete\")\n end", "title": "" }, { "docid": "6747291c67a9582809a24236670c8699", "score": "0.5605746", "text": "def destroy\n\n if @note.about_person\n @aboutPerson = @note.about_person\n @aboutPerson.destroy\n end\n\n if @note.about_event\n @about_event = @note.about_event\n @about_event.destroy\n end\n\n\n @rn = RemovedNote.new(:sequence_number => @note.id, :person_id => @note.person_id)\n @rn.save\n\n @note.destroy\n\n respond_to do |format|\n format.html { redirect_to notes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "451292d1b0fbccd5e5a3c3d9c3a95649", "score": "0.5603664", "text": "def my_array_deletion_method(source, thing_to_delete)\n\tsource.delete_if {|element| element.to_s.include?(thing_to_delete)}\nend", "title": "" }, { "docid": "bb7146e7fa01f674fa44e82cabf146ce", "score": "0.56035733", "text": "def remove_from_notifications\n notifications.find_all { |n| n.noti_read == 'N' }.each do |n|\n remove_from_notification(n)\n end # each n\n end", "title": "" }, { "docid": "5aa452632182c1c4e790f220f0ecdcf1", "score": "0.56007767", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.delete_if { |x| x.to_s.include?(thing_to_delete)}\nend", "title": "" }, { "docid": "7b77507aa296703d188e5b123f08f1a0", "score": "0.5592728", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.delete_if{|x| x.to_s.include?(thing_to_delete)}\nend", "title": "" }, { "docid": "db9a4ff56d123ff03f11252c045cf34f", "score": "0.5592306", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.delete_if {|x| x.to_s.include? thing_to_delete}\nend", "title": "" }, { "docid": "7315d7e9a8d681ae0ed5feb0489f188b", "score": "0.5585094", "text": "def remove_attachments_from_existing_note(note, attachments)\n attachments.each do |attach|\n logger.info \"Removing attachment '#{attach.file_name}' from note ID #{note.id}\"\n wait_for_update_and_click existing_note_attachment_delete_button(note, attach)\n confirm_delete\n existing_note_attachment_delete_button(note, attach).when_not_visible Utils.short_wait\n note.attachments.delete attach\n attach.deleted_at = Time.now\n note.updated_date = Time.now\n end\n end", "title": "" }, { "docid": "59105e99365274e553698f62c8d0679d", "score": "0.5577579", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.delete_if do |item| \n item.to_s.include? thing_to_delete\n end\n source\nend", "title": "" }, { "docid": "f34d42e78bd36152ad24125ddf33cd99", "score": "0.55758506", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.delete_if {|x| x.to_s.include?(thing_to_delete)}\nend", "title": "" }, { "docid": "f34d42e78bd36152ad24125ddf33cd99", "score": "0.55758506", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.delete_if {|x| x.to_s.include?(thing_to_delete)}\nend", "title": "" }, { "docid": "c460301620949650effc5e2979dd3818", "score": "0.5567906", "text": "def note_cleanup(xmldoc)\n q = \"//note[following-sibling::*[not(local-name() = 'note')]]\"\n xmldoc.xpath(q).each do |n|\n next if n[\"keep-separate\"] == \"true\"\n next unless n.ancestors(\"table\").empty?\n\n prev = n.previous_element || next\n n.parent = prev if ELEMS_ALLOW_NOTES.include? prev.name\n end\n xmldoc.xpath(\"//note[@keep-separate] | \"\\\n \"//termnote[@keep-separate]\").each do |n|\n n.delete(\"keep-separate\")\n end\n end", "title": "" }, { "docid": "43bd6be00925ca0bd3785f7f6e3b0748", "score": "0.55539525", "text": "def my_array_deletion_method(source, thing_to_delete)\n source.delete_if{|item| item.to_s.include?(thing_to_delete.to_s)}\nend", "title": "" }, { "docid": "59098af14036da0f7aa0487e1adbd7f9", "score": "0.5553155", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.delete_if {|item| item.to_s.include?(thing_to_delete)}\nend", "title": "" }, { "docid": "59098af14036da0f7aa0487e1adbd7f9", "score": "0.5553155", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.delete_if {|item| item.to_s.include?(thing_to_delete)}\nend", "title": "" }, { "docid": "0254e4dc88998879aacf053497f113bb", "score": "0.55388534", "text": "def my_array_deletion_method(source, thing_to_delete)\n source.delete_if{|x| x.to_s.include?(thing_to_delete)}\n return source\nend", "title": "" }, { "docid": "0254e4dc88998879aacf053497f113bb", "score": "0.55388534", "text": "def my_array_deletion_method(source, thing_to_delete)\n source.delete_if{|x| x.to_s.include?(thing_to_delete)}\n return source\nend", "title": "" }, { "docid": "1fb89139dd67b6696915077613e88db9", "score": "0.5521767", "text": "def remove_idea_events(events)\n events.delete_if(&:idea?)\nend", "title": "" }, { "docid": "245cf3565029848ac53ff64decbdeaa9", "score": "0.55176103", "text": "def my_array_deletion_method(source, thing_to_delete)\n source.delete_if {|element| element.to_s.include? (thing_to_delete)} \nend", "title": "" }, { "docid": "b00579853456fea4dc5dcc186923afac", "score": "0.5509292", "text": "def my_array_deletion_method!(source, thing_to_delete)\n remove_letter = source.find_all { |letter| letter.to_s.include?(thing_to_delete)}\n\n remove_letter.each { |word| source.delete(word)}\n\n p source\nend", "title": "" }, { "docid": "1363ebfec8ebeca37a6eef07c98763bd", "score": "0.550232", "text": "def my_array_deletion_method(source, thing_to_delete)\n source.delete_if {|x| x.to_s.include?(thing_to_delete) == true}\nend", "title": "" }, { "docid": "329c570ea4ec27545f0a6e4085967d8f", "score": "0.5473696", "text": "def process_notes_array(array_of_id)\n notes = []\n array_of_id.each do |d|\n notes << Note.find(d[0].to_i)\n end\n notes\n end", "title": "" }, { "docid": "4699b0192eeeb55984d2bdfac42a324c", "score": "0.5469079", "text": "def my_array_deletion_method(source, thing_to_delete)\n \tsource.each do |x|\n \t\t#puts x\n \t\tif x.to_s.include? \"#{thing_to_delete}\"\n \t\t\tsource.delete(x)\n \t\tend\n \tend\nend", "title": "" }, { "docid": "0562667667b32585e72b287b065a243c", "score": "0.54683495", "text": "def unstar_note(id)\n n = ActiveMetadata::Note.find(id)\n update_note id, n.note, starred: false\n end", "title": "" }, { "docid": "859e53d4399cf3a53c6bc8d56c84870b", "score": "0.54588103", "text": "def update_notes(teacher_set_notes_string)\n TeacherSetNote.where(teacher_set_id: self.id).destroy_all\n return if teacher_set_notes_string.blank?\n\n teacher_set_notes_string.split(',').each do |note_content|\n TeacherSetNote.create(teacher_set_id: self.id, content: note_content)\n end\n rescue StandardError => e\n raise TeacherSetNoteException.new(TEACHER_SET_NOTE_EXCEPTION[:code], TEACHER_SET_NOTE_EXCEPTION[:msg])\n end", "title": "" }, { "docid": "c98c1fdf09f95d2dc2ff118a2b4f6b52", "score": "0.545828", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.select! {|el| el.to_s.include?(thing_to_delete) == false}\nend", "title": "" }, { "docid": "0e65e1179317ab02d1356d832e08e034", "score": "0.5445528", "text": "def write_notes_without_serializing(obs:, notes:)\n Observation.connection.execute(\"\n UPDATE observations\n SET notes = #{Observation.connection.quote(notes)}\n WHERE id = #{obs.id}\n \")\n end", "title": "" }, { "docid": "0e65e1179317ab02d1356d832e08e034", "score": "0.5445528", "text": "def write_notes_without_serializing(obs:, notes:)\n Observation.connection.execute(\"\n UPDATE observations\n SET notes = #{Observation.connection.quote(notes)}\n WHERE id = #{obs.id}\n \")\n end", "title": "" }, { "docid": "29a43073cffa29e047111f29f1c29bd4", "score": "0.54450226", "text": "def note_contents=(notes)\n \tnotes.each do |content|\n \t\tself.notes << Note.find_or_create_by(content: content) unless content == \"\"\n \tend\n end", "title": "" }, { "docid": "6596aa233a7a2294ff78ca0f9c273135", "score": "0.54382914", "text": "def remove(input_list, item)\n input_list.delete(item)\nend", "title": "" }, { "docid": "3624f1ff4fde4aa47ae2fc944c8655a5", "score": "0.54376054", "text": "def remove_midi_source(source)\n @midi.inputs.delete(source)\n end", "title": "" }, { "docid": "6a324384012bd2d3e0baa712fdaeaa06", "score": "0.5424888", "text": "def remove_discard_supernatant(items)\n show do\n title 'Remove Supernatant'\n note 'Remove and discard supernatant from:'\n items.each do |item|\n bullet item.to_s\n end\n end\n end", "title": "" }, { "docid": "5c216bba2eca287ea528899b383ef198", "score": "0.53932124", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.delete_if { |a| a.include?(thing_to_delete) }\nend", "title": "" }, { "docid": "12f71a2fcaf8a03699a64ba7eb73c053", "score": "0.53796685", "text": "def remove_vowels(array_of_words)\n array_of_words.map do |word|\n word.delete(\"aeiouAEIOU\")\n end\nend", "title": "" }, { "docid": "5bfc922e57fed5b68845f302d21322bd", "score": "0.5374458", "text": "def remove( *ruleses )\n self.dup.remove!( *ruleses )\n end", "title": "" }, { "docid": "97209d0f35ff5c74838f5fe1c8d01fc0", "score": "0.53673244", "text": "def emails_remove_n(array)\n array.map do |n|\n n.delete(\"/\\n/\")\n end\nend", "title": "" }, { "docid": "99e530cf0528699962089cf862d4abfe", "score": "0.53436357", "text": "def list_remover(list_input_remover, item_name_remove)\n list_input_remover.delete(item_name_remove)\nend", "title": "" }, { "docid": "5589464cd049a212dc0cebd33b6c1290", "score": "0.5322938", "text": "def solo5(arr)\n\tarr.delete_if {|sup| sup.include?(\" \")} \n\t#p zombie_apocalypse_supplies\nend", "title": "" }, { "docid": "3c015c9569c5462734e7ec6527570ddf", "score": "0.5317853", "text": "def note(id)\n @contacts.each do |contact|\n if contact.id == id\n contact.notes.clear\n contact.notes << @note.input\n contact.notes.flatten!\n end\n end\n end", "title": "" }, { "docid": "7f1335b109d22c307220d75ce5d5d710", "score": "0.53160936", "text": "def remove_item(complete_list, removed_item )\n #complete_list.delete(remove_item)\n complete_list.delete_if {|k| k == removed_item }\n# if remove_answer == \"yes\"\n# while remove_answer == \"yes\"\n# puts \"what would you like to remove?\"\n# remove_item = gets.chomp\n# p complete_list[remove_item] #complete_list.delete(remove_item)\n# puts \"do you want to remove anything else? yes or no?\"\n# remove_answer = gets.chomp\n# end\n# else\n p complete_list\n end", "title": "" }, { "docid": "edc5dfe0200a4b12d4455f2c9111e7a7", "score": "0.53135985", "text": "def note_contents=(notes)\n notes.each do |note|\n if note != \"\"\n self.notes << Note.find_or_create_by(content: note)\n end\n end\n\n end", "title": "" }, { "docid": "80cadd6eebe22aec44dc14f67fe0c17b", "score": "0.53127944", "text": "def clear_remarks\n remarks.each(&:destroy)\n end", "title": "" }, { "docid": "85167153f06eecb1876028f90e5922a9", "score": "0.5304016", "text": "def drop_lines(array)\n\t\tarray.each do |el|\n\t\t\tdbrows = @database.query <<-SQL\n\t\t\t\tDELETE FROM invoice_lines WHERE invoice_id = '#{el}';\n\t\t\tSQL\n\t\tend\n\tend", "title": "" }, { "docid": "bc42b8967b340680a76bdf0c69d8bbca", "score": "0.5297496", "text": "def my_array_deletion_method!(source, thing_to_delete)\n \n duplicate = source.dup\n\n i = 0\n while i < duplicate.length\n word = duplicate[i]\n if word.is_a?(Fixnum)\n i += 1\n next\n end\n if word.include?(thing_to_delete)\n source.delete(word)\n end\n i += 1\n end \n source\nend", "title": "" }, { "docid": "ce4b2a35def34ef5b2175a65c0a3e64c", "score": "0.5296306", "text": "def my_array_deletion_method!(source, thing_to_delete)\n source.each do |thing|\n if thing.to_s.downcase.include?(thing_to_delete)\n source.delete(thing)\n end\n end\n source\nend", "title": "" }, { "docid": "d3c1c6aaccee48a667c1f7320bc30d95", "score": "0.52900106", "text": "def remove_vowels(array)\n array.map {|word| word.delete(\"aeiou\")}\nend", "title": "" }, { "docid": "ce27609f6bc7a545db87bf36ce0903a4", "score": "0.52850914", "text": "def delete_tags(post_num_input, tags_input)\n tags_to_delete = tags_input.split(\" \")\n tags_to_delete.each do |y|\n BLOG[post_num_input].tags.delete_if {|x| x == y}\n end\n puts ''\n puts 'Your tags have been deleted'\n puts BLOG[post_num_input].tags\n puts ''\n end", "title": "" }, { "docid": "cfa3440d5671814c2e16c1223c3b8a68", "score": "0.5277217", "text": "def my_array_deletion_method(source, thing_to_delete)\n\t\nend", "title": "" }, { "docid": "4c44dc2533e3ec57e780f8a8beafad81", "score": "0.5275837", "text": "def destroy\n @note = @user.notes.find(params[:id])\n @note.destroy\n\n respond_to do |format|\n format.html { redirect_to(notes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8f7ddc48fafeeb8f120a378180174c6e", "score": "0.5273752", "text": "def my_array_deletion_method!(array, a)\n array.delete_if { |value| value.to_s.include?(a) }\nend", "title": "" }, { "docid": "8739cf9c7ce88c07df8d7332317ac40a", "score": "0.52611965", "text": "def note(*note_names)\n midi_values = note_names.map { |name| Midishark::Notes.note(name) }\n @notes << midi_values\n\n midi_values\n end", "title": "" }, { "docid": "4701abbd1fe4a01caa2213371cb41c25", "score": "0.5251233", "text": "def my_array_deletion_method!(source, thing_to_delete)\n\n indexChange = 0\n for x in 0..(source.length - 1)\n sourceString = source[x - indexChange].to_s\n\n if sourceString.include? thing_to_delete\n source[x - indexChange,source.length] = source[x + 1 - indexChange, source.length]\n indexChange = indexChange + 1\n end\n end\n # p source\n return source\nend", "title": "" }, { "docid": "3db48635b4d320edf61f28cc8df86155", "score": "0.52372336", "text": "def my_array_deletion_method!(source, thing_to_delete)\nend", "title": "" }, { "docid": "8af828f6045e9e1fb4f8f60e4164bd8d", "score": "0.523514", "text": "def remove_topics(note, topics)\n logger.info \"Removing topics #{topics.map &:name} from note ID '#{note.id}'\"\n topics.each do |topic|\n logger.debug \"Removing topic '#{topic.name}'\"\n wait_for_update_and_click topic_remove_button(note, topic)\n topic_pill(note, topic).when_not_visible Utils.short_wait\n note.topics.delete topic\n end\n end", "title": "" }, { "docid": "fa10c58346f20858dfa699cec480b33f", "score": "0.52232593", "text": "def my_array_deletion_method(source, thing_to_delete)\n #Your code here!\nend", "title": "" } ]
d3ea9df7ff673ad26e7db76991cb6f23
Returns an array of manufacturer choices to be used with the select view helper
[ { "docid": "f1cbe23bd9e7a3e6a1d80d188c1f05f9", "score": "0.80581945", "text": "def manufacturer_choices\n @list_of_manufacturers ||= Array.new\n\n @manufacturers = Manufacturer.all\n\n @manufacturers.each do |p|\n\n @list_of_manufacturers.push([p.name, p._id])\n end\n\n @list_of_manufacturers\n end", "title": "" } ]
[ { "docid": "40c16aa533acafe5470f18bf69789ecc", "score": "0.6475", "text": "def genders_select\n return [['Male', 'm'], ['Female', 'f'], ['Unspecified', 'u']]\n end", "title": "" }, { "docid": "a0bada22e44a72d8854bca85ccff23e9", "score": "0.6320299", "text": "def choices()\n model.choices\n end", "title": "" }, { "docid": "165c14d62e9c4295ff9d4996f54dd446", "score": "0.61852777", "text": "def select_from_model_resource_name_options\n res = Resources::Models.all.values\n .reject { |r| r.option_type }\n .map { |r| [\"#{r[:type]} - #{r[:model].human_name}\", r[:resource_name]] }\n .uniq\n options_for_select res\n end", "title": "" }, { "docid": "76556bd2b8109cea7fcbfeaa41b3a52f", "score": "0.61788636", "text": "def choices\n raise NotImplementedError\n end", "title": "" }, { "docid": "d46940572b403669758b830976c7be6a", "score": "0.61067", "text": "def option_sets_for_select\n option_sets.collect{|x| [x.name, x.id]}\n end", "title": "" }, { "docid": "cbd6a239ba072047a9b476ca1c6c23e2", "score": "0.607711", "text": "def options_for_select\n [[nil,nil]]+choices.map{|x|[x.underscore.humanize,x] unless x.nil? }.compact\n end", "title": "" }, { "docid": "ff66529cbe9b90d522c216abf2b3a51d", "score": "0.60275424", "text": "def extractChoices\n end", "title": "" }, { "docid": "42416ed672eed101cce740bf69eb9b98", "score": "0.60218513", "text": "def option_for_product\n Product.select(:id, :name).map{|i| [i.name, i.id]}\n end", "title": "" }, { "docid": "3e0773cc5e6a26d092b10905bc9b99c6", "score": "0.601417", "text": "def getGenres()\n\t\t@library.each do |book|\n\t\t\tif !@genre_choices.include?(book.genre) \n\t\t\t\t@genre_choices.push(book.genre)\n\t\t\tend\n\t\tend\n\t\treturn @genre_choices\n\tend", "title": "" }, { "docid": "8d22b3fd381232d33531ae75f84d00fe", "score": "0.5982901", "text": "def manufacturers\n assets = TransamAsset.where(organization_id: @organization_list)\n manufacturers = assets.joins(:manufacturer)\n .where.not(manufacturer_id: nil)\n .where.not(manufacturers: {name: 'Other'})\n .pluck(\"manufacturers.id, manufacturers.name\").uniq.map{|d| {id: d[0], name: d[1]}}\n\n idx = 0 # indicate other_manufacturers\n other_manufacturers = assets.where.not(other_manufacturer: [nil, \"\"]).pluck(:other_manufacturer).uniq.map{|name| \n idx -= 1\n {id: idx, name: name}\n }\n \n render json: (manufacturers + other_manufacturers).sort_by{|d| d[:name]}\n end", "title": "" }, { "docid": "9bb3c08b016408e92739d80aa214a434", "score": "0.591417", "text": "def manufacturer_models\n assets = TransamAsset.where(organization_id: @organization_list)\n manufacturer_models = assets.joins(:manufacturer_model)\n .where.not(manufacturer_model_id: nil)\n .where.not(manufacturer_models: {name: 'Other'})\n .pluck(\"manufacturer_models.id, manufacturer_models.name\").uniq.map{|d| {id: d[0], name: d[1]}}\n\n idx = 0 # indicate other_manufacturers\n other_manufacturer_models = assets.where.not(other_manufacturer_model: [nil, \"\"]).pluck(:other_manufacturer_model).uniq.map{|name| \n idx -= 1\n {id: idx, name: name}\n }\n \n render json: (manufacturer_models + other_manufacturer_models).sort_by{|d| d[:name]}\n end", "title": "" }, { "docid": "1d2894b9c2d76d51dc5a333658d0055c", "score": "0.58702457", "text": "def search_manufacturer(manufacturer)\n manufacturers = []\n params = {q: \"name=#{CGI.escape(manufacturerQuery.to_s)}\"}\n path = \"/manufacturers\"\n method = 'GET'\n manufacturer_list = call_with_cache(method,params, path)\n manufacturer_list.each do |m|\n manufacturers << Hashie::Mash.new(m)\n end\n manufacturers\n end", "title": "" }, { "docid": "f5b19dab3805278331b811b728cb6023", "score": "0.5827415", "text": "def manufacturer\n @manufacturer\n end", "title": "" }, { "docid": "94ec1642e0e4646c41004ec5c8d3f3da", "score": "0.5788044", "text": "def product_options_for_select\n self.products.split(/\\,\\s*/)\n end", "title": "" }, { "docid": "68219b02104455d69477ef5a4618313a", "score": "0.57825005", "text": "def choices\n @choices ||= contenders.shuffle\n end", "title": "" }, { "docid": "938844f79bfb557602cc7c2fdf81e838", "score": "0.5700189", "text": "def available_choices_for(component); @available_choices[component] + [:none]; end", "title": "" }, { "docid": "3d90bf142693d0f64b128b3bb8e54174", "score": "0.5700162", "text": "def search_for\n choices = %w(Dell Samsung HP) \n prompt = TTY::Prompt.new\n item_brand=prompt.multi_select(\"What are you looking for?\",choices)\n computerlist=[]\n item_brand.each do |m|\n computerlist.push(Item.search_by_name(m)) \n end\n $choices=[]\n computerlist.each do |m|\n m.each do |n|\n $choices.push(n.name)\n end\n end\n computerlist\n select_or_not?\n end", "title": "" }, { "docid": "cbfd68bdf6ff34becc0d29494f661994", "score": "0.56913155", "text": "def available_choices_for(component)\n @available_choices[component] + [:none]\n end", "title": "" }, { "docid": "b5227fe6a19acedf34eba69a14952b38", "score": "0.5679412", "text": "def available_choices_for(component)\r\n @available_choices[component] + [:none]\r\n end", "title": "" }, { "docid": "4d51859924c1d25f5cabde7b06605889", "score": "0.56778413", "text": "def auto_manufacturers\n @manu = AutoManufacturer.find(:all, :order => :name)\n \n respond_to do |format|\n format.json { render json: @manu }\n end\n end", "title": "" }, { "docid": "f3d947cd880dda3eac952f875b4cdc08", "score": "0.567662", "text": "def select_list\n codes.map { |code| [human_name(code), code] }\n end", "title": "" }, { "docid": "68c23822a32e3878171b3f48e6803123", "score": "0.56506824", "text": "def fetch(brand_id)\n @models = []\n @brand_id = brand_id\n\n # Mobile.de uses some non-printable character (hexa: A0 C2) instead of spaces.\n document.css('option').each do |option|\n model_id = option.attributes['value'].content\n model_name = option.text.gsub(/[^[:graph:]]/, ' ')\n\n next if model_name.in?(IGNORE_LIST)\n @models << model_name\n end\n\n @models\n end", "title": "" }, { "docid": "b6d1ee2fac2ef4b336a1c5fd341c18ea", "score": "0.5632658", "text": "def dynamic_manufacturer\n begin\n \n manufacturers=RestClient.get $api_service+'/suppliers/supplier_manufacturer?supplier_id='+params[\"format\"]\n @manufacturer_dropdown=JSON.parse manufacturers\n\n unless @manufacturer_dropdown.present?\n Rails.logger.debug_log.debug { \"#{\"contact may be not available otherwise check backend\"}\"}\n end\n \n rescue => e\n Rails.logger.custom_log.error { \"#{e} ContactsController dynamic_manufacturer method\" }\n end\n \n \n end", "title": "" }, { "docid": "123304176c91f05f1c9fc10f4c4a3937", "score": "0.562465", "text": "def get_available_option_list_types\n [\n {'name' => 'REST', 'value' => 'rest'}, \n {'name' => 'Morpheus Api', 'value' => 'api'}, \n {'name' => 'LDAP', 'value' => 'ldap'}, \n {'name' => 'Manual', 'value' => 'manual'}\n ]\n end", "title": "" }, { "docid": "5495e457c1382431c8a49bd8e147ae30", "score": "0.5592944", "text": "def computer_group_options\n options_for_select(ComputerGroup.unit(current_unit).collect { |cg| [cg.name, cg.id] })\n end", "title": "" }, { "docid": "398f7b2d0ec26a36bd383d5c8ab02234", "score": "0.55908906", "text": "def computer_group_options\n options_for_select(ComputerGroup.unit(current_unit).collect {|cg| [cg.name, cg.id] })\n end", "title": "" }, { "docid": "cc77e30f8c7139c104054df18017f073", "score": "0.55592275", "text": "def ua_list\n prompt = TTY::Prompt.new\n sleep(1)\n products = Brand.choose_brand_items(\"Under Armour\")\n products_list(prompt.select(\"Here are the available choices for this brand.\", products))\nend", "title": "" }, { "docid": "88a59399543d802f6c0e09bda00536d7", "score": "0.55556536", "text": "def manufacturer\n whitelist_api['manufacturer']\n end", "title": "" }, { "docid": "fc89d6dbe869deaddd116d60d41a14da", "score": "0.5541544", "text": "def selected_options\n if inventory_field_option_ids.blank?\n []\n else\n inventory_field_option_ids.map do |field_option_id|\n Inventory::FieldOption.find_by(id: field_option_id)\n end.compact\n end\n end", "title": "" }, { "docid": "8b8f9f4705884040b3c73409c1cff567", "score": "0.5527779", "text": "def gender_options_for_select(selected = nil)\n return select_option(GENDER_OPTIONS_FOR_SELECT, selected)\n end", "title": "" }, { "docid": "1cc903200e585c8e9c73dbe8d4df85ad", "score": "0.5513537", "text": "def roles_for_select\n available_roles.map do |r|\n [human_role_name(r), r]\n end\n end", "title": "" }, { "docid": "d1892b5b8dd98b187feb2b08dcd00990", "score": "0.551042", "text": "def all_choices\n @choices.values.flat_map(&:to_a)\n end", "title": "" }, { "docid": "f1fc56ed825ac6d7769f196659967665", "score": "0.55056226", "text": "def prefill_select_menus\n @categories = Category.all\n @manufacturers = Manufacturer.all\n @conditions = Condition.all\n @colors = Color.all\n @materials = Material.all\n @fingerboards = Fingerboard.all\n @bridges = Bridge.all\n @countries = Country.all\n @cases = Case.all\n @deliveries = Delivery.all\n end", "title": "" }, { "docid": "e795b7e272541dc878c9d5afd5b2a697", "score": "0.5502261", "text": "def index\n @manufacturers = Manufacturer.all\n end", "title": "" }, { "docid": "4957532461a118f7003d9ac5c8d7b8ea", "score": "0.55015725", "text": "def manufacturer\n os = inspec.os\n if os.darwin?\n \"Apple Inc.\"\n elsif os.linux?\n inspec.command(\"cat /sys/class/dmi/id/sys_vendor\").stdout.chomp\n elsif os.windows?\n inspec.powershell(\"Get-CimInstance -ClassName Win32_ComputerSystem | Select Manufacturer -ExpandProperty Manufacturer\").stdout.chomp\n else\n skip_resource \"The `sys_info.manufacturer` resource is not supported on your OS yet.\"\n end\n end", "title": "" }, { "docid": "1c215d07707b8ea93155ed252ef2ca25", "score": "0.5495413", "text": "def manufacturer_name; manufacname; end", "title": "" }, { "docid": "aa9ba61505d79660313fff51866357e8", "score": "0.54946864", "text": "def choices\n @property[:choices]\n end", "title": "" }, { "docid": "ca17ff62d8b4b5c579f26c92625dcce9", "score": "0.54742193", "text": "def options\n @registry.select do |opt|\n opt.kind_of?(Option)\n end\n end", "title": "" }, { "docid": "94ab510bf5344639da4d181b7d0aa196", "score": "0.5467024", "text": "def brands\n self.package_skus.map(&:product).map(&:brand)\n end", "title": "" }, { "docid": "91635d9bb345e574c3881cbbb65f520b", "score": "0.5464127", "text": "def manufacturer\n return @manufacturer\n end", "title": "" }, { "docid": "91635d9bb345e574c3881cbbb65f520b", "score": "0.5464024", "text": "def manufacturer\n return @manufacturer\n end", "title": "" }, { "docid": "91635d9bb345e574c3881cbbb65f520b", "score": "0.5464024", "text": "def manufacturer\n return @manufacturer\n end", "title": "" }, { "docid": "91635d9bb345e574c3881cbbb65f520b", "score": "0.5464024", "text": "def manufacturer\n return @manufacturer\n end", "title": "" }, { "docid": "91635d9bb345e574c3881cbbb65f520b", "score": "0.5464024", "text": "def manufacturer\n return @manufacturer\n end", "title": "" }, { "docid": "91635d9bb345e574c3881cbbb65f520b", "score": "0.5464024", "text": "def manufacturer\n return @manufacturer\n end", "title": "" }, { "docid": "bc9eaeee324923868ab48cfbcacb2143", "score": "0.5446981", "text": "def selected_options; end", "title": "" }, { "docid": "02c022e8f3ec59de2d3752792930f273", "score": "0.5445284", "text": "def get_choices\n \t#TODO randomize order of choices if is_scrambled is true\n \n end", "title": "" }, { "docid": "71ec6d31aa50f023eed780451fbaf512", "score": "0.5441521", "text": "def choices\n @choices ||= {}\n end", "title": "" }, { "docid": "ac66492389eec8dd722710c99bd43363", "score": "0.54344463", "text": "def get_specializations\n\t\t\tcountry = get_country\n\t\t\tif country == 'int'\n\t\t\t\t@menu_specializations = ['surgery','orthodontics','prosthetics', 'endodontics']\n\t\t\telse\n\t\t\t\t@menu_specializations = [\"#{country}.surgery\",\"#{country}.orthodontics\",\"#{country}.prosthetics\", \"#{country}.endodontics\"]\n\t\t\tend\n\t\t\t@menu_specializations = UserGroup.where(\"ident IN (?)\", @menu_specializations)\n\t\tend", "title": "" }, { "docid": "8b2e5f05c7a23e49511e84be2771d165", "score": "0.5413727", "text": "def passenger_choices\n passenger_choices_array = [[\"NONE\", \"NONE\"]]\n ##result = pass_get_passenger_types\n passenger_types_array.each do |purpose|\n passenger_choices_array.append([purpose.try(:[], :description), purpose.try(:[], :abbreviation)])\n end\n passenger_choices_array\n end", "title": "" }, { "docid": "050380125947d85d3f3a59e53ffd5375", "score": "0.5394361", "text": "def manufacturer\n get_prop('ro.product.manufacturer')\n end", "title": "" }, { "docid": "c2d0487d302c9db1ce98a29109a0e7a5", "score": "0.53890145", "text": "def get_choices(*)\n {}\n end", "title": "" }, { "docid": "d034c676b49cf3d553182f9723db2bdd", "score": "0.538337", "text": "def specifications\n rv = [] \n specification_hash.each do |opt, text| \n rv << \"#{opt.name} = #{text}\" \n end \n rv.join(' - ') \n end", "title": "" }, { "docid": "6e49c2395e776063d6146a6abec303f5", "score": "0.53770316", "text": "def forms\n option_sets.collect{|os| os.questionings.collect(&:form)}.flatten.uniq\n end", "title": "" }, { "docid": "6e49c2395e776063d6146a6abec303f5", "score": "0.53770316", "text": "def forms\n option_sets.collect{|os| os.questionings.collect(&:form)}.flatten.uniq\n end", "title": "" }, { "docid": "4ea4f69ff2dc49d9b236a55a1e83ce4c", "score": "0.5369154", "text": "def manufacturer_model\n get_prop('ro.product.model')\n end", "title": "" }, { "docid": "2b798f6b8f1f4bd8b789162c678a8d1a", "score": "0.5358507", "text": "def get_select_options(selectLocator)\n return get_string_array(\"getSelectOptions\", [selectLocator,])\n end", "title": "" }, { "docid": "00d87fed227a278d47dd72d1478af2f0", "score": "0.53579324", "text": "def apphelp_select( form, objfield, choices, multiple = true )\n return form.select(\n objfield,\n choices,\n {},\n apphelp_extra_selection_args( choices, multiple )\n )\n end", "title": "" }, { "docid": "d2e8d2154a38f7ed2d743922b0e0ae90", "score": "0.53560585", "text": "def select_options\n self.vehicle_check.select_options\n end", "title": "" }, { "docid": "45bd6aa192e8b70c1b21afd7ca374a3a", "score": "0.534099", "text": "def get_select_data\n\t\tgrms = Grammar.find(:all, :order=>'grm ASC')\n\t\tgrms = grms.map {|g| [g.grm,g.grm]}\n\t\tcats = Category.find(:all, :order=>'cat ASC')\n\t\tcats = cats.map {|c| [c.cat,c.cat]}\n\t\treturn [grms, cats]\n\tend", "title": "" }, { "docid": "01f85c461fff933d39454b7e8d92f46c", "score": "0.5338538", "text": "def carrier_select(name = :mobile_carrier, phrase = \"Select a Carrier\")\n select_tag name, options_for_select([phrase,nil]+carrier_collection, phrase)\n end", "title": "" }, { "docid": "63fed744225a5d3d1a1b91ed45b46597", "score": "0.53363717", "text": "def build_dropdown_lists\n @type = ['Broard line', 'Food', 'Meat', 'Custom cut']\n @uom = ['LB', 'Each', 'Case']\n @source = ['Vendor', 'Invoice', 'Verbal']\n @delivery = ['Driver', 'Overnight']\n @grade = ['Prime', 'Choice plus', 'Choice', 'Select', 'Grade A', 'Grade B']\n end", "title": "" }, { "docid": "5252e616ca1d39d61af3006bbc7cab2b", "score": "0.5324333", "text": "def pbChooseSpeciesList(default=0)\n commands = []\n for i in 1..PBSpecies.maxValue\n cname = getConstantName(PBSpecies,i) rescue nil\n commands.push([i,PBSpecies.getName(i)]) if cname\n end\n return pbChooseList(commands,default,-1)\nend", "title": "" }, { "docid": "b0df82a4e9ff5ec61dd70757bf2aa9a3", "score": "0.531593", "text": "def country_choices\n Country.to_select\n end", "title": "" }, { "docid": "f3c63bad7269c3d427ad0465a759caa6", "score": "0.5312201", "text": "def chooser_options\n { \"choices\" => get_departments,\n \"required\" => true }\n end", "title": "" }, { "docid": "3dc40b02ffa5c669f5f7409531ea1c4d", "score": "0.5308846", "text": "def manufacturer\n @manufacturer ||= read_string(usb_device.iManufacturer, \"VENDOR(0x#{vendor_id.to_hex(4)})\").strip\n end", "title": "" }, { "docid": "1e9f12ab863a4888336268c94e2e7049", "score": "0.53063995", "text": "def machine_choice\n CHOICES.sample\n end", "title": "" }, { "docid": "b3df3d5330ccc245847ceb57744023e9", "score": "0.52942854", "text": "def manufacturer=(value)\n @manufacturer = value\n end", "title": "" }, { "docid": "9a9d5449ad5c0397da7824dc673cdd2d", "score": "0.5289116", "text": "def list_specimens # :nologin:\n query = create_query(:Specimen, :all, by: :herbarium_label)\n show_selected_specimens(query)\n end", "title": "" }, { "docid": "4b27896c9fd1addd78c3af286da6a60b", "score": "0.52848905", "text": "def products\n return Product.all.select { |product| vendors.include? product.vendor }\n end", "title": "" }, { "docid": "2665a2f8fba8b39ca2a959677b8e88dd", "score": "0.52811855", "text": "def mk_game_choices\n [\n choice(\"Show stores\",1),\n choice(\"Show all deals\",2),\n choice(\"Show cheapest deal\",3)\n ]\n end", "title": "" }, { "docid": "bfccc585c093f2eb7b88153cb8cf4b28", "score": "0.5279132", "text": "def options_for_user_select(object)\n object.collect { |r| [r.name, r.id] }\n end", "title": "" }, { "docid": "6bd72fea3e698f57a87b5d636ab0315a", "score": "0.5274179", "text": "def brands\n FlavorBrand.all.select{|fb| fb.flavor == self}.map(&:brand).uniq\n end", "title": "" }, { "docid": "d927e69279a87d7fec38ca2654f35336", "score": "0.5262829", "text": "def search_manufacturers(manufacturer_query)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup % [Configuration.host]\r\n _query_builder << '/search/medicines/manufacturers/{manufacturer_query}'\r\n _query_builder = APIHelper.append_url_with_template_parameters _query_builder, {\r\n 'manufacturer_query' => manufacturer_query\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 _query_url, headers: _headers\r\n OAuth2.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": "578e93534d829e61c86fd9d7b4eed3cc", "score": "0.5259795", "text": "def all_items\n all(:xpath, \"//select[@id='_ctl0_content5_ddlcommodity']//option\").map { |a| a.text}\n end", "title": "" }, { "docid": "5f3e17691db56ff33ddc13141fb140b4", "score": "0.5258341", "text": "def selected_question_options\n return response_value.split(\",\").map{|id_str| id_str.to_i}.map{|id| QuestionOption.find(id)}\n end", "title": "" }, { "docid": "94506d3f34f38deff84299780a3df26b", "score": "0.5256654", "text": "def item_types_select\n h.item_types_select\n end", "title": "" }, { "docid": "7b2d2a11fe9287cc1e1db48c6ca5793c", "score": "0.52537835", "text": "def configurable_option_types\n product_option_values.map{|pov| pov.option_value.option_type}.uniq\n end", "title": "" }, { "docid": "388b95dd7c7351bfbf4cb868e35e787f", "score": "0.5248305", "text": "def select_options(type, request)\n all_rows_for(type, request).map{|obj| [object_display_name(type, request, obj), primary_key_value(obj)]}\n end", "title": "" }, { "docid": "36ddaee91891b5dd96578b54cb7b75b6", "score": "0.5244316", "text": "def list_specimens # :nologin:\n query = create_query(:Specimen, :all, :by => :herbarium_label)\n show_selected_specimens(query)\n end", "title": "" }, { "docid": "0b5ed580e42f21a51529ecb05a80fa01", "score": "0.5241822", "text": "def options_for_select\n opts = \"\"\n Product.find(:all,\n :conditions => ['includeable_in_promotions = ?', true],\n :order => 'id').each {|prod|\n opts += \"<option value='#{prod.id}'\"\n # opts += \" selected='selected'\" if user.has_event?(role.name)\n opts += \" selected='selected'\" if self.products.include?(prod)\n opts += \">#{prod.name}</option>\"\n }\n # logger.info(opts.inspect)\n return opts\n end", "title": "" }, { "docid": "ecfb7b7c8fb8593758202f839113bfbc", "score": "0.5233742", "text": "def apple_picker_with_select(fruit_array)\r\n fruit_array.select { |item| item == \"apple\" }\r\nend", "title": "" }, { "docid": "360ba1350d958ccad9017f53e3c337bb", "score": "0.52336717", "text": "def applications\r\n emc_combo_menu_dropdown_button('applicationList').click\r\n item_list = emc_combo_menu_items('applicationList')\r\n appList=[]\r\n item_list.each { |item|\r\n appList.push item.text \r\n }\r\n emc_combo_menu_dropdown_button('applicationList').click\r\n \r\n return appList\r\n end", "title": "" }, { "docid": "53741ffbcdf8fd89e61718627931f38f", "score": "0.52321684", "text": "def civicrm_models\n option_value_model\n end", "title": "" }, { "docid": "53741ffbcdf8fd89e61718627931f38f", "score": "0.52321684", "text": "def civicrm_models\n option_value_model\n end", "title": "" }, { "docid": "11a28a56baff11481fd4433f04a9a192", "score": "0.52284944", "text": "def manufacturer\n @hash[\"manufacturer\"]\n end", "title": "" }, { "docid": "11a28a56baff11481fd4433f04a9a192", "score": "0.52284944", "text": "def manufacturer\n @hash[\"manufacturer\"]\n end", "title": "" }, { "docid": "1b03720ce75e8993fd6eb9a897620d61", "score": "0.5225256", "text": "def select_options; end", "title": "" }, { "docid": "a2a9371afbfc10acc2ec0193b85d4b8b", "score": "0.52102876", "text": "def manufacturer=(value)\n @manufacturer = value\n end", "title": "" }, { "docid": "a2a9371afbfc10acc2ec0193b85d4b8b", "score": "0.52102876", "text": "def manufacturer=(value)\n @manufacturer = value\n end", "title": "" }, { "docid": "a2a9371afbfc10acc2ec0193b85d4b8b", "score": "0.52102876", "text": "def manufacturer=(value)\n @manufacturer = value\n end", "title": "" }, { "docid": "a2a9371afbfc10acc2ec0193b85d4b8b", "score": "0.52102876", "text": "def manufacturer=(value)\n @manufacturer = value\n end", "title": "" }, { "docid": "a2a9371afbfc10acc2ec0193b85d4b8b", "score": "0.52102876", "text": "def manufacturer=(value)\n @manufacturer = value\n end", "title": "" }, { "docid": "a2a9371afbfc10acc2ec0193b85d4b8b", "score": "0.52102876", "text": "def manufacturer=(value)\n @manufacturer = value\n end", "title": "" }, { "docid": "eb3b026c7a3a9d80cfa5d8562b212465", "score": "0.5202606", "text": "def get_selects_info\n @nuage_versions = NuageVersion.all\n @ha_models = HaModel.all\n @verticals = Vertical.all\n @qty_ranges = QtyRange.all\n @revenues = Revenue.all\n @regions = Region.all\n @cmss = CloudManagementSystem.all\n end", "title": "" }, { "docid": "766e59aba73c6f1f3686d993b31fec95", "score": "0.5197205", "text": "def solicitante_options_for_select\n @solicitante_options_for_select = Analista.all.order(:nome)\n end", "title": "" }, { "docid": "8dcdc3e94cf01b9cfb184c3911ea1429", "score": "0.51953137", "text": "def choices\n extracted_choices = []\n\n unless self.qp_answers.nil?\n self.qp_answers.each do |choice| \n extracted_choices.push(Choice.new(choice))\n end \n end\n\n return extracted_choices \n end", "title": "" }, { "docid": "520be68cb8fdac7eba5a3d2031a3e0d6", "score": "0.5194884", "text": "def selected_software\n request_str = \"/appliances/#{id.to_i}/software\"\n response = GenericRequest.new(self.class.studio_connection).get request_str\n attrs = XmlSimple.xml_in response\n convert_selectable attrs\n end", "title": "" }, { "docid": "4e395cfb66f5c36ab10c783782b82ffb", "score": "0.5191886", "text": "def options(name)\n enum = enums[name]\n return [] if enum.blank?\n enum.to_a\n end", "title": "" }, { "docid": "f0c900fbf3b27cebb30550df70a0da1a", "score": "0.51836514", "text": "def options_for_combo(attribute, key)\n options = [\"<option value=''></option>\".html_safe]\n if attribute\n options << \"<option value='#{ attribute.slug }' selected='selected'>#{ attribute.name }</option>\".html_safe\n end\n\n Tag.find_popular(key).each do |i|\n options << \"<option value='#{i[:slug]}'>#{i[:name]}</option>\".html_safe\n end\n\n safe_join(options)\n end", "title": "" } ]
2839561f3cfe8b7e1814d5a9fde35d71
Took 64.685792 seconds => 362879
[ { "docid": "aff8160e3a30e6b13bac03dc30ac2238", "score": "0.0", "text": "def benchmark\n n = 349572681\n oldTime = Time.now\n 50.times do\n n = test(n)\n end\n puts \"1000 Tests took #{Time.now-oldTime}\"\n n = 123456789\n oldTime = Time.now\n 1000.times do\n n = test2(n)\n end\n puts \"1000 Test2s took #{Time.now-oldTime}\"\nend", "title": "" } ]
[ { "docid": "089f00f53597451ffe6433696e855a58", "score": "0.5737471", "text": "def benchmark\nend", "title": "" }, { "docid": "b3929c54bbce28e89dd83fba60f7b4b0", "score": "0.56845653", "text": "def build_timing; end", "title": "" }, { "docid": "1182dd0594ef4a8eb04bb707a7817594", "score": "0.5658208", "text": "def fast_duration\n 0.5\n end", "title": "" }, { "docid": "c9f7afe6e914c0a45c0c542db8dd7c92", "score": "0.5490817", "text": "def server_timing; end", "title": "" }, { "docid": "df6f2e6975d4474e508e6dd37a9a81b7", "score": "0.54807067", "text": "def timer; end", "title": "" }, { "docid": "df6f2e6975d4474e508e6dd37a9a81b7", "score": "0.54807067", "text": "def timer; end", "title": "" }, { "docid": "df6f2e6975d4474e508e6dd37a9a81b7", "score": "0.54807067", "text": "def timer; end", "title": "" }, { "docid": "df6f2e6975d4474e508e6dd37a9a81b7", "score": "0.54807067", "text": "def timer; end", "title": "" }, { "docid": "316eb5edbf5bd1e3496835fc2eb0b299", "score": "0.5473629", "text": "def cstime=(*) end", "title": "" }, { "docid": "834f78682ad3c456a1aaf4193baefef4", "score": "0.5472432", "text": "def eu1\n # .00028s | 1000 silent iterations\n total = 0\n (1..1000).each { |i| total += i if i % 3 == 0 or i % 5 == 0 }\n return total\nend", "title": "" }, { "docid": "0555c96ec69e0972d21614f6333ca085", "score": "0.53613025", "text": "def smoothing; end", "title": "" }, { "docid": "3aed6bf09d049db487e1bed466e2a5b5", "score": "0.53584", "text": "def measure; end", "title": "" }, { "docid": "293c5f15df2caa9bc9970021974f3031", "score": "0.5331694", "text": "def latency; end", "title": "" }, { "docid": "5971f871580b6a6e5171c35946a30c95", "score": "0.5322411", "text": "def stderrs; end", "title": "" }, { "docid": "726c6755ed6d69c45e6dad965ba4002b", "score": "0.53221375", "text": "def thread; end", "title": "" }, { "docid": "726c6755ed6d69c45e6dad965ba4002b", "score": "0.53221375", "text": "def thread; end", "title": "" }, { "docid": "726c6755ed6d69c45e6dad965ba4002b", "score": "0.53221375", "text": "def thread; end", "title": "" }, { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.5302036", "text": "def private; end", "title": "" }, { "docid": "600745f81af1ce78324dbbc73f8ab19b", "score": "0.52922183", "text": "def stats; end", "title": "" }, { "docid": "600745f81af1ce78324dbbc73f8ab19b", "score": "0.52922183", "text": "def stats; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.528382", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.528382", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.528382", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.528382", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.528382", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.528382", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.528382", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.528382", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.528382", "text": "def time; end", "title": "" }, { "docid": "03a8d48503f7c689a967fb4802f8823a", "score": "0.52716833", "text": "def get_model_years_slow\n start = Time.now\n\n # open the json file of all cars and models\n json = JSON.parse(File.read(@all_cars_file))\n\n if json.nil?\n puts \"ERROR - could not find json file\"\n exit\n end\n\n # get all of the car ids with model ids\n # model_ids = json.map{|key, value| value['models'].keys}.flatten\n car_model_ids = json.map{|key, value| [key, value['models'].keys]}\n\n if car_model_ids.nil? || car_model_ids.length == 0\n puts \"ERROR - could not find model ids\"\n exit\n end\n\n puts \"- found #{car_model_ids.length} cars with a total of #{car_model_ids.map{|x| x[1]}.flatten.length} models\"\n\n total_left_to_process = car_model_ids.length\n car_model_ids.each_with_index do |car, index|\n puts \"-------------------\"\n puts \"#{index} cars download so far in #{((Time.now-start)/60).round(2)} minutes\\n\\n\"\n\n car[1].each do |model_id|\n puts \"- car #{car[0]}, model #{model_id}\"\n # save years\n json[car[0]]['models'][model_id]['years'] = JSON.parse(open(\"#{@model_years_url}#{model_id}\").read)\n end\n end\n\n puts \"FINISHED DOWNLOAD DATA!!\"\n\n # save to file\n File.open(@all_cars_file_with_years, 'wb') { |file| file.write(JSON.generate(json)) }\n\n puts \"TOTAL TIME TO DOWNLOAD AND WRITE TO FILE = #{((Time.now-start)/60).round(2)} minutes\"\nend", "title": "" }, { "docid": "5b21002110ca7dd9d8fe3103db1f57cc", "score": "0.52577984", "text": "def fingerprint; end", "title": "" }, { "docid": "b61a4ba68f80637b0607ef5e33968e0b", "score": "0.5250615", "text": "def pausable; end", "title": "" }, { "docid": "52884a6298251d060573be742d8f0b13", "score": "0.52374524", "text": "def memo; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5229753", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5229753", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5229753", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5229753", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5229753", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5229753", "text": "def cache; end", "title": "" }, { "docid": "157d4a88a386243ea01f87cf394d4588", "score": "0.5229753", "text": "def cache; end", "title": "" }, { "docid": "bdd5a19756e5b77c377131d39521a57b", "score": "0.5218944", "text": "def optimize_every; end", "title": "" }, { "docid": "30f089b3cb8b3758d771fd26c51d3595", "score": "0.5216314", "text": "def total_time=(_arg0); end", "title": "" }, { "docid": "9bea815400e77f7d29f3829bedc32e03", "score": "0.520193", "text": "def memos; end", "title": "" }, { "docid": "9bea815400e77f7d29f3829bedc32e03", "score": "0.520193", "text": "def memos; end", "title": "" }, { "docid": "fb127afb655b22988cea794c54e71aff", "score": "0.5190988", "text": "def lock; end", "title": "" }, { "docid": "fb127afb655b22988cea794c54e71aff", "score": "0.5190988", "text": "def lock; end", "title": "" }, { "docid": "fb127afb655b22988cea794c54e71aff", "score": "0.5190988", "text": "def lock; end", "title": "" }, { "docid": "82b889ef009ff6b285d96bab56ffcf42", "score": "0.5177617", "text": "def generate_comprehensive\n\n end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51740575", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51740575", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51740575", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51740575", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51740575", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51740575", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51740575", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51740575", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51740575", "text": "def run; end", "title": "" }, { "docid": "db1d5aa88d5a744daa2a87ab506afd80", "score": "0.51642066", "text": "def counter_cache; end", "title": "" }, { "docid": "4b7e0d128bcbde385f74cc14a2edae0c", "score": "0.5151803", "text": "def tv_usec() end", "title": "" }, { "docid": "0e3a24c9ffda4b75a460a00d1e2785fe", "score": "0.51462126", "text": "def benchmark(s1, s2)\n puts \"s1=#{s1}\"\n puts \"s2=#{s2}\"\n puts \n \n start_time = Time.now\n #match = number_match(s1, s2)\n match = slide_cache(s1, s2)\n duration = Time.now - start_time\n \n puts \"Slide match: #{match}\"\n puts \"Took: #{(duration * 1000).round(5)}ms\"\n puts\n \n=begin \n start_time = Time.now\n a1 = build_substrings(s1)\n a2 = build_substrings(s2)\n match = find_longest_match(a1, a2)\n duration = Time.now - start_time\n \n puts \"Table match: #{match}\"\n puts \"Took: #{duration * 1000}ms\"\n=end \nend", "title": "" }, { "docid": "f17451d7b0ea9b164312bd1a2ae6af4d", "score": "0.51459694", "text": "def throttles; end", "title": "" }, { "docid": "20f2344c76eec140ad4c4e662f7a0104", "score": "0.5143135", "text": "def paint_locations(image,color)\n puts \"painting locations in color #{color}.\"\n c = 0\n before = Time.new\n # get the locations in small blocks (due to bug in mysql pkg)\n # WARNING: this will stop working as soon as there are more than 350k locations\n # as of now (2011-04) there are about 305k\n (0..3500).each do |i|\n $matcher.get_location(i*100,(i+1)*100-1).each do |l|\n image.coordinate(l[0].to_f,l[1].to_f,color)\n c += 1\n if c % 50000 == 0\n puts \"Painted #{c} locations.\"\n end\n end\n end\n after = Time.new\n puts \"Painted #{c} locations in #{(after-before)} seconds (#{(c/(after-before)).to_i}/sec)\"\nend", "title": "" }, { "docid": "ecfeaf84a3523f7b95a3c5ef2b0d5fab", "score": "0.513783", "text": "def quick_stats\n\tend", "title": "" }, { "docid": "7109b3be182f46c6f5597bf7b816f373", "score": "0.5131717", "text": "def pedal_faster\n\t\t@speed += 10\n\tend", "title": "" }, { "docid": "922fe0eda225dc74cdde0f8977fd4336", "score": "0.5126723", "text": "def max_fast_inline(num_of_requests); end", "title": "" }, { "docid": "ef0ae9c9373faf99d8a862b7242b88be", "score": "0.51242197", "text": "def leeway; end", "title": "" }, { "docid": "ef0ae9c9373faf99d8a862b7242b88be", "score": "0.51242197", "text": "def leeway; end", "title": "" }, { "docid": "93c3e3537cdd1a94a74a230719a5b12c", "score": "0.5112632", "text": "def runtime; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.50901353", "text": "def probers; end", "title": "" }, { "docid": "910557aef9b3658fcdbfd8c47b390fa9", "score": "0.5085237", "text": "def test_load_0\n\n map = {}\n\n @engine.register_participant(\"count\") do |workitem|\n count = map[workitem.flow_id]\n count = unless count\n 1\n else\n count + 1\n end\n map[workitem.flow_id] = count\n end\n\n n = 1000\n\n n.times do |i|\n li = LaunchItem.new(TestDefinition0)\n li.flow_id = i\n @engine.launch(li)\n end\n\n #while @engine.get_expression_storage.size > 1\n # sleep 0.001\n #end\n @engine.join_until_idle\n\n good = true\n\n n.times do |i|\n c = map[i]\n if c == 2\n #if c == 1\n print \".\"\n else\n print c\n good = false\n end\n end\n\n #puts \"\\n__good ? #{good}\"\n assert good, \"missing count\"\n\n # 100 in 1s (in memory engine)\n # 1'000 in 14s (in memory engine)\n # 10'000 in 143s (in memory engine)\n # 1'000 in 31s (cache engine)\n # 10'000 in 321s (cache engine)\n # 1'000 in 113s (persistence only engine)\n # 10'000 in 1173s (persistence only engine)\n #\n #\n # ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-darwin8.8.3]\n #\n # Machine Name: Mac\n # Machine Model: MacBook2,1\n # Processor Name: Intel Core 2 Duo\n # Processor Speed: 2 GHz\n # Number Of Processors: 1\n # Total Number Of Cores: 2\n # L2 Cache (per processor): 4 MB\n # Memory: 2 GB\n # Bus Speed: 667 MHz\n\n # Thu Sep 13 15:38:46 JST 2007\n #\n # 100 in 3s (in memory engine)\n # 1'000 in 85s (in memory engine)\n # 10'000 in s (in memory engine)\n end", "title": "" }, { "docid": "ad6f4a8f1a7471d04ceab0a0cf706f4c", "score": "0.50851643", "text": "def find_fast(u)\n u += 0xe91aaa35\n u ^= u >> 16\n u += (u << 8) & 0xFFFFFFFF\n u &= 0xFFFFFFFF\n u ^= u >> 4\n b = (u >> 8) & 0x1ff\n a = ((u + ((u << 2) & 0xFFFFFFFF)) & 0xFFFFFFFF) >> 19\n a ^ Arrays::HASH_ADJUST[b]\n end", "title": "" }, { "docid": "52f9c6181c5686bfe8b12805dfdd5be0", "score": "0.50498354", "text": "def test_raw_performance\n assert_nothing_raised do\n # 20 seconds would seem to be far more than is necessary for this...\n Timeout::timeout(20) {CS::matrix_fibonacci(10000)}\n end\n end", "title": "" }, { "docid": "f60ffb34feba6e149e5670da38db33b1", "score": "0.5048388", "text": "def find_hash(possible_words, known_anagram, known_md5s, start, n = 3)\n cpus = Parallel.processor_count\n puts \"Total number of iteration: #{possible_words.length**n}\"\n puts \"You got #{cpus} cores\"\n\n hash_table = get_hash_table(known_anagram)\n known_hash = get_hash(known_anagram, hash_table)\n\n Parallel.map(possible_words, in_processes: cpus) do |w1|\n possible_words.each do |w2|\n possible_words.each do |w3|\n # Print every ten million iteration\n phrase = \"#{w1} #{w2} #{w3}\"\n\n # Allow only equal size phrases\n next unless phrase.length == known_anagram.length\n\n # Allow only equal hash phrases\n hash = get_hash(phrase, hash_table)\n next unless hash == known_hash\n\n # All only equal md5 phrases\n md5 = Digest::MD5.hexdigest phrase\n next unless known_md5s.include?(md5)\n\n puts \"#{phrase} #{md5} (#{Time.now - start}s)\"\n end\n end\n end\nend", "title": "" }, { "docid": "50f39d5efb0c0aefc4b21461f853c459", "score": "0.50396067", "text": "def generate_kpi_from_key_counter(all_fomula,s1_ip,time_counter_hash,source_file,logger)\n\ncell_size=3\n\ntime_counter_hash.each do |start_time,one_time_counter|\n\n counter_hash=one_time_counter\n #logger.debug \"kpi calculation for start time=#{start_time}\"\n all_cell_hash=Hash.new\n\n all_fomula.each do |fomula|\n #puts fomula.name\n #logger.debug \"start calculate fomula #{fomula.name}\"\n\n fomula_hash=Hash.new\n\n #获取原始公式并替换处理\n new_fomula=fomula.fomula_exp1.gsub(/sum|avg|\\[|\\]/,\"\")\n #获取一个公示里面所有的counter,并存放在数组中\n counter_array=fomula.fomula_exp1.scan(/M\\d+C\\d+/)\n\n counter_array.each do |counter|\n fomula_hash[counter]=counter_hash[counter]\n end\n\n #logger.debug \"fomula hash=#{fomula_hash}\"\n\n# we need convert fomulu to map to the array we calculated above\n cell_fomula_array=[]\n\n 0.upto(cell_size-1).each do |i|\n\n new_fomula_2=String.new(new_fomula)\n formated_fomula=\"\"\n counter_array.uniq.each do |counter|\n\n if fomula.formularid==\"LTE_5218c\" || fomula.formularid==\"LTE_5023d\" || fomula.formularid==\"LTE_5017a\" || fomula.formularid==\"LTE_5017a\" || fomula.formularid==\"LTE_5035a\" || fomula.formularid==\"LTE_5082a\" \\\n || fomula.formularid==\"LTE_5114a\" || fomula.formularid==\"LTE_5035a\" ||fomula.formularid==\"LTE_5048b\" || fomula.formularid==\"LTE_5082a\" || fomula.formularid==\"LTE_5114a\" || fomula.formularid==\"LTE_5043a\" \\\n || fomula.formularid==\"LTE_5058b\" || fomula.formularid==\"LTE_5119c\" ||fomula.formularid==\"LTE_5025d\"\n formated_fomula= new_fomula_2.gsub!(\"#{counter}\",\"fomula_hash\\[\\\"#{counter}\\\"\\]\\[#{i}\\].to_f\")\n\n else\n formated_fomula= new_fomula_2.gsub!(\"#{counter}\",\"fomula_hash\\[\\\"#{counter}\\\"\\]\\[#{i}\\]\")\n end\n \n end #end of each counter sacn\n #save converted fomulr\n cell_fomula_array << formated_fomula\n\n #logger.debug \"formated_fomula=#{formated_fomula}\"\n end\n\n#logger.debug cell_fomula_array\n\n #对于每一个cell的公式\n cell_fomula_array.each_index do |index|\n all_cell_hash[\"#{start_time}_cell#{index}\"] ||={}\n # logger.debug \"calculation formuala=#{cell_fomula_array[index]}\"\n\n merged_hash=all_cell_hash[\"#{start_time}_cell#{index}\"]\n\n merged_hash[\"start_time\"]=start_time\n merged_hash[\"source_file\"]=source_file\n merged_hash[\"s1_ip\"]=s1_ip\n merged_hash[\"kpi_hash\"]||={} #KPI is empty\n merged_hash[\"scopelevel\"]=\"cell-#{index+1}\"\n\n begin\n #logger.debug cell_fomula_array\n kpi_result=eval(cell_fomula_array[index].to_s)\n logger.debug \"kpi_result=#{kpi_result}\"\n if kpi_result.kind_of?(Float)\n kpi_result=kpi_result.round(2).to_s+\"%\"\n end\n\n\n # logger.debug \"kpi result=#{kpi_result}\"\n merged_hash[\"kpi_hash\"]=merged_hash[\"kpi_hash\"].merge({fomula.name.to_s=>kpi_result})\n \n rescue Exception => ex\n # puts ex\n logger.debug ex.class\n\n \t#logger.debug \"merged_hash=#{merged_hash}\"\n \t#merged_hash[\"kpi_hash\"]||=Hash.new #KPI is empty\n \t#\traise unless merged_hash[\"kpi_hash\"].kind_of?(Hash)\n merged_hash[\"kpi_hash\"]=merged_hash[\"kpi_hash\"].merge({fomula.name.to_s=>\"#{ex.class}\"})\n end #end of rescue\n\n \n \n all_cell_hash[\"#{start_time}_cell#{index}\"]=merged_hash\n # puts merged_hash\n end # end of 3 cell calculation \n #logger.debug all_cell_hash\n\t\n end #end of all fomula\n\nall_cell_hash.each do |key,value|\n #logger.debug \"start_time =#{key},value hash size=#{value[\"kpi_hash\"].size}\"\n value[\"kpi_hash\"]=value[\"kpi_hash\"].to_s\n kpi=Kpi.where(:s1_ip=>s1_ip,:start_time=>value[\"start_time\"],:scopelevel=>value[\"scopelevel\"]).first\n \n if kpi.nil?\n Kpi.create(value) \n # else\n # kpi.update_attributes(value) \n end\n\nend\n\nend \n\n\n\nend", "title": "" }, { "docid": "6dc3809caae9c653f5a970f0b6d8a69b", "score": "0.5034857", "text": "def big_google_call()\n\n number_of_step = 30;\n lat_base = 48.810837;\n lat_step = (0.1 / number_of_step);\n lng_base = 2.241837;\n lng_step = (0.22 / number_of_step);\n\n for lat_index in 0..number_of_step\n for lng_index in 0..number_of_step\n this_lat = lat_base + lat_index * lat_step;\n this_lng = lng_base + lng_index * lng_step;\n\n places = google_radar_call([this_lat,this_lng], nil)\n places.each do |place|\n add_one_to_db(place, db)\n end\n end\n end\nend", "title": "" }, { "docid": "2f065aafa3727721a2ea53637dcff804", "score": "0.5034343", "text": "def speed_up\n self.speed += 5\n info\n end", "title": "" }, { "docid": "2f065aafa3727721a2ea53637dcff804", "score": "0.5034343", "text": "def speed_up\n self.speed += 5\n info\n end", "title": "" }, { "docid": "a83f3dc7eb8c93d19d61b0d111775d0a", "score": "0.5027834", "text": "def slow_correction\n slow ? 2000/440 : 1\n end", "title": "" }, { "docid": "fc4f13bdb176bd34161683632594b340", "score": "0.5019781", "text": "def get_large_mapping( indicator )\n\treturn 0\t\tif indicator <= 1\n\t3 + get_large_mapping( indicator / 1000 )\nend", "title": "" }, { "docid": "9a80a09f55b88f50286ed06be4031566", "score": "0.5009448", "text": "def thread()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "42a376771c0483184eed81072ec4d0af", "score": "0.500792", "text": "def quick(repetitions=100, &block)\n require 'benchmark'\n Benchmark.bmbm do |b|\n b.report {repetitions.times &block}\n end\n nil\nend", "title": "" }, { "docid": "668f390f783683a44574c377c6622fc8", "score": "0.5002536", "text": "def running; end", "title": "" }, { "docid": "668f390f783683a44574c377c6622fc8", "score": "0.5002536", "text": "def running; end", "title": "" }, { "docid": "07388179527877105fd7246db2b49188", "score": "0.5000433", "text": "def villian; end", "title": "" }, { "docid": "2a05afac0f14245a9bfea72e23267d2f", "score": "0.49983424", "text": "def low_toms\n [43]\n end", "title": "" }, { "docid": "8b50378ae407edae71ee346a9e57d0ff", "score": "0.49968982", "text": "def craw_contacts\n start_time = Time.now\n\n agent = touch_and_customize_cookies\n \n values = COLL.find({\"done\" => {\"$exists\" => false}})\n \n Parallel.each(values, :in_threads => 2, :in_processes => 2) do |value|\n # values.each do |value|\n detail_url = value['url']\n parse_single_page(agent.get(URL_PREFIX + detail_url))\n COLL.update({\"_id\" => value['_id']}, {\"$set\" => {\"done\" => true}})\n end\n\n p Time.now - start_time\nend", "title": "" }, { "docid": "8b50378ae407edae71ee346a9e57d0ff", "score": "0.49968982", "text": "def craw_contacts\n start_time = Time.now\n\n agent = touch_and_customize_cookies\n \n values = COLL.find({\"done\" => {\"$exists\" => false}})\n \n Parallel.each(values, :in_threads => 2, :in_processes => 2) do |value|\n # values.each do |value|\n detail_url = value['url']\n parse_single_page(agent.get(URL_PREFIX + detail_url))\n COLL.update({\"_id\" => value['_id']}, {\"$set\" => {\"done\" => true}})\n end\n\n p Time.now - start_time\nend", "title": "" }, { "docid": "f441b8118e227a06e7a1c24b554ba9b4", "score": "0.4986781", "text": "def blg; end", "title": "" }, { "docid": "4a8a45e636a05760a8e8c55f7aa1c766", "score": "0.49845532", "text": "def terpene; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.49716628", "text": "def timeout; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.49716628", "text": "def timeout; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.49716628", "text": "def timeout; end", "title": "" }, { "docid": "7cd5de21d23f9339c242f5c4b164c18f", "score": "0.4970798", "text": "def go_faster\n ping_check \"go_faster\"\n end", "title": "" }, { "docid": "92eb67ffdf10584ed31a74e05f590cc5", "score": "0.4955585", "text": "def gounod; end", "title": "" }, { "docid": "1f60ec3e87d82a4252630cec8fdc8950", "score": "0.494507", "text": "def berlioz; end", "title": "" }, { "docid": "b5a06d115b3602354d698ee2a95ef1a6", "score": "0.49382436", "text": "def digest!()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "7580ee4b3bb65a573c0e6df70314d45a", "score": "0.49347848", "text": "def ordv\n large = Array.new([0,0,0,0,0,0,0,0,0,1])\n (1..7830457).each do |n|# digit represents ,2^n\n passover = 0\n 9.downto(0).each do |i|\n large[i] *= 2\n large[i] += passover\n if large[i] >= 10\n large[i] %= 10\n passover = 1\n else\n passover = 0\n end\n end\n end\n (28433 * large.join.to_i + 1)%100000000000\nend", "title": "" }, { "docid": "5b8c1b60d06f5a0ef8b3823b75599bbb", "score": "0.49333927", "text": "def max_descent_speed; end", "title": "" }, { "docid": "3b4df29992323899033bb22a35a64989", "score": "0.49294055", "text": "def malts; end", "title": "" }, { "docid": "f5b7670e9b85b032a4fc353eb1e56002", "score": "0.492827", "text": "def test_find_stack_overflow\n skip # because it takes *forever*\n @starting_point = MM::Ratio.new(1,1)\n @search = MM::Search.new(@starting_point)\n @search.delta = 0.001\n @search.adjacent_points_function = ->(current) {\n [MM::Ratio.new(1,1), MM::Ratio.new(-1,1)].map {|m| m + current}\n }\n goal = MM::Ratio.new(9000,1)\n @search.cost_function = ->(x) {\n (x - goal).abs\n }\n assert_equal goal, @search.find\n puts @search.iterations\n end", "title": "" }, { "docid": "baabb3812db31942b413369b11795731", "score": "0.49250284", "text": "def benchmark!\n @benchmark = true\n end", "title": "" } ]
2492ea2c548597ee179dd47de9c97d9b
signs text with this key, base64 encoded by default
[ { "docid": "feac08eee7d1baf37c8f93f3a6911195", "score": "0.79002416", "text": "def sign_and_encode(text_to_sign, base64_encode=true)\n return nil if text_to_sign.nil? || text_to_sign.empty?\n sig = @key.sign(OpenSSL::Digest::SHA256.new, text_to_sign)\n base64_encode ? Base64UrlSafe.encode(sig) : sig\n end", "title": "" } ]
[ { "docid": "0dd84a6988b85ad759905df11ae884c9", "score": "0.7459426", "text": "def sign(string, base64=false)\n sig = @private_key.sign(OpenSSL::Digest.new(\"SHA1\"), string)\n\n base64 ? base64_encode(sig) : sig\n end", "title": "" }, { "docid": "2b2be35379a65d2ed77cbf3023f920a8", "score": "0.73086166", "text": "def sign(string)\n @key.sign OpenSSL::Digest::SHA256.new, string\n end", "title": "" }, { "docid": "d915a8a65f4283676a0240e753e31e5a", "score": "0.7171375", "text": "def sign_base_string(base_string)\n key = OpenSSL::PKey::RSA.new File.read @private_key\n signature = key.sign(OpenSSL::Digest::SHA256.new, base_string)\n\n Base64.encode64(signature).delete(\"\\n\")\n end", "title": "" }, { "docid": "217a38e89c3c07be517f4bbf8b48e527", "score": "0.70977426", "text": "def signature\n Base64.encode64(digest_with_key(string_to_sign)).strip\n end", "title": "" }, { "docid": "7e56f9d383d6deae61a464fadaebf250", "score": "0.705748", "text": "def sign_key; end", "title": "" }, { "docid": "18c0cab8a4b1865c9cf8a7ad5bd14f9c", "score": "0.70218235", "text": "def signature\n Base64.encode64(encryption_key.sign(OpenSSL::Digest::SHA256.new, id_string))\n end", "title": "" }, { "docid": "1eb3d2a9085016dc99713eebed73c573", "score": "0.6922322", "text": "def sign secret, string_to_sign, digest_method = 'sha256'\n Base64.encode64(hmac(secret, string_to_sign, digest_method)).strip\n end", "title": "" }, { "docid": "d2d40477857d7c10ce0a2648e19b463a", "score": "0.6807229", "text": "def sign(message); end", "title": "" }, { "docid": "63d4aa483cbdde3f3ddb5f506c98d196", "score": "0.6777713", "text": "def encrypt_and_sign(value)\n Base64.urlsafe_encode64(@box.encrypt(::JSON.dump(value)))\n end", "title": "" }, { "docid": "512e9d0ca8254959c9430ab1dac2d71d", "score": "0.6689302", "text": "def sign(body)\n signed = OpenSSL::HMAC.digest('sha256', access_key, body)\n Base64.strict_encode64(signed)\n end", "title": "" }, { "docid": "3cef72d4f06c2097990afb1657977f2b", "score": "0.6671217", "text": "def signature\n sha256 = OpenSSL::Digest::SHA256.new\n hash = OpenSSL::HMAC.digest sha256, secret, string_to_sign\n\n Base64.encode64(hash).chomp\n end", "title": "" }, { "docid": "f95d9d74f27d90ff79028c6e5ceaeaf1", "score": "0.66458106", "text": "def sign(key, string)\n SSL.new(nil, key).sign(string, true)\n end", "title": "" }, { "docid": "6ad7daf827fad9f8efef02ee79ce8fbe", "score": "0.6644644", "text": "def sign(data)\n @key.sign(@algo.new, data)\n end", "title": "" }, { "docid": "1517d4e418dc2974016ef261a0a35465", "score": "0.6549254", "text": "def sign(string, secret_access_key)\n hmac = HMAC::SHA256.new(secret_access_key)\n hmac.update(string)\n # chomp is important! the base64 encoded version will have a newline at the end\n Base64.encode64(hmac.digest).chomp\n end", "title": "" }, { "docid": "91485f864d090c9994d4c85f4f268831", "score": "0.6505484", "text": "def sign data\n return unless @key\n\n @key.sign @digest_algorithm.new, data\n end", "title": "" }, { "docid": "ad158dae6260fbff60c141e754a55948", "score": "0.6478919", "text": "def signing_input; end", "title": "" }, { "docid": "ad158dae6260fbff60c141e754a55948", "score": "0.6478919", "text": "def signing_input; end", "title": "" }, { "docid": "dca58e07b74f4dec53d691311166f5be", "score": "0.6460903", "text": "def sign content\n Utils::BinUtil.to_hex(sign_to_bin(content))\n end", "title": "" }, { "docid": "15abb4d70d4ffa4281761a22bd57b95a", "score": "0.6451486", "text": "def signed_string\n \"service=#{params['service']}&v=#{params['v']}&sec_id=#{params['sec_id']}&notify_data=#{params['notify_data']}#{key}\"\n end", "title": "" }, { "docid": "85a7b4e76bdd1b6cf5e26bd797296593", "score": "0.64338505", "text": "def sign(t_outputs)\n # binding.pry\n Base64.encode64(private_key.sign(OpenSSL::Digest::SHA256.new, t_outputs.to_json))\n end", "title": "" }, { "docid": "ad07a57d5c6bae8b423c72b8af6a68ab", "score": "0.64277", "text": "def sign(str)\n @signer.sign(str) unless str.nil? || str.empty?\n end", "title": "" }, { "docid": "cda2bd272592dd57333cdacc048a6364", "score": "0.6421288", "text": "def fps_sign string\n digest = OpenSSL::Digest::Digest.new('sha1')\n hmac = OpenSSL::HMAC.digest(digest, SECRET_ACCESS_KEY, string)\n Base64.encode64(hmac).chomp\n end", "title": "" }, { "docid": "71b65d023469b83f0fd7976e84336e1a", "score": "0.6389127", "text": "def signature\n digest = \"SHA256\"\n OpenSSL::HMAC.hexdigest(digest, signing_key, string_to_sign)\n end", "title": "" }, { "docid": "744f8f56c758ca1457a2f4be7031f30e", "score": "0.63818157", "text": "def computed_signed_info\n \n llave = CFDI::Key.new @key, @password\n\n return Base64::encode64(llave.sign(OpenSSL::Digest::SHA1.new, CGI::unescapeHTML(self.canonicalized_signed_info.gsub('<TEST/>','').gsub(/\\n/, ''))))\n \n end", "title": "" }, { "docid": "d6d0f6d764ba4533e9429d988d0fe122", "score": "0.6336022", "text": "def encode(data)\n @encryptor.encrypt_and_sign(data)\n end", "title": "" }, { "docid": "3d1c66e94ff754e013b26acfef22b5c4", "score": "0.63323814", "text": "def encode_signature(algo, signature)\n encode_string(algo) + encode_string(signature)\n end", "title": "" }, { "docid": "dbceb41d06d58d4298ff83556c04c565", "score": "0.6312279", "text": "def sign(data)\n key.dsa_sign_asn1(data)\n end", "title": "" }, { "docid": "68f7a7f53102ec6b70ef3cb056e5622b", "score": "0.63121307", "text": "def build_signature\n sig = case signature_method\n when \"HMAC-SHA1\"\n Base64.encode64(HMAC::SHA1.digest(signature_secret, signature_base_string)).chomp.gsub(/\\n/,'')\n when \"HMAC-MD5\"\n Base64.encode64(HMAC::MD5.digest(signature_secret, signature_base_string)).chomp.gsub(/\\n/,'')\n else\n false\n end\n Merb::Parse.escape(sig)\n end", "title": "" }, { "docid": "99c6e77b97532f35b97e3ee78a68ed81", "score": "0.6250662", "text": "def sign(msg)\n Digest::SHA1.hexdigest(@secret + msg)\n end", "title": "" }, { "docid": "c10043b54e6a034d33445161049a3722", "score": "0.6234139", "text": "def signed_or_encrypted; end", "title": "" }, { "docid": "8cec33cadf7c7c6dabe4f6a61bd21800", "score": "0.62279", "text": "def encode_base64(text)\n Base64.strict_encode64(text).strip\n end", "title": "" }, { "docid": "462f464c57892b4b396286e660cf84e3", "score": "0.6226497", "text": "def encrypt_and_sign(value, **options)\n create_message(value, **options)\n end", "title": "" }, { "docid": "69d1f901fdeffd148ad6ac4b05332353", "score": "0.62205064", "text": "def sign( key, data )\n blob = @buffers.writer\n blob.write_key key\n\n packet_data = @buffers.writer\n packet_data.write_string blob.to_s\n packet_data.write_string data.to_s\n packet_data.write_long 0\n\n type, reply = send_with_reply SSH2_AGENT_SIGN_REQUEST, packet_data\n if agent_failed( type )\n raise AgentError,\n \"agent could not sign data with requested identity\"\n elsif type != SSH2_AGENT_SIGN_RESPONSE\n raise AgentError, \"bad authentication response #{type}\"\n end\n\n return reply.read_string\n end", "title": "" }, { "docid": "47898a3f85b80dffa1b51f133cba65d3", "score": "0.6184799", "text": "def sign_with(secret)\n #puts \"Signing #{string_to_sign.inspect} with #{secret.inspect}\"\n digest = OpenSSL::Digest.new('sha256')\n Base64.encode64(OpenSSL::HMAC.digest(digest, secret, string_to_sign)).strip\n end", "title": "" }, { "docid": "d8f176e2be5a39dffd91a2c1b6c3b1e0", "score": "0.6180857", "text": "def sign()\n # TODO\n end", "title": "" }, { "docid": "90011556b6edf6cac7eb65bf188672b7", "score": "0.61716646", "text": "def encrypt(text)\n Base64.encode64(@public_key.public_encrypt(text)).gsub(/\\n/, \"\") if text\n end", "title": "" }, { "docid": "90011556b6edf6cac7eb65bf188672b7", "score": "0.61716646", "text": "def encrypt(text)\n Base64.encode64(@public_key.public_encrypt(text)).gsub(/\\n/, \"\") if text\n end", "title": "" }, { "docid": "96bad84289a982143835a3be32de68de", "score": "0.6168583", "text": "def string_to_sign\n [\n SIGNV4ALGO,\n date,\n credential_scope,\n Digestor.hexdigest(canonical_request)\n ].join(\"\\n\")\n end", "title": "" }, { "docid": "29e466ff8442365100f163d238b26987", "score": "0.6167471", "text": "def sign; adapter_class.new(self).sign; end", "title": "" }, { "docid": "064e6dcadde91989074781eb883f309b", "score": "0.6123288", "text": "def sign(cmd)\n \t\t\t\tiv = rand(0xffffffff).to_i.to_s(16).upcase.rjust(8,\"0\")\n \t\t\t\tdigest = Digest::MD5.hexdigest(cmd+iv).upcase\n \t\t\t\tsb = [@signature_block + digest].pack(\"h*\")\n \t\t\t\tsig = @signingkey_priv.private_encrypt(sb).unpack(\"h*\")[0].upcase\n \t\t\t\t# i haven't a clue what those numbers are on the front, 10|3|22\n \t\t\t\t\"10|3|22|#{cmd}|#{sig}|#{iv}\"\n \t\t\tend", "title": "" }, { "docid": "b8e4d12fd072b4f67309e035d648edec", "score": "0.61198676", "text": "def sign(params)\n Digest::MD5::hexdigest(wrap_with_secret sorted_option_string(params)).upcase\n end", "title": "" }, { "docid": "0cce065bfde158cce0c2f59e1f55676c", "score": "0.6114427", "text": "def signing_input=(_); end", "title": "" }, { "docid": "0cce065bfde158cce0c2f59e1f55676c", "score": "0.6114427", "text": "def signing_input=(_); end", "title": "" }, { "docid": "02cb89d210a7484ddb26ed1c7179e97d", "score": "0.6105287", "text": "def default_signer(string_to_sign)\n key = @storage_json.authorization.signing_key\n key = OpenSSL::PKey::RSA.new(@storage_json.authorization.signing_key) unless key.respond_to?(:sign)\n digest = OpenSSL::Digest::SHA256.new\n return key.sign(digest, string_to_sign)\n end", "title": "" }, { "docid": "904d2aee231fb6d00fbe8adb0ef0caec", "score": "0.60709155", "text": "def sign!(key, sign_nonce = T.unsafe(nil)); end", "title": "" }, { "docid": "b2f5428d6ea8ec432c7c6868e7fd883a", "score": "0.60655326", "text": "def text_representation\n self.signed_request[:signature].to_s\n end", "title": "" }, { "docid": "b2f5428d6ea8ec432c7c6868e7fd883a", "score": "0.60655326", "text": "def text_representation\n self.signed_request[:signature].to_s\n end", "title": "" }, { "docid": "c713d26a3cbe69ac3c418c6d07c3cbc8", "score": "0.60622585", "text": "def generate_signature\n sha1x16 = Digest::SHA1.hexdigest(signed_string)\n .tap { |s| logger.debug \"sha1x16 #{s}\" }\n enc = case form_fields['signMethod']\n when '01' # 01 means RSA\n merchant_private_key.sign(OpenSSL::Digest::SHA1.new, sha1x16)\n .tap { |s| logger.debug \"enc #{s}\" }\n else # at current time (2015-05-25) no other signing method is mentioned in Unionpay's official docs\n raise \"sign method #{form_fields['signMethod']} is not implemented yet.\"\n end\n Base64.strict_encode64(enc) # has to be strict_encode64, not encode64, as the latter as an extra '\\n'\n .tap { |s| logger.debug \"final: #{s}\" }\n end", "title": "" }, { "docid": "32a845618acbe01a6be2af207e979294", "score": "0.6055853", "text": "def signing_key; end", "title": "" }, { "docid": "43664743306574cb968eeb0f9bdac236", "score": "0.605533", "text": "def sign\n begin\n data64 = params[:data]\n data = Base64.decode64(data64)\n crypto = GPGME::Crypto.new(password: ENV[\"PASSPHRASE\"].to_s)\n signature = crypto.sign(data, signer: ENV[\"EMAIL\"].to_s, mode: GPGME::SIG_MODE_DETACH)\n render json: {\"email\": ENV[\"EMAIL\"].to_s,\n \"signature\": Base64.strict_encode64(signature.to_s)}, \n status: 200\n\n rescue => error\n render json: {\"error\": error.message},\n status: 500\n end\n end", "title": "" }, { "docid": "641895b775c842c76f1df2573ed7a8fd", "score": "0.60539985", "text": "def sign(message)\n OpenSSL::HMAC.digest('SHA256', @key, message)\n end", "title": "" }, { "docid": "e85cf324f96e0f1796ee873833e40e01", "score": "0.60512036", "text": "def sign(data, padding: nil, rng: Botan::RNG.new)\n sign = Botan::PK::Sign.new(key: self, padding: padding)\n sign << data\n sign.finish(rng)\n end", "title": "" }, { "docid": "6bb8069aa5db0c9c3a5c12624f256367", "score": "0.604871", "text": "def signed_string\n signed_data_only = form_fields.reject { |s| FIELDS_NOT_TO_BE_SIGNED.include?(s) }\n signed_data_only.sort.collect { |s| \"#{s[0]}=#{s[1]}\" }.join('&')\n .tap { |ss| logger.debug \"signed string is #{ss}\" }\n end", "title": "" }, { "docid": "845021c2a5012833d13d52b8c3c14552", "score": "0.60397404", "text": "def generate_signature(base_string)\n key = OpenSSL::HMAC.digest('sha1', client_secret, base_string)\n CGI::escape(Base64.encode64(key).chomp)\n end", "title": "" }, { "docid": "335e3385c364dce4a64e0e1d8845f7a8", "score": "0.60393953", "text": "def signature\n @signature ||= Base64.encode64(digest).gsub(\"\\n\", '')\n end", "title": "" }, { "docid": "49d43bfef4c733fbbfbee5f1d659b31d", "score": "0.60267043", "text": "def signstuff(revision, data, pkeypath)\n pkey = OpenSSL::PKey::EC.new File.read pkeypath\n\n revm = revision.match(/([0-9]+)-.+/)\n oldrev = revm[1]\n newrev = oldrev.to_i + 1\n\n signature = Base64.encode64(pkey.dsa_sign_asn1(newrev.to_s+data))\nend", "title": "" }, { "docid": "1e15dfb6a0df8c00b17d1210f78eab65", "score": "0.6015573", "text": "def sign(content, secret:)\n encoded = Base64.encode64(content)\n digest = OpenSSL::Digest.new(\"sha1\")\n OpenSSL::HMAC.hexdigest(digest, secret, encoded)\n end", "title": "" }, { "docid": "0df207491c3526b5b5d40f36c77216ba", "score": "0.60142267", "text": "def sign_payload(request_body = '')\n payload = \"#{request_body}#{shared_secret}\"\n Digest::SHA256.base64digest(payload)\n end", "title": "" }, { "docid": "8b149c40e8f1d209e0dc946f3b2bfab0", "score": "0.6009626", "text": "def sign_payload(request_body = '')\n payload = \"#{request_body}#{shared_secret}\"\n ::Digest::SHA256.base64digest(payload)\n end", "title": "" }, { "docid": "6d2d6b85b1ebdf457573799c4c188dfe", "score": "0.60079837", "text": "def signature\n subject = self.class.sig_subject([@payload,\n DATA_TYPE,\n ENCODING,\n ALGORITHM])\n @rsa_pkey.sign(DIGEST, subject)\n end", "title": "" }, { "docid": "e7694f01af36a4983c92bccc38e03be5", "score": "0.6001664", "text": "def sign(data, key, options = {})\n raise KeyError.new(\"Please provide a secret key to sign data with.\") unless key\n options = settings[:sign].merge(options)\n digest = OpenSSL::Digest.new(options[:algorithm])\n signature = OpenSSL::HMAC.digest(digest, key, data)\n encode(signature, options)\n end", "title": "" }, { "docid": "663eed511aa887d4482759102091cdf7", "score": "0.5988413", "text": "def encript(text_to_encript)\n require 'base64'\n Base64.encode64(text_to_encript)\n\nend", "title": "" }, { "docid": "e5462486407bdddfdc73b1f8dae3a128", "score": "0.5982706", "text": "def string_to_sign\n if content_type.nil?\n \"#{method.upcase}\\n#{host.downcase}\\n#{uri}#{canonicalized_params}\"\n else\n \"#{method.upcase}\\n#{body_md5}\\n#{content_type}\\n#{host.downcase}\\n#{uri}#{canonicalized_params}\"\n end\n end", "title": "" }, { "docid": "62f342b1078cd608d15930dbe4476513", "score": "0.59735113", "text": "def sign(data, key)\n hmac = OpenSSL::HMAC.new(key, OpenSSL::Digest::SHA256.new)\n hmac.update data\n hmac.digest\n end", "title": "" }, { "docid": "cab810c33e8f6748ded9f3f358e4749e", "score": "0.597232", "text": "def encrypt(text_to_encrypt, base64_encode=true)\n encrytped = public_key.public_encrypt(text_to_encrypt)\n base64_encode ? Base64UrlSafe.encode(encrytped) : encrytped\n end", "title": "" }, { "docid": "abb1c7c339f3cfcf4b6608574f1a45f3", "score": "0.5969994", "text": "def sign(text)\n signature = Digest::MD5.hexdigest([text, 'Hello from Events 2'].join)[0...SIGNATURE_LENGTH]\n [text,signature].join\n end", "title": "" }, { "docid": "781335ee1597596882e69216c4215bf5", "score": "0.59697", "text": "def signature_key; end", "title": "" }, { "docid": "a0cf3390fafcd29711c000af88921668", "score": "0.5951469", "text": "def sign_and_encrypt_encapsulated(message)\n sign(message)\n encrypt(message)\n end", "title": "" }, { "docid": "1e8731db659198cfdabdd3ce0206518b", "score": "0.5945752", "text": "def sign(secret_key_base, salt, data, options = {})\n encoded = encode(data, options)\n key = get_secret(secret_key_base, salt, options)\n MessageVerifier.sign(encoded, key)\n end", "title": "" }, { "docid": "4c1886fd19a1dcf0a2983c1a5b816688", "score": "0.5941481", "text": "def sign(params)\n string = params_to_string(params)\n\n case @sign_type\n when 'RSA'\n ::Alipay::Sign::RSA.sign(@app_private_key, string)\n when 'RSA2'\n ::Alipay::Sign::RSA2.sign(@app_private_key, string)\n else\n raise \"Unsupported sign_type: #{@sign_type}\"\n end\n end", "title": "" }, { "docid": "62ee5408c36cceb9b48c01939735bdbf", "score": "0.59259325", "text": "def createsignature(str)\r\n signature_raw = sign(str)\r\n signature_der = ECDSA::Format::SignatureDerString.encode(signature_raw)\r\n signature_der_b64 = Base64.strict_encode64(signature_der) \r\n digest_raw = Digest::SHA256.digest(str)\r\n digest_b64 = Base64.encode64(digest_raw)\r\n #Base64 encoding was used due to the readablility, and transportability. \r\n puts(\"Signature (b64 encoded der): \"+signature_der_b64)\r\n puts(\"Digest (b64 endoded): \"+digest_b64)\r\n $signature_array.push(signature_der_b64)\r\n $digest_array.push(digest_b64)\r\n #return signature_der_b64\r\nend", "title": "" }, { "docid": "13df3f0747b3f43b83dd24dcbee99ecc", "score": "0.5923258", "text": "def get_secure_signature(message)\n digest = OpenSSL::Digest.new('SHA256')\n Base64.strict_encode64(private_key.sign(digest, message))\n end", "title": "" }, { "docid": "8f081ac89acc33670b74e3bc9287d893", "score": "0.5918023", "text": "def encode(str)\n CGI::escape(Base64.encode64(hmac_sha1_digest(@aws_secret_access_key, str)).strip)\n end", "title": "" }, { "docid": "749a81120a3189002283f36deda12e30", "score": "0.5916632", "text": "def sign\n write_attr('mid', SecureRandom.uuid)\n write_attr('ts', Time.now.utc.to_i)\n canonical_msg = self.canonicalize\n\n #priv_key = OmfCommon::Key.instance.private_key\n #digest = OpenSSL::Digest::SHA512.new(canonical_msg)\n\n #signature = Base64.encode64(priv_key.sign(digest, canonical_msg)).encode('utf-8') if priv_key\n #write_attr('digest', digest)\n #write_attr('signature', signature) if signature\n\n if OmfCommon::Measure.enabled?\n MPMessage.inject(Time.now.to_f, operation.to_s, mid, cid, self.to_s.gsub(\"\\n\",''))\n @@mid_list << mid\n end\n self\n end", "title": "" }, { "docid": "72b337cb841ea6bfe6a7ba046061bb7c", "score": "0.59067404", "text": "def encode h\n return h.init_data if h.vanila?\n str = h.to_json\n str = @cipher_key ? cipher(str) : encode64(str)\n digest = @dss.digest str\n return h.init_data if digest == h.init_digest\n\n sig = @dsa.syssign digest\n \"#{encode64 sig}/#{str}\"\n end", "title": "" }, { "docid": "bfc5cc1494dcba186b1526aad4290865", "score": "0.59025496", "text": "def base64_encode(string)\n SSL.base64_encode(string)\n end", "title": "" }, { "docid": "bfc5cc1494dcba186b1526aad4290865", "score": "0.59025496", "text": "def base64_encode(string)\n SSL.base64_encode(string)\n end", "title": "" }, { "docid": "369d18a1b311215713cc5805e9a9cde1", "score": "0.5893271", "text": "def signing_key\n [percent_encode(@secret), percent_encode(@token)].join('&')\n end", "title": "" }, { "docid": "fb2e665e38e8e04c567aaa3667d4be5c", "score": "0.58829033", "text": "def to_s\n signed = (signed_at || Time.now).to_i.to_s\n\texpires = expires_at.to_i.to_s\n\tsignature = \"#{public_key}#{expires}#{signed}#{action}\"\n\ttoken = OpenSSL::HMAC.hexdigest DIGEST, secret, signature\n\tencoded_token = Base64.encode64(token)\n\tencoded_token.gsub! /\\n/, ''\n\tparams = [ encoded_token, public_key, expires, signed ].join SEPARATOR\n\tBase64.encode64(params).gsub(/\\n/, '')\n end", "title": "" }, { "docid": "aef509d7fb32279d869ccc7334d47d99", "score": "0.58779377", "text": "def signature_for(data, secret)\n Base64.encode64(hmac_sha256(data, secret)).strip\n end", "title": "" }, { "docid": "906b8906b731e6c3d55a32a07e18e196", "score": "0.5874664", "text": "def generate_signature(string_to_sign)\n digest = OpenSSL::Digest.new('sha256')\n OpenSSL::HMAC.hexdigest(digest, @api_secret, string_to_sign)\n end", "title": "" }, { "docid": "4a2680f2be10731a881b20e507c93c02", "score": "0.58713645", "text": "def gen_sig(mac, params)\n signed = params[\"signed\"].split(\",\").map {|k| [k, params[k]]}\n base64_encode(Signatures.sign(mac, kv_encode(signed)))\n rescue Signatures::NotFound\n nil\n end", "title": "" }, { "docid": "b980e1b7ff08620fc66d7de12858daa4", "score": "0.5869967", "text": "def sign( identity, data )\n info = find_identity( identity )\n\n if info[:key].nil? && info[:from] == :file\n begin\n info[:key] = @keys.load_private_key( info[:file] )\n rescue Exception => e \n raise UserKeyManagerError,\n \"the given identity is known, \" +\n \"but the private key could not be loaded \" +\n \"(#{e.message} [#{e.class}])\"\n end\n end\n\n if info[:key]\n sig_blob = @buffers.writer\n sig_blob.write_string identity.ssh_type\n sig_blob.write_string info[:key].ssh_do_sign( data.to_s )\n return sig_blob.to_s\n end\n\n if info[:from] == :agent\n raise UserKeyManagerError,\n \"the agent is no longer available\" unless @agent\n return @agent.sign( identity, data.to_s )\n end\n\n raise UserKeyManagerError,\n \"[BUG] can't determine identity origin (#{info.inspect})\"\n end", "title": "" }, { "docid": "6be57ac3699d3904252e1993ef9af21c", "score": "0.5866313", "text": "def sign(private_key)\n # Our multiline hash for authorization will be encoded in multiple header\n # lines - X-Ops-Authorization-1, ... (starts at 1, not 0!)\n header_hash = {\n \"X-Ops-Sign\" => SIGNING_DESCRIPTION,\n \"X-Ops-Userid\" => user_id,\n \"X-Ops-Timestamp\" => canonical_time,\n \"X-Ops-Content-Hash\" => hashed_body,\n }\n\n string_to_sign = canonicalize_request\n signature = Base64.encode64(private_key.private_encrypt(string_to_sign)).chomp\n signature_lines = signature.split(/\\n/)\n signature_lines.each_index do |idx|\n key = \"X-Ops-Authorization-#{idx + 1}\"\n header_hash[key] = signature_lines[idx]\n end\n \n Mixlib::Authentication::Log.debug \"String to sign: '#{string_to_sign}'\\nHeader hash: #{header_hash.inspect}\"\n \n header_hash\n end", "title": "" }, { "docid": "003b4c6c6cea9c8a1b9a54e39beaa90c", "score": "0.5865601", "text": "def aws_sign(key, data)\n OpenSSL::HMAC.digest(\"SHA256\", key, data)\n end", "title": "" }, { "docid": "902fe3646a2b0d37f7689c47b9d7a161", "score": "0.5859178", "text": "def string_to_sign\n [\n http_method,\n headers.values_at('content-md5', 'content-type').join(\"\\n\"),\n signing_string_date,\n canonicalized_headers,\n canonicalized_resource,\n ].flatten.compact.join(\"\\n\")\n end", "title": "" }, { "docid": "623a0c64c797b85a077ab920989e2b8b", "score": "0.5847007", "text": "def to_encrypted_string\n self.class.send(:encryptor).encrypt_and_sign to_hash\n end", "title": "" }, { "docid": "fe67cb347d13989b6256df852b26c31d", "score": "0.58464044", "text": "def sign(signed_data, algo: nil)\n algo ||= self.algo\n raise AlgorithmError unless algo == self.algo\n openssl_sig = openssl.sign(public_key.digest.new, signed_data)\n raw_sig = PublicKey::ECDSA.ssh_signature(openssl_sig)\n Encoding.encode_signature(algo, raw_sig)\n end", "title": "" }, { "docid": "41a15921bd2c58c25dfd71e7a76dfdcb", "score": "0.5822351", "text": "def verify_signature(signature, signed_text, base64_encoded=true)\n sig = base64_encoded ? Base64UrlSafe.decode(signature) : signature\n self.public_key.verify(OpenSSL::Digest::SHA256.new, sig, signed_text)\n end", "title": "" }, { "docid": "5a1c814bbc74fcbd61a6d54484bdeef1", "score": "0.5818775", "text": "def sign(message)\n Ed25519.provider.sign(@keypair, message)\n end", "title": "" }, { "docid": "e8e2f701dc7275378b7c4e72e3b279fc", "score": "0.58156985", "text": "def s3_sign(s3_policy)\n Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha1'), S3Uploader.config.access_key, s3_policy)).gsub(/\\n/, '')\n end", "title": "" }, { "docid": "51ac351625e2533f52e9747e7995fd35", "score": "0.58098966", "text": "def sign(str, secret)\n OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new(\"sha256\"), secret, str)\n end", "title": "" }, { "docid": "3ffee3be2d9cd8a35a6ab49fdc33a7fd", "score": "0.5807784", "text": "def encode\n ::Base64.encode64(@string)\n end", "title": "" }, { "docid": "b71bbb75e9fb9c1101b35ff38070ae27", "score": "0.58049464", "text": "def sign string\n raise Chimps::AuthenticationError.new(\"No Catalog API secret stored in #{Chimps.config[:config]} or #{Chimps.config[:site_config]}. Set Chimps.config[:catalog][:secret].\") unless (authenticable? || @forgive_authentication_error)\n require 'digest/md5'\n Digest::MD5.hexdigest(string + Chimps.config[:catalog][:secret])\n end", "title": "" }, { "docid": "e631a60311ed824f9e0999345a106f43", "score": "0.5800797", "text": "def signature\n # Remove 'sha_sign' key from request params and concatenate all\n # key value pairs\n params = payload.to_h\n .reject { |key, value| key == :sha_sign }\n .reject { |key, value| value == '' || value == false }.sort\n .map { | key, value| \"#{key}=#{value}#{passphrase}\" }.join\n\n # Calculate SHA512 and upcase all letters, since Digistore will\n # also return upcased letters in the signature.\n Digest::SHA512.hexdigest(params).upcase\n end", "title": "" }, { "docid": "03c112b5ab8d89f17e5c4f328a48d70e", "score": "0.5798385", "text": "def string_to_sign\n [\n \"AWS4-HMAC-SHA256\",\n request_timestamp,\n credential_scope,\n digest.hexdigest(canonical)\n ].join(\"\\n\")\n end", "title": "" }, { "docid": "069be7d812d65ce880d7f0a42c7170fc", "score": "0.5795668", "text": "def sign!\n @signed_date_time = Time.now.utc.strftime('%Y-%m-%dT%H:%M:%SZ')\n @signature = Cybersource::Security.generate_signature(signed_data)\n\n self\n end", "title": "" }, { "docid": "76d40962b13362b6c2a4d3773069dc19", "score": "0.5795278", "text": "def public_key\n # Base64 encode without line feeds\n Base64.strict_encode64(public_key_raw)\n end", "title": "" }, { "docid": "950aa5404e4e10bbd257c2e46ddd8edb", "score": "0.5789096", "text": "def sign(payload)\n payload = payload.merge({\n :client_id => @client_id,\n :client_secret => @client_secret,\n })\n\n scope = create_scope\n context = create_context(payload)\n s2s = create_string_to_sign(scope, context)\n signing_key = get_signing_salt\n OpenSSL::HMAC.hexdigest(@hash_algo, signing_key, s2s)\n end", "title": "" }, { "docid": "3cfde8cbe860bcf632d985d622d0ae42", "score": "0.57868385", "text": "def encrypt(str)\n return nil if @key_id.empty?\n # The option --trust-model always omits the requirement for you to type y about trusting this key.\n result = IO.popen(\"gpg --trust-model always -e -a -r #{@key_id}\", \"r+\") do |pipe|\n pipe.write(str)\n pipe.close_write\n pipe.read\n end\n result[/-----BEGIN PGP MESSAGE-----/] ? result : nil\n end", "title": "" } ]
e3ded68faa959d5349ef358cc921528c
The Add Subscription endpoint registers the application to send notifications when the user Fitbit data changes. The endpoint response includes a summary of the subscription
[ { "docid": "c056c6dd39dc331525f6ead3ba20a205", "score": "0.60885394", "text": "def add_subscription(user_id: '-', collection_path: nil, subscription_id: nil)\n raise StandardError if !subscription_id\n if collection_path\n return post(\"#{API_URI}/#{SUBSCRIPTION_API_VERSION}/user/#{user_id}/#{collection_path}/apiSubscriptions/#{subscription_id}.json\")\n else\n return post(\"#{API_URI}/#{SUBSCRIPTION_API_VERSION}/user/#{user_id}/apiSubscriptions/#{subscription_id}.json\")\n end\n end", "title": "" } ]
[ { "docid": "0e32a468b1ba5f969d8d94570fb20d47", "score": "0.71150523", "text": "def registerSubscription\n require 'json'\n\n if (@role.nil? or !(@role.subscriptions_permissions)) and !current_actor.superadmin\n json_response({ message: \"You don't have permission to register subscriptions in this project\" }, :unauthorized)\n return\n end\n\n service_id = @subscription.service_id\n service = Service.find(service_id)\n\n # Prepare subscription JSON\n subscriptionJSON = {\n 'description' => @subscription.description,\n 'subject' => JSON.parse(@subscription.subject),\n 'notification' => JSON.parse(@subscription.notification),\n 'throttling' => @subscription.throttling\n }\n\n # Add expiration unless is 'never'\n if @subscription.expires != 'never'\n subscriptionJSON[\"expires\"] = @subscription.expires\n end\n\n # Send it to context broker endpoint for Subscriptions\n # TODO: Move path in configuration elsewhere\n serviceURI = service.endpoint+\":1026/v2/subscriptions\"\n\n begin\n response = RestClient.post(\n serviceURI,\n subscriptionJSON.to_json,\n 'Content-Type' => 'application/json'\n )\n # Update sub ID if successful and set as active\n subId = URI(response.headers[:location]).path.split('/').last\n @subscription.update(status: \"active\", subscription_id: subId)\n json_response({subId: subId}, :created)\n rescue RestClient::ExceptionWithResponse => e\n # If error, report to the client\n json_response({message: e.response}, :unprocessable_entity)\n end\n end", "title": "" }, { "docid": "c2e343b09091881b8c59526d8cea7cc4", "score": "0.6847397", "text": "def add(subscription)\n @subscriptions << subscription\n end", "title": "" }, { "docid": "7634a5768c1518868e05bf4cd50f1c5d", "score": "0.68288875", "text": "def subscribe\n @current_user.update!(\n endpoint: params[:subscription][:endpoint],\n p256dh: params[:subscription][:keys][:p256dh],\n auth: params[:subscription][:keys][:auth],\n alerts: true,\n )\n end", "title": "" }, { "docid": "eb39173fe5857aec4b8bf3774ff44a75", "score": "0.6772426", "text": "def add_subscription(user_id, app_id)\n # Create a subscription to tie the user and the app.\n subscription = Subscription.create(user_id: user_id, application_id: app_id)\n # Create a service data to specify the notification service.\n servicedata = ServiceData.create(user_id: user_id, push_client: \"mail\")\n # Add servicedata to the subscription.\n subscription.service_data_id = servicedata.id\n subscription.save!\n end", "title": "" }, { "docid": "4d72a974811703b1d7e3d507b7fb1f03", "score": "0.65718573", "text": "def subscribe(example_subscription)\n user_subs.create(subscription_id: example_subscription.id)\n end", "title": "" }, { "docid": "7b006e3f6c50ff7086783bf53530d2b3", "score": "0.65583515", "text": "def subscribed(subscription)\n if subscription && subscription.subscription == :subscribed\n puts \"Subscribe successful.\"\n else\n puts \"Subscribe failed!\"\n end\n end", "title": "" }, { "docid": "c0ffeb0e61a9a2378f9aa823286d2aa3", "score": "0.65441793", "text": "def subscribe(sub)\n active_subscriptions.create(sub_id: sub.id)\n end", "title": "" }, { "docid": "a4cfeb937ab622d935b12b042e97fa4e", "score": "0.6496994", "text": "def create\n @subscription = Subscription.new(subscription_params)\n if require_org?\n org = Organization.create(name: org_name)\n current_user.update!(type: 'OrgnaizationTenant', organization_id: org.id)\n @subscription.organization_id = org.id\n else\n @subscription.frequancey = 'Monthly'\n end\n @subscription.user_id = current_user.id\n @subscription.status = 'active'\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to root_path, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { redirect_to plans_path, notice: 'Fail to Subscribe' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1bcf21f3fbb6594447d56d2291bfb39d", "score": "0.64750594", "text": "def push_new_subscription\n notification = Hash.from_xml(request.body())\n render :text => \"Request accepted.\"\n if notification.has_key?('new_subscription_notification')\n account_code = notification['new_subscription_notification']['account']['account_code']\n sub_code = notification['new_subscription_notification']['subscription']['uuid']\n plan_code = notification['new_subscription_notification']['subscription']['plan']['plan_code']\n @uuid = notification['new_subscription_notification']['subscription']['uuid']\n logger.info \"Recurly push notification: new_subscription_notification for account #{account_code}\"\n # because in the signup process the customer could technically make more than one subscription saved to the database\n # using .last to target the last one they created >> the subscription they intended to checkout with\n new_subscription = Subscription.where(:user_id => account_code, :subscription_frequency => plan_code).last\n new_subscription.active unless new_subscription.nil?\n new_subscription.uuid = @uuid\n new_subscription.save\n # end\n end\n rescue Recurly::Resource::NotFound => e\n logger.error \"Recurly: #{e.message}\"\n rescue ActiveRecord::RecordNotFound => e\n logger.error \"Customer record not found: #{e.message}\"\n end", "title": "" }, { "docid": "5b6f7d8b8dffcc9c7495809551846b0f", "score": "0.6464545", "text": "def web_hooks_add_web_hook_subscriptions_with_http_info(new_web_hook_subscription, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: WebHooksApi.web_hooks_add_web_hook_subscriptions ...\"\n end\n # verify the required parameter 'new_web_hook_subscription' is set\n if @api_client.config.client_side_validation && new_web_hook_subscription.nil?\n fail ArgumentError, \"Missing the required parameter 'new_web_hook_subscription' when calling WebHooksApi.web_hooks_add_web_hook_subscriptions\"\n end\n # resource path\n local_var_path = \"/api/WebHookSubscriptions\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/json', 'application/xml', 'text/xml', 'application/x-www-form-urlencoded'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(new_web_hook_subscription)\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Object')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: WebHooksApi#web_hooks_add_web_hook_subscriptions\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "bcf1fb39188b8e8aa19707f16ba9c9f6", "score": "0.6464186", "text": "def add(connection, options = {})\n subscription_succeeded(connection, options)\n end", "title": "" }, { "docid": "4509aa06b0d64d3e56179b4ba6449ee8", "score": "0.6454026", "text": "def subscribe\n api_result = try_api { PaymentGateway.subscribe }\n if api_result == :success\n update_attributes(subscription_plan: \"monthly\")\n end\n api_result\n end", "title": "" }, { "docid": "78f1660ccff3a490760d95770d4bc05d", "score": "0.6448121", "text": "def subscribe\n @subscription.add_subscription self.class\n end", "title": "" }, { "docid": "2bac9661fba7b012cae3376bfc2c4474", "score": "0.6429918", "text": "def create_subscription(options = {})\n build_response(make_request(:post, url: 'subscriptions', options: options))\n end", "title": "" }, { "docid": "c11a8d450f49c16bfeba2ebe5b487433", "score": "0.6408398", "text": "def subscribe_for_notification()\n begin\n eventFilters = ['/restapi/v1.0/account/~/extension/~/message-store/instant?type=SMS']\n bodyParams = {\n eventFilters: eventFilters,\n deliveryMode: {\n transportType: 'WebHook',\n address: DELIVERY_ADDRESS\n },\n expiresIn: 3600\n }\n endpoint = \"/restapi/v1.0/subscription\"\n resp = $platform.post(endpoint, payload: bodyParams)\n if (resp.status == 200)\n puts (resp.body)\n puts (\"Subscription id: \" + resp.body['id'])\n puts (\"Ready to receive incoming SMS via WebHook.\")\n else\n puts (\"Webhook creation failed.\")\n puts (resp.body)\n end\n rescue StandardError => e\n puts e\n end\nend", "title": "" }, { "docid": "896e75152d485226b2954e1cb3d30500", "score": "0.63974476", "text": "def insert_subscription\n # Called to insert a new subscription.\n callback = \"#{request.protocol}#{request.host_with_port}/users/notify_callback?\"+ params[:subscriptionId].to_s \n puts callback\n\n begin\n puts \"-SUBSUB----\"\n credentials = refesh_tooken()\n @mirror = MirrorClient.new(credentials)\n\n @mirror.insert_subscription(session[:user_id], params[:subscriptionId], callback)\n puts \"Subscribed to #{params[:subscriptionId]} notifications.\"\n rescue\n puts \"Could not subscribe because the application is not running as HTTPS.\"\n end\n \n render text: \"OK DONE\"\n\n end", "title": "" }, { "docid": "999fb1d89558ad4c3ee95f170328593f", "score": "0.63840044", "text": "def subscribe\n @subscription.subscribe(with_email_subscription: params[:with_email_subscription].to_s.to_boolean(true),\n with_optional_targets: params[:with_optional_targets].to_s.to_boolean(true))\n return_back_or_ajax\n end", "title": "" }, { "docid": "bfdf960e06879cde4484e2846d613654", "score": "0.6372836", "text": "def create_subscription(param)\n if param == nil\n raise ArgumentError, \"parameter subscription cannot be blank\"\n end\n\n request_with_logging(:post, config.api_host + \"/v1/subscriptions\", param)\n end", "title": "" }, { "docid": "8ade7716a1aa77df7e73d9a6d0764d56", "score": "0.6360488", "text": "def create(subscription, options = {})\n body = options.has_key?(:body) ? options[:body] : {}\n body[:subscription] = subscription\n\n response = @client.post \"/api/subscriptions\", body, options\n\n return response\n end", "title": "" }, { "docid": "2907e7da3f71a1d3102adf692a7e27c7", "score": "0.63333845", "text": "def create_subscription_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NotificationsApi.create_subscription ...\"\n end\n # resource path\n local_var_path = \"/subscriptions\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'subscription'])\n auth_names = ['api_key']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NotificationsApi#create_subscription\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "7fc8fe0cf5ec2153a269f0c5a6cf7cfe", "score": "0.6311918", "text": "def save_subscription(subscription)\n @user.subscriptions.each do |sub|\n sub.update(status: nil)\n end\n sub = Subscription.new(subscription_params)\n sub.status = 'active'; sub.subscription_tok = subscription.id; sub.description = \"New subscription against plan #{params[:plan_id]}\";\n sub.user = @user; sub.order_no = rand(10 ** 10)\n sub.plan = Plan.find_by_plan_tok(params[:plan_tok])\n sub.coupon = params[:coupon_token] if params[:coupon_token].present? && Coupon.find_by_token(params[:coupon_token]).present?\n if sub.save\n render json: { order_no: sub.order_no, message: 'Your subscription has been set up and Power Box is on its way, you will receive an email shortly with your order details...!' }, status: 200\n else\n render json: sub.errors.messages, status: 400\n end\n SubscriptionMailer.subscribe(@user, sub).deliver\n end", "title": "" }, { "docid": "3982ff68d37880ddc498fbabe4e38eba", "score": "0.6308886", "text": "def add_custom_subscription(options = {})\n query = set_query(options)\n query[:recurring] = 'add_subscription'\n query[:type] = 'recurring'\n query[:plan_payments] ||= '0'\n require_fields(:plan_payments, :plan_amount) # day_frequency, #month_frequency 1-24, # day_of month 1-31\n response = post query\n end", "title": "" }, { "docid": "3fe319d43358a3402ef0ddc4f4facd81", "score": "0.630855", "text": "def create(**options, &block)\n call(\n method: :post,\n path: \"/subscriptions\",\n data: options,\n &block\n )\n end", "title": "" }, { "docid": "e879c65e9e7df16755b5c64584bb5db5", "score": "0.6308099", "text": "def subscribe\n url = GoCardless.new_subscription_url(\n amount: \"10\",\n interval_unit: \"month\",\n interval_length: 1,\n name: \"Sample subscription\"\n )\n redirect_to(url)\n end", "title": "" }, { "docid": "7f68cfaaac9ce7302b32286011fbef86", "score": "0.6294904", "text": "def associate_subscription(subscription)\n self.subscriptions << subscription\n\n self.save\n end", "title": "" }, { "docid": "b796f4abf18d172f9ae55d39b3495524", "score": "0.6281071", "text": "def create_subscription_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: StoreSubscriptionsApi.create_subscription ...\"\n end\n # resource path\n local_var_path = \"/subscriptions\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'subscription_resource'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SubscriptionResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: StoreSubscriptionsApi#create_subscription\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "4fa71e462746f86d950d603d4f87f179", "score": "0.62577647", "text": "def subscribe(subscription)\n Customer.transaction do\n update(:subscription => subscription)\n response = setup_recurring_payment\n end\n end", "title": "" }, { "docid": "73b45b8293c4826f094b443fa4ae2967", "score": "0.6232803", "text": "def update_subscription(options={})\n self.class.post(\"/subscriptions/update.json\", :body => options)\n end", "title": "" }, { "docid": "404153c2cfe8914aa901d0edb85a0f30", "score": "0.6228958", "text": "def create\n @subscription = @user.subscriptions.new(subscription_params)\n if @subscription.save\n render json: @subscription\n else\n render json: { error: @subscription.errors }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "09df97ad40adc3c96303bd2aa0b5194e", "score": "0.6225721", "text": "def create_subscription(data)\r\n Subscription.new.create(data)\r\n end", "title": "" }, { "docid": "368a91452a7a84d7b63e4ddadad82439", "score": "0.6220336", "text": "def create\n @target.create_subscription(subscription_params)\n return_back_or_ajax\n end", "title": "" }, { "docid": "b91a38b181c02079c5e44dc12c399931", "score": "0.6215927", "text": "def build_subscription\n self.subscription = Subscription.create\n self.subscription.subscribe!\n end", "title": "" }, { "docid": "94ce75cedabe19e4fc7d81a4f5efbd74", "score": "0.62130797", "text": "def new_subscription(subscriber)\n @subscriber = subscriber\n\n mail to: \"you@yourapp.com\", subject: \"New Subscriber\"\n end", "title": "" }, { "docid": "9f2160eecbc61d2563ad48efbcfcb53d", "score": "0.61810285", "text": "def subscribe\n \n end", "title": "" }, { "docid": "72155baff317834f16c718b99be46dee", "score": "0.61782086", "text": "def create\n unless @subscription\n subscription = current_user.create_subscription(subscription_params)\n render json: subscription and return\n end\n\n data = {\n error: 'subscription already exists for this user.'\n }\n render json: data, status: :unprocessable_entity\n end", "title": "" }, { "docid": "33318ef3c5a320838370a50aab58e7f4", "score": "0.61764187", "text": "def new\n @subscription = Subscription.new\n respond_with(@subscription)\n end", "title": "" }, { "docid": "4dd54af3128744b8d76701a38d56d783", "score": "0.6172467", "text": "def push_subscriptions(options = {})\n get('push_subscriptions', options).map do |row|\n Strava::Webhooks::Models::Subscription.new(row)\n end\n end", "title": "" }, { "docid": "a1837d416ef71266a14917daeee02cab", "score": "0.6172272", "text": "def add_subscription_to_plan(options = {})\n query = set_query(options)\n query[:recurring] = 'add_subscription'\n query[:type] = 'recurring'\n require_fields(:plan_id) # day_frequency, #month_frequency 1-24, # day_of month 1-31\n response = post query\n end", "title": "" }, { "docid": "86d8b7ead64692a61af6aae0e34e445d", "score": "0.61655843", "text": "def save_subscription(subscription, user)\n @user = user\n @user.subscriptions.each do |sub|\n sub.update(status: nil)\n end\n sub = Subscription.new(subscription_params)\n sub.status = \"active\"; sub.subscription_tok = subscription.id; sub.description = \"New subscription against plan #{params[:plan_id]}\"\n sub.user = @user; sub.order_no = rand(10 ** 10)\n sub.plan = Plan.find_by_plan_tok(params[:plan_tok])\n sub.coupon = params[:coupon_token] if params[:coupon_token].present? && Coupon.find_by_token(params[:coupon_token]).present?\n if sub.save\n # SubscriptionMailer.subscribe(@user, sub).deliver\n render json: { user_id: @user.id, token: @user.authentication_token, order_no: sub.order_no, message: \"Your subscription has been set up and Power Box is on its way, you will receive an email shortly with your order details...!\" }, status: 200\n else\n render json: sub.errors.messages, status: 400\n end\n end", "title": "" }, { "docid": "e35e518f169ddda6cf18de890aeaba85", "score": "0.6164841", "text": "def subscribe\n api_result = try_api { PaymentGateway.subscribe }\n if api_result == :success\n self.subscription = :monthly_plan\n end\n api_result\n end", "title": "" }, { "docid": "52d963ec4992157835d8b71664e27ebe", "score": "0.61638373", "text": "def create_with_http_info(app_id, subscription_create_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SubscriptionsApi.create ...'\n end\n # verify the required parameter 'app_id' is set\n if @api_client.config.client_side_validation && app_id.nil?\n fail ArgumentError, \"Missing the required parameter 'app_id' when calling SubscriptionsApi.create\"\n end\n # verify the required parameter 'subscription_create_request' is set\n if @api_client.config.client_side_validation && subscription_create_request.nil?\n fail ArgumentError, \"Missing the required parameter 'subscription_create_request' when calling SubscriptionsApi.create\"\n end\n # resource path\n local_var_path = '/webhooks/v3/{appId}/subscriptions'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])\n # 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(subscription_create_request) \n\n # return_type\n return_type = opts[:return_type] || 'SubscriptionResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || ['hapikey']\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: SubscriptionsApi#create\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c4b489ddb7439c173192a00442876ed9", "score": "0.6162633", "text": "def create\n @subscription = Subscription.new(params[:subscription])\n @subscription.subscriber = @user\n @subscription.save\n respond_with(@subscription)\n end", "title": "" }, { "docid": "2a65ec9fed831ccc9a7157367cc7e7fd", "score": "0.61619806", "text": "def _add_subscription(subscription)\n @receivers[subscription.subscriber] ||= begin\n _log.info { \"watch service loop: adding subscription for '#{subscription.subscriber}\" }\n Receive.new(subscription, @max_events).start\n end\n end", "title": "" }, { "docid": "f872d1d1dc09fb0d2cb1509760dec05e", "score": "0.61579895", "text": "def subscribe(event)\n\t\tsubscriptions.create(event_id: event.id)\n\tend", "title": "" }, { "docid": "ca47c48b69d838563f0b0da8cc88a0fc", "score": "0.6155999", "text": "def add_subscriber(subscriber)\n data = aos.req(\"v1/mailinglists/#{self.data(:id)}/subscriptions/#{subscriber.data(:id)}\", :post)\n res = data.fetch(:json)\n\n if res[\"Message\"] == \"Succesfully created Subscription\"\n res[\"Result\"].to_i > 0\n else\n ApsisOnSteroids::Errors::InvalidResponse.error(\n message: \"Unexpected result: '#{res[\"Result\"]}'.\",\n response: data.fetch(:response)\n )\n end\n end", "title": "" }, { "docid": "80eb9baf48f794ed948473c0f4ec4f30", "score": "0.6155339", "text": "def subscribe(subscribed_user)\n active_subscriptions.create(subscribed_id: subscribed_user.id)\n end", "title": "" }, { "docid": "35992f53e1f412948ea2580cd4a8991d", "score": "0.61512405", "text": "def subscribe\n end", "title": "" }, { "docid": "0da15ddc07e03d2473015eeb1488c3cd", "score": "0.6151016", "text": "def push_api_subscriptions\n response = connection.get(\"push_api_subscriptions\")\n return_error_or_body(response)\n end", "title": "" }, { "docid": "9e9700e200f10b276da117ce499c0342", "score": "0.6147016", "text": "def subscribe\n end", "title": "" }, { "docid": "31373ba95df846944a98bc7889998ee2", "score": "0.61410946", "text": "def subscribe\n @subscribe = Subscribe.new\n end", "title": "" }, { "docid": "26013b60bb495ab8755682eb0295c3f6", "score": "0.6140985", "text": "def add(url)\n @api.post_link 'api/0/subscription/edit', :s => \"feed/#{url}\" , :ac => :subscribe \n update\n end", "title": "" }, { "docid": "5136dd101ca95b88aa3c2b17bbc62c1e", "score": "0.6130306", "text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to root_path, notice: 'You have successfully subscribed to Pixie!' }\n format.json { render action: 'show', status: :created, location: @subscription}\n else\n format.html { render action: 'new', notice: 'You have not subscribed to Pixie yet!' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "739675ee404c10b6efd0607e58e75229", "score": "0.61244845", "text": "def add_subscription(plan:, dmp_id:)\n client = api_client\n path = callback_path\n Rails.logger.warn 'DMPHubService - No ApiClient defined!' if client.blank?\n return nil unless plan.present? &&\n dmp_id.present? &&\n path.present? &&\n client.present?\n\n Subscription.create(\n plan: plan,\n subscriber: client,\n callback_uri: format(path, dmp_id: dmp_id.gsub(%r{https?://doi.org/}, '')),\n updates: true,\n deletions: true,\n last_notified: Time.zone.now\n )\n end", "title": "" }, { "docid": "1ce224f3c4bae4b61d32fd1dd66b22dc", "score": "0.6124451", "text": "def subscribe\n if current_user.subscription?\n current_user.subscription = false\n else\n current_user.subscription = true\n end\n\n if current_user.save\n if current_user.subscription?\n flash[:notice] = \"You have successfully subscribed!\"\n redirect_to root_path\n else\n flash[:alert] = \"You are now unsubscribed.\"\n redirect_to root_path\n end\n else\n flash[:warning] = \"There was an error. Please try again.\"\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "bf93eb7de5912a92b4db505b71ebac3f", "score": "0.6096102", "text": "def create\n @subscription = Subscription.new(subscription_params)\n\n if @subscription.save\n render :show, status: :created, location: @subscription\n else\n render json: @subscription.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "9fb2462635ff85b8d1c4ed1751d2dcf5", "score": "0.6078853", "text": "def subscribe(action: :sub, skip_initial_defaults: false)\n client.post(\n '/api/subscribe',\n sr_name: read_attribute(:display_name),\n action: action,\n skip_initial_defaults: skip_initial_defaults\n )\n end", "title": "" }, { "docid": "1ffea0eacd219ca7018a005039438ab5", "score": "0.60668224", "text": "def create\n ActiveRecord::Base.transaction do\n begin\n @subscription = Subscription.new(subscription_params) \n \n if @subscription.save\n respond_with(@subscription, location: subscriptions_path, notice: 'Thank you for subscribing!')\n else\n respond_with(@subscription)\n end\n rescue Paymill::PaymillError => e\n respond_with(e, location: :back, notice: e.message)\n rescue Paymill::APIError => e\n respond_with(e, location: :back, notice: e.message)\n rescue Paymill::AuthenticationError \n respond_with(e, location: :back, notice: e.message)\n end\n end\n end", "title": "" }, { "docid": "9b1085d74bf31475e18f89757deec3d3", "score": "0.6064201", "text": "def new_subscription()\n Subscription.new(self)\n end", "title": "" }, { "docid": "06609ab0c05aef4841040dbe6e621301", "score": "0.6062503", "text": "def create_subscription(subscription_id, collection_path = nil)\n post(\"#{subscriptions_path(collection_path)}/#{subscription_id}.json\")\n end", "title": "" }, { "docid": "53eb3a3c3738a6d9bed46c6ead185897", "score": "0.60530734", "text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n flash[:success] = 'Subscription was successfully created.'\n format.html { redirect_to @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a334c549f8f8c3a19d33d156631469b7", "score": "0.60521185", "text": "def add_subscription(user_id, type, auth_token)\n sig_options = {\n :user_id => user_id,\n :type => type,\n :auth_token => auth_token,\n :method => \"vimeo.people.addSubscription\"\n }\n\n make_request sig_options\n end", "title": "" }, { "docid": "bc97be7d5c23b49cc800eab5d51015d0", "score": "0.6033366", "text": "def add_subscription(starts_at, product_code, bank_account_code, setup_fee=0, metadata=nil)\n params = {:starts_at => starts_at, :product_id => product_code, :debtor_bank_account_id => bank_account_code}\n params[:setup_fee] = setup_fee if setup_fee\n params[:metadata] = metadata if metadata\n Subscription.create( params, {:customer_id => id} )\n end", "title": "" }, { "docid": "239a55eef27c9fa3924cb127fea61b03", "score": "0.6025782", "text": "def create_subscription\n @subscription = @calendar.subscriptions.find_by_user_id(current_user.id)\n if @subscription.nil?\n @subscription = @calendar.subscriptions.build(user_id: current_user.id)\n @subscription.rw = false\n end\n @subscription.subscribed = true\n @subscription.title = unique_title\n if @subscription.save\n redirect_back_or current_user\n else\n flash[:error] = \"Error Subscribing to Calendar!\"\n redirect_back_or @current_user\n end\n end", "title": "" }, { "docid": "0dc1f5f2015756a52f07fea652fa8526", "score": "0.6023195", "text": "def subscribe_with_http_info(public_update_subscription_status_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: StatusApi.subscribe ...'\n end\n # verify the required parameter 'public_update_subscription_status_request' is set\n if @api_client.config.client_side_validation && public_update_subscription_status_request.nil?\n fail ArgumentError, \"Missing the required parameter 'public_update_subscription_status_request' when calling StatusApi.subscribe\"\n end\n # resource path\n local_var_path = '/communication-preferences/v3/subscribe'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(public_update_subscription_status_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'PublicSubscriptionStatus'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['hapikey', 'oauth2']\n\n new_options = opts.merge(\n :operation => :\"StatusApi.subscribe\",\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: StatusApi#subscribe\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "13a84d3aa3cfc5d198022ea0965c110e", "score": "0.6018518", "text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { render partial: 'partials/subscriptions' }\n format.json { render action: 'show', status: :created, location: @subscription }\n else\n format.html { redirect_to controller: 'subscriptions' }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f375ca7c7ee170e350d1ca880310b", "score": "0.60171306", "text": "def create_subscription(options)\n api_post(make_subscription_url(options.merge({:use_subscription_id => true})))\n end", "title": "" }, { "docid": "8ac675396cfb7a0f170f5d5aa87bf19d", "score": "0.6013986", "text": "def subscriptions\n @subscriptions ||= Services::SubscriptionsService.new(@api_service)\n end", "title": "" }, { "docid": "b6e0ed53a8c0f77634e78be47930945a", "score": "0.6013139", "text": "def subscribe(subscription_name = nil)\n\t\t\t@spire.subscribe(subscription_name, self.name)\n\t\tend", "title": "" }, { "docid": "fe714deb6b8d803f78fd5d8559caf8e7", "score": "0.6011664", "text": "def subscriptions\n\t\t@subscriptions_api ||= Glass::Api::Subscriptions.new(self)\n\tend", "title": "" }, { "docid": "908d6a460e46e56e02c9c73cdf4d0f4b", "score": "0.60110426", "text": "def subscribe(url, id = nil, opts = {}, &blk)\n endpoint = opts[:hub] || @@superfeedr_endpoint\n request = prep_request(url, id, endpoint, opts)\n\n if opts[:retrieve]\n request['retrieve'] = true\n end\n \n if opts[:format] == \"json\"\n request['format'] = \"json\"\n end\n\n if opts[:secret]\n request['hub.secret'] = opts[:secret]\n else\n request['hub.secret'] = \"WHAT DO WE PICK? A UNIQUE SCRET THE CALLBACK? SO WE CAN USE THAT ON NOTIFS?\" \n end\n \n request['hub.mode'] = 'subscribe'\n\n response = http_post(endpoint, request)\n\n r = [response.body, opts[:async] && Integer(response.code) == 202 || Integer(response.code) == 204 || opts[:retrieve] && Integer(response.code) == 200, response]\n if blk\n blk.call(r) \n end\n r\n end", "title": "" }, { "docid": "a34d0a93fe26309a80f96f308f2ecb88", "score": "0.600339", "text": "def create\n FeedSubscription.add current_user.profile, @subject\n current_user.profile.publish_subscription @subject, true\n \n respond_to do |format|\n format.html { redirect_to_subject }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "250bf9ff3ad35f7388bb46b24b8f2c9a", "score": "0.6001732", "text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n @subscription.price_calculate_and_save\n format.html { redirect_to subscription_path(@subscription), flash: {:success => 'Subscription was successfully created.'} }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bb64dbcc110b1b29fd459dd05d41765", "score": "0.59997636", "text": "def create\n @offer = Offer.find(params[:offer_id])\n @subscription = @offer.subscriptions.create(params[:subscription])\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to thanks_offer_path(@offer), notice: 'Offer was successfully created.' }\n format.json { render json: @offer, status: :created, location: @offer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f1f21f6fc94ff3b701baeaef49662d62", "score": "0.5995489", "text": "def new_record_notification(subscription)\n @subscription = subscription\n mail to: @subscription.email, subject: \"Subscription: Success!\"\n end", "title": "" }, { "docid": "644cff121e101ac25b97561c2aa46a8b", "score": "0.599027", "text": "def edit_subscription(action, subreddit)\n fullname = extract_fullname(subreddit)\n post \"/api/subscribe\", action: action, sr: fullname\n end", "title": "" }, { "docid": "347c513915f254e7a54409e2a5215bbc", "score": "0.59860235", "text": "def call\n # Create the subscription. Note we're expanding the Subscription's\n # latest invoice and that invoice's payment_intent\n # so we can pass it to the front end to confirm the payment\n\n subscription = Stripe::Subscription.create(\n customer: @stripe_customer_id,\n items: @price_array,\n expand: ['latest_invoice.payment_intent'],\n payment_behavior: 'default_incomplete',\n payment_settings: {save_default_payment_method: 'on_subscription'},\n expand: ['latest_invoice.payment_intent']\n )\n end", "title": "" }, { "docid": "937df8c5315039261ffba7508b82595b", "score": "0.59818846", "text": "def create\n @subscription = Subscription.new subscription_params\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: 'Subscription was successfully created.' }\n # format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n # format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bab776dfc5203eef36b2ae2cf4f2b7fb", "score": "0.59771895", "text": "def subscribe(args = {})\n :no_response\n end", "title": "" }, { "docid": "2a00c73626e612c6eac43aacb07a7b09", "score": "0.5974008", "text": "def new\n\t\t@subscription = Subscription.new\n\tend", "title": "" }, { "docid": "bba13e45080a61ffe107bc94b02e2939", "score": "0.59722626", "text": "def subscriptions\n @subscriptions ||= SubscriptionsApi.new config\n end", "title": "" }, { "docid": "0976892e2961a1e66f0c419b7a2d8385", "score": "0.59672683", "text": "def subscribe(subscription)\n if subscription.confirmed?\n if subscription.unsubscribed?\n raise \"Subscription #{subscription.id} is unsubscribed.\"\n else\n update_subscription(subscription)\n end\n else\n raise \"Subscription #{subscription.id} is not confirmed.\"\n end\n end", "title": "" }, { "docid": "e590b816ac656dcbcb6540b00ef89795", "score": "0.5955891", "text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e590b816ac656dcbcb6540b00ef89795", "score": "0.5955891", "text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: 'Subscription was successfully created.' }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b88a378141f7cc2dd0f611330185366c", "score": "0.5954188", "text": "def create\n @subscription = @user.subscriptions.build(params[:subscription])\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to(user_subscriptions_path(@user), :notice => 'Subscription was successfully created.') }\n format.xml { render :xml => @subscription, :status => :created, :location => @subscription }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @subscription.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6eb9c2f9022c87d833f13ac394595668", "score": "0.595412", "text": "def create\n @subscription = Subscription.new(subscription_params)\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to subscriptions_url, notice: t('subscription.notice.created') }\n format.json { render :show, status: :created, location: @subscription }\n end\n end\n end", "title": "" }, { "docid": "9674100f95cf4ff91d7545b0f179d26c", "score": "0.5946861", "text": "def create_subscriptions(scope:, **options)\n \t\tresponse = client.post(subscriptions_path , scope, options)\n\n \t\tSubscription.new(subscription_id: response[\"_id\"], url: response[\"url\"], payload: response)\n \tend", "title": "" }, { "docid": "1039855ab942b98043c54ddae37a5e8c", "score": "0.59344476", "text": "def create_subscription mailing_list_id, subscription_data\n fetch_body \"subscribers/mailinglist/#{mailing_list_id}/create?updateIfExists=true\", subscription_data\n end", "title": "" }, { "docid": "9daf155af19eaaed6e30a0114e5ec3a2", "score": "0.59256333", "text": "def create\n @subscription = Subscription.new(subscription_params)\n @customer = @subscription.customer\n @show = @subscription.show\n \n # Verify current customer\n if current_person.user != @customer\n redirect_to root_url\n return\n end\n \n # Check if customer already has sub\n if !@customer.has_subscription?(@show)\n # Check if customer can subscribe without purchase\n if @customer.open_slots?\n if @subscription.save\n flash.notice = \"Subscription added!\"\n end\n else\n # Check if customer wants to purchase\n if params[:purchase] == \"true\"\n if @subscription.save\n # Purchase another slot\n Invoice.create(:payment_id => @customer.payment.id, :amount => 1.50, :description => \"Additional subscription slot\")\n @customer.slots += 1\n @customer.save\n flash.notice = \"Subscription purchased!\"\n end\n end\n end\n end\n \n redirect_to @show\n end", "title": "" }, { "docid": "4a397961e1d68c6de8d962f8032a3e96", "score": "0.5924727", "text": "def subscriptions=(value)\n @subscriptions = value\n end", "title": "" }, { "docid": "4a397961e1d68c6de8d962f8032a3e96", "score": "0.5924727", "text": "def subscriptions=(value)\n @subscriptions = value\n end", "title": "" }, { "docid": "f59a075e9c1ee9d500ed21daea1d4550", "score": "0.5923291", "text": "def create\n @subscription = Subscription.new(params[:subscription])\n\n respond_to do |format|\n if @subscription.save\n format.html { redirect_to @subscription, notice: 'Subscribtion was successfully created.' }\n format.json { render json: @subscription, status: :created, location: @subscription }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c277467b6a989b2c4779d362852bd538", "score": "0.5920639", "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": "e3d47d2e7c7963512e8042a8466b3967", "score": "0.591466", "text": "def subscription_request\n OrisMailer.subscription_request\n end", "title": "" }, { "docid": "6fe6dee2cfb225638d6bf1801e6769d6", "score": "0.5911367", "text": "def create_subscriptions(accountId, model) path = \"/api/v2/accounts/#{accountId}/subscriptions\"\n post(path, model, {}, AvaTax::VERSION) end", "title": "" }, { "docid": "740c806825ceb85abf3e2ab587bc2f44", "score": "0.5908371", "text": "def create\n @subscription = Subscription.new(subscription_params)\n @subscription.renewal = false\n \n # this is a crude hack to hide address, and probably should be a part of the address model on person\n # - country_code can be provided by the underpayment calculator as a query param for prefilling\n # - alternatively the system will geolocate the IP address\n @subscription.set_country_code(params[\"country_code\"] || request.location.try(:country_code))\n \n respond_to do |format|\n if save_step\n format.html { redirect_to next_step, notice: next_step_notice }\n format.json { render :show, status: :created, location: @subscription }\n else\n format.html { render :new }\n format.json { render json: @subscription.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "84e0f9f13cdcb8318d091efdccb07d4b", "score": "0.59025705", "text": "def subscribe(rsrc, endpoint, conf={})\n opts = { :query => { :endpoint => endpoint } }\n opts.merge! @options\n\n set_id_and_secret(opts, conf)\n\n response = self.class.post(\"/subscriptions/#{rsrc}\", opts)\n if response.success?\n return true\n else\n raise Shine::ShineError.new(:subscribe, response)\n end\n end", "title": "" }, { "docid": "4c77a1d057aa05ed258b1ade358f9f83", "score": "0.5898832", "text": "def create_newsletter_subscription(params)\n request(:post, 'api/0/newsletter', params)\n nil\n end", "title": "" }, { "docid": "c55d4814071bdab06215c24596503c46", "score": "0.58867127", "text": "def subscribe\n if current_user\n @user = User.find(current_user.id)\n @user.update_attribute(:subscription_id, params[:id])\n redirect_to subscriptions_path\n else\n redirect_to new_user_session_path\n end\n end", "title": "" }, { "docid": "fb6f9d55449a305008c0b768d2fce709", "score": "0.5885516", "text": "def get_user_subscription_details\n send_request 'getUserSubscriptionDetails'\n end", "title": "" }, { "docid": "8a7702746ac222366368dcec35ff9414", "score": "0.5875119", "text": "def push_subscription\n\t\trender :nothing => true\n\tend", "title": "" } ]
d70e52484e328ff2411a0096a01353f7
Set implicit wait and default_wait to timeout, defaults to 30. if set_wait is called without a param then the second to last wait will be used. ```ruby` set_wait 2 set_wait 3 set_wait 2 ````
[ { "docid": "9d5cc248a6ae9cf69153dd69c3514b66", "score": "0.8285323", "text": "def set_wait timeout=nil\n if timeout.nil?\n # puts \"timeout = @default_wait = @last_wait\"\n # puts \"timeout = @default_wait = #{@last_waits}\"\n timeout = @default_wait = @last_waits.first\n else\n @default_wait = timeout\n # puts \"last waits before: #{@last_waits}\"\n @last_waits = [@last_waits.last, @default_wait]\n # puts \"last waits after: #{@last_waits}\"\n end\n\n @driver.manage.timeouts.implicit_wait = timeout\n end", "title": "" } ]
[ { "docid": "830af04f8c796a954f149e8829aeb96f", "score": "0.7200762", "text": "def set_implicit_wait_by_default(wait)\n return if @default_wait.nil?\n\n @driver.manage.timeouts.implicit_wait = wait\n rescue ::Selenium::WebDriver::Error::UnknownError => e\n unless e.message.include?('The operation requested is not yet implemented')\n raise ::Appium::Core::Error::ServerError, e.message\n end\n\n ::Appium::Logger.debug(e.message)\n {}\n end", "title": "" }, { "docid": "e1e4f2591082c791a366917879f8bc73", "score": "0.6679357", "text": "def default_wait\n @default_wait\n end", "title": "" }, { "docid": "a8f776774f1239f3c890abcc22b516f2", "score": "0.65788174", "text": "def wait_timeout\n @wait_timeout ||= options[:wait_timeout] || DEFAULT_WAIT_TIMEOUT\n end", "title": "" }, { "docid": "e663055cebbecee35735b233000168a4", "score": "0.6443681", "text": "def implicit_wait=(seconds); end", "title": "" }, { "docid": "1aad6a6fb9c9c1947dbbbce6bbdc2936", "score": "0.6226858", "text": "def set_max_wait_time\n q = 'Set the MAX WAIT TIME after executing the RESTART command ' \\\n '(>= 180 secs): '\n until @max_wait && @max_wait.to_i > 179\n @max_wait = Utils.qna(q.cyan, true)\n end\n end", "title": "" }, { "docid": "cd090ad34824d5a0b30a697e1709af2e", "score": "0.596722", "text": "def wait timeout: 3, &block\n wait = Selenium::WebDriver::Wait.new timeout: timeout\n wait.until(&block)\nend", "title": "" }, { "docid": "fe5471c45564bbc241a28674f5952326", "score": "0.59339607", "text": "def state_wait(set, state, timeout=1200)\n # do a special wait, if waiting for operational (for dns)\n if state == \"operational\"\n set.each { |server| obj_behavior(server, :wait_for_operational_with_dns, timeout) }\n else\n set.each { |server| obj_behavior(server, :wait_for_state, state, timeout) }\n end\n end", "title": "" }, { "docid": "95a086998accd5d92621e399f47eb9ea", "score": "0.58681065", "text": "def wait_for(wait_max: 3, step: 0.001, &block)\n stop_at = wait_max.seconds.from_now\n\n sleep step while !block.call && (@time = Time.now) < stop_at\n\n fail \"Timeout of #{wait_max} seconds exceeded!\" unless @time < stop_at\nend", "title": "" }, { "docid": "feb763253dc46c3e4a3587e4e4b3c337", "score": "0.5848157", "text": "def no_wait\n @last_waits = [@default_wait, 0]\n @default_wait = 0\n @driver.manage.timeouts.implicit_wait = 0\n end", "title": "" }, { "docid": "2d53aee9a32c371abe4eff2694181a8c", "score": "0.5846182", "text": "def wait(timeout=10)\n Selenium::WebDriver::Wait.new(:timeout => timeout)\n end", "title": "" }, { "docid": "58ef10ba4da97c0cc1b7f0f47877ccfd", "score": "0.58411944", "text": "def set_wait_time\n @wait_time = WaitTime.find(params[:id])\n end", "title": "" }, { "docid": "58ef10ba4da97c0cc1b7f0f47877ccfd", "score": "0.58411944", "text": "def set_wait_time\n @wait_time = WaitTime.find(params[:id])\n end", "title": "" }, { "docid": "87f84f658e9492ccf377a218cbf16e53", "score": "0.58140564", "text": "def do_wait(waited)\n wait = get_config(:docker_wait)\n return unless wait.is_a?(Integer) || wait.is_a?(Float)\n return if waited >= wait\n sleep(wait - waited)\n end", "title": "" }, { "docid": "6007d71901742c6dd4361870fc9709a4", "score": "0.5790305", "text": "def set_timeout(timeout)\n @log.info('Setting the selenium timeout to: ' + timeout.to_s)\n @driver.manage.timeouts.implicit_wait = timeout\n end", "title": "" }, { "docid": "040dfd7052b9c57d6ba289b3721cff81", "score": "0.57674325", "text": "def abs_wait_short\n wait(15)\n end", "title": "" }, { "docid": "f9592fea5f2594d899951f51b8539f3e", "score": "0.57514125", "text": "def wait(seconds)\n @waiting = seconds * 1000\n end", "title": "" }, { "docid": "14ee4a49d794546bfa53176ffa583398", "score": "0.57201034", "text": "def wait\n sleep WAIT_TIME unless @skip_wait\n end", "title": "" }, { "docid": "7f5d495e3e5d60e5642b59ade9066020", "score": "0.5716633", "text": "def wait(seconds) \r\n\t\texec(\"Wait\", seconds.to_s)\r\n\tend", "title": "" }, { "docid": "31667d48d583a68a9748299807a8e647", "score": "0.56703126", "text": "def reset_wait\n @wait = @t + rand(@t_rand)\n end", "title": "" }, { "docid": "886f511c4d61bd561518367b5eecb348", "score": "0.5669643", "text": "def wait\n sleep 0.0001\n end", "title": "" }, { "docid": "e48524f9089c9ca6fc3f79e7178fb2fa", "score": "0.560765", "text": "def pause wait_time\r\n command 'pause', wait_time\r\n end", "title": "" }, { "docid": "6a64b6fe82c54834e9e88f8d573dfa23", "score": "0.56066203", "text": "def wait!\n sleep(@sleep)\n end", "title": "" }, { "docid": "71d6d3b785cb892ffeee519f640a2673", "score": "0.55677146", "text": "def brute_wait(delay)\n sleep(delay)\n end", "title": "" }, { "docid": "c66deb43d8e4b0d1b4be3d0ff46ca78d", "score": "0.55675995", "text": "def set_timeout(timeout, element_timeout)\n @log.info('Setting the selenium timeout to: ' + timeout.to_s + ' element timeout: '+element_timeout.to_s)\n @driver.manage.timeouts.implicit_wait = timeout\n Capybara.default_wait_time = element_timeout\n end", "title": "" }, { "docid": "3155912af534603d8c471f46148f0156", "score": "0.5563107", "text": "def set_wait_flags(*flags)\n a = (flags.include?(:a) || flags.include?(:a)) ? '1' : 'X'\n b = (flags.include?(:b) || flags.include?(:b)) ? '1' : 'X'\n c = (flags.include?(:c) || flags.include?(:c)) ? '1' : 'X'\n d = (flags.include?(:d) || flags.include?(:d)) ? '1' : 'X'\n self.wait_flags = d + c + b + a\n self\n end", "title": "" }, { "docid": "e572c3e4c1696ebd195331bacaf8efcf", "score": "0.55415636", "text": "def wait timeout = nil\n @mutex.synchronize {\n if @cnt != 0\n if timeout\n @cond_var.wait @mutex, timeout\n else\n @cond_var.wait @mutex\n end\n end\n }\n end", "title": "" }, { "docid": "d64db49a8b063ea621c3518cd747b9a8", "score": "0.55283546", "text": "def implicit_wait; end", "title": "" }, { "docid": "c2527bbf58d8b66c4e235d7c25f2ad19", "score": "0.552373", "text": "def wait(sec = 5)\n Logbook.message(\"Waiting #{sec} sec >>\" + \"\\n\")\n sec.instance_of?(Integer) ? sleep(sec) : Logbook.message(\"Waiting time is not integer: [#{sec}]\" + \"\\n\")\n end", "title": "" }, { "docid": "7ff7e461e9e77e98120da0e4dc944497", "score": "0.5503527", "text": "def wait(frames)\n return if @wait > 0\n @wait = frames\n end", "title": "" }, { "docid": "0f1d7e51935ce26992b39d40f45311ef", "score": "0.5499676", "text": "def wait(arg0)\n end", "title": "" }, { "docid": "d60c4f160c0c4f659493a88a89ceefbd", "score": "0.5491762", "text": "def skip_wait=(setting)\n @skip_wait = setting\n end", "title": "" }, { "docid": "deaa4cf36980b54946cec199970c3ccf", "score": "0.5481426", "text": "def wait_until timeout=10, &block\n wait = Selenium::WebDriver::Wait.new(:timeout => timeout)\n wait.until &block\nend", "title": "" }, { "docid": "14fadcf2132294c8977d0c82d0f10b73", "score": "0.547819", "text": "def wait_for timeout = 0, &condition\n if condition\n SeleniumAdapter.wait_for(timeout, &condition)\n return nil\n else\n @wait_for = timeout\n return self\n end\n end", "title": "" }, { "docid": "d8e6a8e29a34537e7bcf16a86390ccaa", "score": "0.54749", "text": "def after_wait(&block)\n @after_wait_block = block\n end", "title": "" }, { "docid": "b9d02ad850ef74b56a8e98509657976b", "score": "0.54464847", "text": "def timeouts_set=(_arg0); end", "title": "" }, { "docid": "1c9c6702a23023be011e2065855e9e1e", "score": "0.5444415", "text": "def click_wait(locator, sec, _arg = nil)\n click_on(locator)\n wait(sec)\n end", "title": "" }, { "docid": "44bbc42a7d33b69654357ed16a9b70c7", "score": "0.5393835", "text": "def wait(timeout = nil)\n @latch.wait(timeout)\n end", "title": "" }, { "docid": "8bca40288b7983415ac91a55ee387d0a", "score": "0.53878504", "text": "def set_timeout timeout\r\n command 'setTimeout', timeout\r\n end", "title": "" }, { "docid": "8bca40288b7983415ac91a55ee387d0a", "score": "0.53878504", "text": "def set_timeout timeout\r\n command 'setTimeout', timeout\r\n end", "title": "" }, { "docid": "44215dd22fd8a13641fe243a68a07afa", "score": "0.5382702", "text": "def state_wait(set, state)\n # do a special wait, if waiting for operational (for dns)\n if state == \"operational\"\n set.each { |server| server.wait_for_operational_with_dns }\n else\n set.each { |server| server.wait_for_state(state) }\n end\n end", "title": "" }, { "docid": "523fd30e7f6b555035f7728c4772cf04", "score": "0.53710735", "text": "def wait_time(value)\n define_singleton_method(:wait_time_value) { value }\n private_class_method :wait_time_value\n end", "title": "" }, { "docid": "33c52353e67da1c1f08b4aa46e50f9a3", "score": "0.5354443", "text": "def wait_for(seq,timeout=1)\n begin\n ::Timeout.timeout(timeout) do\n wait(seq)\n end\n rescue ::Timeout::Error\n end\n end", "title": "" }, { "docid": "6bc2924df1e94dd8c17f9a6c2f4a9581", "score": "0.53336674", "text": "def wait_until(index)\n\t\t@wait = index\n\tend", "title": "" }, { "docid": "fa2506df709b087cfabd19cd050225c0", "score": "0.53278303", "text": "def wait(duration, variable)\n for i in 0...duration\n @wait_time += 1 if variable\n @wait_time_thirst if variable == false \n break if i >= duration / 2\n end\n end", "title": "" }, { "docid": "9bf8a9bfea4bde92f735dcdb4f619e48", "score": "0.53137374", "text": "def wait\n loop do sleep 1 end\n end", "title": "" }, { "docid": "33bd3c38287fc497afef4bd4beaa039e", "score": "0.52783096", "text": "def wait_until(options = {}, &block)\n eventually(options, &block)\n end", "title": "" }, { "docid": "7341500c52a6296bc8e6a6a44aa565bb", "score": "0.52596825", "text": "def driver_timeout=(value)\n Watir.default_timeout = value\n end", "title": "" }, { "docid": "7341500c52a6296bc8e6a6a44aa565bb", "score": "0.52596825", "text": "def driver_timeout=(value)\n Watir.default_timeout = value\n end", "title": "" }, { "docid": "428c23e887361f2b542565c59d128b4a", "score": "0.52242017", "text": "def wait(per = nil)\n @target += per || @period\n error = @target - Time.now\n sleep error if error > 0\n true\n end", "title": "" }, { "docid": "f8dccfdfb4135daab3df5cc0d5f7b530", "score": "0.52166414", "text": "def ev_do_calculate_rw_wait(wait); end", "title": "" }, { "docid": "72978f58d283adbfc8e19e2e849c84ec", "score": "0.5209517", "text": "def wait_true max_wait=30, interval=0.5, &block\n max_wait = 1 if max_wait <= 0\n result = nil\n timeout max_wait do\n until (result = begin; block.call; rescue; end)\n sleep interval\n end\n end\n result\n end", "title": "" }, { "docid": "a993ed775e28208a6d1dd630c264c0c0", "score": "0.51961994", "text": "def wait_for(timeout = DEFAULT_TIMEOUT)\n Selenium::WebDriver::Wait.new(:timeout => timeout).until {yield}\nend", "title": "" }, { "docid": "37d37acbce65c232efa2eadaab22e8dd", "score": "0.5191122", "text": "def wait_until_with_buffer(args, &block)\n original_timeout = args[:timeout] || ENV['WAIT_TIMEOUT'].to_i\n args_buffered = args.dup\n\n args_buffered[:timeout] = 60\n\n start_time = Time.now\n Frank::Cucumber::WaitHelper.wait_until(args_buffered) { block.call() }\n end_time = Time.now\n\n delta = end_time - start_time\n puts(\"wait_until exceeded timeout #{original_timeout}. Took #{delta}. #{caller[0]}\") if delta > original_timeout\nend", "title": "" }, { "docid": "2071975ced4fba2c33b11d15d8745ea5", "score": "0.5187647", "text": "def wait(timeout = nil)\n return true if set?\n\n @mutex.synchronize { @waiters << Thread.current }\n return true if set? # if event was set while waiting for mutex\n\n if timeout.nil?\n slept = sleep\n else\n slept = sleep(timeout)\n end\n rescue\n # let it fail\n ensure\n @mutex.synchronize { @waiters.delete(Thread.current) }\n return set?\n end", "title": "" }, { "docid": "c24922ee0c8b937697f4de7254118c2b", "score": "0.51807165", "text": "def sleep_for\n @sleep_for ||= 5\n end", "title": "" }, { "docid": "1916b7a12d5c7f632851a763dd75e413", "score": "0.5132711", "text": "def wait\n @wait.synchronize do\n sleep 1 while @count >= THREAD_MAX\n @count += 1\n end\n end", "title": "" }, { "docid": "6248069c87e6eec3ac1c3ffa751f1fa0", "score": "0.5130975", "text": "def send_and_wait(type, *args); end", "title": "" }, { "docid": "f1bcef70b315f11f5de31fde48bab8a2", "score": "0.5123968", "text": "def set_waitness\n @waitness = Waitness.find(params[:id])\n end", "title": "" }, { "docid": "b1c1c1415854b1aa6b14cd3fb1c12260", "score": "0.5108815", "text": "def wait_until(timeout=self.class.default_timeout, cycle=1, fatigue=1.2, &block)\n waited = 0\n until block.call\n debug \"#{self} is waiting for resource (%5.2f/%2ds +%5.2f)...\"% [waited, timeout, cycle]\n sleep cycle\n waited += cycle\n cycle *= fatigue\n if waited > timeout\n raise WaitTimeoutError, \"Waiting for aws resources timed out after #{waited} seconds!\"\n end\n end\n end", "title": "" }, { "docid": "9905f4aa92f21ea397e269a5abcc158d", "score": "0.5106938", "text": "def wait\n @running.reset\n @waiting.set\n @running.wait\n end", "title": "" }, { "docid": "17fd741aebb428bb38331744c6b99e62", "score": "0.5105778", "text": "def wait_until times: 5, delay: 1, &condition\n times.times do\n return if condition.call\n sleep delay\n end\n raise \"Condition not met. Waited #{times} times with #{delay} sec delay\"\n end", "title": "" }, { "docid": "483b461d006f744aa5b7824169a43b8a", "score": "0.51013505", "text": "def wait(timeout = 0)\n Window.wait(@title, @text, timeout)\n end", "title": "" }, { "docid": "3592df576318a3ee1f459bc1c09423c1", "score": "0.5084699", "text": "def wait_for(seconds = timeout)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\n end", "title": "" }, { "docid": "e8082d34b3c088097d20a4ef2fb370e3", "score": "0.507069", "text": "def normalize_timeout(timeout)\r\n if timeout == nil\r\n timeout = Capybara.default_wait_time\r\n end\r\n\r\n if timeout < 1\r\n timeout = 1\r\n end\r\n\r\n return timeout\r\n end", "title": "" }, { "docid": "a3b3d7e56224e71199ecf25d5ed25e89", "score": "0.50667423", "text": "def with_driver_timeout(timeout)\n\t\t\tcurrent = @driver_timeout\n\t\t\tdriver.manage.timeouts.implicit_wait = timeout\n\t\t\tyield\n\t\tensure\n\t\t\t@driver_timeout = current\n\t\t\tdriver.manage.timeouts.implicit_wait = current\n\t\tend", "title": "" }, { "docid": "fce17024fcc7ed0dc6a9845477f60283", "score": "0.5066697", "text": "def timeouts_set; end", "title": "" }, { "docid": "40160c57e02d3e0f139776a8c86f3501", "score": "0.5065286", "text": "def wait(duration)\n info \"Request from Experiment Script: Wait for #{duration}s....\"\n warn \"Calling 'wait' or 'sleep' will block entire EC event loop. Please try 'after' or 'every'\"\n sleep duration\n end", "title": "" }, { "docid": "d8f48ec7501dbf6cbbb796becff01e8d", "score": "0.50625074", "text": "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "title": "" }, { "docid": "d8f48ec7501dbf6cbbb796becff01e8d", "score": "0.50625074", "text": "def wait_until(wait_time = Capybara.default_max_wait_time)\n Timeout.timeout(wait_time) do\n loop until yield\n end\n end", "title": "" }, { "docid": "3707668aedab08d7c773f621096b183a", "score": "0.5046045", "text": "def wait(what = T.unsafe(nil)); end", "title": "" }, { "docid": "54817fe421b7314a8a469c16939facdf", "score": "0.503985", "text": "def eventually(wait_time = Capybara.default_max_wait_time, &block)\n Checkpoint.wait_for wait_time, &block\n end", "title": "" }, { "docid": "866e52458396fd584cc6e36fc75ee838", "score": "0.50366455", "text": "def set_timeout(value)\n if value.nil?\n @timeout = 2\n else\n return skip_resource 'timeout is not numeric' unless value.to_s =~ /^\\d+$/\n @timeout = value\n end\n end", "title": "" }, { "docid": "d6a1fdf8d1301f127a9273fd5437b884", "score": "0.50340354", "text": "def wait\n 0\n end", "title": "" }, { "docid": "d0a26a7242be17a6b2ab67d6a2709926", "score": "0.5013885", "text": "def wait(duration, value)\n for i in 0...duration\n @wait_time += 1 if value == false\n @wait_time2 += 1 if value\n break if i >= duration / 2\n end\n end", "title": "" }, { "docid": "d0a26a7242be17a6b2ab67d6a2709926", "score": "0.5013885", "text": "def wait(duration, value)\n for i in 0...duration\n @wait_time += 1 if value == false\n @wait_time2 += 1 if value\n break if i >= duration / 2\n end\n end", "title": "" }, { "docid": "cf15e0c414b008afd415971eee81d47c", "score": "0.5012922", "text": "def set_waitlist\n @waitlist = Waitlist.find(params[:id])\n end", "title": "" }, { "docid": "f03aa3c43ae27c74e1b3de6129783b74", "score": "0.5004764", "text": "def wait(time = 60)\n resp = connection.post(\"/containers/#{id}/wait\", nil, read_timeout: time)\n Docker::Util.parse_json(resp)\n end", "title": "" }, { "docid": "e942f3ea4261b146d847843b4eb9c3b6", "score": "0.49990445", "text": "def wait(time, increment = 1, elapsed_time = 0, &block)\n begin\n yield\n rescue Exception => e\n if elapsed_time >= time\n raise e\n else\n sleep increment\n wait(time, increment, elapsed_time + increment, &block)\n end\n end\nend", "title": "" }, { "docid": "fe7a94609714be65e0be355b9687bb20", "score": "0.49981248", "text": "def wait_for(seconds)\n Selenium::WebDriver::Wait.new(timeout: seconds).until { yield }\nend", "title": "" }, { "docid": "4fac70d0fde57f6a673d75ad90093744", "score": "0.49882007", "text": "def wait_any(timeout = -1)\n DRMAA.wait(ANY_JOB, timeout)\n end", "title": "" }, { "docid": "21716aff04a1ffe33c42325e2bdf9d6b", "score": "0.49848828", "text": "def skip_wait\n @skip_wait = true\n end", "title": "" }, { "docid": "716addc82b6cba664a8c8c84371f1c19", "score": "0.49846333", "text": "def wait(time = 60)\n resp = connection.post(\"/containers/#{id}/wait\", nil, :read_timeout => time)\n Docker::Util.parse_json(resp)\n end", "title": "" }, { "docid": "a8299e3ec161b3df5990a7af77a73dcb", "score": "0.49790746", "text": "def pick_timeout!\n @timeout = (ENV['TIMEOUT'] || DEFAULT_TIME_LIMIT).to_i\n $stdout.puts \"TIMEOUT=#{@timeout}\"\n $stdout.flush\n end", "title": "" }, { "docid": "a8299e3ec161b3df5990a7af77a73dcb", "score": "0.49790746", "text": "def pick_timeout!\n @timeout = (ENV['TIMEOUT'] || DEFAULT_TIME_LIMIT).to_i\n $stdout.puts \"TIMEOUT=#{@timeout}\"\n $stdout.flush\n end", "title": "" }, { "docid": "a8299e3ec161b3df5990a7af77a73dcb", "score": "0.49790746", "text": "def pick_timeout!\n @timeout = (ENV['TIMEOUT'] || DEFAULT_TIME_LIMIT).to_i\n $stdout.puts \"TIMEOUT=#{@timeout}\"\n $stdout.flush\n end", "title": "" }, { "docid": "907d37137c5d18bcb21c0cdbb5efcae5", "score": "0.4978969", "text": "def wait(frames)\n frames.times do\n wait_internal\n end\n end", "title": "" }, { "docid": "503e82d63184b272ea7e29606ef53923", "score": "0.4975581", "text": "def wait(time)\n if time.kind_of?(ExperimentProperty)\n duration = time.value\n else\n duration = time\n end\n info \"Request from Experiment Script: Wait for #{duration}s....\"\n Kernel.sleep duration\n end", "title": "" }, { "docid": "5b18bff7afcb2c5c9a141d5183827d99", "score": "0.4972192", "text": "def set_lock_timeout(timeout)\n @lock_timeout = timeout\n end", "title": "" }, { "docid": "2c38787c230274d3f13fc0f25a90132c", "score": "0.49705392", "text": "def wait_for_condition script, timeout\r\n command 'waitForCondition', script, timeout\r\n end", "title": "" }, { "docid": "2c38787c230274d3f13fc0f25a90132c", "score": "0.49705392", "text": "def wait_for_condition script, timeout\r\n command 'waitForCondition', script, timeout\r\n end", "title": "" }, { "docid": "cc4b395e67624622b320eb03fe2989b3", "score": "0.4964455", "text": "def wait; end", "title": "" }, { "docid": "cc4b395e67624622b320eb03fe2989b3", "score": "0.4964455", "text": "def wait; end", "title": "" }, { "docid": "cc4b395e67624622b320eb03fe2989b3", "score": "0.4964455", "text": "def wait; end", "title": "" }, { "docid": "b6084d4c6351a02cacf8918f306e6045", "score": "0.4958019", "text": "def wait(timeout, &block)\n end_time = @end_time || (current_time + timeout)\n loop do\n yield(block)\n @remaining_time = end_time - current_time\n break if @remaining_time.negative?\n end\n end", "title": "" }, { "docid": "c6292a85ad892bf3997d499cbc4d8c98", "score": "0.49421915", "text": "def wait\n\tend", "title": "" }, { "docid": "5915df5dea86c1ad8c52bd72e44ac0d7", "score": "0.49399215", "text": "def wait_for_jobs(jobs)\n jobs.each(&:wait)\n end", "title": "" }, { "docid": "34ffc957547d0d13eeeef6e9df8da7d2", "score": "0.49313208", "text": "def wait(timeout = nil)\n event.wait(timeout) if timeout != 0 && incomplete?\n self\n end", "title": "" }, { "docid": "51ad61d439d72636b0e34f1aca0e5b01", "score": "0.49302775", "text": "def wait!\n now = Time.now.utc.to_i\n duration = (reset.to_i - now) + 1\n\n sleep duration if duration >= 0\n\n yield if block_given?\n\n duration\n end", "title": "" }, { "docid": "10aabd9933f118d7690766d3aba185bd", "score": "0.4925183", "text": "def test_time_out\n get_method = proc { create_op MockOperation.new(status: :NOTDONE, name: NAME) }\n mock_client = MockLroClient.new get_method: get_method\n op = create_op MockOperation.new(status: :NOTDONE, name: NAME), client: mock_client\n\n sleep_counts = [10, 20, 40, 80]\n sleep_mock = Minitest::Mock.new\n sleep_counts.each do |sleep_count|\n sleep_mock.expect :sleep, nil, [sleep_count]\n end\n sleep_proc = ->(count) { sleep_mock.sleep count }\n\n Kernel.stub :sleep, sleep_proc do\n time_now = Time.now\n incrementing_time = lambda do\n delay = sleep_counts.shift || 160\n time_now += delay\n end\n Time.stub :now, incrementing_time do\n retry_config = { initial_delay: 10, multiplier: 2, max_delay: (5 * 60), timeout: 400 }\n op.wait_until_done! retry_policy: retry_config\n refute op.done?\n end\n end\n\n sleep_mock.verify\n end", "title": "" }, { "docid": "6a55a0109b22845243391e3277b2e8bb", "score": "0.492385", "text": "def wait(timeout=60)\n countdown = timeout.to_f\n\n while countdown > 0\n if @zmq_thread and @zmq_thread.alive?\n sleep 0.1\n countdown = countdown - 0.1\n else\n break\n end\n end\n\n super()\n end", "title": "" } ]
ed4a296c1c73d4449f325c189314bc1a
Set the value of the Sort input for this Choreo.
[ { "docid": "3260352ef52838d0a9f14e20d5200c3e", "score": "0.8527327", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" } ]
[ { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "b1bcf88183b04fceab8cf1aa4d387afa", "score": "0.83067393", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "bfdbbcceed7c391329e7f63bc42e8b0c", "score": "0.8250745", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "bfdbbcceed7c391329e7f63bc42e8b0c", "score": "0.8250745", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "bfdbbcceed7c391329e7f63bc42e8b0c", "score": "0.82505566", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "bfdbbcceed7c391329e7f63bc42e8b0c", "score": "0.82505566", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "bfdbbcceed7c391329e7f63bc42e8b0c", "score": "0.82505566", "text": "def set_Sort(value)\n set_input(\"Sort\", value)\n end", "title": "" }, { "docid": "56b4db10d44863fa0fc32cb41eb37682", "score": "0.8017853", "text": "def sort=(value)\n @sort = value\n end", "title": "" }, { "docid": "bab694ca0f74301fda8cce93b1b3bdf9", "score": "0.799023", "text": "def sort=(value)\n @sort = value\n end", "title": "" }, { "docid": "ff86809659878d7d922f978f981b78d1", "score": "0.72801673", "text": "def set_SortOrder(value)\n set_input(\"SortOrder\", value)\n end", "title": "" }, { "docid": "ff86809659878d7d922f978f981b78d1", "score": "0.72801673", "text": "def set_SortOrder(value)\n set_input(\"SortOrder\", value)\n end", "title": "" }, { "docid": "ff86809659878d7d922f978f981b78d1", "score": "0.72801673", "text": "def set_SortOrder(value)\n set_input(\"SortOrder\", value)\n end", "title": "" }, { "docid": "ff86809659878d7d922f978f981b78d1", "score": "0.72801673", "text": "def set_SortOrder(value)\n set_input(\"SortOrder\", value)\n end", "title": "" }, { "docid": "ff86809659878d7d922f978f981b78d1", "score": "0.72801673", "text": "def set_SortOrder(value)\n set_input(\"SortOrder\", value)\n end", "title": "" }, { "docid": "ff86809659878d7d922f978f981b78d1", "score": "0.72801673", "text": "def set_SortOrder(value)\n set_input(\"SortOrder\", value)\n end", "title": "" }, { "docid": "ff86809659878d7d922f978f981b78d1", "score": "0.72801673", "text": "def set_SortOrder(value)\n set_input(\"SortOrder\", value)\n end", "title": "" }, { "docid": "ff86809659878d7d922f978f981b78d1", "score": "0.72801673", "text": "def set_SortOrder(value)\n set_input(\"SortOrder\", value)\n end", "title": "" }, { "docid": "ff86809659878d7d922f978f981b78d1", "score": "0.72801673", "text": "def set_SortOrder(value)\n set_input(\"SortOrder\", value)\n end", "title": "" }, { "docid": "ff86809659878d7d922f978f981b78d1", "score": "0.72801673", "text": "def set_SortOrder(value)\n set_input(\"SortOrder\", value)\n end", "title": "" }, { "docid": "4ec78da85a4b26c53fef35919acbd0e9", "score": "0.725446", "text": "def set_SortOrder(value)\n set_input(\"SortOrder\", value)\n end", "title": "" }, { "docid": "7ca2ffbd0bd29e6314cf1b82631702ce", "score": "0.71596026", "text": "def set_ProductSort(value)\n set_input(\"ProductSort\", value)\n end", "title": "" }, { "docid": "2cea62198cd3962bacf55cafc7627253", "score": "0.683977", "text": "def set_SortBy(value)\n set_input(\"SortBy\", value)\n end", "title": "" }, { "docid": "2cea62198cd3962bacf55cafc7627253", "score": "0.683977", "text": "def set_SortBy(value)\n set_input(\"SortBy\", value)\n end", "title": "" }, { "docid": "2cea62198cd3962bacf55cafc7627253", "score": "0.683977", "text": "def set_SortBy(value)\n set_input(\"SortBy\", value)\n end", "title": "" }, { "docid": "2cea62198cd3962bacf55cafc7627253", "score": "0.683977", "text": "def set_SortBy(value)\n set_input(\"SortBy\", value)\n end", "title": "" }, { "docid": "2cea62198cd3962bacf55cafc7627253", "score": "0.683977", "text": "def set_SortBy(value)\n set_input(\"SortBy\", value)\n end", "title": "" }, { "docid": "2cea62198cd3962bacf55cafc7627253", "score": "0.683977", "text": "def set_SortBy(value)\n set_input(\"SortBy\", value)\n end", "title": "" }, { "docid": "b7e7cf98b97d78514ab79c936a388545", "score": "0.6770538", "text": "def set_sort\n @sort = Sort.find(params[:id])\n end", "title": "" }, { "docid": "b7e7cf98b97d78514ab79c936a388545", "score": "0.6770538", "text": "def set_sort\n @sort = Sort.find(params[:id])\n end", "title": "" }, { "docid": "a7d19ddaf371dcf127b8503c2ba70e9e", "score": "0.67690855", "text": "def sort_order=(value)\n @sort_order = value\n end", "title": "" }, { "docid": "708d4cd8272632e3354d5cfd9d06d2cf", "score": "0.67050356", "text": "def sort\n @sort ||= params[:sort].to_s\n end", "title": "" }, { "docid": "dea6cf65a3ad19705860fd1d049cef03", "score": "0.6697115", "text": "def sort_by=(value)\n @sort_by = value\n end", "title": "" }, { "docid": "dea6cf65a3ad19705860fd1d049cef03", "score": "0.6697115", "text": "def sort_by=(value)\n @sort_by = value\n end", "title": "" }, { "docid": "a808c33d937185888db78e7910467c57", "score": "0.66245097", "text": "def setSort( &block )\n\t\t@sortblock = block\n\tend", "title": "" }, { "docid": "8d041ded8b1424fc0a27d3c6164d1132", "score": "0.65919703", "text": "def sort_order= (sort_order)\n @sort_order=sort_order\n end", "title": "" }, { "docid": "ae82e683b4a7fa824ddffffb8ec734dd", "score": "0.64974064", "text": "def allow_sort=(value)\n @allow_sort = value\n end", "title": "" }, { "docid": "d5e7ae9618cc229375265d8fdf13d178", "score": "0.64973474", "text": "def sort_param\n\t\t\t@params[:sort] || (respond_to?(:default_sort_option, true) ? default_sort_option : 'none')\n\t\tend", "title": "" }, { "docid": "a67b5ddc592186699f340e17aaee72b2", "score": "0.64898026", "text": "def sort(sort)\n upgrade_to_advanced_selector\n operation.selector[\"$orderby\"] = sort\n self\n end", "title": "" }, { "docid": "b2148a24c25786c602b5af35281e8721", "score": "0.6216079", "text": "def apply_sorting_options #:nodoc:\n\n if sort = @params['sort']\n unless @sorts.has_key?(sort)\n sort = @default_sort \n # sort was invalid\n end\n else\n sort = @default_sort\n end\n\n @select['sort'] = @sorts[sort]\n\n end", "title": "" }, { "docid": "80c74d4dfc17beb98f60d81c237ddc5f", "score": "0.6192841", "text": "def sort_on=(value)\n @sort_on = value\n end", "title": "" }, { "docid": "268ddf44977a8b2eb64e978663823113", "score": "0.61772114", "text": "def sort_attribute\n params[:sort].try(:to_sym) || self.class.default_sort_attribute\n end", "title": "" }, { "docid": "e68285446c934687bb12544f154fd68a", "score": "0.61176634", "text": "def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end", "title": "" }, { "docid": "d763b2d710d6b4924da3bb7a7eac286f", "score": "0.6109595", "text": "def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end", "title": "" }, { "docid": "d763b2d710d6b4924da3bb7a7eac286f", "score": "0.6109595", "text": "def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end", "title": "" }, { "docid": "d763b2d710d6b4924da3bb7a7eac286f", "score": "0.6109595", "text": "def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end", "title": "" }, { "docid": "d763b2d710d6b4924da3bb7a7eac286f", "score": "0.6109595", "text": "def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end", "title": "" }, { "docid": "d763b2d710d6b4924da3bb7a7eac286f", "score": "0.6109595", "text": "def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end", "title": "" }, { "docid": "d763b2d710d6b4924da3bb7a7eac286f", "score": "0.6109595", "text": "def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end", "title": "" }, { "docid": "d763b2d710d6b4924da3bb7a7eac286f", "score": "0.6109595", "text": "def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end", "title": "" }, { "docid": "3d8d795363ce8cf343240605f437f0da", "score": "0.6096311", "text": "def set_sort(arg)\n if arg\n session[:sort] = SORT_CATEGORIES.key?(arg) ? arg : SORT_CATEGORIES.keys[0]\n else\n session[:sort] ||= SORT_CATEGORIES.keys[0]\n end\n end", "title": "" }, { "docid": "2d57d8513551a20f23b7ffb3de314549", "score": "0.60931176", "text": "def sort_params\n params.fetch(:sort, {}).permit(:name, :input) \n end", "title": "" }, { "docid": "4222a6f10fa86fe641e6926b232fd334", "score": "0.60824096", "text": "def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end", "title": "" }, { "docid": "4222a6f10fa86fe641e6926b232fd334", "score": "0.60824096", "text": "def set_OrderBy(value)\n set_input(\"OrderBy\", value)\n end", "title": "" }, { "docid": "556e162ef3d293ec4a20cb1c8cf8f008", "score": "0.6025088", "text": "def sort=(_value)\n raise 'Not support #sort= in Gruff::Candlestick'\n end", "title": "" }, { "docid": "25efefed4783e116118fe8d0e1c5b6f0", "score": "0.60159993", "text": "def sort(sort_cmd)\n @platform.sort = sort_cmd\n end", "title": "" }, { "docid": "c78804814c12638d6fa2fc6a91575df5", "score": "0.6015859", "text": "def update_sorting\n @sort_column = params[:sort_column] || 'created_at'\n @sort_direction = params[:sort_direction] || 'desc'\n end", "title": "" }, { "docid": "93a390a9126c70ab9b9e1dedd2ce9ab2", "score": "0.59921503", "text": "def selected_sort_value\n sort_param.present? ? sort_param : default_sort_value\n end", "title": "" }, { "docid": "1105ae4b83addcee9a34060f33ae5a6e", "score": "0.59716654", "text": "def set_sort_order\n previous_max = Room.maximum(\"sort_order\") || 0\n write_attribute(:sort_order, previous_max +1)\n end", "title": "" }, { "docid": "348017ae7caa2148c12a0d75cb2f82f0", "score": "0.5960602", "text": "def sort\n sort_string_for object.params['sort']\n end", "title": "" }, { "docid": "348017ae7caa2148c12a0d75cb2f82f0", "score": "0.5960602", "text": "def sort\n sort_string_for object.params['sort']\n end", "title": "" }, { "docid": "277d120f20b29c380b5c2c42cbd533c9", "score": "0.5937639", "text": "def set_sort_order(order); end", "title": "" }, { "docid": "319932c3eddde090e82d5e8631761e8b", "score": "0.5911596", "text": "def sort_by &sorting\n @sorting = sorting\n end", "title": "" }, { "docid": "c6f15d8e43ee66db058aa7096d6217b9", "score": "0.59087116", "text": "def sortable(att, value)\n sortables[id][att].set(value)\n\n fields[SORTABLES].sadd att\n end", "title": "" }, { "docid": "e7f3e39528ff6eadc3f9c70118916ec3", "score": "0.5884171", "text": "def problem_sort=(problem_sort)\n validator = EnumAttributeValidator.new('String', [\"Ascending\", \"Descending\"])\n unless validator.valid?(problem_sort)\n fail ArgumentError, \"invalid value for 'problem_sort', must be one of #{validator.allowable_values}.\"\n end\n @problem_sort = problem_sort\n end", "title": "" }, { "docid": "fadc7c0af786aea830f0f2b3363419be", "score": "0.58699846", "text": "def add_sort(sort) #:nodoc:\n @query.add_sort(sort)\n end", "title": "" }, { "docid": "d639542dd44dba432fd5c3fd46ee1053", "score": "0.5869225", "text": "def validate_sort_value\n unless [\"Name\", \"Most Recent\", \"Distance\"].include?( params[:sort] )\n params[:sort] = \"Name\"\n end\n end", "title": "" }, { "docid": "9ce4ce4fe07293833f9fca57cf150f4a", "score": "0.5855771", "text": "def order(sort)\n add_query_part(:sort, sort)\n end", "title": "" }, { "docid": "c449ce7a0f5f93cda0fdcb199992ed18", "score": "0.5854767", "text": "def set_sorting!\n return unless faceted || options[:sort_column].present?\n \n unless sort_values.include?(options[:sort_column])\n options[:sort_column] = 'created_at'\n end\n \n options[:sort_direction] = sort_direction(options[:sort_column]).downcase\n end", "title": "" }, { "docid": "780f6c8c05ce30054634c90b4e0f1f9d", "score": "0.58527315", "text": "def set_sorting!\n return unless faceted || collected || options[:sort_column].present?\n \n unless sort_values.include?(options[:sort_column])\n options[:sort_column] = 'revised_at'\n end\n \n options[:sort_direction] ||= sort_direction(options[:sort_column]).downcase\n options[:sort_direction] = \"desc\" unless options[:sort_direction] == \"asc\"\n end", "title": "" }, { "docid": "cf1cf9d68105f50a4e4caa3c85d15e01", "score": "0.5808208", "text": "def sort(*args)\n @query_params[:sort] += args\n self\n end", "title": "" }, { "docid": "ce14ace24aae5fff60ba5b7b4865887a", "score": "0.5776795", "text": "def sort_params\n params.require(:sort).permit(:name, :mark_id)\n end", "title": "" }, { "docid": "3d479906fbbd6c9b818a7686fb72ab55", "score": "0.57758045", "text": "def sort(spec = nil)\n configure(:sort, spec)\n end", "title": "" }, { "docid": "80d6855b536dd3bf55889293d1001830", "score": "0.5754673", "text": "def apply_sorting\n if spec = criteria.options[:sort]\n in_place_sort(spec)\n end\n end", "title": "" }, { "docid": "80d6855b536dd3bf55889293d1001830", "score": "0.5754673", "text": "def apply_sorting\n if spec = criteria.options[:sort]\n in_place_sort(spec)\n end\n end", "title": "" }, { "docid": "1c4fdef6dd0bb91c1dcc4d6a19a139d1", "score": "0.575256", "text": "def add_sort(sort) #:nodoc:\n @sort << sort\n end", "title": "" }, { "docid": "a48fb2ebf79b03ca17374a2e3102681b", "score": "0.5736511", "text": "def sort_query\n if @sort\n validates_sort\n \"sort=#{CGI.escape @sort.to_json}\"\n end\n end", "title": "" }, { "docid": "6bfd53bec0b1f0dd2f160cacc5484518", "score": "0.57295954", "text": "def sort_param\n search_params[:sort]\n rescue\n nil\n end", "title": "" }, { "docid": "a351157824c7bc3605f78d4b0c2ee27e", "score": "0.5694732", "text": "def sort\n params[:sort] || 'first_name'\n end", "title": "" }, { "docid": "ad1cffed8fd53eabc92ee0dda4a94614", "score": "0.5691079", "text": "def sort\n if params[:bUseDefaultSort] == 'true' and self.initial_order.present?\n column = self.columns.select{|c|c.name == self.initial_order.keys.first.to_s}.first\n direction = self.initial_order.values.first.to_s == \"asc\" ? 1 : -1\n else\n column = self.columns[params[:iSortCol_0].to_i]\n direction = params[:sSortDir_0] == \"asc\" ? 1 : -1\n end\n if column.sortable\n Squeel::Nodes::KeyPath.new(column.column_source.to_s.split('.') << Squeel::Nodes::Order.new(Squeel::Nodes::Stub.new(column.method_name.to_s), direction))\n end\n end", "title": "" }, { "docid": "c5a744a15fab5fe41082df1820516fc4", "score": "0.56881946", "text": "def resolution_sort=(resolution_sort)\n validator = EnumAttributeValidator.new('String', [\"Ascending\", \"Descending\"])\n unless validator.valid?(resolution_sort)\n fail ArgumentError, \"invalid value for 'resolution_sort', must be one of #{validator.allowable_values}.\"\n end\n @resolution_sort = resolution_sort\n end", "title": "" }, { "docid": "b3f43c8d1c5ef827baf4ba1205afb20f", "score": "0.56857115", "text": "def choose_sort(sender)\n set_states(@sort_by = sender.representedObject)\n refresh\n end", "title": "" }, { "docid": "4c088746c0a02869c06c8a62e212ac62", "score": "0.5685474", "text": "def clean_sort(params)\n case @sort_override || params[:sort_column_name]\n when 'response_due_on' # Soonest to end first\n (column = 'response_due_on') && (order = 'asc')\n when 'first_published_at' # Newest posted to oldest\n (column = 'first_published_at') && (order = 'desc')\n when 'updated_at' # Most recently updated\n (column = 'updated_at') && (order = 'desc')\n when 'relevance' # Most relevant first\n (column = 'response_due_on') && (order = 'asc') # TODO: Add relevance. Temporary fix\n else\n (column = 'response_due_on') && (order = 'asc')\n end\n OpportunitySort.new(default_column: column, default_order: order)\n end", "title": "" } ]
ba13e006aff44c9a07478b9600ab7b03
POST /area_editions POST /area_editions.json
[ { "docid": "5de89b8e146ac7f762e06b96e329e9da", "score": "0.7159524", "text": "def create\n @area_edition = @layout.area_editions.new(area_edition_params)\n\n respond_to do |format|\n if @area_edition.save\n format.html { redirect_to main_app.url_for([:edit, @product, @theme, @personalization, @layout, @area_edition]), notice: 'Area edition was successfully created.' }\n format.json { render :show, status: :created, location: @area_edition }\n else\n format.html { render :new }\n format.json { render json: @area_edition.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "b7dffee3429c9758b77e266174b304b9", "score": "0.66242385", "text": "def index\n @area_editions = @layout.area_editions.all\n end", "title": "" }, { "docid": "b61379707fe0dd22cd70965250ccb01e", "score": "0.6481441", "text": "def set_area_edition\n @area_edition = @layout.area_editions.find(params[:id])\n end", "title": "" }, { "docid": "43cadf6f56887e6a77acba635e923259", "score": "0.62490255", "text": "def areas\n @area = Area.new(geo_json: params.to_json)\n if @area.save\n json_response([id: @area.id], :created, :geo_json_recieved)\n else\n json_response(nil, :error, :db_error)\n end\n end", "title": "" }, { "docid": "cc9a7e4f41111d2efcc63b45125e40c9", "score": "0.58900535", "text": "def area_edition_params\n params.require(:area_edition).permit(:layout_id, :name, :required, :order, :area_type)\n end", "title": "" }, { "docid": "e7f62e63f4cd1ed03cfc8556aeff9b09", "score": "0.582633", "text": "def update\n respond_to do |format|\n if @area_edition.update(area_edition_params)\n format.html { redirect_to main_app.url_for([:edit, @product, @theme, @personalization, @layout, @area_edition]), notice: 'Area edition was successfully updated.' }\n format.json { render :show, status: :ok, location: @area_edition }\n else\n format.html { render :edit }\n format.json { render json: @area_edition.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc328c7ac786874624bc47228913bfe8", "score": "0.565963", "text": "def get_editions(params = {})\n get_json(get_editions_url(params))\n end", "title": "" }, { "docid": "74375e1927b7707419f946bb653c2a34", "score": "0.5632511", "text": "def create\n @area = Area.new(params[:area])\n\n respond_to do |format|\n if @area.save\n format.html { redirect_to areas_path, notice: 'Area was successfully created.' }\n format.json { render json: @area, status: :created, location: @area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a08d40c179a264871065b43673a2028c", "score": "0.56144994", "text": "def destroy\n @area_edition.destroy\n respond_to do |format|\n format.html { redirect_to main_app.url_for([@product, @theme, @personalization, @layout, :area_editions]), notice: 'Area edition was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a1954cab5a253987afea30ce826d2fd9", "score": "0.5599941", "text": "def create\n @area = Area.new(params[:area])\n\n respond_to do |format|\n if @area.save\n format.html { redirect_to @area, notice: 'Area was successfully created.' }\n format.json { render json: @area, status: :created, location: @area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a1954cab5a253987afea30ce826d2fd9", "score": "0.5599941", "text": "def create\n @area = Area.new(params[:area])\n\n respond_to do |format|\n if @area.save\n format.html { redirect_to @area, notice: 'Area was successfully created.' }\n format.json { render json: @area, status: :created, location: @area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a89e8f67ab19a5723287dd9db3209ccb", "score": "0.5567736", "text": "def create\n @area = Area.new(area_params)\n @area.skus = params[:area][:skus]\n respond_to do |format|\n if @area.save\n format.html { redirect_to admin_areas_path, notice: 'Area was successfully created.' }\n format.json { render :show, status: :created, location: @area }\n else\n format.html { render :new }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd38c86821f3ea96668bb0c1dbcd3e7f", "score": "0.5528696", "text": "def create\n @specialization_area = SpecializationArea.new(specialization_area_params)\n\n respond_to do |format|\n if @specialization_area.save\n format.html { redirect_to admin_specialization_area_path(@specialization_area), notice: 'Specialization area was successfully created.' }\n format.json { render :show, status: :created, location: @specialization_area }\n else\n format.html { render :new }\n format.json { render json: @specialization_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52f03f8e66ecd170b45c11b3d4196fc7", "score": "0.55030626", "text": "def create\n @breadcrumb = 'create'\n @area = Area.new(params[:area])\n @area.created_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @area.save\n format.html { redirect_to @area, notice: crud_notice('created', @area) }\n format.json { render json: @area, status: :created, location: @area }\n else\n @departments = departments_dropdown\n @workers = workers_dropdown\n format.html { render action: \"new\" }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c904cbd859b1d85301dec31dbe723a73", "score": "0.54823166", "text": "def create\r\n @area = Area.new(params[:area])\r\n\r\n respond_to do |format|\r\n if @area.save\r\n format.html { redirect_to areas_url(domain_id: @area.domain_id), notice: 'Area was successfully created.' }\r\n format.json { render json: @area, status: :created, location: @area }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @area.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "c65e5c846f819f9282b645e3d25165ca", "score": "0.5461182", "text": "def create\n @area = Area.new(area_params)\n @area.start_date = Date.today\n @area.active = true\n @area.status = \"in progress\"\n if @area.save\n redirect_to new_waste_info_path(area: @area), notice: \"#{@area.name} has been added to the system\"\n else\n flash[:error] = \"This area could not be created.\"\n render \"new\"\n end\n end", "title": "" }, { "docid": "458b645f99504d8bd55bc8967853e200", "score": "0.54205203", "text": "def set_district_area\n \n\t r = open(\"http://localhost:3001/district_areas/\" + params[:id] + \".json\").read\n\t #r = open(\"http://floating-chamber-80486.herokuapp.com/district_areas/1.json\").read\n\t hash = JSON.parse(r)\n\t upzsJSON = hash[\"upzs\"]\n\t hash.delete(\"url\")\n\t hash.delete(\"upzs\")\n\t p hash\n\t p upzsJSON\n\t @district_area = DistrictArea.new(hash)\n\t p @district_area.inspect\n\t \n\t upzsJSON.each do |currentUPZ|\n\t\t@district_area.upzs << Upz.new(currentUPZ)\n\t\tend\n\trescue \n\t\t p \"EL RECURSOO NO EXISTEEEEEE\"\n\t\trender json: {}, status: :ok\n\tend", "title": "" }, { "docid": "65fb157456ec65cf5363315e565aa8f6", "score": "0.5414594", "text": "def create\n @postulate_area_interest = PostulateAreaInterest.new(postulate_area_interest_params)\n\n respond_to do |format|\n if @postulate_area_interest.save\n format.html { redirect_to @postulate_area_interest }\n format.json { render :show, status: :created, location: @postulate_area_interest }\n else\n format.html { render :new }\n format.json { render json: @postulate_area_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "feaa1be77f3d149ddbcfb833090bb29f", "score": "0.53879344", "text": "def area_params\n params.require(:area).permit(:code, :name, :reservable, :status, :area_id, :institute_id,\n resources_attributes: [:id, :code, :name, :description, :movil, :pedagogic, :resource_id, :area_id, :_destroy])\n end", "title": "" }, { "docid": "84e3c37cbb63cdec5f8a6ad542c68ae0", "score": "0.53692734", "text": "def create\n #return render json: params[:recursos]\n @area = Area.new(area_params)\n @count = 0\n save_multiples_recursos if params[:recursos][:status] == '1'\n respond_to do |format|\n if @area.save\n format.html { redirect_to areas_path, notice: 'El Área fue creada éxitosamente.' }\n format.json { render :show, status: :created, location: @area }\n else\n format.html { render :new }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f178f3bd6da6115da681ff3f33b57cfe", "score": "0.5361312", "text": "def create\n @interest_area = InterestArea.new(params[:interest_area])\n\n respond_to do |format|\n if @interest_area.save\n format.html { redirect_to @interest_area, notice: 'Interest area was successfully created.' }\n format.json { render json: @interest_area, status: :created, location: @interest_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interest_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3af6ecee1048f974abadca2a63418302", "score": "0.53437614", "text": "def area_params\n params.require(:area).permit(:name, :active, :start_date, :end_date, :status, :audit_id)\n end", "title": "" }, { "docid": "a0870a21c8dd8186b8285f0d220eb247", "score": "0.532764", "text": "def create\n require_user()\n @area_of_expertise = AreaOfExpertise.new(area_of_expertise_params)\n\n respond_to do |format|\n if @area_of_expertise.save\n format.html { redirect_to @area_of_expertise, notice: 'Area of expertise was successfully created.' }\n format.json { render :show, status: :created, location: @area_of_expertise }\n else\n format.html { render :new }\n format.json { render json: @area_of_expertise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7053ea1dcc165e23481f458fa023ba3d", "score": "0.5290885", "text": "def json_entry_params\n params.require(:json_entry).permit(:area_id, :data, :name, :verb, :post_body)\n end", "title": "" }, { "docid": "95ff4d1e68e516258bd34e2c768dab2a", "score": "0.525103", "text": "def create\n @region = Region.new(region_params)\n\n respond_to do |format|\n if @region.save\n format.html { redirect_to regions_path, notice: 'Region was successfully created.' }\n format.json { render :show, status: :created, location: @region }\n else\n @region_areas = region_areas(@region, false)\n format.html { render :new }\n format.json { render json: @region.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6cf126264e43315d96337fda50ff6227", "score": "0.52487075", "text": "def create\n @sub_area = SubArea.new(sub_area_params)\n\n respond_to do |format|\n if @sub_area.save\n format.html { redirect_to @sub_area, notice: 'Sub area was successfully created.' }\n format.json { render :show, status: :created, location: @sub_area }\n else\n format.html { render :new }\n format.json { render json: @sub_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2451eaa7e536aee152ea49baa7ab12d9", "score": "0.5243729", "text": "def create\n @research_area = ResearchArea.create(research_area_params)\n\n respond_to do |format|\n if @research_area.save\n format.html { redirect_to @research_area, notice: 'Research area was successfully created.' }\n format.json { render :show, status: :created, location: @research_area }\n else\n format.html { render :new }\n format.json { render json: @research_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "822b0a1f92bbb9439fd7e6241911c05c", "score": "0.5219913", "text": "def create\n @runner = Runner.new(runner_params)\n @runner.status = true\n @area = Area.find_by(name: @runner.area)\n @runner.area_id = @area.id\n respond_to do |format|\n if @runner.save\n format.html { redirect_to @runner, notice: 'Runner was successfully created.' }\n format.json { render :show, status: :created, location: @runner }\n else\n format.html { render :new }\n format.json { render json: @runner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16bbf203c864091fdf9af0edb7d351ac", "score": "0.51790094", "text": "def set_gestor_area\n @gestor_area = GestorArea.find(params[:id])\n end", "title": "" }, { "docid": "d0aa5753696cccbb352c2f89ff200427", "score": "0.5178775", "text": "def create\n @employee = Employee.new(employee_params.except(:area))\n @employee.area = employee_params[:area].to_i\n respond_to do |format|\n if @employee.save\n format.html { redirect_to @employee, notice: \"Employee was successfully created.\" }\n format.json { render :show, status: :created, location: @employee }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @employee.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "333e05dfa1abdb03ed2a8aeb8ead3848", "score": "0.5175197", "text": "def new\n @area = Area.new\n @other_areas = Area.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end", "title": "" }, { "docid": "f5b6ffbfc20dad0b1ebac458e046ab49", "score": "0.5156825", "text": "def create\n @evaluation = Evaluation.new(evaluation_params)\n\n if @evaluation.save\n flash[:success] = 'Evaluación creada con éxito.'\n if @evaluation.is_a? Course and params[:areas]\n params[:areas].each do |a|\n\n area = Area.find a\n area.inscriptions.preinscrito.each do |pr|\n pr.evaluation_id = @evaluation.id\n pr.save\n end\n\n @evaluation.area_courses.create(area_id: a)\n end\n end\n else\n flash[:danger] = \"Error: #{@evaluation.errors.full_messages.to_sentence}\"\n end\n\n redirect_back fallback_location: \"#{evaluations_path}?#{@evaluation.type}=true\"\n\n end", "title": "" }, { "docid": "d7c9bcf89285387c2618a87229df04c4", "score": "0.51452583", "text": "def set_area\n @area = Area.find_by_id(params[:id])\n if @area.blank?\n json_response(nil, :unprocessable_entity, :invalid_id)\n end\n end", "title": "" }, { "docid": "3b655eaf53c05cb281384c8827258c57", "score": "0.5132265", "text": "def create\n @district_area = DistrictArea.new(district_area_params)\n\n respond_to do |format|\n if @district_area.save\n format.html { redirect_to @district_area, notice: 'District area was successfully created.' }\n format.json { render :show, status: :created, location: @district_area }\n else\n format.html { render :new }\n format.json { render json: @district_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b655eaf53c05cb281384c8827258c57", "score": "0.5132265", "text": "def create\n @district_area = DistrictArea.new(district_area_params)\n\n respond_to do |format|\n if @district_area.save\n format.html { redirect_to @district_area, notice: 'District area was successfully created.' }\n format.json { render :show, status: :created, location: @district_area }\n else\n format.html { render :new }\n format.json { render json: @district_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6cb92276cbd6ef08141d246bdcd037c4", "score": "0.51206493", "text": "def create\n @researcharea = Researcharea.new(params[:researcharea])\n\n respond_to do |format|\n if @researcharea.save\n format.html { redirect_to @researcharea, notice: 'Research area was successfully created.' }\n format.json { render json: @researcharea, status: :created, location: @researcharea }\n else\n format.html { render action: \"new\" }\n format.json { render json: @researcharea.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e3d3ba5896aa5c5c5e6089a0ac7d5948", "score": "0.51125807", "text": "def new\n @proposal = Proposal.new\n @proposal.area_tags = [Area.find(params[:area_id]).area_tag.name_es] if params[:area_id]\n respond_to do |format|\n format.html\n format.floki { render :action => 'new.floki', :content_type => 'application/json', :layout => false}\n end\n end", "title": "" }, { "docid": "529c31d46a8a1538933ad343f22bf4a0", "score": "0.5106868", "text": "def create\n #params[:area] == {\"parent_id\"=>\"21\",\"name\"=>\"test4\"} parent id from hidden field, name from field\n @area = Area.new(params[:area])\n\n respond_to do |format|\n if @area.save\n #format.html { redirect_to(@area, :notice => 'Area was successfully created.') }\n format.html { redirect_to(locations_url, :notice => \"#{@area.to_s} was successfully created.\") }\n format.xml { render :xml => @area, :status => :created, :location => @area }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @area.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e2d18c8a4aeaf56055bc13bd67efd116", "score": "0.5105654", "text": "def create\n @issue_area = IssueArea.new(issue_area_params)\n\n respond_to do |format|\n if @issue_area.save\n format.html { redirect_to @issue_area, notice: 'Issue area was successfully created.' }\n format.json { render :show, status: :created, location: @issue_area }\n else\n format.html { render :new }\n format.json { render json: @issue_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "996e90b408ab1e88ea7912cfffc3fc36", "score": "0.5097092", "text": "def create\n @practice_area = PracticeArea.new(practice_area_params)\n\n respond_to do |format|\n if @practice_area.save\n format.html { redirect_to @practice_area, notice: 'Practice area was successfully created.' }\n format.json { render :show, status: :created, location: @practice_area }\n else\n format.html { render :new }\n format.json { render json: @practice_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06845b7ae42ce03385c1659d246df278", "score": "0.50867957", "text": "def area_params\n params.require(:area).permit(:name, :theme_id, :label, :position, :navigation, :footer, :comments, :ascending, :mode, :paid, :restricted, array: [:sku])\n end", "title": "" }, { "docid": "4a278ceb1d5e01eb81bbe4c19cc7eba5", "score": "0.50856525", "text": "def create\n @survey_area = SurveyArea.new(params[:survey_area])\n\n respond_to do |format|\n if @survey_area.save\n format.html { redirect_to @survey_area, notice: 'Survey area was successfully created.' }\n format.json { render json: @survey_area, status: :created, location: @survey_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5068399e96cded4d3623a635730a9e24", "score": "0.50827014", "text": "def create\n @area = Area.new(params[:area])\n\n respond_to do |format|\n if @area.save\n flash[:notice] = 'Area was successfully created.'\n format.html { redirect_to(@area) }\n format.xml { render :xml => @area, :status => :created, :location => @area }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @area.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c94f47e03cbf2f0ab976b84892551a79", "score": "0.50795954", "text": "def create\n @group_area = GroupArea.new(params[:group_area])\n\n respond_to do |format|\n if @group_area.save\n format.html { redirect_to @group_area, notice: 'Group area was successfully created.' }\n format.json { render json: @group_area, status: :created, location: @group_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "01eb0a4a8b7f7de70825a85f7ebc3f79", "score": "0.5045188", "text": "def gestor_area_params\n params.require(:gestor_area).permit(:area_id, :pessoa_id, :data_inicio, :data_termino, :ativo)\n end", "title": "" }, { "docid": "012b78ad1b5b593223987b526b9a212e", "score": "0.50371706", "text": "def create\n @area = Area.new(params[:area])\n @area.parent_id = params[:parent_id]\n respond_to do |format|\n if @area.save\n flash[:notice] = 'Area was successfully created.'\n format.html { redirect_to(@area) }\n format.xml { render :xml => @area, :status => :created, :location => @area }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @area.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "94c67a6d909d63cd9cdf1c926af7102e", "score": "0.5030059", "text": "def create\n @area_attribute = AreaAttribute.new(area_attribute_params)\n\n respond_to do |format|\n if @area_attribute.save\n format.html { redirect_to @area_attribute, notice: 'Area attribute was successfully created.' }\n format.json { render action: 'show', status: :created, location: @area_attribute }\n else\n format.html { render action: 'new' }\n format.json { render json: @area_attribute.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49e252561e15c9d9e655afaed6c3f95f", "score": "0.50243664", "text": "def area_params\n permitted = ProductionArea.globalize_attribute_names + [:edrpou_code, :site, :railway_track, :railway_distance,\n :trucks_road, :state_road_distance, :airport_distance,\n :total_area, :building_year, :free_floors_count,\n :free_floors, :production_area, :additional, :phone,\n :email, :rent_year, :sale, :date_info, :main_image,\n :gis_type_name, :status, :map_layer_id, :ownership_id,\n questionnaire_images_attributes: %i[id imgable_type\n imgable_id _destroy],\n questionnaire_file_attributes: %i[id fileable_type file\n fileable_id _destroy],\n geo_json_attributes: %i[id geo_type position],\n balancer_ids: [], infrastructure_type_ids: []]\n params.require(:production_area).permit(permitted)\n end", "title": "" }, { "docid": "0797813d15959aa40a6158274670e2ab", "score": "0.50088066", "text": "def create\n @area = Area.new(area_params)\n if @area.save\n flash[:success] = 'Area was successfully created.'\n redirect_to :back\n else\n flash[:danger] = 'Area was not created.'\n redirect_to :back\n end\n end", "title": "" }, { "docid": "b4cb5e1952b53b4614fe9affe3abdc18", "score": "0.49861875", "text": "def create\n @country_area = CountryArea.new(params[:country_area])\n\n respond_to do |format|\n if @country_area.save\n format.html { redirect_to @country_area, notice: 'Country area was successfully created.' }\n format.json { render json: @country_area, status: :created, location: @country_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @country_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1fd2f1c6948ab2770169b6e0ab5c6abb", "score": "0.4982913", "text": "def new\n @area = Area.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end", "title": "" }, { "docid": "1fd2f1c6948ab2770169b6e0ab5c6abb", "score": "0.4982913", "text": "def new\n @area = Area.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end", "title": "" }, { "docid": "c2342f2b401f3a5faa2389240fe13369", "score": "0.49804842", "text": "def create\n @idea = current_member.ideas.new(idea_params) \n respond_to do |format|\n sectors_params.delete(\"\")\n if @idea.save\n sectors_params.each do |k|\n @idea.sectors << Sector.find_by(id:k)\n end\n format.json { head :no_content }\n format.js\n else\n\n format.json { render :json => { :error => @idea.errors.full_messages }, :status => 422 }\n end\n \n end\n end", "title": "" }, { "docid": "e150ccd604eb4ac63c1b7d2a25500a4e", "score": "0.49784404", "text": "def sub_area_params\n params.require(:sub_area).permit(:code_capes, :title, :description, :area_id)\n end", "title": "" }, { "docid": "81ca27240ec4aa409e37c4d2b997ce9f", "score": "0.4951357", "text": "def create\n input_params = rescue_action_area_params\n input_params[:rescue_action_id] = params[:rescue_action_id]\n\n @rescue_action_area = RescueActionArea.new(input_params)\n\n respond_to do |format|\n if @rescue_action_area.save\n format.html { redirect_to rescue_action_area_path(@rescue_action_area.rescue_action.id, @rescue_action_area.id), notice: 'Rescue action area was successfully created.' }\n format.json { render :show, status: :created, location: @rescue_action_area }\n else\n format.html { render :new }\n format.json { render json: @rescue_action_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e91046d7faeb03a546c06c1bb721383", "score": "0.49287087", "text": "def create\n @lab_area = LabArea.new(lab_area_params)\n\n respond_to do |format|\n if @lab_area.save\n format.html { redirect_to @lab_area, notice: 'Lab area was successfully created.' }\n format.json { render :show, status: :created, location: @lab_area }\n else\n format.html { render :new }\n format.json { render json: @lab_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3810bd5290276fccb175e80fe03efb86", "score": "0.49281716", "text": "def areas\n aux = WorkOrderArea.by_name\n render json: serialized_work_order_areas(aux)\n end", "title": "" }, { "docid": "ae2916fc37b4378175e1a562030e3aba", "score": "0.49241486", "text": "def new\n @breadcrumb = 'create'\n @area = Area.new\n @departments = departments_dropdown\n @workers = workers_dropdown\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @area }\n end\n end", "title": "" }, { "docid": "12440b2ea7079de9a4d196d39b7aec64", "score": "0.49207354", "text": "def area_params\n params.require(:area).permit(:name,:wards_attributes => [ :id,:name,:ward_no,:mun_ref,:_destroy])\n end", "title": "" }, { "docid": "f21ede742d3e8bda45756b98465506ea", "score": "0.49148163", "text": "def create\n if !has_right?(:create)\n redirect_to :unauthorized\n return\n end\n @section_preview = SectionPreview.new(params[:section_preview])\n create_new_objects(:property => params[:property],\n \t\t\t\t\t\t\t\t\t :image_storage => params[:image_storage],\n \t\t\t\t\t\t\t\t\t :asset => params[:asset],\n \t\t\t\t\t\t\t\t\t :resource => @section_preview) ### Add to all resources\n end", "title": "" }, { "docid": "a9178c7f764e6ac4e49882bd66cd002d", "score": "0.49133742", "text": "def set_area\n @area = Area.find(params[:area_id])\n end", "title": "" }, { "docid": "b9f46b6e2dd13faef795ef6f055ec394", "score": "0.4909048", "text": "def create\n \n if params[:parent_id]\n @parent_area = Area.find(params[:parent_id]) \n @area = @parent_area.children.build(params[:area]) \n else\n @area = Area.new(params[:area]) \n end\n \n @errors = []\n \n #Me fijo que haya seleccionado al menos un coordinador válido para el área.\n @project_leaders = @area.project_leaders.split(%r{,\\s*})\n if !project_leaders_valid?(@project_leaders) \n @errors = @errors.concat([\"Debe seleccionar un coordinador válido para el área \" + @area.name])\n end\n \n if @errors.empty? && @area.valid?\n @area.save\n set_project_leaders(@project_leaders, @area)\n end\n respond_with(@area)\n end", "title": "" }, { "docid": "08edd05e340fd4b3267fa57d86a3489a", "score": "0.4908374", "text": "def create\n @election = Election.new(election_params)\n respond_to do |format|\n if @election.save\n format.html { redirect_to [:admin, @election], notice: 'Election was successfully created.' }\n format.json { render :show, status: :created, location: @election }\n else\n format.html { render :new }\n format.json { render json: @election.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc0a10eeedd5588f62315428e44f234e", "score": "0.4907609", "text": "def create\n @userarea = Userarea.new(userarea_params)\n\n respond_to do |format|\n if @userarea.save\n format.html { redirect_to @userarea, notice: 'Userarea was successfully created.' }\n format.json { render :show, status: :created, location: @userarea }\n else\n format.html { render :new }\n format.json { render json: @userarea.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96d7d619e738908cbb4051ccaedb1407", "score": "0.4906048", "text": "def create\n @area_code = AreaCode.new(area_code_params)\n\n respond_to do |format|\n if @area_code.save\n format.html { redirect_to @area_code, notice: 'Area code was successfully created.' }\n format.json { render :show, status: :created, location: @area_code }\n else\n format.html { render :new }\n format.json { render json: @area_code.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aebfd0ad7379a39099ca0579f101a03c", "score": "0.49036637", "text": "def area_params\n params.require(:area).permit(:name)\n end", "title": "" }, { "docid": "2cec28b228a6e46d7831170df17f3e92", "score": "0.49018976", "text": "def new\n if params[:area_id]\n @parent_area = Area.find(params[:area_id]) \n @area = @parent_area.children.build \n else\n @area = Area.new \n end\n @area.project_leaders = []\n respond_with(@area)\n \n end", "title": "" }, { "docid": "6e94582d89719cf5f88f46d0b19b075d", "score": "0.49005473", "text": "def create\n @area_type = AreaType.new(params[:area_type])\n\n respond_to do |format|\n if @area_type.save\n format.html { redirect_to @area_type, notice: 'Area type was successfully created.' }\n format.json { render json: @area_type, status: :created, location: @area_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @area_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9519cb1553209f546f05bc9dde155e5e", "score": "0.48996383", "text": "def new_service_area_params\n params.require(:service_area).permit(:state, :description)\n end", "title": "" }, { "docid": "dc5e694cfb1c0f916fa5c3e4778695aa", "score": "0.4898587", "text": "def create\n @post_code_electorate_map = PostCodeElectorateMap.new(post_code_electorate_map_params)\n\n respond_to do |format|\n if @post_code_electorate_map.save\n format.html { redirect_to @post_code_electorate_map, notice: 'Post code electorate map was successfully created.' }\n format.json { render :show, status: :created, location: @post_code_electorate_map }\n else\n format.html { render :new }\n format.json { render json: @post_code_electorate_map.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8669f47e6d1ea20aee5944c6aae396d", "score": "0.48977378", "text": "def election_params\n params.require(:election).permit(:title, :start_date, :finish_date, :status, :category_id)\n end", "title": "" }, { "docid": "e0db9ecbf82996a1d7bb50ce82849ef1", "score": "0.48932254", "text": "def lab_area_params\n params.require(:lab_area).permit(:fk_region_id, :area_number, :is_active, :name, :sort_order)\n end", "title": "" }, { "docid": "760e16e77e4e22e6758cee56d63f61c1", "score": "0.4892877", "text": "def create\n @areas_skill = AreasSkill.new(areas_skill_params)\n\n respond_to do |format|\n if @areas_skill.save\n format.html { redirect_to @areas_skill, notice: 'Areas skill was successfully created.' }\n format.json { render :show, status: :created, location: @areas_skill }\n else\n format.html { render :new }\n format.json { render json: @areas_skill.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c4b882f0a45b9cac0d2b5bf201a5b437", "score": "0.4883623", "text": "def add_area(area)\n @areas[area.type] = {} unless @areas[area.type]\n @areas[area.type][area.key] = area\n end", "title": "" }, { "docid": "cedb55cdb3387f3891efefbd8d4cde46", "score": "0.4874494", "text": "def expedition_params\n params.require(:expedition).permit(:astronaut, :planet_id, :start_date, :end_date, astronaut_ids: [])\n end", "title": "" }, { "docid": "0159590b827836614e9c686035dad339", "score": "0.48742443", "text": "def set_area\n @area = Area.find(params[:id])\n end", "title": "" }, { "docid": "8018e3dab10f8a064fa922c52c0d6d91", "score": "0.48725632", "text": "def create\n\n has = params[\"area\"].to_json\n data_has = JSON.parse(has)\n @zone = Zone.new();\n @zone.nombre_zona = params[\"nombre_zona\"]\n @zone.color = params[\"color\"]\n\n respond_to do |format|\n if @zone.save\n \n data_has.each do |geo|\n @coordenada = CoordinateZone.new()\n geo.each do |data|\n @coordenada.zone_id = @zone.id\n @coordenada.latitud = data[\"lat\"].to_f\n @coordenada.longitud = data[\"lng\"].to_f \n end\n @coordenada.save\n end\n\n format.html { redirect_to @zone, notice: 'Zone was successfully created.' }\n format.js \n # format.js { render js: \"window.location.href=#{ directories_path }\" }\n format.json { render :show, status: :created, location: @zone }\n \n else\n format.html { render :new }\n format.json { render json: @zone.errors, status: :unprocessable_entity }\n end\n\n end\n end", "title": "" }, { "docid": "4c9928f3e5d33d75b93882f8d334a9cd", "score": "0.48709798", "text": "def create\n begin\n @area = Area.new(params[:area])\n\n @area.save!\n\n flash[:notice] = t(:success_created, :id => @area.id)\n redirect_to(areas_url)\n rescue => e\n# flash[:error] = t(:error_default, :message => e.message)\n render :action => :new\n end\n end", "title": "" }, { "docid": "9cf0e778252a60c0930f8e6fafb39d15", "score": "0.48662668", "text": "def index\n @area_attributes = AreaAttribute.all\n end", "title": "" }, { "docid": "3ab5d11c775bc8e5ef57f7196eb58d62", "score": "0.48595837", "text": "def rescue_action_area_params\n params.require(:rescue_action_area).permit(:name, :points, :latitude, :longitude, :zoom_level)\n end", "title": "" }, { "docid": "dd5bdac8eba19d8802ea7e9f707a74f3", "score": "0.48442373", "text": "def store_area_params\n params.require(:store_area).permit(:area_id, :area_name)\n end", "title": "" }, { "docid": "04954a2770a57a9cb0f9a5b954cad1f5", "score": "0.48414457", "text": "def create\n @question_content_area = QuestionContentArea.new(params[:question_content_area])\n\n respond_to do |format|\n if @question_content_area.save\n format.html { redirect_to @question_content_area, notice: 'Question content area was successfully created.' }\n format.json { render json: @question_content_area, status: :created, location: @question_content_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question_content_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "359d39b65d6ed77b55c778f60d823484", "score": "0.48332238", "text": "def create\n @curriculum_area = CurriculumArea.new(curriculum_area_params)\n\n respond_to do |format|\n if @curriculum_area.save\n format.html { redirect_to [:admin, @curriculum_area], notice: 'Curriculum area was successfully created.' }\n format.json { render json: @curriculum_area, status: :created }\n else\n format.html { render action: \"new\" }\n format.json { render json: @curriculum_area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abb77cc295285b669dbdede12a17948f", "score": "0.4820054", "text": "def sub_area_params\n params.require(:sub_area).permit(:name, :area_id, :sub_area_id)\n end", "title": "" }, { "docid": "96a99c00e2e9c55d6d4b0b445c9832e0", "score": "0.48193628", "text": "def set_postulate_area_interest\n @postulate_area_interest = PostulateAreaInterest.find(params[:id])\n end", "title": "" }, { "docid": "a47d8758f89978bd9dc400253bebe93e", "score": "0.48033297", "text": "def create\n @tarea = Tarea.new(tarea_params)\n\n respond_to do |format|\n if @tarea.save\n format.html { redirect_to @tarea, notice: 'Tarea was successfully created.' }\n format.json { render :show, status: :created, location: @tarea }\n else\n format.html { render :new }\n format.json { render json: @tarea.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10c05508ba6210ef060cd91c5c5642e3", "score": "0.48029017", "text": "def create\n @offices = Office.create!(office_params)\n json_response(@offices, :created)\n end", "title": "" }, { "docid": "4d46a3db2067d6fe657829a256f0fc93", "score": "0.47983664", "text": "def create\n @encounter_area_feature = EncounterAreaFeature.new(params[:encounter_area_feature])\n\n respond_to do |format|\n if @encounter_area_feature.save\n format.html { redirect_to(@encounter_area_feature.encounter.adventure, :notice => 'Encounter area feature was successfully created.') }\n format.xml { render :xml => @encounter_area_feature, :status => :created, :location => @encounter_area_feature }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @encounter_area_feature.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a859fd20bede2f8e3c34dd93d7c10bd", "score": "0.47982603", "text": "def create\n @evaluation = Evaluation.new(evaluation_params)\n @evaluation.collection = evaluation_params[:collection]\n \n\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to @evaluation, notice: \"Evaluation was successfully created.\" }\n format.json { render :show, status: :created, location: @evaluation }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fbb12bc6880a6990404e83896f529b19", "score": "0.47975475", "text": "def index\n @areas = Area.with_ordered_countries\n respond_with(@areas)\n end", "title": "" }, { "docid": "eb6c40e23c24fad8d23f3ea65f468fdc", "score": "0.47710362", "text": "def index\n @specialization_areas = SpecializationArea.all\n end", "title": "" }, { "docid": "4514bc715e10d427eddfad570192c0c9", "score": "0.476495", "text": "def set_area\n @area = Area.find(params[:id])\n end", "title": "" }, { "docid": "4514bc715e10d427eddfad570192c0c9", "score": "0.476495", "text": "def set_area\n @area = Area.find(params[:id])\n end", "title": "" }, { "docid": "4514bc715e10d427eddfad570192c0c9", "score": "0.476495", "text": "def set_area\n @area = Area.find(params[:id])\n end", "title": "" }, { "docid": "512451398ea95dc464c98f26e9cf8aab", "score": "0.4760626", "text": "def update\n respond_to do |format|\n @area.skus = params[:area][:skus]\n if @area.update area_params\n format.html { redirect_to admin_areas_path, notice: 'Area was successfully updated.' }\n format.json { render :show, status: :ok, location: @area }\n else\n format.html { render :edit }\n format.json { render json: @area.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fb8492a74af932fde2900e23eea339b", "score": "0.47554606", "text": "def index\n @postulate_area_interests = PostulateAreaInterest.all\n end", "title": "" }, { "docid": "deb65666480caa1475c074d628e82336", "score": "0.47525433", "text": "def new\n @researcharea = Researcharea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @researcharea }\n end\n end", "title": "" }, { "docid": "0343dfea854e633b04cc6e09176c8bf3", "score": "0.47525138", "text": "def areas()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Areas::AreasRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "9dfa4d5af8a041ab8003b20f20563d2b", "score": "0.47423774", "text": "def update\n respond_to do |format|\n if @postulate_area_interest.update(postulate_area_interest_params)\n format.html { redirect_to @postulate_area_interest }\n format.json { render :show, status: :ok, location: @postulate_area_interest }\n else\n format.html { render :edit }\n format.json { render json: @postulate_area_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fec0f8db91bafbec83d8c334c3957254", "score": "0.47379404", "text": "def new\n @interest_area = InterestArea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interest_area }\n end\n end", "title": "" }, { "docid": "9f6637b18f8972e08d6cccb2530b4827", "score": "0.47319344", "text": "def post_amenities\n return if @amenities.nil?\n\n if @amenities.empty?\n Rentlinx.client.unpost_amenities_for(self)\n else\n Rentlinx.client.post_amenities(@amenities)\n end\n end", "title": "" } ]
d5dce0c417cbfb224f7ff65c46027ba7
array of values in the BST when the BST is traveresed inorder
[ { "docid": "a2fc8bcb3affae659c675147869f768f", "score": "0.6649827", "text": "def inorder\n\t\ttree_data = []\n\t\ttree_data = inorder_traverse(@root, tree_data)\n\tend", "title": "" } ]
[ { "docid": "225eb8f1b0dd93a38f235988930f7516", "score": "0.76707506", "text": "def inorder\n current = @root\n values = []\n if current != nil\n current.inorder(values)\n end\n return values\n end", "title": "" }, { "docid": "f4042a761ccf9b15032270695d0f27b8", "score": "0.7405927", "text": "def inorder\n arr = []\n in_order(@root, arr)\n return arr\n end", "title": "" }, { "docid": "5fb8f69921d45a86a80a8ee207f690e8", "score": "0.73282593", "text": "def inorder\n root_node = @root\n array = []\n return bst_inorder(root_node, array)\n end", "title": "" }, { "docid": "e16f8ae191bf97e1194066f7c1bf2f47", "score": "0.7327329", "text": "def bfs\n array = []\n return array if @root.nil?\n\n array << {:key=> @root.key, :value=> @root.value}\n\n # load a queue\n queue = Queue.new\n queue << @root.left if @root.left\n queue << @root.right if @root.right\n\n until queue.empty? \n cur = queue.shift \n array << {:key=> cur.key, :value=> cur.value}\n queue << cur.left if cur.left\n queue << cur.right if cur.right\n\n end\n\n return array\n end", "title": "" }, { "docid": "20d214905ed9c38e5887f2c80fcee0ec", "score": "0.732474", "text": "def bfs\n return [] if @root.nil?\n queue = [@root]\n nodes_array = []\n\n while queue.length > 0\n node = queue.shift # take first element, delete it from array\n nodes_array << {:key => node.key, :value => node.value} # add to results\n queue << node.left if node.left # add left node to array if it exists\n queue << node.right if node.right # add right node to array if it exists\n end\n return nodes_array\n end", "title": "" }, { "docid": "e04c7dbacf3e9b672a3b6e1ec5570138", "score": "0.73102415", "text": "def inorder(root = @root, temparr = [])\n\n\t\tif root\n\t\tinorder(root.left_children, temparr)\n\t\ttemparr << root.value\n\t\tinorder(root.right_children,temparr)\n\t\tend\n\t\treturn temparr\n\tend", "title": "" }, { "docid": "0234dc091afda8d85349596f820bd721", "score": "0.7305986", "text": "def inorder\n node = @root\n return [] if (node.nil?)\n inorder_array = []\n inorder_helper(node.left, inorder_array)\n inorder_array << {key: node.key, value: node.value}\n\n inorder_helper(node.right, inorder_array)\n\n return inorder_array\n end", "title": "" }, { "docid": "c4c23493bd5b0217593eb2b42cfe7655", "score": "0.72612053", "text": "def inorder\n return [] if !@root\n values = []\n inorder_key(@root, values)\n end", "title": "" }, { "docid": "623d77e01f50f3c8b9918cc8d29b9d60", "score": "0.72455287", "text": "def BST_sequences(root_node)\n results = [root_node.value]\n\n\n\n\n\nend", "title": "" }, { "docid": "180dae63fd92807a48f0d1e1f9afd246", "score": "0.7211695", "text": "def inorder\n array = []\n return array if @root.nil?\n inorder_helper(array, @root)\n return array\n end", "title": "" }, { "docid": "bee98ff5fc6c957945655210aee5357b", "score": "0.72077036", "text": "def inorder\n current = root\n stack = []\n output = []\n while current || !stack.empty?\n while !current.nil?\n stack.push(current)\n current = current.left\n end\n current = stack.pop\n new_hash = Hash.new\n new_hash[:key] = current.key\n new_hash[:value] = current.value\n output.push(new_hash); #storing the data\n current = current.right\n end\n return output\n end", "title": "" }, { "docid": "ffb7873a748b6bbfd54e25796cd8b36b", "score": "0.71960926", "text": "def inorder\n ret = Array.new\n inorderHelper @root, ret\n return ret\n end", "title": "" }, { "docid": "ffb7873a748b6bbfd54e25796cd8b36b", "score": "0.71960926", "text": "def inorder\n ret = Array.new\n inorderHelper @root, ret\n return ret\n end", "title": "" }, { "docid": "94d231d4ba070dfd41c5bb28f1940e45", "score": "0.7190784", "text": "def bfs\n queue = Queue.new\n if @root.nil?\n return []\n end\n array = []\n queue.push(@root)\n while !queue.empty? \n node = queue.pop\n array.push({:key => node.key, :value => node.value})\n if !node.left.nil?\n queue.push(node.left)\n end\n if !node.right.nil?\n queue.push(node.right)\n end\n end\n return array\n end", "title": "" }, { "docid": "580b2181159c8744fe7f953a7a0ff09e", "score": "0.71454823", "text": "def inorder\n nodes_array = []\n inorder_helper(@root, nodes_array)\n return nodes_array\n end", "title": "" }, { "docid": "8f264535c86b8f1b3ece6b12d5fdb0bc", "score": "0.71454084", "text": "def inorder\n traversal = []\n traversal.concat(self.left.inorder) if self.left\n traversal << self.value\n traversal.concat(self.right.inorder) if self.right\n traversal\n end", "title": "" }, { "docid": "a07b5de3c3aed9dfcb278a52dded8b20", "score": "0.7139554", "text": "def in_order(node = @root, array = [])\n return [node.value] unless node.children\n\n if node.left\n node.left.children ? in_order(node.left, array) : array.push(node.left.value)\n end\n\n array.push(node.value)\n\n if node.right\n node.right.children ? in_order(node.right, array) : array.push(node.right.value)\n end\n\n array\n end", "title": "" }, { "docid": "41a60a59ffb400e77a7b7040f8f86292", "score": "0.7133388", "text": "def bfs\n q = [@root]\n ary = []\n while !q.empty?\n current = q.pop\n q << current.left if current.left\n q << current.right if current.right\n ary << { :key => current.key, :value => current.value }\n end\n return ary\n end", "title": "" }, { "docid": "9e4a09d69cb2c95ffb5c1974bf4e4201", "score": "0.7123127", "text": "def inorder\n tree = []\n tree << left.inorder unless left.nil?\n tree << val\n tree << right.inorder unless right.nil?\n\n tree\n end", "title": "" }, { "docid": "8905dbd992e8a262b12b0e33b185f73d", "score": "0.71195394", "text": "def inorder(root = @root, ary = [])\n return root if root.nil?\n\n inorder(root.left_child, ary)\n ary.push(root.value)\n inorder(root.right_child, ary)\n ary\n end", "title": "" }, { "docid": "0c1b2e7dc50d40c3d1b8536b5296462d", "score": "0.7111477", "text": "def inorder\n tree_array = []\n current_node = @root\n while current_node\n tree_array.push({:key => current_node.key, :value => current_node.value})\n end\n \n end", "title": "" }, { "docid": "746a269a82689c74bea1942634546ddd", "score": "0.7082133", "text": "def inorder\n \n return [] if @root.nil?\n return @root.inorder\n\n end", "title": "" }, { "docid": "2b918ae5e184c2d47cae4fee3ef3be1a", "score": "0.70819974", "text": "def bfs\n return [] unless @root\n array = [@root]\n i = 0\n current = @root\n length = 1\n until (i == length - 1) && (current.left == nil) && (current.right == nil)\n if current.left\n array.push(current.left)\n length += 1\n end\n if current.right\n array.push(current.right)\n length += 1\n end\n i += 1\n current = array[i]\n end\n return array.map do |node|\n { key: node.key, value: node.value }\n end\n end", "title": "" }, { "docid": "174c7e2eb212f60d1b51f4cc833f6dfd", "score": "0.7071469", "text": "def inorder\n # return an array\n inorder_helper(@root, [])\n end", "title": "" }, { "docid": "29efb4b49644bb3761b47a08d9da8653", "score": "0.70693314", "text": "def inorder\n inorder_array = []\n current = @root\n\n return inorder_array if current.nil?\n\n return inorder_helper(current, inorder_array)\n end", "title": "" }, { "docid": "b4425afa7a5ce4bf0a6f696d74798188", "score": "0.7057426", "text": "def inorder\n inorder_array = [] \n return inorder_array if @root == nil\n current = @root\n return inorder_helper(current, inorder_array)\n end", "title": "" }, { "docid": "331d31d8ef40809afc251f39c3d0c6f5", "score": "0.70464635", "text": "def inorder\n array = []\n if root.nil?\n return array\n else\n root.inorder(array)\n return array\n end\n end", "title": "" }, { "docid": "9baa40e2f340b7dd1e226669a31dd030", "score": "0.7037863", "text": "def inorder\n if @root == nil\n return []\n end\n \n current = @root\n getInOrder(current)\n return @inOrderArray\n end", "title": "" }, { "docid": "b577a40d60c4b6e1cc099cd67a95c3e9", "score": "0.7036598", "text": "def to_a #preorder\n return [] if @value.nil?\n \n array = []\n array << @value \n array << @left.to_a\n array << @right.to_a\n\n array\n end", "title": "" }, { "docid": "e375a05ada4dd07fee7d782b6675ab1f", "score": "0.70201117", "text": "def inorder\n result = []\n inorder_helper(@root, result)\n return result\n end", "title": "" }, { "docid": "fe3560aec71eb820c6f14dcd55ad4004", "score": "0.7017257", "text": "def get_all_trees_from_inorder(array, index=0)\n #In-order visits left first, then root and then right. So all elements to left belongs to left sub tree and right belongs to right subtree\n #Form all trees with next element being its right, then trees with next element as its right etc.\n # [1,2,3,4] => \n # Consider each element as root. Left will form left subtree and right will form right subtree. Do this recursively to collect all trees\n\n\nend", "title": "" }, { "docid": "18d315794df307323f3bdd2ff740b0eb", "score": "0.7014518", "text": "def level_order\n array = []\n queue = []\n queue << @root\n until queue.empty?\n queue.push(queue.first.left) unless queue.first.left.nil?\n queue.push(queue.first.right) unless queue.first.right.nil?\n array << queue.shift.data\n end\n array\n end", "title": "" }, { "docid": "e2b0a1ec87c7534ef97f70a27fcd9bca", "score": "0.70035684", "text": "def to_arr # recursive\n sorted = []\n\n # create a sorted array of the left subtree\n if @left\n sorted = sorted + @left.to_arr\n end\n\n # add an array with just the current node\n sorted = sorted + [@value]\n\n # create a sorted array of the right subtree\n if @right\n sorted = sorted + @right.to_arr\n end\n\n sorted\n\n end", "title": "" }, { "docid": "de4769864e5a5997cc5d8cbb8a4392f2", "score": "0.69971985", "text": "def node_to_array(node)\n # Maintain queue of nodes?\n # empty results array\n # push current.value; stop if nil\n # push current.left.value; stop if nil\n # push current.right.value; stop if nil\n # How to get back to sibling?\n # Need to be able to form array regardless of whether starting point is root\n\n end", "title": "" }, { "docid": "938c2df9955d5fcede12b4cd74eb5bdd", "score": "0.6981836", "text": "def in_order(root_node) \n node_stack = [root_node]\n curr_node = nil\n visted_nodes = []\n in_order_array = []\n until node_stack.empty?\n curr_node = node_stack.pop\n node_stack.push(curr_node.right) if curr_node.right\n node_stack.push(curr_node.left) if curr_node.left\n visted_nodes.push(curr_node)\n end\n return visted_nodes\nend", "title": "" }, { "docid": "a4f98fc36e13eb1e3039b9f0e0437f4a", "score": "0.6979921", "text": "def inorder\n list = []\n if @root != nil\n @root.inorder(list)\n end\n return list\n end", "title": "" }, { "docid": "97c5dba0a53e3fe5a62bb5531990a666", "score": "0.69706124", "text": "def in_order_traverse(tree, array)\n unless tree.nil?\n in_order_traverse(tree.left)\n array.append(tree.value)\n in_order_traverse(tree.right)\n end\n\n return array\nend", "title": "" }, { "docid": "5840343f18053034140fd8d4ceade15e", "score": "0.6961215", "text": "def inorder\n tree_inorder = []\n\n if @root.nil?\n return tree_inorder\n end\n\n current = @root\n inorder_helper(current.left, tree_inorder)\n tree_inorder << {:key => current.key, :value => current.value}\n inorder_helper(current.right, tree_inorder)\n\n return tree_inorder\n end", "title": "" }, { "docid": "2bc7c8f0f8f151bc3d8dcc3de63c5645", "score": "0.69576037", "text": "def inorder\n if @root == nil\n return []\n end\n inorder_helper(@root, [])\n end", "title": "" }, { "docid": "2f1b0f8d607a99142f02cee7326a4a99", "score": "0.69468206", "text": "def inorder(node = @root)\n array = []\n if node.left && node.right == nil\n return node.data\n else\n array.push(inorder(node.left)) unless node.left == nil\n array.push(node.data)\n array.push(inorder(node.right)) unless node.right == nil\n end\n array.flatten\n end", "title": "" }, { "docid": "51225a899b47eb043b89978442140036", "score": "0.6943184", "text": "def inorder\n result = []\n return result if @root.nil?\n inorder_helper(@root, result)\n return result\n end", "title": "" }, { "docid": "5093ec29b227fbea0f644aba4ebb39e4", "score": "0.69399154", "text": "def postorder\n if @root == nil\n return []\n end\n \n current = @root\n getPostOrder(current)\n return @inOrderArray\n end", "title": "" }, { "docid": "97215ec6dff4cba19455f637f1ef5a75", "score": "0.69362414", "text": "def inorder\n node = @root\n traverse_array = []\n return traverse_array if node.nil?\n \n in_order_helper(node) do |node|\n traverse_array << {:key=> node.key, :value=>node.value}\n # puts node.key\n end\n\n return traverse_array\n end", "title": "" }, { "docid": "b60033e8e969fbbfebba1ea8d70a90e5", "score": "0.69226575", "text": "def inorder\n # raise NotImplementedError\n root = @root\n traverse_array = []\n return traverse_array if root.nil?\n\n inorder_helper(root) do |node|\n traverse_array << { key: node.key, value: node.value }\n end\n\n traverse_array\n end", "title": "" }, { "docid": "49aff3a0eb472ec92c96773b88962911", "score": "0.69220537", "text": "def inorder\n node_array = []\n if !@root\n return node_array\n end\n current = @root\n\n node_array = traverse_in_order(node_array, current)\n\n return node_array\n end", "title": "" }, { "docid": "9ca099e0f020785d4484ceb615ec4670", "score": "0.6921053", "text": "def level_order\n return nil if @root.nil?\n\n queue = [@root]\n values = []\n until queue.empty?\n cur = queue.shift\n block_given? ? yield(cur) : values << cur.value\n queue << cur.left unless cur.left.nil?\n queue << cur.right unless cur.right.nil?\n end\n values unless block_given?\n end", "title": "" }, { "docid": "fc2c319a3f993f61380da2b025a024cf", "score": "0.6916503", "text": "def preorder\n current = @root\n values = []\n if current != nil\n current.preorder(values)\n end\n return values\n end", "title": "" }, { "docid": "f4388e68ccbd5bb248ce92ddc263e4bb", "score": "0.6914986", "text": "def inorder\n ary = []\n\n def innerfunc(node, ary)\n return if node.nil?\n innerfunc(node.left, ary)\n ary << { :key => node.key, :value => node.value }\n innerfunc(node.right, ary)\n end\n\n innerfunc(@root, ary)\n return ary\n end", "title": "" }, { "docid": "b2da3957d18bfbe6ebbc90f1da1449c2", "score": "0.6904097", "text": "def in_order(node = @root, array = [])\n return if node == nil\n in_order(node.left, array)\n array << node.value\n in_order(node.right, array)\n return array\n end", "title": "" }, { "docid": "fa0cebbbf2f467d5be956f47400a12d1", "score": "0.6903254", "text": "def inorder\n # This method returns an array of all the elements in the tree, in order. (left, root, right)\n inorder_array = []\n inorder_helper(@root, inorder_array)\n end", "title": "" }, { "docid": "f7c2510c845e8c99dd80f1923093f72d", "score": "0.6891395", "text": "def bfs\n results_array = []\n if !@root\n return results_array\n end\n queue = [@root]\n\n until queue.length == 0\n current = queue.shift\n if current.left\n queue.push(current.left)\n end\n if current.right\n queue.push(current.right)\n end\n results_array.push(pretty_node_object(current))\n end\n return results_array\n end", "title": "" }, { "docid": "98bf479f8256e04a65dcc3ab21d2441b", "score": "0.68804914", "text": "def bfs\n array = []\n return array if @root.nil?\n end", "title": "" }, { "docid": "d0e5823ff6cbab457c45a02e5a64f982", "score": "0.6874826", "text": "def level_order(root = @root, unvisited = [], val_arr = [])\n unvisited = handle_unvisited(unvisited, root)\n val_arr.push(root.data) unless val_arr.include?(root.data)\n unvisited.each { |j| level_order(j, unvisited, val_arr) } unless unvisited.empty?\n val_arr\n end", "title": "" }, { "docid": "acd02a54efbc8cd759eb08d0b2043ea1", "score": "0.6871107", "text": "def inorder\n result = []\n inorder_recursion(@root, result)\n return result\n end", "title": "" }, { "docid": "9f6b1e87f18a28eb924d6bb9956ce683", "score": "0.6859307", "text": "def inorder\n result = []\n return result if @root.nil?\n return @root.inorder_list(result)\n end", "title": "" }, { "docid": "957c2b0f1c157c7708839649f43fa921", "score": "0.6846172", "text": "def bfs\n if @root == nil\n return []\n end\n\n queue = Queue.new\n queue.enqueue(@root)\n bfs_values = []\n\n while queue.size > 0\n node = queue.front\n bfs_values << {key: node.key, value: node.value}\n queue.enqueue(node.left) unless node.left == nil\n queue.enqueue(node.right) unless node.right == nil\n queue.dequeue\n end\n\n return bfs_values\n end", "title": "" }, { "docid": "c23ac061daa49a38569baf65404b13c2", "score": "0.68386924", "text": "def level_order_iter\n que = [@root]\n values = []\n\n until stack.empty?\n curr_node = stack.shift\n que << curr_node.left unless curr_node.left.nil?\n que << curr_node.right unless curr_node.right.nil?\n\n que << curr_node.data unless curr_node.data.nil?\n end\n\n values\n end", "title": "" }, { "docid": "060e03ba98e9e5882b5da6b053f1deed", "score": "0.68356", "text": "def inorder\n return [] if @root.nil?\n \n results = []\n inorder_helper(@root, results)\n return results\n end", "title": "" }, { "docid": "a233fec5ead77ae6295acdc9e193429f", "score": "0.68346435", "text": "def inorder\n result = []\n return inorder_helper(@root, result)\n end", "title": "" }, { "docid": "e61639ae0f40736eda89590c2c66771c", "score": "0.6829146", "text": "def in_order(root, values = [])\n return if root.nil?\n\n in_order(root.left, values)\n values.push(root)\n in_order(root.right, values)\n values\n end", "title": "" }, { "docid": "ad991f8240f2a8c78a26c610ff9ad6d5", "score": "0.68150234", "text": "def postorder\n current = @root\n values = []\n if current != nil\n current.postorder(values)\n end\n return values\n end", "title": "" }, { "docid": "c19f527fa1ed38cfb2d7cf9dfb6fed43", "score": "0.68089974", "text": "def build_tree(array)\n btsArray = []\n \n array.each_with_index do |e, index|\n if index == 0\n btsArray.push(node = Node.new(e))\n else\n parentNode = compare(btsArray[0], e)\n btsArray.push(node = Node.new(e, parentNode))\n puts parentNode.class\n puts \"Value being pushed is #{e}\"\n if parentNode.class != nil\n if parentNode.value > e\n parentNode.left_child = btsArray[btsArray.length - 1]\n elsif parentNode.value < e\n parentNode.right_child = btsArray[btsArray.length - 1]\n #puts \"This is the set: #{btsArray[btsArray.length - 1].value}\"\n end\n end\n end\n end\n \n return btsArray\n #array[array.length/2]\nend", "title": "" }, { "docid": "36eb447a0aec2681b6536c625db82cce", "score": "0.68074024", "text": "def in_order\n return [] if @root.nil?\n\n order_rec(@root, [], 'in')\n end", "title": "" }, { "docid": "1fdc6f63dc8bbc93505240c3b5f07302", "score": "0.6806629", "text": "def inorder\n array = []\n inorder_helper(array, @root)\n end", "title": "" }, { "docid": "124c9858b958be910f575567f455b949", "score": "0.6800552", "text": "def bf_order\n order = []\n queue = MyQueue.new\n @root.nil? ? order : queue.enqueue(@root)\n\n until queue.empty?\n current = queue.dequeue\n queue.enqueue(current.left) unless current.left.nil?\n queue.enqueue(current.right) unless current.right.nil?\n order << current.value\n end\n\n order\n end", "title": "" }, { "docid": "b55436ab6ffc8c3010de22292b39535f", "score": "0.67931", "text": "def inorder\n #Left, Current, Right\n new_array = Array.new()\n inorder_helper(@root, new_array)\n end", "title": "" }, { "docid": "6e185a4f3bc9739f5feb8470171716af", "score": "0.67927766", "text": "def preorder\n if @root == nil\n return []\n end\n \n current = @root\n getPreOrder(current)\n return @inOrderArray\n end", "title": "" }, { "docid": "e90960cc7de1108379a7529fb798888f", "score": "0.679032", "text": "def inorder \n return inorder_helper(root, [])\n end", "title": "" }, { "docid": "569d64cc474b18125ea9f154a849dd32", "score": "0.67871314", "text": "def level_order(array_of_values = [], queue = [], pointer = root)\n return if pointer.nil?\n\n queue << pointer\n until queue.empty?\n pointer = queue.shift\n array_of_values << pointer.data\n queue << pointer.left_child unless pointer.left_child.nil?\n queue << pointer.right_child unless pointer.right_child.nil?\n end\n array_of_values\n end", "title": "" }, { "docid": "d460d0b8fae7243c98835767f035f71b", "score": "0.67673975", "text": "def inorder\n tree = []\n return tree if @root.nil?\n inorder_helper(@root, tree)\n return tree\n end", "title": "" }, { "docid": "84a8bbef32c4aded60639d7cd63637e0", "score": "0.6766969", "text": "def bfs\n return [] if !@root\n queue = []\n nodes = []\n\n queue.push(@root)\n while !queue.empty?\n current = queue.shift\n nodes << { key: current.key, value: current.value }\n queue.push(current.left) if current.left\n queue.push(current.right) if current.right\n end\n return nodes\n end", "title": "" }, { "docid": "52579f7b9c1445bbd74c71ebbf3d0e12", "score": "0.676052", "text": "def inorder\n arr = []\n current = @root\n\n inorder_helper(arr, current)\n end", "title": "" }, { "docid": "bb5deb40f4f35157111f630d6e305c58", "score": "0.67572236", "text": "def return_values_breadth_first(root)\n\tnodes = [root]\n\tvalues = []\n\twhile !nodes.empty?\n\t\tcurrent = nodes.shift \n\t\tif !current.visited\n\t\t\tvalues << current.value \n\t\t\tcurrent.visited = true\n\t\t\tcurrent.neighbors.each do |node|\n\t\t\t\tnodes << node if !node.visited \n\t\t\tend \n\t\tend\n\tend \n\treturn values\nend", "title": "" }, { "docid": "bb5deb40f4f35157111f630d6e305c58", "score": "0.67572236", "text": "def return_values_breadth_first(root)\n\tnodes = [root]\n\tvalues = []\n\twhile !nodes.empty?\n\t\tcurrent = nodes.shift \n\t\tif !current.visited\n\t\t\tvalues << current.value \n\t\t\tcurrent.visited = true\n\t\t\tcurrent.neighbors.each do |node|\n\t\t\t\tnodes << node if !node.visited \n\t\t\tend \n\t\tend\n\tend \n\treturn values\nend", "title": "" }, { "docid": "afc30cd611a75eb17b511c764603ac69", "score": "0.6756364", "text": "def inorder\n return [] if @root.nil?\n traverse_inorder(@root)\n return @nodes\n end", "title": "" }, { "docid": "1c981e47cbe24dfd5c326f7da1d986a9", "score": "0.6756136", "text": "def inorder(array_of_values = [], pointer = root)\n return array_of_values if pointer.nil?\n\n inorder(array_of_values, pointer.left_child)\n array_of_values << pointer.data\n inorder(array_of_values, pointer.right_child)\n end", "title": "" }, { "docid": "3afb9c312f1f8e43cdadf0fa3b032442", "score": "0.67501247", "text": "def inorder()\n inorderBST(@root)\n end", "title": "" }, { "docid": "c4d64fc77f1292695dab126f9a705c94", "score": "0.6748312", "text": "def bfs\n return [] if @root.nil?\n\n queue = []\n list = []\n\n queue << @root\n current = @root\n while !queue.empty?\n current = queue[0]\n queue << current.left if !current.left.nil?\n queue << current.right if !current.right.nil?\n node_to_add = queue.shift\n list << {key: node_to_add.key, value: node_to_add.value}\n end\n \n return list\n end", "title": "" }, { "docid": "dad499ab56a32e6ad7c8aa8947c2f4eb", "score": "0.67455167", "text": "def inorder(node = @root, values = [])\n return nil if node.nil?\n \n inorder(node.left, values) unless node.left.nil?\n values.append(node.data)\n inorder(node.right, values) unless node.right.nil?\n values\n end", "title": "" }, { "docid": "f3a5c9225b80d8a6ef80ff97f5366369", "score": "0.6743611", "text": "def bfs\n return [] if @root.nil?\n queue = []\n output = []\n queue << @root\n while (!queue.empty?)\n current = queue.shift\n if(current.left) then queue.push(current.left) end\n if(current.right) then queue.push(current.right) end\n output.push({key: current.key, value: current.value})\n end\n return output\n end", "title": "" }, { "docid": "2b6d21d3fdd4db86ca2bea2a8d89e2f2", "score": "0.67382467", "text": "def inorder\n root = @root\n list = []\n\n inorder_helper(root, list)\n\n return list\n end", "title": "" }, { "docid": "1451951398e021b447c3dcc84ec2c221", "score": "0.6737586", "text": "def post_order_traverse(tree, array)\n unless tree.nil?\n post_order_traverse(tree.left)\n post_order_traverse(tree.right)\n array.append(tree.value)\n end\n\n return array\nend", "title": "" }, { "docid": "0b1f44d63847bc59eed8d9cdde081584", "score": "0.67278755", "text": "def inorder\n return [] if @root.nil?\n list = []\n stack = []\n current = @root\n \n # while current node exists OR the stack is not empty\n while !current.nil? || !stack.empty?\n \n # while current node exists\n while !current.nil?\n # add it to the stack\n stack << current\n # current becomes node to its left and if it is not nil, this loop will continue\n current = current.left\n end\n \n # pop off the last node that was added\n current = stack.pop\n # add it to the list\n list << {key: current.key, value: current.value}\n # traverse to the right\n current = current.right\n end\n \n return list\n end", "title": "" }, { "docid": "27946b73f380af7dc37d1109909702a5", "score": "0.6726077", "text": "def inorder(root)\n return if root.nil?\n inorder(root.left)\n @array << root\n inorder(root.right)\nend", "title": "" }, { "docid": "e5776732107986cfdbdd401cbebc6471", "score": "0.6723063", "text": "def level_order(root, values = [])\n return if root.nil?\n\n queue = []\n queue.push(root)\n until queue.empty?\n node = queue.shift\n values.push(node.value)\n queue.push(node.left) if node.left\n\n queue.push(node.right) if node.right\n\n end\n values\n end", "title": "" }, { "docid": "092aca85aa067d8227195e3ec5b228a4", "score": "0.6716223", "text": "def bfs\n #raise NotImplementedError\n return [] if @root.nil?\n queue = []\n output = []\n queue.push(@root)\n while !queue.empty?\n current = queue[0]\n new_hash = Hash.new\n new_hash[:key] = current.key\n new_hash[:value] = current.value\n output.push(new_hash)\n if current.left\n queue.push(current.left)\n end\n if current.right\n queue.push(current.right)\n end\n queue = queue[1..-1]\n end\n return output\n end", "title": "" }, { "docid": "e97d0b8d109dbc499971e14f60607b10", "score": "0.67130524", "text": "def postorder\n arr = []\n post_order(@root, arr)\n return arr\n end", "title": "" }, { "docid": "81b968c414a5f9b725be5228549228fa", "score": "0.67118895", "text": "def inorder\n return [] if @root.nil?\n ordered_list = []\n holder = []\n current_node = @root\n\n while !current_node.nil? || !holder.empty?\n until current_node.nil? \n holder << current_node\n current_node = current_node.left \n end\n\n current_node = holder.pop\n list_pusher(current_node, ordered_list)\n current_node = current_node.right \n end\n\n return ordered_list\n\n end", "title": "" }, { "docid": "a26e97aad0172bc83e80c5b7e9cc6555", "score": "0.67093945", "text": "def inorder\n return [] if @root.nil?\n return inorder_helper(@root)\n end", "title": "" }, { "docid": "57acb2fec01c3eeb3369fd087919bb82", "score": "0.6702994", "text": "def bfs # like reading left to right\n # you need a queue (you could use an array) for breadth-first search\n\n list = []\n return list if @root.nil?\n queue = [@root]\n\n until queue.empty?\n current = queue.shift # shift removes first element of array and returns it (or returns nil if array is empty). time complexity is O(n)\n queue.push(current.left) unless current.left.nil?\n queue.push(current.right) unless current.right.nil?\n\n list << { key: current.key, value: current.value }\n end\n\n return list\n\n end", "title": "" }, { "docid": "b54ffada23623d1bb38d970a58441291", "score": "0.6693646", "text": "def pre_order_traverse(tree, array)\n unless tree.nil?\n array.append(tree.value)\n pre_order_traverse(tree.left)\n pre_order_traverse(tree.right)\n end\n\n return array\nend", "title": "" }, { "docid": "5e4b43fdd20fd67359eb737758b8c030", "score": "0.66919315", "text": "def inorder(root = @root, arr = [])\n return if root.nil?\n\n inorder(root.left, arr)\n arr.append(root.data) if root.data\n inorder(root.right, arr)\n\n arr\n end", "title": "" }, { "docid": "9280d532d450ad2f8b71087acb477d6b", "score": "0.66850454", "text": "def inorder\n nodes = []\n if @root\n add_nodes_inorder(root, nodes)\n end\n return nodes\n end", "title": "" }, { "docid": "c888b01cf8386c9f27f4d738d5f4ca04", "score": "0.6681867", "text": "def level_order(node = @root, values = [])\n return nil if node.nil?\n \n queue = []\n queue.append(node)\n until queue.empty?\n current = queue.shift\n queue.append(current.left) unless current.left.nil?\n queue.append(current.right) unless current.right.nil?\n values.append(current.data)\n end\n values\n end", "title": "" }, { "docid": "b0e86810997736c50f0574cf64f2d03c", "score": "0.66808724", "text": "def level_order(root = @root)\n return if root.nil?\n\n queue = []\n arr = []\n queue.append(root)\n until queue.empty?\n current = queue[0]\n arr.append(current.data) if current.data\n queue.shift\n queue.append(current.left) unless current.left.nil?\n queue.append(current.right) unless current.right.nil?\n end\n arr\n end", "title": "" }, { "docid": "a9a7c2089765f5dfc12b5bdeff1c1ff7", "score": "0.6655125", "text": "def inorder\n node = @root\n return inorder_recurssive(node, [])\n end", "title": "" }, { "docid": "4afe51bbe5191f08b2c7f1b7bdb98d4e", "score": "0.6643723", "text": "def inorder(node=@root, inorder_arr=[])\n if node == nil\n inorder_arr\n else \n inorder(node.left_child, inorder_arr)\n block_given? ? yield(node) : inorder_arr << node.value \n inorder(node.right_child, inorder_arr) \n end \n end", "title": "" }, { "docid": "5e2afbd34dfe366ab47412fbb9ae160b", "score": "0.6630799", "text": "def bfs\n visted = []\n return visted if @root.nil?\n\n to_visit = [@root]\n until to_visit.empty?\n curr = to_visit.shift\n visted << {\n key: curr.key,\n value: curr.value\n }\n \n to_visit << curr.left if curr.left\n to_visit << curr.right if curr.right\n end\n\n return visted\n end", "title": "" }, { "docid": "99a9524803e1a955623b954a5f10fd7b", "score": "0.66232395", "text": "def depthFirstSearchInOrder\n @result = []\n\n def traverse(node)\n traverse(node.left) if node.left\n @result << node.value\n traverse(node.right) if node.right\n end\n\n traverse(self.root)\n return @result\n end", "title": "" } ]
83c4398b46bc51ed07d5e5d5ec699274
used for strong parameters
[ { "docid": "dec1ca8d7e3e35b8b3fee8108819a29b", "score": "0.0", "text": "def user_params\n params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation)\n end", "title": "" } ]
[ { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.8266021", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.72142285", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.72142285", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.7099806", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.70836174", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.7034704", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.7006076", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6959427", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.68701226", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "28bd714f0d790bda0a4b0777c5bfce0c", "score": "0.6824414", "text": "def user_params\n params.require(:user).permit(STRONG_PARAMETERS)\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.681285", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "2824d3cecaf24bae1e15940382b95a52", "score": "0.6785121", "text": "def make_params\r\n raise 'must be implemented in subclasses'\r\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6716948", "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": "55aa899fab0dfa44916f71c499998ca8", "score": "0.6666306", "text": "def parameter_params\n params.require(:parameter).permit(:key, :value)\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.66641724", "text": "def need_params\n end", "title": "" }, { "docid": "0ca6957c483d76ea4bf451da4abb625c", "score": "0.665275", "text": "def safe_params\n obj_name = self.class.model_class.name.underscore.to_sym\n params = wrap_parent_param(self.params, obj_name)\n params[obj_name] = shim_construct_type(params[obj_name])\n params.require( obj_name )\n .permit( [:label, :parent_id, :parent_type, :position, :branch, :instrument_id] + self.class.params_list )\n end", "title": "" }, { "docid": "032773b3a12aee5407b5bbe968819b3e", "score": "0.66413087", "text": "def user_parameters\n params.require(:user).permit(:name,:email)\nend", "title": "" }, { "docid": "d7b4753824806eca76b548a30e3351b6", "score": "0.6640956", "text": "def model_params\n params.require(variable_symbol).permit(*permitted_parameters)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.66239417", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "6008e8707eafce375988b3c7ccf098c3", "score": "0.66236967", "text": "def original_params; end", "title": "" }, { "docid": "7ba07daf235cb0fe536bff23b0194efc", "score": "0.66190475", "text": "def prepare_params\n \n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.661836", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "c4a4eb81dfa908f7bbe9a566ea814985", "score": "0.6605146", "text": "def params\n super.with_indifferent_access\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6585589", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "8e54eaded22dd280d836e96375fed9a4", "score": "0.6582261", "text": "def paramun_params\n params.require(:parametre).permit!\n end", "title": "" }, { "docid": "1151eba5f6475aa06f77f57b18e73af6", "score": "0.65795076", "text": "def user_params\n # these are STRONG parameters, it is secure, because you allow only\n # the paramenters that you name. this avoids manipulation of the database.\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n end", "title": "" }, { "docid": "ca6419335e0def563dcffd6184ca1e7b", "score": "0.65759724", "text": "def user_params # we want to require a strong params hash to have :user attribute, and to permit name, email, password, password_confirmation\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n end", "title": "" }, { "docid": "06b954bfafd8ff54a81c3c0f94b83858", "score": "0.65731233", "text": "def stud_params\r\n\t\t# the parameters require obj student to exist and allowing all which are written to be save to the obj later on\r\n\t\tparams.require(:student).permit(:name, :email, :password, :password_confirmation)\r\n\tend", "title": "" }, { "docid": "fed6e5f6581fc3a6bc945330c40b3526", "score": "0.6563478", "text": "def strong_params(*args)\n #byebug\n params.require(controller_name.singularize.to_sym).permit(*args)\n end", "title": "" }, { "docid": "6b48b65e26460eb891218bbd7c904d7c", "score": "0.6562783", "text": "def rails_params; end", "title": "" }, { "docid": "3e61c04682f3256b99320c743e21d691", "score": "0.6554273", "text": "def user_params\n end", "title": "" }, { "docid": "3e61c04682f3256b99320c743e21d691", "score": "0.6554273", "text": "def user_params\n end", "title": "" }, { "docid": "60a32cf4c1c461f4b2660e16b6964919", "score": "0.6545387", "text": "def secure_params(hash)\n\t\t\t\thash\t\n\t\t\tend", "title": "" }, { "docid": "f4ee5d60be47c3cfe950b52a86fc7682", "score": "0.6538699", "text": "def post_params(*args) #is the helper method \n\n\t\tparams.require(:post).permit(*args)\n\t\t#uses .require and .permit methods as stronger params to prevent hacks through inspect element right click edit html \n\t\t#require restricts, permit allows, and *args is for the custom arguments\n\tend", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.65334207", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "bdac5b92b4c9158c3c7b058134d9e3a6", "score": "0.65318304", "text": "def brigade_params\n strong_params = params[:brigade]\n strong_params[:user] = current_user\n strong_params\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.65176755", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "609cf83f3240beba143cbe957ca2b37e", "score": "0.65111095", "text": "def toy_params\n self.params[:toy].permit(:cat_id, :name, :ttype)\n #self.params returns an object of type Paramters(HashWithDifferentAccess < Hash)\n # Like hash with some extra stuff\n # permit whitelist whitelist the attributes given so that ActiveRecord will set them \n # when I mass assign. \n # This method makes it so that only those things in my permit method \n # can be updated \n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.65110147", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "408c591e4a146f398543e9f30bac35f9", "score": "0.64996713", "text": "def params\n super.symbolize_keys\n end", "title": "" }, { "docid": "ff6f55caa994e4876f1d0797af27a8a4", "score": "0.6497375", "text": "def user_params\n \n #Note:This code returns a version of the params \n #hash with only the permitted attributes (while raising \n #an error if the :user attribute is missing).\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n end", "title": "" }, { "docid": "cef52537876a0d06258a85248d1d6f2b", "score": "0.6492548", "text": "def secretary_params\n params.require(:secretary).permit(:name, :address, :user_id)\n end", "title": "" }, { "docid": "36175c820060d06ff1142c31b3dd05ac", "score": "0.6479933", "text": "def get_params\r\n #params.require(:symptom).permit(:name, :part_id, :feel_id)\r\n params.require(:symptom).permit!\r\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.64775795", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "15ddace2f26312d452416583d7b54c39", "score": "0.6468124", "text": "def params\n \n end", "title": "" }, { "docid": "8e935216f7c763601cd5538c3ce1a6c6", "score": "0.64674574", "text": "def usuario_params\n #params.require(:usuario)\n #params.require(:nombre)\n params.permit(:usuario, :nombre, :apellido, :twitter)\n end", "title": "" }, { "docid": "371f1b76a5914e73e913359620e13aed", "score": "0.64646167", "text": "def Person_params\n params.require(:Person).permit(:name, :age, :birthdate)\nend", "title": "" }, { "docid": "9ceae3892a8ff0961a65fc980069d473", "score": "0.64593804", "text": "def company_params\n\t params.permit(\n\t \t:user_id,\n\t \t:company_notes, \n\t \t:twitter_handle, \n\t \t:phone_number,\n\t \t:address,\n\t \t:name, \n\t \t)\n\t end", "title": "" }, { "docid": "e494564d764a4b760a5c9a9379a1212b", "score": "0.64538753", "text": "def student_params(*args)\n params.require(:student).permit(*args)\nend", "title": "" }, { "docid": "cfd33eebddc64500b944557414449fe9", "score": "0.6452447", "text": "def user_params\n #params.fetch(:user, {})\n params.require(:user).permit!\n end", "title": "" }, { "docid": "80ecf0dd9749fa92727a90eeafd5f164", "score": "0.6440822", "text": "def service_params\n params[:service].permit!\n end", "title": "" }, { "docid": "7014b2897f3379602e7018074d2a8241", "score": "0.6436673", "text": "def set_params\n \tparams.require(:user).permit(:name, :surname, :email, :phone, :active, :document, :token_pass, :rol_id, :device_id, :semester_id)\n end", "title": "" }, { "docid": "4f1e3a08a37c8ada6ca80e7416e4042f", "score": "0.6436559", "text": "def user_params\n\t\tparams.permit(*policy(User).user_attributes)\n\tend", "title": "" }, { "docid": "5c019fc2762bcdf0e87a0c8045e251e3", "score": "0.6431837", "text": "def generic_model_params\n params.require(:generic_model).permit(:user_id)\n end", "title": "" }, { "docid": "058836cd00d2422dafbb500c77053a0b", "score": "0.642974", "text": "def allow_params\n params.permit(:id, :user_id, :pair)\n end", "title": "" }, { "docid": "42f480ba96ee6fe85054473e14d9508b", "score": "0.64225155", "text": "def person_params\n params[:person].permit!\n end", "title": "" }, { "docid": "4ba8f5cdb0399571d60b7242794ce47f", "score": "0.6421392", "text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "59786e44185dfc9dd83fb6bafadcdfc7", "score": "0.64137685", "text": "def strong_params #will be used in place of params arguments, and inside Student.create instead of Student.new, this is just explicit so I know what is happeneing.\n params.require(:students).permit(:first_name, :last_name) #'alters' hash to always look inside the students nest, permits first and last name to be potential fields.\n end", "title": "" }, { "docid": "30d7e3c6f036216832e06e3e14d071ed", "score": "0.64103264", "text": "def authentication_params\n params.require(:authentications).permit(:name, :description)\n end", "title": "" }, { "docid": "ea00b668336826b5d4c3eb0c5a33cb4a", "score": "0.64032096", "text": "def transferencia_params \n #params.require(:transferencia).permit(:fecha, :area_id, :deposito_id)\n params.require(:transferencia).permit! \n end", "title": "" }, { "docid": "8d20b1221bf855875494a6bc95b79eb5", "score": "0.63878757", "text": "def entity_param\n params.permit(:entity)\n end", "title": "" }, { "docid": "ab49b0baeea5bf6f204adca9e864094e", "score": "0.6386003", "text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "title": "" }, { "docid": "c7b1dfb09e7688ad840523cd982d42a7", "score": "0.6382639", "text": "def transaction_params\n params.require(:transaction).permit!\n end", "title": "" }, { "docid": "e39a98d9676e424d7f2f34cb8c777af0", "score": "0.63826126", "text": "def attributes_for_actor\n params.require(hash_key_for_curation_concern).permit!\n end", "title": "" }, { "docid": "c8c77859df9e3d2e0f69df8eb3a82191", "score": "0.63822603", "text": "def user_params\n params.require(:user).permit(:id)\n end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63817024", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63815635", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.63815635", "text": "def params; end", "title": "" }, { "docid": "bb87f049d98368e6bded8818a36c92a2", "score": "0.63813084", "text": "def safe_hash(key)\n params.require(key).permit!.to_h\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.63795483", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.63728744", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "2f86022f4e475cc9e07b2ed0b23936e5", "score": "0.63725984", "text": "def safe_params\n safe_attributes = %i[name assignable_id]\n params.require(:lead).permit(safe_attributes)\n end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.6372527", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "93a76f8dedab1009b762fc108221f885", "score": "0.63719004", "text": "def user_attributes\n params.require(:user).permit! \n end", "title": "" }, { "docid": "c7ce57355080ceab91e908069284b3a0", "score": "0.6371208", "text": "def user_strong_params\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n end", "title": "" }, { "docid": "fb772fef1fc34fb6eb81ee32d9635b1b", "score": "0.6370026", "text": "def user_params\n ActionController::Parameters.new(params).permit :user_id, :email, :password, :firstname, :lastname, :school, :lend_num, :borrow_num, :comment, :invitation_code\n end", "title": "" }, { "docid": "1da11b68a0eea83eb4583bfe0a722300", "score": "0.63675755", "text": "def assign_params(permitted_params, key: nil)\n if key == false\n assign_attributes ::Current.params.permit(permitted_params)\n else\n assign_attributes ::Current.params.require(key || default_param_key).permit(permitted_params)\n end\n end", "title": "" }, { "docid": "e95311abe7206a540262ca346ad56ee6", "score": "0.63668835", "text": "def params\n super.to_unsafe_h.deep_symbolize_keys\n end", "title": "" }, { "docid": "ab76ba841b5611b7c2fe3803fce59ce6", "score": "0.6358112", "text": "def person_params\n\t params.require(:person).permit(:name, :age)\n\t end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6354217", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "4632c7949842c8534d66b50254032add", "score": "0.6353918", "text": "def parameterization_params\n params.permit(:name, :user_id, :number_value, :money_value)\n end", "title": "" }, { "docid": "c429c6dca45292d9f38f8565ede8c9eb", "score": "0.6351174", "text": "def user_params\n \tparams.require(:user).permit(:id)\n end", "title": "" }, { "docid": "881668e7d32a9883676926faacb1e198", "score": "0.6350601", "text": "def product_params\n params.permit!\n end", "title": "" } ]
7e6c2be143a1283eff583190e5150a4d
Locates the `watchdogs` service.
[ { "docid": "c476ad9ea299db2a512a1d14461252c0", "score": "0.73355365", "text": "def watchdogs_service\n @watchdogs_service ||= VmWatchdogsService.new(self, 'watchdogs')\n end", "title": "" } ]
[ { "docid": "a535ef311b33ccaf621185e76a6168ae", "score": "0.7573211", "text": "def watchdogs_service\n @watchdogs_service ||= InstanceTypeWatchdogsService.new(self, 'watchdogs')\n end", "title": "" }, { "docid": "f351bd7d7169de87a8aa04ae0c7dc73a", "score": "0.7396977", "text": "def watchdogs_service\n @watchdogs_service ||= TemplateWatchdogsService.new(self, 'watchdogs')\n end", "title": "" }, { "docid": "0e2d077ada60a4271d6e5b7eb688646c", "score": "0.7161591", "text": "def watchdogs\n @watchdogs\n end", "title": "" }, { "docid": "0e2d077ada60a4271d6e5b7eb688646c", "score": "0.7161591", "text": "def watchdogs\n @watchdogs\n end", "title": "" }, { "docid": "0e2d077ada60a4271d6e5b7eb688646c", "score": "0.7161591", "text": "def watchdogs\n @watchdogs\n end", "title": "" }, { "docid": "0e2d077ada60a4271d6e5b7eb688646c", "score": "0.7161591", "text": "def watchdogs\n @watchdogs\n end", "title": "" }, { "docid": "db90e1a0a76b2e6cec694fb307522fae", "score": "0.63375884", "text": "def watchdog\n request(:watchdog)\n end", "title": "" }, { "docid": "875c21aaded5a7ed3c3b3da36b59e2f2", "score": "0.6243402", "text": "def watchdog_service(id)\n InstanceTypeWatchdogService.new(self, id)\n end", "title": "" }, { "docid": "77851ed64e26ae0777ce01d79fa69a47", "score": "0.597433", "text": "def dest_watchdogs(shell)\n [:system_load,:utilized_memory, :used_space].map do |e|\n start_watchdog(:destination, e, shell)\n end\n end", "title": "" }, { "docid": "2cad7e8aac4e01189996942bb1b09732", "score": "0.5911944", "text": "def set_watchdog\n @watchdog = Watchdog.find(params[:id])\n end", "title": "" }, { "docid": "c1e21db1ddf4649d3614c04abd0e40bf", "score": "0.5907067", "text": "def notify_watchdog\n notify(\"WATCHDOG=1\")\n end", "title": "" }, { "docid": "46f765d3d2783b9ec1b14935072ebc47", "score": "0.5894416", "text": "def watchdog_service(id)\n VmWatchdogService.new(self, id)\n end", "title": "" }, { "docid": "e6a472e3380b02879c7b51e9b3508ca0", "score": "0.5887954", "text": "def source_watchdogs(shell)\n [:system_load,:utilized_memory].map do |e|\n start_watchdog(:source, e, shell)\n end\n end", "title": "" }, { "docid": "072c6bb626bf8015183555bf6f194b3d", "score": "0.5881522", "text": "def watchdog_service(id)\n TemplateWatchdogService.new(self, id)\n end", "title": "" }, { "docid": "52636e79ed90378c029a82b9ac4c465d", "score": "0.5847182", "text": "def index\n @watchdogs = Watchdog.all\n end", "title": "" }, { "docid": "50cb44875c0ea42eaeba722de68ef6b5", "score": "0.57369953", "text": "def watchdogs=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Watchdog.new(value)\n end\n end\n end\n @watchdogs = list\n end", "title": "" }, { "docid": "50cb44875c0ea42eaeba722de68ef6b5", "score": "0.57369953", "text": "def watchdogs=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Watchdog.new(value)\n end\n end\n end\n @watchdogs = list\n end", "title": "" }, { "docid": "50cb44875c0ea42eaeba722de68ef6b5", "score": "0.57360643", "text": "def watchdogs=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Watchdog.new(value)\n end\n end\n end\n @watchdogs = list\n end", "title": "" }, { "docid": "50cb44875c0ea42eaeba722de68ef6b5", "score": "0.57360643", "text": "def watchdogs=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Watchdog.new(value)\n end\n end\n end\n @watchdogs = list\n end", "title": "" }, { "docid": "733739e05823a2c3bb5ab6fd4e187ff5", "score": "0.5734978", "text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n index = path.index('/')\n if index.nil?\n return watchdog_service(path)\n end\n return watchdog_service(path[0..(index - 1)]).service(path[(index + 1)..-1])\n end", "title": "" }, { "docid": "733739e05823a2c3bb5ab6fd4e187ff5", "score": "0.5734978", "text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n index = path.index('/')\n if index.nil?\n return watchdog_service(path)\n end\n return watchdog_service(path[0..(index - 1)]).service(path[(index + 1)..-1])\n end", "title": "" }, { "docid": "733739e05823a2c3bb5ab6fd4e187ff5", "score": "0.5734978", "text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n index = path.index('/')\n if index.nil?\n return watchdog_service(path)\n end\n return watchdog_service(path[0..(index - 1)]).service(path[(index + 1)..-1])\n end", "title": "" }, { "docid": "b093b15860965833cd6b70b2fcad20b9", "score": "0.56836146", "text": "def stop_watchdogs(watchdogs)\n watchdogs.each { |watchdog| stop_watchdog(watchdog) }\n end", "title": "" }, { "docid": "cfef815e14313361a5cc645a79c71f96", "score": "0.56829005", "text": "def start_watchdog(location, name, shell)\n display = \"#{location} #{name}\".capitalize\n UI.spinner(\"Starting watchdog: #{display}\") do\n Watchdogs.send(name, shell, display)\n end\n rescue Timeout::Error\n failed = name.to_s.gsub(/_/, ' ').capitalize\n retry_exit(\"Timed out starting the #{failed} watchdog.\")\n retry\n end", "title": "" }, { "docid": "399e15d4f2cdccd3d10f6575efcd5eaf", "score": "0.5658667", "text": "def watchdog\n EM.next_tick {\n # must be called within the EM thread\n @watchdog = Watchdog.new(self.class.name, Thread.current,\n interval: WATCHDOG_INTERVAL,\n threshold: WATCHDOG_THRESHOLD,\n timeout: WATCHDOG_TIMEOUT,\n )\n }\n\n EM::PeriodicTimer.new(WATCHDOG_INTERVAL) do\n @watchdog.async.ping\n end\n end", "title": "" }, { "docid": "d8c0690f99de033a874018eb610f739e", "score": "0.5634739", "text": "def set_watchdog_alerts(watchdogs, worker)\n watchdogs.each do |watchdog|\n method = watchdog.name.split(/ /).last\n Watchdogs.send(\"set_alarm_#{method}\", watchdog, worker)\n end\n end", "title": "" }, { "docid": "06fb7561f9b6e4e414b298cdc0326751", "score": "0.55147123", "text": "def daemons\n @daemons ||= []\n end", "title": "" }, { "docid": "484972c4b95d1f1185eb99b62acf5d58", "score": "0.5490426", "text": "def watchdog_loop\n @launcher.events.log \"* systemd: watchdog detected (#{@systemd.watchdog_usec}usec)\"\n\n # Ruby wants seconds, and the docs suggest notifying halfway through the\n # timeout.\n sleep_seconds = @systemd.watchdog_usec / 1000.0 / 1000.0 / 2.0\n\n loop do\n begin\n @launcher.events.debug \"systemd: notify watchdog\"\n @systemd.notify_watchdog\n rescue\n @launcher.events.error \"! systemd: notify watchdog failed:\\n #{$!.to_s}\\n #{$!.backtrace.join(\"\\n \")}\"\n ensure\n @launcher.events.debug \"systemd: sleeping #{sleep_seconds}s\"\n sleep sleep_seconds\n end\n end\n end", "title": "" }, { "docid": "88e7c12e6cd4b249066c2998f5e7a85a", "score": "0.52379936", "text": "def watchdogstats(args={})\n fetch(url(:\"watchdogstats\", args))\n end", "title": "" }, { "docid": "d343d92694271df17b2922becf411620", "score": "0.5186328", "text": "def locate_hooks\n hooks = []\n\n matching_hooks.each do |hook|\n hooks << hook if File.exist? hook\n end\n\n hooks\n end", "title": "" }, { "docid": "d3de58b81720089f7b4ff99d9c535a7d", "score": "0.51575536", "text": "def watchdog_enabled?\n memoize(:watchdog_enabled?) do\n break if ENV.has_key?('WATCHDOG_PID') && ENV.has_key?('WATCHDOG_USEC')\n break if ENV['WATCHDOG_PID'].to_i != Process.pid\n break if ENV['WATCHDOG_USEC'].to_i <= 0\n ENV.delete 'WATCHDOG_PID'\n true\n end\n end", "title": "" }, { "docid": "7d3ad6b9369d012cd4f4e1bd8ebb0b32", "score": "0.515198", "text": "def watchers\n [@watcher]\n end", "title": "" }, { "docid": "d63a8fd9063785d4be71c491d092a95e", "score": "0.5133394", "text": "def watchers\n if (nick =~ /^#{BOT_CONFIG[:owner_nick]}$/i) then\n @wx_watch.each { |w| msg nick, w.join(\"::\") }\n msg nick, \"#{@watcher_interval} second interval\"\n end\n end", "title": "" }, { "docid": "555294bcdc8aa3ab627802d74b3b0957", "score": "0.51217484", "text": "def start_daemons\n @daemons.keys.each do |daemon|\n start_daemon(daemon)\n end\n end", "title": "" }, { "docid": "6d62dc8543e6ce288d4e0887f7f40d0e", "score": "0.50790244", "text": "def watcher(*opts)\n res = @zk.get_children :path => ZK_PATH, :watcher => @watcher\n @services, @stat = res[:children], res[:stat]\n\n if @existing_services.size > @services.size # lost a registered service\n puts \"Service(s) with IP #{(@existing_services - @services).join(', ').light_red} Un-Registered\\n\\n\"\n else # gained a registered service\n puts \"Service(s) with IP #{(@services - @existing_services).join(', ').light_green} Registered\\n\\n\"\n end\n\n puts \"Service IPs Online: #{@services.empty? ? 'None'.light_yellow : @services.join(', ').light_yellow}\\n\\n\"\n\n @existing_services = @services\n end", "title": "" }, { "docid": "47c341033b0d1206dab141b340fd888b", "score": "0.5075315", "text": "def hooks_service\n @hooks_service ||= HostHooksService.new(self, 'hooks')\n end", "title": "" }, { "docid": "fbcc5e8f67e9650e553cbffa03d47b27", "score": "0.506151", "text": "def watchdog?\n ENV.include?(\"WATCHDOG_USEC\") &&\n (!ENV.include?(\"WATCHDOG_PID\") || ENV[\"WATCHDOG_PID\"].to_i == $$)\n end", "title": "" }, { "docid": "c299154ce376577f182345fd6aa98bbb", "score": "0.50153124", "text": "def create_watchdogs(source_shell, dest_shell)\n source_watchdogs(source_shell) + dest_watchdogs(dest_shell)\n end", "title": "" }, { "docid": "430e0ba46d627d680f6b5483f8e5a292", "score": "0.49928623", "text": "def watchdog\n Kontena::Watchdog.watch do\n fail \"Celluloid::Supervision::Container died\" unless @supervisor.alive?\n end\n end", "title": "" }, { "docid": "afbab3335065677cc205c0382bb63bcb", "score": "0.49688822", "text": "def services\n begin\n if @monit.get\n @monit.services.map(&:name)\n else\n puts \"[#{Time.now}]: Monit instance didn't give right answer\" if @debug\n []\n end\n rescue\n puts \"[#{Time.now}]: Error trying to connect to Monit instance\" if @debug\n []\n end\n end", "title": "" }, { "docid": "21e6a78b113303c7ceb701baa66d39f1", "score": "0.4918512", "text": "def listen(monitored_paths)\n @monitored_paths = monitored_paths\n loop { trigger; sleep(1) }\n end", "title": "" }, { "docid": "21e6a78b113303c7ceb701baa66d39f1", "score": "0.4918512", "text": "def listen(monitored_paths)\n @monitored_paths = monitored_paths\n loop { trigger; sleep(1) }\n end", "title": "" }, { "docid": "5d52eae13e44be677cc5dc1de34919fe", "score": "0.49182132", "text": "def set_services\n services = get_services\n\n @app_definitions.each do |app|\n app_name = app['name']\n\n file = File.join(@manifest_dir, app_name, 'manifest.yml')\n if File.exist?(file)\n begin\n manifest = YAML.load_file(file)\n\n app_service = manifest['applications'][0]['services'].first[1]['label']\n\n if services.include?(app_service)\n\n @apps_to_monitor << app_name\n\n end\n rescue => ex\n logger.warn(\"Can't read manifest for app #{app_name} - #{ex.message}:#{ex.backtrace}\")\n end\n end\n end\nend", "title": "" }, { "docid": "6a948d57027575ee1b70c3ae492d715b", "score": "0.49164015", "text": "def stop_watchdog(watchdog)\n UI.spinner(\"Stopping watchdog: #{watchdog.name}\") { watchdog.stop }\n rescue Timeout::Error\n end", "title": "" }, { "docid": "4b1f0cd5c0c33212ffc7a5325b14daa1", "score": "0.48885077", "text": "def check_running_count_for_service(service)\n # start instances\n if service.config_auto_start\n Watchdog.engine_instance.to_be_started_ports(service).each do |port|\n Watchdog.logger.info { \"start new instance of #{service.name} on port #{port}\" }\n Watchdog.engine_instance.start_service(service)\n end\n else\n Watchdog.logger.info { \"autostart for service #{service.name} is disabled\" }\n end\n\n # stop instances\n Watchdog.engine_instance.to_be_stopped_instances(service).each do |instance|\n Watchdog.logger.info { \"stop instance #{instance.name}\" }\n Watchdog.engine_instance.stop_service(instance.pid)\n end\n end", "title": "" }, { "docid": "67c54edd54290ae848740e535b43a585", "score": "0.487332", "text": "def load_daemon_info\n Dir.glob(\"#{Autumn::Config.root}/resources/daemons/*.yml\").each do |yml_file|\n yml = YAML.load(File.open(yml_file, 'r'))\n Daemon.new File.basename(yml_file, '.yml'), yml\n end\n end", "title": "" }, { "docid": "2ae211960c1d0d59da39fd3eca53b36a", "score": "0.48678738", "text": "def watched_directories\n []\n end", "title": "" }, { "docid": "b7b3e7477a4d90e1eefa651858d2fa87", "score": "0.4862187", "text": "def deregister_services\n Watchdog.logger.info { \"deregistering services...\" }\n enabled_services_names = Watchdog.engine_instance.show_enabled_services&.reject! { |name| name == Watchdog.full_name }\n if enabled_services_names.present?\n to_be_cleaned_classes = enabled_services_names.map { |name| Karma::Helpers.service_class_from_name(name) } - Karma.service_classes\n to_be_cleaned_classes.each do |service_class|\n Watchdog.logger.info { \"removing #{service_class}...\" }\n Watchdog.engine_instance.show_service(service_class).values.map do |s|\n Watchdog.logger.info { \"stopping pid #{s['pid']}...\" }\n Watchdog.engine_instance.stop_service(s['pid'])\n end\n sleep(1) until Watchdog.engine_instance.show_service(service_class).empty?\n Watchdog.engine_instance.remove_service(service_class)\n end\n else\n Watchdog.logger.info { \"no services to remove\" }\n end\n end", "title": "" }, { "docid": "3afddec007e473d02a9ddfe44457132b", "score": "0.48479947", "text": "def deployable_services\n Dir.glob(\"#{@repository_path}/service_*.rb\").map { |file| File.basename(file).match(/^service_(.*)\\.rb$/)[1] }\n end", "title": "" }, { "docid": "f1d3effd8e52549b15cef30a3c0956f8", "score": "0.48169655", "text": "def watchable_dirs\n @@watchable_dirs ||= {}\n end", "title": "" }, { "docid": "2128e296031a5490f167c916a64eb7c3", "score": "0.48085865", "text": "def discover\n statsd_increment('synapse.watcher.zk.discovery', [\"zk_cluster:#{@zk_cluster}\", \"zk_path:#{@discovery['path']}\", \"service_name:#{@name}\"])\n statsd_time('synapse.watcher.zk.discovery.elapsed_time', [\"zk_cluster:#{@zk_cluster}\", \"zk_path:#{@discovery['path']}\", \"service_name:#{@name}\"]) do\n log.info \"synapse: discovering backends for service #{@name}\"\n\n new_backends = []\n zk_children = with_retry(@retry_policy.merge({'retriable_errors' => ZK_RETRIABLE_ERRORS})) do |attempts|\n statsd_time('synapse.watcher.zk.children.elapsed_time', [\"zk_cluster:#{@zk_cluster}\", \"service_name:#{@name}\"]) do\n log.info \"synapse: zk list children at #{@discovery['path']} for #{attempts} times\"\n @zk.children(@discovery['path'], :watch => true)\n end\n end\n statsd_gauge('synapse.watcher.zk.children.bytes', ObjectSpace.memsize_of(zk_children), [\"zk_cluster:#{@zk_cluster}\", \"zk_path:#{@discovery['path']}\"])\n\n zk_children.each do |id|\n if id.start_with?(CHILD_NAME_ENCODING_PREFIX)\n decoded = parse_base64_encoded_prefix(id)\n if decoded != nil\n new_backends << create_backend_info(id, decoded)\n next\n end\n end\n\n begin\n node = with_retry(@retry_policy.merge({'retriable_errors' => ZK_RETRIABLE_ERRORS})) do |attempts|\n statsd_time('synapse.watcher.zk.get.elapsed_time', [\"zk_cluster:#{@zk_cluster}\", \"service_name:#{@name}\"]) do\n log.debug \"synapse: zk get child at #{@discovery['path']}/#{id} for #{attempts} times\"\n @zk.get(\"#{@discovery['path']}/#{id}\")\n end\n end\n rescue ZK::Exceptions::NoNode => e\n # This can happen when the registry unregisters a service node between\n # the call to @zk.children and @zk.get(path). ZK does not guarantee\n # a read to ``get`` of a child returned by ``children`` will succeed\n log.error(\"synapse: #{@discovery['path']}/#{id} disappeared before it could be read: #{e}\")\n next\n rescue StandardError => e\n log.error(\"synapse: #{@discovery['path']}/#{id} failed to get from ZK: #{e}\")\n statsd_increment('synapse.watcher.zk.get_child_failed')\n raise e\n end\n\n begin\n # TODO: Do less munging, or refactor out this processing\n decoded = deserialize_service_instance(node.first)\n rescue StandardError => e\n log.error \"synapse: skip child due to invalid data in ZK at #{@discovery['path']}/#{id}: #{e}\"\n statsd_increment('synapse.watcher.zk.parse_child_failed')\n else\n new_backends << create_backend_info(id, decoded)\n end\n end\n\n # support for a separate 'generator_config_path' key, for reading the\n # generator config block, that may be different from the 'path' key where\n # we discover service instances. if generator_config_path is present and\n # the value is \"disabled\", then skip all zk-based discovery of the\n # generator config (and use the values from the local config.json\n # instead).\n case @discovery.fetch('generator_config_path', nil)\n when 'disabled'\n discovery_key = nil\n when nil\n discovery_key = 'path'\n else\n discovery_key = 'generator_config_path'\n end\n\n if discovery_key\n begin\n node = with_retry(@retry_policy.merge({'retriable_errors' => ZK_RETRIABLE_ERRORS})) do |attempts|\n statsd_time('synapse.watcher.zk.get.elapsed_time', [\"zk_cluster:#{@zk_cluster}\", \"service_name:#{@name}\"]) do\n log.info \"synapse: zk get parent at #{@discovery[discovery_key]} for #{attempts} times\"\n @zk.get(@discovery[discovery_key], :watch => true)\n end\n end\n new_config_for_generator = parse_service_config(node.first)\n rescue ZK::Exceptions::NoNode => e\n log.error \"synapse: No ZK node for config data at #{@discovery[discovery_key]}: #{e}\"\n new_config_for_generator = {}\n rescue StandardError => e\n log.error \"synapse: skip path due to invalid data in ZK at #{@discovery[discovery_key]}: #{e}\"\n statsd_increment('synapse.watcher.zk.get_config_failed')\n new_config_for_generator = {}\n end\n else\n new_config_for_generator = {}\n end\n\n set_backends(new_backends, new_config_for_generator)\n end\n end", "title": "" }, { "docid": "f1b2f63034354e740f8e46f922e082f3", "score": "0.48038074", "text": "def _scoped_watchers\n watchers = []\n runner.send(:_scoped_plugins) { |guard| watchers += guard.watchers }\n watchers\n end", "title": "" }, { "docid": "de36c56b1ab06c05112829bf5c53cfee", "score": "0.47906855", "text": "def start\n GoodJob::SdNotify.ready\n run_watchdog\n end", "title": "" }, { "docid": "938de16c6d884acb75d75541ab29c6fe", "score": "0.4786217", "text": "def defined_notifiers\n Module.constants.select {|c| c.match /\\w+Notifier/ }.map { |c| Object.const_get(c) }\n end", "title": "" }, { "docid": "e59f4d070c552d47bd91471dcee39a21", "score": "0.47317713", "text": "def discover\n statsd_increment('synapse.watcher.zk.discovery', [\"zk_cluster:#{@zk_cluster}\", \"zk_path:#{@discovery['path']}\", \"service_name:#{@name}\"])\n statsd_time('synapse.watcher.zk.discovery.elapsed_time', [\"zk_cluster:#{@zk_cluster}\", \"zk_path:#{@discovery['path']}\", \"service_name:#{@name}\"]) do\n log.info \"synapse: discovering backends for service #{@name}\"\n\n new_backends = []\n @zk.children(@discovery['path'], :watch => true).each do |id|\n begin\n node = statsd_time('synapse.watcher.zk.get.elapsed_time', [\"zk_cluster:#{@zk_cluster}\", \"service_name:#{@name}\"]) do\n @zk.get(\"#{@discovery['path']}/#{id}\")\n end\n rescue ZK::Exceptions::NoNode => e\n # This can happen when the registry unregisters a service node between\n # the call to @zk.children and @zk.get(path). ZK does not guarantee\n # a read to ``get`` of a child returned by ``children`` will succeed\n log.error(\"synapse: #{@discovery['path']}/#{id} disappeared before it could be read: #{e}\")\n next\n end\n\n begin\n # TODO: Do less munging, or refactor out this processing\n host, port, name, weight, haproxy_server_options, labels = deserialize_service_instance(node.first)\n rescue StandardError => e\n log.error \"synapse: invalid data in ZK node #{id} at #{@discovery['path']}: #{e}\"\n else\n # find the numberic id in the node name; used for leader elections if enabled\n numeric_id = id.split('_').last\n numeric_id = NUMBERS_RE =~ numeric_id ? numeric_id.to_i : nil\n\n log.debug \"synapse: discovered backend #{name} at #{host}:#{port} for service #{@name}\"\n new_backends << {\n 'name' => name, 'host' => host, 'port' => port,\n 'id' => numeric_id, 'weight' => weight,\n 'haproxy_server_options' => haproxy_server_options,\n 'labels' => labels\n }\n end\n end\n\n # support for a separate 'generator_config_path' key, for reading the\n # generator config block, that may be different from the 'path' key where\n # we discover service instances. if generator_config_path is present and\n # the value is \"disabled\", then skip all zk-based discovery of the\n # generator config (and use the values from the local config.json\n # instead).\n case @discovery.fetch('generator_config_path', nil)\n when 'disabled'\n discovery_key = nil\n when nil\n discovery_key = 'path'\n else\n discovery_key = 'generator_config_path'\n end\n\n if discovery_key\n node = statsd_time('synapse.watcher.zk.get.elapsed_time', [\"zk_cluster:#{@zk_cluster}\", \"service_name:#{@name}\"]) do\n @zk.get(@discovery[discovery_key], :watch => true)\n end\n begin\n new_config_for_generator = parse_service_config(node.first)\n rescue StandardError => e\n log.error \"synapse: invalid config data in ZK node at #{@discovery[discovery_key]}: #{e}\"\n new_config_for_generator = {}\n end\n else\n new_config_for_generator = {}\n end\n\n set_backends(new_backends, new_config_for_generator)\n end\n end", "title": "" }, { "docid": "105af3c99810911399a9ac1933eb64fe", "score": "0.47109494", "text": "def ListOfServicesToStart\n services_to_start = []\n current_runlevel = GetCurrentRunlevel()\n\n # In AutoYast the current runlevel doesn't matter\n # the imported one (default_runlevel) does.\n current_runlevel = GetDefaultRunlevel() if InAutoYast()\n\n Builtins.y2milestone(\"Current runlevel: %1\", current_runlevel)\n\n Builtins.foreach(@services) do |service, details|\n # boot.* services are ignored\n next if Builtins.regexpmatch(service, \"^boot..*\")\n # these services should not be running now\n if !Builtins.contains(\n Ops.get_list(details, \"start\", []),\n current_runlevel\n )\n next\n end\n # only changed services\n next if !Ops.get_boolean(details, \"dirty\", false)\n services_to_start = Builtins.add(services_to_start, service)\n end\n\n Builtins.y2milestone(\"Services to start: %1\", services_to_start)\n\n deep_copy(services_to_start)\n end", "title": "" }, { "docid": "977c91d438268fe790112ffd6417c472", "score": "0.47068214", "text": "def populate_registry\n [\"DevelopmentLogger\", \"ProductionLogger\"].each do |logger_type|\n register logger_type, Object.const_get(logger_type).send(:new)\n end\n end", "title": "" }, { "docid": "a76978a4c9f185b04224c10162cd845e", "score": "0.4705372", "text": "def watching\n @watching ||= ApiFactory.new 'Repos::Watching'\n end", "title": "" }, { "docid": "a9892a439eeedde67aa55886731947d0", "score": "0.4701774", "text": "def register_services\n Watchdog.logger.info { \"registering services... #{Karma.service_classes.count} services found\" }\n Karma.service_classes.each do |cls|\n Watchdog.logger.info { \"registering #{cls.name}...\" }\n Watchdog.engine_instance.export_service(cls)\n cls.register\n end\n Watchdog.logger.info { \"done registering services\" }\n end", "title": "" }, { "docid": "9b5f9bef4e2dafc3cc47a9dda86368ba", "score": "0.46850562", "text": "def listen(monitored_paths)\n # FIX ... make more generic (handle at a higher level ...)\n while true\n @monitored_paths = monitored_paths\n @old_paths = []\n @first_time = true\n @watchers = {}\n ::EM.run do\n attach\n if Watchr.options.once\n Watchr.batches.each do |k,v|\n k.deliver\n end\n return \n end\n end\n end\n end", "title": "" }, { "docid": "d881c837ee688943654740cf6d2576c7", "score": "0.46820304", "text": "def watchers; end", "title": "" }, { "docid": "e175fc0b29388d837a7e4b0aec6412b8", "score": "0.46807668", "text": "def services\n @services ||= registry_strategy.load_services\n end", "title": "" }, { "docid": "aa8e8dad3685fc09fbaf72cb38f7338f", "score": "0.4676892", "text": "def init_daemons\n @daemons_setting.each do |daemon_task, setting|\n begin\n @daemon_logger.info(\"[INIT_DAEMON] #{daemon_task}\")\n @daemon_logger.info(\"[#{daemon_task}] setting: #{setting}\")\n daemon = daemon_task.constantize.new(setting)\n # daemon = DaemonTask.new(setting)\n @daemons << daemon\n daemon.start\n rescue => e\n @daemon_logger.error(e)\n end\n end\n end", "title": "" }, { "docid": "9384db03ddf4a14c78cf2fcf27bc6d7d", "score": "0.46746027", "text": "def mon_pid\n shell = systemu(\"ps auxw | grep -v grep | grep bixby-monitoring-daemon\")\n lines = shell.stdout.split(/\\n/).reject{ |s| s.empty? }\n return nil if lines.empty?\n lines = lines.map{ |s| s.split(/\\s+/) }\n lines.reject!{ |l| l.first != \"bixby\" || l.last != \"bixby-monitoring-daemon\" }\n if lines.size > 1 then\n raise Micron::Assertion, \"Found #{lines.size} monitoring daemons running!\", caller\n end\n ps = lines.first\n return ps[1].to_i\n end", "title": "" }, { "docid": "8b153ee4609993f1e04ff3c3e3c4fcdf", "score": "0.46745303", "text": "def watcher(*opts)\n res = @zk.get_children :path => ZK_PATH, :watcher => @watcher\n @services, @stat = res[:children], res[:stat]\n\n # remove un-registered services from view\n if @existing_services.size > @services.size\n (@existing_services - @services).each do |lost_service|\n setpos (@existing_services.index(lost_service) + TOP_OFFSET), LEFT_OFFSET\n deleteln\n refresh\n end\n end\n\n @existing_services = @services\n end", "title": "" }, { "docid": "43d635a2974eafd3b0fec70332006939", "score": "0.46576932", "text": "def servicedir\n unless @servicedir\n [\"/service\", \"/etc/service\",\"/var/lib/svscan\"].each do |path|\n if FileTest.exist?(path)\n @servicedir = path\n break\n end\n end\n raise \"Could not find service directory\" unless @servicedir\n end\n @servicedir\n end", "title": "" }, { "docid": "38ef626cba0152846e4a3bcdd2e721fc", "score": "0.4656122", "text": "def watchable_dirs; end", "title": "" }, { "docid": "d0c01e8e080e61c408710871460d7a39", "score": "0.46495754", "text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n if path == 'cdroms'\n return cdroms_service\n end\n if path.start_with?('cdroms/')\n return cdroms_service.service(path[7..-1])\n end\n if path == 'diskattachments'\n return disk_attachments_service\n end\n if path.start_with?('diskattachments/')\n return disk_attachments_service.service(path[16..-1])\n end\n if path == 'graphicsconsoles'\n return graphics_consoles_service\n end\n if path.start_with?('graphicsconsoles/')\n return graphics_consoles_service.service(path[17..-1])\n end\n if path == 'nics'\n return nics_service\n end\n if path.start_with?('nics/')\n return nics_service.service(path[5..-1])\n end\n if path == 'permissions'\n return permissions_service\n end\n if path.start_with?('permissions/')\n return permissions_service.service(path[12..-1])\n end\n if path == 'tags'\n return tags_service\n end\n if path.start_with?('tags/')\n return tags_service.service(path[5..-1])\n end\n if path == 'watchdogs'\n return watchdogs_service\n end\n if path.start_with?('watchdogs/')\n return watchdogs_service.service(path[10..-1])\n end\n raise Error.new(\"The path \\\"#{path}\\\" doesn't correspond to any service\")\n end", "title": "" }, { "docid": "f26831a2a745ed46227f42ff5ecfa45c", "score": "0.46475276", "text": "def configure_boot_services\n disable_runlevel '2'\n disable_runlevel 'S'\n\n @services.each do |root, service|\n args = [service[:name]]\n args += ['start'] + service[:start].split(' ') if service[:start]\n args += ['stop'] + service[:stop].split(' ') if service[:stop]\n in_update_rcd '-f', *args\n end\n end", "title": "" }, { "docid": "c72ae6e61be3f60381a2e0215a41dfd5", "score": "0.46389565", "text": "def watcher\n @watcher ||= ActiveSupport::Dependencies::WatchStack.new\n end", "title": "" }, { "docid": "65d504a7d57ee4829a401c83d2d9a5ec", "score": "0.46265423", "text": "def index\n items = User.watchdogs\n items = items.name_sorted unless (params[:q][:s] rescue nil)\n @q = items.ransack(params[:q])\n @watchdogs = @q.result(distinct: true).page(params[:page])\n end", "title": "" }, { "docid": "98490d38bd28e29fadb49c8ac2d8fd9b", "score": "0.46211332", "text": "def install_all_services\n\n @location = \"/usr/local/bin/logstash\"\n @logstash = \"logstash-1.1.5.jar\"\n @config_location = \"/etc/logstash/conf\"\n @grok_config_location = \"/etc/logstash/conf/grok_patterns\"\n @flags = \"agent -f \"\n\n logstash_service_files.each do |service|\n service_name = \"logstash-#{service.split('-').last}\"\n service_config_file = \"redis-#{service.split('-').last}.conf\"\n\n\n\n @to_run = \"java -jar #{@location}/#{@logstash} #{@flags} #{@config_location}/#{service_config_file}\"\n\n file \"/usr/local/bin/#{service_name}\",\n :ensure => :present,\n :mode => '755',\n :content => template(File.join(File.dirname(__FILE__), '..', '..', 'templates', \"service.erb\"), binding)\n\n\n file \"/etc/init.d/#{service}\",\n :ensure => :present,\n :mode => '755',\n :content => template(File.join(File.dirname(__FILE__), '..', '..', 'templates', \"#{service}.d.erb\"), binding)\n end\n\n end", "title": "" }, { "docid": "fd248d9f349cdc082ebe9f20f5ceaa97", "score": "0.46192458", "text": "def look_for_responders(severity, type)\n responders = Responder.to(type).available_on_duty\n return [] if responders.empty?\n\n # Pick desired dispatcher\n Dispatcher::Naive.look_for(severity, responders)\n rescue Dispatcher::NoDispatchError\n []\n end", "title": "" }, { "docid": "41fe288615186ee326681b66cc6fe019", "score": "0.46074122", "text": "def list\n eww(\"No %s services controlled by `#{bin}` running...\" % [root? ? 'root' : 'user-space']) and return if running.empty?\n running.each do |label|\n if svc = Service.from(label)\n status = !svc.dest.file? ? \"#{Tty.red}stale \" : \"#{Tty.white}started\"\n puts \"%-10.10s %s#{Tty.reset} %7s %s\" % [svc.name, status, svc.pid ? svc.pid.to_s : '-', svc.dest.file? ? svc.dest : label]\n else\n puts \"%-10.10s #{Tty.red}unknown#{Tty.reset} %7s #{label}\" % [\"?\", \"-\"] \n end\n end\n end", "title": "" }, { "docid": "c83284f38bf168e18be0296d61e4ab28", "score": "0.46029794", "text": "def servicedir\n unless @servicedir\n [\"/service\", \"/etc/service\",\"/var/service\"].each do |path|\n if FileTest.exist?(path)\n @servicedir = path\n break\n end\n end\n raise \"Could not find service directory\" unless @servicedir\n end\n @servicedir\n end", "title": "" }, { "docid": "a7a0303e4c28d647f429fdbd35b856e8", "score": "0.46002597", "text": "def stop_watchdog\n sleep Workety::STOP_SELF_WATCHDOG_TIMEOUT\n Thread.log \"Timeout stopping process\"\n ensure\n Process.exit(false)\n end", "title": "" }, { "docid": "1ad5ca14f853bf97a862f066f1504749", "score": "0.45993686", "text": "def service(path)\n if path.nil? || path == ''\n return self\n end\n if path == 'graphicsconsoles'\n return graphics_consoles_service\n end\n if path.start_with?('graphicsconsoles/')\n return graphics_consoles_service.service(path[17..-1])\n end\n if path == 'nics'\n return nics_service\n end\n if path.start_with?('nics/')\n return nics_service.service(path[5..-1])\n end\n if path == 'watchdogs'\n return watchdogs_service\n end\n if path.start_with?('watchdogs/')\n return watchdogs_service.service(path[10..-1])\n end\n raise Error.new(\"The path \\\"#{path}\\\" doesn't correspond to any service\")\n end", "title": "" }, { "docid": "1a8f94f54937dfcf8ebb148b7dbdbf94", "score": "0.45825925", "text": "def watch\n @watcher.unsubscribe if defined? @watcher\n @watcher = @zk.register(@discovery['path'], &watcher_callback)\n end", "title": "" }, { "docid": "aaf005a1841bd8480893615635fe780d", "score": "0.45642978", "text": "def services\n `service --status-all 2>&1`\n end", "title": "" }, { "docid": "ae9cf65c0fb9477467d8e7a0d11867c5", "score": "0.45620465", "text": "def services\n @services ||= []\n end", "title": "" }, { "docid": "ae9cf65c0fb9477467d8e7a0d11867c5", "score": "0.45620465", "text": "def services\n @services ||= []\n end", "title": "" }, { "docid": "c1ef8e4c62c768fed21635abfa00f100", "score": "0.4555686", "text": "def help\n [\"#{config.nick}.watchdog.list\",\n \"#{config.nick}.watchdog.add <URL>\",\n \"#{config.nick}.watchdog.del <URL>\",\n ].join(\"\\n\")\n end", "title": "" }, { "docid": "d03287099802f00fff820d0ca0f248b6", "score": "0.45522058", "text": "def services\n @services ||= []\n end", "title": "" }, { "docid": "d03287099802f00fff820d0ca0f248b6", "score": "0.45522058", "text": "def services\n @services ||= []\n end", "title": "" }, { "docid": "d03287099802f00fff820d0ca0f248b6", "score": "0.45522058", "text": "def services\n @services ||= []\n end", "title": "" }, { "docid": "d03287099802f00fff820d0ca0f248b6", "score": "0.45522058", "text": "def services\n @services ||= []\n end", "title": "" }, { "docid": "fab1483d81b98a063c49610c5779424e", "score": "0.4538274", "text": "def service_registry\n @service_registry ||= {}\n end", "title": "" }, { "docid": "5b149d43fdf051209a31467755e49b5f", "score": "0.45205632", "text": "def install_all_services\n\n puts '*'*100\n puts \"Service Install\"\n\n @location = \"/usr/local/bin/logstash\"\n @logstash = \"logstash-1.1.5.jar\"\n @config_location = \"/etc/logstash/conf\"\n @grok_config_location = \"/etc/logstash/conf/grok_patterns\"\n @flags = \"agent -f \"\n\n logstash_service_files.each do |service|\n @service = service\n puts @service\n\n @service_name = \"logstash-#{service.split('-').last}\"\n @service_config_file = \"redis-#{service.split('-').last}.conf\"\n\n @to_run = \"cd #{@location} && java -jar #{@location}/#{@logstash} #{@flags} #{@config_location}/#{@service_config_file} &\"\n\n puts \"/usr/local/bin/#{@service_name}\"\n file \"/usr/local/bin/#{@service_name}\",\n :ensure => :present,\n :mode => '755',\n :content => template(File.join(File.dirname(__FILE__), '..', '..', 'templates', \"service.erb\"), binding)\n\n\n puts \"/etc/init.d/#{@service_name}\"\n file \"/etc/init.d/#{@service_name}\",\n :ensure => :present,\n :mode => '755',\n :content => template(File.join(File.dirname(__FILE__), '..', '..', 'templates', \"init-template.d.erb\"), binding)\n end\n puts '*'*100\n end", "title": "" }, { "docid": "f5b7276a8cc962bdffcd8a2b32d6868e", "score": "0.45122662", "text": "def watch\n return if @zk.nil?\n log.debug \"synapse: setting watch at #{@discovery['path']}\"\n\n statsd_time('synapse.watcher.zk.watch.elapsed_time', [\"zk_cluster:#{@zk_cluster}\", \"zk_path:#{@discovery['path']}\", \"service_name:#{@name}\"]) do\n @watcher = @zk.register(@discovery['path'], &watcher_callback) unless @watcher\n\n # Verify that we actually set up the watcher.\n unless @zk.exists?(@discovery['path'], :watch => true)\n log.error \"synapse: zookeeper watcher path #{@discovery['path']} does not exist!\"\n zk_cleanup\n end\n end\n log.debug \"synapse: set watch at #{@discovery['path']}\"\n end", "title": "" }, { "docid": "a978452a796bd971130925b166492a10", "score": "0.45108593", "text": "def daemons\n entries = []\n if ::File.read(\"/etc/rc.conf\") =~ /DAEMONS=\\((.*)\\)/m\n entries += $1.gsub(/\\\\?[\\r\\n]/, \" \").gsub(/# *[^ ]+/, \" \").split(\" \") if $1.length > 0\n end\n\n yield(entries) if block_given?\n\n entries\n end", "title": "" }, { "docid": "a9913810e31b22eb3cf08f72fd5ed1c7", "score": "0.45104778", "text": "def listen\n autoload\n unless roots.any?\n raise NoRootsError, 'No folders to watch!'\n end\n roots.uniq!\n logger.debug(\"[#{Time.now.utc}] - Listening to #{roots.join(',')}\")\n args = roots + [{:latency => 0.1}]\n listener = Listen.to(*args) do |modified, added, removed|\n EVENTS.each do |event|\n eval(event).each do |path|\n logger.debug %([#{Time.now.utc}] - #{event}: #{path})\n begin\n uuid = path[/^#{roots_regex}\\/([^\\/]+)\\/.+$/, 1] || next\n begin\n base = Base.find_by_uuid(uuid)\n base.handle(event, path)\n rescue Mongoid::Errors::DocumentNotFound\n logger.error %([#{Time.now.utc}] - Can't find Vidibus::WatchFolder::Base #{uuid})\n end\n rescue => e\n logger.error(\"[#{Time.now.utc}] - ERROR in Vidibus::WatchFolder.listen:\\n#{e.inspect}\\n---\\n#{e.backtrace.join(\"\\n\")}\")\n end\n end\n end\n end\n listener.start\n sleep\n end", "title": "" }, { "docid": "39b47f05e1d91e78e757f2528b28b041", "score": "0.4509079", "text": "def services_path\n File.expand_path @target || \"~/Library/Services\"\n end", "title": "" }, { "docid": "924b7183360d73cde935ffd936a1e3bc", "score": "0.4500791", "text": "def services\n Dir.children @path\n end", "title": "" }, { "docid": "10d93bb949eaa19d8bc42962cac4c2cb", "score": "0.44960213", "text": "def find_reloadable_worker\n t_workers = Dir[\"#{WORKER_ROOT}/**/*.rb\"]\n @reloadable_workers = t_workers.map do |x|\n worker_name = File.basename(x,\".rb\")\n require worker_name\n worker_klass = Object.const_get(worker_name.classify)\n worker_klass.reload_flag ? worker_klass : nil\n end.compact\n @worker_triggers = { }\n @reloadable_workers.each do |t_worker|\n schedule = load_reloadable_schedule(t_worker)\n if schedule && !schedule.empty?\n @worker_triggers[t_worker.worker_name.to_sym] = schedule\n end\n end\n end", "title": "" }, { "docid": "10d93bb949eaa19d8bc42962cac4c2cb", "score": "0.44960213", "text": "def find_reloadable_worker\n t_workers = Dir[\"#{WORKER_ROOT}/**/*.rb\"]\n @reloadable_workers = t_workers.map do |x|\n worker_name = File.basename(x,\".rb\")\n require worker_name\n worker_klass = Object.const_get(worker_name.classify)\n worker_klass.reload_flag ? worker_klass : nil\n end.compact\n @worker_triggers = { }\n @reloadable_workers.each do |t_worker|\n schedule = load_reloadable_schedule(t_worker)\n if schedule && !schedule.empty?\n @worker_triggers[t_worker.worker_name.to_sym] = schedule\n end\n end\n end", "title": "" }, { "docid": "c60bb97a7a5bb95e0946fcad7381abed", "score": "0.4495461", "text": "def refresh(monitored_paths)\n @monitored_paths = monitored_paths\n end", "title": "" }, { "docid": "c60bb97a7a5bb95e0946fcad7381abed", "score": "0.4495461", "text": "def refresh(monitored_paths)\n @monitored_paths = monitored_paths\n end", "title": "" }, { "docid": "ea831aeb3aa439263457417ab5189df1", "score": "0.44826028", "text": "def watchers(options = {})\n watchers_resource(options)\n end", "title": "" }, { "docid": "24d5b366d2923f61ca45b50dc6cb2d50", "score": "0.44765294", "text": "def cancel_watchdog\n if @watchdog\n @watchdog.cancel\n end\n end", "title": "" }, { "docid": "9a094327ffdb44ca0b196aa6f7f9d079", "score": "0.44754717", "text": "def wind_service(value = nil)\n rw_config(:wind_service, value)\n end", "title": "" } ]
ca4f9c9811a385630428fd7ef9b8ce8f
USDT > ETH > BTC > USDT
[ { "docid": "20f1023c66974ee864d1a19113620b9f", "score": "0.0", "text": "def calculate_triangle(fund)\n refresh_balances(@base, @coin1, @coin2)\n print_balances\n\n pairs = [\n find_pair(@coin1, base: @base),\n find_pair(@coin2, base: @coin1),\n find_pair(@base, base: @coin2),\n ]\n\n points = pairs.map do |pair|\n [pair, API.get_market_order_book(pair[:name], 1)]\n end\n # ap points\n\n result1 = { order: [] }\n result2 = { order: [] }\n\n fund1 = fund\n result1[:order] << calculate_after_exchange(fund1, *points[0], method: :buy)\n fund1 = result1[:order].last[:exchanged_fund]\n result1[:order] << calculate_after_exchange(fund1, *points[1], method: :buy)\n fund1 = result1[:order].last[:exchanged_fund]\n result1[:order] << calculate_after_exchange(fund1, *points[2], method: :buy)\n fund1 = result1[:order].last[:exchanged_fund]\n\n fund2 = fund\n result2[:order] << calculate_after_exchange(fund2, *points[2], method: :sell)\n fund2 = result2[:order].last[:exchanged_fund]\n result2[:order] << calculate_after_exchange(fund2, *points[1], method: :sell)\n fund2 = result2[:order].last[:exchanged_fund]\n result2[:order] << calculate_after_exchange(fund2, *points[0], method: :sell)\n fund2 = result2[:order].last[:exchanged_fund]\n\n if fund1 > fund2\n result1.merge(earn: \"#{fund1 - fund} #{@base}\")\n else\n result2.merge(earn: \"#{fund2 - fund} #{@base}\")\n end\n end", "title": "" } ]
[ { "docid": "2596915d7c5ca6c0db960f2489f82ae2", "score": "0.5571792", "text": "def usd_profit\n break_even(:usd).abs\n end", "title": "" }, { "docid": "332253c50901c5dc6965ff2a7ea9024d", "score": "0.54490966", "text": "def usd_value\n # CBR.ru may not update exchange rate on holidays\n # so the we need the most recent exchange rate up to date.\n # It is assumed here that exchange rate is updated at least once a month\n Time.use_zone('Europe/Moscow') do\n today = Time.zone.now\n date1 = (today-1.month).strftime(\"%d/%m/%Y\")\n date2 = today.strftime(\"%d/%m/%Y\")\n url = \"http://www.cbr.ru/scripts/XML_dynamic.asp?date_req1=#{date1}&date_req2=#{date2}&VAL_NM_RQ=R01235\"\n begin\n page = Net::HTTP::get(URI(url))\n xml = Nokogiri::XML(page)\n val = xml.xpath('//ValCurs//Record//Value').last.content\n m = val.match(/(?<rubl>\\d+)(.|,)(?<cop>\\d+)/)\n BigDecimal(\"#{m[:rubl]}.#{m[:cop]}\")\n rescue StandardError => error\n # rescuing StandardError is a bad practice\n # but for the sake of a simplification\n # we don't care here if it's a timeout, 503 or the response xml is malformed\n nil\n end\n end\n end", "title": "" }, { "docid": "05d5c4c2be154276197bd4412b15c4a5", "score": "0.5396349", "text": "def balance_btc_ui\n balance_btc.to_f * 10 ** -8\n end", "title": "" }, { "docid": "e787326a558406bb37b7dbec98130e81", "score": "0.53868264", "text": "def currency\n :TWD\n end", "title": "" }, { "docid": "f397b86e630b93e8abe00f8b31f00c50", "score": "0.53648293", "text": "def as_us_dollar\n exchange_to(\"USD\")\n end", "title": "" }, { "docid": "f397b86e630b93e8abe00f8b31f00c50", "score": "0.53648293", "text": "def as_us_dollar\n exchange_to(\"USD\")\n end", "title": "" }, { "docid": "f397b86e630b93e8abe00f8b31f00c50", "score": "0.53648293", "text": "def as_us_dollar\n exchange_to(\"USD\")\n end", "title": "" }, { "docid": "f397b86e630b93e8abe00f8b31f00c50", "score": "0.53648293", "text": "def as_us_dollar\n exchange_to(\"USD\")\n end", "title": "" }, { "docid": "dfc96a3d27cb3306fc12c9df80a6d8dd", "score": "0.5360276", "text": "def trading_pair\n @trading_pair.split('-').reverse.join('-').sub('BTC', 'XBT').sub('-','')\n end", "title": "" }, { "docid": "85fe8941929f3557e85c967264227cc1", "score": "0.5359008", "text": "def usd(cents); end", "title": "" }, { "docid": "b31303332f915fb382e8f6eb7e309975", "score": "0.53282773", "text": "def trend\n if new_sub?\n \"none\"\n elsif avg_fee == operations.last.amount_cents\n \"flat_fee\"\n elsif operations.last.amount_cents > operations[-2].amount_cents\n \"arrow_up\"\n else\n \"arrow_down\"\n end\n end", "title": "" }, { "docid": "ce04b2f281c2b73e125514baa075b4d4", "score": "0.52984357", "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": "ffc7d9e72a7d0aedc981956846167247", "score": "0.5294658", "text": "def usd_rate\n clean(Typhoeus::Request.get('https://wts.zold.io/usd_rate')).body.to_f\n end", "title": "" }, { "docid": "88c26824970a2cfbdb94b7f541930f36", "score": "0.52424353", "text": "def balances?(tk); end", "title": "" }, { "docid": "c5579a5e392cdcc144a768fbe96f31f3", "score": "0.5236251", "text": "def update_stx(payments, stx_info, pubkey_payer, pubkey_payee)\n\n # update the balance after payment.\n for payment_type_hash in payments.keys()\n for index in (0..stx_info[:outputs].length - 1)\n @logger.info(\"update_stx: begin.\")\n output = stx_info[:outputs][index]\n output_data = stx_info[:outputs_data][index]\n @logger.info(\"update_stx: output: #{output}, output_data: #{output_data}\")\n type = find_type(payment_type_hash)\n amount = payments[payment_type_hash]\n if payment_type_hash == \"\"\n @logger.info(\"update_stx: ckb branch.\")\n return (output.capacity - output.calculate_min_capacity(output_data)) - amount if output.capacity - amount < output.calculate_min_capacity(output_data) && output.lock.args == pubkey_payer\n return (output.capacity - output.calculate_min_capacity(output_data)) + amount if output.capacity + amount < output.calculate_min_capacity(output_data) && output.lock.args == pubkey_payee\n stx_info[:outputs][index].capacity = output.capacity - amount if output.lock.args == pubkey_payer\n stx_info[:outputs][index].capacity = output.capacity + amount if output.lock.args == pubkey_payee\n elsif payment_type_hash == @udt_type_script_hash\n @logger.info(\"update_stx: udt branch.\")\n return type[:decoder].call(output_data) - amount if type[:decoder].call(output_data) - amount < 0 && output.lock.args == pubkey_payer\n return type[:decoder].call(output_data) + amount if type[:decoder].call(output_data) + amount < 0 && output.lock.args == pubkey_payee\n stx_info[:outputs_data][index] = type[:encoder].call(type[:decoder].call(output_data) - amount) if output.lock.args == pubkey_payer\n stx_info[:outputs_data][index] = type[:encoder].call(type[:decoder].call(output_data) + amount) if output.lock.args == pubkey_payee\n else\n return \"not support\"\n end\n end\n end\n\n witness_new = Array.new()\n for witness in stx_info[:witnesses]\n witness = parse_witness(witness)\n lock = parse_witness_lock(witness.lock)\n witness_new << generate_empty_witness(lock[:id], lock[:flag], lock[:nounce] + 1, witness.input_type, witness.output_type)\n end\n\n stx_info[:witnesses] = witness_new\n\n return stx_info\n end", "title": "" }, { "docid": "403a93fc671ef3d874a9f1891abef07e", "score": "0.5210124", "text": "def in_usd(*opts)\n exchange_to(\"USD\", *opts)\n end", "title": "" }, { "docid": "9d4ecf133de0037764f42b7bd19417c4", "score": "0.51866066", "text": "def currency\n 'usd'\n end", "title": "" }, { "docid": "cc5d56f44462a54c2e764f6ef75ac3de", "score": "0.51798844", "text": "def processa_eth\n puts(format(\"%<n>4i TRANSACOES\\tETH\\t\\tINSERIDAS etht\", n: apies.novtx.empty? ? 0 : dml(etht_ins)))\n puts(format(\"%<n>4i TOKENS\\tETH\\t\\tINSERIDAS ethk\", n: apies.novkx.empty? ? 0 : dml(ethk_ins)))\n end", "title": "" }, { "docid": "f1bd068abcc3762349d6b47b855916dc", "score": "0.5179674", "text": "def get_USD (num_string)\n if num_string == nil || num_string.to_i == 0\n return num_string\n end\n\n num_string = num_string.to_s.split(\"\")\n\n usd = [\"$\"]\n\n num_string.each_with_index do |num, index|\n if index == ((num_string.length) -1)\n usd << \"#{num}.00\"\n elsif index != 0 && index % 3 == 0\n usd << \",#{num}\"\n else\n usd << num.to_s\n end\n end\n return usd.join(\"\")\n end", "title": "" }, { "docid": "607a675417ad5512e0de82bbfbb655a0", "score": "0.51632285", "text": "def bitcoin\n @bitcoin_data = {\n price: @api_hash[\"RAW\"][\"BTC\"][\"USD\"][\"PRICE\"],\n change_usd: @api_hash[\"RAW\"][\"BTC\"][\"USD\"][\"CHANGE24HOUR\"].round(2),\n change_percent: @api_hash[\"RAW\"][\"BTC\"][\"USD\"][\"CHANGEPCT24HOUR\"].round(2)\n }\nend", "title": "" }, { "docid": "59e1493a0ac8ee900d31ead61dd09707", "score": "0.51608056", "text": "def tier_prices_string (unit_label = '')\n tiers = self.cloud_cost_tiers.order(\"upto ASC\")\n return \"#{tiers.first.cost.to_s}\" if tiers.length == 1\n\n tier_prices_string = \"From 0#{unit_label}\"\n\n tiers.each do |t|\n if t.upto == nil\n tier_prices_string << \" and above: #{t.cost.to_s}\"\n else\n tier_prices_string << \" up to #{t.upto.to_s}#{unit_label}: #{t.cost.to_s},\"\n end\n end\n return tier_prices_string\n end", "title": "" }, { "docid": "361cb5c70afea1224932dda23e98d0ae", "score": "0.51505953", "text": "def balance_delta\n prepared.map(&:amount_with_sign).reduce(:+)\n end", "title": "" }, { "docid": "829226a57ab6fa4c56f8fdfbe2aed39d", "score": "0.5143434", "text": "def price_in_usd\n case @currency\n when :inr\n @price_per_share.to_i * 50\n when :gbp\n @price_per_share.to_i * 2\n else\n @price_per_share.to_i\n end\n end", "title": "" }, { "docid": "14d23e4ba5808e72b326df0de264a54c", "score": "0.51396257", "text": "def btc_profit\n break_even.abs\n end", "title": "" }, { "docid": "036fc26de90ba753fe47299cd4902f48", "score": "0.51003927", "text": "def sort_by_price_usd\n coins.sort_by { |coin| coin.price_usd }.reverse\n end", "title": "" }, { "docid": "6a8d4f3bbcf766aec4fa48cd866064bf", "score": "0.50927496", "text": "def rates_for_usd\n rates_for 'USD'\n end", "title": "" }, { "docid": "f351550ded454944afb8a1193d0a8342", "score": "0.5087684", "text": "def saturated_and_trans_fats\n saturated_fat + trans_fat\n end", "title": "" }, { "docid": "73f080a4439b60873b27b2564850d839", "score": "0.50526166", "text": "def test_returns_10_percent_for_normal_bank_account\n tax_due = bank_account_tax_due(\"normal\", 100.00)\n assert_equal(10.00, tax_due)\n end", "title": "" }, { "docid": "c5b95bfaefdaca507e564754da70112a", "score": "0.50495636", "text": "def currency; end", "title": "" }, { "docid": "c5b95bfaefdaca507e564754da70112a", "score": "0.50495636", "text": "def currency; end", "title": "" }, { "docid": "d46e8888740ccefad5986e82545b585b", "score": "0.50484943", "text": "def balance_to_decimal(balance)\n balance.chars.reverse.map.with_index do |i, index|\n (i == 'T' ? -1 : i.to_i) * (3**index)\n end.sum\nend", "title": "" }, { "docid": "4e35cc7735cb6865e7574cc591d18315", "score": "0.50482476", "text": "def trade_value\n 0.4\n\n end", "title": "" }, { "docid": "9bc5472d3b532f3d21745ee901115507", "score": "0.50283253", "text": "def debt_rate\n ten_year_treasury + bps(200)\n end", "title": "" }, { "docid": "b65e3bdd0a5b93a7c559a09bf1962c60", "score": "0.5021429", "text": "def get_price_of_bitcoin\n data = get_data_from_website(BLOCKCHAIN_WEBSITE)\n price = get_price_in_usd(data)\n # This converts the string to a floating point number\n # Another conversion instruction is to_i (integer)\n price.to_f\nend", "title": "" }, { "docid": "edcfc950ba8e239597145236dbc34032", "score": "0.50148374", "text": "def non_pending_balance_display\n number_to_currency(non_pending_balance)\n end", "title": "" }, { "docid": "4b0d52d465d533bec6069a7b057ad363", "score": "0.500842", "text": "def <=>(other_currency); end", "title": "" }, { "docid": "4bb27459348d7e47da2248d0cb361c02", "score": "0.50015664", "text": "def currency_as_string; end", "title": "" }, { "docid": "b0638d8ac0301513d90c0e97b8f10922", "score": "0.4990611", "text": "def balance(*tags)\n\t # debugger\n\t income_estimation(tags) - rollup\n\tend", "title": "" }, { "docid": "8ae81fcd59c11c6a5f8ac15d22f6fc88", "score": "0.49899948", "text": "def card_fee_str(transaction, bin = nil)\n amount = transaction.amount\n if bin\n data = estimate_fee(amount, bin)\n data[:fee_str]\n else\n low, high = calculate_fee(transaction)\n result = \"$#{format_amount(low)}\"\n result += \"-#{format_amount(high)} (depends on card type)\" if high\n result\n end\n end", "title": "" }, { "docid": "ec473ca1effc24f6e8ae7694c7f8eed8", "score": "0.49852678", "text": "def amount_for_display(amt, opts={})\n if amt.abs < CUTOFF_FOR_BTC and not amt.zero?\n satoshi = amt * BigDecimal.new(\"100000000\")\n if opts[:no_html]\n \"#{satoshi.truncate} Satoshi\"\n else\n \"#{satoshi.truncate} \" +\n link_to(\"Satoshi\",\n \"https://en.bitcoin.it/wiki/Satoshi\",\n :target => '_blank')\n end\n else\n \"#{amt.to_s('F')} BTC\"\n end\n end", "title": "" }, { "docid": "1a2e53f8d281118f2509e81e7ad58b30", "score": "0.4958768", "text": "def tax_money_owed\n if update_taxable <= 43953 && update_taxable >= 0\n update_taxable * 0.15\n elsif update_taxable >= 43954 && update_taxable <=87907\n (43953*0.15) + ((update_taxable-43953) * 0.22)\n elsif update_taxable >= 87908 && update_taxable <=136270\n (43953*0.15)+ (48363*0.22) + (update_taxable * 0.26)\n elsif update_taxable >= 136270\n (43953*0.15)+ (48363*0.22)+ (43954*0.26) + (update_taxable * 0.29)\n else\n update_taxable \n end\n end", "title": "" }, { "docid": "63f57b69e8f0f940313c8a0bca9990ab", "score": "0.49560258", "text": "def balances\n Crypto.available.active.sort_by(&:name).map do |crypto|\n account = accounts.find { |a| a.crypto_id == crypto.id }\n filtered_nodes = nodes.select{ |n| n.crypto_id == crypto.id && ['online', 'new'].include?(n.status) }\n if account.nil?\n {\n btc: 0.0,\n fee: crypto.percentage_conversion_fee,\n has_nodes: false,\n name: crypto.name,\n slug: crypto.slug,\n symbol: crypto.symbol,\n usd: 0.0,\n value: 0.0,\n wallet: nil,\n withdrawable: crypto.withdrawable?\n }\n else\n crypto_pricer = CryptoPricer.new(account.crypto)\n btc = crypto_pricer.to_btc(account.balance, 'sell')\n usd = crypto_pricer.to_usdt(account.balance, 'sell')\n {\n btc: btc,\n fee: crypto.percentage_conversion_fee,\n has_nodes: filtered_nodes.present?,\n name: account.name,\n slug: crypto.slug,\n symbol: account.symbol,\n usd: usd,\n value: account.balance,\n wallet: account.wallet,\n withdrawable: crypto.withdrawable?\n }\n end\n end\n end", "title": "" }, { "docid": "722c403547fcd22bdce53974190bb939", "score": "0.49456993", "text": "def print_result\n @balance.sort.each do |key, value|\n puts \"#{key}: #{value} billcoins\" if value != 0\n end\n end", "title": "" }, { "docid": "10b7e2f79d9ae9503d49a13a7a9714a6", "score": "0.494474", "text": "def transaction_amount(currency_and_amount)\n currency = parse(currency_and_amount).first\n if currency == 'USD'\n amount = parse(currency_and_amount).last.to_f\n else\n amount = currency.to_f unless amount == 0.0\n end\n# self.amount = amount \n end", "title": "" }, { "docid": "cb41daf726daa6971126bbdc6e462a5f", "score": "0.49393556", "text": "def decode_tx_to_btc_tx(tx)\n hash = {\n 'version' => tx['version'],\n 'lock_time' => tx['locktime'],\n 'hex' => tx['hex'],\n 'txid' => tx['txid'],\n 'blockhash' => tx['blockhash'],\n 'confirmations' => tx['confirmations'],\n 'time' => tx['time'],\n 'blocktime' => tx['blocktime'],\n 'in' => tx['vin'].map{|input|\n {'output_index' => input['vout'], 'previous_transaction_hash' => input['txid'], 'coinbase' => input['coinbase'],\n 'scriptSig' => input['scriptSig']['asm'], 'sequence' => input['sequence']}},\n 'out' => tx['vout'].map{|out|\n {'amount' => out['value'], 'scriptPubKey' => out['scriptPubKey']['asm']}\n }\n }\n Bitcoin::Protocol::Tx.from_hash(hash)\n end", "title": "" }, { "docid": "0fdeef60e746dcb5107f20b4dd9ba1b7", "score": "0.4938889", "text": "def processa_bc\n # puts(format(\"%<n>4i ATTESTATIONS INSERIDAS #{BD}.eth2at\", n: apibc.novtx.empty? ? 0 : dml(eth2at_ins)))\n # puts(format(\"%<n>4i PROPOSALS INSERIDAS #{BD}.eth2pr\", n: apibc.novkx.empty? ? 0 : dml(eth2pr_ins)))\n puts(format(\"%<n>4i BALANCES\\tETH2\\t\\tINSERIDOS eth2bh\", n: apibc.nov.empty? ? 0 : dml(eth2bh_ins)))\n end", "title": "" }, { "docid": "0021a4a6fba0b49fdfb83a37f08e6d2f", "score": "0.49318472", "text": "def price_sans_tax\n price_as_price.sans_tax\n end", "title": "" }, { "docid": "45a60ae353031059b7bedcf81a329264", "score": "0.49307364", "text": "def prt_balance\n b = self.balance\n return \"#{'-' if b.cents<0}#{b.currency.symbol}#{b.abs.to_s}\"\n end", "title": "" }, { "docid": "54cc7eced5815c5af9fea5358d303cda", "score": "0.49111873", "text": "def eth_value\n return eth_portfolio * eth_price\n end", "title": "" }, { "docid": "02bbf78cf2b60cb50b592a32d13fd75e", "score": "0.4904471", "text": "def bank_account_tax_due( account_type, account_amount )\nif account_type == \"normal\"\n return account_amount * 0.10\nelse\n return 0\nend\nend", "title": "" }, { "docid": "9ce6bf87d782fd02a32588a60871a43a", "score": "0.48981652", "text": "def calc_daily_credit_debit\n credit = Transaction.sum(:amount, :conditions => \"date IS '#{Date.current}' AND sign IS 'c' \") # change this to transactiontype_id 1\n debit = Transaction.sum(:amount, :conditions => \"date IS '#{Date.current}' AND sign IS 'd' \") # change this to transactiontype_id 4 (2 + 5)\n @dailytotal = credit - debit\n return @dailytotal\n end", "title": "" }, { "docid": "41b07267a4afb8ff68acd5834dbfa4af", "score": "0.489752", "text": "def direct_debit()\n @amount -= 50 if @type == \"personal\"\n @amount -= 100 if @type == \"business\"\n end", "title": "" }, { "docid": "d9cd4bfdbfad28a456606f6d4c7c6a29", "score": "0.4892845", "text": "def to_usd(amt, currency)\n unless currency == \"USD\"\n path = @xml_parser.find_conversion_path(currency, \"USD\")\n amount = @xml_parser.get_rates_from_xml(path[0])\n #pp path # print the path array (for debug if you need it)\n\n #conversion = find_conversion_amt(currency, \"USD\")\n else\n conversion = BigDecimal.new('1') \n end\n amt = BigDecimal(amt)\n amount = amt * conversion\n #puts \"amount is #{amount}\"\n round_banker_style(amount)\n end", "title": "" }, { "docid": "8c065ecb86282f7eaa44a3e4d650e102", "score": "0.48894462", "text": "def reverse transaktion\n decrement!(:balance, transaktion.amount) if transaktion.deposit?\n increment!(:balance, transaktion.amount) if transaktion.withdrawal?\n end", "title": "" }, { "docid": "9f80aa3478bc96770a72e38171097ef7", "score": "0.48862657", "text": "def mark_up()\n return @retail_price-@buying_cost\n end", "title": "" }, { "docid": "3d9247478191d7f5c83e549d00ef9a80", "score": "0.48855403", "text": "def same_currency?(currency1, currency2); end", "title": "" }, { "docid": "88d9370589d2f8659d81644ea96807ad", "score": "0.48820308", "text": "def balance\n txns.inject(Amount::ZERO) { |sum, t| sum + t.amount }\n end", "title": "" }, { "docid": "06d2f9737ac3fc22b58f785f423e043e", "score": "0.4877699", "text": "def >(money_live_convertor) \n arithmetic_op('>',self,money_live_convertor)\n end", "title": "" }, { "docid": "2d8d5d6a1981967fd528d46c8a86a3d8", "score": "0.48697162", "text": "def cashflow_from\n [info_at('Cash Flow'), ebitda].compact\n end", "title": "" }, { "docid": "7938a1786f5cab72bf5b55d94d040e2b", "score": "0.48635748", "text": "def profit\n \tself.bid - self.payout\n end", "title": "" }, { "docid": "54b35d2f4559b006b6e5e940243f9262", "score": "0.485684", "text": "def orders_open\n orders = Bitstamp.orders.all\n orders.sort_by{ |order| order.price }.reverse\n end", "title": "" }, { "docid": "cf7b548add194e04dc42dac7cc8da664", "score": "0.48544806", "text": "def mapping_usd_to_fares(user_id)\n convert_fares_under_budget_back_to_s(user_id).map! { |word| \"USD#{word}\" }\nend", "title": "" }, { "docid": "462d03a552c4c6b6c3e90f08d2155902", "score": "0.48525235", "text": "def utxos(sources)\n txns = []\n sources.each do |hash|\n json = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://chain.api.btc.com/v3/address').append(hash).append('unspent')\n )\n data = json['data']\n raise Sibit::Error, \"The address #{hash} not found\" if data.nil?\n txns = data['list']\n next if txns.nil?\n txns.each do |u|\n outs = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://chain.api.btc.com/v3/tx').append(u['tx_hash']).add(verbose: 3)\n )['data']['outputs']\n outs.each_with_index do |o, i|\n next unless o['addresses'].include?(hash)\n txns << {\n value: o['value'],\n hash: u['tx_hash'],\n index: i,\n confirmations: u['confirmations'],\n script: [o['script_hex']].pack('H*')\n }\n end\n end\n end\n txns\n end", "title": "" }, { "docid": "c62581df3c6d84a52c4217848e499305", "score": "0.48509374", "text": "def trade; end", "title": "" }, { "docid": "c8b5da9ed35717dcce94936d14a99c5e", "score": "0.48487112", "text": "def currency_conversions(price = 0.0)\n convert_dollars = price * EXCHANGE_DOLLARS\n convert_euros = price * EXCHANGE_EUROS\n return convert_dollars, convert_euros\nend", "title": "" }, { "docid": "68ca1ece696aeefc90875b4a3d17dc21", "score": "0.484321", "text": "def balance\n entries = @@ledgers.find(\"owner\" => @sender).first['entries']\n\n sum = 0\n entries.each do |entry|\n value = entry['value'].gsub(\"$\",\"\")\n\n if entry['value'][0] == '('\n value = value[1..-2]\n sum = sum - value.to_i\n else\n sum = sum + value.to_i\n end\n end\n\n @t.say(\"The balance is $#{sum}\")\nend", "title": "" }, { "docid": "0bec5ee013629a6b0fbd477cc34ac61b", "score": "0.48381606", "text": "def currency_list\n %w(USD EUR GBP JPY AUD INR)\n end", "title": "" }, { "docid": "ffc430727598d3ff1d118dfdffa8af80", "score": "0.48379284", "text": "def without_vat_original_currency()\n return invoice_goods_ammout.to_f + shipping.to_f\n end", "title": "" }, { "docid": "6c96175ffd355f949945212655095e50", "score": "0.48368984", "text": "def to_btc(value)\n value.to_f\n end", "title": "" }, { "docid": "c7fa2401f7ca39ac6a4855e041aa8260", "score": "0.48368445", "text": "def currency\n \"USD\"\n end", "title": "" }, { "docid": "895f682fa0021ee713ff66a709580b07", "score": "0.4819494", "text": "def conv_exchange_rate\n currency_exchange.exchange_rate\n end", "title": "" }, { "docid": "a152fa841aea3dfae4f325a2d2684cf9", "score": "0.48192593", "text": "def ot_currency_code\n end", "title": "" }, { "docid": "0d00960442f0f20229c15075cc9de439", "score": "0.48113605", "text": "def print_balances(acc_balances)\n acc_balances.keys.sort.each do |acc_no|\n balance = acc_balances[acc_no]\n puts \"#{acc_no}: #{balance} billcoins\" if balance.positive?\n end\nend", "title": "" }, { "docid": "084f0de6bdfb44183de377318a7cd967", "score": "0.48072577", "text": "def available_currency\n # GROUP THE ORDER BY THE CURRENCY, AND TOTAL THE AMOUNT FOR THAT CURRENCY\n grouped_orders = orders.group_by(&:converted_currency)\n grouped_orders.map{|c| {c[0].denomination => c[1].map(&:purchase_amount).reduce(:+)}}\n end", "title": "" }, { "docid": "a159c1cb6176240981b73080718fa952", "score": "0.48069146", "text": "def rate_key_for(currency_iso_from, currency_iso_to); end", "title": "" }, { "docid": "4fd28ae4130303558f665611a61864e4", "score": "0.48000672", "text": "def unit_price_without_tax\n unit_price - tax_amount\n end", "title": "" }, { "docid": "778ca3b444d0e57018e35306908b3038", "score": "0.47985741", "text": "def transform_us_to_mxn(dollars, current_value)\n dollars * current_value\nend", "title": "" }, { "docid": "a2a939549f802ca7e732f98404b2b404", "score": "0.47946927", "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": "641479bb8cf90dfcef88475e6107be5c", "score": "0.4786897", "text": "def debit_amount\n sum( debits )\n end", "title": "" }, { "docid": "ac265a908f89d2b52bde2344ed38d8e0", "score": "0.4781869", "text": "def second_payment_sum\n total_sum - first_payment_sum\n end", "title": "" }, { "docid": "8fb04176a58ba6b9800cce60957c5492", "score": "0.47759447", "text": "def trade(ticker, day)\n # this day's price\n price = @account.broker.exchange.quote(ticker, day)\n\n# if @last_purchase.key? ticker # If we've purchased this stock before, we continue with Dr. Rushton's trading rule.\n if @account.portfolio[ticker] == 0 # try to buy the given ticker\n last_hold_time = if @last_purchase[ticker][:buy_day] && @last_purchase[ticker][:sell_day]\n @last_purchase[ticker][:buy_day] - @last_purchase[ticker][:sell_day]\n else\n 0\n end\n \n # Wait for a time interval equal to gamma * HT to pass (cool-down period) OR Price < P to buy more\n if(!@last_purchase.key?(ticker) || \n price < @last_purchase[ticker][:price] || \n @last_purchase[ticker][:sell_day] - day >= @gamma * last_hold_time)\n s = @account.buy_amap(ticker, day, @amount_per_company)\n @last_purchase[ticker] = {price: price, buy_day: day}\n puts \"bought #{s} shares of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date}\" if $DEBUG\n end\n else # try to sell our holdings of the given ticker\n # compute t, the return multiplier, given the interval between now and last purchase of the given stock (ticker)\n t = @fn_t.call(@last_purchase[ticker][:buy_day] - day)\n\n # compute alpha, given the value t, to determine the percentage gain multiplier\n alpha = @fn_alpha.call(t)\n\n puts \"t = #{t}\", \"alpha = #{alpha}\" if $DEBUG\n\n puts \"price of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date} is #{price}\" if $DEBUG\n\n if(price > (1.0 + alpha) * @last_purchase[ticker][:price])\n s = @account.sell_all(ticker, day)\n @last_purchase[ticker][:sell_day] = day\n puts \"sold #{s} shares of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date}\" if $DEBUG\n end\n end\n# else # We use SMA to make our initial purchase of each stock\n# # compute average over number of days\n# avg = average_price(ticker, day)\n\n # if price > avg -> price - avg = positive\n # price < avg -> price - avg = negative\n # price = avg -> price - avg = 0\n# @price_relation_to_average[\"#{ticker}#{day}\"] = price - avg\n\n # decide whether the price has just upcrossed or downcrossed the MA line\n# if(price > avg && @price_relation_to_average[\"#{ticker}#{day + 1}\"] < 0) # upcross - BUY as much as possible\n# s = @account.buy_amap(ticker, day, @amount_per_company)\n# @last_purchase[ticker] = {price: price, buy_day: day}\n# puts \"bought #{s} shares of #{ticker} on #{@account.broker.exchange.eod(ticker, day).date}\" if $DEBUG\n# end\n# end\n \n puts \"account: #{@account.to_s(day)}\" if $DEBUG\n end", "title": "" }, { "docid": "71da62cf03ee2a9b7d869b58500286bf", "score": "0.47755837", "text": "def getCashValueOfIndFundInvestment(ind, fund, date)\r\n\r\n\t\t\r\n\r\n\tend", "title": "" }, { "docid": "53c390311b9de8f8a74bb189f4d0e612", "score": "0.47749314", "text": "def bet(amount)\n [:bet, amount]\n end", "title": "" }, { "docid": "c0dc5fe551f2631a260984b035c3da45", "score": "0.4771774", "text": "def currencies_name_and_price\n currencies_price = get_all_price\n currencies = get_data\n both = Hash[currencies.zip currencies_price]\n #\n puts both \nend", "title": "" }, { "docid": "dd0755212a6fe0d32a29bc04f3b4e287", "score": "0.47687626", "text": "def sum_symbol\n sum ? sum.symbol : MoneyRails.default_currency.symbol\n end", "title": "" }, { "docid": "e5de2ae3ed74bc271dc625158345b646", "score": "0.4767054", "text": "def test_PPPPQRUVPQRUVPQRUVSU\n basket = Checkout.new.checkout('PPPPQRUVPQRUVPQRUVSU')\n # PPPPPP QQQ RRR S UUUU VVV\n # 250 + [80 + 150(Free Q?)] + 30 + 120 + 130\n # Q=30\n # R5 pricing: S=20, was 30\n assert_equal 730, basket, '4F, pay for 3F because third free'\n end", "title": "" }, { "docid": "91166f302ba9da20d4715847e2167ab6", "score": "0.47659987", "text": "def net_amount\n ((transaction_value - 0.2) / 1.034).floor_with_two_decimal_places\n end", "title": "" }, { "docid": "29daf91b6b559063210a86dd65c23f2f", "score": "0.47634247", "text": "def pending_balance_display\n number_to_currency(pending_balance)\n end", "title": "" }, { "docid": "e42bc0a1d6baf0cb4e255510eba76c01", "score": "0.47574103", "text": "def had_funds?\n balance_at = self.get_address.balance(self.currency_id, before_time: self.tx_date)\n balance_at >= amount\n end", "title": "" }, { "docid": "2f9425c3d57f9d7d100fd9152960f6a3", "score": "0.47568545", "text": "def btc(lifetime: 30 * 60)\n item = read\n if item['btc'] && item['assigned']\n age = Time.now.to_i - item['assigned']\n return item['btc'] if age < lifetime\n return item['btc'] if item['active'] && item['active'] == 2 && age < lifetime * 10\n end\n found = @aws.query(\n table_name: 'zold-wallets',\n limit: 1,\n index_name: 'queue',\n select: 'ALL_ATTRIBUTES',\n consistent_read: false,\n expression_attribute_values: { ':a' => 1 },\n key_condition_expression: 'active=:a'\n ).items\n if found.empty? || Time.at(found[0]['assigned']) > Time.now - lifetime\n return item['btc'] if item['btc']\n item['btc'] = yield\n else\n expired = found[0]\n prev = item['btc']\n item['btc'] = expired['btc']\n raise \"There is no BTC in the table for @#{expired['login']}, while marked as active\" if item['btc'].nil?\n if prev.nil?\n expired.delete('btc')\n expired['active'] = 0\n else\n expired['btc'] = prev\n end\n @aws.put_item(table_name: 'zold-wallets', item: expired)\n end\n item['assigned'] = Time.now.to_i\n item['active'] = 1\n @aws.put_item(table_name: 'zold-wallets', item: item)\n item['btc']\n end", "title": "" }, { "docid": "eebcac970cd1f20969903f57ba070889", "score": "0.47561586", "text": "def ltc()\n @response = HTTParty.get(\"https://www.btc-e.com/api/2/ltc_usd/ticker\")\n @JSON = JSON.parse(@response)\n @LTC_price = @JSON['ticker']['sell']\n if(@LTC_price.size() > 12)\n else\n CryptoPrices.create! :LTC => @LTC_price\n end\n end", "title": "" }, { "docid": "c75ea8b1b8e9da57b6db79de75d89662", "score": "0.47546858", "text": "def trades(symbol=\"tBTCUSD\", params={})\n check_params(params, %i{limit start end sort})\n get(\"trades/#{symbol}\", params).body\n end", "title": "" }, { "docid": "64c13ac1150ddd008c17147748a6faab", "score": "0.4753571", "text": "def get_btc_profit\n quantity - close_positions.sum(:quantity)\n end", "title": "" }, { "docid": "8e3ea9fded1028b91f3ef5673067af99", "score": "0.47499043", "text": "def get_rate(currency_iso_from, currency_iso_to); end", "title": "" }, { "docid": "c141d3db5590cc37bee1501888018dd3", "score": "0.47466168", "text": "def test_traditional_unit_test\n assert_equal @market.calculate_cost(100.0, 10), 1000.00\n end", "title": "" }, { "docid": "fde1b3d35462c80cf074387638c7b8c8", "score": "0.47428936", "text": "def get_usd_exchange_rate\n Sidekiq.logger.debug \"get_usd_exchange_rate\"\n begin\n today = Time.now.strftime '%d/%m/%Y'\n uri = \"http://www.cbr.ru/scripts/XML_daily.asp?date_req=#{today}\"\n doc = Nokogiri::XML(open(uri))\n text = doc.xpath('//ValCurs/Valute[@ID=\"R01235\"]/Value').text\n return text.gsub(',', '.')\n rescue Exception => excp\n Sidekiq.logger.error \"rate loading error: #{excp}\"\n return \"\"\n end\n end", "title": "" }, { "docid": "164040474ca8799ec29bff6e83682cde", "score": "0.47382736", "text": "def adapt(market_pair, output)\n ticker = Cryptoexchange::Models::Ticker.new\n ticker.base = market_pair.base\n ticker.target = market_pair.target\n ticker.market = Kkcoin::Market::NAME\n ticker.last = NumericHelper.to_d(output[7])\n ticker.bid = NumericHelper.to_d(output[1])\n ticker.ask = NumericHelper.to_d(output[3])\n ticker.high = NumericHelper.to_d(output[9])\n ticker.low = NumericHelper.to_d(output[10])\n ticker.change = NumericHelper.to_d(output[6])\n ticker.volume = NumericHelper.to_d(output[11])\n ticker.timestamp = nil\n ticker.payload = output\n ticker\n end", "title": "" }, { "docid": "be09b16f1922cc9cb42714b891c2bc2e", "score": "0.47345886", "text": "def weighIntrade()\n\n end", "title": "" }, { "docid": "afebcc4e7fe839bf5ead16d964afe3f4", "score": "0.47332504", "text": "def stock_market; end", "title": "" }, { "docid": "cf990f16b9ff65f5f714d4aa4ad9e497", "score": "0.4732382", "text": "def currency_unit\n @currency_unit\n end", "title": "" }, { "docid": "7fe6100c4a64eb44e05326e1a3123795", "score": "0.47297466", "text": "def get_Currency()\n \t return @outputs[\"Currency\"]\n \tend", "title": "" } ]
2bbb3a7b59d0fa4c48e5b5871ef4f363
api_hostname is for ingress controller
[ { "docid": "84d3b982cb0b92354665cdd54e1ca593", "score": "0.7957872", "text": "def api_hostname; application.api_hostname end", "title": "" } ]
[ { "docid": "4634ecf2f3aa9030c6d80db9748dd9e8", "score": "0.72369194", "text": "def host\n api['host']\n end", "title": "" }, { "docid": "b34d14530308a3a72e912a6b00242b05", "score": "0.7017119", "text": "def v3_hostname\n unless @server.starts_with?(\"platform-api-\")\n if @server.starts_with?(\"platform-\")\n @server.gsub(\"platform-\", \"platform-api-\")\n else\n \"platform-api-#{@server}\"\n end\n else\n @server\n end\n end", "title": "" }, { "docid": "a0c2bca5d3ade6e2d4adbc1d85fde0e7", "score": "0.68548477", "text": "def get_hostname token\n return \"#{token['subdomain']}.sf-api.com\"\nend", "title": "" }, { "docid": "adda3442f840e80a7042361f4e03b5bc", "score": "0.6717289", "text": "def api_host=(value)\n @api_host = value\n end", "title": "" }, { "docid": "db470866fdc3fc2085b2898b5e5657e5", "score": "0.66710705", "text": "def api_endpoint\n \"#{name.split('::').last.downcase}s\"\n end", "title": "" }, { "docid": "3cfca91ce9a87821048231f7b0d9f41e", "score": "0.652553", "text": "def api_host\n 'https://api.envato.com'\n end", "title": "" }, { "docid": "0642012edb5e91b7738e6706dae8909e", "score": "0.6398408", "text": "def api_host=(host)\n @api_host = URI(host).host || host\n end", "title": "" }, { "docid": "7614764540f10fe4c4749889a902df10", "score": "0.6388484", "text": "def host\n resource[:host]\n end", "title": "" }, { "docid": "0858afc3c046a7f823d17143e59a9f3d", "score": "0.6347015", "text": "def api_host\n \"#{subdomain}.brickftp.com\"\n end", "title": "" }, { "docid": "c1206312da970ddc9e1253b2779a1c3d", "score": "0.6258324", "text": "def api_url(request, resource_name)\n if request.port == 80\n port = \"\"\n else\n port = \":#{request.port}\"\n end\n \"#{request.scheme}://#{request.host}#{port}#{resource_name}\"\nend", "title": "" }, { "docid": "df90318146c29cd28aa97b4a1832db2c", "score": "0.6250229", "text": "def lanai_hostname()\n ENV['LANAI_HOSTNAME'] || 'app.net'\nend", "title": "" }, { "docid": "34b9556506d9d785dd313badb2e418a8", "score": "0.62472147", "text": "def hostname; host_name; end", "title": "" }, { "docid": "7571ee436d07a92e313d171ff10f9426", "score": "0.62436736", "text": "def casein_config_hostname\n 'http://' + Rails.application.config.hostname\n end", "title": "" }, { "docid": "29167cabde8076b88c94c12bef7caf4f", "score": "0.62262577", "text": "def api_url\n \"https://#{$host}:#{$port}/services/\"\n end", "title": "" }, { "docid": "9bd030cdea68227b8628c7bcaca6ebd2", "score": "0.62129545", "text": "def api_name; end", "title": "" }, { "docid": "b33d4fc96d088765aef019f658cdca96", "score": "0.62020874", "text": "def application_hostname\n context.target.application.endpoint.cnfs_sub\n end", "title": "" }, { "docid": "24d1f91fc35fb901e39f018583a2baf5", "score": "0.6174356", "text": "def api_prefix\n @prefix\n end", "title": "" }, { "docid": "5236577a15301ff202148ac0d537f9ca", "score": "0.6152565", "text": "def host\n \"http://api.lvh.me:3000\"\n end", "title": "" }, { "docid": "1556f03e0ce19cca6787600db1ab39bb", "score": "0.6144272", "text": "def config_hostname\n if config[:hostname].nil?\n if config[:label]\n config[:hostname] = \"#{config[:label]}\"\n else\n config[:hostname] = \"#{instance.name}\"\n end\n end\n end", "title": "" }, { "docid": "51c43e95050074e774e977e34dd47319", "score": "0.6142711", "text": "def host=(value)\n api['host'] = value\n end", "title": "" }, { "docid": "fba6053a9485aec2d00991374d7750c0", "score": "0.61413294", "text": "def desired_hostname\n 'www.website.com'\n end", "title": "" }, { "docid": "fba6053a9485aec2d00991374d7750c0", "score": "0.61413294", "text": "def desired_hostname\n 'www.website.com'\n end", "title": "" }, { "docid": "194d339bc4ccd1152e8bfc7852eac910", "score": "0.61407316", "text": "def this_public_hostname\n return zz[:public_hostname]\n end", "title": "" }, { "docid": "175c34924fda2295896a43faeced4367", "score": "0.611656", "text": "def hostname\n @config['Hostname']\n end", "title": "" }, { "docid": "6b024a688f1f79c6334cc72f3f18c1a5", "score": "0.61112875", "text": "def api_path\n \"#{self.host}#{self.path_prefix}\"\n end", "title": "" }, { "docid": "426ebbd92383a86ff20fa969b4a91de6", "score": "0.6069668", "text": "def host_name\n self['HOSTNAME']\n end", "title": "" }, { "docid": "41303d1d072b9f06253adb1d38716fd6", "score": "0.60638535", "text": "def hostname; end", "title": "" }, { "docid": "41303d1d072b9f06253adb1d38716fd6", "score": "0.60638535", "text": "def hostname; end", "title": "" }, { "docid": "41303d1d072b9f06253adb1d38716fd6", "score": "0.60638535", "text": "def hostname; end", "title": "" }, { "docid": "41303d1d072b9f06253adb1d38716fd6", "score": "0.60638535", "text": "def hostname; end", "title": "" }, { "docid": "41303d1d072b9f06253adb1d38716fd6", "score": "0.60638535", "text": "def hostname; end", "title": "" }, { "docid": "41303d1d072b9f06253adb1d38716fd6", "score": "0.60638535", "text": "def hostname; end", "title": "" }, { "docid": "41303d1d072b9f06253adb1d38716fd6", "score": "0.60638535", "text": "def hostname; end", "title": "" }, { "docid": "41303d1d072b9f06253adb1d38716fd6", "score": "0.60638535", "text": "def hostname; end", "title": "" }, { "docid": "41303d1d072b9f06253adb1d38716fd6", "score": "0.60638535", "text": "def hostname; end", "title": "" }, { "docid": "ede780e1ec6c3a105557377933542755", "score": "0.60415477", "text": "def registry_hostname\n \"#{ip}:5000\"\nend", "title": "" }, { "docid": "9213fed79c1ed31c8b43c47d8814b5ba", "score": "0.601801", "text": "def hostname; self[:hostname] end", "title": "" }, { "docid": "92c793023dac89deefbeebfca79d5ef6", "score": "0.60123396", "text": "def host(hostname)\n hostname === req.host\n end", "title": "" }, { "docid": "e74119539c465fd3ed91338536211fdd", "score": "0.59864515", "text": "def get_public_engage_hostname_cors\n return node[:public_engage_hostname_cors] if node[:public_engage_hostname_cors]\n\n get_public_engage_hostname\n end", "title": "" }, { "docid": "7787dd5dac036eeb0e13529f3f4c4f35", "score": "0.59858006", "text": "def api_prefix\n client.api_prefix\n end", "title": "" }, { "docid": "5456f28dc02842519ef1f04d7f359710", "score": "0.59840846", "text": "def api_endpoint\n ENV['API_ENDPOINT']\n end", "title": "" }, { "docid": "273aa59b9d8ce40b6af65a227b48a85b", "score": "0.59833527", "text": "def api_name\n self.to_s.split(\"::\").last.downcase\n end", "title": "" }, { "docid": "862a395c804217614090d656b419c66f", "score": "0.59829146", "text": "def public_hostname\n @instance['public_hostname']\n end", "title": "" }, { "docid": "eb9a678bca0c9200a97ccddb8f117ffa", "score": "0.5975427", "text": "def public_hostname\n self.cloud? ? self.automatic[:cloud][:public_hostname] : self.automatic[:fqdn]\n end", "title": "" }, { "docid": "83659e37a96862794bf1c72607c1c5d6", "score": "0.59710187", "text": "def ssl_api_domain; (Rails.env == 'production') ? api_domain.sub('http', 'https'): api_domain; end", "title": "" }, { "docid": "9113f776830050e3a464a2270bce12c3", "score": "0.5969163", "text": "def host_name\n \"#{self.host.name}\"\n end", "title": "" }, { "docid": "cb3dc7712f49ed20230379ae1f1bc6cc", "score": "0.59644675", "text": "def abs_host\n subdomain = ENV['ABS_SUBDOMAIN'] || 'abs-prod'\n \"#{subdomain}.k8s.infracore.puppet.net\"\n end", "title": "" }, { "docid": "3d1e4b10065bde2c625aac962b7f85ea", "score": "0.59550667", "text": "def host\n @host ||= 'api.postmarkapp.com'\n end", "title": "" }, { "docid": "999b1e33535316507a2cc9fed8302cfb", "score": "0.5941696", "text": "def get_nsca_hostname\n case node['mconf']['instance_type']\n when \"bigbluebutton\"\n node['bbb']['server_domain']\n when \"nagios\"\n \"localhost\"\n else\n node['ipaddress']\n end\nend", "title": "" }, { "docid": "9299b3061840045f9eb3df027fe19634", "score": "0.5931213", "text": "def endpoint\n \"http#{('s' if self.ssl)}://#{self.host}:#{self.port}/api/\"\n end", "title": "" }, { "docid": "2ca98b6be918283c92868b88c78f80c1", "score": "0.5916645", "text": "def hostname\n @hostname\n end", "title": "" }, { "docid": "ced275f646cc393a6ba505afbe134a85", "score": "0.59153926", "text": "def host; @client.host; end", "title": "" }, { "docid": "ced275f646cc393a6ba505afbe134a85", "score": "0.59153926", "text": "def host; @client.host; end", "title": "" }, { "docid": "4ce7d20669fa5e46ef7a8f10f2a86669", "score": "0.5905803", "text": "def host_name\n @host_name\n end", "title": "" }, { "docid": "4ce7d20669fa5e46ef7a8f10f2a86669", "score": "0.5905803", "text": "def host_name\n @host_name\n end", "title": "" }, { "docid": "11c24f98d403cdfc174f0d70ecc6ece2", "score": "0.59055734", "text": "def host_name\n env['HOSTNAME']\n end", "title": "" }, { "docid": "e4a039685e046adc798cfe02baa0407d", "score": "0.587571", "text": "def endpoint\n \"#{@domain}/api/#{@api_version}\"\n end", "title": "" }, { "docid": "b327554036b489b47fd8f180d0b869d4", "score": "0.5874291", "text": "def api\n return @api if @api\n api_hash = sensu.find { |endpoint| endpoint['host'] == host }\n @api = api_hash ? api_hash : {}\n end", "title": "" }, { "docid": "4bf6a770da0333ea4cf1e1dc5e8ac5ae", "score": "0.58729196", "text": "def requested_http_host\n @client_headers['Host']\n end", "title": "" }, { "docid": "59d9be6f9bc7480d94d00343c2d86416", "score": "0.5869437", "text": "def api_endpoint\n @api_endpoint ||= 'https://api.emarsys.net/api/v2'\n end", "title": "" }, { "docid": "c4c83d6a34eee3d0547fd62a4a11643c", "score": "0.586659", "text": "def hostname\n super\n end", "title": "" }, { "docid": "c4c83d6a34eee3d0547fd62a4a11643c", "score": "0.586659", "text": "def hostname\n super\n end", "title": "" }, { "docid": "c4c83d6a34eee3d0547fd62a4a11643c", "score": "0.586659", "text": "def hostname\n super\n end", "title": "" }, { "docid": "718a7b49fe3e921baad56ea647023046", "score": "0.5861147", "text": "def host\n request.env['HTTP_HOST']\nend", "title": "" }, { "docid": "d265204bf60e17668c063a38a0d8a727", "score": "0.5859998", "text": "def host\n @host ||= payload.host || request.ip\n end", "title": "" }, { "docid": "aff32734266dae1186771bd90a7be264", "score": "0.5858359", "text": "def api_endpoint\n @config.fetch(:url)\n end", "title": "" }, { "docid": "df048f23909b4294cae26f338e1a6e43", "score": "0.5847459", "text": "def host\n logger.debug request.env[\"HTTP_X_FORWARDED_HOST\"] || request.env[\"HTTP_HOST\"]\n render :json => {:host_uri => request.env[\"HTTP_X_FORWARDED_HOST\"] || request.env[\"HTTP_HOST\"]}\n end", "title": "" }, { "docid": "068c2586cdf4d14e593269c9fed94280", "score": "0.58444476", "text": "def api_host\n @mutex.synchronize { @api_host.clone }\n end", "title": "" }, { "docid": "e204321050052d68024cb5af5d6549ea", "score": "0.5842392", "text": "def app_host\n @data['app_host']\n end", "title": "" }, { "docid": "86d0d3cb70846b1f3ee14a335b32213d", "score": "0.5841285", "text": "def api_url\n @api_url ||= Addressable::URI.new(\n :scheme => scheme, :host => host, :port => port,\n :path => path_with_base(\"/_api\", resource_path)\n ).normalize.to_s\n end", "title": "" }, { "docid": "7fa51420842007fa20f5dee388c29d7a", "score": "0.58403236", "text": "def hostname\n name\n end", "title": "" }, { "docid": "9f6cc5a733219915239f98f40dc7935b", "score": "0.5831114", "text": "def _host; end", "title": "" }, { "docid": "ff6f8d1c5fc0e23708d5a1196778ce44", "score": "0.583092", "text": "def current_hostname\n return config.hostname! if config.hostname?\n hostname_parts = request.host.split '.'\n hostname_parts.shift if I18n.available_locales.include?( hostname_parts.first.to_sym )\n hostname_parts.join \".\"\nend", "title": "" }, { "docid": "74e3561bfa5eb82903ae24ea4b61c82f", "score": "0.5813924", "text": "def host; @options[:hostname] end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "4a5a6e95b2c222884610a08c943308d6", "score": "0.5810037", "text": "def host; end", "title": "" }, { "docid": "b09e57d580575af8cc6ff528aca7ca12", "score": "0.5800245", "text": "def api_authenticate_url\n \"#{self.name.split(\"::\").last.downcase}\"\n end", "title": "" }, { "docid": "9a889fcd442f5b17218d11b2525bece4", "score": "0.5795664", "text": "def full_host; end", "title": "" }, { "docid": "d2bbdcdfbf8682980f6894f3888e8821", "score": "0.5792324", "text": "def server_name; end", "title": "" }, { "docid": "d2bbdcdfbf8682980f6894f3888e8821", "score": "0.5792324", "text": "def server_name; end", "title": "" }, { "docid": "ff7e341373f132b157f051564b807646", "score": "0.5790654", "text": "def homepage\n SeoAssistant::Api.config.APP_HOST\nend", "title": "" }, { "docid": "a73c3025f165fce1fc722f644f3780ac", "score": "0.5790509", "text": "def resolve_hostname; end", "title": "" }, { "docid": "ee9c9c2c2e0a9ecda26e8a5a395013d6", "score": "0.57837677", "text": "def host_names; end", "title": "" }, { "docid": "f36100a43311ca61407c5b5fe7617efb", "score": "0.5781474", "text": "def hostname(subdomain)\n \"#{subdomain}.coveryourbasics.dev\"\n end", "title": "" }, { "docid": "fb90c52f6d430ed43733f8c0efb945ee", "score": "0.5779212", "text": "def base_url\n Rails.env.development? ? \"#{@host}:8080/api/\" : \"#{@host}/api/\"\n end", "title": "" }, { "docid": "17549e81a0ff3ceca3c94cb06f7d57b7", "score": "0.5777883", "text": "def clean_host_name(environment)\n if environment.instances.first && environment.instances.first.public_hostname\n environment.instances.first.public_hostname.gsub!(/_/,'-')\n end\n end", "title": "" } ]
a177ef766ef3ca99d2ccb781ee69d95f
Test 09 & 10
[ { "docid": "389059ddd523cc1724a7469861f768a1", "score": "0.0", "text": "def to_s\n str = \"| \"\n current_item = @first_item\n until current_item.nil?\n str << current_item.payload\n punctuation = current_item.last? ? \" \" : \", \"\n str << punctuation\n current_item = current_item.next_item\n end\n str << \"|\"\n str\n end", "title": "" } ]
[ { "docid": "78947974f0b66760c445fa9c50eec611", "score": "0.62204415", "text": "def test_010\n require 't010'\n test(X10, 123, '010 test: X10')\n test(X20, 678, '010 test: X20')\n end", "title": "" }, { "docid": "f308ee36b33172b534fc355fc2913314", "score": "0.61265564", "text": "def between_1_and_10 num \n if 1 <= num && num <= 10\n 'Valid'\n else\n 'Invalid'\n end\nend", "title": "" }, { "docid": "63e6c757772bf107e6e6067428601641", "score": "0.6050873", "text": "def digit!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 20)\n\n \n # - - - - main rule block - - - -\n # at line 363:17: '0' .. '9'\n match_range(?0, ?9)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 20)\n\n end", "title": "" }, { "docid": "de93027a8d03b4876c5c6ababf8074ce", "score": "0.60478723", "text": "def day_less_than_10(date_number)\n if date_number == 1\n unusual_day_1(date_number)\n elsif date_number == 2\n unusual_day_2(date_number)\n elsif date_number == 3\n unusual_day_3(date_number)\n elsif date_number.between?(4, 9) && has_text?(\"2#{date_number}\", count: 2)\n calendar_date(date_number, 1)\n else\n first_day(date_number).native.style('font-weight').should == 'bold'\n end\n end", "title": "" }, { "docid": "bfc0ae00463214f569bf98b5b12976da", "score": "0.6009918", "text": "def es_valido(mes,dia)\r\n if(mes==\"01\"||mes==\"03\"||mes==\"05\"||mes==\"07\"||mes==\"08\"||mes==\"10\"||mes==\"12\")\r\n return (1..31)===dia.to_i\r\n else\r\n if(mes==\"04\"||mes==\"06\"||mes==\"09\"||mes==\"11\")\r\n return (1..30)===dia.to_i\r\n else\r\n return (1..28)===dia.to_i\r\n end\r\n end\r\nend", "title": "" }, { "docid": "bfc0ae00463214f569bf98b5b12976da", "score": "0.6009918", "text": "def es_valido(mes,dia)\r\n if(mes==\"01\"||mes==\"03\"||mes==\"05\"||mes==\"07\"||mes==\"08\"||mes==\"10\"||mes==\"12\")\r\n return (1..31)===dia.to_i\r\n else\r\n if(mes==\"04\"||mes==\"06\"||mes==\"09\"||mes==\"11\")\r\n return (1..30)===dia.to_i\r\n else\r\n return (1..28)===dia.to_i\r\n end\r\n end\r\nend", "title": "" }, { "docid": "bfc0ae00463214f569bf98b5b12976da", "score": "0.6009918", "text": "def es_valido(mes,dia)\r\n if(mes==\"01\"||mes==\"03\"||mes==\"05\"||mes==\"07\"||mes==\"08\"||mes==\"10\"||mes==\"12\")\r\n return (1..31)===dia.to_i\r\n else\r\n if(mes==\"04\"||mes==\"06\"||mes==\"09\"||mes==\"11\")\r\n return (1..30)===dia.to_i\r\n else\r\n return (1..28)===dia.to_i\r\n end\r\n end\r\nend", "title": "" }, { "docid": "441333daac61f8a824dc913f4d6e91df", "score": "0.59912556", "text": "def test_two_different_number_start\n result = look_and_see(23)\n assert_equal(\"1213\",result)\n end", "title": "" }, { "docid": "a1924199658ebced0f06a7e16719f601", "score": "0.59602755", "text": "def test_for_date_too_early\n output = `./cal.rb 01 1799`\n expected = <<EOS\nDate not in acceptable format/range\nEOS\n assert_equal expected, output\n end", "title": "" }, { "docid": "2ef8e4c2fc799d2aa1e781c918f45052", "score": "0.58642375", "text": "def digit!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n \n # - - - - main rule block - - - -\n # at line 117:18: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n end", "title": "" }, { "docid": "35888f7b9d3640db96a30bfd03f4c4f1", "score": "0.58457136", "text": "def digit!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 41 )\n\n \n # - - - - main rule block - - - -\n # at line 69:17: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 41 )\n\n end", "title": "" }, { "docid": "6c109333d3859de7fb5fa4fee7dd26af", "score": "0.58165276", "text": "def test_day_num?\n assert_equal(true, day_num?(1))\n assert_equal(true, day_num?(2))\n\n assert_equal(false, day_num?(8))\n assert_equal(false, day_num?('stuff'))\n end", "title": "" }, { "docid": "d2a6e39f6850398c45e3cdd6c01194f1", "score": "0.5795852", "text": "def test_08_month_layout\n cal = Month.new(9,2012)\n layout = []\n layout << \" September 2012 \"\n layout << \"Su Mo Tu We Th Fr Sa\"\n layout << \" 1\"\n layout << \" 2 3 4 5 6 7 8\"\n layout << \" 9 10 11 12 13 14 15\"\n layout << \"16 17 18 19 20 21 22\"\n layout << \"23 24 25 26 27 28 29\"\n layout << \"30\"\n assert_equal(layout,cal.print_month)\n end", "title": "" }, { "docid": "0e6c1787b58f5a8828ebaae7735b4565", "score": "0.5753039", "text": "def test_day_num?\r\n assert_equal(true, day_num_elem?(1))\r\n assert_equal(false, day_num_elem?(9))\r\n\r\n assert_equal(false, day_num_elem?('str'))\r\n end", "title": "" }, { "docid": "f2cc8efe31daffdf093616ceb237d5b3", "score": "0.5737119", "text": "def test_should_convert_month_to_fixnum\n assert_equal Month.june.to_i, 6\n end", "title": "" }, { "docid": "38335abb458467fe9f6363cb431cb690", "score": "0.5721288", "text": "def is_between_1_10?(num)\n (1..10).include?(num)\nend", "title": "" }, { "docid": "1708b77dd68cca50c7d4cd26433604f9", "score": "0.5709003", "text": "def test_should_divide_month_and_fixnum\n assert_equal (Month.december / 2), 6\n end", "title": "" }, { "docid": "71efd268c13bcd4aedbea71d4a4e5426", "score": "0.56891435", "text": "def testInA_range\n \n NUMBERS.each do |roman, number|\n assert_equal(roman, Rome.new(number).roman_converter, \"invalid value\")\n end\n end", "title": "" }, { "docid": "83e1ff0a3e03b2134fc6df8acf65f82f", "score": "0.56828827", "text": "def test_should_modulo_month_and_fixnum\n assert_equal (Month.june % 7), 6\n end", "title": "" }, { "docid": "e6fdb9cefdecb77cf453d5f888e5463a", "score": "0.5659713", "text": "def checkdigit_10(stem)\n int_index = 0\n int_sum = 0\n stem.each_char do |digit|\n int_sum += digit.to_i * (10 - int_index)\n int_index += 1\n end\n mod = (11 - (int_sum % 11)) % 11\n mod == 10 ? 'X' : mod.to_s\nend", "title": "" }, { "docid": "8a8984dc482fb890e62074ee4b2113a4", "score": "0.5650095", "text": "def test_008_radix()\n 36.times do |radix|\n next if (radix < 2)\n\n %w(r R).each do |rsig|\n expected = ':' + 100.to_s(radix) + ':'\n expected.upcase! if (rsig.eql?('R'))\n format = \":!@#{radix.to_s}#{rsig}:\"\n result = FTO.new(format, 100).format\n assert_equal(expected,\n result,\n \"Testing #{format}\")\n\n expected = ':' + 100.to_s(radix) + ':'\n expected.upcase! if (rsig.eql?('R'))\n format = \":!@0#{radix.to_s}#{rsig}:\"\n result = FTO.new(format, 100).format\n assert_equal(expected,\n result,\n \"Testing #{format}\")\n\n expected = 100.to_s(radix)\n expected = ':' + ('0' * (10 - expected.length)) + expected + ':'\n expected.upcase! if (rsig.eql?('R'))\n format = \":!10@0#{radix}#{rsig}:\"\n result = FTO.new(format, 100).format\n assert_equal(expected,\n result,\n \"Testing #{format}\")\n\n #\n # Now the fun ones.. specify the radix in the argument list.\n #\n expected = ':' + 100.to_s(radix) + ':'\n expected.upcase! if (rsig.eql?('R'))\n format = \":!@##{rsig}:\"\n result = FTO.new(format, radix, 100).format\n assert_equal(expected,\n result,\n \"Testing #{format}\")\n\n expected = ':' + 100.to_s(radix) + ':'\n expected.upcase! if (rsig.eql?('R'))\n format = \":!@0##{rsig}:\"\n result = FTO.new(format, radix, 100).format\n assert_equal(expected,\n result,\n \"Testing #{format}\")\n\n expected = 100.to_s(radix)\n expected = ':' + ('0' * (10 - expected.length)) + expected + ':'\n expected.upcase! if (rsig.eql?('R'))\n format = \":!10@0##{rsig}:\"\n result = FTO.new(format, radix, 100).format\n assert_equal(expected,\n result,\n \"Testing #{format}\")\n end\n end\n end", "title": "" }, { "docid": "b6069b5eeb07fd51eb0fcbc3af098cd2", "score": "0.56468624", "text": "def test_minutes_past\n assert_equal \"ten minutes past nine\", Conversion.time2text(9, 10)\n end", "title": "" }, { "docid": "b0989e6ec7c28db133b6b8e0c6888c48", "score": "0.5637939", "text": "def test_returns_false_when_non_digits\n\t\t\t# if any character is zero\n\t\t\trefute(CpfCnpj._mod11_check_digit(VALID_CPF_WITH_ZERO.sub('0', 'a'), MAX_MULTI_CPF))\n\t\t\t# the last character is not used to calculate, just to verify, so it could be vulnerable\n\t\t\t# even if the others are checked for range\n\t\t\trefute(CpfCnpj._mod11_check_digit(VALID_CPF_END_ZERO.sub(/0\\z/, 'a'), MAX_MULTI_CPF))\n\t\tend", "title": "" }, { "docid": "03e212e506b5ac1552517369bfbd96f2", "score": "0.5637584", "text": "def test_valid_ordinal__england\n valid_ordinal_p = :_valid_ordinal?\n skip unless Date.respond_to?(valid_ordinal_p, true)\n (1..355).each do |d|\n assert_not_nil(Date.__send__(valid_ordinal_p, 1752,d,Date::ENGLAND))\n end\n (356..366).each do |d|\n assert_nil(Date.__send__(valid_ordinal_p, 1752,d,Date::ENGLAND))\n end\n end", "title": "" }, { "docid": "8b9509c1cd8d7323a9736336c645796d", "score": "0.5633317", "text": "def checkdigit_10(isbn10 = self.isbn10)\n digits = isbn10[0..8].each_char.map(&:to_i)\n checkdigit = 0\n (1..9).each do |i|\n checkdigit += digits[i-1] * i\n end\n check = checkdigit % 11\n check = 'X' if check == 10\n check.to_s\n end", "title": "" }, { "docid": "ed962bc6a4b853d8d868f465b81e4261", "score": "0.56315976", "text": "def test_21_february_2240_std_feb_leap_year\n output = `cal.rb 2 2240`\n expected = <<EOS\nFebruary 2440\nSun Mon Tue Wed Thu Fri Sat\n 1 2 3 4\n5 6 7 8 9 10 11\n12 13 14 15 16 17 18\n19 20 21 22 23 24 25\n26 27 28 29\nEOS\n assert_equal expected, output\n end", "title": "" }, { "docid": "01b3ef6bc0f5490f05e419c4a2bb9c39", "score": "0.56279343", "text": "def test_date\n # test with 1 and 2 digits for month/day, 2 digit year\n assert_equal(0, RegExpProcessor.is_date(\"01-01-14\"))\n assert_equal(0, RegExpProcessor.is_date(\"1-01-14\"))\n assert_equal(0, RegExpProcessor.is_date(\"1-1-14\"))\n # test with 1 and 2 digits for month/day, 4 digit year\n assert_equal(0, RegExpProcessor.is_date(\"01-01-2014\"))\n assert_equal(0, RegExpProcessor.is_date(\"1-01-2014\"))\n assert_equal(0, RegExpProcessor.is_date(\"1-1-2014\"))\n # test with too many digits for month/day, 2 digit year\n assert_equal(nil, RegExpProcessor.is_date(\"1-123-2014\"))\n assert_equal(nil, RegExpProcessor.is_date(\"123-12-2014\"))\n # test with day > 31\n assert_equal(nil, RegExpProcessor.is_date(\"1-32-14\"))\n # test with month > 12\n assert_equal(nil, RegExpProcessor.is_date(\"13-10-14\"))\n assert_equal(nil, RegExpProcessor.is_date(\"21-10-14\"))\n # test day boundary\n assert_equal(0, RegExpProcessor.is_date(\"1-31-14\"))\n # test month boundary\n assert_equal(0, RegExpProcessor.is_date(\"12-31-2014\"))\n # test invalid year\n assert_equal(nil, RegExpProcessor.is_date(\"1-10-0145\"))\n assert_equal(nil, RegExpProcessor.is_date(\"1-10-3145\"))\n assert_equal(nil, RegExpProcessor.is_date(\"1-10-20145\"))\n # test a few with /\n assert_equal(0, RegExpProcessor.is_date(\"1/31/14\"))\n assert_equal(0, RegExpProcessor.is_date(\"12/31/2014\"))\n assert_equal(0, RegExpProcessor.is_date(\"01/01/14\"))\n assert_equal(nil, RegExpProcessor.is_date(\"13/10/14\"))\n assert_equal(nil, RegExpProcessor.is_date(\"1/32/14\")) \n end", "title": "" }, { "docid": "0abac1c6e2e4ea8336258d70788eeb02", "score": "0.56013525", "text": "def test_days_until_christmas\n\n end", "title": "" }, { "docid": "d57720585e3ed4ffe3aa4b3b52e78035", "score": "0.5600457", "text": "def test_check_digit\n assert_equal(30_686_957, @tester.rut(min_rut: 30_686_957, fixed: true))\n assert_equal('4', @tester.dv)\n end", "title": "" }, { "docid": "2d488623205e66649c29e0aaad61fc0b", "score": "0.55938256", "text": "def test_valid_ordinal__italy\n valid_ordinal_p = :_valid_ordinal?\n skip unless Date.respond_to?(valid_ordinal_p, true)\n (1..355).each do |d|\n assert_not_nil(Date.__send__(valid_ordinal_p, 1582,d,Date::ITALY))\n end\n (356..365).each do |d|\n assert_nil(Date.__send__(valid_ordinal_p, 1582,d,Date::ITALY))\n end\n end", "title": "" }, { "docid": "b2c788fb950a56acbeff53f6b8a987d4", "score": "0.5563313", "text": "def test_month_of_january\n skip\n output = `./cal.rb 01 2011`\n expected = <<EOS\n January 2011\nSu Mo Tu We Th Fr Sa\n 1\n 2 3 4 5 6 7 8\n 9 10 11 12 13 14 15\n16 17 18 19 20 21 22\n23 24 25 26 27 28 29\n30 31\n\nEOS\n assert_equal expected, output\n end", "title": "" }, { "docid": "18fd68626bf0deee59b9322b69fa8a8c", "score": "0.5557531", "text": "def test_date_to_early_to_input\n skip\n output = `./cal.rb 12 1799`\n expected = <<EOS\nDate not in acceptable format/range.\nEOS\n assert_equal expected, output\n end", "title": "" }, { "docid": "4201c17de28a1e5a1f5164f71691ff17", "score": "0.555332", "text": "def test_resta_densa_dispersa\n\t\tassert_equal(@h12.m, @h9-@h10, \"Resultado Incorrecto\" )\n\tend", "title": "" }, { "docid": "36a8d2d81200a23f9a34b09a871ba32e", "score": "0.55458677", "text": "def test_february_28_days\n skip\n output = `./cal.rb 02 1805`\n expected = <<EOS\n February 1805\nSu Mo Tu We Th Fr Sa\n 1 2\n 3 4 5 6 7 8 9\n10 11 12 13 14 15 16\n17 18 19 20 21 22 23\n24 25 26 27 28\n\nEOS\n assert_equal expected, output\n end", "title": "" }, { "docid": "d7ab873d2804e713d4cc84cc29a738f3", "score": "0.5525012", "text": "def test_to_day_num\r\n assert_equal(4, to_day_num(4))\r\n assert_equal(5, to_day_num(:FR))\r\n\r\n assert_raise(RT) { to_day_num('SO') }\r\n end", "title": "" }, { "docid": "47d8ac85dc09e2896a381c2ef4d8ac63", "score": "0.551597", "text": "def BEG09=(arg)", "title": "" }, { "docid": "d2d4d6582dd0a0a659fb988b12536c61", "score": "0.55148166", "text": "def test_half_past\n assert_equal \"half past thirteen\", Conversion.time2text(13, 30)\n end", "title": "" }, { "docid": "46a64dae40edaac7f25f60d397d8a9a1", "score": "0.55090415", "text": "def test_day_result_both_nonzero\n assert_equal \"\\tFound 1 ruby and 2 fake rubies in Pitt\", @p.text_day_result(1, 2, \"Pitt\")\n end", "title": "" }, { "docid": "6c52679ff5dbbf16b1b2d385a79d3a28", "score": "0.54962623", "text": "def test_invalid_ten_digit_isbn_return_false\r\n\t\tisbn = \"0471958699\"\r\n\t\tassert_equal(false, valid_isbn(isbn))\r\n\tend", "title": "" }, { "docid": "18fe24ee787cdbbdb484883c2e096ec3", "score": "0.54869235", "text": "def test_isbn10_valids\n assert_equal(\"Valid\", isbn10(\"0-330-28498-3\"))\n assert_equal(\"Valid\", isbn10(\"0-321-14653-0\"))\n assert_equal(\"Valid\", isbn10(\"2-226-05257-7\"))\n assert_equal(\"Valid\", isbn10(\"3-7965-1900-8\"))\n assert_equal(\"Valid\", isbn10(\"5-85270-001-0\"))\n assert_equal(\"Valid\", isbn10(\"5-85270-001-0\"))\n assert_equal(\"Valid\", isbn10(\"605-384-057-2\"))\n assert_equal(\"Valid\", isbn10(\"609-01-1248-8\"))\n assert_equal(\"Valid\", isbn10(\"877195869x\"))\n assert_equal(\"Valid\", isbn10(\"877195869X\"))\n end", "title": "" }, { "docid": "ace0ae283cba23f9eb5ad72083fea1e4", "score": "0.5485274", "text": "def isValid(num)\n if num >= 1 && num <= 10\n puts \"Valid\"\n else\n puts \"Invalid\"\n end\nend", "title": "" }, { "docid": "e9011e5b69cbcf113c9b365a500d4a52", "score": "0.5482769", "text": "def test_11_month_greater_than_12_returns_error\n cal=Calendar.new(13, 1967)\n assert_equal(\"my_cal: Entered #{month} is not a month number (1..12).\", cal.month_number_error)\n end", "title": "" }, { "docid": "cbbc97c504065866fdc4c7eb4e856937", "score": "0.54733545", "text": "def test_is_day_of_month\n assert @controller.is_day_of_month(2007, 7, 22)\n assert !@controller.is_day_of_month(2007, 7, 32)\n end", "title": "" }, { "docid": "982362a772975fd797ed8228c30d1730", "score": "0.5472751", "text": "def range_print_10\n\n (0..9).each do |num|\n puts num\n end\n\nend", "title": "" }, { "docid": "482687c3f636252463eaf98705748abc", "score": "0.54713106", "text": "def ten(digit)\n case digit\n when 0 then ''\n when 1 then 'zehn'\n else unit(digit) + 'zig'\n end\n end", "title": "" }, { "docid": "a1567abb7d905adedf76e1a46a474e06", "score": "0.5463922", "text": "def test_should_exponent_month_and_fixnum\n assert_equal (Month.may ** 2), 25\n end", "title": "" }, { "docid": "c774985e4a44c59809bcc746e2be30ec", "score": "0.5463117", "text": "def test_date_to_late_to_input\n skip\n output = `./cal.rb 01 3001`\n expected = <<EOS\nDate not in acceptable format/range.\nEOS\n assert_equal expected, output\n end", "title": "" }, { "docid": "48bdb653006f62332e14ac8041e04694", "score": "0.54584944", "text": "def is_valid num\n if num <= 10 && num >= 1\n 'Valid'\n else\n 'Invalid'\n end\nend", "title": "" }, { "docid": "00e07c88a0cd6d630f9e8e399fc9e43a", "score": "0.5457616", "text": "def test_number_between_0_and_100\n nn = NumberName.new(0, \"ala ma kota\" )\n assert nn.number >= 0 || nn.number <= 100\n\n nn.number = 99\n assert nn.number >= 0 || nn.number <= 100\n end", "title": "" }, { "docid": "5729ff9e89e11864dd9610ea2110eb73", "score": "0.54444057", "text": "def test_true_if_x_musts_be_at_end\r\n\t\tbooknum10 = '123456789x'\r\n\t\tassert_equal(true, check_for_x(booknum10)) #call it anything but write this function!!\r\n\tend", "title": "" }, { "docid": "a1452e0d263b60d8d1324c174ac056e3", "score": "0.54393286", "text": "def range_print_10\n\t(0..9).each do |x|\n\t\tputs x\n\tend\nend", "title": "" }, { "docid": "d48e63041d7d5760378b19a113e4a2ad", "score": "0.543587", "text": "def test_day?\r\n assert_equal(true, day?(:MO))\r\n assert_equal(false, day?(:LA))\r\n assert_equal(true, day?(1))\r\n assert_equal(false, day?(9))\r\n assert_equal(false, day?('str'))\r\n end", "title": "" }, { "docid": "c5d33ec5c5b126618094f37b3f21bb0d", "score": "0.54291123", "text": "def isSpecialCase(n)\n n = n % 100\n return (11 <= n && n <= 13) \nend", "title": "" }, { "docid": "dbaa63dca5f1132654e1c1a89c51745a", "score": "0.5423953", "text": "def test_day_form_ten\n p = Prospector.new(1, 1, 1)\n assert_equal 'days', p.day_form(10)\n end", "title": "" }, { "docid": "41b9ab2c4e1da6778e596d6cd8897a52", "score": "0.54165685", "text": "def control_F(dia,mes,anio)\r\n valido=false\r\n if ((01..31)===dia.to_i)\r\n if((01..12)===mes.to_i)&&es_valido(mes,dia)||(mes==\"02\"&&dia==\"29\")&& es_bisiesto(anio.to_i)\r\n if ((1..9999)===anio.to_i)\r\n valido= true\r\n else\r\n valido= false\r\n end\r\n else\r\n valido= false\r\n end\r\n else\r\n valido= false\r\n end\r\n return valido\r\nend", "title": "" }, { "docid": "58292c0933a026c19ba90347989047af", "score": "0.5414675", "text": "def teen?(number)\n (11..19).include?(number)\nend", "title": "" }, { "docid": "85b4a1042f947e2972e2610676643cde", "score": "0.5414142", "text": "def valid_digit?(digit)\n digit == digit.to_i.to_s\nend", "title": "" }, { "docid": "c857caa4e46eda405507e64cd5772efc", "score": "0.54139197", "text": "def usable_date?(str, min, max)\n date = str.to_i\n return true if date == 9999\n return false unless date >= min\n return false unless date <= max\n true\n end", "title": "" }, { "docid": "b4586f72a1bc49c6f5bab27f3ca2070f", "score": "0.54133594", "text": "def range_print_10\n (0..9).each {|number| puts number}\nend", "title": "" }, { "docid": "8c7fd8b5a93c53712527e53c5eb0ed61", "score": "0.5410838", "text": "def text_should_subtract_month_and_fixnum\n assert_equal (Month.june - 4), 2\n end", "title": "" }, { "docid": "d86280ce27450ec77fe6d8fe395008dc", "score": "0.5409755", "text": "def control_F(dia,mes,anio)\r\n valdio=false\r\n if ((01..31)===dia.to_i)\r\n if((01..12)===mes.to_i)&&(es_valido(mes,dia)||(mes==\"02\"&&dia==\"29\")&& es_bisiesto(anio.to_i))\r\n if ((1900..2019)===anio.to_i)\r\n valido= true\r\n else\r\n valido= false\r\n end\r\n else\r\n valido= false\r\n end\r\n else\r\n valido= false\r\n end\r\n return valido\r\nend", "title": "" }, { "docid": "c0fe066c361817d50a7f41b1cb9c501b", "score": "0.5407003", "text": "def test_minutes_to\n assert_equal \"ten minutes to eleven\", Conversion.time2text(10,50)\n end", "title": "" }, { "docid": "17a0cd4b972867fa52b496ed10388098", "score": "0.5406986", "text": "def test_and_pass_1919fdjksl3_return_false\n\t\tassert_equal(false, all_numeric_digits?(\"1919fdjksl3\"))\n\tend", "title": "" }, { "docid": "aa33fced30f46df47c1b51c8d108c991", "score": "0.54066116", "text": "def verification_digit\r\n difference_value = odd_positions_sum - even_positions_sum\r\n result = difference_value.negative? ? -difference_value : difference_value # ignore - sign\r\n result > 9 ? (result % 10) : result # calulate reminder if difference is greater than 9\r\n end", "title": "" }, { "docid": "e851a8aca42293480fd00d1bcee9bb40", "score": "0.5401906", "text": "def test_isbn_string_length_other_than_10_or_13_true\n\t\tassert_equal(true, valid_isbn?(\"9780470059029\"))\n\t\tassert_equal(true, valid_isbn?(\"0471958697\"))\n\tend", "title": "" }, { "docid": "d326d2e7476f95e2d64f4f1e23f09ca3", "score": "0.54008776", "text": "def test_to_day_num\n assert_equal(1, to_day_num(1))\n assert_equal(7, to_day_num(:SO))\n\n assert_raise(RT) { to_day_num('stuff') }\n end", "title": "" }, { "docid": "8048a61c9484be0cd6f60de1a778b4dd", "score": "0.5399793", "text": "def test_begin\n assert_equal(1, Range.new(1, 10).begin)\n assert_equal(\"a\", Range.new(\"a\", \"z\").begin)\n assert_equal(1, Range.new(1, 10, true).begin)\n assert_equal(\"a\", Range.new(\"a\", \"z\", true).begin)\n end", "title": "" }, { "docid": "fe4136c695a357600800a43c35e6a356", "score": "0.5399709", "text": "def test_two_the_same_numbers\n result = look_and_see(44)\n assert_equal(\"24\",result)\n end", "title": "" }, { "docid": "e99fcbb6ca013e37ca523c9887960590", "score": "0.5396415", "text": "def test_several_dates_1\n \tassert_equal(1, Zeller.calc(12, 2013))\n end", "title": "" }, { "docid": "cc55bed2cc6d2e870ec2b549aaf887c3", "score": "0.53962326", "text": "def test_day_num_succ\r\n assert_equal(2, day_num_succ(1))\r\n assert_equal(1, day_num_succ(7))\r\n\r\n assert_raise(RT) { day_num_succ('str') }\r\n\r\n assert_equal(7, day_num_succ(1, 6))\r\n\r\n assert_raise(RT) { day_num_succ(1, 'str') }\r\n end", "title": "" }, { "docid": "4ba8d84c58e0129793325516e45847fc", "score": "0.5387506", "text": "def num_checker(num)\n if num >= 1 && num <=10\n print \"valid\"\n else\n print \"invalid\"\n end\nend", "title": "" }, { "docid": "4c63151dae2f874c096c697a60d1e033", "score": "0.53804415", "text": "def test_regular_leap_years\n output = `./cal.rb 02 2012`\n expected = <<EOS\n February 2012\nSu Mo Tu We Th Fr Sa\n 1 2 3 4\n 5 6 7 8 9 10 11\n12 13 14 15 16 17 18\n19 20 21 22 23 24 25\n26 27 28 29\n\nEOS\n assert_equal expected, output\n end", "title": "" }, { "docid": "ed97df8fe959023fa5dba612e999511c", "score": "0.5376968", "text": "def test_month_of_year_end_of_month_day_start_2am\n assert_result :month_of_year, 12, \"2013-01-01 01:59:59\", false, day_start: 2\n end", "title": "" }, { "docid": "84cb2c0e4e3c83892a5b13ed7eb001d8", "score": "0.53627634", "text": "def test_05_leap_1999\n refute CalCalc.leap?(1999)\n end", "title": "" }, { "docid": "9f512c38e1fc77298814a9a2af666a3c", "score": "0.53587615", "text": "def range_print_10\n (0..9).each do |n|\n puts n\n end\nend", "title": "" }, { "docid": "9f512c38e1fc77298814a9a2af666a3c", "score": "0.53587615", "text": "def range_print_10\n (0..9).each do |n|\n puts n\n end\nend", "title": "" }, { "docid": "494e7676485ec0a893b1d425bfb1aa44", "score": "0.53581125", "text": "def test_date_too_early\n skip\n output = `./cal.rb 12 1799`\n expected = <<EOS\nI'd Cal for you, but only after 1800\n\nEOS\n assert_equal expected, output\n end", "title": "" }, { "docid": "48005d5636620d350a3f9e9faae3c0b0", "score": "0.53476316", "text": "def test_negative_integers\n (-1000..-1).each do |digit|\n assert_tokenises_as digit.to_s, IntegerToken.new(digit)\n end\n assert_tokenises_as '-1 ', IntegerToken.new(-1)\n assert_tokenises_as ' -1', IntegerToken.new(-1)\n end", "title": "" }, { "docid": "670746a033dfe29c2ef9bcb2e2d4a167", "score": "0.5345242", "text": "def modulo11_2to9(valor_inicial=\"\")\n return nil if (valor_inicial !~ /\\S/)\n\n multiplicadores = [2,3,4,5,6,7,8,9]\n total = 0\n multiplicador_posicao = 0\n\n for caracter in valor_inicial.split(//).reverse!\n multiplicador_posicao = 0 if (multiplicador_posicao == 8)\n total += (caracter.to_i * multiplicadores[multiplicador_posicao])\n multiplicador_posicao += 1\n end\n\n valor = (11 - (total % 11))\n return [0,10,11].include?(valor) ? 1 : valor\n end", "title": "" }, { "docid": "cbb630e86216d9925d91d75440b17c18", "score": "0.53435946", "text": "def itsOKquestion(test)\nif(test.to_i<4||test.to_i>30)\n\treturn false\nend\nreturn true\nend", "title": "" }, { "docid": "1a230f678966b8853d3e097c337c4096", "score": "0.5342442", "text": "def validate(n)\n arr = n.to_s.chars.reverse.map.with_index{|i, index| (index % 2 == 1) ? i.to_i*2 : i.to_i}.reverse\n arr.map{|i| i > 9 ? i-=9 : i }.reduce(0,&:+) % 10 == 0\nend", "title": "" }, { "docid": "97a641467ec9501e384054e7ad258496", "score": "0.5336912", "text": "def test_day_increment\n\tend", "title": "" }, { "docid": "5788c0c5da5d800130a4ca861c2266d1", "score": "0.5334929", "text": "def test_day_num_pred\r\n assert_equal(7, day_num_pred(1))\r\n assert_equal(6, day_num_pred(7))\r\n\r\n assert_raise(RT) { day_num_pred('str') }\r\n\r\n assert_equal(2, day_num_pred(1, 6))\r\n\r\n assert_raise(RT) { day_num_pred(1, 'str') }\r\n end", "title": "" }, { "docid": "3d40a8782418912c25b22a5238521605", "score": "0.5333189", "text": "def time_of_the_day(x)\nif x >= 7 && x < 11\n print \"Good Morning\"\nelsif x >= 11 && x < 17\n print \"Good Afternoon\"\nelsif x >= 17 && x < 22\n print \"Good Evening\"\nelse\n print \"welcome to chilis\"\nend\nend", "title": "" }, { "docid": "68f961004eb0d0206b97203d0642ff44", "score": "0.5327125", "text": "def time_str(num)\n num > 9 ? \"#{num}\" : \"0#{num}\"\nend", "title": "" }, { "docid": "c761e8f18bb1a7f952eb7f77d498d477", "score": "0.53229237", "text": "def test_day_result_fake_rubies_nonzero\n assert_equal \"\\tFound 3 fake rubies in Hershey\", @p.text_day_result(0, 3, \"Hershey\")\n end", "title": "" }, { "docid": "6150f2f50ebd666fdd2fa9cd0e481b58", "score": "0.53178734", "text": "def digit?(char)\n ('0'..'9') === char\n end", "title": "" }, { "docid": "d28edc885232c3e578f71b7865585152", "score": "0.53093094", "text": "def test_int_valid\n assert @rpn.int?('1')\n assert @rpn.int?('10')\n assert @rpn.int?('100')\n end", "title": "" }, { "docid": "f5d2ab75f5724833faf7169135da48a9", "score": "0.53075707", "text": "def module11_2to9(value = \"\")\n return nil unless value && (value !~ /[^0-9]+/)\n\n multipliers = [2,3,4,5,6,7,8,9]\n total = 0\n position_multiplier = 0\n\n for caracter in value.split(//).reverse!\n position_multiplier = 0 if (position_multiplier == 8)\n total += (caracter.to_i * multipliers[position_multiplier])\n position_multiplier += 1\n end\n\n valor = (11 - (total % 11))\n return [0,10,11].include?(valor) ? 1 : valor\n end", "title": "" }, { "docid": "e2f4800d38ae9fcfd17578b95568f353", "score": "0.5298027", "text": "def divisible_by_10?(num)\n if num % 10 == 0 then true else false end\n end", "title": "" }, { "docid": "18432f747f610dd3d7b08eccfca60ad0", "score": "0.5292089", "text": "def test_25\n expected = [\"\\\"ABC\\\" \", \"\\\"ABC\\\" \", \"\\\"ABC\\\" \", \"\\\"ABC\\\" \", \"\\\"ABC\\\" \",\n \"\\\"ABC\\\" \", \"\\\"ABC\\\" \", \"\\\"ABC\\\" \", \"\\\"ABC\\\" \", \"\\\"ABC\\\" \",\n \"\\\"ABC\\\" \", \"\\\"ABC\\\" \", \"\\\"ABC\\\" \", \"\\\"ABC\\\" \", \"\\\"ABC\\\" \"]\n -4.upto(10){ |i| assert_equal(expected[i + 4], \"~v,,2S\".format(i, \"ABC\")) }\n end", "title": "" }, { "docid": "e2d130679d7277d1dcc4873f1c655d89", "score": "0.52822477", "text": "def test_querter_to\n assert_equal \"quarter to nine\", Conversion.time2text(8, 45)\n end", "title": "" }, { "docid": "04814bab810f7ad246a2bb0756e0c4c3", "score": "0.52761465", "text": "def control_F(dia,mes,anio)\r\n valdio=false\r\n if ((01..31)===dia.to_i)\r\n if((01..12)===mes.to_i)&&(es_valido(mes,dia)||(mes==\"02\"&&dia==\"29\")&& es_bisiesto(anio.to_i))\r\n if ((1000..9999)===anio.to_i)\r\n valido= true\r\n else\r\n valido= false\r\n end\r\n else\r\n valido= false\r\n end\r\n else\r\n valido= false\r\n end\r\n return valido\r\nend", "title": "" }, { "docid": "efdc8835a1f067990df0440c9a693e7e", "score": "0.5275056", "text": "def super_digit(number)\n number = super_helper(number) until number < 10\n number\nend", "title": "" }, { "docid": "77504a1df4e6f802e93bb9df889b9846", "score": "0.5274246", "text": "def val_inval(numm)\n if numm >=1 && numm <= 10\n 'Valid'\n else\n 'Invalid'\n end\nend", "title": "" }, { "docid": "9f79ed25a624ee6169deb458ad7701f5", "score": "0.5273453", "text": "def test_h2j_9\r\n @hb = Hebruby::HebrewDate.new(Date.new(2008, 1, 7))\r\n assert_equal(10, @hb.month, \"Wrong month.\")\r\n assert_equal(\"Tevet\", @hb.month_name, \"Wrong month name.\")\r\n assert_equal(5768, @hb.year, \"Wrong year.\")\r\n assert_equal(29, @hb.day, \"Wrong day.\")\r\n assert_equal(\"כ\\\"ט\", @hb.heb_day_name, \"Wrong heb day.\")\r\n end", "title": "" }, { "docid": "0b186a64c3958205a7be51b87c0e06b2", "score": "0.527073", "text": "def test_credit_card_no\n assert_match /\\d{4}\\-\\d{4}\\-\\d{4}\\-\\d{4}/, @main.credit_card_no\n end", "title": "" }, { "docid": "6f6bf57fccc49876b3b8aa9622fa2202", "score": "0.5270126", "text": "def test_invalid_months_dd_mm\n output = `./cheers Abby 25/08`\n expected = <<EOS\nGive me an... A\nGive me a... B\nGive me a... B\nGive me a... Y\nAbby’s just GRAND!\n\nI couldn't understand that. Could you give that to me in mm/dd format?\nEOS\n assert_equal expected, output\n end", "title": "" }, { "docid": "c6eb87cfcb15ca8c34a0596ccc053afb", "score": "0.5266839", "text": "def test_non_negative_integers\n (0..1000).each do |digit|\n assert_tokenises_as digit.to_s, IntegerToken.new(digit)\n end\n assert_tokenises_as '0 ', IntegerToken.new(0)\n assert_tokenises_as ' 0', IntegerToken.new(0)\n end", "title": "" }, { "docid": "5cc321d5ceacd52e4accbb3dddd3c83e", "score": "0.52652866", "text": "def test_25\n expected = [\"ABC \", \"ABC \", \"ABC \", \"ABC \", \"ABC \", \"ABC \", \"ABC \",\n \"ABC \", \"ABC \", \"ABC \", \"ABC \", \"ABC \", \"ABC \", \"ABC \",\n \"ABC \"]\n -4.upto(10){ |i| assert_equal(expected[i + 4], \"~v,,2A\".format(i, \"ABC\")) }\n end", "title": "" }, { "docid": "81699fbb3e4fb24448049d69a3443fc2", "score": "0.5264516", "text": "def day_greater_than_23(date_number)\n if date_number >= 23 && has_text?(date_number, count: 2)\n calendar_date(date_number, 1)\n else\n first_day(date_number).native.style('font-weight').should eq('bold')\n end\n end", "title": "" } ]
01e60e7c52e9b52c0611bde50c8859d3
String representation of this Link in dotfile syntax.
[ { "docid": "6f8a626b706a7d2922d1fdbdc22bc231", "score": "0.0", "text": "def to_dot(*attrs)\n s = \" \\\"#{nid(@src)}\\\" #{edgesymbol} \\\"#{nid(@dest)}\\\" \"\n s << \"[#{@attrs.join(',')}]\" unless @attrs.empty?\n s << \"[#{attrs.join(',')}]\" unless attrs.empty?\n if block_given?\n wl = yield(@weight)\n s << '[' << case wl\n when String, Symbol\n \"label=\\\"#{wl.tr('\"',\"'\")}\\\"\"\n when Enumerable\n wl.join(', ')\n end << ']'\n else\n s << weightlabel(@weight) if linkcount\n end\n s << \";\\n\"\n s\n end", "title": "" } ]
[ { "docid": "3633bb74b430cc397ee0e7998eab8fbf", "score": "0.714472", "text": "def to_s\n \"#{self.name} => #{self.link}\"\n end", "title": "" }, { "docid": "788cd51805d996705deacf14c3828141", "score": "0.6956311", "text": "def to_s\n \"#<\" + self.class.name + \": \" + href + \">\"\n end", "title": "" }, { "docid": "6184e28b2a40bd19638a31693273b70b", "score": "0.6519261", "text": "def to_s\n label.to_s + ':' + rule.embed\n end", "title": "" }, { "docid": "26a01a0c49ed058c9a726ca5cef24d28", "score": "0.6425776", "text": "def to_s\n \"#<\" + self.class.name + \": \" + (href || \"ANONYMOUS\") + \">\"\n end", "title": "" }, { "docid": "42feb031542346b22419249c19df2f1f", "score": "0.63954026", "text": "def to_s\n label_name.to_s + ':' + rule.embed\n end", "title": "" }, { "docid": "3b8663e3bd94712fefc919e00e2f5331", "score": "0.6375541", "text": "def inspect\n\t\tcontents = ''\n\t\tif self.parsed?\n\t\t\tcontents = %{\"%s\"/%d linkages/%d nulls} % [\n\t\t\t\tself.to_s,\n\t\t\t\tself.num_linkages_found,\n\t\t\t\tself.null_count,\n\t\t\t]\n\t\telse\n\t\t\tcontents = \"(unparsed)\"\n\t\tend\n\n\t\treturn \"#<%s:0x%x %s>\" % [\n\t\t\tself.class.name,\n\t\t\tself.object_id / 2,\n\t\t\tcontents,\n\t\t]\n\tend", "title": "" }, { "docid": "7966dbacebfe10fab60f6901ed38e317", "score": "0.63636136", "text": "def to_s\n \"#<#{ self.class.name } name=#{ name.inspect } path=#{ path.to_s }>\"\n end", "title": "" }, { "docid": "62bdf09f38890832adeb6084d20ba09d", "score": "0.62487006", "text": "def to_s\n \"#<syntax:#{ @name }>\"\n end", "title": "" }, { "docid": "36bab9a44d2cacdabf122a03501f4d4a", "score": "0.6237133", "text": "def inspect\n links = map(&:inspect).join(\",\")\n \"#<#{self.class}[#{links}]>\"\n end", "title": "" }, { "docid": "a761933e9ef35c5873bbf39a8a4031ea", "score": "0.62190217", "text": "def to_s\n \"#{self.class}#url: #{url}\"\n end", "title": "" }, { "docid": "219655c25ba1ec179e7ff515a791ed68", "score": "0.6218744", "text": "def to_s\n stringified = \"#{@name}[\"\n @children.each { |kid| stringified += \"#{kid[:link]} -> #{kid[:residue]}\" }\n stringified += \"]\\n\" \n end", "title": "" }, { "docid": "dfc935619720daeb7b5d1566d9bdb025", "score": "0.6216629", "text": "def to_s\n \"##{target}\"\n end", "title": "" }, { "docid": "746b2eb73826dc1ba3017ad412d7f1b0", "score": "0.6195732", "text": "def inspect\n return sprintf(\n \"#<%s:%#0x URI:%s>\",\n self.class.to_s, self.object_id, self.uri.to_s\n )\n end", "title": "" }, { "docid": "bdbea45859ce0d4086187a6375362f42", "score": "0.61934525", "text": "def inspect\n\t\t%{#<%s:0x%x: sublinkage %d: [%d links]>} % [\n\t\t\tself.class.name,\n\t\t\tself.object_id / 2,\n\t\t\tself.current_sublinkage,\n\t\t\tself.num_links\n\t\t]\n\tend", "title": "" }, { "docid": "5899dbc288d4d50b10404b12fd212fee", "score": "0.6101799", "text": "def to_s\n self.name.split('::').last\n end", "title": "" }, { "docid": "ed56745a3119e86a75e10630e2b921e7", "score": "0.6083377", "text": "def to_s\n self.ref\n end", "title": "" }, { "docid": "7c1846a613d547310a101769fb82ab99", "score": "0.6071749", "text": "def to_s\n\t\turl.to_s\n\tend", "title": "" }, { "docid": "a145204f58da1d524202d3dcdc43992c", "score": "0.6032036", "text": "def inspect\n\t\treturn \"#<%s:0x%x (%s): %s>\" % [\n\t\t\tself.class.name,\n\t\t\tself.object_id * 2,\n\t\t\tself.loaded? ?\n\t\t\t self.extensions.map( &:name ).join( ', ' ) :\n\t\t\t 'not yet loaded',\n\t\t\tself.dn\n\t\t]\n\tend", "title": "" }, { "docid": "a93a85a25d37a651b0000a6362afb62e", "score": "0.6027342", "text": "def describe(conj = \"\\n\")\n parts = [ ]\n\n self.attrs.each do |attr|\n if (attr[:title].downcase == 'link')\n if (attr[:value][0] == '/')\n uri = URI.parse(self.source.attrs['url'])\n parts.push(\"#{attr[:title]}: #{uri.scheme}://#{uri.host}#{attr[:value]}\")\n else\n parts.push(\"#{attr[:title]}: #{attr[:value]}\")\n end\n else\n parts.push(\"#{attr[:title]}: #{attr[:value]}\")\n end\n end\n\n return parts.join(conj)\n end", "title": "" }, { "docid": "970fe441966c9ad35ad9fc684cfa9951", "score": "0.60222316", "text": "def to_s\n #\"\\#<#{self.class}-#{@name} - #{@top_dir}>\"\n \"\\#<#{self.class}-#{@name}>\"\n end", "title": "" }, { "docid": "45f971a8f0633bf50fa7b983852537c5", "score": "0.6019699", "text": "def to_s\n self.uri.to_s\n end", "title": "" }, { "docid": "d94535cabedf9aa3e3863b5675669ff1", "score": "0.5994783", "text": "def to_s\n\t\t\t\"<Bibmix::Reference(#{@title})>\"\n\t\tend", "title": "" }, { "docid": "0b4aa0b52f7d80454107bc87b651fbc8", "score": "0.5993558", "text": "def dot\n RGL::DOT::Graph.new('elements' => dot_edges).to_s\n end", "title": "" }, { "docid": "00887ad5169962069fd7c8ea509f4ad4", "score": "0.59896666", "text": "def to_s\n @uri.to_s\n end", "title": "" }, { "docid": "00887ad5169962069fd7c8ea509f4ad4", "score": "0.59896666", "text": "def to_s\n @uri.to_s\n end", "title": "" }, { "docid": "e848849a0c2671946b595e6a34ad9f89", "score": "0.59780896", "text": "def inspect #:nodoc:\n \"#<%s:0x%s '%s'>\" % [self.class, object_id, path]\n end", "title": "" }, { "docid": "22e7812eacb97d41b5bf0597623b7361", "score": "0.59698045", "text": "def inspect\n\t\treturn \"#<%s:0x%0x %s @ %s entry=%p>\" % [\n\t\t\tself.class.name,\n\t\t\tself.object_id * 2,\n\t\t\tself.dn,\n\t\t\tself.directory,\n\t\t\t@entry,\n\t\t ]\n\tend", "title": "" }, { "docid": "2fb59ae498352630af83465dedfb9a12", "score": "0.59617686", "text": "def to_s\n \"#{@aggregate_type} reference: #{@reference_source_position} explicitly refers to aggregate '#{@subpath}' (#{descrip})\"\n end", "title": "" }, { "docid": "ad8ede7bf59d96d4fc00a82a646abbf7", "score": "0.5956734", "text": "def to_s\n psar_file_and_symbol\n end", "title": "" }, { "docid": "0a57c014f795e32780ad2c62d864f8b9", "score": "0.59553236", "text": "def inspect\n return sprintf(\n \"#<%s:%#0x REF:%s>\",\n self.class.to_s, self.object_id, self.ref\n )\n end", "title": "" }, { "docid": "75c468ae7aac18e1f6817fa278aa2fc3", "score": "0.5953757", "text": "def to_s\n self.inspect\n end", "title": "" }, { "docid": "22868017df4bebb2371312cc4c788d61", "score": "0.5950952", "text": "def to_s\r\n if self.prefix\r\n \"#{self.prefix}:#{self.href}\"\r\n else\r\n self.href\r\n end\r\n end", "title": "" }, { "docid": "80e7cd613fc39ff2bad3fc5128643ccf", "score": "0.59505033", "text": "def to_s\n str = @type.to_s.upcase\n if @uri and not @uri.empty?\n str << \"; URI: #{@uri}\"\n end\n str << \"; line #{@line}\"\n if @message and not @message.empty?\n str << \": #{@message}\"\n end\n return str\n end", "title": "" }, { "docid": "41993088b84f7b4b56543fede1dfaf36", "score": "0.5950037", "text": "def to_s\n return '#<' + self.class.to_s + \":\" + self.name + '>'\n end", "title": "" }, { "docid": "1ed95c55690028f99738cbdfca0f60f6", "score": "0.59436834", "text": "def to_s\n\t\tparts = [ self.oid ]\n\n\t\tparts << \"NAME %s\" % Treequel::Schema.qdescrs( self.names ) unless self.names.empty?\n\n\t\tparts << \"DESC '%s'\" % [ self.desc ] if self.desc\n\t\tparts << \"OBSOLETE\" if self.obsolete?\n\t\tparts << \"APPLIES %s\" % [ Treequel::Schema.oids(self.attr_oids) ]\n\t\tparts << self.extensions.strip unless self.extensions.empty?\n\n\t\treturn \"( %s )\" % [ parts.join(' ') ]\n\tend", "title": "" }, { "docid": "76509805c21cfac079bfc3165bbc3e10", "score": "0.594139", "text": "def to_s\n \"#{path} | #{native_revision_identifier}\"\n end", "title": "" }, { "docid": "f4ea66bb891a11f17520285a3f423ec7", "score": "0.5924106", "text": "def to_s\n\t\tres = \"\\nname: \" + name.to_s + \"\\nid: \" + id.to_s + \"\\nservice: \" + service.to_s + \"\\ntitle: \" + title.to_s + \"\\nthumbnail: \" + thumbnail.to_s + \"\\nhref: \" + href.to_s\n\t\tres\n\tend", "title": "" }, { "docid": "0e399de021211bb4f9a3b16267cf8b1c", "score": "0.59240484", "text": "def to_s\n uri.to_s\n end", "title": "" }, { "docid": "5b85c96e760fa1bd733f5b6ec6ce312f", "score": "0.59193546", "text": "def to_s\n \"#{prefix}#{head}\"\n end", "title": "" }, { "docid": "64d2313157916bcf41098f17a76b5afe", "score": "0.59160054", "text": "def to_s\n @path\n end", "title": "" }, { "docid": "cf2fdcd688c7fcda8a7aa4bcdc8e75a0", "score": "0.5911341", "text": "def inspect\n sprintf(\"#<%s:%#0x(%s)>\", self.class.name, __id__, url.to_s)\n end", "title": "" }, { "docid": "cf2fdcd688c7fcda8a7aa4bcdc8e75a0", "score": "0.5911341", "text": "def inspect\n sprintf(\"#<%s:%#0x(%s)>\", self.class.name, __id__, url.to_s)\n end", "title": "" }, { "docid": "731d1d59ffa45c60112c27e9f4512dbc", "score": "0.59095037", "text": "def to_s\n logical_path.to_s\n end", "title": "" }, { "docid": "36b324bf10e813e7b86e43cc351617c7", "score": "0.5907891", "text": "def to_s\n @node.to_s\n end", "title": "" }, { "docid": "823e1d4e9318c5a7856790ea6f0d31fd", "score": "0.59046906", "text": "def to_s\n\t\t@node_string\n\tend", "title": "" }, { "docid": "6cb810a8ea314a36581ee7a791e2a907", "score": "0.59032184", "text": "def to_s\n @path\n end", "title": "" }, { "docid": "9a19529558c492a496952cfe4bd588f4", "score": "0.5887533", "text": "def to_s\n return @string if @string\n result = @type + \" \" + to_sWithAliasesIndexes( @join_sources )\n result += @exporter.separator\n result += \"ON \" + @join_on.val.to_s if @join_on\n @string = result\n end", "title": "" }, { "docid": "4857c253d8f9f408e70c5f19be8289e2", "score": "0.5882388", "text": "def to_s\n \"by tag name: #{@by_tag_name}, by CIDR: #{@by_cidr}\"\n end", "title": "" }, { "docid": "ccb227319f87c34a5d5badd68ea58ad4", "score": "0.5874701", "text": "def to_s\n @path\n end", "title": "" }, { "docid": "017a64bfb367e00271f493fdbde92a43", "score": "0.58733124", "text": "def inspect\n\t\treturn \"#<%p:#%x %s: %s%s>\" % [\n\t\t\tself.class,\n\t\t\tself.object_id * 2,\n\t\t\tself.path,\n\t\t\tself.status_description,\n\t\t\tself.source ? \" via copy/move from #{self.source}\" : '',\n\t\t]\n\tend", "title": "" }, { "docid": "a682eea0519180c924093477625afbff", "score": "0.5869422", "text": "def to_s\n 'rule: ' + @symbol.to_s\n end", "title": "" }, { "docid": "86129319a2a6447f6fe874d37b39c363", "score": "0.5859436", "text": "def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end", "title": "" }, { "docid": "fc8ed03c9f6597ec94c33fea1e622870", "score": "0.585688", "text": "def to_s\n return \"#{self.name}\"\n end", "title": "" }, { "docid": "934275705b2d46290ae6cdd15df2b7d2", "score": "0.5854292", "text": "def inspect\n sprintf(\"#<%s:%#0x URI:%s>\", URI.to_s, self.object_id, self.to_s)\n end", "title": "" }, { "docid": "eb274e2ea4bfba7a1a071feff0db9cbc", "score": "0.5851519", "text": "def link_text\n name\n end", "title": "" }, { "docid": "da4d9d0ba09bcd1cd7c2bfe2468c227f", "score": "0.5847245", "text": "def to_s\n '!' + rule.embed\n end", "title": "" }, { "docid": "da4d9d0ba09bcd1cd7c2bfe2468c227f", "score": "0.5847245", "text": "def to_s\n '!' + rule.embed\n end", "title": "" }, { "docid": "984628811d09d8bf73d17697feafe899", "score": "0.5836069", "text": "def to_s\r\n \"#@parent/#@name/\".squeeze('/')\r\n end", "title": "" }, { "docid": "26e60e90716bfd014ff48922ee80d415", "score": "0.5825985", "text": "def to_s\n @uri\n end", "title": "" }, { "docid": "e057accf2f31a9e7a0e4499d58e8471e", "score": "0.5820259", "text": "def to_s\n @url\n end", "title": "" }, { "docid": "7ed37ef754d55c432ff403f6be7d4190", "score": "0.5817945", "text": "def to_s\n Alf::Renderer.text(self).execute(\"\")\n end", "title": "" }, { "docid": "e3829125d8eb64049f21d5218d425548", "score": "0.58131784", "text": "def to_s\n \"#<#{self.class.inspect}(#{attachment_name})>\"\n end", "title": "" }, { "docid": "d0f26183c05d514bcd07d8be4547fc6e", "score": "0.58121693", "text": "def to_s\n '&' + rule.embed\n end", "title": "" }, { "docid": "6e5b9b6b9bcb39a2c20336994c7133d5", "score": "0.5810305", "text": "def to_s\n @file.to_s\n end", "title": "" }, { "docid": "6cba0d8450a670dfe114d154954b5fa6", "score": "0.5808454", "text": "def inspect\n\t\treturn \"#<%p:%0#x {%d} '%s' (%s): [%s] %s>\" % [\n\t\t\tself.class,\n\t\t\tself.object_id * 2,\n\t\t\tself.synsetid,\n\t\t\tself.words.map(&:to_s).join(', '),\n\t\t\tself.part_of_speech,\n\t\t\tself.lexical_domain,\n\t\t\tself.definition,\n\t\t]\n\tend", "title": "" }, { "docid": "17b8e5a88bc06ed3e8cf8d621ec3be09", "score": "0.58080775", "text": "def to_s\n rule.inspect\n end", "title": "" }, { "docid": "c8cb17c291b447223818a659d712b2bd", "score": "0.5801871", "text": "def to_s\n @uri\n end", "title": "" }, { "docid": "06b48700d45a90dd31f2ad2bbfea8e45", "score": "0.5799021", "text": "def pan_string()\n pan_body().join(',') + \".\"\n end", "title": "" }, { "docid": "ca31f5d44c9a566f42a01a5c343d7fc5", "score": "0.5795933", "text": "def to_s\n \"Relview #{name} #{definition.inspect}\"\n end", "title": "" }, { "docid": "fd97c673ee83be9d6c2c6fd80d0003bd", "score": "0.5795871", "text": "def to_s\n s = @domain\n s = \"#{@node}@#{s}\" if @node\n s += \"/#{@resource}\" if @resource\n return s\n end", "title": "" }, { "docid": "714033da0a8834f45826ee4a254f419f", "score": "0.5795288", "text": "def to_s\n url\n end", "title": "" }, { "docid": "8780cc0ec2512892910dad8930065667", "score": "0.5788695", "text": "def to_s\n @path\n end", "title": "" }, { "docid": "8780cc0ec2512892910dad8930065667", "score": "0.5788695", "text": "def to_s\n @path\n end", "title": "" }, { "docid": "c1c2aafbc6c9d8f709983c21c1998863", "score": "0.5780707", "text": "def to_s; @url; end", "title": "" }, { "docid": "1354df41ace17b1ad1d12d4a6d157586", "score": "0.57797164", "text": "def to_link\n \"<a href=\\\"#{self.url}\\\">#{self.name}</a>\"\n end", "title": "" }, { "docid": "d2fa5f15e8da75557d108270137fe79c", "score": "0.5778914", "text": "def inspect\n @lock.synchronize do\n links = @links.to_a.map { |l| \"#{l.class}:#{l.object_id}\" }.join(',')\n \"#<Celluloid::Links[#{links}]>\"\n end\n end", "title": "" }, { "docid": "53943cc4cae1348051acd14081f5b87e", "score": "0.5775728", "text": "def to_s\n @target\n end", "title": "" }, { "docid": "09f2ac825d019c7a2c34d55daf10d471", "score": "0.57748204", "text": "def to_s\n extended_name\n end", "title": "" }, { "docid": "27b88c5d08ddff7f902c0c757eede93f", "score": "0.5774005", "text": "def to_s\n \"Target - #{@name}\"\n end", "title": "" }, { "docid": "a019e5e1d99c34e3ded18e928db29e1b", "score": "0.57623076", "text": "def to_s\n if @proto == 'file'\n \"file://#{@path}\"\n else\n result = ''\n result << @proto << '://'\n result << URI.encode_www_form_component(@user) if @user\n result << ':' << URI.encode_www_form_component(@pwd) if @user && @pwd\n result << '@' if @user\n result << @host\n result << ':' << @port.to_s if @port\n result << '/' if @path || !@props.empty?\n result << @path if @path\n\n result << '?' << @props.keys.map { |k|\n v=@props[k]; v ? \"#{k}=#{URI.encode_www_form_component(v)}\" : \"#{k}\"\n }.join('&') unless @props.empty?\n\n result\n end\n end", "title": "" }, { "docid": "7fff5b5d21ea744886aea3f15df52608", "score": "0.57523316", "text": "def path\n @link.TargetPath\n end", "title": "" }, { "docid": "2f97c17320f7732a2bb6f3ba53216206", "score": "0.57447916", "text": "def to_s\n path\n end", "title": "" }, { "docid": "2b3cfa7b13b1f00a0ca7845235896ac7", "score": "0.5735306", "text": "def to_s\n out = ''\n self.metadata.each{|k,v| out << \"#{k}: #{v}\\n\"}\n out << \"--------------------\\n\"\n self.steps.each{|s| out << s.to_s }\n out\n end", "title": "" }, { "docid": "1d297b0b89a1adfec1d2a46b6852d5ca", "score": "0.5730206", "text": "def to_s\n return \"#{name} (#{hash})\"\n end", "title": "" }, { "docid": "1627d3adfbd9880a1ac29e5f0bf7fe8a", "score": "0.5729146", "text": "def to_s\n return self.get_info()\n end", "title": "" }, { "docid": "26e1ee649261a953c4a8b68d61cf9e6e", "score": "0.57285464", "text": "def to_s\n text =\"\"\n {'type'=>@type, 'copy'=>(@copy) ? \":copy\" : nil, 'target'=>@target}.each do |name,item|\n if ['target'].index(name)\n text += \"\\\"#{item}\\\" \" unless item.nil?\n else\n text += \"#{item} \" unless item.nil?\n end\n\n end\n text[text.length-1] = \";\" if text.length > 0\n text\n end", "title": "" }, { "docid": "b15abb884c48fd2b7d8dcb5ef8ec37bb", "score": "0.5720685", "text": "def to_s\n target.inspect\n end", "title": "" }, { "docid": "711b9c6c90f3da36189ccf6b0a7ddf40", "score": "0.5717456", "text": "def to_s\n \"[#{@type}]#{@content}\"\n end", "title": "" }, { "docid": "b0579e1a8c5f3d3178ee74726926c67a", "score": "0.5717001", "text": "def to_s\n \"#{@filename}: #{@name}#{@args}\\n\"\n end", "title": "" }, { "docid": "ebfe7e854b1818ef24f73cfaab15276b", "score": "0.5715542", "text": "def to_s; \"#@keyword:#@key; #@sourceRef\" end", "title": "" }, { "docid": "b90f70f041453e71045d7b1632231554", "score": "0.57153183", "text": "def to_s\n \"#{@head.value}\"\n end", "title": "" }, { "docid": "274f141eca0968f39e91369da12f4936", "score": "0.5708233", "text": "def inspect\n\t\treturn \"#<%s:0x%0x %s(%s) %p -> %p >\" % [\n\t\t\tself.class.name,\n\t\t\tself.object_id / 2,\n\t\t\tself.name,\n\t\t\tself.oid,\n\t\t\tself.desc,\n\t\t\tself.attr_oids,\n\t\t]\n\tend", "title": "" }, { "docid": "24580b653c4500196896afdd4c9f3913", "score": "0.57047063", "text": "def to_s\n \"#{@name} => Files: \\n\\t#{@files.join \"\\n\\t\"}\\n Subpackages:\n \\t#{@subpackages.keys.join \"\\n\\t\"}\"\n end", "title": "" }, { "docid": "ea713a1ec8fd8483bcf3642ad3cb4c8b", "score": "0.57035756", "text": "def inspect\n \"#<HG Versioned File: #{to_s}>\"\n end", "title": "" }, { "docid": "6105cc7b81a7b05f4ae1184fdf329563", "score": "0.5703309", "text": "def to_s\n \"#{self.class}::#{name}\"\n end", "title": "" }, { "docid": "82535b8c9da926ad3fbb566c497821c7", "score": "0.57018197", "text": "def to_s\n\t\t\"#{self.name}\"\n\tend", "title": "" }, { "docid": "9bcb94c8644e812bab062c17cf07e612", "score": "0.5698591", "text": "def to_s\n source\n end", "title": "" }, { "docid": "9bcb94c8644e812bab062c17cf07e612", "score": "0.5698591", "text": "def to_s\n source\n end", "title": "" }, { "docid": "db7e1e4e6dd4d5a9c5903c3d935a9d79", "score": "0.5697794", "text": "def to_s\n l = label ? \" '#{label.to_s}'\" : ''\n \"(#{source}-#{target}#{l})\"\n end", "title": "" }, { "docid": "85f8bca4fad356afc4e483024c56ca3f", "score": "0.5695184", "text": "def to_s\n \"#{type}:#{flags.join}:#{principle}@#{domain}:#{permissions.join}\"\n end", "title": "" }, { "docid": "e13c5fb882f5dfc8aaacbc7b1121d08c", "score": "0.5691246", "text": "def description\n @link.Description\n end", "title": "" } ]
d34a9a870a4a047b36257afda09c363c
Wrap the update action with Turbolinks support.
[ { "docid": "b9069ef813412cce99058a52813417d9", "score": "0.0", "text": "def update\n super\n response.status = :unprocessable_entity if resource&.errors&.any?\n end", "title": "" } ]
[ { "docid": "a01ff27bec76eef35eece87af255bc7d", "score": "0.6957167", "text": "def update(*args)\n wrap_in_javascript_for(:update, *args)\n end", "title": "" }, { "docid": "dfa8ac7965df1bb4b09ad4597b03fd30", "score": "0.6730909", "text": "def update\n #formats as js since it's getting parsed on the front end\n respond_to do |format|\n format.js\n end\n end", "title": "" }, { "docid": "f5c8f5c29ae6b799b2bcef61e0b6ed17", "score": "0.6656156", "text": "def update\n respond_to do |format|\n format.js {update_js}\n end\n end", "title": "" }, { "docid": "b9233a01271abe8ee25eb87f3e674327", "score": "0.6570491", "text": "def update\n @mentor = \"Arnold\"\n render \"update.js.coffee\"\n end", "title": "" }, { "docid": "6f6849386933fc2b0b9765a05d258637", "score": "0.6504018", "text": "def update(request)\n end", "title": "" }, { "docid": "6f6849386933fc2b0b9765a05d258637", "score": "0.6504018", "text": "def update(request)\n end", "title": "" }, { "docid": "6ebc864e6d2fa513e088bc6025db4b53", "score": "0.6471537", "text": "def update\n head :no_content\n end", "title": "" }, { "docid": "6ebc864e6d2fa513e088bc6025db4b53", "score": "0.6471537", "text": "def update\n head :no_content\n end", "title": "" }, { "docid": "c6d4f3eb998a2d27de7662fbfdf61505", "score": "0.6350158", "text": "def update #saves and redirects, saves changes\n end", "title": "" }, { "docid": "470cfdc14ed934eb9f945b2f5a08aa39", "score": "0.6323727", "text": "def update!\n inject_js\n self\n end", "title": "" }, { "docid": "a578361e329543cec789c2b96b3b8d47", "score": "0.6263003", "text": "def the_update_redirect; {:action => 'index'}; end", "title": "" }, { "docid": "7266a84272d4595cd822741d1c629cc2", "score": "0.62603587", "text": "def update\n #Nothing necessary\n end", "title": "" }, { "docid": "65bbc11863a034e02fa8974298724c56", "score": "0.62561715", "text": "def update\n #\n end", "title": "" }, { "docid": "e0c4f4d1b7810f2311891ecf9256ac15", "score": "0.6233531", "text": "def component_update \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n update_params :default_scaffold_id => \"webrt\", :default_sort => nil, :default_sort_direction => \"desc\"\n return_to_main\n end\n end", "title": "" }, { "docid": "87665131635149fcfa4305cfb3872516", "score": "0.6198601", "text": "def component_update \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n update_params :default_scaffold_id => \"recipe\", :default_sort => nil, :default_sort_direction => \"asc\"\n return_to_main\n end\n end", "title": "" }, { "docid": "123bfc5feca68fee51b63e58539abce7", "score": "0.61930406", "text": "def update\n @website = Website.find(params[:id])\n @website.update(update_params)\n @components = @website.components.order(id: :asc)\n respond_to do |format|\n format.js\n end\n PreviewJob.perform_later @website\n end", "title": "" }, { "docid": "ce2586144db015244638fcaf108f8926", "score": "0.618912", "text": "def update\n \tredirect_to root_path\n end", "title": "" }, { "docid": "20b8022ef435bda0526e18182931760d", "score": "0.61690366", "text": "def update \n render partial: theme_presenter.page_template_path('products/accessories/update'), format: [:js]\n end", "title": "" }, { "docid": "406655f9fd2e37eddc1e0253bab07e10", "score": "0.6145866", "text": "def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n end", "title": "" }, { "docid": "406655f9fd2e37eddc1e0253bab07e10", "score": "0.6145866", "text": "def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n end", "title": "" }, { "docid": "406655f9fd2e37eddc1e0253bab07e10", "score": "0.6145866", "text": "def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n end", "title": "" }, { "docid": "fb3c30b6fb569efc67f02e8b3df965c4", "score": "0.6140464", "text": "def component_update\r\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \r\n if request.xhr?\r\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\r\n component\r\n else\r\n # If this is from a client without javascript we want to update the session parameters and then delegate\r\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\r\n return_to_main\r\n end\r\n\t\r\n end", "title": "" }, { "docid": "2449ed0605c6e220f1e51e65b3664068", "score": "0.61289334", "text": "def update\n #\n # NO-OP\n #\n end", "title": "" }, { "docid": "cd7020b4dbdf408fa8e8a865797e07b6", "score": "0.611727", "text": "def update\n @otf_lookup = OtfLookup.find(params[:id])\n\n respond_to do |format|\n if @otf_lookup.update_attributes(params[:otf_lookup])\n expire_fragment(\"lookup-#{@otf_lookup.id}\")\n format.html { redirect_to(@otf_lookup, :notice => 'Otf lookup was successfully updated.') }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.js\n end\n end\n end", "title": "" }, { "docid": "007f976d25ffbdde53e6c6cd23cc1a12", "score": "0.6101355", "text": "def update\n end", "title": "" }, { "docid": "007f976d25ffbdde53e6c6cd23cc1a12", "score": "0.6101355", "text": "def update\n end", "title": "" }, { "docid": "007f976d25ffbdde53e6c6cd23cc1a12", "score": "0.6101355", "text": "def update\n end", "title": "" }, { "docid": "007f976d25ffbdde53e6c6cd23cc1a12", "score": "0.6101355", "text": "def update\n end", "title": "" }, { "docid": "007f976d25ffbdde53e6c6cd23cc1a12", "score": "0.6101355", "text": "def update\n end", "title": "" }, { "docid": "007f976d25ffbdde53e6c6cd23cc1a12", "score": "0.6101355", "text": "def update\n end", "title": "" }, { "docid": "007f976d25ffbdde53e6c6cd23cc1a12", "score": "0.6101355", "text": "def update\n end", "title": "" }, { "docid": "007f976d25ffbdde53e6c6cd23cc1a12", "score": "0.6101355", "text": "def update\n end", "title": "" }, { "docid": "007f976d25ffbdde53e6c6cd23cc1a12", "score": "0.6101355", "text": "def update\n end", "title": "" }, { "docid": "007f976d25ffbdde53e6c6cd23cc1a12", "score": "0.6101355", "text": "def update\n end", "title": "" }, { "docid": "007f976d25ffbdde53e6c6cd23cc1a12", "score": "0.6101355", "text": "def update\n end", "title": "" }, { "docid": "ba5a882c8b2dbce1dc8153798b2594c2", "score": "0.60922605", "text": "def update\n head :ok\n end", "title": "" }, { "docid": "10f71f03196c82822d6ddef255619479", "score": "0.60902643", "text": "def component_update\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n return_to_main\n end\n end", "title": "" }, { "docid": "10f71f03196c82822d6ddef255619479", "score": "0.60902643", "text": "def component_update\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n return_to_main\n end\n end", "title": "" }, { "docid": "10f71f03196c82822d6ddef255619479", "score": "0.60902643", "text": "def component_update\n @show_wrapper = false # don't show the outer wrapper elements if we are just updating an existing scaffold \n if request.xhr?\n # If this is an AJAX request then we just want to delegate to the component to rerender itself\n component\n else\n # If this is from a client without javascript we want to update the session parameters and then delegate\n # back to whatever page is displaying the scaffold, which will then rerender all scaffolds with these update parameters\n return_to_main\n end\n end", "title": "" }, { "docid": "5016ec2cfe522d86aeb9c51e3b49b726", "score": "0.6056962", "text": "def update\n # Not generally used\n end", "title": "" }, { "docid": "5016ec2cfe522d86aeb9c51e3b49b726", "score": "0.6056962", "text": "def update\n # Not generally used\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" }, { "docid": "dc1181921395ed1c63f2b45eefaf0ee6", "score": "0.605666", "text": "def update\n end", "title": "" } ]
3b81a7878c56cd8a4310f59aa77476e4
How can you ask for both the name and the cohort? What if one of the values is empty? Can you supply a default value? The input will be given to you as a string? How will you convert it to a symbol? What if the user makes a typo?
[ { "docid": "759b0f7ce6718336a153aca5a7063d0d", "score": "0.6234122", "text": "def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n cohorts = ['january','february','march','april','may','june',\n 'july', 'august','september','october','november','december']\n # get the first name\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n students << {name: name, cohort: \"\"}\n puts \"Cohort?\"\n cohort = gets.chomp\n until cohorts.include?(cohort)\n cohort = gets.chomp\n end\n students[-1][:cohort] = cohort.to_sym\n puts \"Now we have #{students.count} students\"\n # get another name from the user\n name = gets.chomp\n end\n # return the array of students\n students\nend", "title": "" } ]
[ { "docid": "4726043e08338c112e9eacd672666ed4", "score": "0.8126306", "text": "def input_cohort\n puts \"Enter their cohort\".center(80)\n cohort = STDIN.gets.chomp.to_sym\n\n if cohort.empty?\n cohort = :none\n end\n cohort\nend", "title": "" }, { "docid": "2ae0b468542038af62b4b0ed84a537a5", "score": "0.773806", "text": "def input_chohort\n\tcohort = ''\n\tuntil @months.include?(cohort)\n\t\tputs \"which cohort?\"\n\t\tcohort = STDIN.gets.chomp.downcase\n\t\tif cohort.empty? or !@months.include?(cohort)\n\t\t\tputs \"please enter a valid cohort.\"\n\t\tend\n\tend\n\treturn cohort\nend", "title": "" }, { "docid": "0e00130c4069221752e5db8a63489a16", "score": "0.7617881", "text": "def get_cohort_info\n puts \"Student's cohort:\"\n cohort = STDIN.gets.chomp\n # if no cohort was entered then default meaning is November\n if cohort.empty?\n cohort = \"November\"\n end\n # checks that cohort is a month (12 possible months)\n until [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"].include? cohort do\n puts \"You have mispelled the month of student's cohort, please enter on of the following months (spelling matters) - January, February, March, April, May, June, July, August, September, October, November, December, or empty string to assign it to November: \"\n cohort = STDIN.gets.chomp\n # user can enter empty input to assign cohort to November (default)\n if cohort.empty?\n return cohort = \"November\"\n end\n end\n return cohort\nend", "title": "" }, { "docid": "150d640d9075c9e0a8b40b89aa5ad706", "score": "0.75240564", "text": "def input_students\n puts \"Please enter the student's name and their cohort\"\n puts \"To exit, press return twice\"\n @name = STDIN.gets.chomp\n @cohort = STDIN.gets.chomp\n @cohort = \"december\" if @cohort.empty?\nend", "title": "" }, { "docid": "92ee18f715827bba65f63b63e651713f", "score": "0.7483978", "text": "def get_cohort\n months = [:January, :February, :March, :April, :May, :June, :July, :August,\n :September, :October, :November, :December]\n\n puts \"Please enter the cohort you will be joining\".center(65)\n cohort = gets.chomp.to_sym.capitalize\n\n if !cohort.empty? && months.include?(cohort)\n return cohort\n elsif !cohort.empty? && !months.include?(cohort)\n puts \"Please enter a valid cohort\".center(65)\n cohort = gets.chomp.to_sym.capitalize\n elsif cohort.empty?\n cohort = :November\n end\n cohort\nend", "title": "" }, { "docid": "846aa138de31b2358b0c6cb42b607811", "score": "0.7476934", "text": "def gather_cohort\n puts \"#{@name}'s cohort:\"\n @cohort = STDIN.gets.chomp.capitalize.to_sym\n @cohort = :November if @cohort.empty?\n until @months.include? @cohort\n puts \"Please enter a valid month\"\n @cohort = STDIN.gets.chomp.capitalize.to_sym\n end\nend", "title": "" }, { "docid": "088a9bb6602bb6f64a8447e421816470", "score": "0.74224716", "text": "def enter_cohort_name value\n fill_in('cohort_name', :with => value)\n end", "title": "" }, { "docid": "235386c85359c43d9cae79d183e47ac2", "score": "0.72807604", "text": "def input_cohort\n puts \"Choose the cohort, please write ONLY the number of the cohort you want\".center(@margins)\n puts \"1 January 2 February 3 March 4 April 5 May 6 June\".center(@margins)\n puts \"7 July 8 August 9 September 10 October 11 November 12 December\".center(@margins)\n#We get the number of the cohort\n cohort = STDIN.gets.chomp\n puts \"You wrote #{cohort}, are you sure that's the cohort you want? Y/N\"\n choice = STDIN.gets.chomp\n#Now the user select an option\n if choice.upcase == \"Y\"\n #If empty, returns the default cohort November\n if cohort.empty?\n return :NotSpecified\n #If the number is selected correctly it will return the cohort\n elsif 0 < cohort.to_i && cohort.to_i < 13\n return @choosen_cohort[cohort.to_i-1]\n else\n #If the input is not in the list we have the wrong input message\n puts \"Wrong input, try again\"\n input_cohort\n end\n #if the user selects no, it goes back to the previous step\n elsif choice.upcase == \"N\"\n input_cohort\n #if wrong input, it goes back to the previous step\n else\n puts \"wrong input try again\"\n input_cohort\n end\nend", "title": "" }, { "docid": "5e8183ede34c675872a47353d7e5d994", "score": "0.7276435", "text": "def input_cohort\n loop do\n # take input, return it if valid and loop again if not\n puts 'Which cohort are they in? (calendar month)'\n cohort_input = STDIN.gets.chomp.downcase.to_sym\n return cohort_input if COHORTS.include?(cohort_input)\n end\n end", "title": "" }, { "docid": "ee713c38e18150b716ac6c3d59360678", "score": "0.7258453", "text": "def input_student_name_cohort\n\t#Q7 let go of the hard-coded cohort. Take cohort input, include default cohort if nil.\n \tputs \"Please spell out the names of the students and their cohort in the form 'Name,Month'.\"\n\tputs \"To finish, just hit return twice\"\n default_cohort = \"november\"\n input = gets.chomp.split(\",\")\n # while the name is not empty, repeat this code\n while !input.empty? do\n \t@name = input[0]\n \tif input[1] != nil\n \t\t@cohort = input[1]\n \telse\n \t\t@cohort = default_cohort\n \tend\n # add the student hash to the array\n @students << {name: @name, cohort: @cohort} # hobby: @hobbby, country: @ country, height: @height}\n # Q9 correcting grammar to allow singular student\n if @students.count < 2\n \tputs \"Now we have #{@students.count} student\"\n else\n \tputs \"Now we have #{@students.count} students\"\n end\n input = gets.chomp.split(\",\")\n end\n @students\nend", "title": "" }, { "docid": "f150707054af2efbeed907e97b237eab", "score": "0.72160274", "text": "def get_cohort\n months = [\"january\", \"february\", \"march\", \"april\", \"may\", \"june\", \"july\", \"august\", \"september\", \"october\", \"november\", \"december\"]\n while true\n puts \"What is their cohort?\"\n cohort = STDIN.gets.chomp\n if cohort == \"\"\n cohort = :november\n break\n elsif months.include?(cohort)\n cohort = cohort.to_sym\n break\n else\n puts \"Please try that again\"\n end\n end\n cohort\nend", "title": "" }, { "docid": "48e9c32f4438a4c8d6bff155673dcf12", "score": "0.720216", "text": "def validate_cohort_choice()\n# Used twice: print_by_cohort() and input_students()\n valid_cohort_choice = false\n valid_cohorts = [\"January\", \"February\",\"March\",\"April\",\"May\",\"June\",\n \"July\",\"August\",\"September\",\"October\",\"November\",\"December\"]\n while valid_cohort_choice == false\n puts \"(Full month name, please)\"\n cohort = default(STDIN.gets.chomp.capitalize, \"UNASSIGNED\")\n if cohort == \"UNASSIGNED\" || valid_cohorts.include?(cohort)\n valid_cohort_choice = true\n return cohort\n end\n end\nend", "title": "" }, { "docid": "fc5cf09a924f8554b0dd0fb73681e362", "score": "0.7102194", "text": "def name_cohort_oneline\n this_student = Hash.new#used to capture each student\n name, cohort = STDIN.gets.split.map{|i| i.to_sym} #split will break the text up into an array and each element will go to each variable. Split defaults on whitespace. map { |i| i.to_s } same as map(&:to_s)\n this_student[:name] = name\n if cohort.nil?\n this_student[:cohort] = 'n/a'\n else this_student[:cohort] = cohort#default value for cohort if empty\n end\n return this_student\nend", "title": "" }, { "docid": "08f3bcbd55b5edde72dd22afe16ab884", "score": "0.70407915", "text": "def add_cohort\n cohort_arr = {1 => :January, 2 => :February, 3 => :March, 4 => :April, 5 => :May, \n 6 => :June, 7 => :July, 8 => :August, 9 => :Septmeber, 10 => :October, 11 => :November, 12 => :December, 13 => :tbc}\n puts \"Enter month (1 to 12) of the cohort to join: \"\n num = gets.strip.to_i\n if cohort_arr.has_key?num\n cohort = cohort_arr[num]\n else\n puts \"\\nYou made a typo. Default cohort 'tbc' assigned.\"\n cohort = cohort_arr[13]\n end\n cohort\nend", "title": "" }, { "docid": "ff7843d1554a7173d7821ce561d3ffea", "score": "0.7013751", "text": "def valid_cohort (cohort)\n while cohort.empty? || !@months.include?(cohort) do\n puts \"Please enter a valid cohort\"\n cohort = STDIN.gets.chop.downcase\n end\nend", "title": "" }, { "docid": "1fd222755ef82b522aedcfbed1aa8716", "score": "0.69923794", "text": "def get_user_input\n print \"Name: \"\n name = gets.chomp.upcase\n\n if name.empty? then name = '< Not provided >' end\n\n print \"Cohort: \"\n cohort = gets.chomp.downcase\n if cohort.empty? then cohort = '< Not provided >' end\n cohort = cohort.to_sym\n if !MONTHS.include? cohort\n puts 'Please, check spelling.'\n end\n\n print \"Age: \"\n age = gets.chomp\n\n print \"Country of birth: \"\n country_of_birth = gets.chomp.upcase!\n\n print \"Height in cm: \"\n height = gets.chomp\n\n print \"Any hobbies? \"\n hobbies = gets.chomp\n\n {\n name: name,\n cohort: cohort,\n age: age,\n born: country_of_birth,\n height: height,\n hobbies: hobbies\n }\nend", "title": "" }, { "docid": "6981ecb2be0d61e531dbe2a00ed6f92e", "score": "0.6979022", "text": "def enter_student_cohort\n puts 'Enter cohort, default is January'\n cohort = ''\n months = %w[january february march april may june july august september october november december]\n while cohort == '' do\n input = STDIN.gets.chomp.downcase\n if months.include?(input)\n return input\n elsif input == ''\n return 'january'\n else\n puts 'Month has typo, try again'\n end\n end\nend", "title": "" }, { "docid": "47020a0e528dfa58f51bc2c89e783398", "score": "0.68981797", "text": "def valid_cohort(cohort, default)\n cohorts = [\n :january, :february, :march, :april,\n :may, :june, :july, :august,\n :september, :october, :november, :december,\n default.to_sym\n ]\n cohorts.include?(cohort.to_sym)\nend", "title": "" }, { "docid": "f880f8190f331ed4215e8d2a576ede6b", "score": "0.68842185", "text": "def input_student_cohort\n puts \"Is this student in the february, may, august or november cohort?\"\n legal_cohorts = [\"february\", \"may\", \"august\", \"november\"]\n cohort = STDIN.gets.strip\n until legal_cohorts.include?(cohort)\n puts \"You entered an invalid cohort, please try again.\"\n cohort = STDIN.gets.strip\n end\n cohort\nend", "title": "" }, { "docid": "aac57a936307ef4fb72f0a403d9b7a64", "score": "0.6778315", "text": "def input_students\r\n puts \"Please enter names of students. \\nAfter each name hit enter. \\nTo exit press enter twice.\"\r\n puts 'If you make a mistake, enter \"typo\" in the next entry and then try again' #What if the user makes a typo?\r\n students = []\r\n name = gets.chomp.downcase.to_sym\r\n while !name.empty?\r\n p \"Which cohort are they in?\"\r\n cohort = gets.chomp.downcase.to_sym #The input will be given to you as a string? How will\r\n #you convert it to a symbol?\r\n if cohort.empty?\r\n cohort = :unknown #What if one of the values is empty? Can you\r\n #supply a default value?\r\n elsif cohort == :typo\r\n redo\r\n end\r\n students << {name: name,\r\n cohort: cohort\r\n }\r\n p \"Added info for #{students.last[:name]}\"\r\n p \"There are now #{students.count} students.\"\r\n p \"Please enter the next student's name.\"\r\n name = gets.chomp.downcase.to_sym\r\n end\r\n students\r\nend", "title": "" }, { "docid": "fc344b88af64023d203b725cf4eadcab", "score": "0.6751807", "text": "def cohort\n puts \"What cohort would you like to see?\"\n cohort = STDIN.gets.chomp\n puts\n @students.each do |student|\n if student[:cohort] = cohort\n puts \"#{student[:name]}, Country: #{student[:country]}, Age: #{student[:age]}, (#{student[:cohort]} cohort)\"\nend\nputs\nend\nend", "title": "" }, { "docid": "ee7ad6266185ee40f438142faf4e5c0c", "score": "0.6735055", "text": "def user_questions()\n puts \"Please enter a students name\"\n puts \"Press enter twice to finish\"\n @name = STDIN.gets.chomp\n case @name\n when \"\"\n puts \"All done\"\n else\n puts \"What cohort are they in?\"\n @cohort = STDIN.gets.chomp\n end\nend", "title": "" }, { "docid": "98ac495880e373b2ad2c3b70edc967ae", "score": "0.66929936", "text": "def input_students\n puts \"Please input student names\"\n puts \"To exit input empty name value\" \n students = []\n name = gets.chomp\n until name.empty?\n puts \"Please input cohort\"\n cohort = gets.chomp\n if cohort.empty? \n students << {name: name, cohort: :november}\n else\n students << {name: name, cohort: cohort.to_sym}\n end\n puts \"We now have #{students.length} students.\"\n puts \"Please input next name\"\n name = gets.chomp\n end\n students\nend", "title": "" }, { "docid": "98ac495880e373b2ad2c3b70edc967ae", "score": "0.66929936", "text": "def input_students\n puts \"Please input student names\"\n puts \"To exit input empty name value\" \n students = []\n name = gets.chomp\n until name.empty?\n puts \"Please input cohort\"\n cohort = gets.chomp\n if cohort.empty? \n students << {name: name, cohort: :november}\n else\n students << {name: name, cohort: cohort.to_sym}\n end\n puts \"We now have #{students.length} students.\"\n puts \"Please input next name\"\n name = gets.chomp\n end\n students\nend", "title": "" }, { "docid": "32b829c4b93109815efdc6b10f61dab6", "score": "0.66517866", "text": "def input_students\n puts \"Please enter the names of the students\".center(50)\n puts \"To finish, just hit return twice\".center(50)\n # create empty array\n students = []\n cohorts = [:january, :february, :march, :april, :may, :june, :july, :august, :september, :october, :november, :december]\n # get the first name\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # ask for cohort information\n puts \"What cohort are they in?\".center(50)\n cohort = gets.chomp\n # check for typos or insert default if empty\n unless (cohorts.include? cohort.downcase.to_sym) || (cohort == \"\")\n puts \"We have detected a typo, please re-enter the cohort\".center(50)\n cohort = gets.chomp\n end\n students << {name: name, cohort: (cohort.empty? ? :unknown : cohort.downcase.to_sym)}\n puts \"Now we have #{students.count} students\".center(50)\n puts \"Please enter the next name\".center(50)\n #get another name from the user\n name = gets.chomp\n end\n # return the array of students\n students\nend", "title": "" }, { "docid": "a14df81d46d294388ae4d586eeff144f", "score": "0.6582154", "text": "def input_students\r\n puts \"Please enter names of students. \\nAfter each name hit enter. \\nTo exit press enter twice.\"\r\n puts 'If you make a mistake, enter \"typo\" in the next entry and then try again' #What if the user makes a typo?\r\n students = []\r\n name = gets.chomp.downcase.to_sym\r\n while !name.empty? \r\n p \"Which cohort are they in?\"\r\n cohort = gets.chomp.downcase.to_sym #The input will be given to you as a string? How will\r\n#you convert it to a symbol?\r\n if cohort.empty?\r\n cohort = :unknown #What if one of the values is empty? Can you\r\n#supply a default value?\r\n elsif cohort == :typo\r\n redo\r\n end\r\n students << {name: name,\r\n cohort: cohort\r\n }\r\n p \"Added info for #{students.last[:name]}\"\r\n p \"There are now #{students.count} students.\"\r\n p \"Please enter the next student's name.\"\r\n name = gets.chomp.downcase.to_sym\r\n end\r\n students\r\n end", "title": "" }, { "docid": "82f708b5b5ec49c63b90c3e5bd9aaa77", "score": "0.6564222", "text": "def input_student\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice times\"\n\n students = []\n months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n\n puts \"Full Name or quit\"\n name = gets.chop\n puts \"Enter cohort month number\"\n months.each_with_index { |month, index| puts \"#{index + 1}. #{month}\" }\n\n month_number = gets.strip\n cohort = months[month_number.to_i - 1]\n cohort = \"TBC\" if cohort.empty?\n\n while !name.empty? do\n students << {name: name.capitalize!, cohort: cohort.to_sym}\n if students.count == 1\n puts \"Now we have #{students.count} student\"\n else\n puts \"Now we have #{students.count} students\"\n end\n puts \"Full Name or quit\"\n name = gets.chomp\n if !name.empty?\n puts \"Enter cohort month number\"\n month_number = gets.chomp\n cohort = months[month_number.to_i - 1]\n if cohort.empty? then cohort = \"TBC\"\n end\n end\n end\n students\nend", "title": "" }, { "docid": "470385bbdc6af6023aca1c1c28ff333b", "score": "0.6555801", "text": "def input_students\n puts \"Please enter the names of the students and their corresponding cohort\"\n puts \"Please provide a name first, followed by their cohort\"\n puts \"To finish, just hit quit\"\n students = []\n name = gets.chomp\n cohort = gets.chomp\n while name != \"quit\" do\n cohort = \"unknown\" if cohort.empty? \n name = \"unknown\" if name.empty?\n puts \"check your answer, type yes for correct, type no to redo\"\n puts \"name = #{name}, cohort = #{cohort}\"\n check = gets.chomp\n if check == \"yes\"\n students << {name: name, cohort: cohort.to_sym, age: :\"25\", hobbies: :tennis}\n puts \"Now we have #{students.count} students\"\n end\n name = gets.chomp\n cohort = gets.chomp\n end\n students\nend", "title": "" }, { "docid": "470385bbdc6af6023aca1c1c28ff333b", "score": "0.6555801", "text": "def input_students\n puts \"Please enter the names of the students and their corresponding cohort\"\n puts \"Please provide a name first, followed by their cohort\"\n puts \"To finish, just hit quit\"\n students = []\n name = gets.chomp\n cohort = gets.chomp\n while name != \"quit\" do\n cohort = \"unknown\" if cohort.empty? \n name = \"unknown\" if name.empty?\n puts \"check your answer, type yes for correct, type no to redo\"\n puts \"name = #{name}, cohort = #{cohort}\"\n check = gets.chomp\n if check == \"yes\"\n students << {name: name, cohort: cohort.to_sym, age: :\"25\", hobbies: :tennis}\n puts \"Now we have #{students.count} students\"\n end\n name = gets.chomp\n cohort = gets.chomp\n end\n students\nend", "title": "" }, { "docid": "4be88447acabe58ff2998922795e8580", "score": "0.65461266", "text": "def input_students\n puts \"Please enter the name and cohort of each student\"\n puts \"To finish, just hit return twice\"\n puts \"Student name: \"\n # get the first name\n name = STDIN.gets.chomp.split.map(&:capitalize).join(' ')\n # while the name is not empty, repeat this code\n while !name.empty? do\n # get student cohort\n puts \"#{name}'s cohort: (or hit return to default to November)\"\n cohort = STDIN.gets.chomp.capitalize.to_sym\n if cohort.empty?\n cohort = :November\n else\n while !COHORT.include?(cohort)\n puts \"#{name}'s cohort: (or hit return to default to November)\"\n cohort = STDIN.gets.chomp.capitalize.to_sym\n end\n end\n # add the student hash to the array\n @students << {\n name: name,\n cohort: cohort,\n hobbies: :reading,\n country: :UK,\n DOB: :unknown\n }\n # 9. edit statement to change for singular or plural\n if @students.count == 1\n $collective = \"student\"\n else\n $collective = \"students\"\n end\n puts \"Now we have #{@students.count} #{$collective}\"\n # get another name from the user\n puts \"Student name: \"\n name = STDIN.gets.chomp.split.map(&:capitalize).join(' ')\n end\nend", "title": "" }, { "docid": "c4b1ca91f381e7eb1e1b54cad5a83674", "score": "0.6531916", "text": "def input_students\n name_cohort\n #hobby\n #country\n #height\n check\nend", "title": "" }, { "docid": "e7f9424deb2c8293902a0765acc38691", "score": "0.65145", "text": "def correct_cohort(cohort)\n\n cohort = STDIN.gets.chomp\n cohort = TBD if cohort.empty?\n\n loop do \n break if CORRECT.include?(cohort.capitalize) or cohort == TBD\n puts \"Enter a correct month\"\n cohort = STDIN.gets.chomp\n end\n\n cohort\nend", "title": "" }, { "docid": "e24aa557a7e5d2ad909b0637163347bc", "score": "0.64417446", "text": "def cohort(students)\n \n cohort_list = []\n students.map {|student| cohort_list << student[:cohort]}\n if cohort_list.size <= 2\n cohort_options = cohort_list.uniq.join(\" or \")\n else\n last_cohorts = cohort_list.pop(2)\n cohort_joined = cohort_list << last_cohorts.join(\" or \")\n cohort_options = cohort_joined.flatten.uniq.join\", \"\n end\n puts \"Which cohort would you like to see: #{cohort_options}?\"\n selected_cohort = gets.chomp.capitalize.to_sym \n \n puts \"Students from the #{selected_cohort} cohort:\"\n students.map do |student| \n puts \"#{student[:name]}, (#{student[:cohort]} cohort)\" if selected_cohort == student[:cohort] \n end \nend", "title": "" }, { "docid": "c2e4db029ce0a9d72b9110a73afbca60", "score": "0.64396375", "text": "def input_students\n months = [\n :january,\n :february,\n :march,\n :april,\n :may,\n :june,\n :july,\n :august,\n :september,\n :october,\n :november,\n :december\n ]\n students = []\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n name = gets.chomp\n\n while !name.empty? do\n puts \"Please type a cohort\"\n cohort = gets.chomp\n while !months.include?(cohort.downcase.to_sym) && !cohort.empty?\n puts \"Please type a valid cohort\"\n cohort = gets.chomp\n end\n\n if !cohort.empty?\n students << {name: name, cohort: cohort.to_sym}\n else\n students << {name: name, cohort: :unknown}\n end\n puts \"Now we have #{students.count} students\"\n name = gets.chomp\n end\n students\nend", "title": "" }, { "docid": "c2e4db029ce0a9d72b9110a73afbca60", "score": "0.64396375", "text": "def input_students\n months = [\n :january,\n :february,\n :march,\n :april,\n :may,\n :june,\n :july,\n :august,\n :september,\n :october,\n :november,\n :december\n ]\n students = []\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n name = gets.chomp\n\n while !name.empty? do\n puts \"Please type a cohort\"\n cohort = gets.chomp\n while !months.include?(cohort.downcase.to_sym) && !cohort.empty?\n puts \"Please type a valid cohort\"\n cohort = gets.chomp\n end\n\n if !cohort.empty?\n students << {name: name, cohort: cohort.to_sym}\n else\n students << {name: name, cohort: :unknown}\n end\n puts \"Now we have #{students.count} students\"\n name = gets.chomp\n end\n students\nend", "title": "" }, { "docid": "fdde4d4ce0045aa7f614e118213b7493", "score": "0.64321685", "text": "def input_students\n puts \"Please enter the name of the student\"\n puts \"To exit, press return twice\"\n #empty array\n students = []\n name = gets.strip\n puts \"What cohort are they joining?\"\n cohort = gets.strip\n #creating a default cohort and age value\n cohort = \"december\" if cohort.empty?\n #condition to loop through input until user inputs empty name\n while !name.empty? do\n students << {name: name, cohort: cohort.to_sym}\n if students.length == 1\n puts \"now we have #{students.count} great student\"\n else\n puts \"now we have #{students.count} great students\"\n end\n name = gets.strip\n puts \"What cohort are they joining?\"\n cohort = gets.strip\n cohort = \"december\" if cohort.empty?\n end\n #returns the array\n students\nend", "title": "" }, { "docid": "7571d46d75ead22bf677fa505363a766", "score": "0.64148146", "text": "def cohort_display\n puts \"Do you want to select which cohort is displayed? Y/N\".center(@margins)\n puts \"If you don't, all of them will be displayed\".center(@margins)\n option = STDIN.gets.chomp\n #if yes, select a month\n if option.upcase == \"Y\"\n return [input_cohort]\n #if no, return the sorted array\n elsif option.upcase == \"N\"\n return @choosen_cohort\n #else, goes to the previous step\n else\n puts \"Wrong argument, try again\"\n cohort_display\n end\nend", "title": "" }, { "docid": "8d89edbe78ee796a5030b543f1a711ee", "score": "0.63933265", "text": "def input_students\n puts \"Please enter the names and cohort of the students\"\n puts \"To finish, just hit return twice\"\n\n name = gets.chomp\n # while the name is not empty, repeat this block of code\n while !name.empty? do\n cohort = gets.chomp\n if cohort.empty?\n cohort = \"November\"\n end\n\n while ![\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"].include? cohort\n puts \"You've made a typo, retype\"\n cohort = gets.chomp\n if cohort.empty?\n cohort = \"November\"\n break\n end\n end\n\n @students << {name: name, cohort: cohort.to_sym, hobby: :skiing, country_of_birth: :UK, height: :\"180\"}\n\n if @students.count == 1\n student_string = \"student\"\n else student_string = \"students\"\n end\n puts \"Now we have #{@students.count} #{student_string}\"\n\n # get another name from the user\n name = gets.delete(\"\\n\")\n\n end\n @students.sort_by {|x| x[:cohort]}\n # return the sorted list of students\n\nend", "title": "" }, { "docid": "ba84d2597d0fccb031833f9da75e3974", "score": "0.63896286", "text": "def input_students(students)\n puts \"To finish, just hit return twice\"\n was_last_name_empty = false\n while true do\n puts \"Please enter the name of the student\"\n name = gets.delete(\"\\n\").capitalize\n if name.empty?\n if was_last_name_empty == true\n break\n else\n was_last_name_empty = true\n end\n else\n puts \"Please enter the student cohort\"\n cohort = gets.chomp.to_sym\n if cohort.empty? \n cohort = :none\n end\n students << {name: name, cohort: cohort}\n was_last_name_empty = false\n end\n end\n return students\nend", "title": "" }, { "docid": "28f83ec341733575d7c5f6f5c301a4af", "score": "0.63879603", "text": "def print_by_cohort\n cohorts = @students.map { |students| students[:cohort] }\n puts \"You have students from the following cohorts:\"\n cohorts.each { |cohort| cohort.to_s\n puts \"#{cohort}\"\n }\n puts \"Which cohort would you like to display:\"\n cohort_input = STDIN.gets.chomp.capitalize.to_sym\n @students.each { |student|\n if student[:cohort] == cohort_input\n puts \"Name: #{student[:name]}, Origin: #{student[:origin]}, DOB: #{student[:dob]}\"\n end\n}\nend", "title": "" }, { "docid": "6ec1fcd76f04bd16d63c1388da77d6b6", "score": "0.63854015", "text": "def input_students\n name = input_name\n while !name.empty? do\n cohort = input_cohort\n if cohort.empty?\n #set November as default cohort\n add_student(name, \"November\")\n else\n add_student(name, cohort)\n end\n name = input_name\n end\n message(\"Students added\")\n @students\nend", "title": "" }, { "docid": "6b24f708156988db41d9189bac2b5d28", "score": "0.6369673", "text": "def name_cohort(cohort)\n wait_for_element_and_type(cohort_name_input_element, cohort.name)\n wait_for_update_and_click save_cohort_button_two_element\n end", "title": "" }, { "docid": "8de268d97a35f732065027ca0307a49a", "score": "0.6363138", "text": "def input_students\n puts \"Please enter the name and cohort of each student\"\n puts \"To finish, just hit return twice\"\n name = gets.chomp\n # create an empty array\n students = []\n # cohort defaults to July is user doesn't enter a month \n \n # while the name is not empty, repeat this code\n while !name.empty? do # As long as the user enters input\n puts \"Please enter the student's cohort\" \n cohort = gets.chomp\n cohort = \"march\" if cohort == \"\"\n puts \"Please enter a valid month\" if cohort != /\"january|January|february|February|\n March|march|April|april|May|may|June|june|July|july|August|august|September|september|October|\n october|November|november|December|december\"/\n # add the student hash to the array\n students << {name: name, cohort: cohort.to_sym}\n if students.count == 1\n puts \"Now we have #{students.count} student\"\n puts \"Please enter the name of the student\"\n puts \"To finish, just hit return twice\"\n elsif students.count > 1\n puts \"Now we have #{students.count} students\"\n puts \"Please enter the name of the student\"\n puts \"To finish, just hit return twice\"\n end\n # get another name from the user\n name = gets.chomp \n end\n # return the array of students\n students\nend", "title": "" }, { "docid": "e3f85b0177303e2834c7a078ade0875e", "score": "0.6333667", "text": "def cohort_params\n params.require(:cohort).permit(:name)\n end", "title": "" }, { "docid": "a08a4bd1ffe3ff9768e9d69e8f71d0e1", "score": "0.63136125", "text": "def get_input\n # gets the first name\n def get_name\n puts \"Please enter the name of the students.\"\n @name = gets.chomp\n end\n\n def get_cohort\n puts \"Please enter the cohort they will be joining.\"\n @cohort = gets.chomp\n end\n\n # Checks input\n def check\n if @name.empty?\n puts \"There's nothing here\"\n else\n puts \"#{@name} will be joining #{@cohort} cohort. Is this correct? Y/N\"\n @correct = gets.chomp\n if @correct == \"Y\" || @correct == \"y\"\n @students << {name: @name, cohort: @cohort}\n if @students.count < 2\n puts \"Now we have #{(@students.count)} student\"\n else\n puts \"Now we have #{(@students.count)} students\"\n end\n end\n end\n end\n\n #Checks if the user wants to continue\n def continue\n puts \"Would you like to enter another name? Y/N\"\n @cont = gets.chomp\n end\n\n #Ask the user for all relevant inputs and checks.\n get_name\n get_cohort\n check\n continue\n end", "title": "" }, { "docid": "d0a0a1727aee61f8ad7f61979522b4bb", "score": "0.6306187", "text": "def input_students\n puts 'Please enter the name of the student. Hit enter if no students'\n# create an empty array\n students = []\n# get the first name\n name = gets.chomp\n# get the month of the cohort\n puts 'Please enter the month of the cohort (first 3 letters)'\n cohort = gets.chomp.capitalize.to_sym\n# Checking the spelling\n# define the months to account for spelling error with user input\n months = [:Jan, :Feb, :Mar, :Apr, :May, :Jun, :Jul, :Aug, :Sep, :Oct, :Nov, :Dec]\n# If the cohort is not empty (i.e. user has inputtted) and the input is not in\n# the months array\n if !cohort.empty? && !months.include?(cohort)\n# keep asking and get the input but break when the input is correct\n loop do\n puts 'Incorrect spelling. Please enter the month of the cohort (first 3 letters)'\n cohort = gets.chomp.capitalize.to_sym\n break if months.include?(cohort)\n end #<- end for my loop\n end #<- end for my if that checks spelling\n# while the name is not empty, repeat this code\n while !name.empty? do\n#if the cohort is empty, add \"unknown\"\n if cohort.empty?\n cohort = :unknown\n end # <- the end to my if cohort empty\n# while the name is not empty, add the student hash to the array\n students << { name: name, cohort: cohort }\n# if only one student, singularize the puts statement\n if students.length == 1\n puts \"We have #{students.count} student\"\n else\n puts \"Now we have #{students.count} students\"\n end # <- this is the end for the if/else\n# get another name and cohort from the user\n puts 'Please enter the name of the student. Hit enter if no further students'\n name = gets.chomp\n# don't ask for the cohort if the name is empty here\n if name.empty?\n break\n end\n puts 'Please enter the month of the cohort (first 3 letters).'\n cohort = gets.chomp.capitalize.to_sym\n if !cohort.empty? && !months.include?(cohort)\n# keep asking and get the input but break when the input is correct\n loop do\n puts 'Incorrect spelling. Please enter the month of the cohort (first 3 letters)'\n cohort = gets.chomp.capitalize.to_sym\n break if months.include?(cohort)\n end #<- end for my loop\n end #<- end for my if that checks spelling\n end # <- this is the end for the while/do\n# return the array of students\n students\nend", "title": "" }, { "docid": "9765122bebf6687316dc88aba68b4a26", "score": "0.63008547", "text": "def cohort_print\n #this allows us to avoid printing an empty list if no students are added\n if @students.count > 0\n puts \"Select which cohort you would like to see: \".center(20)\n cohort = STDIN.gets.chomp.capitalize.to_sym\n counter = 0\n #will print out the students that match the requested cohort\n @students.each do |student|\n if @student[:cohort] == cohort\n puts \"#{counter + 1}. #{@students[counter][:name]} (#{@students[counter][:cohort]} cohort) Hobby: #{@students[counter][:hobbies]}\".center(20)\n counter =+ 1\n end\n end\n else\n puts \"No students were added, please re-run the program\".center(20)\n end\nend", "title": "" }, { "docid": "1da1e65b00cda0a9627360be1c229d56", "score": "0.6286714", "text": "def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n\n students = []\n\n name = gets.chomp\n\n while !name.empty? do\n \n puts \"What cohort are they part of?\"\n cohort = gets.chomp\n if cohort == \"\" \n cohort = \"november\"\n end\n students << {name: name, cohort: cohort.to_sym}\n puts \"Now we have #{students.count} students\"\n name = gets.chomp\n end\n\n students\nend", "title": "" }, { "docid": "25489885ef1eee9bbfc4c64033f5dd51", "score": "0.6273049", "text": "def input_students\n\tputs \"Please enter the name of student\"\n\tputs \"To finish, just hit return twice\"\n\tstudents =[]\n\tname = gets.chomp\n\tputs \"Please enter the cohort\"\n\tcohort = gets.chomp\n\tcohort_array = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n\n\twhile !name.empty? do\n\t\tcohort_exists = cohort_array.select {|month| month==cohort}\n\t\tif cohort.empty? || cohort_exists.empty?\n\t\t\tcohort = \"March\"\n\t\tend\n\t\t\n\t\tcohort = cohort.to_sym\n\t\tstudents << {:name => name, :cohort => cohort, :gender => :male}\n\t\tif students.length > 1\n\t\t\tputs \"Now we have #{students.length} students\"\n\t\telse \n\t\t\tputs \"Now we have #{students.length} student\"\n\t\tend\n\t\tputs \"Please enter the name of the student\"\n\t\tname = gets.chomp\n\t\tputs \"Please enter the cohort\"\n\t\tcohort = gets.chomp\n\n\tend\n\tstudents\nend", "title": "" }, { "docid": "8583869cf7f3b7fed7ac5e75ccc184ac", "score": "0.6272745", "text": "def input_students\n puts \"Please enter the names of the students and their corresponding cohort\"\n puts \"Please provide a name first, followed by their cohort\"\n puts \"To finish, just hit quit\"\n students = []\n name = gets.chomp\n cohort = gets.chomp\n while name != \"quit\" do\n # add the student hash to the array\n cohort = \"unknown\" if cohort.empty? \n name = \"unknown\" if name.empty?\n puts \"check your answer, type yes for correct, type no to redo\"\n puts \"name = #{name}, cohort = #{cohort}\"\n check = gets.chomp\n if check == \"yes\"\n students << {name: name, cohort: cohort.to_sym, age: :\"25\", hobbies: :tennis}\n if students.length == 1\n puts \"Now we have #{students.count} student\"\n else\n puts \"Now we have #{students.count} students\"\n end\n end\n name = gets.chomp\n cohort = gets.chomp\n end\n students\nend", "title": "" }, { "docid": "48b8620000d50c29dec49b5d4e03c48f", "score": "0.62711775", "text": "def input_students\n puts \"Please enter the names of the students: \"\n puts \"When you're done, type 'finish' and press enter.\"\n #create an empty array\n students = []\n print \"Name: \"\n name = gets.chomp\n if name == \"\"\n name = \"N/A\"\n end\n\n cohorts = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december']\n print \"Cohort: \"\n cohort = gets.chomp.downcase\n\n condition = true\n while condition\n if cohorts.include? cohort\n puts \"Adding #{name} the cohort #{cohort}.\"\n condition = false\n elsif cohort == \"\"\n cohort = \"N/A\"\n condition = false\n else\n print \"Please put in a cohort, make sure you spell it correctly :\"\n cohort = gets.chomp.downcase\n end\n end\n\n #while the name is not empty, repeat this code\n while name != \"finish\" do\n #add the student hash to the array\n students << {name: name, cohort: cohort.downcase.to_sym}\n puts \"Now we have #{students.count} students\"\n #get another name from the user\n print \"Name: \"\n name = gets.chomp\n if name == \"\"\n name = \"N/A\"\n end\n cohorts = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december']\n print \"Cohort: \"\n cohort = gets.chomp.downcase\n\n condition = true\n while condition\n if cohorts.include? cohort\n puts \"Adding #{name} to the cohort #{cohort}.\"\n condition = false\n elsif cohort == \"\"\n cohort = \"N/A\"\n condition = false\n else\n print \"Please put in a cohort, make sure you spell it correctly: \"\n cohort = gets.chomp.downcase\n end\n end\n end\n\n #return the array of students\n students\nend", "title": "" }, { "docid": "568086f7297bef0f086a282691d57226", "score": "0.6265842", "text": "def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n # get the first name\n name = $stdin.gets.strip\n # while the name is not empty, repeat this code\n while !name.empty? do\n # get user input about more information?\n puts \"Now enter the cohort of this student: \"\n # convert input from string to a symbol\n cohort = $stdin.gets.strip.downcase.to_sym\n # inputs to be expected\n cohorts = [:january, :february, :march, :april, :may, :june, :july, :august, :september, :october, :november, :december]\n # if input is empty give a default value\n if cohort.empty?\n cohort = :november\n # if cohort does not include any of the values listed in cohorts, try again until it does\n elsif !cohorts.include? cohort\n until cohorts.include? cohort\n puts \"Invalid cohort. Try again.\"\n cohort = $stdin.gets.strip.downcase.to_sym\n end\n end\n\n students << {name: name, cohort: cohort}\n number_students = students.count\n if number_students == 1\n puts \"Now we have #{students.count} student\"\n else\n puts \"Now we have #{students.count} great students\"\n end\n\n # get another name from the user\n puts \"Now enter another student's name (or press enter to finish)\"\n name = $stdin.gets.strip\n end\n # return the array of students\n students\n end", "title": "" }, { "docid": "b4ad05c1d6268c1b25615bea3005b746", "score": "0.6251492", "text": "def existing_cohorts(students)\n puts \"To print students by cohort, please type in corhot\"\n cohort_to_display = gets.strip\n\n to_return = []\n\n students.each do |student|\n student.each do |value|\n if student[:cohort] == cohort_to_display.downcase\n to_return << student[:name]\n end\n break\n end\n end\n puts to_return\nend", "title": "" }, { "docid": "71eec00b2f52a069c4dadc16145f7b0e", "score": "0.62379813", "text": "def input_students\n puts \"Please enter the names of the students: \"\n puts \"When you're done, type 'finish', followed by enter.\"\n #create an empty array\n students = []\n print \"Name: \"\n name = gets.chomp\n if name == \"\"\n name = \"N/A\"\n end\n\n cohorts = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december']\n print \"Cohort: \"\n cohort = gets.chomp.downcase\n\n condition = true\n while condition\n if cohorts.include? cohort\n puts \"Adding #{name} the cohort #{cohort}.\"\n condition = false\n elsif cohort == \"\"\n cohort = \"N/A\"\n condition = false\n else\n puts \"Please put in a cohort, make sure you spell it correctly!\"\n cohort = gets.chomp.downcase\n end\n end\n\n\n #while the name is not empty, repeat this code\n while name != \"finish\" do\n #add the student hash to the array\n students << {name: name, cohort: cohort.downcase.to_sym}\n puts \"Now we have #{students.count} students\"\n #get another name from the user\n print \"Name: \"\n name = gets.chomp\n if name == \"\"\n name = \"N/A\"\n end\n cohorts = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december']\n print \"Cohort: \"\n cohort = gets.chomp.downcase\n\n condition = true\n while condition\n if cohorts.include? cohort\n puts \"Adding #{name} to the cohort #{cohort}.\"\n condition = false\n elsif cohort == \"\"\n cohort = \"N/A\"\n condition = false\n else\n puts \"Please put in a cohort, make sure you spell it correctly!\"\n cohort = gets.chomp.downcase\n end\n end\n end\n\n #return the array of students\n students\nend", "title": "" }, { "docid": "90d136fef9cde2ee1be9b04d01cb3cbe", "score": "0.62308156", "text": "def input_students\n puts \"Please enter the names, hobbies, country of birth and height of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n name = gets.chomp # name stored in variable\n hobbies = gets.chomp\n country = gets.chomp\n height = gets.chomp\n while !name.empty? do # set up while loop\n # while the name is not empty, repeat this code\n # add the student hash to the array\n students << {name: name, cohort: :november, hobbies: hobbies, country: country, \n height: height\n }\n # name is the key and the second name is the variable to which the user's \n # input is saved \n # cohort is a key and :november is a value - but it is hardcoded - not interactive \n puts \"Now we have #{students.count} students\"\n # get another name from the user\n name = gets.chomp\n hobbies = gets.chomp\n country = gets.chomp\n height = gets.chomp\n end\n students # Print the students array - with their names and cohorts\nend", "title": "" }, { "docid": "5948c3f14d76b6c19f000a58133ebd92", "score": "0.6228854", "text": "def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n cohorts = ['January','February','March','April','May','June',\n 'July', 'August','September','October','November','December']\n # get the first name\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n students << {name: name, cohort: \"\"}\n puts \"Cohort?\"\n cohort = gets.chomp\n until cohorts.include?(cohort)\n cohort = gets.chomp\n end\n students[-1][:cohort] = cohort.to_sym\n puts \"Now we have #{students.count} students\"\n # get another name from the user\n name = gets.chomp\n end\n # return the array of students\n students\nend", "title": "" }, { "docid": "f956b5e291d626451ed9f73fff51cb47", "score": "0.62273777", "text": "def input_students\n students = []\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n name = gets.strip\n while !name.empty? do\n student = Student.new(name)\n students << student\n puts \"Which cohort is #{name} in?\"\n user_input = gets.strip\n # Student.cohorts.include?(user_input.to_sym) ? student.cohort = user_input : puts \"Please enter a valid cohort.\"\n until Student.cohorts.include?(user_input.downcase.to_sym) do\n break if user_input.empty?\n puts \"Please enter a valid cohort.\"\n user_input = gets.strip\n end\n student.cohort = user_input\n\n puts \"Now we have #{students.count} student#{pluralize(students.count)}\"\n name = gets.strip\n end\n if students.empty?\n puts \"Please enter at least one student\"\n input_students\n else\n @students = students\n students\n end\nend", "title": "" }, { "docid": "c3e56f1bf1d6b46371b495402c21d362", "score": "0.6222283", "text": "def input_cohort\n loop do\n puts \"Choosing cohort\"\n puts \"Choose candidate to assign cohort to:\"\n name = STDIN.gets.chomp\n puts \"Choose cohort for #{name}\"\n cohort = STDIN.gets.chomp\n @students.find do |student| \n if student[:name] == name \n student[:cohort] = cohort\n end\n end\n puts \"Do you wish to assing another? Y/N\"\n answer = STDIN.gets.chomp\n break if answer == \"N\" \n end\nend", "title": "" }, { "docid": "e31a76054ba959f21b97aa6e4325bffa", "score": "0.6177267", "text": "def input_students\n puts \"Please enter details of students\"\n puts \"To continue/complete hit return (twice to finish)\"\n # create an empty array\n students = []\n #get the first name\n puts \"Full name:\"\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n puts \"Cohort (month starting on site):\"\n input = gets.chomp.downcase\n month = select_cohort(input)\n puts \"Gender (M/F/N):\"\n gender = gets.chomp\n puts \"Country of birth:\"\n country = gets.chomp\n puts \"Hobbies (separate with ,):\"\n hobbies = gets.chomp.strip.split(\",\"||\", \")\n #add the student hash to the array\n students << {name: name, gender: gender, country: country, hobbies: hobbies, cohort: month}\n puts \"Now we have #{students.count} students\"\n # get another name from the user\n puts \"Full name:\"\n name = gets.chomp\n end\n #return the array of students\n students\nend", "title": "" }, { "docid": "136468f3c3a5652f45347612c95d3e1e", "score": "0.61761314", "text": "def view_a_cohort(academy)\n include Formatting\n include Validation\n puts long_bar\n puts \" \"\n puts \"Which cohort would you like to view? ( \".bold.blue + \"enter a month\" + \" )\".bold.blue\n puts \"(press return to go back to menu)\".italic\n # puts list of cohorts to choose from\n academy.list_cohort_months\n print \"Enter a month\".yellow, \": \"\n cohort_choice = STDIN.gets.chomp.capitalize\n if cohort_choice != \"\" # main menu if user presses return\n until academy.existing_cohorts.include?(cohort_choice.capitalize)\n puts \"----\"\n puts \"Invalid entry.\".italic.red\n puts \"Please enter an existing cohort month\".blue\n puts \"(press return to go back to menu)\".italic\n academy.list_cohort_months\n print \"Enter a month\".yellow, \": \"\n cohort_choice = STDIN.gets.chomp.capitalize\n return if cohort_choice == \"\" # main menu if user presses return\n end\n puts long_bar\n puts \" \"\n puts (\"Displaying #{ cohort_choice } cohort..\").italic.blue\n puts academy.cohorts.select { |cohort| cohort.roster if cohort.month == cohort_choice }\n end\nend", "title": "" }, { "docid": "f29fd67dcdd30ff86a982e5bbe73f4c1", "score": "0.6174703", "text": "def existing_cohorts\n puts \"To print students by cohort, please type in corhot\"\n cohort_to_display = gets.strip\n\n to_return = []\n\n @students.each do |student|\n student.each do |value|\n if student[:cohort] == cohort_to_display.downcase\n to_return << student[:name]\n end\n break\n end\n end\n puts to_return\nend", "title": "" }, { "docid": "5572a6a7add36e8fdeff54e78a7ca7c6", "score": "0.6171144", "text": "def input_students_typofix\n\tputs \"Please enter the first name of the students(s)\"\n\t#create an empty array\n\tstudents = []\n\t#get the first name\n\tname = gets.chomp\n\t#while the name is not empty prompt for other info and repeat proccess\n\twhile !name.empty? do\n\t\t#prompt for age\n\t\tputs \"Please enter the age of the students(s)\"\n\t\tage=gets.chomp\n\n\t\t#prompt for cohort\n\t\tputs \"Please enter the cohort of the students(s)\"\n\t\tcohort = gets.chomp\n\n\t\tcase cohort.downcase.chars[0]\n\t\t\twhen \"f\" then cohort=\"Feb\"\n\t\t\twhen \"m\" then cohort=\"Mar\"\n\t\t\telse cohort=\"[-]\"\n\t\tend\n\t\n\t\t# add the student data hash to the array\n\t\tstudents << {name: name, age: age, cohort: cohort}\n\t\tputs \"Now we have #{students.length} students\"\n\t\t# get another name from the user\n\t\tputs \"Please enter the next name of the students(s), or hit enter to finish\"\t\t\n\t\tname = gets.chomp\n\tend\n\t# return the array of students\n\tstudents\nend", "title": "" }, { "docid": "97198a328012e91d8ef42e667ccd3a2b", "score": "0.6166339", "text": "def input_students\n # Months array for the cohorts\n months = [\"january\",\"february\",\"march\",\"april\",\"may\",\"june\",\"july\",\"august\",\"september\",\"october\",\"november\",\"december\"]\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n cohort = \"\"\n # get the first name\n name = STDIN.gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # ask for cohort while user inputs correct input\n while !months.include? cohort\n puts \"Enter cohort: \"\n cohort = gets.downcase.chomp\n end\n # convert a string into symbol\n cohort = cohort.to_sym\n # Get mmore info about the student\n # puts \"Enter hobbies: \"\n # hobbies = gets.chomp\n # puts \"Enter your country of birth: \"\n # country = gets.chomp\n # puts \"Enter your mother language: \"\n # language = gets.chomp\n # add the student hash to the array\n # @students << {name: name, cohort: cohort, hobbies: hobbies, country: country, language: language }\n add_student(name, cohort)\n # Use singular form when appropriate and plural form otherwise\n if @students.count == 1\n puts \"Now we have #{@students.count} student\"\n else\n puts \"Now we have #{@students.count} students\"\n end\n # get another name from the user\n puts \"Enter a name or hit return to finnish.\"\n name = STDIN.gets.chomp\n end\nend", "title": "" }, { "docid": "f67b6e4cf1909bf04529367fe40166f9", "score": "0.6135243", "text": "def input_students\n students = []\n months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n \n while true\n puts \"Please enter the name of the student\"\n name = gets.strip\n puts \"Please enter the cohort month\"\n input = gets.strip.capitalize\n cohort = input.length > 0 ? input : \"November\"\n while !months.include?(cohort)\n puts \"Enter a valid month\"\n cohort = gets.strip.capitalize\n end\n students << {name: name, cohort: cohort.to_sym}\n puts \"Now we have #{students.count} students\" if students.count > 1\n puts \"Now we have #{students.count} student\" if students.count == 0\n puts \"Would you like to enter another student? (y/n)\"\n choice = gets.strip\n break if choice == \"n\"\n end\n\n students\nend", "title": "" }, { "docid": "cbaa40a69f67034f2fbdb8841bbf0e69", "score": "0.6128394", "text": "def input_students\n students = []\n months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\n \n while true\n puts \"Please enter the name of the student\"\n name = gets.chomp\n puts \"Please enter the cohort month\"\n input = gets.chomp.capitalize\n cohort = input.length > 0 ? input : \"November\"\n while !months.include?(cohort)\n puts \"Enter a valid month\"\n cohort = gets.chomp.capitalize\n end\n students << {name: name, cohort: cohort.to_sym}\n puts \"Now we have #{students.count} students\" if students.count > 1\n puts \"Now we have #{students.count} student\" if students.count == 0\n puts \"Would you like to enter another student? (y/n)\"\n choice = gets.chomp\n break if choice == \"n\"\n end\n\n students\nend", "title": "" }, { "docid": "8ce28c04dc5335241f0196b0b516c090", "score": "0.6121088", "text": "def save_and_name_cohort(cohort)\n click_save_cohort_button_one\n name_cohort cohort\n end", "title": "" }, { "docid": "e3c06de70d2b1e3c2f93f9d1c111cbe6", "score": "0.611697", "text": "def input_students\n puts \"Please enter the names of the student\"\n # get the first name\n name = gets.chomp\n puts \"Please enter the cohort of the student\"\n #get the cohort\n cohort = gets.chomp\n #create an empty array\n students = []\n puts \"To finish, just hit return when the student's name is asked\"\n # while the name is not empty, repeat this code\n while !name.empty? do\n cohort = cohort_check(cohort) # november will be assigned if nothing entered\n # add the student hash to the array\n students << {name: name, cohort: cohort.to_sym}\n puts \"Now we have #{students.count} students\"\n # get another name from the user\n puts \"Please enter the next student's name\"\n name = gets.chomp\n break if name.empty?\n puts \"Please enter the student's cohort\"\n cohort = gets.chomp\n end\n #return the array of students\n students\nend", "title": "" }, { "docid": "dee0061a7f685afa3750c41b44e57cfe", "score": "0.61088204", "text": "def get_perhiperal_name(raw_name)\n default = get_perhiperal_default_name(raw_name)\n\n print \"Name for \\\"#{raw_name}\\\" (Default #{default}): \"; input = gets.strip\n input == '' ? default : input\nend", "title": "" }, { "docid": "61e15a771c1fe06610e9c1fa8e3c4e56", "score": "0.61077505", "text": "def input_instructions\n puts \"Please enter student name to add and hit return.\"\n puts \"Then, enter that student's cohort month and hit return, or leave it blank and press return to default to current cohort.\"\n puts \"To finish, simply hit return without adding text.\"\nend", "title": "" }, { "docid": "849622c2b3d88223aecee74b960a8b4c", "score": "0.6106574", "text": "def input_students\n puts \"Please enter the name and cohort of each student\"\n puts \"To finish, just hit return twice\"\n while !get_student_name.empty?\n get_student_cohort\n add_student(@student_name, @student_cohort, \"count\")\n end\nend", "title": "" }, { "docid": "fdb49b539e1fa3b398d02bd6f3480c2a", "score": "0.6090576", "text": "def display_grouped_by_cohorts\n#Create new students list grouped by the cohorts\n cohorts_list = {}\n \n @students.each do |student|\n cohort = student[:cohort]\n name = student[:name]\n\n if cohorts_list[cohort] == nil\n cohorts_list[cohort] = [name]\n else \n cohorts_list[cohort] << name\n end\n end\n# Ask user which cohort students he would like to see \n puts \"Which cohort students do you want to print?\"\n user_input = gets.chomp\n# Iterate through cohort list grouped by the cohort and print only students that user wants to see \n cohorts_list.each do |key, value| \n puts value if user_input.downcase== key.to_s\n end\nend", "title": "" }, { "docid": "1b82accbef9a471191d0cfdee6c7e627", "score": "0.6087015", "text": "def input_students\n t = Time.now\n current_month = t.strftime(\"%B\") # gets the current month in text form\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # gets the name from the user\n name = STDIN.gets.chomp\n # whilst name is not empty, repeat this code\n while !name.empty? do\n puts \"Please input their cohort\"\n cohort = STDIN.gets.chomp\n if !cohort.empty?\n @students << {name: name, cohort: cohort}\n else\n @students << {name: name, cohort: current_month}\n end\n puts \"Now we have #{@students.count} student(s).\"\n # gets another name from the user\n name = STDIN.gets.chomp\n end\nend", "title": "" }, { "docid": "0a7df94e4c871163383a8ab32dba72ed", "score": "0.6076116", "text": "def input_students\n students = []\n\n \n # the prock will ask you to \"Please enter the #{argument}\"\n # call the prock\n puts \"Please enter the names, country of birth and hobbies of each student\"\n puts \"Strat with there name.\"\n puts \"To finish, just hit return a number of times\"\n # create an empty array\n \n #get the first name\n name = gets.chomp\n puts \"Please enter the students cohort\"\n cohort = gets.rstrip\n puts \"Add the students country of birth\"\n birth = gets.chomp\n puts \"Add the students hobbie\"\n hobbie = gets.chomp\n \n \n #while the name is not empty, repeat this code\n while !name.empty? do\n #add the students hash to the array\n if cohort.empty?\n cohort = \"Unspecified\".to_sym\n end\n students << {name: name, cohort: cohort, country: birth, hobbie: hobbie}\n \n puts \"Please enter the next students details starting with their name\"\n name = gets.chomp\n puts \"Please enter the students cohort\"\n cohort = gets.chomp.to_sym\n puts \"Add the students country of birth\"\n birth = gets.chomp\n puts \"Add the students hobbie\"\n hobbie = gets.chomp\n puts \"Now we have #{students.count} students\"\n #get another name from the user\n \n end\n # return the array of students\n students\nend", "title": "" }, { "docid": "3f0fe320a16bdff1858c1e3fd5aa77a8", "score": "0.6069798", "text": "def confirm_info(name, cohort)\n puts \"Name: [#{name}], Cohort: [#{cohort}]\"\n puts \"Yes => 1, No => 2\"\nend", "title": "" }, { "docid": "0303b9c5383834372f5d2b8d6b2bccb6", "score": "0.60579705", "text": "def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n months = [\n 'january', 'february', 'march', 'april', 'may', 'june',\n 'july', 'august', 'september', 'october', 'november', 'december'\n ]\n # get the first name\n name = gets.chomp\n puts \"what is the cohort? \"\n cohort = gets.chomp\n if cohort.empty? or not months.include? cohort.to_s\n current_month = Date.today.strftime(\"%m\") \n cohort = months[current_month.to_i - 1].to_sym\n end \n while !name.empty? do\n # add student hash into an array\n students << {name: name, cohort: cohort}\n puts \"Now we have #{students.count} students, enter another name :\"\n\n # get another name from the user\n name = gets.chomp\n puts \"what is the cohort? \"\n cohort = gets.chomp\n if cohort.empty? or not months.include? cohort.to_s\n current_month = Date.today.strftime(\"%m\") \n cohort = months[current_month.to_i - 1].to_sym\n end \n end\n\n return students\nend", "title": "" }, { "docid": "29211784c280e96832df85ebdbec14ac", "score": "0.6055098", "text": "def print_by_cohort\n students_by_cohort = {}\n @students.each do |student|\n cohort = student[:cohort]\n name = student[:name]\n if students_by_cohort[cohort] == nil\n students_by_cohort[cohort] = []\n end\n students_by_cohort[cohort].push(name)\n end\n loop do \n puts \"Choose cohort to display. Say stop to exit\"\n choice = STDIN.gets.chomp\n break if choice == \"stop\"\n puts students_by_cohort[choice].join(', ')\n end\nend", "title": "" }, { "docid": "f0ccb34e77b49534f97d86b3ec02819d", "score": "0.60516405", "text": "def input_students\n puts \"Please enter the names of the student, followed by their cohort\"\n puts \"To finish, just hit return twice\"\n # get the first person's name\n name = STDIN.gets.chomp\n # get that person's cohort\n cohort = STDIN.gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student's name, chort and random country to the array as a hash\n @students << {name: name, cohort: cohort, country: random_country}\n # if there is only 1 student, handle output to reflect the correct plural cases\n if @students.length < 2\n puts \"Now we have #{@students.count} student\"\n else\n puts \"Now we have #{@students.count} students\"\n end\n # get another person's name & their cohort from the user\n name = STDIN.gets.chomp\n cohort = STDIN.gets.chomp\n end\n # return the updated array of students\n @students\nend", "title": "" }, { "docid": "6cf83c61c3483a6dc0e28cbea932c77e", "score": "0.6046908", "text": "def input_students\n puts \"Please enter the names and cohorts of the students\"\n puts \"To finish, just hit return three times\"\n students = []\n name = gets.chomp\n cohort = gets.chomp\n i = 0\n while !name.empty? || !cohort.empty? do\n i += 1\n if name.empty?\n name = \"student number #{i}\"\n end\n if cohort.empty?\n cohort = \"november\"\n end\n students << {name: name.to_sym, cohort: cohort.to_sym}\n puts \"Now we have #{students.count} students\"\n name = gets.chomp\n cohort = gets.chomp\n end\n students\nend", "title": "" }, { "docid": "6cf83c61c3483a6dc0e28cbea932c77e", "score": "0.6046908", "text": "def input_students\n puts \"Please enter the names and cohorts of the students\"\n puts \"To finish, just hit return three times\"\n students = []\n name = gets.chomp\n cohort = gets.chomp\n i = 0\n while !name.empty? || !cohort.empty? do\n i += 1\n if name.empty?\n name = \"student number #{i}\"\n end\n if cohort.empty?\n cohort = \"november\"\n end\n students << {name: name.to_sym, cohort: cohort.to_sym}\n puts \"Now we have #{students.count} students\"\n name = gets.chomp\n cohort = gets.chomp\n end\n students\nend", "title": "" }, { "docid": "f87905360603d129449e9549212431c9", "score": "0.60353434", "text": "def input_students \n\tputs \"Please enter the names of the students and their cohorts (default is #{@default_cohort}).\\nTo finish, just hit return two times.\"\n\t#get the first name\n\tprint \"Student name? \"\n\tname = STDIN.gets.chomp\n\tprint \"Student cohort month? (Usage: January or Jan, etc.)? \" \n\tcohort = validate(STDIN.gets.chomp)\n\n\t#while name and cohort are both not empty repeat\n\twhile !name.empty? do\n\t\t#add student hash to the array\n\t\tadd_students(name, cohort)\n\t\tputs \"Now, we have #{@students.length} student\" + (@students.length == 1 ? \"\" : \"s\") \n\t\t#get another name/cohort from user\n\t\tprint \"Student name? \"\n\t\tname = STDIN.gets.chomp\n\t\tprint \"Student cohort? \"\n\t\tcohort = validate(STDIN.gets.chomp)\n\tend\n\t# sort the hash\n\t@students.sort_by!{|hash| hash[:name] }\n\nend", "title": "" }, { "docid": "6711629be6086adadceeb3546968be96", "score": "0.60276294", "text": "def add_student_info(name = :Anon_, cohort = :November) #problem - works if I explicitly call the method without any arguments but not sure the defaults works in the context of calling the method within input_students\n @students << {name: name, cohort: cohort}\nend", "title": "" }, { "docid": "ba16473b5cee67e573d83f2dec5b6e42", "score": "0.6023242", "text": "def input_students\n puts \"Please enter the names of the students\"\n name = gets.chomp\n puts \"Please enter the month of entry\"\n cohort = gets.chomp\n cohort =\"january\" if cohort.empty?\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n print \"Name: \"\n name = gets.chomp\n if name == \"\"\n name = \"N/A\"\n end\n # get the first name\n\n\n # while the name is not empty, repeat this code\n while !name.empty? do\n # add the student hash to the array\n students << {name: name, cohort: cohort}\n puts \"Now we have #{students.count} students\"\n # get another name from the user\n name = gets.chomp\n end\n # return the array of students\n students\nend", "title": "" }, { "docid": "3d62efcacdbeafd686689271b8221237", "score": "0.60166794", "text": "def student_input(students)\n\tputs \"Please enter the name of the first student and press RETURN\"\n\tputs \"or press RETURN to exit\"\n\tname = gets.chomp.capitalize\n\t\twhile !name.empty?\n\t\t\tputs \"Please enter the cohort month\"\n\t\t\tcohort = gets.chomp.capitalize.to_sym\n\t\t\t\tif cohort.empty?\n\t\t\t\t\t\tcohort = :June\n\t\t\t\tend \n\t\t\tputs \"Please enter student's nationality\"\n\t\t\tnationality = gets.chomp\n\n\t\t\tstudents << { name: name, cohort: cohort, nationality: nationality}\n\n\t\t\tstudent_tally(students)\n\n\t\t\tputs \"Please enter name of next student and press RETURN to continue, or press RETURN to exit\"\n\t\t\tname = gets.chomp.capitalize\n\t\tend\n\t\tstudents\nend", "title": "" }, { "docid": "03aae88d65e6eb301efb93114abca0a4", "score": "0.60145605", "text": "def input_hobby\n# ask user to input their fav hobbu\n puts \"What is your favourite hobby?\".center(65)\n hobby = gets.chomp.to_sym.capitalize\n if !hobby.empty?\n hobby\n elsif hobby.empty?\n \"Please enter a hobby\".center(65)\n hobby = gets.chomp.to_sym.capitalize\n end\nhobby\nend", "title": "" }, { "docid": "f51a52f9f13340edb3457eca52006f94", "score": "0.60033816", "text": "def create_cohort\n fill_in 'Name', with: 'Rails'\n select 'Moon', from: 'Campus'\n select instructor.name, from: 'Instructor'\n\n click_button 'Create Cohort'\n end", "title": "" }, { "docid": "bea7ae6a1868df4208b19ebf6dabbe30", "score": "0.60009414", "text": "def cohort_params\n params.require(:cohort).permit(:campus_id, :course_id, :banner_x, :banner_y, :banner, :name, :begins_at, :ends_at, :github_repo)\n end", "title": "" }, { "docid": "f5b0b3261812d269e39950e9e5c2e168", "score": "0.60001284", "text": "def input_students\n puts \"To finish, just hit return twice\"\n puts \"Please enter the names of the students\"\n puts \"Name:\"\n #get the first name\n #remove the white space at the end of the line\n name = STDIN.gets.chomp\n\n #while the name is not empty, repeat this code\n while valid_name?(name) do\n puts \"Cohort:\"\n cohort = STDIN.gets.chomp\n #validate cohort input if it's empty or not match with the existing cohort (considered it as typo)\n #, print out Typo to let the user know\n if (cohort.to_s.empty?) || (@months.select{|m| m.downcase == cohort.downcase}.empty?) == true\n puts \"Typo\"\n else\n #add the student hash to the array\n add_student(name,cohort)\n if @students.length == 1\n puts \"Now we have #{@students.count} student\"\n else\n puts \"Now we have #{@students.count} students\"\n end\n #get another name from the user\n puts \"Name:\"\n name = STDIN.gets.chomp\n end\n end\nend", "title": "" }, { "docid": "daa5cf3e1dbe931290c00fdeca5d49a1", "score": "0.59844774", "text": "def cohorts(month)\n return month if month\n return \"alumni\" if !month\nend", "title": "" }, { "docid": "54ff045735bba762e32dcffb5e901891", "score": "0.59798855", "text": "def input_students\n puts \"Please input student names\"\n puts \"To exit press return twice\" \n students = []\n name = gets.chop\n until name.empty?\n students << {name: name, cohort: :november}\n puts \"We now have #{students.length} students.\"\n name = gets.chomp\n end\n students\nend", "title": "" }, { "docid": "b10899d3e344cca3baac6d6267fe8867", "score": "0.59760845", "text": "def input_students \n # create empty array\n students = []\n center_puts \"Please follow the instructions. When you're done, hit return twice\"\n center_puts \"Please enter a student's name\"\n # get the first name\n name = gets.strip.capitalize\n while !name.empty? do\n # get cohort\n# EXERCISE 7: add input method for cohort (some additional functionality still missing, e.g. misspelled months etc.)\n center_puts \"Which cohort (month) is this student in?\"\n cohort = gets.chomp.strip.capitalize.to_sym\n if cohort.empty?\n cohort = \"July\"\n end\n # get hobbies\n center_puts \"Please enter student's hobby\"\n hobby = gets.chomp.strip.downcase\n # get CoB\n center_puts \"What is the student's country of birth?\"\n country = gets.chomp.strip\n # while name is not empty, repeat this code\n # add student hash to array\n students << {name: name, hobby: hobby, country: country, cohort: cohort}\n # EXERCISE 9: use singular \"student\" if there is only one peron on list\n if students.count == 1\n center_puts \"Now we have #{students.count} student\"\n else\n center_puts \"Now we have #{students.count} students\"\n end\n # get another name from user\n center_puts \"Please enter another student's name, or just hit return to end the list:\"\n name = gets.chomp.strip.capitalize\n if name.empty?\n break\n end\n end\n # return array of students\n students\nend", "title": "" }, { "docid": "33c3b3c26c45e41508f598f42ab812f6", "score": "0.5975386", "text": "def create_a_cohort(academy)\n include Formatting\n include Validation\n puts long_bar\n puts \" \"\n puts \"Creating a new cohort..\".italic.blue\n puts \"Enter a valid month to create a new cohort.\".bold.blue\n puts \"(press return to go back to menu)\".italic\n puts \"Existing cohorts:\".bold.blue\n academy.list_cohort_months\n print \"New cohort\".yellow, \": \"\n new_month = STDIN.gets.chomp\n if new_month != \"\" # else to menu\n # check if entry is a valid month (Validation mixin) \n # and if cohort already exists\n until actual_months.include?(new_month.downcase.to_sym) && \n !academy.existing_cohorts.include?(new_month.capitalize)\n if academy.existing_cohorts.include?(new_month.capitalize)\n puts \"----\"\n puts \"A \".blue + \"#{ new_month.capitalize }\".bold.blue + \" Cohort already exists\".blue\n puts \"Enter a different month to create a new Cohort\".blue\n puts \"(press return to go back to menu)\".italic\n print \"Enter a month\".yellow, \": \"\n new_month = STDIN.gets.chomp\n return if new_month == \"\" # else to menu\n else\n puts \"----\"\n puts \"Invalid month.\".italic.red\n puts \"Enter a valid month to create a new Cohort\".blue\n puts \"(press return to go back to menu)\".italic\n print \"Enter a month\".yellow, \": \"\n new_month = STDIN.gets.chomp\n return if new_month == \"\" # else to menu\n end\n end\n if new_month != \"\" # else to menu\n puts long_bar\n puts \" \"\n # create new cohort and add it to the academy\n new_cohort = Cohort.new(new_month.capitalize)\n academy.add_cohort(new_cohort) # capitalizes within the method\n puts \"Done.\".italic.blue\n puts \"Existing cohorts:\".italic.blue\n # resorts all cohorts before displaying, permanent sorting\n academy.resort_cohorts_by_month\n academy.list_cohort_months\n puts \" \"\n end\n end\nend", "title": "" }, { "docid": "dcb6274b37ac0763bb60422df6d4d755", "score": "0.59742707", "text": "def student_input\n\tputs \"Please enter the name of the first student and press RETURN\"\n\tputs \"or press RETURN to exit\"\n\tname = STDIN.gets.chomp.capitalize\n\t\twhile !name.empty?\n\t\t\tputs \"Please enter the cohort month\"\n\t\t\tcohort = STDIN.gets.chomp.capitalize.to_sym\n\t\t\t\tif cohort.empty?\n\t\t\t\t\t\tcohort = :June\n\t\t\t\tend \n\t\t\tputs \"Please enter student's nationality\"\n\t\t\tnationality = STDIN.gets.chomp\n\n\t\t\tadd_student(name,cohort,nationality)\n\n\t\t\tstudent_tally\n\n\t\t\tputs \"Please enter name of next student and press RETURN to continue, or press RETURN to exit\"\n\t\t\tname = STDIN.gets.chomp.capitalize\n\t\tend\n\t\t@students\nend", "title": "" }, { "docid": "19e7a3d8624ad43b5abbc71cee818ebb", "score": "0.59679735", "text": "def cohort_sort\n\tputs \"which cohort?\"\n\tcohort = ''\n\tuntil @months.include?(cohort)\n\t\tcohort = STDIN.gets.chomp\n\tend\n\t@students.select! {|student| student[:cohort] == cohort.to_sym } \nend", "title": "" }, { "docid": "5eedc39358af56416cc177e9f9b08268", "score": "0.59658366", "text": "def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n # create an empty array\n students = []\n name = gets.chomp\n # while the name is not empty, repeat this code\n while !name.empty? do\n\ncohort_count = 0\n puts \"Which cohort is this person in? Input the month\"\n cohort1 = gets.chomp\n if cohort1 =~ /^[0-9]/\n puts \"Please input the month name\"\n cohort1 = gets.chomp.to_sym\n else\n cohort1 = cohort1.to_sym\n end\n\n puts \"Let me know this student's hobby\"\n hobby = gets.chomp.to_sym\n if hobby.empty?\n hobby = (\"Calcio\").to_sym\n end\n\n puts \"What is this student's country of birth?\"\n country_of_birth = gets.chomp\n\n puts \"What is the student's height?\"\n height1 = gets.chomp\n #add the student hash to the array\n students << {name: name, cohort: cohort1, hobbies: hobby, birth: country_of_birth, height: height1}\n puts \"Now we have #{students.count} students\"\n\n puts \"Please enter the name of the next student\"\n name = gets.chomp\n\n end\n students\nend", "title": "" }, { "docid": "335cb134a4075bde9e14b93d9a2f12a7", "score": "0.5955645", "text": "def input_students\n puts \"Please enter the name of the students.\"\n puts \"To finish, just press \\\"return\\\" twice (or once if you don't want to add any students ;))\"\n #now we start getting the list of students from the user asking for the first name\n #we are using the method delete to delete the return character at the end of user's input\n name= STDIN.gets.delete(\"\\n\")\n #we use a loop to collect all names until the input is empty\n while !(name.empty?)\n #first we ask for the cohort\n puts \"Which cohort does #{name} come from?\"\n cohort=STDIN.gets.chomp\n #now we check if that cohort exists in our compiled hash of cohorts, if not, we keep asking for a cohort until it does\n while !(@cohort_list.has_value?(cohort.downcase))\n puts \"Oops, we cannot recognize that cohort, do you want to try again?\"\n cohort=STDIN.gets.chomp\n end\n #now we add the inputted name to the array via a hash (together with a cohort, hobbies and country)\n add_student_info(name,cohort)\n #then we say how many students we now have\n if @students.count==1\n puts \"Now we have #{@students.count} student.\"\n else\n puts \"Now we have #{@students.count} students.\"\n end\n #we then ask for a new student name from the user and change the variable name restarting the loop\n name=STDIN.gets.chomp\n end\nend", "title": "" }, { "docid": "8fa365413e994f4ade5d640a9a20f755", "score": "0.5953341", "text": "def cohort_params\n\n \n \n \n params.require(:cohort).permit(:name, :start_date, :end_date, :course_id, :instructor_id)\n end", "title": "" }, { "docid": "502566976e8e536907298368c87e70b8", "score": "0.5944267", "text": "def input_students\n puts \"Please enter the names of the students\"\n puts \"To finish, just hit return twice\"\n students = []\n name = gets.chomp\n\n#7. adding in more details such as the country etc. (1 example)\n while !name.empty? do\n puts \"What country are they from?\"\n country = $stdin.gets.chomp\n students << {name: name, country: country , cohort: :October}\n puts \"Now we have #{students.count} students\"\n puts \"Add more students or press ENTER to print out the whole list\"\n # get another name from the user\n name = gets.chomp\n end\n students\nend", "title": "" }, { "docid": "91f8e1c1d0a4fb93b43cd844995a6043", "score": "0.59296465", "text": "def specific_letter(students)\n puts \"Please indicate the first letter of the name you wish to see.\"\n answer = gets.chomp.capitalize\n students.select {|student| puts \"#{student[:name]} (#{student[:cohort]} cohort)\" if student[:name].split(\"\").shift == answer }\nend", "title": "" }, { "docid": "7a4f10e25c7cb999e06433c26cc6cd42", "score": "0.5926271", "text": "def cohort_validation(month)\n checks = [\"January\", \"February\",\"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\",\n \"December\", \"\"]\n until checks.include?(month) == true\n puts \"Please enter a valid month\"\n month = STDIN.gets.delete!(\"\\n\").capitalize\n end\n month\nend", "title": "" }, { "docid": "706812eda4713625c6bd307602950ddc", "score": "0.5909169", "text": "def cohort_params\n params.require(:cohort).permit(:name, :start_date, :end_date, :instructor_id, :course_id)\n end", "title": "" } ]
208c4fafab380471d5eb461e8bb6ffb9
apply coupon to the cart, adds a new key, value pair to the cart hash called 'ITEM NAME W/COUPON' adds the coupon price to the property hash of couponed item adds the count number to the property hash of couponed item removes the number of discounted items from the original item's count remembers if the item was on clearance accounts for when there are more items than the coupon allows doesn't break if the coupon doesn't apply to any items
[ { "docid": "08568b8d26083c19341c2d87128def57", "score": "0.82815135", "text": "def apply_coupons(cart, coupons)\n cart = cart.dup\n coupons.each do |coupon|\n item = coupon[:item]\n #cart[item]=if item in cart matches coupon item\n if cart[item] && (cart[item][:count] >=coupon[:num])#amount in cart >= coupon limit\n cart[item][:count] -= coupon[:num] #remove discount items from cart\n unless cart[\"#{item} W/COUPON\"] # create a coupon if none exists, this {}:\n cart[\"#{item} W/COUPON\"] = {:price => coupon[:cost],\n :clearance => cart[item][:clearance],\n :count => 1}\n else\n cart[\"#{item} W/COUPON\"][:count] += 1 #increase :count if num items > coupon limit\n end\n end\n end\n cart\nend", "title": "" } ]
[ { "docid": "13ec123086e5bd19104f6e1f54bc8388", "score": "0.83677256", "text": "def apply_coupons(cart, coupons)\n coupons.each do |coupon|\n if cart.keys.include? coupon[:item]\n if cart[coupon[:item]][:count] >= coupon[:num]\n new_name = \"#{coupon[:item]} W/COUPON\"\n if cart[new_name]\n cart[new_name][:count] += coupon[:num] \n else\n cart[new_name] = {\n count: coupon[:num], \n price: coupon[:cost]/coupon[:num],\n clearance: cart[coupon[:item]][:clearance] } \n end\n cart[coupon[:item]][:count] -= coupon[:num]\n end\n end\n end\n \n cart\n end", "title": "" }, { "docid": "60e338bc864db13c61e294169f28cfe0", "score": "0.8278383", "text": "def apply_coupons(cart, coupons)\n coupons.each do |coupon|\n coupon_item = coupon[:item]\n if cart[coupon_item]\n if coupon[:num] <= cart[coupon_item][:count] &&\n !cart.has_key?(\"#{coupon_item} W/COUPON\")\n \n cart[\"#{coupon_item} W/COUPON\"] = {\n :price => (coupon[:cost] / coupon[:num]),\n :clearance => cart[coupon_item][:clearance],\n :count => coupon[:num]\n }\n cart[coupon_item][:count] -= coupon[:num]\n \n elsif coupon[:num] <= cart[coupon_item][:count] &&\n cart.has_key?(\"#{coupon_item} W/COUPON\")\n \n cart[\"#{coupon_item} W/COUPON\"][:count] += coupon[:num]\n cart[coupon_item][:count] -= coupon[:num]\n \n end\n end\n end\n cart\nend", "title": "" }, { "docid": "93aa82cb0563f728afdafb1418408ea8", "score": "0.8257431", "text": "def apply_coupons(cart, coupons)\n coupons.each do |coupon|\n item = coupon[:item]\n if cart.has_key?(item)\n if cart[item][:count] >= coupon[:num] && !cart.has_key?(\"#{item} W/COUPON\")\n cart[\"#{item} W/COUPON\"] = {price: coupon[:cost] / coupon[:num], clearance: cart[item][:clearance], count: coupon[:num]}\n cart[item][:count] -= coupon[:num]\n elsif cart[item][:count] >= coupon[:num] && cart.has_key?(\"#{item} W/COUPON\")\n cart[\"#{item} W/COUPON\"][:count] += coupon[:num]\n cart[item][:count] -= coupon[:num]\n end \n end\n end\n cart\nend", "title": "" }, { "docid": "a44ff1860d1c46e7a25ec1544f0ade07", "score": "0.82219696", "text": "def apply_coupons(cart, coupons)\n \n #iterate through the coupons\n coupons.each do |coupon|\n \n #create variable - item - which has the value of the item: key in the coupon\n item = coupon[:item]\n \n #look up item in cart and check if it is enough (or more than enough) for the coupon to be valid\n if cart[item] && cart[item][:count] >= coupon[:num] \n \n #check if coupon has already been applied (or multiple coupons)\n if cart[\"#{item} W/COUPON\"]\n cart[\"#{item} W/COUPON\"][:count] += coupon[:num]\n\n else \n cart[\"#{item} W/COUPON\"] = { \n price: coupon[:cost] / coupon[:num],\n clearance: cart[item][:clearance],\n count: coupon[:num]\n }\n end\n cart[item][:count] -= coupon[:num]\n end\n end\n cart\nend", "title": "" }, { "docid": "b51208edbc27d44d99b975485641b9b6", "score": "0.8091008", "text": "def apply_coupons(cart, coupons)\ncoupons.each do |coupon|\n name = coupon[:item]\n if cart[name] && coupon[:num] <= cart[name][:count]\n if cart[\"#{name} W/COUPON\"]\n cart[\"#{name} W/COUPON\"][:count] += 1\n else \n cart[\"#{name} W/COUPON\"] = {count: 1, price: coupon[:cost], clearance: cart[name][:clearance]} \n end \n cart[name][:count] -= coupon[:num]\n end\nend\ncart\nend", "title": "" }, { "docid": "adf6d2b5482b0b5e8584e883727490d3", "score": "0.8063219", "text": "def apply_coupons(cart, coupons)\n new_cart = cart.clone\n cart_clone = Marshal.load(Marshal.dump(cart)) #Copies the hash 'cart' {with zero connections}\n if coupons != []\n coupons.each {|coupon|\n i = 0 #reset counter for each coupon\n cart.each {|item_key,item_hash|\n while coupon[:item] == item_key && item_hash[:count] >= coupon[:num] #loops until not enough to apply coupon\n i += 1\n item_hash[:count] = item_hash[:count] - coupon[:num]\n new_cart[item_key + \" #{\"W/COUPON\"}\"] = {:price => coupon[:cost], :clearance => item_hash[:clearance], :count => i}\n end\n }\n }\n end\n new_cart\nend", "title": "" }, { "docid": "1c4bfef757db9cb2284340e884099e36", "score": "0.8054503", "text": "def apply_coupons(cart, coupons)\n i = 0\n while i < coupons.length\n cart_item = find_item_by_name_in_collection(coupons[i][:item], cart) #should return name of item on the coupon\n # want to see if item exists in the cart that's why it's 2nd argument\n #check to see if itemw/ coupon exists in cart already\n item_name_couponed = \"#{coupons[i][:item]} W/COUPON\"\n cart_item_couponed = find_item_by_name_in_collection(item_name_couponed, cart)\n\n if cart_item && cart_item[:count] >= coupons[i][:num] # amount of item within coupons\n if cart_item_couponed # increases coupons count when it already exists\n cart_item_couponed[:count] += coupons[i][:num] # increase it by the number of items on our coupons\n cart_item[:count] -= coupons[i][:num] # moves this out of cart_item into couponed so need to subtract it from there\n else\n cart_item_couponed = {\n :item => item_name_couponed,\n :price => coupons[i][:cost] / coupons[i][:num], #TEST adds the coupon price to the property hash of couponed item\n :clearance => cart_item[:clearance], \n :count => coupons[i][:num] #TEST adds the count number to the property hash of couponed item\n } # adds a new key, value pair to the cart hash called 'ITEM NAME W/COUPON'\n cart << cart_item_couponed #TEST remembers if the item was on clearance\n cart_item[:count] -= coupons[i][:num] #TEST removes the number of discounted items from the original item's count\n end\n end\n\n i += 1\n end\n cart\nend", "title": "" }, { "docid": "843b52d2fd17a91e73752695d28a6942", "score": "0.8023716", "text": "def apply_coupons(cart, coupons)\n return cart if coupons.count < 1\n # create a copy of cart to manipulate\n discounted_cart = cart.dup\n coupons.each do |coupon|\n key = coupon[:item]\n coupon_count = coupon[:num]\n coupon_value = coupon[:cost] / coupon[:num]\n discounted_name = \"#{key} W/COUPON\"\n # if coupon applies to item in cart and there are enough items to qualify\n if discounted_cart.key?(key) && discounted_cart[key][:count] >= coupon_count\n discounted_cart[key][:count] -= coupon_count\n if discounted_cart.key?(discounted_name)\n discounted_cart[discounted_name][:count] += coupon_count\n else\n discounted_cart[discounted_name] = {:price => coupon_value, :clearance => discounted_cart[key][:clearance], :count => coupon_count}\n end\n end\n end\n discounted_cart\nend", "title": "" }, { "docid": "02ff89d5bb294ec12a4b5dda851ffd5b", "score": "0.7968007", "text": "def apply_coupons(cart, coupons)\n # code here\n new_cart=cart\n coupons.each do |coupon|\n name = coupon[:item]\n if new_cart[name] && new_cart[name][:count] >= coupon[:num]\n if new_cart[\"#{name} W/COUPON\"]\n new_cart[\"#{name} W/COUPON\"][:count] += 1\n else\n new_cart[\"#{name} W/COUPON\"] = {:count => 1, :price => coupon[:cost]}\n new_cart[\"#{name} W/COUPON\"][:clearance] = new_cart[name][:clearance]\n end\n new_cart[name][:count] -= coupon[:num]\n end\n end\n return new_cart\nend", "title": "" }, { "docid": "4fadbbc45cc4ac7281ae58602115501b", "score": "0.7940354", "text": "def apply_coupons(cart, coupons)\n coupons.each do |cpn|\n #set variable equal to the name of the discounted item for cleaner code\n discounted_item = cpn[:item]\n #if the item exists in the cart...\n if cart[discounted_item] != nil\n #if the cart has the minimum count of items for a coupon to be valid...\n if cart[discounted_item][:count] >= cpn[:num]\n #calculate the discounted price for the item\n new_price = cpn[:cost] / cpn[:num]\n #calculate the number of items remaining at full price\n remaining_full_price = cart[discounted_item][:count] % cpn[:num] #3%2 = 1\n #calculate the number of items that will have the discounted price applied\n coupon_applied = cart[discounted_item][:count] - remaining_full_price\n #maintain the clearance status\n clearance = cart[discounted_item][:clearance]\n #create new discounted item\n cart[\"#{discounted_item} W/COUPON\"] = {:price => new_price, :clearance => clearance, :count => coupon_applied}\n #change the previous cart number to the number remaining\n cart[discounted_item][:count] = remaining_full_price\n #else, the cart doesn't have the minimum number of items required to qualify for the coupon\n #OR the item doesn't exist in the cart\n else\n #donothing\n end\n end\n end\n cart\n end", "title": "" }, { "docid": "6128e95c4792937f34062403d4d5e171", "score": "0.78703624", "text": "def apply_coupons(cart, coupons)\n coupon_index = 0\n while coupon_index < coupons.length do\n cart_item = find_item_by_name_in_collection(coupons[coupon_index][:item], cart)\n item_applied = \"#{coupons[coupon_index][:item]} W/COUPON\"\n item_with_coupon = find_item_by_name_in_collection(item_applied, cart)\n if cart_item && cart_item[:count] >= coupons[coupon_index][:num]\n if item_with_coupon\n item_with_coupon[:count] += coupons[coupon_index][:num]\n cart_item[:count] -= coupons[coupon_index][:num]\n else item_with_coupon = {\n :item => item_applied,\n :price => coupons[coupon_index][:cost] / coupons[coupon_index][:num],\n :count => coupons[coupon_index][:num],\n :clearance => cart_item[:clearance]\n }\n cart << item_with_coupon\n cart_item[:count] -= coupons[coupon_index][:num]\n end\n end\n coupon_index += 1\n end\n cart\nend", "title": "" }, { "docid": "9a589ecb346d066dd713bce7fc8a5b83", "score": "0.7811205", "text": "def apply_coupons(cart: [], coupons: [])\n couponed_items= {}\n coupons.each do |coupon_hash|\n cart.each do |name, item_hash|\n if name == coupon_hash[:item] && item_hash[:count] >= coupon_hash[:num]\n item_hash[:count] = item_hash[:count] - coupon_hash[:num]\n new_name = coupon_hash[:item] + \" w/coupon\"\n couponed_items[new_name] = { :price => coupon_hash[:cost],\n :count => 1,\n :clearance => item_hash[:clearance] }\n end\n end\n end\n cart.merge(couponed_items)\n end", "title": "" }, { "docid": "108ea74dbe255964131b1d54ea076e41", "score": "0.7777645", "text": "def apply_coupons(cart, coupons)\ni = 0\n while i < coupons.length\n cart_item = find_item_by_name_in_collection(coupons[i][:item], cart)\n #find item from coupon array and use it to search throught cart array to see existence\n couponed_item_name = \"#{coupons[i][:item]} W/COUPON\"\n #display coupon is applied on receipt\n cart_item_with_coupon = find_item_by_name_in_collection(couponed_item_name, cart)\n #searches for item that has a coupon attached in the cart array to see\n #if it has more than 1 same item (will return item name with coupon or nil)\n if cart_item && cart_item[:count] >= coupons[i][:num]\n #if there's enough item in the cart for applying coupon\n #if cart_item exists in cart AND its count value >= the number value needed for apply coupon for item from coupon NDS\n if cart_item_with_coupon\n #if cart item is found with coupon, then returns truthy value, otherwise, is nil, a falsey value which does NOT execute the code\n cart_item_with_coupon[:count] += coupons[i][:num]\n #if truthy, count value of the item with coupon attached in cart\n # = count value of the item with coupon attached in cart + the number value needed for apply coupon for item from coupon NDS\n cart_item[:count] -= coupons[i][:num]\n #count value of items in cart - the number value of the coupon applied\n else\n #如果cart_item_with_coupon 不存在,we build it\n cart_item_with_coupon = {\n :item => couponed_item_name,\n :price => coupons[i][:cost]/coupons[i][:num], #coupon显示的价格/coupon显示的数量要求\n :clearance => cart_item[:clearance],\n :count => coupons[i][:num]\n }\n cart << cart_item_with_coupon\n cart_item[:count] -= coupons[i][:num]\n end\n end\n i += 1\n end\n cart\nend", "title": "" }, { "docid": "cf9c1724873891189d455012e7e21b41", "score": "0.7777314", "text": "def apply_coupons(cart, coupons)\n # Consult README for inputs and outputs\ni=0 \nwhile i < coupons.length\n\ncoupon_name= find_item_by_name_in_collection(coupons[i][:item],cart)\ncouponed_item= \"#{coupons[i][:item]} W/COUPON\"\nc=find_item_by_name_in_collection(couponed_item,cart)\nif coupon_name && coupon_name[:count] >= coupons[i][:num]\n if c \n c[:count] += coupons[i][:num]\n # coupon_name[:count] -= coupons[i][:num]\nelse \n c={\n :item => couponed_item ,\n :price => coupons[i][:cost] / coupons[i][:num],\n :count => coupons[i][:num] , \n :clearance => coupon_name[:clearance] }\n\ncart << c\ncoupon_name[:count] -= coupons[i][:num]\nend\nend\ni += 1\n # REMEMBER: This method **should** update cart\nend\ncart\n\nend", "title": "" }, { "docid": "d1032fc8778100e5cf8c9a9138daa7c8", "score": "0.7774715", "text": "def apply_coupons(cart, coupons)\n # Consult README for inputs and outputs\n i = 0 \n while i < coupons.length do \n coupon_name = coupons[i][:item]\n couponed_item = find_item_by_name_in_collection(coupon_name, cart)\n w_coupon = \"#{coupons[i][:item]} W/COUPON\"\n item_two = find_item_by_name_in_collection(w_coupon, cart)\n if couponed_item && couponed_item[:count] >= coupons[i][:num]\n if item_two\n item_two[:count] += coupons[i][:num]\n couponed_item[:count] -= coupons[i][:num]\n else item_two = {\n :item => w_coupon,\n :price => coupons[i][:cost] / coupons[i][:num],\n :count => coupons[i][:num],\n :clearance => couponed_item[:clearance]\n }\n cart << item_two\n couponed_item[:count] -= coupons[i][:num]\n \n \n end\n end\n i += 1 \n end\n #\n cart\n # REMEMBER: This method **should** update cart\nend", "title": "" }, { "docid": "505c6304449e0a00a1d6ee84e4daa7d2", "score": "0.7764316", "text": "def apply_coupons(cart, coupons)\n coupons.each do |coupon| #going into iteration over the array\n # coupon.each do |attribute, value| #going into the hash within the array \n\n\n name = coupon[:item]#.to_s #variable name for coupon[:item] to clean up how I view my code\n \n if cart[name] # if cart[name] exits as truthy if coupon didnt exist it wouldnt be truthy \n \n if cart[name][:count] >= coupon[:num] \n # if cart[name][:count] is greater than or equal to coupons number requirement \n \n item_with_coupon = \"#{name} W/COUPON\" \n #cleaning up applied coupon name\n \n if cart[item_with_coupon] #if it exists... \n \n #***** CHANGED with just an equal.didnt + or - effect results. \n cart[item_with_coupon][:count] += coupon[:num]\n # we are adding to the final coupons count, the coupons required number to fufill the coupon (wordy but true)\n \n else \n cart[item_with_coupon] = {:price => coupon[:cost]/coupon[:num], \n :clearance => cart[name][:clearance], :count => coupon[:num]} \n # else, a coupon has not been applied, first time applying it. \n end \n cart[name][:count] -= coupon[:num] \n # outside of our iteration. is it though? subtract number from cart count so that we are keeping our net even. \n end \n end \n end \n#end \n cart \n # return the cart \nend", "title": "" }, { "docid": "f6401bb1fd97b0a89487cb223b120ecd", "score": "0.77170414", "text": "def apply_coupons(cart, coupons)\n#iterate over the coupons array\n coupons.each do |coupon|\n#conditional: if any of the keys of items in the cart array == item in the coupon array\n if cart.keys.any? coupon[:item]\n#secondary-conditional: if the cart/coupon :count value is greater than or equal to the coupon :num value\n if cart[coupon[:item]][:count] >= coupon[:num]\n#then create a variable within the cart array for the discounted product which is == :item within the coupons array\n discounted_product = \"#{coupon[:item]} W/COUPON\"\n#tertiary condiitonal: if there is a discounted product within the cart array\n if cart[discounted_product]\n#then the :count value of the discounted product is added from the coupon :num value\n cart[discounted_product][:count] += coupon[:num]\n else\n#otherwise, the discounted product's values within the cart array are == to the following\n cart[discounted_product] = {\n #count: is == the corresponding coupon's :num value\n count: coupon[:num],\n #price: is == the corresponding coupon's :cost value divided by the coupon's :num value\n price: coupon[:cost]/coupon[:num],\n #clearance: is added from the cart array's item value :clearance\n clearance: cart[coupon[:item]][:clearance]\n }\n end\n#Finally, if coupon was applied to an item(s) reduce the item's :count value by the coupon's :num v\n cart[coupon[:item]][:count] -= coupon[:num]\n end\n end\n end\n#return cart\n cart\nend", "title": "" }, { "docid": "ba3c38f2b10f7c25562e601c93c5352f", "score": "0.77063775", "text": "def apply_coupons(cart, coupons)\n counter = 0\n while counter < coupons.length\n cart_item = find_item_by_name_in_collection(coupons[counter][:item], cart)\n couponed_item_name = \"#{coupons[counter][:item]} W/COUPON\"\n cart_item_with_coupon = find_item_by_name_in_collection(couponed_item_name, cart)\n # designed to deal with multiple coupons. Will help us increment item count if \n # if couponed item is already in cart\n if cart_item && cart_item[:count] >= coupons[counter][:num] # returns cart item or nil\n if cart_item_with_coupon \n cart_item_with_coupon[:count] += coupons[counter][:num]\n cart_item[:count] -= coupons[counter][:num]\n else \n cart_item_with_coupon = {\n item: couponed_item_name,\n price: coupons[counter][:cost] / coupons[counter][:num],\n count: coupons[counter][:num],\n clearance: cart_item[:clearance]\n }\n cart << cart_item_with_coupon\n cart_item[:count] -= coupons[counter][:num]\n end \n end \n counter += 1\n end \n cart \nend", "title": "" }, { "docid": "ea23b0ba42a4b1f99b9cccedc854e52a", "score": "0.7694887", "text": "def apply_coupons(cart, coupons)\n # Consult README for inputs and outputs\n #\n # REMEMBER: This method **should** update cart\n index = 0\n\n while index < coupons.length do\n cart_item = find_item_by_name_in_collection(coupons[index][:item], cart)\n couponed_item_name = \"#{coupons[index][:item]} W/COUPON\"\n cart_item_with_coupon = find_item_by_name_in_collection(couponed_item_name, cart)\n if cart_item && cart_item[:count] >= coupons[index][:num]\n if cart_item_with_coupon\n cart_item_with_coupon[:count] += coupons[index][:num]\n cart_item[:count] -= coupons[index][:num]\n else\n cart_item_with_coupon = {\n :item => couponed_item_name,\n :price => coupons[index][:cost] / coupons[index][:num],\n :count => coupons[index][:num],\n :clearance => cart_item[:clearance]\n}\ncart << cart_item_with_coupon\ncart_item[:count] -= coupons[index][:num]\n end\n end\n index += 1\n end\n cart\n end", "title": "" }, { "docid": "05bb2ef252e3e194c5a7de99d64f5035", "score": "0.7679359", "text": "def apply_coupons(cart, coupons)\n i = 0\n while i < cart.length\n item = cart[i]\n item_name = cart[i][:item]\n item_dup = cart[i].dup\n\n if find_item_by_name_in_collection(item_name, coupons) != nil\n coupon_item = find_item_by_name_in_collection(item_name, coupons)\n\n # Reasigning the duplicate item name to be the name with coupon\n item_dup[:item] = \"#{item_name} W/COUPON\"\n\n # Chaning the count in the duplicate item and the original item\n item[:count] -= coupon_item[:num]\n item_dup[:count] -= item[:count]\n\n # Changing the price for the item that is a coupon in the cart\n item_dup[:price] = (coupon_item[:cost] / coupon_item[:num])\n\n cart << item_dup\n end\n\n i += 1\n end\n\n cart\nend", "title": "" }, { "docid": "f2053344ebd0faba9b669629e613b5cb", "score": "0.7656044", "text": "def apply_coupon\n return unless self.behavior == 'coupon'\n \n item = self.item\n \n # coitem is the OrderItem to which the coupon acts upon\n coitem = self.order.order_items.visible.find_by_sku(item.coupon_applies)\n log_action \"coitem was not found\" and return if coitem.nil?\n\n unless coitem.coupon_amount.zero? then\n log_action \"This item is a coupon, but a coupon_amount has already been set\"\n return\n end\n \n ctype = self.item.coupon_type\n if ctype == 1\n # percent rebate\n log_action \"Percent rebate coupon\"\n coitem.coupon_amount = coitem.total * (self.price.to_f / 100)\n elsif ctype == 2\n # fixed amount\n log_action \"Fixed amount coupon\"\n coitem.coupon_amount = self.price\n elsif ctype == 3\n # buy x get y free\n log_action \"B1G1\"\n x = 2\n y = 1\n if coitem.quantity >= x\n coitem.coupon_amount_cents = y * coitem.total_cents / coitem.quantity\n end\n end\n log_action \"Total is: #{coitem.total} and coupon_amount is #{coitem.coupon_amount}\"\n coitem.total -= coitem.coupon_amount\n coitem.calculate_tax\n coitem.save\n end", "title": "" }, { "docid": "2d9ed5bbb338ceed61051833cac42bd7", "score": "0.7569707", "text": "def apply_coupons(cart, coupons)\n new_cart_with_coupons = []\n i = 0\n while i < coupons.length\n cart_item = find_item_by_name_in_collection(coupons[i][:item], cart)\n new_coupon_name = \"#{coupons[i][:item]} W/COUPON\"\n cart_item_with_coupon = find_item_by_name_in_collection(new_coupon_name, cart)\n if cart_item && cart_item[:count] >= coupons[i][:num]\n if cart_item_with_coupon\n cart_item_with_coupon[:count] += coupons[i][:num]\n cart_item[:count] -= coupons[i][:num]\n else\n cart_item_with_coupon = {\n :item => new_coupon_name,\n :price => coupons[i][:cost] / coupons[i][:num],\n :count => coupons[i][:num],\n :clearance => cart_item[:clearance]\n }\n cart << cart_item_with_coupon\n cart_item[:count] -= coupons[i][:num]\n end\n end\n i +=1\n end\n cart\nend", "title": "" }, { "docid": "036371460850a9ad1676670194265968", "score": "0.75090593", "text": "def apply_coupons(cart, coupons)\n index = 0 \n while index < coupons.length do \n cart_item = find_item_by_name_in_collection(coupons[index][:item], cart)\n couponed_item_name = \"#{coupons[index][:item]} W/COUPON\"\n cart_item_with_coupon = find_item_by_name_in_collection(couponed_item_name, cart)\n if cart_item && cart_item[:count] >= coupons[index][:num]\n if cart_item_with_coupon\n cart_item_with_coupon[:count] += coupons[index][:num]\n cart_item[:count] -= coupons[index][:num]\n else\n cart_item_with_coupon = {\n :item => couponed_item_name,\n :price => coupons[index][:cost] / coupons[index][:num],\n :clearance => cart_item[:clearance],\n :count => coupons[index][:num]\n }\n cart << cart_item_with_coupon\n cart_item[:count] -= coupons[index][:num]\n end\n end\n index += 1\n end\n cart\nend", "title": "" }, { "docid": "04e949bdd2e3ae0383ea96f02ffea7b3", "score": "0.73337424", "text": "def apply_coupons(cart, coupons)\n element_index = 0\n after_coupons_array = []\n while element_index < cart.length do\n x = find_item_by_name_in_collection(cart[element_index][:item], coupons)\n if x && cart[element_index][:count] >= x[:num]\n coupon_hash = {} \n coupon_hash[:clearance] = cart[element_index][:clearance]\n coupon_hash[:item] = x[:item] += \" W/COUPON\"\n coupon_hash[:price] = x[:cost] / x[:num]\n coupon_hash[:count] = x[:num]\n after_coupons_array << coupon_hash\n cart[element_index][:count] -= x[:num]\n after_coupons_array << cart[element_index]\n elsif coupons == []\n after_coupons_array = cart\n else \n after_coupons_array << cart[element_index]\n end\n element_index += 1\n end\nafter_coupons_array\nend", "title": "" }, { "docid": "eeb60c8d645e26a6b58f695cb0bb3c2b", "score": "0.73233944", "text": "def apply_clearance(cart)\n cart.each do |item_name,item_details|\n\n if item_details[:clearance] == true\n # at this point we know coupon can be applied\n coupons.each do |coupon|\n if item_name == coupon[:item]\n #at this point we know the coupn is for the item\n if item_details[:count] == coupon[:num]\n binding.pry\n discounted_item = {\"#{item} W/COUPON\" => }\n\n\n elsif item_details[:count] < coupon[:count]\n\n\n end\n end\n end\n end\n end\nend", "title": "" }, { "docid": "5f9d45584200088ff2a647f440fcddbc", "score": "0.71740234", "text": "def update_coupons_for_clearance_discount\n COUPS.each do |coupon|\n # coupon => {:item=>\"AVOCADO\", :num=>2, :cost=>5.00}\n ITEMS.each do |items|\n # items {\"AVOCADO\"=>{:price=>3.0, :clearance_items=>true, :count=>2}}\n items.each do |name, attributes|\n coupon[:cost] = coupon[:cost] * 0.8 if coupon[:item] == name && attributes[:clearance_items] == true\n end\n end\n end\nend", "title": "" }, { "docid": "8a6d30eaee40d7a64ef71993e92d4f71", "score": "0.716937", "text": "def apply_coupon_discount\n reset_coupon_items\n if !coupon.blank? && coupon_conditions_met?\n if coupon.product?\n cart_items.where(:item_num.in => coupon.products).each do |item|\n item.calculate_coupon_discount(coupon)\n end\n elsif coupon.group?\n coupon.children.select {|c| coupon_conditions_met?(c)}.each do |child|\n cart_items.where(:item_num.in => child.products).each do |item|\n item.calculate_coupon_discount(child)\n end\n end\n elsif coupon.order?\n # === if order level coupon is a line item:\n # order_discount = coupon.percent? ? (0.01 * coupon.discount_value * sub_total(coupon.products_excluded + [Coupon::COUPON_ITEM_NUM])).round(2) : coupon.discount_value\n # cart_items << CartItem.new(:name => coupon.name, :item_num => Coupon::COUPON_ITEM_NUM, :msrp => -(order_discount), :price => -(order_discount), :coupon_price => true,\n # :quantity => 1, :currency => current_currency, :small_image => nil, :added_at => Time.now, :product_id => nil, :weight => 0, :tax_exempt => false, :handling_price => 0, :volume => 0)\n\n # === if order level discount is distributed:\n cart_items.where(:item_num.nin => coupon.products_excluded).each do |item|\n item.calculate_coupon_discount(coupon)\n end\n elsif coupon.highest_priced_product?\n item = cart_items.where(:item_num.nin => coupon.products_excluded).order_by(:price.desc).first\n item.calculate_coupon_discount(coupon) if item\n end\n end\n save\n end", "title": "" }, { "docid": "55413a6801c7ffe98464425152e2de2a", "score": "0.71593106", "text": "def coupon_items(cart, coupons)\n return 0 if coupons.nil?\n cost = 0\n cart.each do |item|\n # items {\"AVOCADO\"=>{:price=>3.0, :clearance_items=>true, :count=>2}}\n item.each do |name, attributes|\n # name is \"AVOCADO\", an attributes is {:price=>3.0, :clearance_items=>true, :count=>2}\n coupons.each do |coupon|\n # coupon => {:item=>\"AVOCADO\", :num=>2, :cost=>5.00}\n # we want to make sure we have the minimum number of the food to apply the coupon\n if name == coupon[:item] && attributes[:count] >= coupon[:num]\n # add the item to our total cost\n cost += coupon[:cost]\n # so we've paid for the number of items reflected in the coupon\n attributes[:count] = attributes[:count] - coupon[:num]\n # so if we started with 3 avocados, wed now have 1 in the cart, and 2 paid for\n end\n end\n end\n end\n cost\nend", "title": "" }, { "docid": "62f2c9eb734a377a7fe6cc3fdf92b8f0", "score": "0.71142614", "text": "def final_price_for_item(item, attributes, coupons)\n price = 0\n # Do we have coupon?\n if coupon = coupon_for_item(item, attributes, coupons)\n price += coupon[:cost]\n attributes[:count] -= coupon[:num]\n end\n\n price += (attributes[:count] * attributes[:price])\n\n if attributes[:clearance]\n price *= 0.8\n end\n\n price\nend", "title": "" }, { "docid": "e621fb00084a1c47d7b2d9ccfed1fecf", "score": "0.709189", "text": "def apply_coupons(cart, coupons)\n binding.pry\n # cart.each do |product|\n # coupons.each do |discount|\n # if product[:item] == discount[:item]\n # result << product[:item] = \"#{product[:item]} W/COUNPON\"; product[:price] = product[]\n # end\n # end\n # end\nend", "title": "" }, { "docid": "aa11938a286f52f424f32be4f88fb583", "score": "0.6963683", "text": "def coupon_items(cart, coupons)\n cost = 0\n cart.each do |item|\n item.each do |name, attributes|\n unless coupons.nil?\n coupons.each do |coupon|\n if name == coupon[:item] && attributes[:count] >= coupon[:num]\n cost += coupon[:cost]\n attributes[:count] = attributes[:count] - coupon[:num]\n end\n end\n end\n end\n end\n cost\nend", "title": "" }, { "docid": "48e70330e89971b4c8cea8db49fac742", "score": "0.69273674", "text": "def checkout(cart, coupons)\ncart = consolidate_cart(cart)\ncoupons_applied = apply_coupons(cart, coupons)\nclearance_applied = apply_clearance(coupons_applied)\nclearance_applied\ntotal = 0\nclearance_applied.each do |item, value|\n total_price = value[:price] * value[:count]\ntotal = total_price + total\n end\nif total > 100 \n discount = total * 0.10\n final_total = total - discount\nelse\nfinal_total = total\nend\nfinal_total\nend", "title": "" }, { "docid": "3bae5eea596a8e41a86ebc33a11f1c54", "score": "0.6912799", "text": "def apply_clearance(cart)\n # code here\n cart.each do |item, hash|\n discount = cart[item][:clearance]\n if item && discount\n new_price = cart[item][:price] - (cart[item][:price] * 0.2)\n cart[item][:price] = new_price\n else\n cart\n end\n end\nend", "title": "" }, { "docid": "21f3376dc9e12b3ac6bf2054a9ed5b78", "score": "0.68887365", "text": "def update_coupons_for_triple_discount(coupons)\n if coupons[0] = coupons[1]\n coupons.delete_at(1)\n\n coupon = coupons[0]\n\n ITEMS.each do |items|\n items.each do |name, attributes|\n if coupon[:item] == name\n real_price = attributes[:price] * coupon[:num]\n new_price = coupon[:cost]\n percentage_discount = (real_price - new_price)/real_price\n coupon[:cost] = coupon[:cost] * (1 - (percentage_discount * 3))\n end\n end\n end\n end\n coupons\nend", "title": "" }, { "docid": "31937ccc838afcdc593fedf7896902be", "score": "0.68429047", "text": "def checkout(cart, coupons)\n new_cart = consolidate_cart(cart)\n #get count first \n apply_coupons(new_cart, coupons)\n apply_clearance(new_cart)\n total = 0 \n new_cart.each do |item, info|\n total += (info[:price] * info[:count])\n end\n if total > 100 \n total *= 0.9 \n end \n total\nend", "title": "" }, { "docid": "45653b968fae5314b4437c14aa6f84ce", "score": "0.6802496", "text": "def redeem_coupon!\n @coupon ||= begin\n details = {\n related_adjustment_item: self,\n discount_code: order.pending_coupon_code,\n display_name: summary,\n purpose: 'coupon',\n price: calculated_discount * -1, # Money doesn't have negate unary method\n order: order,\n }.merge coupon_details\n FeeAdjustment.create! details\n end\n end", "title": "" }, { "docid": "41af66908ae8c18767909f210b1ed2e2", "score": "0.6582162", "text": "def checkout(cart, coupons)\n total_counter = 0.0\n new_cart = cart\n new_cart = consolidate_cart(new_cart)\n new_cart = apply_coupons(new_cart, coupons)\n new_cart = apply_clearance(new_cart)\n new_cart.each do |item, information|\n total_counter += (new_cart[item][:price] * new_cart[item][:count])\n end\n if total_counter > 100.0\n total_counter = total_counter * 0.9\n end\n return total_counter\nend", "title": "" }, { "docid": "e9819816979b3f1f948091245833fc45", "score": "0.6501849", "text": "def check_coupons (cart, coupons)\n # what should the paramater be? \n \t# check if the number of coupons = the count number \n \t# if the replace the number of \n \tif coupons.nil?\n \t\treturn 0\n \tend \n \tcost = 0 \n \tcart.each do |item|\n \t\titem.each do |name, item_specs|\n \t\t\tcoupons.each do |coupon|\n \t\t\tif name == coupon[:item] && item_specs[:count] >= coupon[:num]\n \t\t\t\tcost += coupon[:cost]\n \t\t\t\titem_specs[:count] = item_specs[:count] - coupon[:num]\n \t\t\tend \n \t\tend \n \tend \n end", "title": "" }, { "docid": "2dfb695f67660ba4a04fc4b87b2248af", "score": "0.6489013", "text": "def checkout(cart, coupons)\n consolidated_cart = consolidate_cart(cart)\n grand_total = 0\n\n # Applies coupons and clearance\n apply_coupons(consolidated_cart, coupons)\n apply_clearance(consolidated_cart)\n\n i = 0\n while i < consolidated_cart.length\n item_count = consolidated_cart[i][:count]\n item_price = consolidated_cart[i][:price]\n\n grand_total += (item_price * item_count)\n i += 1\n end\n\n if grand_total >= 100\n grand_total = (grand_total - ((grand_total * 10.0) / 100))\n end\n\n grand_total\nend", "title": "" }, { "docid": "910480321415c411343f7348fcefb88c", "score": "0.64888346", "text": "def check_coupons (cart, coupons)\n \tif coupons.nil?\n \t\treturn 0\n \tend \n \tcost = 0 # we set cost = 0 because it is the first time we are referring to cost. \n \tcart.each do |item|\n \t\titem.each do |name, item_specs|\n \t\t\tcoupons.each do |coupon|\n\t \t\t\tif name == coupon[:item] && item_specs[:count] >= coupon[:num]\n\t \t\t\t\tcost += coupon[:cost]\n\t \t\t\t\titem_specs[:count] = item_specs[:count] - coupon[:num]\n\t \t\t\tend\n\t \t\tend\n \t\tend \n \tend \n \tcost\n end", "title": "" }, { "docid": "c881f6c8cb65bf0c1a65ae1b92ce439c", "score": "0.6477742", "text": "def checkout(cart: [], coupons: [])\n # puts cart.inspect === cart\n call_later = cart\n cart = consolidate_cart(cart: cart)\n final_cart = apply_coupons(cart: cart, coupons: coupons)\n total = 0\n final_cart.each do |name, item_hash|\n if item_hash[:clearance]\n item_hash[:price] = item_hash[:price] - (item_hash[:price] * 0.20)\n end\n total += item_hash[:price] * item_hash[:count]\n end\n if total > 100\n total = total - ( total * 0.10 )\n end\n total\n end", "title": "" }, { "docid": "397fbc6ce398e271f77bced1119ee5ef", "score": "0.64757943", "text": "def checkout(cart, coupons)\n cart = consolidate_cart(cart)\n cart = apply_coupons(cart, coupons)\n cart = apply_clearance(cart)\n total = 0\n index = 0 \n while index < cart.length do\n if cart[index][:count] == 1 \n total += cart[index][:price]\n elsif cart[index][:count] > 1\n total += (cart[index][:price] * cart[index][:count])\n end \n index += 1\n end\n if total > 100\n total -= (total * 0.1).round(2)\n end\n total\nend", "title": "" }, { "docid": "9c50510cf858b3cb1a746f82cbcacfbd", "score": "0.6460798", "text": "def checkout(cart, coupons) #must use whats called in arg.\n consolidated_cart = consolidate_cart(cart) #calling method with it's argument, c_c(cart), also bc we're calling it wihtin this arg.\n couponed_cart = apply_coupons(consolidated_cart, coupons) # consolidate_cart(cart) bc it's included & as a placeholder #^ same reasoning.\n final_cart = apply_clearance(couponed_cart) #finalcart calling apply_clearance method.\n cart_total = 0\n final_cart.each do |item, properties|\n cart_total += properties[:price] * properties[:count] #mult. price with count of properties in cart\n end\n #10% 100> #should just be cart_total bc thats what we're apply disc. to & not [:price]\n cart_total = cart_total * 0.90 if cart_total > 100\n cart_total\n end", "title": "" }, { "docid": "ad1c128982e0d123d7f7c322d3dfce1c", "score": "0.6430432", "text": "def coupon_amount\n coupon_id ? coupon.value(item_prices, self) : 0.0\n end", "title": "" }, { "docid": "342d51f788a6f2d3d7ecd51d11486270", "score": "0.6430051", "text": "def checkout(cart, coupons)\n final_cart = apply_clearance(apply_coupons(consolidate_cart(cart), coupons))\n total_sum = 0\n\n final_cart.each do |item|\n total_sum += item[:price] * item[:count]\n end\n \n if total_sum > 100\n total_sum *= 0.9\n else total_sum.round(2)\n end\n \n total_sum\nend", "title": "" }, { "docid": "2f08470d60e9226d9b9b79a0d69894a4", "score": "0.64291304", "text": "def apply_coupon\n if @order.update_attributes(object_params)\n\n if @order.coupon_code.present?\n\n if (Spree::Promotion.exists?(:code => @order.coupon_code))\n if (Spree::Promotion.where(:code => @order.coupon_code).last.eligible?(@order) && Spree::Promotion.where(:code => @order.coupon_code).last.order_activatable?(@order))\n fire_event('spree.checkout.coupon_code_added', :coupon_code => @order.coupon_code)\n # If it doesn't exist, raise an error!\n # Giving them another chance to enter a valid coupon code\n @message = \"Coupon applied\"\n else\n # Check why the coupon cannot be applied (at least a few checks)\n promotion = Spree::Promotion.where(:code => @order.coupon_code).last\n if promotion.expired?\n @message = \"The coupon is expired or not yet active.\"\n elsif promotion.usage_limit_exceeded?(@order)\n @message = \"The coupon cannot be applied, it's usage limit has been exceeded.\"\n elsif promotion.created_at.to_i > @order.created_at.to_i\n @message = \"The coupon cannot be applied because it has been created after the order.\"\n else\n @message = \"The coupon cannot be applied to this order.\"\n end\n end\n else\n @message = t(:promotion_not_found)\n end\n end\n # Need to reload the order, otherwise total is not updated\n @order.reload\n respond_with(@order, @message)\n end\n end", "title": "" }, { "docid": "540f5699e2b13e8af22f252ee2ad4bf1", "score": "0.64004064", "text": "def checkout(cart, coupons)\n # code here\n consolidated_cart = consolidate_cart(cart)\n couponed_cart = apply_coupons(consolidated_cart, coupons)\n final_cart = apply_clearance(couponed_cart)\n total = 0\n final_cart.each do |name, properties|\n total += properties[:price] * properties[:count]\n end\n total = total * 0.9 if total > 100\n total\nend", "title": "" }, { "docid": "a75eaff9ba1966d1a92748fbe0309c77", "score": "0.6385482", "text": "def checkout(cart, coupons)\nconsolidated_cart = consolidate_cart(cart)\ncouponed_cart = apply_coupons(consolidated_cart, coupons)\nfinal_cart = apply_clearance(couponed_cart)\n total_price=0\n i=0\n while i<final_cart.length\n total_price += final_cart[i][:price]*final_cart[i][:count]\n i+=1\n end\n\n if total_price>100\n total_price*=0.9\n end\n total_price\nend", "title": "" }, { "docid": "dfe9bc0dfabc89492b294598df799d16", "score": "0.6378709", "text": "def apply_clearance(cart)\n cart.each do |item_hash|\n if item_hash[:clearance] == true \n item_hash[:price] = 0.8 * item_hash[:price].to_f\n end\n end\n cart\nend", "title": "" }, { "docid": "a67a9807d55362efdca072376245bcea", "score": "0.6361561", "text": "def commit_invoice_prices\n #get all the items that match this coupon.. THIS IS A PAYMENT TIME METHOD, in an attempt to have transaction agree with lines\n @discount_amount = 0.00\n \n ## clear the old coupons out\n self.reservation_carts.each do |ci|\n ci.line_discount=0\n ci.line_price=ci.reservation.event.price\n ci.coupon_id=nil\n ci.save\n end\n \n unless self.user_coupon_code.blank?\n # puts \"we will apply discount for #{self.user_coupon_code} \"\n coupon_collection = Coupon.where( \"code = ?\", self.user_coupon_code)\n if coupon_collection.empty? #then we don't have a coupon any more, maybe it was deleted , changed or fraud?\n self.reservation_carts.each do |ci|\n ci.line_discount=0\n ci.line_price=ci.reservation.event.price\n ci.coupon_id=nil\n ci.save\n end \n else # coupon collection empty\n coupon_object=coupon_collection.first\n # puts \"we have a coupon : #{coupon_object.code}\"\n if ((coupon_object.use_limit.to_i<1) or (coupon_object.use_limit.to_i>0 and coupon_object.has_remaining?)) and (coupon_object.is_valid_today?)\n @num_remaining=coupon_object.number_remaining \n if coupon_object.event_restricted?\n self.reservation_carts.joins(:reservation => :event).where( :events => {:id => coupon_object.event_id}).each do |ci|\n working_cart_item = ReservationCart.find(ci[:id])\n @line_discount=0\n @line_price = 0\n if @num_remaining > 0\n # puts \"applying an event restricted coupon to a reservation : #{ci.reservation.event.eventname}\"\n if coupon_object.discount_type=='FIXED'\n @line_discount = coupon_object.discount_value\n @discount_amount += @line_discount #coupon_object.discount_value\n else\n @line_discount = (ci.reservation.event.price*(coupon_object.discount_value/100).round(2))\n @discount_amount += @line_discount #(ci.reservation.event.price*(coupon_object.discount_value/100).round(2))\n end\n @num_remaining=@num_remaining-1\n working_cart_item.line_discount = @line_discount\n working_cart_item.coupon_id = coupon_object.id\n working_cart_item.line_price = ci.reservation.event.price\n working_cart_item.save\n end \n end #end loop\n else #else not event restricted\n self.reservation_carts.each do |ci| \n @line_discount = 0\n @line_price = 0 \n if @num_remaining > 0\n # puts \"applying a coupon to a reservation : #{ci.reservation.event.eventname}\"\n if coupon_object.discount_type=='FIXED'\n @line_discount = coupon_object.discount_value\n @discount_amount += @line_discount #coupon_object.discount_value\n else\n @line_discount = (ci.reservation.event.price*(coupon_object.discount_value/100).round(2))\n @discount_amount += @line_discount #(ci.reservation.event.price*(coupon_object.discount_value/100).round(2))\n end\n ci.line_discount = @line_discount\n ci.coupon_id = coupon_object.id\n ci.line_price = ci.reservation.event.price\n ci.save\n @num_remaining=@num_remaining-1\n end \n end #end loop\n end #event restricted?\n end #has remaining and valid today\n end #coupon collection empty?\n end #coupon code is nil \n end", "title": "" }, { "docid": "9a5608b521c83c555ad7d4d705a0ecb5", "score": "0.6357189", "text": "def apply_coupon(subscription_id, coupon_id, options = nil)\n request = Request.new(@client)\n path = \"/subscriptions/\" + CGI.escape(subscription_id) + \"/discounts\"\n data = {\n \"amount\"=> @amount, \n \"expires_at\"=> @expires_at, \n \"metadata\"=> @metadata, \n 'coupon_id'=> coupon_id\n }\n\n response = Response.new(request.post(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"discount\"]\n \n \n return_values.push(self.fill_with_data(body))\n \n\n \n return_values[0]\n end", "title": "" }, { "docid": "ee61c9ba269b09c132b7d9df5d8dbc0f", "score": "0.6342489", "text": "def consolidate_cart(cart)\n cchash = {}\n cart.each do |item_cchash|\n item_cchash.each do |name, price_cchash|\n if cchash[name].nil?\n cchash[name] = price_cchash.merge({:count => 1})\n else\n cchash[name][:count] += 1\n end\n end\n end\n cchash\nend", "title": "" }, { "docid": "b08eb16004b89aa580c0f036b00c8c8b", "score": "0.6332539", "text": "def apply_coupon\n if Coupon.where(coupon_code: params[:coupon_code]).count > 0 #if this exists\n this_coup = Coupon.where(coupon_code: params[:coupon_code])\n cart.items.each do |item| \n if item.first.merchant_id == this_coup.first.merchant_id \n session[:coupon] = Coupon.where(coupon_code: params[:coupon_code])\n end\n end\n else\n flash[:notice] = \"Please Enter A Valid Coupon\"\n end\n redirect_to \"/cart\"\n end", "title": "" }, { "docid": "ba86ef377f2686b1c3685bcbbe602869", "score": "0.6293398", "text": "def apply_clearance(cart)\n cart.each do |name, properties|\n if properties[:clearance]\n updated_price = properties[:price] * 0.80\n properties[:price] = updated_price.round(2)\n end\n end\n cart\nend", "title": "" }, { "docid": "254cd7c86900099c5b74d7796ee09f1e", "score": "0.62931305", "text": "def add_coupon\n @page_title = \"Add Coupon\"\n find_cart\n @coupon = Coupon.find_by_coupon_number(params[:coupon_number])\n \n unless @coupon\n @coupon_error = \"Not found\"\n render :action => 'index' and return\n end\n \n if @coupon.used == true && @coupon.reusable == false\n @coupon_error = \"Already used\"\n render :action => 'index' and return\n end\n \n if @cart.subtotal < @coupon.min_purchase\n @coupon_error = \"#{@coupon.min_purchase} minimum required\"\n render :action => 'index' and return\n end\n \n if @coupon.is_expired?\n @coupon_error = \"Coupon is expired\"\n render :action => 'index' and return\n end\n \n if @cart.coupon\n flash[:notice] = \"Only 1 coupon per order. Coupon: #{@coupon.coupon_number} added, Coupon: #{@cart.coupon.coupon_number} removed\"\n @cart.coupon = @coupon\n else\n @cart.coupon = @coupon\n end\n \n \n @cart.save\n redirect_to cart_path\n \n end", "title": "" }, { "docid": "bad5476e818e16ae162ccd5556d2a2fe", "score": "0.62813663", "text": "def generateCart\n\tcart = []\n\trand(20).times do\n\t\tcart.push(ITEMS.sample) \n\tend\n\tcart\n\t# Cart, an array of items\n\t# Items, each one is a nested hash. Top level key is the name and its values are\n\t# attributes of the item, price and clearance item.\n# \tcart = [{\"AVOCADO\" => {:price => 3.00, :clearance => true}},\n# \t\t\t{\"KALE\" => {:price => 3.00,:clearance => false}},\n# \t\t\t{\"BLACK_BEANS\" => {:price => 2.50,:clearance => false}},\n# \t\t\t{\"ALMONDS\" => {:price => 9.00, :clearance => false}},\n# \t\t\t{\"TEMPEH\" => {:price => 3.00,:clearance => true}},\n# \t\t\t{\"CHEESE\" => {:price => 6.50,:clearance => false}},\n# \t\t\t{\"BEER\" => {:price => 13.00, :clearance => false}},\n# \t\t\t{\"PEANUTBUTTER\" => {:price => 3.00,:clearance => true}},\n# \t\t\t{\"BEETS\" => {:price => 2.50,:clearance => false}}]\n# end\n\n#randomly generates set of coupons\ndef generateCoups\n\tcoups = []\n\trand(2).times do\n\t\tcoups.push(COUPS.sample)\n\tend\n\tcoups\n\t\t# List of coupons, similar structure, which gives us the items' name, cost and number\n\t\t# Items, each one is a nested hash. Top level key is the name and its values are\n\t\t# attributes of the item, price and clearance item.\n\t# coups = [\t{:item=>\"AVOCADO\", :num=>2, :cost=>5.00},\n\t# \t\t{:item=>\"BEER\", :num=>2, :cost=>20.00},\n\t# \t\t{:item=>\"CHEESE\", :num=>3, :cost=>15.00}]\nend\n\n# How to approach this problem:\n# 1. Get the count of each item in the Cart.\n\ndef cart_count(cart)\n\ttotal = {}\n\t#this creates a new hash for all the items in the hash\n\t\tcart.each do |item|\n\t\t#go over each item in your pre-established cart, do something with it. You will now refer to this as item. \n\t\t#Go one level down in the hash.\n\t\t\titem.each do |name, description|\n\t\t\t#go over each individual item's name and description in the cart.\n\t\t\t#Go one level down in the hash.\n\t\t\t\ttotal[name] = cart.select{|other_item| other_item == item}.size\n\t\t\t\t#put stuff in the total hash, organized by name. In the existing cart, size returns the total number in the cart as\n\t\t\t\t#other_item == item is saying \"other item is equal to item in the cart\"\n\t\t\tend\n\t\tend\n\tcounts\n\t#why do I call this here?? Do not understand?\nend\n\n# Now the cart count is returned.\n# 2. update the cart\ndef cart_update(cart, total)\n\t#defines a new method in where we'll be working with the first cart array and the total hash.\n\tog_cart = cart.uniq!\n\t#start off with the cart array, take out any duplicates from the cart FOREVER when using the original gangster cart\n\t\tog_cart.each do |item|\n\t\t#go through the now mushed cart, do something with each item. The item is the constant listed above.\n\t\t#go one level down in the array.\n\t\t\titem.each do |name, description|\n\t\t\t#now with each item in the array, do something with the name and the description of each item.\n\t\t\t#go one level down in each hash\n\t\t\t\ttotal.each do |next_item, description|\n\t\t\t\t#now go in to the total and go to the key/value pair now called next_item and description\n\t\t\t\t\tdescription[:count] = number if next_item == name\n\t\t\t\t\t#this says \"assign to the description key a number if the next item is a name\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\n\n# 3. Now apply all the discounts to items in the cart.\n# here are the conditions we can have and need to be accounted for:\n# a. Full price, no coupons or clearance\n# b. No coupons, but clearance\n# c. Clearance and coupons\n# d. Coupons but no clearance.\n\n# a. full price items.\ndef full_price_items(cart, cost)\n#defines a new method for full price items where we'll be working again with the cart and the cost.\n\tcart.each do |item|\n\t#for each item in the cart (now called item) do something with it.\n\t\tcost += (description[:cost] * description[:count])\n\t\t#in this case, the cost is added to or equal the description cost key times the description count key\n\tend\nend\ncost\nend", "title": "" }, { "docid": "803b510e24bc2508cfe3f73d3a97d3ab", "score": "0.62777525", "text": "def checkout(cart, coupons)\n # Consult README for inputs and outputs\n #\n # This method should call\n # * consolidate_cart\n # * apply_coupons\n # * apply_clearance\n #\n # BEFORE it begins the work of calculating the total (or else you might have\n # some irritated customers\n consolidated = consolidate_cart(cart)\n consolidated = apply_coupons(consolidated,coupons)\n consolidated = apply_clearance(consolidated)\n grand_total = 0\n total_index = 0 \n while total_index < consolidated.count do \n item_price = consolidated[total_index][:price]\n item_count = consolidated[total_index][:count]\n item_total = item_price * item_count\n grand_total += item_total\n total_index += 1 \n end\n if grand_total > 100\n grand_total = grand_total * 0.9\n grand_total.round(2)\n end\n grand_total\nend", "title": "" }, { "docid": "d6f9fceae9f3d40f6b2a5b14c95f7f83", "score": "0.62720954", "text": "def update_items(check = false, quote = false)\n return if cart_items.blank?\n Rails.logger.info \"Cart: cart items are being updated\"\n if check && cart_items.any?(&:coupon_price)\n reset_coupon_items\n save\n end\n self.removed = 0\n self.removed_items = []\n self.changed_items = nil\n cart_items.each do |item|\n next if item.coupon?\n product = item.product\n item.write_attributes :sale_price => product.outlet? ? product.price : product.sale_price, :campaign_name => product.campaign_name, :msrp => product.msrp_or_wholesale_price, :currency => current_currency, :small_image => product.small_image, :tax_exempt => product.tax_exempt, :outlet => product.outlet?, :pre_order => product.pre_order?,\n :handling_price => product.handling_price, :gift_card => product.gift_card, :retailer_price => product.retailer_price, :weight => product.virtual_weight, :actual_weight => product.weight, :out_of_stock => backorder_allowed? && product.listable?(current_system, item.quantity) ? product.out_of_stock?(current_system, item.quantity - 1) : product.out_of_stock?\n item.price = product.price unless item.custom_price\n if check\n if quote && !product.available?\n item.quantity = 0\n #elsif (quote && can_place_quote_on_backordered? || backorder_allowed?) && product.out_of_stock? && product.listable?\n # do nothing\n elsif (quote && can_place_quote_on_backordered? || backorder_allowed?) && product.listable?(current_system, item.quantity) && product.quantity < item.quantity\n # mark item as \"out_of_stock\" to trigger limited quantity notification\n item.out_of_stock = true\n item.reset_attribute! \"out_of_stock\" if item.changes[\"out_of_stock\"].present? && item.changes[\"out_of_stock\"].uniq.count == 1\n else\n Rails.logger.info \"Cart: removing item...\"\n item.quantity = product.unavailable? ? 0 : product.quantity if product.unavailable? || product.quantity < item.quantity\n end\n end\n end\n if check\n self.removed_items = cart_items.where(:quantity.lt => 1).map {|e| e.item_num}\n self.removed = cart_items.delete_all(:conditions => {:quantity.lt => 1})\n self.changed_items = cart_items.select(&:updated?).map {|i| [i.id, i.updated]}\n self.coupon = Coupon.available.with_coupon.where(:_id => self.coupon_id).first\n self.coupon_id = Coupon.available.with_coupon.where(:_id => self.coupon_id).first.try :id #lame!\n self.coupon_removed = self.changed.include? \"coupon_id\"\n self.coupon_code, self.coupon_updated_at = nil if self.coupon_removed\n #self.coupon_has_been_updated = self.coupon_updated_at != self.coupon.try(:updated_at)\n self.last_check_at = Time.now.utc\n end\n reset_tax_and_shipping if cart_items.any?(&:updated?) || self.removed > 0 || self.coupon_removed #|| self.coupon_updated_at != self.coupon.try(:updated_at)\n #self.coupon_updated_at = self.coupon.try(:updated_at) if self.coupon_updated_at != self.coupon.try(:updated_at)\n apply_coupon_discount\n end", "title": "" }, { "docid": "ae51cddf252b2f3fd9d962f6b4816f72", "score": "0.6261114", "text": "def order_cart(cart)\n self.line_items = cart.line_items\n if cart.coupon_applied?\n self.coupon_code = cart.coupon_code\n self.coupon_discount = cart.coupon_value\n end\n end", "title": "" }, { "docid": "7acbbb4175508e7818f02e65f9ac1589", "score": "0.62549245", "text": "def apply_clearance(cart)\n clearance_cart = []\n index =0\n while index<cart.length\n if cart[index][:clearance]# == TRUE\n clearance_item = {\n :item => cart[index][:item],\n :price => (cart[index][:price] *= 0.8).round(2),\n :clearance => cart[index][:clearance],\n :count => cart[index][:count]}\n \n clearance_cart.push(clearance_item)\n else clearance_item = {\n :item => cart[index][:item],\n :price => cart[index][:price],\n :clearance => cart[index][:clearance],\n :count => cart[index][:count]}\n clearance_cart.push(clearance_item)\n end\n index+=1\n end\nclearance_cart\nend", "title": "" }, { "docid": "79b5a6b9354cc1e8c92ca316b97533da", "score": "0.62506855", "text": "def update\n new_coupon = Coupon.new(coupon_params)\n new_coupon.set_discount_ID\n new_coupon.validate_couponcode = true unless new_coupon.coupon_code.strip == @coupon.coupon_code\n if new_coupon.valid?\n if is_changed_coupon?(@coupon, new_coupon)\n @coupon.update_column(:deleted, true)\n new_coupon.save\n else\n @coupon.update_attributes(updated_at: Time.now)\n end\n flash[:success] = Spree.t('Coupon has been successfully updated.')\n redirect_to '/spree/admin/coupons'\n else\n\n #@coupon = new_coupon\n @coupon.assign_attributes(coupon_params)\n @coupon.set_discount_ID\n @coupon.save\n #@coupon.update_attributes(coupon_params)\n render 'new'\n end\n\n end", "title": "" }, { "docid": "acc17cd477bf74f4fa46ea516d85bae9", "score": "0.62484294", "text": "def apply_clearance(cart)\n cart = cart.dup\n cart.each do |item, data|\n # if clearance is true = take 20% off; no discount = return cart\n data[:clearance] ? data[:price] = (data[:price]*0.8).round(2) : cart\n end\nend", "title": "" }, { "docid": "7280b951022e381a45a676c7b2f93da8", "score": "0.6245184", "text": "def update_cart_counts(cart, counts)\n cart.uniq!\n cart.each do |item|\n # {\"AVOCADO\"=>{:price=>3.0, :clearance_items=>true}}\n item.each do |name, attributes|\n # key is \"AVOCADO\", value is {:price=>3.0, :clearance_items=>true}\n # counts is {\"AVOCADO\"=>2, \"KALE\"=>2, \"BLACK_BEANS\"=>1, \"ALMONDS\"=>1, \"TEMPEH\"=>1, \"CHEESE\"=>1, \"BEER\"=>1, \"PEANUTBUTTER\"=>1, \"BEETS\"=>1}\n counts.each do |item2, number|\n # item2 should be \"AVOCADO\", and number should be 2\n attributes[:count] = number if item2 == name\n end\n end\n end\nend", "title": "" }, { "docid": "f0c2bb7b8e8cae90d0c1aae8fc764294", "score": "0.62346035", "text": "def apply_clearance(cart)\n cart.each_with_object({}) do |item, new_cart|\n key = item.first\n item_info = item[1]\n if item_info[:clearance] == true\n item_info[:price] -= 0.2 * item_info[:price]\n end\n new_cart[key] = item_info\n end\nend", "title": "" }, { "docid": "fef17d97526e4d8e8e1011bd6c046444", "score": "0.6224054", "text": "def checkout(cart, coupons)\n \n total = 0\n \n #binding.pry\n cart = consolidate_cart(cart)\n #binding.pry\n if cart.length == 1\n cart = apply_coupons(cart, coupons)\n cart_clearance = apply_clearance(cart)\n if cart_clearance.length > 1\n cart_clearance.each do |items, details|\n if details[:count] >=1\n total += (details[:price]*details[:count])\n end\n end\n else\n cart_clearance.each do |item, details|\n total += (details[:price]*details[:count])\n end\n end\n else\n cart = apply_coupons(cart, coupons)\n cart_clearance = apply_clearance(cart)\n cart_clearance.each do |item, details|\n total += (details[:price]*details[:count])\n end\n end\n \n #binding.pry\n if total > 100\n total = total*(0.90)\n end\n total\nend", "title": "" }, { "docid": "5a44bcb34e5da73b3fdd96c28af51950", "score": "0.6210282", "text": "def checkout(cart, coupons)\n cc_array = consolidate_cart(cart)\n ac_array = apply_coupons(cc_array, coupons)\n c_array = apply_clearance(ac_array)\n \n #begin looping through cart to calculate total\n \n element_index = 0\n total = 0.00\n while element_index < c_array.length do\n total += c_array[element_index][:price] * c_array[element_index][:count]\n element_index += 1\n end \n if total > 100.00\n final_total = total * 0.90\n else \n final_total = total\n end\n final_total\nend", "title": "" }, { "docid": "1feda1da83fe713fd29ef69225ab8ace", "score": "0.62029433", "text": "def consolidate_cart(cart:[])\n # variables for later\n new_grocery_hash = {}\n # iterate over each item in the orignial cart\n cart.each do |item|\n # iterate over the k:v pairs in the original cart hash\n item.each do |food,data|\n # add the old items to the new hash\n if new_grocery_hash.member?(food) != true\n new_grocery_hash[food] = data\n # include a count of the new item\n data.store(:count, 1)\n else\n # incremement the count of an existing item\n new_grocery_hash[food][:count] = new_grocery_hash[food][:count] + 1\n end\n end\n end\n new_grocery_hash\nend", "title": "" }, { "docid": "b91a49a37e2898808b1bd7f9a6ea3da6", "score": "0.61796415", "text": "def modify_prices(item, count_rule)\n items = @cart.select { |c_item| c_item.product_code == item.product_code }\n items.map! do |c_item|\n count_rule.new_val_factor.nil? ? c_item.price = count_rule.new_value : c_item.price *= count_rule.new_val_factor\n c_item\n end\n item.price = count_rule.new_value\n end", "title": "" }, { "docid": "be8ae0cb01701ef89827b547b367056c", "score": "0.6172383", "text": "def consolidate_cart(cart)\n\n index = 0\n consolidated_cart = []\n\nwhile index < cart.length do\n consolidated_cart_item = find_item_by_name_in_collection(cart[index][:item], consolidated_cart)\n item_name = cart[index][:item]\nif consolidated_cart_item != nil\n consolidated_cart_item[:count] += 1\nelse\nconsolidated_cart_item = {\n :item => cart[index][:item],\n :price => cart[index][:price],\n :clearance => cart[index][:clearance],\n :count =>1\n}\n consolidated_cart << consolidated_cart_item\n end\n index += 1\n end\n consolidated_cart\nend", "title": "" }, { "docid": "1c117d6709d5768b95f0a8f806c01658", "score": "0.61707747", "text": "def apply_clearance(cart)\n i = 0\n while i < cart.length do\n cart[i][:clearance] == true ? cart[i][:price] = (cart[i][:price]*0.8).round(2) : nil\n i += 1\n end\n cart\n # Consult README for inputs and outputs\n #\n # REMEMBER: This method **should** update cart\nend", "title": "" }, { "docid": "c40d219fde4b1be14c3635e3a0d18bd3", "score": "0.61698157", "text": "def apply_clearance(cart)\n cart.map do |item|\n if item[:clearance]\n item[:price] = (item[:price] * 0.8).round(2)\n end\n item\n end\nend", "title": "" }, { "docid": "c877e37a0b37cc9129d67d42696f22d8", "score": "0.61506087", "text": "def apply_clearance(cart)\n i = 0\n while i < cart.length\n item = cart[i]\n item_clearance = cart[i][:clearance]\n\n if item_clearance == true\n item[:price] = (item[:price] - ((item[:price] * 20.0) / 100))\n end\n\n i += 1\n end\n\n cart\nend", "title": "" }, { "docid": "144091373ac27971d9204df0f6a93e50", "score": "0.615016", "text": "def checkout(cart, coupons)\n #Consolidate cart...\n consolidated_cart = consolidate_cart(cart)\n # Apply coupons...\n coupons_applied = apply_coupons(consolidated_cart, coupons)\n #Apply clearance...\n final_cart = apply_clearance(coupons_applied)\n #start cart total at zero\n cart_total = 0\n #calculate the cost of the cart...\n final_cart.each do |item, attributes|\n item_total = attributes[:price] * attributes[:count]\n cart_total = cart_total + item_total\n end\n final_total = cart_total.round(2)\n # If the final_tota is > 100...\n if final_total > 100\n final_total *= 0.9\n end\n puts final_total\nend", "title": "" }, { "docid": "7133bc82a35d2d571f75f0717e403b6f", "score": "0.61336774", "text": "def apply_coupon(coupon)\n return nil if stripe_subscription_id.nil? or canceled? or coupon.nil? or !coupon.valid?\n\n # Update current customer with coupon\n stripe_customer = structure.stripe_customer\n stripe_customer.coupon = coupon.stripe_coupon_id\n stripe_customer.save\n\n self.coupon = coupon\n save\n end", "title": "" }, { "docid": "c785f9205c4e22b03358dfccab636503", "score": "0.6114446", "text": "def apply_clearance(cart)\n cart.each do |item, details|\n if details[:clearance] === true\n details[:price] = (details[:price] * 0.8).round(2)\n end\n end\n cart\nend", "title": "" }, { "docid": "9e207bf45592b5970aa45c021b3980ae", "score": "0.6104152", "text": "def consolidate_cart(cart)\n \n grocery_list =[]\n index = 0 \n \n while index<cart.length do\n \n item_name = cart[index][:item]\n item_price = cart[index][:price]\n item_clearance = cart[index][:clearance]\n \n if grocery_list.length == 0 \n grocery_list = [{:item => item_name, :price => item_price, :clearance => item_clearance, :count => 1}]\n \n elsif find_item_by_name_in_collection(item_name, grocery_list)\n \n grocery_index = 0\n while grocery_index < grocery_list.length do \n if grocery_list[grocery_index][:item] == item_name\n grocery_list[grocery_index][:count] +=1 \n end\n \n grocery_index += 1 \n end\n\n else\n grocery_list << {:item => item_name, :price => item_price, :clearance => item_clearance, :count => 1}\nend\n \n index += 1 \nend\n grocery_list\nend", "title": "" }, { "docid": "efc378f23d2d0984f53f123d7a35f81d", "score": "0.60857743", "text": "def apply_clearance(cart)\n # Consult README for inputs and outputs\n #\n # REMEMBER: This method **should** update cart\n cart_index = 0 \n while cart_index < cart.count do \n if cart[cart_index][:clearance] == true\n updated_price = cart[cart_index][:price] * 0.8\n cart[cart_index][:price] = updated_price.round(2)\n end\n cart_index += 1\n end\n cart\nend", "title": "" }, { "docid": "273f2704a24549f2dfeb2c4ea28a7916", "score": "0.60812664", "text": "def apply_coupon_code\n # find promotion code\n coupon_code = params[:coupon_code].to_s.gsub(/\\s+/, '').downcase\n promotion_code = Spree::PromotionCode.find_by value: coupon_code\n\n unless promotion_code\n return flow_render_coupon_error('Coupon code not found')\n end\n\n promotion = Spree::Promotion.find promotion_code.promotion_id\n experience_key = @order.flow_order.dig('experience', 'key')\n forbiden_keys = promotion.flow_data.dig('filter', 'experience') || []\n\n if experience_key.present? && !forbiden_keys.include?(experience_key)\n return flow_render_coupon_error('Promotion is not available in current country')\n end\n\n # authorize! :update, @order, order_token\n # all good, apply coupon to Solidus as Flow is not present\n\n @order.coupon_code = params[:coupon_code]\n @handler = Spree::PromotionHandler::Coupon.new(@order).apply\n\n if @handler.successful?\n render \"spree/api/promotions/handler\", status: 200\n else\n logger.error(\"apply_coupon_code_error=#{@handler.error.inspect}\")\n render \"spree/api/promotions/handler\", status: 422\n end\n end", "title": "" }, { "docid": "5286abc07111a33402b829c636c3c19b", "score": "0.60659117", "text": "def index\n @page_title = \"View Cart\"\n find_cart\n \n #hack to auto-apply a coupon\n # if Time.now >= Time.parse(\"06/30/2010 9:00 AM\")\n # @coupon = Coupon.find_by_coupon_number \"ship4free\"\n # if @cart.coupon.blank?\n # @cart.coupon = @coupon \n # @cart.save\n # end\n # end\n \n end", "title": "" }, { "docid": "deb9d8b1234e4d08d63c800695b82813", "score": "0.60637736", "text": "def checkout(cart: [], coupons: [])\r\n cart = consolidate_cart(cart: cart)\r\n cart = apply_coupons(cart: cart, coupons: coupons)\r\n cart = apply_clearance(cart: cart)\r\n result = 0\r\n cart.each do |food, info|\r\n result += (info[:price] * info[:count]).to_f\r\n end\r\n result > 100 ? result * 0.9 : result\r\nend", "title": "" }, { "docid": "b10b224e3ebe4e06250750c460cd510d", "score": "0.6060624", "text": "def coupon\n @coupon ||= Coupon.create!(user: reward.user, discount: money, minimum_order: money, unit: :value, unique: true, origin: :reward)\n end", "title": "" }, { "docid": "80d7a7a6675ebc4c6bd633eef9f09f6d", "score": "0.6058968", "text": "def consolidate_cart(cart)\n consolidated = { }\n cart.each do |item|\n if consolidated[item.keys[0]]\n consolidated[item.keys[0]][:count] += 1\n else\n consolidated[item.keys[0]] = {\n price:item.values[0][:price],\n clearance:item.values[0][:clearance],\n count: 1\n }\n end\n end\n return consolidated\nend", "title": "" }, { "docid": "e0d013fa439b21d857537710b4b9a779", "score": "0.6029933", "text": "def add(item, promo_code=nil)\n @promo_code = promo_code || @promo_code # only set if present\n reset_bill_items!\n if @cart_items.has_key?(item.product)\n @cart_items[item.product].quantity += item.quantity\n else\n @cart_items[item.product] = item.clone\n end\n end", "title": "" }, { "docid": "0f97d0ace342c591bfeba81a0a176d3b", "score": "0.6021336", "text": "def apply_clearance(cart)\n cart.each do |item, attributes|\n if attributes[:clearance] == true\n clearance_price = attributes[:price] * 0.8\n attributes[:price] = clearance_price.round(2)\n else\n #do nothing\n end\n end\n cart\n end", "title": "" }, { "docid": "e748a6a8eca1b528d505e5d79d3e5eb1", "score": "0.6020511", "text": "def apply_clearance(cart)\n # code here\n cart.each do |key, value|\n if value[:clearance] == true\n updated_price = value[:price] * 0.80\n value[:price] = updated_price.round(2)\n end \n end\n cart\nend", "title": "" }, { "docid": "cfd5caca4ed08eb43ac5d279db90ab34", "score": "0.6019184", "text": "def with_coupon(coupon)\n @coupon = coupon\n\n self\n end", "title": "" }, { "docid": "3a44e42b4ddaf28a445f12b0772a076e", "score": "0.60078496", "text": "def update\n # Admin only\n if !current_user_is_admin\n respond_to do |format|\n format.html { redirect_to items_path }\n end\n return\n end\n\n @coupon.name = coupon_params[:name].upcase\n @coupon.discount = coupon_params[:discount]\n \n respond_to do |format|\n if @coupon.save\n format.html { redirect_to @coupon, notice: 'Coupon was successfully updated.' }\n format.json { render :show, status: :ok, location: @coupon }\n else\n format.html { render :edit }\n format.json { render json: @coupon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4acb2b27b56d78bdda636ae90bbabb40", "score": "0.60073847", "text": "def checkoutForm\n #render :json=>params['couponCode']\n @coupon_id= @@coupon_used_id\n while ShoppingCardItem.where(user:current_user).length > 0 do\n @first_store=ShoppingCardItem.find_by(user:current_user).product.store\n @store_products=Product.where(store:@first_store)\n @products=ShoppingCardItem.where(user:current_user,product:@store_products)\n \n # @coupon=Coupon.find(@coupon_id)\n if@coupon_id==0\n @order=Order.create!(status:\"Pending\",user:current_user,store:@first_store)\n else\n @order=Order.create!(status:\"Pending\",user:current_user,store:@first_store,coupon_id: @coupon_id)\n end\n @products.each do |product|\n @orderDetail=OrderDetail.create(paid_price:product.product.price,product:product.product,order:@order,amount:product.quantity)\n @orderDetail.save\n @orderDetail.product.quantity=@orderDetail.product.quantity-@orderDetail.amount\n @orderDetail.product.save\n end\n @products.delete_all\n @@discount =0\n @@coupon_used_id = 0\n end\n \n redirect_to shopping_card_item_index_path \n end", "title": "" }, { "docid": "541493a74f350eee445943a627e925ad", "score": "0.600029", "text": "def consolidate_cart(cart)\n # Consult README for inputs and outputs\n #\n # REMEMBER: This returns a new Array that represents the cart. Don't merely\n # change `cart` (i.e. mutate) it. It's easier to return a new thing.\n i = 0\n new_cart = []\n\n while i < cart.length do\n new_cart_item = find_item_by_name_in_collection(cart[i][:item], new_cart)\n if new_cart_item != nil\n #If new_cart_item is present then...\n new_cart_item[:count] += 1\n #Increase :count :key by one.\n else\n #Recreates hash that, but also adds a new :counter key and sets it to 1\n new_cart_item = {\n item: cart[i][:item],\n price: cart[i][:price],\n clearance: cart[i][:clearance],\n count: 1\n }\n new_cart << new_cart_item\n end\n i += 1\n end\n new_cart\nend", "title": "" }, { "docid": "726fbfcb599d829e450b080b8ab43107", "score": "0.59852463", "text": "def update_total_price_and_quantity_in_cart\n \n # update price and quantity\n cart = get_current_cart\n price = 0\n quantity = 0\n cart.items.each do |item|\n price += item.price*item.quantity\n quantity += item.quantity\n end\n cart.price = price\n cart.quantity = quantity\n \n # update coupon price if necessary\n if cart.coupon_id\n cart.discount_price = calculate_discount_price(cart.price, cart.coupon)\n end\n \n cart.save! \n end", "title": "" }, { "docid": "a2610e92aa0c8fc0a9577321a764b093", "score": "0.5984248", "text": "def consolidate_cart(cart)\n new_cart = []\n index = 0 \n while index < cart.length do\n new_cart_item = find_item_by_name_in_collection(cart[index][:item], new_cart)\n if new_cart_item \n new_cart_item[:count] += 1\n else\n new_cart_item = {\n :item => cart[index][:item],\n :price => cart[index][:price],\n :clearance => cart[index][:clearance],\n :count => 1\n }\n new_cart << (new_cart_item)\n end \n index += 1\n end \n new_cart\nend", "title": "" }, { "docid": "8e2ac9ace7e985aab0f4203d2f837628", "score": "0.59792906", "text": "def apply_clearance(cart)\n i = 0 \n while i < cart.length do\n if cart[i][:clearance] == true\n cart[i][:price] = (cart[i][:price] * 0.8).round(2)\n end\n i += 1 \n end \n cart\nend", "title": "" }, { "docid": "4f6d28b960cb06820ce1b8bf75a2378e", "score": "0.59719926", "text": "def apply_clearance(cart)\n # code here\n cart.each do |key, value|\n if value[:clearance]\n value[:price] = (value[:price] * 0.8).round(2)\n end\n end\n\n return cart\nend", "title": "" }, { "docid": "e85fe9f2bbd05b771dea5a59e02beadb", "score": "0.59599924", "text": "def redeem_coupon\n coupon.redeem! if coupon\n end", "title": "" }, { "docid": "16db1531a037880fac8d30de9788fa5f", "score": "0.5943393", "text": "def create\n unless coupon\n flash[:error] = I18n.t('coupon.applied_fail')\n redirect_to navigation.back(1)\n return\n end\n if apply_coupon.success?\n flash[:success] = I18n.t('coupon.applied_successfully')\n else\n flash[:error] = \"#{apply_coupon.error}\"\n end\n redirect_to navigation.back(1)\n end", "title": "" }, { "docid": "12f2f223186b8a54556b49289fb51f11", "score": "0.59423643", "text": "def consolidate_cart(cart)\n result = []\n i = 0 \n while i < cart.length do \n new_cart_item = find_item_by_name_in_collection(cart[i][:item], result)\n if new_cart_item != nil\n new_cart_item[:count] += 1 \n else \n new_cart_item = {\n item: cart[i][:item],\n price: cart[i][:price],\n clearance: cart[i][:clearance],\n count: 1\n }\n result << new_cart_item\n end\n i += 1\n end\n result\nend", "title": "" }, { "docid": "ef0608a2added632235fea965ed46cfa", "score": "0.59402066", "text": "def add_item_to_cart(new_item, cart)\n # iterate through the items in the cart\n # if the item already exists; increment the count of that item\n i = 0\n item_found = false\n while i < cart.count do\n if new_item[:name] == cart[i][:name]\n cart[i][:count] += 1\n item_found = true\n end\n i += 1\n end\n\n # if the item does NOT already exist in the cart, add the item to the cart\n if !item_found\n item_to_add = {\n :item => new_item[:item],\n :price => new_item[:price],\n :clearance => new_item[:clearance],\n :count => 1\n }\n cart << item_to_add\n end\n cart\nend", "title": "" }, { "docid": "d7307a9a5a537b518e45cb9adc921e81", "score": "0.59306306", "text": "def run(cart)\n total_shirts = 0 # total shirts to discount\n applicable_items = cart.line_items.select do |line_item|\n is_shirt = line_item.variant.product.tags.include? 'shirts'\n is_bundle = line_item.variant.product.tags.include? 'bundle'\n if is_shirt and is_bundle\n total_shirts += line_item.quantity\n line_item\n end\n end\n\n # The remaining amount of items that can be discounted in each category\n threes = (total_shirts / 3).floor * 3\n twos = ((total_shirts % 3) / 2).floor * 2\n \n # Change the price of applicable items\n applicable_items.each do |item|\n for q in 1..item.quantity\n if threes > 0\n new_price = item.line_price - @discount_of_3\n threes -= 1\n item.change_line_price(new_price, message: \"\")\n elsif twos > 0\n new_price = item.line_price - @discount_of_2\n twos -= 1\n item.change_line_price(new_price, message: \"\")\n end\n end\n end\n end", "title": "" }, { "docid": "3ffd9464dc90f4a65260cae98833bb8c", "score": "0.5926688", "text": "def consolidate_cart(cart)\n consolidated = {}\n cart.each do |single_item|\n # puts \"#{single_item}\"\n single_item.each do |item_name, item_values|\n # puts \"#{item_name}::#{item_values}\"\n if consolidated[item_name].nil?\n consolidated[item_name] = item_values\n consolidated[item_name][:count] = 1\n else\n consolidated[item_name][:count] += 1\n end #if consolidated\n end #item_name\n end\n consolidated\nend", "title": "" }, { "docid": "ae076f280ff32ddb60a575172e3a2e4b", "score": "0.592644", "text": "def recalculate!\n if payment_detail_coupon_code.nil?\n update_attribute(:amount, line_item.total_cost)\n else\n update_attribute(:amount, payment_detail_coupon_code.price)\n end\n end", "title": "" } ]
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "f392c181864a13ef6567e80e653689de", "score": "0.5698631", "text": "def legal_form=(legal_form)\n validator = EnumAttributeValidator.new('String', ['1000', '1100', '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2110', '2120', '2210', '2220', '2310', '2320', '2385', '2400', '2700', '2900', '3110', '3120', '3205', '3210', '3220', '3290', '4110', '4120', '4130', '4140', '4150', '4160', '5191', '5192', '5193', '5194', '5195', '5196', '5202', '5203', '5306', '5307', '5308', '5309', '5385', '5410', '5415', '5422', '5426', '5430', '5431', '5432', '5442', '5443', '5451', '5453', '5454', '5455', '5458', '5459', '5460', '5485', '5498', '5499', '5505', '5510', '5515', '5520', '5522', '5525', '5530', '5531', '5532', '5542', '5543', '5546', '5547', '5548', '5551', '5552', '5553', '5554', '5555', '5558', '5559', '5560', '5585', '5599', '5605', '5610', '5615', '5620', '5622', '5625', '5630', '5631', '5632', '5642', '5643', '5646', '5647', '5648', '5651', '5652', '5653', '5654', '5655', '5658', '5659', '5660', '5685', '5699', '5710', '5720', '5785', '5800', '6100', '6210', '6220', '6316', '6317', '6318', '6411', '6521', '6532', '6533', '6534', '6535', '6536', '6537', '6538', '6539', '6540', '6541', '6542', '6543', '6544', '6551', '6554', '6558', '6560', '6561', '6562', '6563', '6564', '6565', '6566', '6567', '6568', '6569', '6571', '6572', '6573', '6574', '6575', '6576', '6577', '6578', '6585', '6588', '6589', '6595', '6596', '6597', '6598', '6599', '6901', '7111', '7112', '7113', '7120', '7150', '7160', '7171', '7172', '7179', '7190', '7210', '7220', '7225', '7229', '7230', '7312', '7313', '7314', '7321', '7322', '7323', '7331', '7340', '7341', '7342', '7343', '7344', '7345', '7346', '7347', '7348', '7349', '7351', '7352', '7353', '7354', '7355', '7356', '7361', '7362', '7363', '7364', '7365', '7366', '7371', '7372', '7373', '7378', '7379', '7381', '7382', '7383', '7384', '7385', '7389', '7410', '7430', '7450', '7470', '7490', '8110', '8120', '8130', '8140', '8150', '8160', '8170', '8190', '8210', '8250', '8290', '8310', '8311', '8410', '8420', '8450', '8470', '8490', '8510', '8520', '9110', '9150', '9210', '9220', '9221', '9222', '9223', '9224', '9230', '9240', '9260', '9300', '9900', '9970'])\n unless validator.valid?(legal_form)\n fail ArgumentError, 'invalid value for \"legal_form\", must be one of #{validator.allowable_values}.'\n end\n @legal_form = legal_form\n end", "title": "" } ]
[ { "docid": "8146b840a980695b919bbb80892fcc0c", "score": "0.6161179", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DEBIT_REVERSAL\", \"GPA_GRANT\", \"GPA_CREDIT_NETWORK_LOAD\", \"GPA_CREDIT_NETWORK_LOAD_CLEARING\", \"GPA_CREDIT_NETWORK_LOAD_REVERSAL\", \"GPA_DEBIT_NETWORK_LOAD\", \"GPA_DEBIT_NETWORK_LOAD_CLEARING\", \"GPA_DEBIT_NETWORK_LOAD_REVERSAL\", \"ORIGINAL_CREDIT_AUTH\", \"ORIGINAL_CREDIT_AUTH_CLEARING\", \"ORIGINAL_CREDIT_AUTH_REVERSAL\", \"ORIGINAL_CREDIT_AUTH_CAPTURE\", \"ORIGINAL_CREDIT_AUTH_CAPTURE_REVERSAL\", \"GPA_CREDIT_ISSUER_OPERATOR\", \"GPA_DEBIT_ISSUER_OPERATOR\", \"GPA_DEBIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION_REVERSAL\", \"GPA_CREDIT_CHARGEBACK\", \"GPA_CREDIT_CHARGEBACK_REVERSAL\", \"GPA_CREDIT_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT_REVERSAL\", \"MSA_CREDIT_PENDING\", \"MSA_CREDIT_PENDING_REVERSAL\", \"MSA_CREDIT_REVERSAL\", \"MSA_CREDIT\", \"MSA_DEBIT_REVERSAL\", \"MSA_DEBIT_PENDING_REVERSAL\", \"MSA_DEBIT\", \"MSA_CREDIT_AUTHORIZATION\", \"MSA_CREDIT_AUTHORIZATION_REVERSAL\", \"MSA_CREDIT_CHARGEBACK\", \"MSA_CREDIT_CHARGEBACK_REVERSAL\", \"AUTHORIZATION\", \"AUTHORIZATION_INCREMENTAL\", \"AUTHORIZATION_ADVICE\", \"AUTHORIZATION_REVERSAL\", \"AUTHORIZATION_CASHBACK\", \"AUTHORIZATION_QUASI_CASH\", \"AUTHORIZATION_ATM_WITHDRAWAL\", \"AUTHORIZATION_CLEARING\", \"AUTHORIZATION_CLEARING_NETWORK_FEE\", \"AUTHORIZATION_CLEARING_REPRESENTMENT\", \"AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"DISPUTE_CREDIT\", \"DISPUTE_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK\", \"AUTHORIZATION_CLEARING_CHARGEBACK_REVERSAL\", \"AUTHORIZATION_CLEARING_CHARGEBACK_COMPLETED\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_CREDIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_WRITEOFF\", \"AUTHORIZATION_CLEARING_CASHBACK\", \"AUTHORIZATION_CLEARING_QUASI_CASH\", \"AUTHORIZATION_CLEARING_ATM_WITHDRAWAL\", \"ACCOUNT_FUNDING_AUTHORIZATION\", \"ACCOUNT_FUNDING_AUTHORIZATION_CLEARING\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE\", \"ACCOUNT_FUNDING_AUTHORIZATION_REVERSAL\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE_REVERSAL\", \"BALANCE_INQUIRY\", \"REFUND\", \"PIN_DEBIT_CREDIT_ADJUSTMENT\", \"PIN_DEBIT_DEBIT_ADJUSTMENT\", \"PIN_DEBIT_ATM_WITHDRAWAL\", \"PIN_DEBIT_QUASI_CASH\", \"PIN_DEBIT_BALANCE_INQUIRY\", \"PIN_DEBIT_CASHBACK\", \"PIN_DEBIT_CHECK_AVS\", \"PIN_DEBIT_FINANCIAL_DEPOSIT\", \"PIN_DEBIT_FINANCIAL_REFUND\", \"PIN_DEBIT_FINANCIAL_REVERSAL\", \"PIN_DEBIT_FINANCIAL_REFUND_REVERSAL\", \"PIN_DEBIT_TRANSFER\", \"PIN_DEBIT\", \"PIN_DEBIT_REPRESENTMENT\", \"PIN_DEBIT_AUTHORIZATION\", \"PIN_DEBIT_AUTHORIZATION_CLEARING\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"PIN_DEBIT_CHARGEBACK\", \"PIN_DEBIT_CHARGEBACK_REVERSAL\", \"PIN_DEBIT_CHARGEBACK_COMPLETED\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_CREDIT\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_DEBIT\", \"PIN_DEBIT_CHARGEBACK_WRITEOFF\", \"DIRECT_DEPOSIT_CREDIT\", \"DIRECT_DEPOSIT_DEBIT\", \"DIRECT_DEPOSIT_CREDIT_PENDING\", \"DIRECT_DEPOSIT_DEBIT_PENDING\", \"DIRECT_DEPOSIT_CREDIT_REJECT\", \"DIRECT_DEPOSIT_DEBIT_REJECT\", \"DIRECT_DEPOSIT_CREDIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_CREDIT_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_REVERSAL\", \"FEE_CHARGE_PENDING\", \"FEE_CHARGE\", \"FEE_CHARGE_REFUND\", \"FUNDS_EXPIRE\", \"PROGRAMRESERVE_CREDIT\", \"PROGRAMRESERVE_DEBIT\", \"REWARD_EARN\", \"TRANSFER_PEER\", \"TRANSFER_FEE\", \"ACCOUNT_CREDIT\", \"ACCOUNT_DEBIT\", \"TRANSFER_PROGRAM\", \"AUTHORIZATION_STANDIN\", \"PIN_DEBIT_STANDIN\", \"TOKEN_ACTIVATION_REQUEST\", \"TOKEN_ADVICE\", \"PTC_DEBIT\", \"PTC_PENDING_DB\", \"PTC_DB_REV\", \"BILLPAYMENT\", \"BILLPAYMENT_CLEARING\", \"BILLPAYMENT_REVERSAL\", \"RETURN_AUTHORIZATION\", \"RETURN_AUTHORIZATION_CLEARING\", \"RETURN_AUTHORIZATION_REVERSAL\", \"ACH_PUSH_PENDING\", \"ACH_PULL_PENDING\", \"ACH_PUSH\", \"ACH_PULL\", \"UNKNOWN\"])\n return false unless type_validator.valid?(@type)\n state_validator = EnumAttributeValidator.new('String', [\"PENDING\", \"CLEARED\", \"COMPLETION\", \"DECLINED\", \"ERROR\", \"ALL\"])\n return false unless state_validator.valid?(@state)\n true\n end", "title": "" }, { "docid": "6b0b457cb8436385a5e9979b4ce7a15c", "score": "0.61435664", "text": "def enum(allowed_values)\n allowed_values = allowed_values.to_a if allowed_values.is_a? Set\n assert_array allowed_values, minimum: 1, unique: true\n set enum: allowed_values\n end", "title": "" }, { "docid": "d9dcaa35507d9793fd3b833edd3f91e1", "score": "0.61418885", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n true\n end", "title": "" }, { "docid": "50bdc5024eb33d5cc47a16805de2bcde", "score": "0.6077904", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"GPA_CREDIT_PENDING\", \"GPA_CREDIT_PENDING_REVERSAL\", \"GPA_CREDIT_REVERSAL\", \"GPA_CREDIT\", \"GPA_DEBIT\", \"GPA_DEBIT_PENDING_REVERSAL\", \"GPA_DEBIT_REVERSAL\", \"GPA_GRANT\", \"GPA_CREDIT_NETWORK_LOAD\", \"GPA_CREDIT_NETWORK_LOAD_CLEARING\", \"GPA_CREDIT_NETWORK_LOAD_REVERSAL\", \"GPA_DEBIT_NETWORK_LOAD\", \"GPA_DEBIT_NETWORK_LOAD_CLEARING\", \"GPA_DEBIT_NETWORK_LOAD_REVERSAL\", \"ORIGINAL_CREDIT_AUTH\", \"ORIGINAL_CREDIT_AUTH_CLEARING\", \"ORIGINAL_CREDIT_AUTH_REVERSAL\", \"ORIGINAL_CREDIT_AUTH_CAPTURE\", \"ORIGINAL_CREDIT_AUTH_CAPTURE_REVERSAL\", \"GPA_CREDIT_ISSUER_OPERATOR\", \"GPA_DEBIT_ISSUER_OPERATOR\", \"GPA_DEBIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION\", \"GPA_CREDIT_AUTHORIZATION_REVERSAL\", \"GPA_CREDIT_CHARGEBACK\", \"GPA_CREDIT_CHARGEBACK_REVERSAL\", \"GPA_CREDIT_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT\", \"GPA_CREDIT_AUTHORIZATION_BILLPAYMENT_REVERSAL\", \"MSA_CREDIT_PENDING\", \"MSA_CREDIT_PENDING_REVERSAL\", \"MSA_CREDIT_REVERSAL\", \"MSA_CREDIT\", \"MSA_DEBIT_REVERSAL\", \"MSA_DEBIT_PENDING_REVERSAL\", \"MSA_DEBIT\", \"MSA_CREDIT_AUTHORIZATION\", \"MSA_CREDIT_AUTHORIZATION_REVERSAL\", \"MSA_CREDIT_CHARGEBACK\", \"MSA_CREDIT_CHARGEBACK_REVERSAL\", \"AUTHORIZATION\", \"AUTHORIZATION_INCREMENTAL\", \"AUTHORIZATION_ADVICE\", \"AUTHORIZATION_REVERSAL\", \"AUTHORIZATION_CASHBACK\", \"AUTHORIZATION_QUASI_CASH\", \"AUTHORIZATION_ATM_WITHDRAWAL\", \"AUTHORIZATION_CLEARING\", \"AUTHORIZATION_CLEARING_NETWORK_FEE\", \"AUTHORIZATION_CLEARING_REPRESENTMENT\", \"AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"DISPUTE_CREDIT\", \"DISPUTE_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK\", \"AUTHORIZATION_CLEARING_CHARGEBACK_REVERSAL\", \"AUTHORIZATION_CLEARING_CHARGEBACK_COMPLETED\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_CREDIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_PROVISIONAL_DEBIT\", \"AUTHORIZATION_CLEARING_CHARGEBACK_WRITEOFF\", \"AUTHORIZATION_CLEARING_CASHBACK\", \"AUTHORIZATION_CLEARING_QUASI_CASH\", \"AUTHORIZATION_CLEARING_ATM_WITHDRAWAL\", \"ACCOUNT_FUNDING_AUTHORIZATION\", \"ACCOUNT_FUNDING_AUTHORIZATION_CLEARING\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE\", \"ACCOUNT_FUNDING_AUTHORIZATION_REVERSAL\", \"ACCOUNT_FUNDING_PLUS_AUTH_CAPTURE_REVERSAL\", \"BALANCE_INQUIRY\", \"REFUND\", \"PIN_DEBIT_CREDIT_ADJUSTMENT\", \"PIN_DEBIT_DEBIT_ADJUSTMENT\", \"PIN_DEBIT_ATM_WITHDRAWAL\", \"PIN_DEBIT_QUASI_CASH\", \"PIN_DEBIT_BALANCE_INQUIRY\", \"PIN_DEBIT_CASHBACK\", \"PIN_DEBIT_CHECK_AVS\", \"PIN_DEBIT_FINANCIAL_DEPOSIT\", \"PIN_DEBIT_FINANCIAL_REFUND\", \"PIN_DEBIT_FINANCIAL_REVERSAL\", \"PIN_DEBIT_FINANCIAL_REFUND_REVERSAL\", \"PIN_DEBIT_TRANSFER\", \"PIN_DEBIT\", \"PIN_DEBIT_REPRESENTMENT\", \"PIN_DEBIT_AUTHORIZATION\", \"PIN_DEBIT_AUTHORIZATION_CLEARING\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL\", \"PIN_DEBIT_AUTHORIZATION_REVERSAL_ISSUER_EXPIRATION\", \"PIN_DEBIT_CHARGEBACK\", \"PIN_DEBIT_CHARGEBACK_REVERSAL\", \"PIN_DEBIT_CHARGEBACK_COMPLETED\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_CREDIT\", \"PIN_DEBIT_CHARGEBACK_PROVISIONAL_DEBIT\", \"PIN_DEBIT_CHARGEBACK_WRITEOFF\", \"DIRECT_DEPOSIT_CREDIT\", \"DIRECT_DEPOSIT_DEBIT\", \"DIRECT_DEPOSIT_CREDIT_PENDING\", \"DIRECT_DEPOSIT_DEBIT_PENDING\", \"DIRECT_DEPOSIT_CREDIT_REJECT\", \"DIRECT_DEPOSIT_DEBIT_REJECT\", \"DIRECT_DEPOSIT_CREDIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_PENDING_REVERSAL\", \"DIRECT_DEPOSIT_CREDIT_REVERSAL\", \"DIRECT_DEPOSIT_DEBIT_REVERSAL\", \"FEE_CHARGE_PENDING\", \"FEE_CHARGE\", \"FEE_CHARGE_REFUND\", \"FUNDS_EXPIRE\", \"PROGRAMRESERVE_CREDIT\", \"PROGRAMRESERVE_DEBIT\", \"REWARD_EARN\", \"TRANSFER_PEER\", \"TRANSFER_FEE\", \"ACCOUNT_CREDIT\", \"ACCOUNT_DEBIT\", \"TRANSFER_PROGRAM\", \"AUTHORIZATION_STANDIN\", \"PIN_DEBIT_STANDIN\", \"TOKEN_ACTIVATION_REQUEST\", \"TOKEN_ADVICE\", \"PTC_DEBIT\", \"PTC_PENDING_DB\", \"PTC_DB_REV\", \"BILLPAYMENT\", \"BILLPAYMENT_CLEARING\", \"BILLPAYMENT_REVERSAL\", \"RETURN_AUTHORIZATION\", \"RETURN_AUTHORIZATION_CLEARING\", \"RETURN_AUTHORIZATION_REVERSAL\", \"ACH_PUSH_PENDING\", \"ACH_PULL_PENDING\", \"ACH_PUSH\", \"ACH_PULL\", \"UNKNOWN\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "title": "" }, { "docid": "07d1438832b26069a882c2a09375301c", "score": "0.60417545", "text": "def render_enums\n # get likely enum attributes\n enums = model_attributes.select{ |attr| field_is_enum?(attr) }\n\n # for each enum, create a constant, an enum field, and validation\n enums.map{ |attr|\n <<-code\n #{attr.name.pluralize.upcase} = { active: 'Active', inactive: 'Inactive' }\n enum #{attr.name}: #{attr.name.pluralize.upcase}.keys\n validates :#{attr.name}, presence: true\n\n code\n }.join\n end", "title": "" }, { "docid": "bdba344ee3068b68a1dd124382ad1a28", "score": "0.60138696", "text": "def attrib_bits_valid=(value); end", "title": "" }, { "docid": "30c46b971aa93fa1f09b3b39a63b38a1", "score": "0.60057545", "text": "def convert_to_enumeration?(attribute)\n !@only_attributes.include?(attribute)\n end", "title": "" }, { "docid": "450ccd97c49a359ffcded93bd336a796", "score": "0.6000713", "text": "def convert_to_enumeration?(attribute)\n !@only_attributes.include?(attribute)\n end", "title": "" }, { "docid": "dacfc418c94e13c05e3d69169aedd306", "score": "0.5939183", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"gpa.credit\", \"gpa.credit.pending\", \"gpa.credit.pending.reversal\", \"gpa.credit.reversal\", \"gpa.credit.networkload\", \"gpa.credit.networkload.reversal\", \"gpa.debit.networkload\", \"gpa.debit\", \"gpa.debit.pending\", \"gpa.debit.pending.reversal\", \"gpa.grant\", \"gpa.credit.issueroperator\", \"gpa.debit.issueroperator\", \"gpa.credit.chargeback\", \"gpa.credit.chargeback.reversal\", \"gpa.credit.billpayment\", \"gpa.credit.authorization.billpayment\", \"gpa.credit.authorization.billpayment.reversal\", \"msa.credit.pending\", \"msa.credit.pending.reversal\", \"msa.credit.reversal\", \"msa.credit\", \"msa.debit.pending\", \"msa.debit.pending.reversal\", \"msa.debit\", \"msa.credit.chargeback\", \"msa.credit.chargeback.reversal\", \"authorization\", \"authorization.advice\", \"authorization.reversal\", \"authorization.clearing\", \"authorization.reversal.issuerexpiration\", \"dispute.credit\", \"dispute.debit\", \"authorization.clearing.chargeback\", \"authorization.clearing.chargeback.reversal\", \"refund\", \"pindebit.atm.withdrawal\", \"pindebit.balanceinquiry\", \"pindebit.cashback\", \"pindebit\", \"programreserve.credit\", \"programreserve.debit\", \"fee.charge.pending\", \"fee.charge\", \"fee.charge.pending.refund\", \"funds.expire\", \"reward.earn\", \"transfer.peer\", \"transfer.fee\", \"account.credit\", \"account.debit\", \"balanceinquiry\", \"authorization.atm.withdrawal\", \"authorization.clearing.atm.withdrawal\", \"authorization.cashback\", \"authorization.clearing.cashback\", \"transfer.program\", \"authorization.quasi.cash\", \"authorization.clearing.quasi.cash\", \"authorization.incremental\", \"gpa.credit.authorization\", \"gpa.credit.authorization.reversal\", \"gpa.debit.reversal\", \"original.credit.authorization\", \"original.credit.authorization.reversal\", \"original.credit.authorization.clearing\", \"original.credit.auth_plus_capture\", \"original.credit.auth_plus_capture.reversal\", \"refund.authorization\", \"refund.authorization.advice\", \"refund.authorization.clearing\", \"refund.authorization.reversal\", \"token.activation-request\", \"token.advice\", \"pindebit.authorization\", \"pindebit.authorization.clearing\", \"pindebit.authorization.reversal\", \"pindebit.authorization.reversal.issuerexpiration\", \"authorization.standin\", \"authorization.clearing.chargeback.completed\", \"authorization.clearing.chargeback.provisional.credit\", \"authorization.clearing.chargeback.provisional.debit\", \"authorization.clearing.chargeback.writeoff\", \"directdeposit.credit\", \"directdeposit.credit.pending\", \"directdeposit.credit.reject\", \"directdeposit.credit.pending.reversal\", \"directdeposit.credit.reversal\", \"directdeposit.debit\", \"directdeposit.debit.pending\", \"directdeposit.debit.reject\", \"directdeposit.debit.reversal\", \"directdeposit.debit.pending.reversal\", \"fee.charge.reversal\", \"pindebit.chargeback\", \"pindebit.chargeback.completed\", \"pindebit.chargeback.provisional.credit\", \"pindebit.chargeback.provisional.debit\", \"pindebit.chargeback.reversal\", \"pindebit.chargeback.writeoff\", \"pindebit.credit.adjustment\", \"pindebit.quasicash\", \"pindebit.refund\", \"pindebit.refund.reversal\", \"pindebit.reversal\", \"pindebit.transfer\", \"pushtocard.debit\", \"pushtocard.reversal\", \"unknown\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "title": "" }, { "docid": "75d6e889813df1b5e0b4c2647f24c0a2", "score": "0.5851587", "text": "def check_enum(key, val, validation)\n return false if !validation[:required] && val.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(val)\n\n val = 'nothing' if val.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{val}\"\n true\n end", "title": "" }, { "docid": "6d289fb843de67072e3ccd10998f1799", "score": "0.5803463", "text": "def valid?\n return false if !super\n style_validator = EnumAttributeValidator.new('String', ['None', 'MediumStyle2Accent1', 'MediumStyle2', 'NoStyleNoGrid', 'ThemedStyle1Accent1', 'ThemedStyle1Accent2', 'ThemedStyle1Accent3', 'ThemedStyle1Accent4', 'ThemedStyle1Accent5', 'ThemedStyle1Accent6', 'NoStyleTableGrid', 'ThemedStyle2Accent1', 'ThemedStyle2Accent2', 'ThemedStyle2Accent3', 'ThemedStyle2Accent4', 'ThemedStyle2Accent5', 'ThemedStyle2Accent6', 'LightStyle1', 'LightStyle1Accent1', 'LightStyle1Accent2', 'LightStyle1Accent3', 'LightStyle1Accent4', 'LightStyle2Accent5', 'LightStyle1Accent6', 'LightStyle2', 'LightStyle2Accent1', 'LightStyle2Accent2', 'LightStyle2Accent3', 'MediumStyle2Accent3', 'MediumStyle2Accent4', 'MediumStyle2Accent5', 'LightStyle2Accent6', 'LightStyle2Accent4', 'LightStyle3', 'LightStyle3Accent1', 'MediumStyle2Accent2', 'LightStyle3Accent2', 'LightStyle3Accent3', 'LightStyle3Accent4', 'LightStyle3Accent5', 'LightStyle3Accent6', 'MediumStyle1', 'MediumStyle1Accent1', 'MediumStyle1Accent2', 'MediumStyle1Accent3', 'MediumStyle1Accent4', 'MediumStyle1Accent5', 'MediumStyle1Accent6', 'MediumStyle2Accent6', 'MediumStyle3', 'MediumStyle3Accent1', 'MediumStyle3Accent2', 'MediumStyle3Accent3', 'MediumStyle3Accent4', 'MediumStyle3Accent5', 'MediumStyle3Accent6', 'MediumStyle4', 'MediumStyle4Accent1', 'MediumStyle4Accent2', 'MediumStyle4Accent3', 'MediumStyle4Accent4', 'MediumStyle4Accent5', 'MediumStyle4Accent6', 'DarkStyle1', 'DarkStyle1Accent1', 'DarkStyle1Accent2', 'DarkStyle1Accent3', 'DarkStyle1Accent4', 'DarkStyle1Accent5', 'DarkStyle1Accent6', 'DarkStyle2', 'DarkStyle2Accent1Accent2', 'DarkStyle2Accent3Accent4', 'DarkStyle2Accent5Accent6', 'LightStyle1Accent5', 'Custom'])\n return false unless style_validator.valid?(@style)\n true\n end", "title": "" }, { "docid": "68017d41b549e3ed8f9626d46579ace9", "score": "0.57846975", "text": "def validate_enum(option, enum)\n values = options[option]\n values.all? { |a| enum.include?(a) } || raise(ArgumentError, \"The --#{option} argument must consist of one or more space separated values from #{enum}. Got: #{values}\")\n end", "title": "" }, { "docid": "d80ba89cf3b6bd399ca742031726f20a", "score": "0.57566047", "text": "def valid?\n legal_form_validator = EnumAttributeValidator.new('String', ['1000', '1100', '1200', '1300', '1400', '1500', '1600', '1700', '1800', '1900', '2110', '2120', '2210', '2220', '2310', '2320', '2385', '2400', '2700', '2900', '3110', '3120', '3205', '3210', '3220', '3290', '4110', '4120', '4130', '4140', '4150', '4160', '5191', '5192', '5193', '5194', '5195', '5196', '5202', '5203', '5306', '5307', '5308', '5309', '5385', '5410', '5415', '5422', '5426', '5430', '5431', '5432', '5442', '5443', '5451', '5453', '5454', '5455', '5458', '5459', '5460', '5485', '5498', '5499', '5505', '5510', '5515', '5520', '5522', '5525', '5530', '5531', '5532', '5542', '5543', '5546', '5547', '5548', '5551', '5552', '5553', '5554', '5555', '5558', '5559', '5560', '5585', '5599', '5605', '5610', '5615', '5620', '5622', '5625', '5630', '5631', '5632', '5642', '5643', '5646', '5647', '5648', '5651', '5652', '5653', '5654', '5655', '5658', '5659', '5660', '5685', '5699', '5710', '5720', '5785', '5800', '6100', '6210', '6220', '6316', '6317', '6318', '6411', '6521', '6532', '6533', '6534', '6535', '6536', '6537', '6538', '6539', '6540', '6541', '6542', '6543', '6544', '6551', '6554', '6558', '6560', '6561', '6562', '6563', '6564', '6565', '6566', '6567', '6568', '6569', '6571', '6572', '6573', '6574', '6575', '6576', '6577', '6578', '6585', '6588', '6589', '6595', '6596', '6597', '6598', '6599', '6901', '7111', '7112', '7113', '7120', '7150', '7160', '7171', '7172', '7179', '7190', '7210', '7220', '7225', '7229', '7230', '7312', '7313', '7314', '7321', '7322', '7323', '7331', '7340', '7341', '7342', '7343', '7344', '7345', '7346', '7347', '7348', '7349', '7351', '7352', '7353', '7354', '7355', '7356', '7361', '7362', '7363', '7364', '7365', '7366', '7371', '7372', '7373', '7378', '7379', '7381', '7382', '7383', '7384', '7385', '7389', '7410', '7430', '7450', '7470', '7490', '8110', '8120', '8130', '8140', '8150', '8160', '8170', '8190', '8210', '8250', '8290', '8310', '8311', '8410', '8420', '8450', '8470', '8490', '8510', '8520', '9110', '9150', '9210', '9220', '9221', '9222', '9223', '9224', '9230', '9240', '9260', '9300', '9900', '9970'])\n return false unless legal_form_validator.valid?(@legal_form)\n legal_annual_turn_over_validator = EnumAttributeValidator.new('String', ['', '0-39', '40-99', '100-249', '250-999', '1000-2999', '3000-9999', '10000-99999', '100000-*'])\n return false unless legal_annual_turn_over_validator.valid?(@legal_annual_turn_over)\n legal_net_income_range_validator = EnumAttributeValidator.new('String', ['', '0-4', '5-9', '10-49', '50-149', '150-499', '500-*'])\n return false unless legal_net_income_range_validator.valid?(@legal_net_income_range)\n legal_number_of_employee_range_validator = EnumAttributeValidator.new('String', ['', '0', '1-9', '10-99', '100-249', '250-*'])\n return false unless legal_number_of_employee_range_validator.valid?(@legal_number_of_employee_range)\n status_validator = EnumAttributeValidator.new('String', ['D', 'N', 'I', 'A', 'C', 'T', 'S', 'L', 'O'])\n return false unless status_validator.valid?(@status)\n true\n end", "title": "" }, { "docid": "71e396ecd3fe724dfdc8a3e319ab3533", "score": "0.57389516", "text": "def validate_enum(enum_class, item)\n case item\n when String, Symbol, Integer\n enum_class[item].present?\n when Hash\n name = item[:name]\n if (e = enum_class[name]).present?\n item.all?{ |attribute, value|\n e.send(attribute) == value\n }\n else\n false\n end\n else\n false\n end\n end", "title": "" }, { "docid": "6631a2651ae0f1379b4c6086d7c060e9", "score": "0.57388884", "text": "def valid?\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n return true\n end", "title": "" }, { "docid": "01ae05766f20de61607b667fad9a6158", "score": "0.5708027", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "title": "" }, { "docid": "0bc1128f4beb4af030e8814b0da2d801", "score": "0.5700165", "text": "def enum_validator(sym, values, opts=nil)\r\n opts ||= {}\r\n default = (opts.key?(:default)) ? opts[:default] : values[0]\r\n message = opts[:message] || \"should be one of #{values.join ', '}\"\r\n allow_nil = opts[:allow_nil] || false\r\n\r\n my_const_set sym, 'ENUM_VALUES', values\r\n my_const_set sym, 'ENUM_DEFAULT', default\r\n my_const_set sym, 'VALIDATION_MESSAGE', message\r\n my_const_set sym, 'DB_OPTS', { :limit => values, :null => allow_nil, :default => default }\r\n\r\n validates_inclusion_of sym, :in => values, :message => message, :allow_nil => allow_nil\r\n end", "title": "" }, { "docid": "f741c9ca645e5667a9637cbdd35ef98b", "score": "0.567808", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"arity\", @arity)\n writer.write_enum_value(\"multivaluedComparisonType\", @multivalued_comparison_type)\n writer.write_collection_of_object_values(\"supportedAttributeTypes\", @supported_attribute_types)\n end", "title": "" }, { "docid": "ef543a39cb61fc92dc80acd0cd8c67da", "score": "0.56777334", "text": "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end", "title": "" }, { "docid": "c328fd8345a69d9ffb9f63b4db1acb76", "score": "0.56698906", "text": "def valid?\n currency_code_validator = EnumAttributeValidator.new('String', [\"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_code_validator.valid?(@currency_code)\n return true\n end", "title": "" }, { "docid": "bf3d36bad4e5502df67ae10502525859", "score": "0.5652725", "text": "def attr_status(*statuses)\n statuses.each do |status|\n define_method(\"#{status}!\".to_sym) { status!(status.to_sym) }\n define_method(\"#{status}?\".to_sym) { status?(status.to_sym) }\n protected \"#{status}!\".to_sym\n end\n end", "title": "" }, { "docid": "488932cbd8336d7c1006b95ab09ef24d", "score": "0.56496996", "text": "def has_enumerated?(attribute)\n return false if attribute.nil?\n enumerated_attributes.include? attribute.to_s\n end", "title": "" }, { "docid": "dab1835cab11879f4568621b568e25d8", "score": "0.5647114", "text": "def validates_acceptance_of(*attr_names); end", "title": "" }, { "docid": "dab1835cab11879f4568621b568e25d8", "score": "0.5647114", "text": "def validates_acceptance_of(*attr_names); end", "title": "" }, { "docid": "bc381d220261d0c14294b0afffdd2a1a", "score": "0.5631377", "text": "def attrib_bits_valid; end", "title": "" }, { "docid": "488c2884dcbb7c7fee190768699077e1", "score": "0.5608338", "text": "def integer_enums=(enums)\n if self.atype == Atype_Integer_Enum\n attribute_ranges.clear\n enums.each_with_index do |ar, ix|\n priority = nil\n if ar[:single]\n ar_low = ar[:single]\n else\n ar_low = ar[:low]\n priority = ar[:priority]\n end\n priority = ix + 1 if priority.blank?\n begin\n ar_low = Integer(ar_low)\n rescue\n next\n end\n attribute_ranges << \n AttributeRange.new(:integer_val_low => ar_low,\n :units_low => ar[:units_low], :priority => priority)\n end\n end\n end", "title": "" }, { "docid": "ade632ea1adb24e5cc374e365a4d9255", "score": "0.5606849", "text": "def enum_accessor(attribute, assignable_values)\n mapping[attribute] = assignable_values.map(&:intern)\n\n self.class.instance_eval do\n define_method(\"#{attribute}_values\") { mapping[attribute] }\n end\n\n self.class_eval do\n define_method(\"#{attribute}\") { instance_variable_get(\"@#{attribute}\") }\n define_method \"#{attribute}=\" do |value|\n raise NotEnumValueError, 'Value is not permitted' if value && !self.class.mapping[attribute].include?(value.intern)\n instance_variable_set(\"@#{attribute}\", value ? value.intern : nil)\n end\n end\n end", "title": "" }, { "docid": "799c558ea31390693a8eb16b0563ae17", "score": "0.55755025", "text": "def validate_enum!(enum)\n raise IncorrectTraversalStrategyError, enum unless enum.respond_to? :each\n end", "title": "" }, { "docid": "d9bc9ced5940fecaff78acf47a5c6158", "score": "0.55721456", "text": "def style=(style)\n validator = EnumAttributeValidator.new('String', ['None', 'MediumStyle2Accent1', 'MediumStyle2', 'NoStyleNoGrid', 'ThemedStyle1Accent1', 'ThemedStyle1Accent2', 'ThemedStyle1Accent3', 'ThemedStyle1Accent4', 'ThemedStyle1Accent5', 'ThemedStyle1Accent6', 'NoStyleTableGrid', 'ThemedStyle2Accent1', 'ThemedStyle2Accent2', 'ThemedStyle2Accent3', 'ThemedStyle2Accent4', 'ThemedStyle2Accent5', 'ThemedStyle2Accent6', 'LightStyle1', 'LightStyle1Accent1', 'LightStyle1Accent2', 'LightStyle1Accent3', 'LightStyle1Accent4', 'LightStyle2Accent5', 'LightStyle1Accent6', 'LightStyle2', 'LightStyle2Accent1', 'LightStyle2Accent2', 'LightStyle2Accent3', 'MediumStyle2Accent3', 'MediumStyle2Accent4', 'MediumStyle2Accent5', 'LightStyle2Accent6', 'LightStyle2Accent4', 'LightStyle3', 'LightStyle3Accent1', 'MediumStyle2Accent2', 'LightStyle3Accent2', 'LightStyle3Accent3', 'LightStyle3Accent4', 'LightStyle3Accent5', 'LightStyle3Accent6', 'MediumStyle1', 'MediumStyle1Accent1', 'MediumStyle1Accent2', 'MediumStyle1Accent3', 'MediumStyle1Accent4', 'MediumStyle1Accent5', 'MediumStyle1Accent6', 'MediumStyle2Accent6', 'MediumStyle3', 'MediumStyle3Accent1', 'MediumStyle3Accent2', 'MediumStyle3Accent3', 'MediumStyle3Accent4', 'MediumStyle3Accent5', 'MediumStyle3Accent6', 'MediumStyle4', 'MediumStyle4Accent1', 'MediumStyle4Accent2', 'MediumStyle4Accent3', 'MediumStyle4Accent4', 'MediumStyle4Accent5', 'MediumStyle4Accent6', 'DarkStyle1', 'DarkStyle1Accent1', 'DarkStyle1Accent2', 'DarkStyle1Accent3', 'DarkStyle1Accent4', 'DarkStyle1Accent5', 'DarkStyle1Accent6', 'DarkStyle2', 'DarkStyle2Accent1Accent2', 'DarkStyle2Accent3Accent4', 'DarkStyle2Accent5Accent6', 'LightStyle1Accent5', 'Custom'])\n unless validator.valid?(style)\n fail ArgumentError, 'invalid value for \"style\", must be one of #{validator.allowable_values}.'\n end\n @style = style\n end", "title": "" }, { "docid": "977c18580a3b1ddadf71ecf8af2fc24f", "score": "0.5508693", "text": "def enum_accessor(attribute, assignable_values)\n mapping[attribute] = assignable_values.map(&:intern)\n\n self.class.instance_eval do\n define_method(\"#{attribute}_values\") { mapping[attribute] }\n end\n\n class_eval do\n define_method(attribute.to_s) { instance_variable_get(\"@#{attribute}\") }\n define_method \"#{attribute}=\" do |value|\n raise NotEnumValueError, 'Value is not permitted' if value && !self.class.mapping[attribute].include?(value.intern)\n\n instance_variable_set(\"@#{attribute}\", value ? value.intern : nil)\n end\n end\n\n nil\n end", "title": "" }, { "docid": "718b23940a620946bc84a2b0e1a210a1", "score": "0.54985684", "text": "def bad_attribute(attribute, values)\n \"#{attribute} must be one of #{values.map(&:inspect).join(\", \")}\"\n end", "title": "" }, { "docid": "dce9facac4a142349af44f00a92abc9a", "score": "0.5497108", "text": "def it_should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n klass = self.described_type\n good_values.each do |v|\n describe \"allows #{attribute} to be set to #{v.inspect}\" do\n assert_good_value(klass, attribute, v)\n end\n end\n end", "title": "" }, { "docid": "c27b19e88fdd6da71c27e54ef6aa85cf", "score": "0.54969", "text": "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n klass = model_class\n klass = model_class\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, get_instance_of(klass)\n end\n end\n end", "title": "" }, { "docid": "61d3f6fcb634b4dcf4de166cba3324ff", "score": "0.54938996", "text": "def validates_attr(name, options = {})\n name = :\"attribute_#{name}\"\n\n if (choices = options.delete(:choices))\n supported_choices = choices.map do |c|\n c.is_a?(String) ? c.to_sym : c.to_s\n end.concat(choices)\n\n choices = choices.map(&:inspect).to_sentence(last_word_connector: \", or \")\n message = \"\\\"%<value>s\\\" is not valid. Options include: #{choices}.\"\n\n options.merge!(inclusion: { in: supported_choices, message: message })\n end\n\n validates(name, options)\n end", "title": "" }, { "docid": "c25a6cf764135f341117cbdb179eb6a8", "score": "0.5490385", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"cloudAppSecurityType\", @cloud_app_security_type)\n end", "title": "" }, { "docid": "8be2f363738b2de37fd7cdb9a36bdb67", "score": "0.5481565", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"type\", @type)\n end", "title": "" }, { "docid": "b567cfe3d53ce0cee192e447edb4f550", "score": "0.54563075", "text": "def validate_enum(current_schema, data, fragments)\n if !current_schema.schema['enum'].include?(data)\n message = \"The property '#{build_fragment(fragments)}' did not match one of the following values:\"\n current_schema.schema['enum'].each {|val|\n if val.is_a?(NilClass)\n message += \" null,\"\n elsif val.is_a?(Array)\n message += \" (array),\"\n elsif val.is_a?(Hash)\n message += \" (object),\"\n else\n message += \" #{val.to_s},\"\n end\n }\n message.chop!\n raise ValidationError.new(message, fragments, current_schema)\n end\n end", "title": "" }, { "docid": "4720ede289047948698982892c450ba1", "score": "0.54559237", "text": "def define_enum_setter(enum_name)\n method_name = \"#{ enum_name }=\"\n raise RuntimeError.new \"The method #{ method_name } already exists on this class.\" if respond_to? method_name\n\n define_method method_name do |*values|\n enumeration = rd_bitwise_enumerations[enum_name][:values].select{ |k,v| values.flatten.include?(k) }\n instance_variable_name = \"@#{ enum_name }\".to_sym\n\n ## Using a Bitwise \"|\" (OR) we will combine all of our flags\n ## to create the value to be stored.\n ##\n instance_variable_set instance_variable_name.to_sym, enumeration.map{ |k,v| v }.reduce(0) { |result, n| result | n }\n end\n end", "title": "" }, { "docid": "a5247474e69ad6546ee0119b7968dd7b", "score": "0.5445337", "text": "def valid_attributes\n [:default_value, :format, :list, :required, :type, :values]\n end", "title": "" }, { "docid": "06bfe8bd8c28b7b57ee3090d2a804ebf", "score": "0.54292357", "text": "def check_ranged_param(ranged_param, allowed)\n 🔞 = ranged_param.keys.map(&:to_sym) - allowed.map(&:to_sym)\n raise InvalidRangeException, \"Attributes #{🔞.map(&:to_s).to_sentence} doesn't exists or aren't rangeables. Available ranges are: #{allowed.to_sentence}\" if 🔞.any?\n end", "title": "" }, { "docid": "2a27a0daa7c74798cc6f47a01e3affbb", "score": "0.5417384", "text": "def valid_attribute?(tag, attribute)\n if LIMITED_ATTRIBUTES.key?(attribute.to_sym)\n return LIMITED_ATTRIBUTES[attribute.to_sym].include?(tag.to_sym)\n end\n return !FORBIDDEN_ATTRIBUTES.include?(attribute)\n end", "title": "" }, { "docid": "9c046178bf04c989733be8cad495b654", "score": "0.5416686", "text": "def attribute(name, type = Type::Value.new, *args, **options)\n arg_options = args.each_with_object({}) { |arg, hsh| hsh[arg.to_sym] = true }\n options = arg_options.merge options\n\n type = check_allowed_type type\n options[:of] = check_allowed_type(options[:of]) if options.key?(:of)\n\n attribute_metadata name, type, options\n\n build_attribute_aliases name, options\n\n options = Validations.build_for(self, name)\n\n super(name, type, **options)\n end", "title": "" }, { "docid": "2a28378335565698a8d97c2e9ca62f13", "score": "0.54132265", "text": "def do_validate(_name, value, errors)\n errors.add(\"invalid type '#{value}'\") unless @allowed_values.include?(value)\n end", "title": "" }, { "docid": "55b7551ca2a16c905eb7c3a540be4ea3", "score": "0.5411249", "text": "def define_active_enum_write_method(attribute)\n old_method = \"#{attribute}_without_enum=\"\n define_method(\"#{attribute}_with_enum=\") do |arg|\n enum = self.class.enum_for(attribute)\n if arg.is_a?(Symbol)\n value = enum[arg]\n send(old_method, value)\n else\n send(old_method, arg)\n end\n end\n\n alias_method_chain \"#{attribute}=\".to_sym, :enum\n end", "title": "" }, { "docid": "a34fd2533b915aa938ed0963f3ae7b79", "score": "0.5400308", "text": "def all_values\n attr = attribute\n vals = values_methods\n\n enum_klass = subtype.klass\n model_klass = klass\n\n # TODO: Rewrite these as string\n enum_module.module_eval do\n vals.each do |val, list|\n # scope :disabled, -> { where(status: 'disabled') }\n model_klass.scope list[0], -> do\n where(enum_klass.scope(arel_table[attr], val))\n end\n\n # def disabled? status.disabled? end\n define_method(list[1]) { send(attr).public_send(\"#{val}?\") }\n\n # def disabled!\n # changed = send(attr).public_send(\"#{val}!\")\n # save! if changed && enum_save_on_bang\n # true\n define_method(list[2]) do\n changed = send(attr).public_send(\"#{val}!\")\n return save! if changed && enum_save_on_bang\n true\n end\n end\n end\n end", "title": "" }, { "docid": "26732fa1c8bfc5d6f163fcfe9a286583", "score": "0.5393772", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"None\", \"Area\", \"Arrow\", \"Distance\", \"Ellipse\", \"Link\", \"Point\", \"Polyline\", \"ResourcesRedaction\", \"TextField\", \"TextHighlight\", \"TextRedaction\", \"TextReplacement\", \"TextStrikeout\", \"TextUnderline\", \"Watermark\", \"Image\", \"TextSquiggly\"])\n if type.to_i == 0\n unless validator.valid?(type)\n # raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n @type = validator.allowable_values[type.to_i]\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end", "title": "" }, { "docid": "9ca3e42b86b1d357fc5bdf80a9b8d9cb", "score": "0.53840685", "text": "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end", "title": "" }, { "docid": "d935a0603851a101823039c5e5bdf695", "score": "0.53678125", "text": "def validates_acceptance_of(*attr_names)\n configuration = { :message => ActiveRecord::Errors.default_error_messages[:accepted], :on => :save }\n configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash)\n\n for attr_name in attr_names\n attr_accessor(attr_name)\n class_eval(%(#{validation_method(configuration[:on])} %{errors.add('#{attr_name}', '#{configuration[:message]}') unless #{attr_name}.nil? or #{attr_name} == \"1\"}))\n end\n end", "title": "" }, { "docid": "9c088abf83d514d7a2552c2120dfa025", "score": "0.5365301", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"mode\", @mode)\n end", "title": "" }, { "docid": "e920ed00ab3733a5e7b6e9b884733a9c", "score": "0.5359162", "text": "def role_enum=(role)\n write_attribute(:role, role)\n end", "title": "" }, { "docid": "f187aca54cfe93d01eefb4eb3e43f331", "score": "0.535419", "text": "def ticket_status=(val)\r\n\r\nself.ticket_status__index_was = self.ticket_status__index\r\ncase val\r\nwhen nil\r\n write_attribute(:ticket_status, nil)\r\nwhen 1..11 # index\r\n write_attribute(:ticket_status, val)\r\nwhen \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\" # index as string\r\n write_attribute(:ticket_status, val.to_i)\r\nwhen *(self.ticket_status__potential_values) # value\r\n write_attribute(:ticket_status, self.ticket_status__potential_values.index(val) + 1)\r\nwhen *LOCALIZED_TICKET_STATUSES # localized value\r\n write_attribute(:ticket_status, LOCALIZED_TICKET_STATUSES.index(val) + 1)\r\nelse\r\n write_attribute(:ticket_status, nil)\r\nend\r\nend", "title": "" }, { "docid": "ffa2a8f8afc3c428fef0c1509c6c1a41", "score": "0.5343541", "text": "def validate_with_definition value, param\n sx = []\n case type\n when :enum\n enum = self.enum\n if enum.key?(value)\n value.replace(enum[value]) if enum[value] != value\n else\n sx.push \"#{vernacular} must be {#{enum.keys.sort.join('|')}}, not #{value.inspect}\"\n end\n when :integer ; /\\A-?\\d+\\z/ =~ value or\n sx.push(\"#{vernacular} must be an integer, not #{value.inspect}\")\n when :float ; /\\A-?\\d+(?:\\.\\d+)?\\z/ =~ value or\n sx.push(\"#{vernacular} must be a float, not {value.inspect}\")\n when :string, :file ; # string: nothing, all data is string data from our perspective\n else; fail(\"not yet, maybe one day timmy: #{type.inspect}\")\n end\n sentence_join sx\n end", "title": "" }, { "docid": "56e1d37d049e3d7fbbaa610f8be6b1f9", "score": "0.5342304", "text": "def attrib_bits=(value); end", "title": "" }, { "docid": "5df8b13d444ed10628dbc6b9d1afa674", "score": "0.533128", "text": "def check_enum(str)\n buf = String.new\n ar = (str.split('('))\n ar[1].chomp!(')')\n limit = ar[1].split(',')\n buf << \", :limit => [\"\n limit.each do |option|\n buf << ':' << option.tr(\"'\",\"\") << ','\n end\n buf.chomp!(',') # remove the last comma\n buf << ']' # end the options array \n end", "title": "" }, { "docid": "6e84adb3711bdbf84923e64ee61b24e0", "score": "0.53229517", "text": "def enum hash\n key = hash.keys.first\n (self.enums ||= {}).merge! hash\n define_attribute_methods if !attribute_methods_generated?\n class_eval %{\n def #{key}\n missing_attribute('#{key}', caller) unless @attributes.has_key?('#{key}')\n self.class.enums[:#{key}][@attributes['#{key}']]\n end\n def #{key}=(val)\n write_attribute('#{key}', Fixnum === val ? val : self.class.enums[:#{key}].index val.to_s\n end\n }\n end", "title": "" }, { "docid": "6ece11983f7f07b25217cd0ce22063c8", "score": "0.5321647", "text": "def currency_code=(currency_code)\n validator = EnumAttributeValidator.new('String', [\"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency_code)\n fail ArgumentError, \"invalid value for 'currency_code', must be one of #{validator.allowable_values}.\"\n end\n @currency_code = currency_code\n end", "title": "" }, { "docid": "586494cb36b3d47597bc00c4bef5caf8", "score": "0.53116965", "text": "def valid?\n entity_type_validator = EnumAttributeValidator.new('Integer', [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\", \"20\", \"21\", \"22\", \"23\", \"24\", \"25\", \"26\", \"27\", \"28\", \"29\", \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\", \"40\", \"41\", \"42\", \"43\", \"44\", \"45\", \"46\", \"47\", \"48\", \"49\", \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\", \"60\", \"61\", \"62\", \"63\", \"64\", \"65\", \"66\", \"67\", \"68\", \"69\", \"70\", \"71\", \"72\", \"73\", \"74\", \"75\", \"76\", \"77\", \"78\", \"79\", \"80\", \"81\", \"82\", \"83\", \"84\", \"85\", \"86\", \"87\", \"88\", \"89\", \"90\", \"91\", \"92\", \"93\", \"94\", \"95\", \"96\", \"97\", \"98\", \"99\", \"100\", \"101\", \"102\", \"103\", \"104\", \"105\", \"106\", \"107\", \"108\", \"109\", \"110\", \"111\", \"112\", \"113\", \"114\", \"115\", \"116\", \"118\", \"119\", \"120\", \"121\", \"122\", \"123\", \"124\", \"125\", \"126\", \"127\", \"128\", \"129\", \"300\", \"301\", \"302\", \"303\", \"304\", \"305\", \"306\", \"307\", \"308\", \"309\", \"310\", \"10000\", \"10001\", \"10002\", \"10003\"])\n return false unless entity_type_validator.valid?(@entity_type)\n return true\n end", "title": "" }, { "docid": "fcf257c078c19338e239395fe52d1bf7", "score": "0.529121", "text": "def required_numeric_attributes\n enum? ? [] : %i[min max default]\n end", "title": "" }, { "docid": "8744b6f6ec057efddfe190f0250661c2", "score": "0.5290592", "text": "def scope(attribute, value)\n attribute.contains(::Arel.array(value, cast: enum_source.type_name))\n end", "title": "" }, { "docid": "e7ed1f76c1df15f1da65493bac971b91", "score": "0.52896464", "text": "def enum_is_valid(mapper, enum_value)\n if enum_value.is_a?(String) && !enum_value.empty?\n model = get_model(mapper[:type][:module])\n model.constants.any? { |e| model.const_get(e).to_s.downcase == enum_value.downcase }\n else\n false\n end\n end", "title": "" }, { "docid": "7063c0729003125904b123f1afb4047a", "score": "0.52855855", "text": "def valid?\n return false if !super\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', ['Title', 'Text', 'TwoColumnText', 'Table', 'TextAndChart', 'ChartAndText', 'Diagram', 'Chart', 'TextAndClipArt', 'ClipArtAndText', 'TitleOnly', 'Blank', 'TextAndObject', 'ObjectAndText', 'Object', 'TitleAndObject', 'TextAndMedia', 'MediaAndText', 'ObjectOverText', 'TextOverObject', 'TextAndTwoObjects', 'TwoObjectsAndText', 'TwoObjectsOverText', 'FourObjects', 'VerticalText', 'ClipArtAndVerticalText', 'VerticalTitleAndText', 'VerticalTitleAndTextOverChart', 'TwoObjects', 'ObjectAndTwoObject', 'TwoObjectsAndObject', 'SectionHeader', 'TwoTextAndTwoObjects', 'TitleObjectAndCaption', 'PictureAndCaption', 'Custom'])\n return false unless type_validator.valid?(@type)\n true\n end", "title": "" }, { "docid": "c93e6e74c7ca8e3ec937ebaf83b2a76f", "score": "0.52768075", "text": "def attribute_value_allowed?(attribute_name, value)\n allowed_values = Hash(defined_attributes).fetch(attribute_name, {})[:allowed_values]\n\n value.nil? || allowed_values.nil? || allowed_values.include?(value)\n end", "title": "" }, { "docid": "0e7f6415a6d39d26b0d04e00bc265c9b", "score": "0.5266651", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"AP\", \"AR\", \"EE\", \"EI\", \"EO\", \"IA\", \"IT\", \"P\", \"PF\", \"R\", \"RA\", \"RD\", \"RE\", \"RP\", \"ST\", \"SD\", \"ET\", \"RM\", \"FT\", \"PT\"])\n return false unless type_validator.valid?(@type)\n expense_class_validator = EnumAttributeValidator.new('String', [\"NonReimbursable\", \"Reimbursable\", \"Personal\"])\n return false unless expense_class_validator.valid?(@expense_class)\n return true\n end", "title": "" }, { "docid": "6f2bdf88da66c4e515a530f51c13c388", "score": "0.5266496", "text": "def enum_types; end", "title": "" }, { "docid": "f4293acbc9bf8b16c2e3724403116f39", "score": "0.5264632", "text": "def allowed_values(type, field, workspace = nil)\n rally_workspace_object(workspace)\n \n type_def = get_typedef_for(type, workspace)\n allowed_vals = {}\n type_def[\"Attributes\"].each do |attr|\n next if attr[\"ElementName\"] != field\n attr[\"AllowedValues\"].each do |val_ref|\n val = val_ref[\"StringValue\"]\n val = \"Null\" if val.nil? || val.empty?\n allowed_vals[val] = true\n end\n end\n allowed_vals\n end", "title": "" }, { "docid": "980f1ecce12cb6af88aea60e530e6082", "score": "0.5254619", "text": "def attr_allowed(attribute, *args)\n opt = args.last.is_a?(Hash) ? args.pop : {}\n vals = {}\n args.flatten.map { |v| vals[v.to_sym] = v.to_s }\n defn = Definition.new(attribute, vals, opt)\n easy_attribute_accessors(attribute, defn)\n end", "title": "" }, { "docid": "7d42bd6632b5674e48aa4039d3b8ccee", "score": "0.5251053", "text": "def entity_type=(entity_type)\n validator = EnumAttributeValidator.new('Integer', [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\", \"13\", \"14\", \"15\", \"16\", \"17\", \"18\", \"19\", \"20\", \"21\", \"22\", \"23\", \"24\", \"25\", \"26\", \"27\", \"28\", \"29\", \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\", \"40\", \"41\", \"42\", \"43\", \"44\", \"45\", \"46\", \"47\", \"48\", \"49\", \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\", \"60\", \"61\", \"62\", \"63\", \"64\", \"65\", \"66\", \"67\", \"68\", \"69\", \"70\", \"71\", \"72\", \"73\", \"74\", \"75\", \"76\", \"77\", \"78\", \"79\", \"80\", \"81\", \"82\", \"83\", \"84\", \"85\", \"86\", \"87\", \"88\", \"89\", \"90\", \"91\", \"92\", \"93\", \"94\", \"95\", \"96\", \"97\", \"98\", \"99\", \"100\", \"101\", \"102\", \"103\", \"104\", \"105\", \"106\", \"107\", \"108\", \"109\", \"110\", \"111\", \"112\", \"113\", \"114\", \"115\", \"116\", \"118\", \"119\", \"120\", \"121\", \"122\", \"123\", \"124\", \"125\", \"126\", \"127\", \"128\", \"129\", \"300\", \"301\", \"302\", \"303\", \"304\", \"305\", \"306\", \"307\", \"308\", \"309\", \"310\", \"10000\", \"10001\", \"10002\", \"10003\"])\n unless validator.valid?(entity_type)\n fail ArgumentError, \"invalid value for 'entity_type', must be one of #{validator.allowable_values}.\"\n end\n @entity_type = entity_type\n end", "title": "" }, { "docid": "cb5074b4e936a2db2c33d0ad25a62fdf", "score": "0.52493125", "text": "def privilege_required=(privilege_required)\n validator = EnumAttributeValidator.new('String', ['N', 'L', 'H'])\n unless validator.valid?(privilege_required)\n fail ArgumentError, 'invalid value for \"privilege_required\", must be one of #{validator.allowable_values}.'\n end\n @privilege_required = privilege_required\n end", "title": "" }, { "docid": "6630708f3097fe961a4387771ec75898", "score": "0.5247862", "text": "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'Pdf16', 'Pdf17', 'PdfA1b', 'PdfA1a', 'PdfA2b', 'PdfA2a', 'PdfA3b', 'PdfA3a', 'PdfUa', 'PdfA2u'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end", "title": "" }, { "docid": "f26eec2ae4be71069d63afdafd26f153", "score": "0.52447504", "text": "def rewrite_enum_defaults; end", "title": "" }, { "docid": "2f3caf89293d72fac9358347684cc788", "score": "0.5230009", "text": "def allowed_values(value, pdef)\n if pdef.include?(value)\n true\n else\n \"Not an allowed value: #{pdef.join(\", \")}\"\n end\n end", "title": "" }, { "docid": "319a3a450dd9ecea8d2d82c7a2b61adb", "score": "0.5224236", "text": "def attribute_allowed?(attr)\n opts.fetch(:all_attributes, config[:all_attributes], allowed_attributes.include?(attr))\n end", "title": "" }, { "docid": "d723220910558b7a1c37d87921066b14", "score": "0.52220035", "text": "def valid?\n return false if !super\n limit_location_validator = EnumAttributeValidator.new('String', ['NotDefined', 'UnderOver', 'SubscriptSuperscript'])\n return false unless limit_location_validator.valid?(@limit_location)\n true\n end", "title": "" }, { "docid": "a5b84d23fe44fecd0d339a41afe7dcb4", "score": "0.5221673", "text": "def validate!\n if options[:required] && blank?\n raise \"'#{name}' attribute is required\"\n elsif options[:required_if]\n req_if = options[:required_if]\n if req_if.is_a?(Symbol) && (respond_to?(req_if, true) ? send(req_if) : req_if) && blank?\n raise \"'#{name}' attribute is required, because `required_if` is given (`#{req_if}`)\"\n end\n end\n\n if !value.is_a?(type)\n raise \"Value of attribute '#{name}' is not a #{type}\"\n end\n end", "title": "" }, { "docid": "6d9a7f4204ef963e52d948b0ce5dd80a", "score": "0.52203035", "text": "def error_type=(error_type)\n validator = EnumAttributeValidator.new('String', [\"INCORRECT_NUMBER_OF_COLUMNS\", \"INVALID_OBJECT_ID\", \"INVALID_ASSOCIATION_IDENTIFIER\", \"NO_OBJECT_ID_FROM_ASSOCIATION_IDENTIFIER\", \"MULTIPLE_COMPANIES_WITH_THIS_DOMAIN\", \"PROPERTY_DEFINITION_NOT_FOUND\", \"PROPERTY_VALUE_NOT_FOUND\", \"COULD_NOT_FIND_OWNER\", \"MULTIPLE_OWNERS_FOUND\", \"COULD_NOT_FIND_BUSINESS_UNIT\", \"COULD_NOT_PARSE_NUMBER\", \"COULD_NOT_PARSE_DATE\", \"COULD_NOT_PARSE_TERM\", \"OUTSIDE_VALID_TIME_RANGE\", \"OUTSIDE_VALID_TERM_RANGE\", \"COULD_NOT_PARSE_ROW\", \"INVALID_ENUMERATION_OPTION\", \"AMBIGUOUS_ENUMERATION_OPTION\", \"FAILED_VALIDATION\", \"FAILED_TO_CREATE_ASSOCIATION\", \"FILE_NOT_FOUND\", \"INVALID_COLUMN_CONFIGURATION\", \"INVALID_FILE_TYPE\", \"INVALID_SPREADSHEET\", \"INVALID_SHEET_COUNT\", \"FAILED_TO_PROCESS_OBJECT_WITH_EMPTY_PROPERTY_VALUES\", \"UNKNOWN_BAD_REQUEST\", \"GDPR_BLACKLISTED_EMAIL\", \"DUPLICATE_ASSOCIATION_ID\", \"LIMIT_EXCEEDED\", \"INVALID_ALTERNATE_ID\", \"INVALID_EMAIL\", \"INVALID_DOMAIN\", \"DUPLICATE_ROW_CONTENT\", \"INVALID_NUMBER_SIZE\", \"UNKNOWN_ERROR\", \"FAILED_TO_OPT_OUT_CONTACT\", \"INVALID_REQUIRED_PROPERTY\", \"MISSING_REQUIRED_PROPERTY\", \"DUPLICATE_ALTERNATE_ID\", \"DUPLICATE_OBJECT_ID\", \"DUPLICATE_UNIQUE_PROPERTY_VALUE\", \"BLANK_VALUE_PROVIDED\", \"UNKNOWN_ASSOCIATION_RECORD_ID\", \"INVALID_RECORD_ID\", \"DUPLICATE_RECORD_ID\", \"INVALID_CUSTOM_PROPERTY_VALIDATION\", \"CREATE_ONLY_IMPORT\", \"UPDATE_ONLY_IMPORT\", \"COLUMN_TOO_LARGE\"])\n unless validator.valid?(error_type)\n fail ArgumentError, \"invalid value for \\\"error_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @error_type = error_type\n end", "title": "" }, { "docid": "fe6b9841a175c460b83a392a86e9a4ac", "score": "0.5215364", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"allowedValues\", @allowed_values)\n writer.write_string_value(\"attributeSet\", @attribute_set)\n writer.write_string_value(\"description\", @description)\n writer.write_boolean_value(\"isCollection\", @is_collection)\n writer.write_boolean_value(\"isSearchable\", @is_searchable)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"status\", @status)\n writer.write_string_value(\"type\", @type)\n writer.write_boolean_value(\"usePreDefinedValuesOnly\", @use_pre_defined_values_only)\n end", "title": "" }, { "docid": "446494fcb3efd8f352acaca7c4a6d047", "score": "0.52149403", "text": "def create_enum(name, values); end", "title": "" }, { "docid": "79d03bfb9f000170105261083051cd19", "score": "0.52118015", "text": "def valid?\n side_validator = EnumAttributeValidator.new('String', [\"B\", \"L\"])\n return false unless side_validator.valid?(@side)\n pt_validator = EnumAttributeValidator.new('String', [\"L\", \"P\", \"MOC\"])\n return false unless pt_validator.valid?(@pt)\n ot_validator = EnumAttributeValidator.new('String', [\"L\", \"LOC\", \"MOC\"])\n return false unless ot_validator.valid?(@ot)\n status_validator = EnumAttributeValidator.new('String', [\"E\", \"EC\"])\n return false unless status_validator.valid?(@status)\n return true\n end", "title": "" }, { "docid": "9f71a66000c11a6d5f116fa9095577fa", "score": "0.5202486", "text": "def validate!\n validations.each do |v|\n value = send v[:attr_name]\n unless validate_value(value, v[:condition])\n raise ArgumentError, \"#{v[:attr_name]} validation failed, #{v[:condition]} missmatch\"\n end\n end\n end", "title": "" }, { "docid": "1e923cb61bf776a06ba32052325ed514", "score": "0.51983684", "text": "def define_enum_tests(enum_name)\n enumeration = rd_bitwise_enumerations[enum_name][:values]\n\n enumeration.each do |name, value|\n method_name = \"#{ name }?\".to_sym\n raise RuntimeError.new \"The method #{ method_name } already exists on this class.\" if respond_to? method_name\n\n define_method method_name do\n current_value = instance_variable_get \"@#{ enum_name }\"\n current_value | value == current_value\n end\n end\n end", "title": "" }, { "docid": "cc8b1fff0b0710ccdcc2397bc24114be", "score": "0.5186405", "text": "def allowed_values=(value)\n @allowed_values = value\n end", "title": "" }, { "docid": "634d57b32c5043b783dd4c8cf18001d0", "score": "0.5175521", "text": "def value_acceptable?\n self.allowed_values.blank? || self.allowed_values.include?(self.value)\n end", "title": "" }, { "docid": "c68d3dab8fc6a202b2ef083d686986af", "score": "0.5174282", "text": "def validate!\n VALID_RANGES.include?(self.value.to_i)\n end", "title": "" }, { "docid": "602f8ac854b2a536ca5e9e4cae0c354c", "score": "0.5172977", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['ClusteredColumn', 'StackedColumn', 'PercentsStackedColumn', 'ClusteredColumn3D', 'StackedColumn3D', 'PercentsStackedColumn3D', 'Column3D', 'ClusteredCylinder', 'StackedCylinder', 'PercentsStackedCylinder', 'Cylinder3D', 'ClusteredCone', 'StackedCone', 'PercentsStackedCone', 'Cone3D', 'ClusteredPyramid', 'StackedPyramid', 'PercentsStackedPyramid', 'Pyramid3D', 'Line', 'StackedLine', 'PercentsStackedLine', 'LineWithMarkers', 'StackedLineWithMarkers', 'PercentsStackedLineWithMarkers', 'Line3D', 'Pie', 'Pie3D', 'PieOfPie', 'ExplodedPie', 'ExplodedPie3D', 'BarOfPie', 'PercentsStackedBar', 'ClusteredBar3D', 'ClusteredBar', 'StackedBar', 'StackedBar3D', 'PercentsStackedBar3D', 'ClusteredHorizontalCylinder', 'StackedHorizontalCylinder', 'PercentsStackedHorizontalCylinder', 'ClusteredHorizontalCone', 'StackedHorizontalCone', 'PercentsStackedHorizontalCone', 'ClusteredHorizontalPyramid', 'StackedHorizontalPyramid', 'PercentsStackedHorizontalPyramid', 'Area', 'StackedArea', 'PercentsStackedArea', 'Area3D', 'StackedArea3D', 'PercentsStackedArea3D', 'ScatterWithMarkers', 'ScatterWithSmoothLinesAndMarkers', 'ScatterWithSmoothLines', 'ScatterWithStraightLinesAndMarkers', 'ScatterWithStraightLines', 'HighLowClose', 'OpenHighLowClose', 'VolumeHighLowClose', 'VolumeOpenHighLowClose', 'Surface3D', 'WireframeSurface3D', 'Contour', 'WireframeContour', 'Doughnut', 'ExplodedDoughnut', 'Bubble', 'BubbleWith3D', 'Radar', 'RadarWithMarkers', 'FilledRadar', 'SeriesOfMixedTypes', 'Treemap', 'Sunburst', 'Histogram', 'ParetoLine', 'BoxAndWhisker', 'Waterfall', 'Funnel', 'Map'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "title": "" }, { "docid": "a4520abf5f6d779b6fb201a1b817d260", "score": "0.5165406", "text": "def legal_annual_turn_over=(legal_annual_turn_over)\n validator = EnumAttributeValidator.new('String', ['', '0-39', '40-99', '100-249', '250-999', '1000-2999', '3000-9999', '10000-99999', '100000-*'])\n unless validator.valid?(legal_annual_turn_over)\n fail ArgumentError, 'invalid value for \"legal_annual_turn_over\", must be one of #{validator.allowable_values}.'\n end\n @legal_annual_turn_over = legal_annual_turn_over\n end", "title": "" }, { "docid": "dbedd61f66b340a99e72d5cc697d6928", "score": "0.51612365", "text": "def test_bad_value\n row = Enumeration.new\n row.color = :violet\n row.string_field = 'test'\n assert !row.save\n \n assert row.errors\n assert_equal ['is not included in the list'], row.errors['color']\n end", "title": "" }, { "docid": "19f9af10736a3af55177dd4c0d0b4c36", "score": "0.51487315", "text": "def side=(side)\n validator = EnumAttributeValidator.new('String', [\"B\", \"L\"])\n unless validator.valid?(side)\n fail ArgumentError, \"invalid value for 'side', must be one of #{validator.allowable_values}.\"\n end\n @side = side\n end", "title": "" }, { "docid": "b9a0d8742e3a4d9c8531bab0aa937aa9", "score": "0.5143194", "text": "def valid_attributes\n {\n name: \"Unlimited\"\n }\n end", "title": "" }, { "docid": "b9a0d8742e3a4d9c8531bab0aa937aa9", "score": "0.5143194", "text": "def valid_attributes\n {\n name: \"Unlimited\"\n }\n end", "title": "" }, { "docid": "4b656e823f1023cdcfc7123acf4549b9", "score": "0.5142558", "text": "def invalid_attribute_value(klass, value)\n raise ArgumentError,\n \"Declared attribute was #{klass}, received #{value}\"\n end", "title": "" }, { "docid": "728825a97d6143ec1d1ba0b555b074b4", "score": "0.5142094", "text": "def supported_attribute_types=(value)\n @supported_attribute_types = value\n end", "title": "" }, { "docid": "3166f88ed8e7b3071fc74b28818b2cf5", "score": "0.51374906", "text": "def define_writer(name, options = {})\n values = extract_values_from(options)\n format = extract_format_from(options)\n types = extract_types_from(options)\n\n define_method(\"#{name}=\") do |value|\n raise InvalidAttributeValue.new(value, values) if values && !values.include?(value)\n\n raise InvalidAttributeFormat.new(value, format) if !format.nil? && value !~ format\n\n raise InvalidAttributeType.new(value, types) if value && types && types.none? { |klass| value.is_a?(klass) }\n\n instance_variable_set(:\"@#{name}\", value)\n end\n end", "title": "" }, { "docid": "18a1aac9f6fd98fc6e91c763811a885b", "score": "0.51369256", "text": "def it_should_not_allow_values_for(attribute, *bad_values)\n message = get_options!(bad_values, :message)\n message ||= default_error_message(:invalid)\n klass = self.described_type\n bad_values.each do |v|\n describe \"doesn't allow #{attribute} to be set to #{v.inspect}\" do\n assert_bad_value(klass, attribute, v, message)\n end\n end\n end", "title": "" }, { "docid": "e1b6f0832f47b970d86ee6bbe0069165", "score": "0.5131753", "text": "def enum_values\n return if $enums.empty?\n\n filename = File.join \"#{$app_root}/app/models\", \"#{$name}.rb\"\n File.open(filename, \"r\") {|file| @lines = file.readlines; }\n\n $enums.each_with_index do |enum, index|\n @lines.each do |line|\n# if line.include?('enum') && line.include? \"#{enum}:\"\n if line.match('enum' && \"#{enum}:\")\n $enums_qty[index] = line.count(',') + 1 # Number of commas + 1\n end\n end\n end\n\n # If no enum statements found in the Model file (NOT NEEEDE now)\n if $enums_qty.empty?\n (0...$enums.count).each do |i|\n $enums_qty[i] = ENUM_DDL_THRESHOLD # All enum attributes to be listed as DDLs\n end\n end\n end", "title": "" }, { "docid": "774a366b9f69fd65cf48be53dd57842f", "score": "0.5129999", "text": "def valid_attribute?(attr_name)\n attribute_names.include?(attr_name)\n end", "title": "" }, { "docid": "477daded5fe1fcf4833feef5d28df0b8", "score": "0.5123942", "text": "def valid_attribute?(attr_name)\n attribute_names.include?(attr_name)\n end", "title": "" }, { "docid": "9e09e478ffbcd5696adbbac0de32b806", "score": "0.51167804", "text": "def check_attribute(attr)\n tag = attr.parent_tag\n\n return warning \"(Tag: #{tag.name}) \"\\\n \"Invalid Attribute '#{attr.name}'\" unless valid_attribute?(tag, attr)\n\n return warning \"(Tag: #{tag.name}, Attribute: #{attr.name})\"\\\n \" Invalid Value '#{attr.value}'\" unless self[tag.name][attr.name]\n .valid?(attr)\n\n true\n end", "title": "" }, { "docid": "184f4ffa6d25c68dad37fb2bd3c2ea24", "score": "0.5112769", "text": "def allowable_values(allowable_range)\n\t\traise RuntimeError, \"#{self.class.to_s} does not implement #allowable_values\"\n\t end", "title": "" }, { "docid": "abdee14b197eb02bfd48be4843938a8d", "score": "0.5112224", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"classification\", @classification)\n writer.write_string_value(\"permissionId\", @permission_id)\n writer.write_string_value(\"permissionName\", @permission_name)\n end", "title": "" }, { "docid": "bdb1fc5342abbce086a370e8721623a6", "score": "0.51070607", "text": "def visit_enum(binding_type)\n raise NotImplementedError\n end", "title": "" } ]
f01a235e7f67e5c864a4aa49fd3af22f
Make me or someone else operator.
[ { "docid": "a1357a9c8ef8c70ad211d5beae705278", "score": "0.6501461", "text": "def chan_op(irc, chan, nick)\n if !caps(irc, 'op', 'owner').any?\n irc.reply \"You don't have the 'op' capability for this channel; go away.\"\n elsif !chan.me.op?\n irc.reply \"I don't appear to be operator on this channel, sorry.\"\n elsif nick\n if (nicks = nick.split).length == 1\n if (u = chan.users[IRC::Address.normalize(nicks[0])])\n if u.op?: irc.reply \"Ehm, that person is already operator, dude.\"\n else u.op end\n else irc.reply \"No such nick name.\" end\n else\n nicks.each { |n| u = chan.users[IRC::Address.normalize(n)] and !u.op? and u.op }\n end\n elsif (u = chan.users[irc.from.nnick])\n if u.op?: irc.reply \"Already there, bro.\"\n else u.op end\n end\n end", "title": "" } ]
[ { "docid": "66aa56d67e78e70dc763eb919fd484a0", "score": "0.6315378", "text": "def set_operator\n OperatorRecordable.operator = current_user\n end", "title": "" }, { "docid": "3608e51948f4077591a036346ba604ec", "score": "0.6195922", "text": "def or(other); end", "title": "" }, { "docid": "3608e51948f4077591a036346ba604ec", "score": "0.6195922", "text": "def or(other); end", "title": "" }, { "docid": "3608e51948f4077591a036346ba604ec", "score": "0.6195922", "text": "def or(other); end", "title": "" }, { "docid": "420b254efd1fb99f34fe9c0ed1876a9d", "score": "0.6185039", "text": "def admin_or_operator?\n self.admin? || self.operator?\n end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.61143667", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.61143667", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "0ee27284dbfa1e68741dc95297e570de", "score": "0.6114039", "text": "def operator; end", "title": "" }, { "docid": "9896a917d58ca9b1c3f0242b9c9a4bfc", "score": "0.6103524", "text": "def or(other)\n spawn.or!(other)\n end", "title": "" }, { "docid": "9896a917d58ca9b1c3f0242b9c9a4bfc", "score": "0.6103524", "text": "def or(other)\n spawn.or!(other)\n end", "title": "" }, { "docid": "97514b7149390880be0e9f1675a41701", "score": "0.6063402", "text": "def alternate_operator; end", "title": "" }, { "docid": "97514b7149390880be0e9f1675a41701", "score": "0.6063402", "text": "def alternate_operator; end", "title": "" }, { "docid": "97514b7149390880be0e9f1675a41701", "score": "0.6063402", "text": "def alternate_operator; end", "title": "" }, { "docid": "97514b7149390880be0e9f1675a41701", "score": "0.6063402", "text": "def alternate_operator; end", "title": "" }, { "docid": "e23c37fa71b7a9e41edf75242e34821c", "score": "0.6048445", "text": "def or!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n\n\n type = OR\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 43:5: 'or'\n match( \"or\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 13 )\n\n\n end", "title": "" }, { "docid": "6fbf0eaf223941bf7b5326b065567047", "score": "0.6029667", "text": "def or!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 10 )\n\n\n\n type = OR\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 49:5: 'or'\n match( \"or\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 10 )\n\n\n end", "title": "" }, { "docid": "5790abc786f0bb43920573d27d12cd10", "score": "0.5976548", "text": "def or\n end", "title": "" }, { "docid": "471647dfe887a661ebc41bf82ef368fb", "score": "0.5933419", "text": "def or_operator\n '|'\n end", "title": "" }, { "docid": "471647dfe887a661ebc41bf82ef368fb", "score": "0.5933419", "text": "def or_operator\n '|'\n end", "title": "" }, { "docid": "06791a59d0b45d6ab7f4c4feb1c94017", "score": "0.5906952", "text": "def operator\n operator = rand(42..47)\n case operator\n when 42 then \"*\"\n when 43 then \"+\"\n when 45 then \"-\"\n when 47 then \"/\"\n else \"+\" \n end\n end", "title": "" }, { "docid": "02a6b3c3a9739b3e38ef67a32a306620", "score": "0.59067744", "text": "def to_satisfy_operator(operator, other)\n return to_be(operator) unless other\n\n failure_message = \"Expected #{@color.p(@target.inspect, :red)} to be #{operator}\" \\\n \" #{@color.p(other, :green)}.\"\n\n assert(@target.public_send(operator, other), failure_message)\n end", "title": "" }, { "docid": "424c8e65e3184b78f1d2e7674fd42263", "score": "0.58988893", "text": "def or(right); end", "title": "" }, { "docid": "efeecd7ef25e4239c24c4bb281e5a6ee", "score": "0.5897372", "text": "def motivate_you(msg)\n motivate_else(msg, msg.user.nick)\n end", "title": "" }, { "docid": "c08f3d3927fbe09d034af62abcc50d91", "score": "0.58968586", "text": "def operator\n @operator ||= OPERATORS.detect{|o| o[:name] == op}\n end", "title": "" }, { "docid": "c08f3d3927fbe09d034af62abcc50d91", "score": "0.58968586", "text": "def operator\n @operator ||= OPERATORS.detect{|o| o[:name] == op}\n end", "title": "" }, { "docid": "b22176f303d504a8f6c171256ec02713", "score": "0.58622146", "text": "def nonmutating_operator_method?; end", "title": "" }, { "docid": "b22176f303d504a8f6c171256ec02713", "score": "0.58622146", "text": "def nonmutating_operator_method?; end", "title": "" }, { "docid": "595e2463f8bb02a9f2bb8151bf249ec9", "score": "0.58391553", "text": "def evaluate_operator(left, right)\n left or right\n end", "title": "" }, { "docid": "36b77cbde091a8c8d77d55ec764fd2bd", "score": "0.5797749", "text": "def rank_name_op_you(op, current_user)\n string = rank_name_short\n string << ' (You)' if self == current_user\n string << ' (OP)' if self == op\n string << ' (Banned)' if self.banned\n string\n end", "title": "" }, { "docid": "bac4bbc05f16b4a20f2395d8d7fc3616", "score": "0.57936096", "text": "def alternate_operator\n logical_operator? ? SEMANTIC_OR : LOGICAL_OR\n end", "title": "" }, { "docid": "b93d091a057a813701c6143322d522cf", "score": "0.57738626", "text": "def operator(operator, first_number, second_number)\n #operand = operator.to_sym --> use for later to simplify\n case @user_operator\n when \"+\"\n @answer = first_number + second_number\n puts \"The answer is: #{@answer}\"\n when \"-\"\n @answer = first_number - second_number\n puts \"The answer is: #{@answer}\"\n when \"*\"\n @answer = first_number * second_number\n puts \"The answer is: #{@answer}\"\n when \"/\"\n @answer = first_number / second_number\n puts \"The answer is: #{@answer}\"\n else\n puts \"Please use a correct value\"\n end\n #puts first_number.public_send(operand, second_number) --> save for later\n end", "title": "" }, { "docid": "23e528502a5d728cfc1f3727fb67d661", "score": "0.5767056", "text": "def okay_operator?(operator)\n if operator == \"+\" || operator == \"add\"\n operator = :+\n elsif operator == \"-\" || operator == \"subtract\" || operator == \"minus\"\n operator = :-\n elsif operator == \"*\" || operator == \"times\" || operator == \"multiply\"\n operator = :*\n elsif operator == \"/\" || operator == \"divide\"\n operator = :/\n elsif operator == \"^\" || operator == \"power\" || operator == \"exponent\"\n operator = :**\n else\n puts \"That is not a valid operator\"\n end\nend", "title": "" }, { "docid": "7ea32c7a84652c17ce9c9f32db8f703f", "score": "0.5766266", "text": "def or!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 63 )\n\n type = OR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 443:6: '||'\n match( \"||\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 63 )\n\n end", "title": "" }, { "docid": "b29d45e0481ae1d542f9c6d5c160ed8a", "score": "0.572672", "text": "def oO\n binary_operator \"||\"\n end", "title": "" }, { "docid": "d50caee10a3ef4dcc83d2a7ca2398288", "score": "0.5716073", "text": "def logical_op(type, lhs, token, rhs)\n s(type, lhs, rhs)\n end", "title": "" }, { "docid": "58d9fc99de5d74188abdae7dc28f1849", "score": "0.57042086", "text": "def get_operator(opt)\n opt.downcase!\n unless opt == 'add' || opt == 'subtract' || opt == 'multiply'\n random_op = rand(3)\n\n case random_op\n when 0\n opt = 'add'\n when 1\n opt = 'subtract'\n when 2\n opt = 'multiply'\n end\n end\n \n opt\n end", "title": "" }, { "docid": "c5017a5fe1719fd3a33885696f2c517f", "score": "0.5696739", "text": "def operator_method?; end", "title": "" }, { "docid": "c5017a5fe1719fd3a33885696f2c517f", "score": "0.5696739", "text": "def operator_method?; end", "title": "" }, { "docid": "77c358835905552043a0c55f11faffa0", "score": "0.5673099", "text": "def or!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 15 )\n\n type = OR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 23:6: '|'\n match( 0x7c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 15 )\n\n end", "title": "" }, { "docid": "c29209ef886967082d52c20b4ecfdc96", "score": "0.5664149", "text": "def set_operator\r\n @user = User.find(params[:id])\r\n end", "title": "" }, { "docid": "1750453213d6bd3ba3fe0f3aa4fd6ee5", "score": "0.56249696", "text": "def reply!\n case self.op\n when 1 then self.op = 2\n when 2 then self.op = 1\n end\n self\n end", "title": "" }, { "docid": "8150b93808c81c4411b4d9b3cb84ab54", "score": "0.56233793", "text": "def operator\n @operator\n end", "title": "" }, { "docid": "1a1cbdf6e70291a6f4d3e2d70a61b6a0", "score": "0.56207156", "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": "f4c548ca9872aee473dfd3b6b520af79", "score": "0.56112754", "text": "def operator(type, other)\n Sequel::SQL::BooleanExpression.new(:NOOP, Sequel::SQL::PlaceholderLiteralString.new(OPERATORS[type], [value, other]))\n end", "title": "" }, { "docid": "8b40b4173d1859aa36169e99d3a6a271", "score": "0.5610053", "text": "def applyOperator(num1, num2, operator)\n \tcase operator\n \t\twhen \"^\"\n \t\t\tnum1 ** num2\n \t\twhen \"%\"\n \t\t\tnum1 % num2\n \t\twhen \"/\"\n \t\t\tnum1 / num2\n \t\twhen \"*\"\n \t\t\tnum1 * num2\n \t\twhen \"+\"\n \t\t\tnum1 + num2\n \t\twhen \"-\"\n \t\t\tnum1 - num2\n \tend\n end", "title": "" }, { "docid": "9794ed3da6499b08c569b6dad5b18606", "score": "0.5606919", "text": "def nonmutating_binary_operator_method?; end", "title": "" }, { "docid": "9794ed3da6499b08c569b6dad5b18606", "score": "0.5606919", "text": "def nonmutating_binary_operator_method?; end", "title": "" }, { "docid": "59fd3be79637c0ac898694ce99e8faf3", "score": "0.5595755", "text": "def semantic_operator?; end", "title": "" }, { "docid": "59fd3be79637c0ac898694ce99e8faf3", "score": "0.5595755", "text": "def semantic_operator?; end", "title": "" }, { "docid": "fc41831a5113278e511cd6c513063e05", "score": "0.5582872", "text": "def is_op?(user)\n @ops.include? user.downcase\n end", "title": "" }, { "docid": "0ee0b5146fe1e9366dcb2374374fd260", "score": "0.556467", "text": "def operator\n @operator ||= OPS.index_by{|o| o[:name]}[op.to_sym]\n end", "title": "" }, { "docid": "0ee0b5146fe1e9366dcb2374374fd260", "score": "0.556467", "text": "def operator\n @operator ||= OPS.index_by{|o| o[:name]}[op.to_sym]\n end", "title": "" }, { "docid": "9f26a44c4e0a68698a32d1371fa35c2e", "score": "0.5530417", "text": "def operator\n @operator ||= '= ?'\n end", "title": "" }, { "docid": "73f201f19599e74c59656252995a9f92", "score": "0.55247855", "text": "def cypher_operator(operator)\n return DIFFERING_OPERATORS[operator] || operator\n end", "title": "" }, { "docid": "b571fc41d5e6f7cd977dbdf6adb85be2", "score": "0.55122566", "text": "def or(other)\n self\n end", "title": "" }, { "docid": "6586d31e2b6c2ba33a551102d2e2ebc1", "score": "0.5507679", "text": "def test_refute_operator\n object1 = 2\n object2 = 5\n operator = :< # the symbol for <\n refute_operator object1, operator, object2\n end", "title": "" }, { "docid": "c95badfeac14d36944eb5b293cf3e292", "score": "0.55007505", "text": "def or(other)\n OrOpVisitCheck.new(self, other)\n end", "title": "" }, { "docid": "b6dd926fc8bf82c318c69d4283484dcd", "score": "0.549472", "text": "def logical_op(type, lhs, op_t, rhs); end", "title": "" }, { "docid": "225feeac39936bea19ced9ce09b7115b", "score": "0.5472695", "text": "def oA\n binary_operator \"&&\"\n end", "title": "" }, { "docid": "6f53cf72736e916f257998fdb4bb187e", "score": "0.5463134", "text": "def other_user(user)\n user == sender ? recipient : sender\n end", "title": "" }, { "docid": "a7be3d4728bdadaa883f9aaeaf4abe5a", "score": "0.54606473", "text": "def is_op?(username)\n username == self.user.username || self.users.any? { |u| u.username == username }\n end", "title": "" }, { "docid": "354da2c01e49fa750092432395daf580", "score": "0.5459681", "text": "def apply_operator(route1, route2)\n case @random_to_operation[rand(@random_to_operation.length)]\n when 0: route1.reverse\n when 1: route1.exchange\n when 2: route1.partner_guided_reorder route2\n else raise Exception.new(\"something's wrong!\")\n end\n end", "title": "" }, { "docid": "cb56093bf24fa6dd185bd8ca95e465ff", "score": "0.5448232", "text": "def operator\n raise NotImplementedError\n end", "title": "" }, { "docid": "8ae7554d986e9f7d21d8c8fb71e77386", "score": "0.5438889", "text": "def to_not_satisfy_operator(operator, other)\n return to_not_be(operator) unless other\n\n failure_message = \"Expected #{@color.p(@target.inspect, :red)} to not be #{operator}\" \\\n \" #{@color.p(other, :green)}.\"\n\n assert(!@target.public_send(operator, other), failure_message)\n end", "title": "" }, { "docid": "085e267ad1f27fe1f8fa323f8f5ee689", "score": "0.542406", "text": "def sql_for_user_id_me_field(field, operator, value)\n sql_for_field(field, operator, value, nil, \"(CASE WHEN (#{TimeEntry.table_name}.user_id = #{User.current.id}) THEN 'me' ELSE 'not_me' END)\")\n end", "title": "" }, { "docid": "085e267ad1f27fe1f8fa323f8f5ee689", "score": "0.542406", "text": "def sql_for_user_id_me_field(field, operator, value)\n sql_for_field(field, operator, value, nil, \"(CASE WHEN (#{TimeEntry.table_name}.user_id = #{User.current.id}) THEN 'me' ELSE 'not_me' END)\")\n end", "title": "" }, { "docid": "b3338b3a846a8065c8f9332c037e5e1f", "score": "0.5419144", "text": "def sql_for_author_id_me_field(field, operator, value)\n sql_for_field(field, operator, value, nil, \"(CASE WHEN (#{TimeEntry.table_name}.author_id = #{User.current.id}) THEN 'me' ELSE 'not_me' END)\")\n end", "title": "" }, { "docid": "b3338b3a846a8065c8f9332c037e5e1f", "score": "0.5419144", "text": "def sql_for_author_id_me_field(field, operator, value)\n sql_for_field(field, operator, value, nil, \"(CASE WHEN (#{TimeEntry.table_name}.author_id = #{User.current.id}) THEN 'me' ELSE 'not_me' END)\")\n end", "title": "" }, { "docid": "aba3c543740b03cb458b732dfe723f8a", "score": "0.54169816", "text": "def or(op_derecho)\n to_pointcut(__method__, op_derecho)\n end", "title": "" }, { "docid": "310511315396e37cd97a1017b8db9153", "score": "0.54020834", "text": "def or(generator_or_options = {})\n Operator::OR.new self, generator_or_options\n end", "title": "" }, { "docid": "c907b29da828e5115cc00cd76d4087cc", "score": "0.53996164", "text": "def validate_ops(user, command, message = true)\n return true if is_op? user.downcase\n @server.puts \"say #{user} is not an op, cannot use !#{command}.\" if message\n end", "title": "" }, { "docid": "89cd76ebe68c63dd5d33ec5883769e1b", "score": "0.539827", "text": "def sell_to?\n user != record.workshifter\n end", "title": "" }, { "docid": "356a8e66c4aa95bb4b4ddbdf3e5dbb2e", "score": "0.5397393", "text": "def proxy_or_depositor(work)\n work.on_behalf_of.presence || work.depositor\n end", "title": "" }, { "docid": "1923191a3ca230401b5c9acf58d3b99d", "score": "0.5393605", "text": "def op(chan, nick)\n usermode(chan, nick, '+o')\n self\n end", "title": "" }, { "docid": "5aff74f028e3b24194f43bb6e6babd31", "score": "0.53872997", "text": "def operator(op)\n if @flag_op\n eval\n operator(op)\n else\n @flag_op = true\n @operator = op\n @result += op\n end\n end", "title": "" }, { "docid": "154021289aff422115272a5164ee94eb", "score": "0.53871524", "text": "def say(*args, &block)\n\t\t\t#\tallocate new\n\t\t\t@instructions << Instruction.new(self, *args, &block)\n\n\t\t\tif @or_likely\n\t\t\t\t#\tretro-apply the likelihood from the 'or' operation\n\t\t\t\targs, block = @or_likely\n\t\t\t\tself.instruction.likely *args, &block unless (args.empty? && block.nil?)\n\t\t\t\t@or_likely = nil\n\t\t\tend\n\n\t\t\tself\n\t\tend", "title": "" }, { "docid": "eb90430fccff48aba4b8d52c135da101", "score": "0.53834933", "text": "def operator\n return @operator\n end", "title": "" }, { "docid": "eb90430fccff48aba4b8d52c135da101", "score": "0.53834933", "text": "def operator\n return @operator\n end", "title": "" }, { "docid": "eb90430fccff48aba4b8d52c135da101", "score": "0.53834933", "text": "def operator\n return @operator\n end", "title": "" }, { "docid": "4c1f697a33c81e9020337437a3ba4a78", "score": "0.5375183", "text": "def give_right_to_vote( to_voter: ) ## address toVoter\r\n return if msg.sender != @chairperson || @voters[to_voter].voted\r\n\r\n @voters[to_voter].weight = 1\r\n end", "title": "" }, { "docid": "292c48e0d148059497764d41ec32bddb", "score": "0.5364722", "text": "def modifying_user?; user_params[:rights] == \"user\"; end", "title": "" } ]
4eb97be925a49a75f7ff7711864e78ec
Method used by twitter gem to post message to twitter
[ { "docid": "492c79545fe3d803b9abd9f4068ac09a", "score": "0.6663111", "text": "def update\n if $twitter.update(message)\n status, message = 'complete', 'Posted to twitter'\n end\n end", "title": "" } ]
[ { "docid": "a3628e7fd19567b1718fb9abface686b", "score": "0.89443296", "text": "def post(msg)\n @twitter.post msg\n end", "title": "" }, { "docid": "9975947a72c926154cec47e45828a227", "score": "0.79752177", "text": "def post_tweet(message)\n Tweet.new(message, self)\n end", "title": "" }, { "docid": "9975947a72c926154cec47e45828a227", "score": "0.79752177", "text": "def post_tweet(message)\n Tweet.new(message, self)\n end", "title": "" }, { "docid": "f6730a5fc296a50e521e2c006ef7ae4c", "score": "0.79332304", "text": "def twitter_post\n \n end", "title": "" }, { "docid": "e1b6d8101186979cddc068855ce266c3", "score": "0.78921026", "text": "def post_tweet(user_id, tweet_id)\r\n \r\n end", "title": "" }, { "docid": "cef8df8096a16b7f9aac0b04cc775d20", "score": "0.7794574", "text": "def post_tweet(user_id, tweet_id)\n \n end", "title": "" }, { "docid": "cef8df8096a16b7f9aac0b04cc775d20", "score": "0.7794574", "text": "def post_tweet(user_id, tweet_id)\n \n end", "title": "" }, { "docid": "630fa612e71d04d297c1f9f62b6aa6d6", "score": "0.77833754", "text": "def post_tweet(message)\n new_tweet = Tweet.new(message, self)\n @tweets << new_tweet\n # use message to create a new tweets\n # tweet also needs to know about this user, who is the one posting -- self will help\n end", "title": "" }, { "docid": "5c45cecbb1df2ecc88f40f852668a953", "score": "0.76849294", "text": "def create\n \tcurrent_user.tweet(twitter_params[:message])\n end", "title": "" }, { "docid": "303406a9290f64fb7968caadff9e5790", "score": "0.7608311", "text": "def post(content)\n tweet = Tweet.new\n tweet.send_tweet(content)\n end", "title": "" }, { "docid": "2f4b108b9c04c15581a633727a96e2ec", "score": "0.7547474", "text": "def post_tweet(message)\n # creates a new tweet,\n # binding.pry\n my_tweet = Tweet.new(message, self)\n # and adds it to the user's tweet collection\n # @tweets << my_tweet\n end", "title": "" }, { "docid": "743bd70b14f5df8da0251733853d3ff7", "score": "0.7529484", "text": "def message(twitter_id, contents)\n\n\n\n\tend", "title": "" }, { "docid": "c5c552b4ea366a88f3177e46e5fc2b2f", "score": "0.74387884", "text": "def post!\n Twitter.post!(twitter_id, \"You vote here <url, etc>\")\n update_attribute :sent_at, Time.now\n rescue TwitterException \n # log\n end", "title": "" }, { "docid": "124492f02909c4635d113089d88c3999", "score": "0.7434214", "text": "def post_message\n end", "title": "" }, { "docid": "7babd598e03cbdeb59c3c06682cb70b0", "score": "0.72982895", "text": "def post(tweet=nil)\n @res = access_token.post(\n 'http://twitter.com/statuses/update.json',\n 'status'=> tweet\n )\n end", "title": "" }, { "docid": "ab5f41236f29327dc427d87f5885a4bf", "score": "0.7291215", "text": "def push_generic_message\n user = current_user\n message = \"Hello #{user.name}! \"\n #Twitter's API forbids sending duplicate tweets\n r = rand(10000)\n message += r.to_s\n Tweet.pushTweet(user, message)\n #############################\n #Code only used to seed database \n # \n #input_lat = 59.896510\n #input_long = -43.424513\n #Tweet.push_tweet_with_geo(user, message, input_lat, input_long)\n #Tweet.update_user_tweets(user,@number_of_tweets_to_pull)\n #############################\n redirect_to '/twitter/'\n end", "title": "" }, { "docid": "999370ef36c91a3ba2685a772ee72430", "score": "0.7272333", "text": "def tweet!(msg)\n connection.post('/statuses/update', :status => msg) ; msg\n end", "title": "" }, { "docid": "ece864e6b2f146c805cd4bbfa7d2f0e1", "score": "0.72177094", "text": "def post_tweet(message)\n # Create a new tweet with the message that was passed in as the argument\n # The new tweet also needs to initialize with a user instance.\n # How do we find the instance we need to pass in?\n # binding.pry\n Tweet.new(message, self)\n end", "title": "" }, { "docid": "873c830bf494121b3e2237162ac100dd", "score": "0.71963173", "text": "def send_twitter_message\n if params[:method] == 'dm'\n tweet_sent = TwitterDm.send_direct_message(current_user, params['screenName'], params['tweetBody'])\n if !!tweet_sent\n respond_to do |format|\n format.json { render json: '', status: :ok }\n end\n else\n format.json { render json: 'no results', status: :unprocessable_entity }\n end\n elsif params[:method] == 'tweet'\n if PostTweet(current_user, params['tweetBody'])\n format.json { head :ok }\n else\n format.json { render json: 'no results', status: :unprocessable_entity }\n end \n end\n end", "title": "" }, { "docid": "3256d56dd3584680a032eb4ec25b9ac5", "score": "0.7145888", "text": "def post\n # article_link = HighSnHn::GenerateShortlink.new(@story.url).shorten\n # sleep(2) unless ENV['HIGHSNHN_ENV'] == 'test'\n\n # comments_url = \"https://news.ycombinator.com/item?id=#{@story.hn_id}\"\n # comments_link = HighSnHn::GenerateShortlink.new(comments_url).shorten\n # sleep(2) unless ENV['HIGHSNHN_ENV'] == 'test'\n\n article_link = @story.url\n comments_url = \"https://news.ycombinator.com/item?id=#{@story.hn_id}\"\n\n if article_link == comments_url\n twitter_text = \"#{@story.title}: #{article_link}\"\n else\n twitter_text = \"#{@story.title}: #{article_link} ( #{comments_url} )\"\n end\n\n LOGGER.info(\"\\ntweeting #{@story.id}: #{twitter_text}\\n\")\n @client.update(twitter_text)\n\n record_posting(article_link, comments_url)\n end", "title": "" }, { "docid": "8277f94d6ce188877af3928f5ae8da4c", "score": "0.7124821", "text": "def send_tweet(message)\n @client.update(message)\n end", "title": "" }, { "docid": "0eb9c008ba10cb4b12f460d7e1a4b3f3", "score": "0.71143746", "text": "def send_tweet(message, url, tags, person = \"\")\n tweet = TwitterSender.convert_message_in_tweet(message, url, tags, person)\n self.sender(tweet)\n return true\n end", "title": "" }, { "docid": "d0b763a7846ad0cfece71246298765ca", "score": "0.7092958", "text": "def dm!(message)\n tweet_string = TweetString.new(message)\n tweet_string.validate!\n Twitter.direct_message_create(self.user_id, tweet_string.to_s)\n true\n end", "title": "" }, { "docid": "f89e0b4defe3c80985819f66660f8b82", "score": "0.70673263", "text": "def create\n @message = Message.new(params[:message])\n update_twitter(@message.body,'nnnnon@gmail.com','2Akgyv2a')\n respond_to do |format|\n if @message.save\n #flash[:notice] = 'Message was successfully created.'\n format.html { redirect_to(messages_url) }\n #format.html { render :action => \"index\" }\n format.xml { render :xml => @message, :status => :created, :location => @message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d150b18e5e76d59023109159ab96c39b", "score": "0.70358706", "text": "def post_tweet(desc)\n tweet = self.tweets.create!(text: desc)\n TweetWorker.perform_async(tweet.id)\n # client.update(desc)\n end", "title": "" }, { "docid": "a3401386390a286325ecc2778fd564a5", "score": "0.70182914", "text": "def post_mess\n @client.search('#{@a}').each do |tweet|\n @client.update(\"@#{tweet.user} Hey, it could interest you: https://growthhackingquinteroyale.herokuapp.com! :)\")\n end\n end", "title": "" }, { "docid": "a3e86efcf58db8d9884c840c090082c8", "score": "0.70174944", "text": "def send_post_message(sender, text)\n\t\t@bot = Bot.find_by(uri: params[:uri])\n\t\tbody = {\n\t\t recipient: {\n\t\t id: sender\n\t\t },\n\n\t\t message: {\n\t\t text: text\n\t\t }\n\t\t }.to_json\n\t\t \n\t response = HTTParty.post(\n\t \"https://graph.facebook.com/v2.6/me/messages?access_token=#{@bot.token}\",\n\t body: body,\n\t headers: { 'Content-Type' => 'application/json' }\n\t )\n\tend", "title": "" }, { "docid": "a3e7d30e72ab15deb9799eb015c311e0", "score": "0.69923025", "text": "def send_tweet(tweet)\n client = Twitter::Client.new\n client.update(tweet) \n end", "title": "" }, { "docid": "13dded23179796ef323db0a9f6cf1067", "score": "0.69816864", "text": "def messages\n begin\n print \"Who do you want to send a message to ?: \"\n puts \"Type the id like that: @username\"\n send_message_to = \"\" + gets.chomp + \"\"\n print \"What do you want to say to #{send_message_to}?: \"\n message_content = \"\" + gets.chomp + \"\"\n @message = @client.create_direct_message(send_message_to, message_content)\n puts \"Message sent\"\n\n rescue Twitter::Error::Forbidden, Twitter::Error::Unauthorized => e
\n puts \"Message not sent. This account do not allow message from non-follower\"\n end\nend", "title": "" }, { "docid": "5c1391dfa754079124350dd6af7c3ad0", "score": "0.69764", "text": "def tweet(message)\n logger.info \"Tweeting message: #{message}\"\n begin\n Twitter::Client.new(:login => 'tracks_org_nz', :password => 'zaq12WSX').status(:post, message) if RAILS_ENV == \"production\"\n rescue\n logger.warn \"Failed to tweet\"\n end\n end", "title": "" }, { "docid": "fad593627e6ea0b63b414918f897b853", "score": "0.6969304", "text": "def tweet(message)\n @twitter_client.update(message)\n end", "title": "" }, { "docid": "4965ac13d3679161bad4e54daf3ebad0", "score": "0.69575197", "text": "def create\n # makes sure user is logged in\n if current_user\n if current_user.tweet(twitter_params[:message])\n flash[:notice] = \"Successfully tweeted!\"\n redirect_to root_path\n else\n # server-side error handling\n flash[:error] = tweet.errors.full_messages.join(', ')\n redirect_to root_path\n end\n else\n flash[:error] = \"Need to log in to create tweet\"\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "04d0d5b0b680eae3173aba16b391a767", "score": "0.6952251", "text": "def sendtweet(newtweet)\nclient.update(newtweet) \nend", "title": "" }, { "docid": "44dfd072acac5d11aa9852887768bcce", "score": "0.6945574", "text": "def create_messages\n bus = MessageBus.find_by_label('Twitter')\n ip = Socket::getaddrinfo(Socket.gethostname,\"echo\",Socket::AF_INET)[0][3]\n bus.messages.create!(\n :ip_address => ip,\n :text => \"Tweet: [#{self.username}] #{self.content}\"\n )\n \n TTMMessage.create!(\n :text => \"[#{self.username}] #{self.content}\",\n :source_type => 'Tweet',\n :source_id => self.id\n )\n end", "title": "" }, { "docid": "7f9eb08dc8d9a6b759ea5632e0dabd23", "score": "0.6934701", "text": "def post_new_activity_to_twitter(params, new_activity)\n \n Rails.logger.error(\"[MODEL] [USER] [post activity to twitter] \") \n if params[:tw].nil? or params[:tw] != 'true'\n return\n end\n\n provider=\"twitter\"\n twitter_auth=Authentication.find_by_user_id_and_provider(self.id, provider)\n\n if twitter_auth.nil?\n return\n end\n Rails.logger.debug(\"[MODEL] [USER] [post activity to facebook] Posting to twitter\")\n tweet_desc = \"#{self.full_name } posted on #{new_activity[:post][:word][:name]} #{new_activity[:post][:text]}\"\n url = \"http://www.actwitty.com/view/id=#{new_activity[:post][:id]}\"\n if tweet_desc.length > 134 - url.length\n tweet_desc = tweet_desc[0...(134 - url.length)] + '...'\n end\n tweet = \"#{tweet_desc} #{url}\"\n Twitter.update tweet\n\n end", "title": "" }, { "docid": "c406a41a1f646c3acdb37d2c9bd3d86f", "score": "0.69269747", "text": "def send_message(message)\n if self.provider == \"twitter\"\n content = message.content.to_s\n url = message.url.to_s\n tags = message.tags_array\n person = message.person.to_s\n sender = self.service_api\n success = sender.send_tweet(content, url, tags, person)\n end\n\n if self.email_alert\n self.send_message_mail_to_user(message)\n end\n\n return success\n end", "title": "" }, { "docid": "c943689aceb049f1420da7b3fc4ce94b", "score": "0.6909005", "text": "def tweet(message)\n if message.length < 140\n @client.update(message)\n puts 'SUCCESS: msg posted'\n else\n puts 'ERROR: msg over 140 characters.'\n end\n end", "title": "" }, { "docid": "89b1858b5389654cadd84b1c3a6eef51", "score": "0.6879498", "text": "def send_message(message)\n client = ::Twitter::REST::Client.new do |config|\n config.consumer_key = @consumer_key\n config.consumer_secret = @consumer_secret\n config.access_token = @oauth_token\n config.access_token_secret = @oauth_token_secret\n end\n\n client.update(message)\n end", "title": "" }, { "docid": "a34bc58be9fee06a2900058292d408a4", "score": "0.68773466", "text": "def dm(message, recipient=ADMIN)\n message = message[0...140] # Shrink message to 140 chars\n message.next! if message == $last_post # Ensure we don't double-post\n Twitter.direct_message_create(recipient, message[0...140]) # Lift-off!\n $last_post = message\nend", "title": "" }, { "docid": "c4693b6f12d001e95a8b93c01f65c53a", "score": "0.6873076", "text": "def post\n value = params[:message]\n tik = Tik.put(value)\n parse_and_save_hashtags(tik, value)\n redirect_to welcome_index_url\n end", "title": "" }, { "docid": "b0e09bd9f50e579cd02dc65f4aac4821", "score": "0.68549824", "text": "def create\n @tweet = current_user.tweets.new(tweet_params)\n serializer = TweetSerializer.new @question\n @my_callback = lambda { |m| \"nothing\" }\n\n ## Execute Publish\n @pubnub.publish(\n :channel => \"twitter\",\n :message => {tweet:serializer,action:\"create\"},\n :callback => @my_callback\n )\n render nothing: true\n # respond_to do |format|\n # if @tweet.save\n # format.html { redirect_to dashboard_path, notice: 'Tweet was successfully created.' }\n # format.json { render :show, status: :created, location: @tweet }\n # else\n # format.html { render :new }\n # format.json { render json: @tweet.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "17e975cf59c5cf2597aa5f59fab31b59", "score": "0.68491364", "text": "def create\n @remoteip = request.env[\"HTTP_X_FORWARDED_FOR\"]\n if @remoteip != HACDCSPACE_IP && @remoteip != WWWHACDC_IP then \n redirect_to(:action => \"joinhacdc\") \n return\n end\n\n @message = Message.new(params[:message])\n\n respond_to do |format|\n if @message.save\n\n begin\n raise if twitter_client == nil\n @message = Message.new(params[:message])\n raise if @message == nil\n response = twitter_client.status(:post, @message.plaintext )\n rescue\n redirect_to(twittererr_path)\n return\n end\n\n @@twitter_client.status(:post, params[:plaintext]);\n\n flash[:notice] = 'Message was successfully created.'\n format.html { redirect_to(@message) }\n format.xml { render :xml => @message, :status => :created, :location => @message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0761fddd7541764c96e28b022ffa926d", "score": "0.6827358", "text": "def chat_post(message)\n @api.send(\"chat.post(#{message})\")\n end", "title": "" }, { "docid": "0761fddd7541764c96e28b022ffa926d", "score": "0.6827358", "text": "def chat_post(message)\n @api.send(\"chat.post(#{message})\")\n end", "title": "" }, { "docid": "4027f5e37c5e4f4e53042e16c674da2b", "score": "0.6795941", "text": "def tweet(message, options = {})\r\n status = Status.new\r\n status.lat = options[:lat]\r\n status.long = options[:long]\r\n status.body = message\r\n status.reply_id = options[:reply_id]\r\n status.post\r\nend", "title": "" }, { "docid": "b96a4b17037b7631bea707b33860392e", "score": "0.67924714", "text": "def post(users, tweet, in_reply_to)\n if tweet\n update = \"#{users.map{|u| \"@#{u}\"}.join(' ')} #{tweet.toutf8}\"\n uri = \"http://twitter.com/statuses/update.json?status=#{URI.encode(update)}&in_reply_to_status_id=#{in_reply_to.to_s}\"\n res = @account.connection(uri, :post)\n end\n end", "title": "" }, { "docid": "f1af9dc45c71cd74a8362f24d04c7fd4", "score": "0.6768751", "text": "def send_tweet(client, tweet)\n client.update(tweet)\nend", "title": "" }, { "docid": "eb65b6dc7636138af48f43cbb4fe11a2", "score": "0.6766818", "text": "def tw_post_direct_message(access_token,\n format, # json or xml\n parameters, # user_id or screen_name\n user_who_should_receive_direct_message, # The ID of the user who should receive the direct message.\n text)\n uri = URI_API_TWITTER +\n 'direct_messages/new' + \".\" +\n format + \"?\" +\n parameters + \"=\" +\n user_who_should_receive_direct_message.to_s + \"&text=\" +\n CGI.escape(text)\n begin\n #$logger.info \"#{self.class.name}.#{__method__}(#{user_who_should_receive_direct_message}, #{text} )\"\n #$logger.info \"#{uri}\"\n puts(\"#{self.class.name}.#{__method__}(#{user_who_should_receive_direct_message}, #{text} )\")\n puts(\"#{uri}\")\n\n response = access_token.request(:post, uri)\n r = TwitterHttpResponseCode.get_code(response.code, response.body)\n\n if response.code == TwitterHttpResponseCode::OK_SUCCESS\n #$logger.info \"Message is SENT SUCCESSFULLY to twitter_id = #{user_who_should_receive_direct_message}\"\n puts(\"Message is SENT SUCCESSFULLY to twitter_id = #{user_who_should_receive_direct_message}\")\n end\n\n return response.code\n\n rescue Exception\n #TwitterUtil.show_error(\"#{self.class.name}.#{__method__}()\",($!).class,($!))\n puts(\"#{self.class.name}.#{__method__}()\",($!).class,($!))\n return nil\n end\n end", "title": "" }, { "docid": "73544429cd849d9555163096501aa067", "score": "0.6743919", "text": "def post(message)\n\t\t@facebook = Koala::Facebook::API.new(oauth_token) \n\t\tprofile = @facebook.get_object(\"me\")\n\t\t@facebook.put_wall_post(:message => message) \n\tend", "title": "" }, { "docid": "54e27e11f088d390d708c6b5c64936aa", "score": "0.6735779", "text": "def post(message)\n posts << message\n end", "title": "" }, { "docid": "d30d4f1737d249f82b79768e031f20aa", "score": "0.6733368", "text": "def tweet\n\treturn \"tweet tweet\"\nend", "title": "" }, { "docid": "9e314ce392d920537c046c351783180d", "score": "0.6725854", "text": "def tweet(message, opts = {})\n message = message.to_s.strip\n logger.debug \"Tweeting #{message}\"\n post(\"statuses/update.json\", opts.merge(:status => message)) do |json|\n delegate.receive_message(:outgoing_tweet, status_to_args(json))\n end\n end", "title": "" }, { "docid": "4de999349c579e4aeeb30fc518158af1", "score": "0.6719055", "text": "def post(message, url)\n @foursquare_client.post(\"checkins/#{@checkin_id}/addpost\", {:text => message, :url => url, :v => \"20130828\"})\n end", "title": "" }, { "docid": "839c996633b691c94e47dff487feefea", "score": "0.6712036", "text": "def create\n logger.info \"*** twitter#create\"\n @tweet = String.new(params[:tweet])\n logger.info \"*** Status is #{@tweet}\"\n respond_to do |format|\n if send_tweet(@tweet)\n format.html { redirect_to :action => \"new\", :notice => \"success\" }\n format.xml { render :xml => @tweet, :status => :created, :location => @tweet }\n else\n format.html { redirect_to :action => \"new\", :notice => \"failure\"}\n format.xml { render :xml => @tweet.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "337e0fae9b38d6f280f75d6c1ff13c8b", "score": "0.6710711", "text": "def print_user_tweet(tweet)\n\tsend_message(tweet)\nend", "title": "" }, { "docid": "f7c43ca208fa90e1cbfea5de3bb90757", "score": "0.669676", "text": "def tweet(message, options = {})\n status = Status.new\n status.lat = options[:lat]\n status.long = options[:long]\n status.body = message\n status.reply_id = options[:reply_id]\n status.post\nend", "title": "" }, { "docid": "f7c43ca208fa90e1cbfea5de3bb90757", "score": "0.669676", "text": "def tweet(message, options = {})\n status = Status.new\n status.lat = options[:lat]\n status.long = options[:long]\n status.body = message\n status.reply_id = options[:reply_id]\n status.post\nend", "title": "" }, { "docid": "d786dd89930d75d3eb48f6b846ba5641", "score": "0.66930413", "text": "def post_from_bot(bot, message)\n post('/bots/post', {\n bot_id: extract_id(bot),\n text: message\n })\n end", "title": "" }, { "docid": "ca15a75d8cdeda2da6769f2034a2a322", "score": "0.6692147", "text": "def tweet(message, lat = nil, long = nil, reply_id = nil)\r\n #\r\nend", "title": "" }, { "docid": "b31ff627c5fdcf34cd1325fe1dee2383", "score": "0.6690436", "text": "def create\n @tweet = Tweet.new(tweet_params)\n @tweet.user_id = current_user.id\n @tweet.token\n\n mention\n\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to user_path(current_user), notice: 'Tweet was successfully created.' }\n format.json { render :show, status: :created, location: @tweet }\n else\n format.html { render :new }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1de64a2818e7b90fca3511a9d9ffc598", "score": "0.6689634", "text": "def create\n @tweet = Tweet.new(params[:tweet])\n if @tweet.message.blank?\n redirect_to tweets_url, :notice => \"Please enter a message\" \n return\n end\n @tweet.friend = current_friend\n respond_to do |format|\n if @tweet.save\n format.html { redirect_to tweets_url, notice: 'Tweet was successfully created.' }\n format.json { render json: @tweet, status: :created, location: @tweet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tweet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56ccf348be2790a76111f05a14b5f644", "score": "0.668786", "text": "def publish\n twitters = Twitter_API.new\n client = twitters.client\n\n tweet_id = 0;\n tweets.order(:tweet_index).each do |tweet|\n tweet_id = tweet.publish_tweet(client, tweet_id)\n end\n\n update(approved: true,\n \tthread_link: \"https://twitter.com/tweechable/status/#{tweets.first.twitter_id}\",\n \tposted_at: DateTime.now)\n end", "title": "" }, { "docid": "ac6e96a3513a5220967d255fc4f834ce", "score": "0.6683331", "text": "def twitter\n end", "title": "" }, { "docid": "489c0ebc678cccd84e822e177fdb11c2", "score": "0.6682263", "text": "def post(text)\n options = { :query => {:status => text}, :basic_auth => @auth }\n self.class.post(\"#{@uri}/api/twitter/statuses/update.json\", options)\n end", "title": "" }, { "docid": "cfe7cdef439fa7455b111c58ac605afe", "score": "0.66770613", "text": "def twitter ; callback end", "title": "" }, { "docid": "2880c7fc3d9158ee432017de63fa75ba", "score": "0.66686624", "text": "def test_tweet\n tweet = TwitterSender.convert_message_in_tweet(\"Bonjour le test\", \"http://les-conjugaisons.com\", [\"test\", \"louis\"], \"nadvence\")\n self.sender(tweet)\n end", "title": "" }, { "docid": "6a0235d354398f422a14f5b2b49c7200", "score": "0.6668633", "text": "def create\n @comment = Comment.new(comment_params.merge(:user_id => current_user.id)) unless current_user.nil?\n @comment = Comment.new(comment_params) if current_user.nil?\n respond_to do |format|\n if @comment.save\n current_user.twitter.update(@comment.message) if params[:postTwitter]\n format.json { render json: @comment, status: :created, location: @comment }\n else\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "955b8be183a56b34c2e90009355ade29", "score": "0.6663644", "text": "def post(message, params = {})\n return if options[:quiet]\n require 'socialcast'\n require 'socialcast/message'\n ActiveResource::Base.logger = Logger.new(STDOUT) if options[:trace]\n Socialcast::Message.configure_from_credentials\n Socialcast::Message.create params.merge(:body => message)\n say \"Message has been posted\"\n end", "title": "" }, { "docid": "06ea6eb5df146be68b8e6aeecfa522af", "score": "0.66540116", "text": "def tweet_message(message)\n \n # Create a Twitter::Tweets::StatusesUpdate choreo, that will be used to update \n #your Twitter feed, using the session object (as always)\n update_choreo = Twitter::Tweets::StatusesUpdate.new(@session)\n \n # Inputs for the steps retrieval choreo.\n update_inputs = update_choreo.new_input_set()\n \n # Set input values. This choreo takes inputs specifying Twitter oauth credentials\n # and the message appropriate to whether you have met your Fitbit goal today.\n update_inputs.set_ConsumerKey(TWITTER_CONSUMER_KEY)\n update_inputs.set_ConsumerSecret(TWITTER_CONSUMER_SECRET)\n update_inputs.set_AccessToken(TWITTER_ACCESS_TOKEN)\n update_inputs.set_AccessTokenSecret(TWITTER_ACCESS_TOKEN_SECRET) \n update_inputs.set_StatusUpdate(message)\n \n # Now execute the StatusesUpdate choreo. If you encounter any problems,\n # Print out an error message.\n begin\n update_choreo.execute(update_inputs)\n puts \"Successfully tweeted: #{message}\"\n \n rescue Exception => e\n puts \"Uh-oh! Something went wrong trying to update your Twitter status.\" \n puts \"The error from the choreo was: \"\n puts e.message\n raise e\n end\n end", "title": "" }, { "docid": "96c1863c93b5e747766a6d71e4a3e173", "score": "0.66506845", "text": "def tweet_v2(message, media_ids = nil)\r\n tweet_options = { text: message }\r\n tweet_options[:media] = { media_ids: media_ids } if media_ids.present?\r\n\r\n post('https://api.twitter.com/2/tweets', tweet_options.to_json, 'Content-Type' => 'application/json' )\r\n end", "title": "" }, { "docid": "c8f76139e6c63e8c903bc62137aa4ce7", "score": "0.6650679", "text": "def post(message, params = {})\n return if options[:quiet]\n\n response = Socialcast::CommandLine::Message.with_debug(options[:trace]) do\n Socialcast::CommandLine::Message.create params.merge(:body => message)\n end\n say \"Message has been posted: #{response.permalink_url}\"\n end", "title": "" }, { "docid": "dc9b6dab2043229a0907451bd3a9ecc2", "score": "0.66387194", "text": "def tweet(message, options = {})\n status = Status.new\n status.lat = options[:lat]\n status.long = options[:long]\n status.body = options[:body]\n status.reply_id = options[:reply_id]\n status.post\nend", "title": "" }, { "docid": "285cbaaa04dad3abd78d27ab2bc8afa8", "score": "0.6638351", "text": "def tweet(tweets)\n\t\t@message = tweets\n\t\tnotify_observers(self)\n\tend", "title": "" }, { "docid": "68f9606bfe28ac295453ec3a721ec291", "score": "0.6633707", "text": "def tweet\n return \"tweet tweet\"\n end", "title": "" }, { "docid": "11dfd1747e93576c34a4fa7eff20c345", "score": "0.6631667", "text": "def new_tweet(text)\n end", "title": "" }, { "docid": "b22b37a16ee8615d13a3f52b2bf451ba", "score": "0.6625885", "text": "def create\n\n @topic = Topic.new( params[:topic])\n @topic.user_id = current_user.user_id\n post = @topic.posts.first\n if post\n post.user_id = current_user.user_id\n post.ip_address = request.remote_ip\n end\n @topic.save\n\n\n flash[:message] = 'Your message has been posted both here and on Twitter'\n redirect_to :action => 'index'\n\n rescue Exception => exception\n flash[:notice] = 'Oops! We had a problem posting your message. If this happens again, please contact the site administrators.'\n redirect_to :action => 'index'\n\n end", "title": "" }, { "docid": "c10b0f323673cb016dd86ff7ee6954d7", "score": "0.66242355", "text": "def tweet(message, lat, long)\r\n #\r\nend", "title": "" }, { "docid": "ae2316afb9502d9d4bd3f1457cde4eee", "score": "0.6602499", "text": "def post(timeline, message, struct)\n raise NotImplementedError\n end", "title": "" }, { "docid": "38d35d42e6fe6d2bfbfbf35b6c944835", "score": "0.65768284", "text": "def sender(tweet)\n client = self.client\n client.update(tweet)\n end", "title": "" }, { "docid": "892d954443fe8d1c310fc63f02dc6c63", "score": "0.6575159", "text": "def create\n @post = Post.new(user_id: post_params[:user_id], game_id: post_params[:game_id], text: post_params[:text])\n\n respond_to do |format|\n if @post.save\n if post_params['tweet'].to_i == 1\n tweet_id = current_user.tweet(@post)\n format.html { redirect_to @post, notice: 'Thanks for sharing your check in! You can see it <a target=\"0\" href=\"http://twitter.com/statuses/' + tweet_id.to_s + '\">here</a>.' }\n format.json { render :show, status: :created, location: @post }\n else\n format.html { redirect_to @post, notice: 'Check-in created!' }\n format.json { render :show, status: :created, location: @post }\n end\n else\n format.html { render :new }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25fc2f996f0d94b509e9f396db6372df", "score": "0.6571438", "text": "def post!(identity)\n expect! identity => [Symbol]\n \n # triggers the posting of a share within bountyhill's social network\n \"Identity::#{identity.to_s.camelize}\".constantize.post(get_message, :object => quest)\n \n # triggers the posting of a share within user's social network\n owner.identity(identity).post(get_message, :object => quest)\n identities.update(identity.to_s => Time.now)\n save!\n end", "title": "" }, { "docid": "bf6df2972b7cb97924c3a51c3a46b04a", "score": "0.6565908", "text": "def on_message(dm)\n begin\n tweet = make_public_tweet(dm.text)\n reply(dm, \"#{WITTY_RESPONSES.sample} It's up at #{tweet.uri}\")\n rescue NoRecordFound\n tweet = make_public_tweet()\n reply(dm, \"#{UNSUCCESSFUL_RESPONSES.sample} It's up at #{tweet.uri}\")\n end\n end", "title": "" }, { "docid": "b6b6e4ab60ed00d86f62b757b89e4436", "score": "0.656034", "text": "def post_retweet(ending = '')\n self.retweet_user_id = from_user_id\n return unless valid?\n twitter_update = Twitter.update(to_retweet(ending), :in_reply_to_status_id => self.twitter_id)\n self.retweet_id = twitter_update.id\n self.save\n end", "title": "" }, { "docid": "0de4d827573f51d5b2eabac229c60ff7", "score": "0.6558657", "text": "def publish_tweet(client, tweet_id)\n unless twitter_id.nil?\n client.destroy_status(twitter_id)\n end\n\n tweet = client.update(text, in_reply_to_status_id: tweet_id)\n update(twitter_id: tweet.id)\n return twitter_id\n end", "title": "" }, { "docid": "0de4d827573f51d5b2eabac229c60ff7", "score": "0.6558657", "text": "def publish_tweet(client, tweet_id)\n unless twitter_id.nil?\n client.destroy_status(twitter_id)\n end\n\n tweet = client.update(text, in_reply_to_status_id: tweet_id)\n update(twitter_id: tweet.id)\n return twitter_id\n end", "title": "" }, { "docid": "42ace6ede92d93ad37ae9ed25726c091", "score": "0.65515035", "text": "def post_text(text)\n post_message({ :text => text }) if text\n end", "title": "" }, { "docid": "3d9c8cd6893576685c02f3881cf0a7b0", "score": "0.6538533", "text": "def notify_twitter\n $twitter_client.update(tweet_content)\n end", "title": "" }, { "docid": "3d9c8cd6893576685c02f3881cf0a7b0", "score": "0.6538533", "text": "def notify_twitter\n $twitter_client.update(tweet_content)\n end", "title": "" }, { "docid": "620c7c1fff65d4e5925f7c686967cba5", "score": "0.6536737", "text": "def deliver_tweet(user, tweet)\n template_data = {\n :id => tweet.id_str,\n :tweetURL => \"http://www.twitter.com/#{tweet.user.screen_name}/statuses/#{tweet.id_str}\",\n :screenName => tweet.user.screen_name,\n :realName => tweet.user.name,\n :tweetText => tweet.text,\n :source => tweet.source,\n :inReplyTo => tweet.in_reply_to_status_id_str,\n :profilePic => tweet.user.profile_image_url,\n :profileBackgroundColor => tweet.user.profile_background_color,\n :profileBackgroundImage => tweet.user.profile_use_background_image ? 'url(' + tweet.user.profile_background_image_url + ')' : 'none',\n :profileTextColor => tweet.user.profile_text_color,\n :profileLinkColor => tweet.user.profile_link_color,\n :timeStamp => tweet.created_at,\n :timeStamp_i => Time.parse(tweet.created_at).to_i,\n :utcOffset => tweet.user.utc_offset\n }\n Juggernaut.publish(\"/tweets/#{user.token}\", template_data.to_json)\nend", "title": "" }, { "docid": "a3b33a5c2973fdb721ba21bdd7f12b41", "score": "0.6532896", "text": "def bot_post_message(bot_id, text, options={})\n options.merge! :bot_id => bot_id\n options.merge! :text => text\n post('/bots/post', options)\n end", "title": "" }, { "docid": "d8cb25979cc0ffa7341f0e3771ce205c", "score": "0.6525873", "text": "def send_tweet!(body)\n client.update(body)\n end", "title": "" }, { "docid": "5f2506f60ca61f7fea3f32ee3c261d25", "score": "0.6521493", "text": "def send_tweet( msg, img_name, options={} )\n raise StandardError, 'need user access token to send tweets' if @client.access_token.nil?\n raise StandardError, 'need user access token secret to send tweets' if @client.access_token_secret.nil?\n\n @client.update_with_media msg, img_name, options\n end", "title": "" }, { "docid": "8b8bcc25668b4bb8493a73dffa1d7fe5", "score": "0.65122867", "text": "def create_tweet\n client.send_tweet(params['Full Text'])\n head 200, content_type: \"text/html\"\n end", "title": "" }, { "docid": "23e5926c39408f982d85f7d09719dcdf", "score": "0.64778167", "text": "def tweetpost(tweet, config)\n Net::HTTP.start('twitter.com') do |http|\n req = Net::HTTP::Post.new('/statuses/update.xml')\n req.basic_auth config[:twitter_user], config[:twitter_pass]\n req.set_form_data({'status' => tweet})\n res = http.request(req).body\n end\nend", "title": "" }, { "docid": "cc9e3c5f103f16c63dbd4d153f72e71e", "score": "0.64757395", "text": "def publish_tweet(tweet)\n\tPusher['live-tweets'].trigger('new-tweet', tweet.to_json)\nend", "title": "" }, { "docid": "cdd4fd4e386f5d3bf9cee8e442f05fcc", "score": "0.6474902", "text": "def send_message(channel, message)\n HTTP.post(INCOMING_URL, json: {\n username: \"soundlikes\",\n channel: \"##{channel}\",\n text: message\n })\nend", "title": "" }, { "docid": "c05610b278eb8de2d04d4915fb442c39", "score": "0.64698154", "text": "def post_message(message)\n # API ENDPOINT: https://slack.com/api/chat.postMessage \n # query: @id\n results = HTTParty.post(\"https://slack.com/api/chat.postMessage\", query: { token: SLACK_TOKEN, channel: id, text: message})\n raise BadResponseError, \"chat.postMessage endpoint response IS NOT OK.\" unless results[\"ok\"]\n end", "title": "" }, { "docid": "8777f901e647ba488dccf09bca74acba", "score": "0.6466415", "text": "def post( text )\n message = {\n 'time' => Time.now.strftime('%Y%m%d%H%M%S'),\n 'text' => text\n }\n\n data['messages'] << message\n end", "title": "" }, { "docid": "3536e2ab2b9f64a389d913cd7e944334", "score": "0.64589334", "text": "def send_tweet(user, tweet)\n\n #Prevent duplicate tweets from sending.\n @tweet = tweet\n\n @last_tweet = Twitter.user_timeline(@user).first.text\n\n #Catch over-length tweets before they're sent to Twitter.\n overtweet = (@tweet.length - TWEET_LENGTH_LIMIT)\n\n if overtweet > 0\n\n return \"Tweet too long by #{overtweet} char(s) (tweet length = #{@tweet.length} chars)\"\n\n elsif @tweet == @last_tweet\n\n return \"Duplicate of previous tweet (#{@last_tweet}). Not sent.\"\n\n else\n\n @response = Twitter.update(tweet)\n #tweet_text = response.text\n #user = response.user[\"screen_name\"]\n #puts \"Tweet '#{tweet_text}' from user #{user} sent\"\n\n end\n\n end", "title": "" }, { "docid": "6e4a17bddd7ae497176b0d1a4d6a849c", "score": "0.64573973", "text": "def tweet\n \n identity = Identity.find_by(provider: \"twitter\", uid: session[:twitter_uid])\n \n tweet = params.require(:message)\n redirect = params.require(:redirect_uri)\n \n # If we couldn't find an identity then we login again\n if(identity.nil?) \n\t session[:session_back] = \"/twitter/tweet?message=\" + URI.encode(tweet) + \"&redirect_uri=\" + URI.encode(redirect);\n redirect_to \"/auth/twitter\"\n return\n end\n \n begin\n\t client = Twitter::REST::Client.new do |config|\n\t config.consumer_key = ENV[\"TWITTER_KEY\"]\n\t config.consumer_secret = ENV[\"TWITTER_SECRET\"]\n\t config.access_token = identity.accesstoken\n\t config.access_token_secret = identity.secret\n\t end\n\n\t client.update(tweet)\n rescue Twitter::Error::Forbidden => e\n\t error = \"You already tweeted about this training!\"\n end\n\n\t if(error)\n redirect_to redirect, alert: error\n\t else\n redirect_to redirect, notice: \"You successfully tweeted about this training!\"\n\t end\n end", "title": "" } ]
f9b9d892af16b74445548bd53aa5c082
test to check functionality of talk method.
[ { "docid": "61dad9962963a71ff5001b57735934dc", "score": "0.6385089", "text": "def test_talk\n student = Student.new(\"Robbie\", \"E23\")\n assert_equal(\"Hi, my name is Robbie\", student.talk)\n end", "title": "" } ]
[ { "docid": "2140c29e128a99a2ea14798d5e8bf3fd", "score": "0.73256004", "text": "def test_that_neil_can_talk_to_you\n\t\tassert @neil.talk_to('good', 'yes')\n\tend", "title": "" }, { "docid": "b5ae3869272707c8a2b59d591fe9e2a2", "score": "0.7010385", "text": "def talk\n return \"I can talk!\"\n end", "title": "" }, { "docid": "afac4a20e9471ec962560d1dc4f315e9", "score": "0.6958885", "text": "def talk\r\n puts \"Duuudde!!!\";\r\n end", "title": "" }, { "docid": "0401e3f8e6a77d6129706932daef6f01", "score": "0.69244015", "text": "def talk\r\n puts \"Wahhh!!!\";\r\n end", "title": "" }, { "docid": "7a20a0c30fce619717564e2de653d98a", "score": "0.6870448", "text": "def talk\r\n puts \"Grrrrr!!!\";\r\n end", "title": "" }, { "docid": "7d90d404eb85bc6b0a85a432bd26c713", "score": "0.68078446", "text": "def talk\n puts \"say hello\"\nend", "title": "" }, { "docid": "b5595e3ec0d92282200878ba96f4633c", "score": "0.67942023", "text": "def test_talk\n student = Student.new(\"Pete\", \"G6\")\n assert_equal(\"I can talk!\", student.talk)\n end", "title": "" }, { "docid": "4be4b69a273361d7c2eab4bf0f7d71d5", "score": "0.6787258", "text": "def test_student_talk()\n assert_equal(\"I can talk!\", @student0.talk)\n end", "title": "" }, { "docid": "d208f4572286384342d2bf7d7efe9ed3", "score": "0.6761048", "text": "def studnet_talk()\n return \"I can talk!\"\n end", "title": "" }, { "docid": "edf38178491222c02a31e41ebc5d2ae9", "score": "0.6747063", "text": "def test_student_talk()\n\n result = @test_student.studnet_talk()\n assert_equal(\"I can talk!\", result)\n\n end", "title": "" }, { "docid": "e71a2573568fa81c5081ae71009934aa", "score": "0.66944754", "text": "def test_student_talks\n account = Student.new('John', 'G13')\n assert_equal('I can talk!', account.talk())\n end", "title": "" }, { "docid": "2b3639d38353c748fc9acf4675030f3c", "score": "0.6663291", "text": "def talk\n \"arrrrrrrrr\"\n end", "title": "" }, { "docid": "10d322318a5b28e7239a096de1f30b46", "score": "0.6651927", "text": "def test_student_can_talk\n assert_equal(\"I can talk!\", @student.student_can_talk())\n end", "title": "" }, { "docid": "7b0b8dedbd7d1b494bf4c55d3d847dde", "score": "0.6599954", "text": "def talk\n puts \"Hello\"\nend", "title": "" }, { "docid": "7b0b8dedbd7d1b494bf4c55d3d847dde", "score": "0.6599954", "text": "def talk\n puts \"Hello\"\nend", "title": "" }, { "docid": "0a947e0fbbac75fb9d4a7d1fa792105b", "score": "0.6588217", "text": "def talk\n \"rrrrrrrrrr\"\n end", "title": "" }, { "docid": "6f17bb5200bd7df38791ad723ff837fd", "score": "0.65532255", "text": "def speak()\n return \"I can talk!\"\n end", "title": "" }, { "docid": "319db2895e72373657b7b54fe5ed49ba", "score": "0.65411925", "text": "def silly_talk()\nend", "title": "" }, { "docid": "b53d91660befcb3898ee886cd61301e0", "score": "0.64945304", "text": "def test_student_talk\n assert_equal(\"I can talk\", @codeclan_student.talk)\n end", "title": "" }, { "docid": "30954bfea876e35723bf4ed6f91c575f", "score": "0.64665246", "text": "def test_send_pings\n end", "title": "" }, { "docid": "c64a72a16a3e110f2ce5b8bd59360bfb", "score": "0.64528465", "text": "def test_guest_go_whoo\n assert_equal(\"Whoo\", @guest1.go_whoo(@song3))\n\n end", "title": "" }, { "docid": "f6f94507ad727e6b0b8d70479b192426", "score": "0.6401369", "text": "def test_simple\n\t\tcalled = false\n\t\tPsychic.connect(h = \"Hello\", :length) {|obj,method,value,*args|\n\t\t\tassert_equal h,obj\n\t\t\tassert_equal :length,method\n\t\t\tassert_equal 5,value\n\t\t\tassert_equal [],args #also test on something wit args\n\t\t\tcalled = true\n\t\t}\n\t\tassert_equal 5,h.length\n\t\tassert called, \"expected psychic connection on \\\"#{h}\\\".length\"\n\tend", "title": "" }, { "docid": "cc3e83c33003a2bf881bd2bc014801e3", "score": "0.6374315", "text": "def talk \n\t\tputs \"#{@name} says Bark!\"\n\tend", "title": "" }, { "docid": "f7ce1f1ff0cd326db24d61e266ba831a", "score": "0.6363113", "text": "def talk\nputs \"Hello\"\nend", "title": "" }, { "docid": "ed9c4a6fbb953b2f96563f66497ce290", "score": "0.63277453", "text": "def talk\n\t\tputs \"#{@name} says Bark!\"\n\tend", "title": "" }, { "docid": "02d9beb6c0b1a04b3b7fb0ce3d4bc77e", "score": "0.62864286", "text": "def test_grandma_responds_to_first_goodbye\n grandma = DeafGrandma.new\n\n assert_equal grandma.speak_to(\"GOODBYE!\"), \"LEAVING SO SOON?\"\n end", "title": "" }, { "docid": "9e2740bb9eae0cb848ce77cfb0f133ee", "score": "0.6260957", "text": "def speak\n end", "title": "" }, { "docid": "eed7b099d602c5f7b8d339b53e40468e", "score": "0.62452537", "text": "def speak\n # Whatever is here is the behavior or action the object can do. In the example it is a string \"Arf!\"\n \"Arf!\"\n # This is the end of the speak method\n end", "title": "" }, { "docid": "a21e478ab5c1dc713812cf25418773ac", "score": "0.6190914", "text": "def talk\n\t\tputs \"#{@name} says Bark!\"\n\tend", "title": "" }, { "docid": "dc23c22fd1597a46b3bd20d025573ab3", "score": "0.6184525", "text": "def speak\n true\n end", "title": "" }, { "docid": "fd3c87ff355cf2ee23c99e563dd87aa8", "score": "0.6145494", "text": "def test_student_talks()\n student = CodeClanStudent.new(\"Scott\", 3)\n student.student_talks()\n assert_equal(\"I can talk!\", student.student_talks())\nend", "title": "" }, { "docid": "31eaab5844f37d73e972f6dd9a080cb0", "score": "0.61390513", "text": "def talk(any) # => any\n any\nend", "title": "" }, { "docid": "ffc325da06547cec2899019cb80a5a5d", "score": "0.61276114", "text": "def test_grandma_responds_when_you_say_anything_in_lowercase\n grandma = DeafGrandma.new\n lower_case_talk = \"hI GrandMa\"\n\n assert_equal grandma.speak_to(lower_case_talk), \"SPEAK UP, KID!\"\n end", "title": "" }, { "docid": "d97b195827d751f8bd749ccb9a3b4c65", "score": "0.6122725", "text": "def test_grandma_responds_to_second_goodbye\n grandma = DeafGrandma.new\n\n assert_equal grandma.speak_to(\"GOODBYE!\"), \"LATER, SKATER!\"\n# => program exits\n assert grandma.nil?\n\n end", "title": "" }, { "docid": "1b30859930eebb957c56d81d173bee5e", "score": "0.6122428", "text": "def cmd_talk\n if @use_talk\n puts \"James, the wise break dancing wizard asks you\"\n puts \"QUICK! What kind of type is programming language SML?\"\n puts \"a: rock type\"\n puts \"b: dynamic type\"\n puts \"c: static type\"\n puts \"d: awesome type\"\n move = gets.chomp\n if move == \"c\"\n puts \"That is correct. James blew your mind away with an\"\n puts \"impressive dance move and gave you 20 gold and an item\"\n @use_talk = false #cant use talk anymore\n @world[:gold] += 20\n @world[:inventory].push(\"potion\",0,7)\n else\n puts \"That is incorrect. James attacked you with his break dancing\"\n puts \"move and damaged you for 10 health\"\n @world[:health] -= 10\n #checks if user died\n if @world[:health] <=0\n return FailureState.new\n end\n end\n else\n puts \"You cannot talk to the wizard anymore\"\n end\n self\n end", "title": "" }, { "docid": "00f5870b9a2ddc04911f7b3b4f665f40", "score": "0.6116522", "text": "def talk\n puts \"#{@name} says Bark!\"\n end", "title": "" }, { "docid": "b7299005fce397fa8831d6b688e0d257", "score": "0.60810393", "text": "def talking_to_bot?\n @talking_to_bot\n end", "title": "" }, { "docid": "f201741b39e980d4386e4b7b41ac06d9", "score": "0.6063853", "text": "def speak\n puts \"chitter!\"\n end", "title": "" }, { "docid": "1513d3d8401297756d4457eb6386ea37", "score": "0.6063335", "text": "def speak\n puts \"Meow\"\n end", "title": "" }, { "docid": "8b40998aa991081e06a4faf58ab25750", "score": "0.60592765", "text": "def say_hello", "title": "" }, { "docid": "0ed971067f9e444e176e4fb067202dc9", "score": "0.60427344", "text": "def ping \n :pong if talk(\"PING\") =~ /PONG/\n end", "title": "" }, { "docid": "e4425112c8ab7e7858538ca0a525cf95", "score": "0.60274154", "text": "def test_teach_one_spell\n got_here = false\n @wiz.learn('telepathy') { puts \"I see what you're thinking\"; got_here = true}\n \n @wiz.telepathy\n assert(got_here)\n end", "title": "" }, { "docid": "a6af6f07da63883c968772b6cabc986f", "score": "0.6024559", "text": "def talk(json)\n end", "title": "" }, { "docid": "f8d9a51ce6d37f0baee96eb0d4a2daf1", "score": "0.6019293", "text": "def talk_hello (params=[])\n\t\t@text_talk[:hello]\n\tend", "title": "" }, { "docid": "bc0f1a77d4975d2b209d4e93a86c3395", "score": "0.59775597", "text": "def say(narrative)\n not_supported('say')\n end", "title": "" }, { "docid": "9ffc80d169a8434bc1354bc32403c8fa", "score": "0.59423953", "text": "def test topic, *args; end", "title": "" }, { "docid": "4dba48e8b94765ad1149fad7ba0812e6", "score": "0.5934136", "text": "def speak\n puts \"hello\"\n end", "title": "" }, { "docid": "1245b35f983cdbcc7570cccc9d3091c6", "score": "0.5916795", "text": "def calling_speak\n speak\n end", "title": "" }, { "docid": "cd830155c2bdc85d56b17e0b8ab1b15e", "score": "0.58569235", "text": "def test_specify_method_support\r\n\t\thello7 = ATU::M1::Hello7.new\r\n\t\tassert_equal([1,2,3],hello7.to_a)\r\n\t\tassert_equal(\"a\",hello7.type(\"b\"))\r\n\t\tassert_equal(\"b\",hello7.to_s)\r\n\t\tassert_equal(\"normal\",hello7.normal)\r\n\tend", "title": "" }, { "docid": "5d8433b77f7d43d7db4c715741e462c8", "score": "0.5855801", "text": "def _communicable?\n say_hi?\n end", "title": "" }, { "docid": "2546addcbd47780fb0f417af1c9ae801", "score": "0.585312", "text": "def test_truth\r\n end", "title": "" }, { "docid": "2546addcbd47780fb0f417af1c9ae801", "score": "0.585312", "text": "def test_truth\r\n end", "title": "" }, { "docid": "2546addcbd47780fb0f417af1c9ae801", "score": "0.585312", "text": "def test_truth\r\n end", "title": "" }, { "docid": "2546addcbd47780fb0f417af1c9ae801", "score": "0.585312", "text": "def test_truth\r\n end", "title": "" }, { "docid": "c1be77b977b1cc34caa2b16ef67f2ffd", "score": "0.5851255", "text": "def student_talks\n return \"I can talk\"\n end", "title": "" }, { "docid": "104139dc2a622fb026ed7b5b3ba4136f", "score": "0.5838654", "text": "def test_grandma_responds_when_you_say_anything_in_all_uppercase\n grandma = DeafGrandma.new\n all_upper_case_talk = \"WHAT UP AHOLE\"\n\n assert_equal grandma.speak_to(all_upper_case_talk), \"NO, NOT SINCE 1946!\"\n end", "title": "" }, { "docid": "46d41fb57ad2fb1c6bcad54302d52e95", "score": "0.58383715", "text": "def test_likes_to_eat\nresult = likes_to_eat(@person2, \"bread\")\nassert_equal(result, true)\nend", "title": "" }, { "docid": "8501ba372246c731b3c51d72d7a00369", "score": "0.58317524", "text": "def whom_should_i_talk_to\n :anybody\n end", "title": "" }, { "docid": "0258123d1e95c51404c45560b987bd9e", "score": "0.5826626", "text": "def welch_ttest\n end", "title": "" }, { "docid": "645d9dab04f4a9f940ad6df69287533f", "score": "0.58227515", "text": "def say_hello\n puts \"#{self.name} says #{self.speak}!\"\n end", "title": "" }, { "docid": "c74376dd75fa738272a1b30b3672b828", "score": "0.5815404", "text": "def speak\n \"Oink Oink!!!\"\n end", "title": "" }, { "docid": "59eafaac57776c25b331e4a3d33aa4f7", "score": "0.5801611", "text": "def test_mute?\n duck = Duck.new\n assert !duck.mute?\n duck.mute\n assert duck.mute?\n end", "title": "" }, { "docid": "a02005a7016ee26fbfd815df9a7ca1bb", "score": "0.5793627", "text": "def test_check_ability_to_fight\n test_person2 = Human.new(\"Test person\", 100, 80, 1)\n test_person2.health = 0\n assert(test_person2.check_ability_to_fight)\n end", "title": "" }, { "docid": "42bd1ead315d1218f6ce990cb5735ded", "score": "0.57858443", "text": "def test_check_favourite_song__yes\n @rooms7.check_favourite song(@LoveSong1)\n assert_equal(\"Whoo\", )\n end", "title": "" }, { "docid": "d0ade3ed5be9106a434f4cff76f4dcf5", "score": "0.5779807", "text": "def talk_to(pars = [])\r\n pars = [ pars ] unless pars.is_a?(Array)\r\n whom = pars.first\r\n\r\n if (pars.size > 1)\r\n say :what_a_gibberish\r\n elsif self.is_active_object?(whom)\r\n say \"You can't chat with that.\" \r\n # PS: assuming that all persons will have something to say, this applies to things\r\n else\r\n say \"Talk to whom? I don't see any #{Thing.alias_to_name(whom)} around here.\"\r\n end\r\n end", "title": "" }, { "docid": "40198eea5846f44a3e00ab2743b45786", "score": "0.57668906", "text": "def test_truth\n end", "title": "" }, { "docid": "40198eea5846f44a3e00ab2743b45786", "score": "0.57668906", "text": "def test_truth\n end", "title": "" }, { "docid": "40198eea5846f44a3e00ab2743b45786", "score": "0.57668906", "text": "def test_truth\n end", "title": "" }, { "docid": "40198eea5846f44a3e00ab2743b45786", "score": "0.57668906", "text": "def test_truth\n end", "title": "" }, { "docid": "40198eea5846f44a3e00ab2743b45786", "score": "0.57668906", "text": "def test_truth\n end", "title": "" }, { "docid": "40198eea5846f44a3e00ab2743b45786", "score": "0.57668906", "text": "def test_truth\n end", "title": "" }, { "docid": "40198eea5846f44a3e00ab2743b45786", "score": "0.57668906", "text": "def test_truth\n end", "title": "" }, { "docid": "40198eea5846f44a3e00ab2743b45786", "score": "0.57668906", "text": "def test_truth\n end", "title": "" }, { "docid": "8bc39227573021007c5e84145ec97348", "score": "0.57648045", "text": "def test_student_talk\n assert_equal(\"Student Aline talking.\", @student.talk)\nend", "title": "" }, { "docid": "7a5e2833877bc3404d0a7b4ae0907f3f", "score": "0.5763616", "text": "def test_method_missing\n assert_raise NoMethodError do\n @questionnaire.no_such_method\n end\n end", "title": "" }, { "docid": "7a5e2833877bc3404d0a7b4ae0907f3f", "score": "0.5763616", "text": "def test_method_missing\n assert_raise NoMethodError do\n @questionnaire.no_such_method\n end\n end", "title": "" }, { "docid": "e2cf79af56a05035cda9023266e1375c", "score": "0.5761566", "text": "def test_kcode_001\n\t\t#\n\t\tdest = make_destination\n @conn.subscribe dest\n\t\t@messages.each do |abody|\n\t\t @conn.publish dest, abody\n\t\t\tmsg = @conn.receive\n\t\t\tassert_instance_of Stomp::Message , msg, \"type check for #{abody}\"\n\t\t\tassert_equal abody, msg.body, \"equal check for #{abody}\"\n\t\tend\n end", "title": "" }, { "docid": "16a6d5e8eabd975007f205c109c50890", "score": "0.5760361", "text": "def testing; end", "title": "" }, { "docid": "f059601b9f504cdaeb63f04d59da2721", "score": "0.5758381", "text": "def speak\n \"meow\"\n end", "title": "" }, { "docid": "149062794bcfa04f30688d30086f4cd5", "score": "0.57522523", "text": "def test_send_multiple_pings\n end", "title": "" }, { "docid": "fae49263af25c016fed56c6406e9a654", "score": "0.57504743", "text": "def think\n answer = echo \"client is thinking\"\n echo answer\n end", "title": "" }, { "docid": "7f740e435a18ea34d387ef31a69c73d0", "score": "0.57441765", "text": "def testing msg=nil\n\t\t\tmsg = @msg if !msg\n\t\t\tnotify(3,\"test #{@action} #{msg}\")\n\t\tend", "title": "" }, { "docid": "e0f90be850325b310c78f636fe90704b", "score": "0.5742526", "text": "def test_eating()\n cat = Cat.new(\"root\")\n assert(cat.will_eat(\"fish\"))\n assert(cat.will_eat(\"milk\"))\n assert(!cat.will_eat(\"rocks\"))\n end", "title": "" }, { "docid": "1f71e7028f03f3fa071b9547cce94550", "score": "0.5740571", "text": "def test_guest_favourite_song_and_add_song\n\n @room3.add_song(@ezra)\n @room3.add_guest(@guest1)\n\n assert_equal(1, @room3.playlist.count)\n assert_equal(\"Whoo!\", @guest1.cheer(@room3.playlist))\n\n end", "title": "" }, { "docid": "7bc93af78b24fa068d0262f165b02f48", "score": "0.573985", "text": "def test_takes_user_inputs\n assert ToyRobot.respond_to?(:main)\n end", "title": "" }, { "docid": "74527c04a1f091dda602391e64b25ddc", "score": "0.5732324", "text": "def test_method(method_name, params, expected)\r\n puts \"#{method_name}(#{params})\"\r\n result = self.send(method_name, params)\r\n ok = result == expected\r\n puts \" (%s) => #{result}\" % (ok ? \"OK\" : \"FAIL\")\r\n puts \" Expected: #{expected}\" unless ok\r\n return ok\r\nend", "title": "" }, { "docid": "3544f5c274a66a1b159a92bd2bbbf5f1", "score": "0.5731618", "text": "def psych_test\n\tend", "title": "" }, { "docid": "97f07eac8136521527c922ceaf3605d7", "score": "0.57237774", "text": "def test_switch_pronoun\n assert_equal(\"i am a robot\", Wordplay.switch_pronouns(\"You are a robot\"))\n assert_equal(\"you are a person\", Wordplay.switch_pronouns(\"i am a person\"))\n assert_equal(\"i love myself\", Wordplay.switch_pronouns(\"you love yourself\"))\n end", "title": "" }, { "docid": "74962ea877f6e4ea8301ac5ef680e24b", "score": "0.5711359", "text": "def bot?; end", "title": "" }, { "docid": "2c9a74d0bd5854617625264a2044a726", "score": "0.5704019", "text": "def speak\n super\n puts 'But I can also talk because I am a great dane.'\n end", "title": "" }, { "docid": "019802c5e955b5a4c4121f2f26b6f53a", "score": "0.5702802", "text": "def test_mute\n duck = Duck.new\n duck.mute\n assert_equal '', duck.quak\n end", "title": "" }, { "docid": "fb6be1360d6532358841b2fd531193e8", "score": "0.5697694", "text": "def hello\r\n true\r\n end", "title": "" }, { "docid": "341597c269fc4cc1d5805e4ed3f615d9", "score": "0.5696866", "text": "def test_go_pond\n duck = Duck.new\n duck.go_pond\n assert duck.in_pond?\n duck.out_pond\n assert !duck.in_pond?\n end", "title": "" }, { "docid": "657ca09ded2c7918af57a835c38ccfdb", "score": "0.5694837", "text": "def test_ok; end", "title": "" }, { "docid": "657ca09ded2c7918af57a835c38ccfdb", "score": "0.5694837", "text": "def test_ok; end", "title": "" }, { "docid": "3b8ad0e0d581fcb45466df375a303e74", "score": "0.56903327", "text": "def say_hello\n puts \"hello call\"\n end", "title": "" }, { "docid": "1068832c8229c37488788b46a0871f26", "score": "0.5686618", "text": "def testing\n end", "title": "" }, { "docid": "33a78e9cda539875e127968dcce51452", "score": "0.5682677", "text": "def test_go_pond\n duck = Duck.new\n duck.go_pond\n assert duck.in_pond?\n end", "title": "" }, { "docid": "314c5c274522bde3677b088c206e07f3", "score": "0.56815904", "text": "def test_shout_hello\n assert_equal \"HELLO\", shout(\"hello\")\n end", "title": "" }, { "docid": "f84859792e3592ddb6e7081946c849d8", "score": "0.5676097", "text": "def test_service_check_aliases\n assert_respond_to(Ping::TCP, :econnrefused)\n assert_respond_to(Ping::TCP, :econnrefused=)\n assert_respond_to(Ping::TCP, :ecr)\n assert_respond_to(Ping::TCP, :ecr=) \n end", "title": "" } ]
3ed890268e35d7778a492d4bb714b68d
Simplify an API value down to a basic term that we can present in a spreadsheet
[ { "docid": "468a4d23b4b0110a6488ded59740441e", "score": "0.0", "text": "def simplify_value(val)\n v = val\n\n if v.is_a?(Hash)\n v = v['@value'] if v['@value']\n v = v['@id'] if v['@id']\n end\n\n v = v.first if v.is_a?(Array)\n\n v\n end", "title": "" } ]
[ { "docid": "ec8ffd7f5f72d240ff2da298fdbbc13f", "score": "0.6083128", "text": "def api_value(val, data)\n case val\n when 'alcoholInteraction'\n data['alcohol_interaction']\n when 'availableGeneric'\n data['available_generic']\n when 'brandNames'\n return [] if data['brand_names'][0] == data['rxcui']\n RxcuiLookup.top_concepts(data['brand_names'], 5) || []\n when 'brandedDoseForms'\n data['branded_dose_form'] || []\n when 'clinicalDoseForms'\n data['clinical_drug_dose_form'] || []\n when 'conditionsTreated'\n conditions(data)\n when 'contraindicatedConditions'\n data['contraindicated_conditions']&.values&.reduce(:+)&.map(&:downcase)&.uniq || []\n when 'drugClasses'\n data['drug_classes'] || []\n when 'drugForms'\n drug_forms(data) || []\n when 'drugInteractions'\n data['normal_interactions']&.uniq || []\n when 'drugSchedule'\n data['addiction_drug_schedule']\n when 'drugScheduleDescription'\n Description.substance_schedule(data['addiction_drug_schedule'])\n when 'hasOTC'\n data['availiability'] == 'No prescription needed'\n when 'ingredientIn'\n data['multiple_ingredients'] || []\n when 'isBrand'\n data['concept_type'] == 'brand_name'\n when 'isPrescribable'\n data['can_be_prescribed']\n when 'name'\n data['name']\n when 'generic'\n data['active_compound_group']\n when 'genericStrength'\n data['available_strengths'][0]\n when 'overdoseWarning'\n data.dig('free_text', 'overdose')\n when 'pathname'\n pathname\n when 'photo'\n image_url\n when 'pregnancyCategory'\n data['pregnancy_category']\n when 'pregnancyCategoryDescription'\n Description.pregnancy(data['pregnancy_category'])\n when 'severeDrugInteractions'\n data['severe_interactions']&.uniq || []\n when 'similarDrugs'\n data['similar_drugs']&.map { |d| d['rxcui'] }&.compact || []\n when 'synonyms'\n canonical_name = data['canonical_name']&.downcase\n canonical_name.nil? || canonical_name == name.downcase ? [] : [data['canonical_name']]\n when 'topComparisonDrug' # TODO: top comparison drug\n top_comp = Medication.find_by_rxcui(data['similar_drugs']&.slice(0)&.dig('rxcui').to_i)\n comp_data = top_comp&.comparison_values || {}\n unless comp_data.empty?\n comparison_interactions = (comp_data['severeDrugInteractions'] + comp_data['drugInteractions']).to_set\n main_interactions = (api_value('severeDrugInteractions', data) + api_value('drugInteractions', data)).to_set\n comp_data['sharedInteractions'] = (comparison_interactions.intersection(main_interactions)).to_a\n comp_data['comparisonInteractionsUnique'] = (comparison_interactions - main_interactions).to_a\n comp_data['mainInteractionsUnique'] = (main_interactions - comparison_interactions).to_a\n comparison_conditions = comp_data['conditionsTreated'].to_set\n main_conditions = conditions(data).to_set\n comp_data['sharedConditions'] = (comparison_conditions.intersection(main_conditions)).to_a\n comp_data['comparisonConditionsUnique'] = (comparison_conditions - main_conditions).to_a\n comp_data['mainConditionsUnique'] = (main_conditions - comparison_conditions).to_a\n end\n comp_data\n when 'type'\n # data['concept_type']&.tr('_', ' ')\n data['active_compound_group'].to_i == rxcui ? 'generic drug' : 'branded drug'\n when 'url'\n pathname\n when 'usage'\n data.dig('free_text', 'dosage_instructions') || []\n when 'warning'\n data.dig('free_text', 'warnings_and_precautions')\n end\n end", "title": "" }, { "docid": "21b41b0e332b674a48d016994a12d191", "score": "0.5640164", "text": "def convert\n match('q', 'name')\n equal('per_page', 'limit', default: input['open_corporates_api_key'] && 100) # default 30, maximum 100\n equal('page', 'page')\n\n # API-specific parameters.\n equal('api_token', 'open_corporates_api_key')\n\n output\n end", "title": "" }, { "docid": "f423a854a0c0c4cb1b270138aaf4e8ff", "score": "0.56181777", "text": "def convert\n match('q', 'name')\n equal('company_type', 'classification')\n equal('created_since', 'created_at>=')\n date_range('incorporation_date', 'founding_date')\n date_range('dissolution_date', 'dissolution_date')\n equal('per_page', 'limit', default: input['open_corporates_api_key'] && 100) # default 30\n equal('page', 'page')\n\n input['contact_details'] && input['contact_details'].each do |contact_detail|\n if contact_detail['type'] == 'address' && (contact_detail['value'] || contact_detail['value~='])\n output['registered_address'] = contact_detail['value'] || contact_detail['value~=']\n end\n end\n\n # API-specific parameters.\n equal('api_token', 'open_corporates_api_key')\n one_of('jurisdiction_code', 'jurisdiction_code', transform: lambda{|v| v.downcase})\n one_of('country_code', 'country_code', transform: lambda{|v| v.downcase})\n equal('current_status', 'current_status')\n all_of('industry_codes', 'industry_code', backup: :one_of)\n equal('inactive', 'inactive', valid: [true, false])\n equal('branch', 'branch', valid: [true, false])\n equal('nonprofit', 'nonprofit', valid: [true, false])\n\n output\n end", "title": "" }, { "docid": "eaff0b8a70077e880ac635c94b3919eb", "score": "0.5542717", "text": "def itemize entry, header = [\"role\", \"who\", \"address\"]\n<<EOS\n- #{clean header.map { |x| entry[x] }.join(\", \")}\n #{period entry}\n#{reflow_to_string entry[\"summary\"], 72, \" \"}\nEOS\nend", "title": "" }, { "docid": "ac55c613c3304588b1006992b32c6e67", "score": "0.551223", "text": "def parse_terms_response(response, type)\n\n str = ''\n\n response['response']['docs'].map do |result|\n if result['numFound'] != '0'\n str = result[type]\n if str.class == Array\n str = str.join() # 'join' is used to convert an array into a string because otherwise an error occurs\n end\n end\n end\n\n return str\n end", "title": "" }, { "docid": "ac55c613c3304588b1006992b32c6e67", "score": "0.551223", "text": "def parse_terms_response(response, type)\n\n str = ''\n\n response['response']['docs'].map do |result|\n if result['numFound'] != '0'\n str = result[type]\n if str.class == Array\n str = str.join() # 'join' is used to convert an array into a string because otherwise an error occurs\n end\n end\n end\n\n return str\n end", "title": "" }, { "docid": "b4c7e4c9fd8cf707b0eac7745c86d7fb", "score": "0.55015", "text": "def parse_terms_response(response, type)\n\n str = ''\n\n response['response']['docs'].map do |result|\n if result['numFound'] != '0'\n str = result[type]\n if str.class == Array\n str = str.join() # 'join' is used to convert an array into a string because otherwise an error occurs\n end\n end\n end\n\n str\n end", "title": "" }, { "docid": "4ea2291835f5a1328dc9951ff5749d11", "score": "0.54488283", "text": "def _reduce_542(val, _values, result)\n result = \"&#{value(val[1])}\".to_sym\n \n result\nend", "title": "" }, { "docid": "26b2fef5f38d0b183be1683de4e63e5f", "score": "0.54433537", "text": "def normalize_value(val)\n if val.is_a?(Hash)\n val = val[\"__content__\"] if val.has_key?(\"__content__\")\n val = val.values.first if val.respond_to?(:values) && val.values.one?\n val = val.join(\" \") if val.respond_to?(:join)\n val.to_s\n else # any other value\n val\n end\n end", "title": "" }, { "docid": "36987df40ef1eb99e1e41a5af37bbe35", "score": "0.5430602", "text": "def _reduce_400(val, _values, result)\n result = \"result = ['dsym', val[1]];\"\n \n result\nend", "title": "" }, { "docid": "c465d50c60d10b09927e86cdf94b21ff", "score": "0.5418927", "text": "def _reduce_524(val, _values, result)\n result = \"&#{value(val[1])}\".to_sym\n \n result\nend", "title": "" }, { "docid": "c465d50c60d10b09927e86cdf94b21ff", "score": "0.5418927", "text": "def _reduce_524(val, _values, result)\n result = \"&#{value(val[1])}\".to_sym\n \n result\nend", "title": "" }, { "docid": "5bc49895b8baf06ece4cee433aff6fff", "score": "0.5408188", "text": "def api_status_description\n status_description.downcase.tr(' ', '_')\n end", "title": "" }, { "docid": "2bc7ebaea7a28fe93d5f77c5e19ceeba", "score": "0.5406298", "text": "def QWordsBeg(value); end", "title": "" }, { "docid": "a6298e87e2d0494d8cc1656ee5045ee1", "score": "0.54040855", "text": "def kitten_value value\n case value\n when Array\n safe_join(value.map {|v| kitten_value v}, ', ')\n when DataKitten::Agent\n if value.mbox\n safe_join([value.name, content_tag(:small, mail_to(value.mbox))], ' ')\n else\n value.name\n end\n when DataKitten::License\n link_to(value.name, value.uri.to_s)\n when DataKitten::Rights\n if value.uri\n link_to(I18n.t('data_kitten.rights_statement'), value.uri.to_s)\n end\n when DataKitten::Temporal\n dates = [kitten_value(value.start), kitten_value(value.end)].reject(&:blank?)\n safe_join(dates, ' — ') if dates.any?\n when String\n value\n when Date\n value.strftime('%-e %B %Y')\n when Hash\n value[:title]\n else\n value.to_s\n end\n end", "title": "" }, { "docid": "dfc1d25e6d02325867c4d8cd0d8d673e", "score": "0.5398999", "text": "def _reduce_508(val, _values, result)\n result = \"&#{value(val[1])}\".to_sym\n \n result\nend", "title": "" }, { "docid": "81d087e422e6e158c20f183d8bf047d2", "score": "0.53965616", "text": "def _reduce_544(val, _values, result)\n result = \"&#{value(val[1])}\".to_sym\n \n result\nend", "title": "" }, { "docid": "0b6f961f329a69f53936981857da471c", "score": "0.5381695", "text": "def normalize_name(value)\n case value\n when /2tth/i\n '2TTH'\n when /arab.+prin/i\n 'Arab Spring'\n when /agen.+21/i\n 'Agenda21'\n when /an.+constit/i\n 'Anti Constitution'\n when /b.+versi/i\n 'Biodiversitée'\n when /cyb.+war/i\n 'CyberWar$'\n when /devil.+weed/i\n 'Devil Weed & Powder'\n when /eq.+chine/i\n 'EQ Machine$'\n when /fal[s\\$]{1,2}e.*flag/i\n 'Fal$e Flag'\n when /hiker/i\n 'Hikers'\n when /hollywood.+whack|hollywood.+shoot/i\n 'Hollywood Whacker$'\n when /l.b.*a/i\n 'Libya'\n when /lone.+wolf/i\n 'Lone Wolf'\n when /lucifer/i\n 'Lucifer'\n when /magic.*number/i\n 'Magic Numbers'\n when /military.+industrial.+compl/i\n 'Military Industrial Complex'\n when /minist.*truth/i\n 'Ministry of Truth'\n when /monsa.*t/i\n 'Monsantooo'\n when /^pedo|pedo.*bear/i\n 'PedoBear'\n when /ron.+paul/i\n 'Ron Paul'\n when /science/i\n 'The Science Is In!'\n when /hadow.*puppet.*thea/i\n 'Shadow Puppet Theatre'\n when /shut.*up.*slave/i\n 'Shut Up Slave!'\n when /squirrel/i\n 'Squirrel!!'\n when /techno.*expert/i\n 'Techno Experts'\n when /trains.+pla.es/i\n 'Trains Good, Planes Bad (Whoo Hoo!)'\n when /united.*tate.*euro/i\n 'United $tates of EUROpe'\n when /vaccin/i\n 'Vaccine$'\n when /vagina/i\n 'Vagina'\n when /video/i\n 'VIDEO'\n when /we.+can.+wait/i\n \"We Can't Wait!\"\n when /word.+matter/i\n 'Words Matter'\n when /zombie/i\n 'Zombie Nation'\n when /clip|stuff/i\n 'Clips'\n else\n value.length > 60 ? 'Other' : value\n end\n end", "title": "" }, { "docid": "019fa056056a8a489bd4f6908a5cb11c", "score": "0.537381", "text": "def weather_report(weather)\n \"The weather in #{weather[:city]} is #{weather[:description]}. The temperature is #{weather[:temperature_farenheit]} degrees Farenheit.\"\nend", "title": "" }, { "docid": "96b96d9343fbbe186d8ac3159ec65073", "score": "0.53727335", "text": "def _reduce_525(val, _values, result)\n result = \"&#{value(val[1])}\".to_sym\n \n result\nend", "title": "" }, { "docid": "fae7e3aa7febeb0f330c4681cf6d19c3", "score": "0.5370024", "text": "def humanize(value, type = nil)\n case type\n when :license\n value.spdx_id\n when :matcher\n value.class\n when :confidence\n Licensee::ContentHelper.format_percent(value)\n when :method\n \"#{value.to_s.tr('_', ' ').capitalize}:\"\n else\n value\n end\n end", "title": "" }, { "docid": "9e635fb344027e699b5b16a46dc2af92", "score": "0.53203887", "text": "def convert\n match('alias', 'name')\n\n # API-specific parameters.\n equal('user_key', 'poderopedia_api_key')\n equal('entity', 'type', valid: ['Person', 'Organization'], transform: lambda{|v|\n case v\n when 'Person'\n 'persona'\n when 'Organization'\n 'organizacion'\n end\n })\n\n output\n end", "title": "" }, { "docid": "676496c04334e2622ed54ad6d9a26bd6", "score": "0.53019106", "text": "def description(weather)\n weather[:description]\nend", "title": "" }, { "docid": "676496c04334e2622ed54ad6d9a26bd6", "score": "0.53019106", "text": "def description(weather)\n weather[:description]\nend", "title": "" }, { "docid": "68ebfb33825452340a865e76d1441b6e", "score": "0.5276957", "text": "def _reduce_491(val, _values, result)\n result = \"&#{value(val[1])}\".to_sym\n \n result\nend", "title": "" }, { "docid": "d6b3f6ef5c9c044c8b01d9cc780881b9", "score": "0.5274783", "text": "def result_api_title\n res = @data.data['$result']\n res && res['title'] ? res['title'] : ''\n end", "title": "" }, { "docid": "3705942f1facec7d7ba51addf38a1d6f", "score": "0.5274776", "text": "def solr_value(value = @value)\n solr_value = Util.escape(@field.to_indexed(value))\n if RESERVED_WORDS.include?(solr_value)\n %Q(\"#{solr_value}\")\n else\n solr_value\n end\n end", "title": "" }, { "docid": "9d95ae064ee9b14ad97d0cca449282d9", "score": "0.5273047", "text": "def type_question(question)\n \"The category is `#{question['category']['title']}` for #{currency_format(question['value'])}: `#{question['question']}`\"\nend", "title": "" }, { "docid": "674506aa2f468dee9531e97ca9fe8a76", "score": "0.5267509", "text": "def get_pub_place_from_008(f008)\n f008.value[15..17].strip\nend", "title": "" }, { "docid": "e2b6fdcd180d21429f5199904f585e23", "score": "0.5261274", "text": "def WordsBeg(value); end", "title": "" }, { "docid": "5ac22a0008f2e55a3ab659c32025434a", "score": "0.52604365", "text": "def _reduce_553(val, _values, result)\n result = \"&#{value(val[1])}\".to_sym\n \n result\nend", "title": "" }, { "docid": "e21527da4a88ff09e8d055fdc77d6910", "score": "0.52574843", "text": "def convert\n equal('per_page', 'limit', default: input['open_corporates_api_key'] && 100) # default 30, maximum 100\n equal('page', 'page')\n\n input['subject'] && input['subject'].each do |subject|\n match('q', 'name', input: subject)\n date_range('date_of_birth', 'birth_date', input: subject)\n\n subject['contact_details'] && subject['contact_details'].each do |contact_detail|\n if contact_detail['type'] == 'address' && (contact_detail['value'] || contact_detail['value~='])\n output['address'] = contact_detail['value'] || contact_detail['value~=']\n end\n end\n end\n\n # API-specific parameters.\n equal('api_token', 'open_corporates_api_key')\n one_of('jurisdiction_code', 'jurisdiction_code', transform: lambda{|v| v.downcase})\n equal('position', 'role')\n equal('inactive', 'inactive', valid: [true, false])\n\n output\n end", "title": "" }, { "docid": "541394110578e3656a20b21b698934d6", "score": "0.5250382", "text": "def convert\n match('q', 'name')\n one_of('type_ids', 'classification')\n equal('num', 'limit') # default 20\n equal('page', 'page')\n\n # API-specific parameters.\n equal('_key', 'little_sis_api_key')\n equal('search_all', 'search_all', valid: [1])\n\n output\n end", "title": "" }, { "docid": "af1dd40a69b91ef1b98c5817dc45d015", "score": "0.5237812", "text": "def convert\n match('company_name', 'name')\n equal('limit', 'limit') # default 100\n equal('index', 'page', transform: lambda{|v| (Integer(v) - 1) * (Integer(input['limit'] || 100))})\n\n input['identifiers'] && input['identifiers'].each do |identifier|\n case identifier['scheme']\n when 'IRS Employer Identification Number'\n equal('irs_number', 'identifier', input: identifier)\n when 'SEC Central Index Key'\n equal('cik', 'identifier', input: identifier)\n end\n end\n\n input['contact_details'] && input['contact_details'].each do |contact_detail|\n if contact_detail['type'] == 'address' && (contact_detail['value'] || contact_detail['value~='])\n output['raw_address'] = contact_detail['value'] || contact_detail['value~=']\n end\n end\n\n # API-specific parameters.\n equal('key', 'corp_watch_api_key')\n # http://api.corpwatch.org/documentation/api_examples.html#A35\n equal('sic_code', 'industry_code')\n equal('sic_sector', 'sector_code')\n equal('substring_match', 'substring_match', valid: [1])\n # http://api.corpwatch.org/documentation/api_examples.html#A36\n equal('country_code', 'country_code', transform: lambda{|v| v.upcase})\n equal('subdiv_code', 'subdiv_code', transform: lambda{|v| v.upcase})\n equal('year', 'year')\n equal('min_year', 'year>=')\n equal('max_year', 'year<=')\n equal('source_type', 'source_type')\n equal('num_children', 'num_children')\n equal('num_parents', 'num_parents')\n equal('top_parent_id', 'top_parent_id')\n\n output\n end", "title": "" }, { "docid": "8afe769b1b843cc354ff4b5870a963d3", "score": "0.522259", "text": "def value_in_words(value)\n if value == 1 then \"weak\"\n elsif value == 2 then \"average\"\n elsif value == 3 then \"thoughtful\"\n elsif value == 5 then \"brilliant!\"\n end\n end", "title": "" }, { "docid": "5ba433bdb6a5ea61e99a48692b42c2c3", "score": "0.52144825", "text": "def headline_value\n -ops!\n end", "title": "" }, { "docid": "0877ba337a8f006204a89fa7439e8a1a", "score": "0.520891", "text": "def url_text(field)\n subfield_values_y = collect_subfield_values_by_code(field, 'y')\n [subfield_values_y.join(' ')].reject(&:empty?)\n .reject { |v| v.match(/get\\s*it@duke/i) }\n .join(' ')\n end", "title": "" }, { "docid": "a284d4c58e86ae4cf5a347953f42460e", "score": "0.5208039", "text": "def to_api\n to_s.downcase.tr(\" \", \"_\")\n end", "title": "" }, { "docid": "9d1ef6c70484d483be5daeda4f1454e0", "score": "0.5206045", "text": "def _reduce_404(val, _values, result)\n result = new_str val[0]\n \n result\nend", "title": "" }, { "docid": "aed1f7d76abf29239bf35187b3cb629c", "score": "0.5199544", "text": "def transform_whodunnit(whodunnit)\n whodunnit\n end", "title": "" }, { "docid": "202a1431ad4bf1accd6c6293ea54b20b", "score": "0.51976895", "text": "def value_string\n case value\n when 1\n 'Ace'\n when 2..10\n SHORT_WORDS[value]\n when 11\n 'Jack'\n when 12\n 'Queen'\n when 13\n 'King'\n when 14\n 'Joker'\n else\n 'Trump'\n end\n end", "title": "" }, { "docid": "4d62200ef6c21592c891b6a2e989b133", "score": "0.5190226", "text": "def convert_api_data(data)\r\n @results = {}\r\n @results[:name] = data[0][\"title\"] # returns string\r\n @results[:serves] = data[0]['servings']\r\n @results[:description] = data[0]['summary'].gsub(/<\\/?[^>]+>/, '')\r\n @results[:ingredients] = data[0][\"extendedIngredients\"].map{|s|s[\"originalString\"]}\r\n @results[:recipe] = data[0][\"instructions\"].gsub(/<\\/?[^>]+>/, '').gsub(\"\\n\", '') # returns string\r\n @results[:time_to_cook] = data[0][\"readyInMinutes\"] # returns integer, turn to stirng if needed?\r\n @results[:url] = data[0]['sourceUrl']\r\n @results\r\n end", "title": "" }, { "docid": "2dcb0fe9e20afa85d93979d37a3f5b15", "score": "0.5188798", "text": "def create_return_english_objectivity_encoded_form text\r\n # the base uri for api requests\r\n query_builder = Configuration.BASE_URI.dup\r\n\r\n # prepare query string for API call\r\n query_builder << \"/objectivity\"\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n \"user-agent\" => \"APIMATIC 2.0\",\r\n \"accept\" => \"application/json\",\r\n \"X-Mashape-Key\" => @x_mashape_key\r\n }\r\n\r\n # prepare parameters\r\n parameters = {\r\n \"text\" => text\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.post query_url, headers:headers, parameters:parameters\r\n\r\n #Error handling using HTTP status codes\r\n if !(response.code.between?(200,206)) # [200,206] = HTTP OK\r\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end", "title": "" }, { "docid": "44b86231ade1a7c620592e5074a37b44", "score": "0.5177627", "text": "def generic_resource_fixer\n value_array = @value.strip.split(',').map(&:strip)\n @value = value_array[0]\n value_array[1]\nend", "title": "" }, { "docid": "ec6f5f554d83ec63e96ab59a9c12b72d", "score": "0.5156761", "text": "def t_desc_value(term, value)\n \"<strong>#{::I18n::t(term)}:</strong>&nbsp;#{value}\"\n end", "title": "" }, { "docid": "748794a006c140639d8a7f726e12a62c", "score": "0.51527625", "text": "def tax_str; \"#{rank}:#{name.nil? ? '?' : name}\"; end", "title": "" }, { "docid": "268aefa6f66ff7fe748d59b9e0df2fd3", "score": "0.5152677", "text": "def process_bibtex_val(key, value)\n # Company name and some other fields should be string\n if @string_fields.include?(key)\n return fix_link(remove_brackets(value.to_s).strip.lstrip)\n\n # Return arrays for list values\n elsif value.to_s.include?(\"{\") || value.to_s.include?(\"}\")\n arr = remove_brackets(value).split(\",\")\n return arr.map{|a| fix_link(a.strip.lstrip)}\n\n else # Make vlaue a string\n return fix_link(value.to_s.strip.lstrip)\n end\n end", "title": "" }, { "docid": "5a591c0b2b6046b89d558d22feae2fdf", "score": "0.5146939", "text": "def limit_to_api(value, unit = nil)\n base = { 'K' => 10, 'M' => 20, 'G' => 30, 'T' => 40 }\n if value == :absent\n '-'\n else\n if unit and base.include? unit\n (value >> base[unit]).to_s\n else\n value.to_s\n end\n end\n end", "title": "" }, { "docid": "e7991ef2ec59bb7eabb58f15082c422a", "score": "0.5138072", "text": "def to_s\n term.to_s\n end", "title": "" }, { "docid": "26575a5d3c6851fc8d868372fa9cdbac", "score": "0.5132515", "text": "def convert\n match('q', 'name')\n equal('num', 'limit') # default 100\n equal('page', 'page')\n\n # API-specific parameters.\n equal('_key', 'little_sis_api_key')\n\n output\n end", "title": "" }, { "docid": "94d9ea36bdb42935a29dd80987854198", "score": "0.51280516", "text": "def sanitize_values metrics\n #metrics['most_similar_to'] = metrics['most_similar_to'].reverse.chomp(\"authors/\".reverse).reverse # god dammit ruby give me lchomp\n end", "title": "" }, { "docid": "d042a5c8754190cefaff9b2daa456210", "score": "0.51278186", "text": "def weather_report(hash)\n \"The weather in #{hash.values[0]} is #{hash.values[1]}. The temperature is #{hash.values[2]} degrees Farenheit and #{hash.values[3]} degrees Celcius.\"\nend", "title": "" }, { "docid": "a4f04fba7a2d388b3b39c5555cbbac6d", "score": "0.5127186", "text": "def query_values_notation; end", "title": "" }, { "docid": "8c2b0004ddd0d9b72e4bcb154c4daeb9", "score": "0.51267195", "text": "def _reduce_484(val, _values, result)\n result = \"&#{val[1]}\".intern\n \n result\nend", "title": "" }, { "docid": "a4f04fba7a2d388b3b39c5555cbbac6d", "score": "0.51253134", "text": "def query_values_notation; end", "title": "" }, { "docid": "d20728fdeda90d17023d9bfed29cbb67", "score": "0.5108581", "text": "def term\n self[SIMPLE_OR_COMPOUND_TOKEN_WITH_GROUPING, 2].delete_prefix('\"').delete_suffix('\"')\n end", "title": "" }, { "docid": "f26f07d989eac0c3e357565ae0cce6b3", "score": "0.5102801", "text": "def extract_info symbol_or_string\n symbol_or_string = symbol_or_string.to_s\n approach = (symbol_or_string.match(/_(#{APPROACHES.join('|')})$/)[1] rescue nil)\n symbol_or_string.gsub!(/(_#{APPROACHES.join('|_')})$/,'') unless approach.blank?\n [symbol_or_string.to_s.singularize, approach]\n end", "title": "" }, { "docid": "68cd366515ad4f30cc05f1782722b2fa", "score": "0.51005816", "text": "def internalize( value )\n value\n end", "title": "" }, { "docid": "951922c24d20d600c610b7200723f872", "score": "0.5090755", "text": "def term\n ::HubEdos::StudentApi::V2::Term::Term.new(@data['term']) if @data['term']\n end", "title": "" }, { "docid": "6a3c825f2c45591bf5e49338d95507fd", "score": "0.5084956", "text": "def api_tag(text); end", "title": "" }, { "docid": "e9e7114bb3ed2c08bf6b4f36349eec26", "score": "0.5082712", "text": "def weather_report(weather)\n \"The weather in #{location(weather)} is #{description(weather)}. The temperature is #{weather[:temperature_farenheit]} degrees Farenheit.\"\nend", "title": "" }, { "docid": "0a174e308c88c9c395bc172b02ff2d32", "score": "0.5076136", "text": "def formatted_search_result(entry)\n <<~TEXT\n Name: #{entry.first}\n Phone: #{entry[1]}\n Email: #{entry[2]}\n TEXT\n end", "title": "" }, { "docid": "8fc19da1bc2bb588277a280793e2b8e8", "score": "0.5071333", "text": "def _reduce_604(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "title": "" }, { "docid": "8fc19da1bc2bb588277a280793e2b8e8", "score": "0.5071333", "text": "def _reduce_604(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "title": "" }, { "docid": "a0939dfca2ad3ce6d1178fc66a1fa63f", "score": "0.5071039", "text": "def get_name_1xx_field(field)\n s = field.map do |sf|\n # added 2017/04/10: filter out 0 (authority record numbers) added by Alma\n # added 2022/08/04: filter our 1 (URIs) added my MARCive project\n if !%W{0 1 4 6 8}.member?(sf.code)\n \" #{sf.value}\"\n elsif sf.code == '4'\n \", #{relator_codes[sf.value]}\"\n end\n end.compact.join\n s2 = s + (!%w(. -).member?(s[-1]) ? '.' : '')\n normalize_space(s2)\n end", "title": "" }, { "docid": "0eb85847047e56f81142f00aab8a259d", "score": "0.5069278", "text": "def search_api(input)\n \"\"\n end", "title": "" }, { "docid": "761d123e6471915ca085374819b9950b", "score": "0.50684583", "text": "def sample_wit_response\n JSON.parse('{\n \"msg_id\" : \"d5c2227b-1a6c-4384-85d7-eec2820e65dd\",\n \"_text\" : \"I ate an apple, three olives, and a slice a bun\",\n \"entities\" : {\n \"food_description\" : [ {\n \"confidence\" : 0.9987320073552927,\n \"entities\" : {\n \"food\" : [ {\n \"confidence\" : 0.9354258378052169,\n \"type\" : \"value\",\n \"value\" : \"apple\"\n } ]\n },\n \"type\" : \"value\",\n \"value\" : \"an apple\"\n }, {\n \"confidence\" : 0.997242556612624,\n \"entities\" : {\n \"number\" : [ {\n \"confidence\" : 1,\n \"value\" : 3,\n \"type\" : \"value\"\n } ],\n \"food\" : [ {\n \"confidence\" : 0.9165590880096315,\n \"type\" : \"value\",\n \"value\" : \"olives\",\n \"suggested\" : true\n } ]\n },\n \"type\" : \"value\",\n \"value\" : \"three olives\",\n \"suggested\" : true\n }, {\n \"confidence\" : 0.9953965565977307,\n \"entities\" : {\n \"units\" : [ {\n \"confidence\" : 1,\n \"type\" : \"value\",\n \"value\" : \"slice\"\n } ],\n \"food\" : [ {\n \"confidence\" : 0.9438404939605672,\n \"type\" : \"value\",\n \"value\" : \"bun\",\n \"suggested\" : true\n } ]\n },\n \"type\" : \"value\",\n \"value\" : \"a slice a bun\",\n \"suggested\" : true\n } ],\n \"intent\" : [ {\n \"confidence\" : 0.9999998855726199,\n \"value\" : \"add_item\"\n } ]\n }\n }')\n end", "title": "" }, { "docid": "1d585014dfe602a5153da2a884908c67", "score": "0.5064839", "text": "def get_concepts_by_string(search_term)\n url = URI(\"#{BASE_URL}#{EDITION}/#{VERSION}/concepts?term=#{search_term}&activeFilter=true&offset=0&limit=50\")\n response = Net::HTTP.get(url)\n data = JSON.parse(response)\n puts data['details']['total']\nend", "title": "" }, { "docid": "eb6b0560af6bb4b601fab5062212b9be", "score": "0.505513", "text": "def value_of_word( word)\n word.map{ |x, y| self[x, y]}.join\n end", "title": "" }, { "docid": "eb2b2557a230a1fc8b797627e594963d", "score": "0.50544363", "text": "def _reduce_583(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "title": "" }, { "docid": "eb2b2557a230a1fc8b797627e594963d", "score": "0.50544363", "text": "def _reduce_583(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "title": "" }, { "docid": "eb2b2557a230a1fc8b797627e594963d", "score": "0.50544363", "text": "def _reduce_583(val, _values, result)\n identifier = val[1].to_sym\n\n self.env[identifier] = :lvar\n result = \"&#{identifier}\".to_sym\n \n result\nend", "title": "" }, { "docid": "14a845257c4238b48f38138cfbf78465", "score": "0.5052331", "text": "def to_s\n entered_term\n end", "title": "" }, { "docid": "85990e6fd4a2a9a7f92677320b1c0a60", "score": "0.5050291", "text": "def prettyValue(raw_value)\n value = raw_value\n postfix = ''\n target = @value['target']\n\n if target.include?(\"asPercent\")\n postfix = postfix + \"%\"\n end\n if raw_value.is_a?(Float)\n value = value.round(1)\n end\n\n return \"#{value}#{postfix}\"\n end", "title": "" }, { "docid": "66fd1b66e48f1772cbd3d73834c23bdc", "score": "0.5035961", "text": "def description(weather_hash)\n \"#{weather_hash[:description]}\"\nend", "title": "" }, { "docid": "c0f39ae4658007caad3d0ba37d5f56ec", "score": "0.50328904", "text": "def value_as_text(val)\n s = [\"super \", \"very \", \"fairly \", \"\", \"fairly \", \"very \", \"super \"][val+3]\n if (val < 0)\n s + self.minlabel.downcase\n elsif(val > 0)\n s + self.maxlabel.downcase\n else \n \"middling \" + self.name.downcase\n end\n end", "title": "" }, { "docid": "f1701f205b44d0d70e2525a360249f3d", "score": "0.502681", "text": "def get_str_from_id(id, type)\n response = SolrQuery.new.solr_query(q='id:\"' + id + '\"', fl=type, rows='1')\n parse_terms_response(response, type);\n end", "title": "" }, { "docid": "7d2eaf7563567815c571325c568f47df", "score": "0.50248575", "text": "def subject_xfacet_to_facet(value)\n value.gsub('--', ' ').gsub(/\\s{2,}/, ' ')\n end", "title": "" }, { "docid": "4bb8363f9a39bdf1a275e8f67950f22e", "score": "0.502265", "text": "def query_part(code, value)\n value = fix_name(value) if code == :au\n matching = value.include?(' ') ? 'exact' : '='\n %Q(srw.#{code} #{matching} \"#{value}\")\n end", "title": "" }, { "docid": "dafa9c4ad4143c2bfbb351e1dcc98bfa", "score": "0.5022635", "text": "def format_lyric(lyric)\n return lyric.gsub('\"', '')\nend", "title": "" }, { "docid": "b729a5dc668467ccab00e9113e162ab7", "score": "0.5018592", "text": "def _reduce_569(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "b729a5dc668467ccab00e9113e162ab7", "score": "0.5018592", "text": "def _reduce_569(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "b729a5dc668467ccab00e9113e162ab7", "score": "0.5018592", "text": "def _reduce_569(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "ff2b8680561143a5ba2b45fa27e8bef3", "score": "0.50134665", "text": "def fix_special_value_types(hash)\n key = hash['key']\n coeff = hash['coeff']\n value_type = hash['link']\n \n if value_type == \"@text\" # 9\n value_type = \"\"\n elsif value_type == \"@cooldownchampion\" # 5\n value_type = \"\"\n \n elsif value_type[0..7] == \"@dynamic\"\n if value_type == \"@dynamic.abilitypower\" # 4\n value_type = \"Ability Power\"\n elsif value_type == \"@dynamic.attackdamage\" # 2\n value_type = \"Attack Damage\" \n end\n \n #---------------------------------------#\n # Rengar Bug-fix #\n #---------------------------------------#\n # Bug: coeff for 'Q' is not in an array.\n # Turn single digit into an array of length 1.\n if coeff.is_a? Float\n coeff = [coeff]\n end\n \n # [1, 2, 3] --> \"1/2/3\"\n coeff = coeff.join(\"/\")\n # (+/-) indicating scaling direction.\n dyn = hash['dyn']\n # Text description lacks parentheses so must make separate string.\n @spell_values[\"{{ #{key} }}\"] = \"(#{dyn}#{coeff} #{value_type})\"\n \n #---------------------------------------#\n # Braum Bug-fix #\n #---------------------------------------#\n # Bug: Keys f3 and f4 for 'W' have coeffs of 0.\n elsif value_type == \"@special.BraumWArmor\" || value_type == \"@special.BraumWMR\" # 2\n @spell_values[\"{{ #{key} }}\"] = \"\"\n\n #---------------------------------------#\n # Darius Bug-fix #\n #---------------------------------------#\n # Bug: Maximum damage f3 for 'R' shows as an array of base damages instead\n # of twice the (base + bonus) damage.\n elsif value_type == \"@special.dariusr3\" # 1\n # \"100/200/300 (+0.75 bonus AD)\" x2\n @spell_values[\"{{ #{key} }}\"] = '200/400/600 (+1.5 Bonus Attack Damage)'\n\n #---------------------------------------#\n # Jax Bug-fix #\n #---------------------------------------#\n # Bug: Extraneous & incorrect scaling values for increased armor and magic\n # resist in 'R' description.\n elsif value_type == \"@special.jaxrarmor\" || value_type == \"@special.jaxrmr\" # 2\n @spell_values[\"{{ #{key} }}\"] = \"\"\n \n #---------------------------------------#\n # Nautilus Bug-fix #\n #---------------------------------------#\n # Bug: Redundant info in 'Q'. Displays \"(0.5 @special.nautilusq)\" after\n # stating a 50% cooldown reduction when hitting terrain.\n elsif value_type == \"@special.nautilusq\"\n @spell_values[\"{{ #{key} }}\"] = \"\" # 1\n\n #---------------------------------------#\n # Vi Bug-fix #\n #---------------------------------------#\n # Bug: Additional damage for 'W' shows up as \"+35\" instead of \"+1% per 35\n # bonus attack damage\". Must reformat how this information is displayed\n # because the '%' sign is static in the text, placed after the spell value:\n # \"[(Bonus Attack Damage)x(1/35)]\".\n elsif value_type == \"@special.viw\" # 1\n @spell_values[\"{{ #{key} }}\"] = \"[(Bonus Attack Damage)x(1/35)]\"\n \n #---------------------------------------#\n # Stacks (Nasus, Veigar, etc.) #\n #---------------------------------------#\n # \"@stacks\" --> \"Number of Stacks\"\n elsif value_type == \"@stacks\" # 2\n @spell_values[\"{{ #{key} }}\"] = \"Number of Stacks\"\n end\n end", "title": "" }, { "docid": "dd3aae1d38d4200373b8d14a5745e991", "score": "0.5011445", "text": "def get_human(invalue,string_val)\n res= ''\n value=invalue.to_s\n # when '1000000000' \t\n # res << ' ; failure in procedure' if value[0]==49\n # when '100000000'\n res << \t' Invalid/ inactive pin' if value[1]==49 \n # when '10000000'\n res << \t' umobile e pin already used, do not use again to prevent account blocking' if value[2]==49 \n # when '1000000'\n res << ' pin already expired' if value[3]==49\n # when '100000'\t\n res << ' invalid account for sender' if value[4]==49\n # when '10000'\t\n res << ' invalid account for receiver' if value[5]==49\n # when '1000'\n res << ' invalid transaction (dealer-retailer or retailer-subscriber for autoload and subscriber-subscriber for pasaload)' if value[6]==49\n # when '100'\n res << ' Insufficient load/load expired. Please reload soon' if value[7]==49 \n # when '10'\n res << \t' No available pin for denomination' if value[8]==49\n # when '1'\n res << \t' No available denomination_type for amount' if value[9]==49\n res\n end", "title": "" }, { "docid": "4830fd1d1f8e3d9d6ba7c63dc7fac5ed", "score": "0.5011069", "text": "def get_str_from_id(id, type)\n response = SolrQuery.new.solr_query(q='id:\"' + id + '\"', fl=type, rows=1)\n parse_terms_response(response, type);\n end", "title": "" }, { "docid": "a604b22ca171e56d82f92c50571298e6", "score": "0.50074214", "text": "def to_s\n return concept.name + \": \" + attributes.collect{|name,value|\n next if value.nil? or value == \"\" or name !~ /value/\n case name\n when \"value_coded\"\n answer_concept.name\n when \"value_drug\"\n drug.name\n else\n value.to_s\n end\n }.compact.join(\", \")\n end", "title": "" }, { "docid": "84b059da9e7faf998a339e6e0b3af479", "score": "0.5004987", "text": "def _reduce_483(val, _values, result)\n result = \"&#{val[1]}\".intern\n \n result\nend", "title": "" }, { "docid": "96e79d354d8571661ad69cd275fdcbf7", "score": "0.50039417", "text": "def _reduce_466(val, _values, result)\n result = \"&#{val[1]}\".intern\n \n result\nend", "title": "" }, { "docid": "c3145c8ac9c466e03677148ec06322f5", "score": "0.5003598", "text": "def _reduce_571(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "c3145c8ac9c466e03677148ec06322f5", "score": "0.5003598", "text": "def _reduce_571(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "c3145c8ac9c466e03677148ec06322f5", "score": "0.5003598", "text": "def _reduce_571(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "c3145c8ac9c466e03677148ec06322f5", "score": "0.5003598", "text": "def _reduce_571(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "c3145c8ac9c466e03677148ec06322f5", "score": "0.5003598", "text": "def _reduce_571(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "c3145c8ac9c466e03677148ec06322f5", "score": "0.5003598", "text": "def _reduce_571(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "c3145c8ac9c466e03677148ec06322f5", "score": "0.5003598", "text": "def _reduce_571(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "c3145c8ac9c466e03677148ec06322f5", "score": "0.5003598", "text": "def _reduce_571(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "1be489f09a09c92c91806d5c496ac6b0", "score": "0.49960816", "text": "def detailed_text\n text = \"<p>Employee <b>#{employee_name}</b> was rated by <b>#{customer_name}</b> and got <b>#{int_value} stars</b><p>\"\n text = text + \"<p>Customer wrote: <i>#{text_value}</i></p>\" if text_value\n text\n end", "title": "" }, { "docid": "aa8a7365053938d160caed7d3a1d5709", "score": "0.4992278", "text": "def term\n @term\n end", "title": "" }, { "docid": "494274263048e933e59854bed9eafc6a", "score": "0.49913043", "text": "def _reduce_578(val, _values, result)\n result = :\"**#{val[1]}\"\n \n result\nend", "title": "" }, { "docid": "c9dff415bf44be7dbdd49fa595032564", "score": "0.49886844", "text": "def _reduce_457(val, _values, result)\n result = \"&#{val[1]}\".intern\n \n result\nend", "title": "" } ]
41217832e5e2e052c8d2ebbd3c814576
Turns "asc" into 1, "desc" into 1, and other values into 1 or 1.
[ { "docid": "51972d196fed8d8fc24643a7a0bfc5c3", "score": "0.6557349", "text": "def sort_value_from_arg(arg) # :nodoc:\n case arg\n when /^asc/i\n arg = 1\n when /^desc/i\n arg = -1\n when Number\n arg.to_i >= 0 ? 1 : -1\n else\n arg ? 1 : -1\n end\n end", "title": "" } ]
[ { "docid": "b6dcbf10075eb361fd5616f39d0c8fda", "score": "0.66440535", "text": "def switch(direction)\n if direction == 'asc'\n 'desc'\n elsif direction == 'desc'\n 'asc'\n else\n ''\n end\n end", "title": "" }, { "docid": "749a5662a4816379c506e3638eee2fdd", "score": "0.65406317", "text": "def arel\n ascending ? attribute.asc : attribute.desc\n end", "title": "" }, { "docid": "2f939576b0a875f65e7022b59ddf1737", "score": "0.6231262", "text": "def orientation( value )\n return \"id\" if value.is_a?(Hash)\n case( value.to_i )\n when Mongo::ASCENDING\n \"asc\"\n when Mongo::DESCENDING \n \"desc\"\n else \n \"n/a\"\n end\n end", "title": "" }, { "docid": "5387dbff7c2b8ee7412ae4dc61ea09eb", "score": "0.6162309", "text": "def asc?\n !desc?\n end", "title": "" }, { "docid": "29729e23507d5d1b4bb96523fe69324b", "score": "0.6022969", "text": "def normalize_direction(direction)\n (direction =~ DIRECTION_DESC) ? 'DESC' : 'ASC'\n end", "title": "" }, { "docid": "848342766a1bc2e55ad3749dd6a1105a", "score": "0.5915896", "text": "def sort_direction\n #params[:direction]?params[:direction]:'asc'\n %w[asc desc].include?(params[:direction])?params[:direction] : 'asc'\n end", "title": "" }, { "docid": "3416fe5a8983d93381d8157d324decd6", "score": "0.5823929", "text": "def build_direction(sort_param)\n case sort_param[0]\n when '-' then [sort_param[1..-1], :desc]\n else [sort_param, :asc]\n end\n end", "title": "" }, { "docid": "243202806e47be67ecc5671dcdadac10", "score": "0.5782626", "text": "def ascending(metadata); end", "title": "" }, { "docid": "c873847fc16d2fafffba79a03d34b358", "score": "0.57271093", "text": "def asc\n meta(direction: \"asc\")\n end", "title": "" }, { "docid": "5bdcec56896071bf51716463a3406fb0", "score": "0.5724139", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\nend", "title": "" }, { "docid": "592318cbba0bd900bfeb8e0ab2eb3dc7", "score": "0.57173514", "text": "def orientation( value )\n return \"id\" if value.is_a?(Mongo::ObjectID)\n case( value.to_i )\n when Mongo::ASCENDING : \"asc\"\n when Mongo::DESCENDING : \"desc\"\n else \"n/a\"\n end\n end", "title": "" }, { "docid": "525973e7e7df40e845b973c011879a8e", "score": "0.56786937", "text": "def sort_query_params\n case params[:sort].presence\n when '+', 'asc', nil\n :asc\n when '-', 'desc'\n :desc\n else\n :asc\n end\n end", "title": "" }, { "docid": "67c68d4245db19acd0263ef91c3a9328", "score": "0.5676433", "text": "def validate_sort_field( value )\n if [ 'title', 'code', 'created_at' ].include?( value )\n return value\n else\n return 'title'\n end\n end", "title": "" }, { "docid": "37e383e2e986d560814d9ac51268c9cb", "score": "0.5674876", "text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end", "title": "" }, { "docid": "37e383e2e986d560814d9ac51268c9cb", "score": "0.5674876", "text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end", "title": "" }, { "docid": "37e383e2e986d560814d9ac51268c9cb", "score": "0.5674876", "text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end", "title": "" }, { "docid": "37e383e2e986d560814d9ac51268c9cb", "score": "0.5674876", "text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end", "title": "" }, { "docid": "37e383e2e986d560814d9ac51268c9cb", "score": "0.5674876", "text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end", "title": "" }, { "docid": "37e383e2e986d560814d9ac51268c9cb", "score": "0.5674876", "text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end", "title": "" }, { "docid": "37e383e2e986d560814d9ac51268c9cb", "score": "0.5674876", "text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end", "title": "" }, { "docid": "37e383e2e986d560814d9ac51268c9cb", "score": "0.5674876", "text": "def sort_direction\n # karakter kontrol yapiliyor security icin \n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\" \n end", "title": "" }, { "docid": "16f98ef49f6c77e3520e695721232f26", "score": "0.56469786", "text": "def get_sort_and_direction(sort_table_param, args)\n if sort_table_param\n key = sort_table_param.keys.first rescue nil\n value = sort_table_param.values.first rescue nil\n return nil if !key.is_a?(String) or !value.is_a?(String)\n return key, value\n end\n return nil if args.size < 2\n return args[1], 'asc' if args.size == 2\n return args[1], args[2]\n end", "title": "" }, { "docid": "cf14ef84b0b1745d2d323d9d630528c6", "score": "0.5586866", "text": "def parse_order_by(order_by, desc, asc)\n case order_by\n when Array\n order_by.map{|ob,d|\n escape(ob.to_s) + \" #{d}\"\n }.join(\", \")\n else\n dir = \"\"\n dir = \" DESC\" if desc\n dir = \" ASC\" if asc\n escape(order_by) + dir\n end\n end", "title": "" }, { "docid": "72049622f744dc5913a1d1880b8efbc1", "score": "0.5585981", "text": "def directionText(dir)\n return \"asc\" if dir == -1\n return \"desc\"\n end", "title": "" }, { "docid": "ad3e133394262134a008d05c54f372bb", "score": "0.5578232", "text": "def filter_param(val, params, allowed, default = nil)\n val ||= default\n unless val == default\n val = val.to_unsafe_h if val.is_a?(ActionController::Parameters)\n val =\n if val.is_a?(Hash)\n val.each_with_object({}) do |(key, dir), h|\n h[key] = (dir == 'desc' ? :desc : :asc) if allowed.include?(key)\n end\n else\n allowed.include?(val) ? val : default\n end\n end\n if val && !val.is_a?(Hash)\n val = {val => ParamsParser.parse_boolean(params[:sort_desc]) ? :desc : :asc}\n end\n val\n end", "title": "" }, { "docid": "e42c8b393562f60ae540ebbf457f3264", "score": "0.5575677", "text": "def order() @order || 'ascending' ; end", "title": "" }, { "docid": "570620b885f2b6f8a3fa9a1d21b4e9b7", "score": "0.5574369", "text": "def sort_direction\n #%w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n if ['asc', 'desc'].include?(params[:direction])\n params[:direction]\n else\n \"asc\"\n end \n end", "title": "" }, { "docid": "9d1470ac7305f2af3786101504eba5bf", "score": "0.55468893", "text": "def set_direction dir\n return 'ASC' unless dir\n dir == 'ASC' ? 'DESC' : 'ASC'\n end", "title": "" }, { "docid": "c8188ad0904efe23687e8685b5465381", "score": "0.5508775", "text": "def converted_sort\n s = params['sort']\n return if s.nil?\n\n if s['sort_id'] == 'SortDate' &&\n s['order'] == 'desc'\n self.applied_sort = s\n return 'date'\n\n elsif s['sort_id'] == 'SortDate' &&\n s['order'] == 'asc'\n self.applied_sort = s\n return 'date2'\n\n else\n # Relevance only has desc, also used as a catch-all\n 'relevance'\n end\n end", "title": "" }, { "docid": "f83d3b6acf30a1c8f84eb36e931176f9", "score": "0.55003726", "text": "def sort_column\n Advert.column_names.include?(params[:sort]) ? params[:sort] : \"description\"\n end", "title": "" }, { "docid": "157170b3b9c8b37f8cbaedfc237115d2", "score": "0.54914623", "text": "def encode_order(field, param, reverse_by_default = false)\n param.blank??\n reverse_by_default ? \"-#{field}\" : field.to_s :\n param == field.to_s ?\n \"-#{field}\" :\n field.to_s\n end", "title": "" }, { "docid": "b6069800a0f39574486a51180692ead9", "score": "0.54823333", "text": "def calls_sort_option\n column = case params[:iSortCol_0].to_s\n when '1'\n 'number'\n when '2'\n 'line_type'\n when '3'\n 'peak_freq'\n end\n column + ' ' + (params[:sSortDir_0] =~ /^A/i ? 'asc' : 'desc') if column\n end", "title": "" }, { "docid": "b32a33b92545e6a44fff1eb72968e2ec", "score": "0.5465638", "text": "def ordering_by(ordering)\n ordering && ordering.to_s.gsub(/^(ascend|descend)_by_/, '')\n end", "title": "" }, { "docid": "c42d7b4e5bfec5a0d23064adaf732274", "score": "0.544166", "text": "def order_as\n return if order.blank?\n return @order_as if @order_as\n \n case order\n when /ASC$/i\n @order_as = \"ASC\"\n when /DESC$/i \n @order_as = \"DESC\"\n else\n nil\n end\n end", "title": "" }, { "docid": "65ce1b9e12b3bc914fc5bfdc32b5298e", "score": "0.5438423", "text": "def sort_sanatize(sort)\n\n\t\tsort = sort.to_s.strip.upcase\n\n\t\t#if it matches DESC or DSC\n\t\tif sort =~ /\\ADE?SC\\Z/\n\t\t\treturn 'DESC'\n\t\telse\n\t\t\treturn 'ASC'\n\t\tend\n\tend", "title": "" }, { "docid": "0d07d8d328f46a5351b1411b4cdc09ea", "score": "0.54358023", "text": "def ordinalize(val, options)\n val ? val.to_i.ordinalize : val\n end", "title": "" }, { "docid": "db55c69e53dbd4efeaa68252bde72e89", "score": "0.54071474", "text": "def sort_info\n @data['sort_info'].nil? ? 0 : @data['sort_info'].to_s.to_i\n end", "title": "" }, { "docid": "23f457b62b4b078bf0a7b90d3c8c8d57", "score": "0.540336", "text": "def autosort_int_html_attr(local_assigns)\n local_assigns[:autosortable] ? ' data-sort=\"int\"' : ''\n end", "title": "" }, { "docid": "541ff9f8e88a169672f44e732697ec2d", "score": "0.53938365", "text": "def to_sortable(alphabetic=true)\n \n end", "title": "" }, { "docid": "289ab6a4fb4bfa26a56150ff79c75b25", "score": "0.53846556", "text": "def sort_by_published_at_or_number\n self.draft? ? 'published_at' : 'number'\n end", "title": "" }, { "docid": "30ab3d165e3958df85852da028ff070b", "score": "0.5366251", "text": "def special_fulladvisory_sort_helper(fulladvisory)\n case fulladvisory\n when /^RHSA/\n \"1000_#{fulladvisory}\"\n when /^RHBA/\n \"2000_#{fulladvisory}\"\n when /^RHEA/\n \"3000_#{fulladvisory}\"\n else\n # should never get here?\n \"4000_#{fulladvisory}\"\n end\n end", "title": "" }, { "docid": "dbfc43cde63c2f9305fbfa9df9be9735", "score": "0.5362793", "text": "def getSortFieldFromString(val)\r\n case(val)\r\n when 'buyer.name'\r\n :buyer_sort\r\n when 'requester.department'\r\n :department_sort\r\n when 'requester.name'\r\n :requester_sort\r\n when 'vendor_string'\r\n :vendor_sort\r\n when 'dateRequested'\r\n :date_requested\r\n end\r\n end", "title": "" }, { "docid": "d294c4d3a6fc23705fca9db640b33136", "score": "0.5362249", "text": "def order_as=(value)\n value = value.blank? ? nil : value.to_s.upcase\n raise(ArgumentError, \"order_as only accepts a blank string / nil or a string as 'ASC' or 'DESC'\") if !value.blank? && ![\"ASC\", \"DESC\"].include?(value)\n if @order_by\n @order = order_by_to_order(@order_by, value)\n elsif order\n @order.gsub!(/(ASC|DESC)/i, value)\n end\n @order_as = value\n end", "title": "" }, { "docid": "33484d90f19afc5eb48f9043f0c9052e", "score": "0.5358603", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "33484d90f19afc5eb48f9043f0c9052e", "score": "0.5358603", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "0d7619bd4745eaa0c126dfd4e42b34bb", "score": "0.5340338", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "0d7619bd4745eaa0c126dfd4e42b34bb", "score": "0.5340338", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "0d7619bd4745eaa0c126dfd4e42b34bb", "score": "0.5340338", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "70093b4aaf647643f53136b030f6b881", "score": "0.5330976", "text": "def get_sort_conditions(conditions)\n conditions = \"published\" if params[:sort].nil?\n case conditions\n when \"title\" then \"title ASC\"\n when \"rating\" then \"rating_avg DESC, rating_count DESC\"\n when \"views\" then \"games.views DESC\"\n when \"published\" then \"games.created_at DESC\"\n when \"title_reverse\" then \"title DESC\"\n when \"rating_reverse\" then \"rating_avg ASC, rating_count ASC\"\n when \"views_reverse\" then \"games.views ASC\"\n when \"published_reverse\" then \"games.created_at ASC\"\n end\n end", "title": "" }, { "docid": "5dcf597de0226b65bf0050e5c88227c1", "score": "0.5327909", "text": "def decode_order_to_expr(param)\n field, reverse = decode_order_to_array(param)\n modifier = reverse ? :desc : :asc\n field.nil? ? nil : \"#{field} #{modifier}\"\n end", "title": "" }, { "docid": "74faf120d2f30e59fabc67f42871a28e", "score": "0.53230554", "text": "def sort_direction\n %w[asc desc].include?(params[:order]) ? params[:order] : \"asc\"\n end", "title": "" }, { "docid": "11429ccf516130a1558430815a54b4d8", "score": "0.5316168", "text": "def collection_rating_sort_values\n {\n 'FALSE' => '1',\n 'PARTIAL' => '2',\n 'TRUE' => '3',\n }\n end", "title": "" }, { "docid": "111e46494acf5dd8e92fa636831671c7", "score": "0.53132063", "text": "def sort_order(default)\n ###############################################\n #params[:sort_order] == 'abbreviation' ? col = \"royalty_owners.#{params[:sort_order]}\" :\n # col = params[:sort_order]\n \"#{(params[:sort_order] || default.to_s).gsub(/[\\s;'\\\"]/,'')} #{params[:sort_dir] == 'down' ? 'DESC' : 'ASC'}\"\n end", "title": "" }, { "docid": "e7d9aa5c5ae595f617fb23e16787a099", "score": "0.53121316", "text": "def asc( column_name )\n\t\tpush( column_name, :asc )\n\tend", "title": "" }, { "docid": "8a822bf366aa8cd99f885dc7112ebf54", "score": "0.53103864", "text": "def es_query_sort_statement\n params['sort'] && params['sort'].collect do |field, val|\n flag, field = split_filter field\n unless flag\n { field => val }\n else\n { field => { order: val, mode: flag } }\n end\n end\nend", "title": "" }, { "docid": "6adef7bb6e99bc745376ef6eafdc76b7", "score": "0.5306454", "text": "def sort_td_class_helper(param)\n result = 'sortup' if params[:sort] == param\n result = 'sortdown' if params[:sort] == param + \"_reverse\"\n result = 'sortup' if params[:sort].nil? and DEFAULT_SORT == param \n return result\n end", "title": "" }, { "docid": "b50cfb19470eb9f0f1a8b887f1fd05aa", "score": "0.53054184", "text": "def test_order_by_clause\n clause = Dynamicloud::API::Criteria::OrderByClause.asc('name')\n\n assert_equal '\"order\": \"name ASC\"',\n (clause.to_record_string Dynamicloud::API::Criteria::Condition::ROOT), 'Wrong condition'\n\n clause = Dynamicloud::API::Criteria::OrderByClause.desc('name')\n\n assert_equal '\"order\": \"name DESC\"',\n (clause.to_record_string Dynamicloud::API::Criteria::Condition::ROOT), 'Wrong condition'\n end", "title": "" }, { "docid": "e2324ba10f33bba20034ebb0431e1a4c", "score": "0.53051865", "text": "def sort_direction\r\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\r\n end", "title": "" }, { "docid": "f56989d641ce9314eb796581600bfd63", "score": "0.5300885", "text": "def sort_column\n if !params[:sort]\n \"i_follow_nbr\"\n elsif params[:sort] == 'tag'\n \"LOWER(t.name)\"\n else\n params[:sort]\n end\n end", "title": "" }, { "docid": "5094a47523245dca82bc2367476d2cc9", "score": "0.52996135", "text": "def apply_sorting(arel, sort)\n case sort\n when \"created_asc\" then arel.oldest\n when \"created_desc\" then arel.newest\n when \"updated_asc\" then arel.stagnant\n when \"updated_desc\" then arel.lively\n else\n arel.lively\n end\n end", "title": "" }, { "docid": "05ebb56af4931d08b003d814ed44a48f", "score": "0.5299004", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end", "title": "" }, { "docid": "05ebb56af4931d08b003d814ed44a48f", "score": "0.5299004", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end", "title": "" }, { "docid": "05ebb56af4931d08b003d814ed44a48f", "score": "0.5299004", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end", "title": "" }, { "docid": "05ebb56af4931d08b003d814ed44a48f", "score": "0.5299004", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end", "title": "" }, { "docid": "05ebb56af4931d08b003d814ed44a48f", "score": "0.5299004", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end", "title": "" }, { "docid": "05ebb56af4931d08b003d814ed44a48f", "score": "0.5299004", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end", "title": "" }, { "docid": "05ebb56af4931d08b003d814ed44a48f", "score": "0.5299004", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"desc\"\n end", "title": "" }, { "docid": "745780e13d2a000d61813366cf710e2e", "score": "0.52977854", "text": "def sort_column\n %w[likes hates date].include?(params[:sort]) ? params[:sort] : \"likes\"\n end", "title": "" }, { "docid": "16be857cc444bec7857df3ddc5d7605e", "score": "0.528239", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? @direction : \"asc\"\n end", "title": "" }, { "docid": "e7235e5278396bf2484e7dc4cdfa152b", "score": "0.5278723", "text": "def issuable_sort_string\n name_placeholder = respond_to?(:name) ? name : ''\n \"#{name_placeholder}#{designator} #{number}\"\n end", "title": "" }, { "docid": "1700cba5dc8ac76a6edfec55a54ec6be", "score": "0.5273813", "text": "def order\n case params[:sortBy]\n when 'crn'\n 'crn'\n when 'course'\n 'course'\n else\n 'id'\n end\n end", "title": "" }, { "docid": "6f9dd934276dec0476dd532e454760f9", "score": "0.5263922", "text": "def sort_dir\n params[:sort_dir] == 'desc' ? 'desc' : 'asc'\n end", "title": "" }, { "docid": "e5b178fb36dc2f48daa08c1cd00d0c0b", "score": "0.52583116", "text": "def sort_order(default)\n sort_col = (params[:c] || default.to_s).gsub(/[\\s;'\\\"]/,'')\n sort_col += \"::text\" if ActiveRecord::Base.connection.class.to_s.match(/PostgreSQLAdapter$/)\n \"LOWER( #{sort_col} ) #{params[:d] == 'down' ? 'DESC' : 'ASC'}\"\n end", "title": "" }, { "docid": "deb67b7ca6f4bb1011c4a7b4329a80eb", "score": "0.5248621", "text": "def sort_column\n Admin::Obra.column_names.include?(params[:sort]) ? params[:sort] : \"titulo\" \n end", "title": "" }, { "docid": "6fd36e68114548af594bfd9182ad20d4", "score": "0.52486145", "text": "def grid_get_sort(evt)\n [evt[:sidx], (evt[:sord] == 'desc' ? 'DESC' : 'ASC')]\n end", "title": "" }, { "docid": "a9cb51acd40bd289d9250d8dc1a6a956", "score": "0.5248248", "text": "def prepare_sort_by\n return unless @enable_sorting\n return if sort_by.blank?\n self.sort_by = case sort_by\n when String\n Queries::Sorts.parse(sort_by)\n else\n sort_by\n end\n end", "title": "" }, { "docid": "c9d3e8a8160f8fcce42ae61c54ad66af", "score": "0.52460724", "text": "def sort_direction\n end", "title": "" }, { "docid": "681e6a96f277013dcecf82ab0881359a", "score": "0.52323073", "text": "def calls_sort_option\n column = case params[:iSortCol_0].to_s\n when '1'\n 'number'\n when '2'\n 'caller_id'\n when '3'\n 'providers.name'\n when '4'\n 'answered'\n when '5'\n 'busy'\n when '6'\n 'audio_length'\n when '7'\n 'ring_length'\n end\n column + ' ' + (params[:sSortDir_0] =~ /^A/i ? 'asc' : 'desc') if column\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "32bc676ace8aea544800f8de12c70fc6", "score": "0.52309954", "text": "def sort_direction\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "8dd1496f0f4b667fe6b5fc883a509e7c", "score": "0.52271646", "text": "def inverse_sorting(sort_on)\n return :asc if current_sorting(sort_on).nil?\n return :desc if current_sorting(sort_on) == :asc\n :asc\n end", "title": "" }, { "docid": "5866c0bb7527a329081a2cca2c889403", "score": "0.5226982", "text": "def summary_order_by(params, options)\n case params[:order_by].to_s\n when \"nice_user\" then\n order_by = \"nice_user\"\n when \"did\" then\n order_by = \"did\"\n when \"provider\" then\n order_by = \"providers.name\"\n when \"comment\" then\n order_by = \"dids.comment\"\n when \"calls\" then\n order_by = \"total_calls\"\n when \"billed_duration\" then\n order_by = \"dids_billsec\"\n when \"owner_price\" then\n order_by = \"own_price\"\n when \"provider_price\" then\n order_by = \"d_prov_price\"\n else\n options[:order_by] ? order_by = options[:order_by] : order_by = \"\"\n end\n\n without = order_by\n order_by += \" ASC\" if options[:order_desc] == 0 and order_by != \"\"\n order_by += \" DESC\" if options[:order_desc] == 1 and order_by != \"\"\n return without, order_by\n end", "title": "" }, { "docid": "08f944d66000224bcd379b6ef5352c08", "score": "0.52258956", "text": "def sort_direction\n %w(asc desc).include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "08f944d66000224bcd379b6ef5352c08", "score": "0.52258956", "text": "def sort_direction\n %w(asc desc).include?(params[:direction]) ? params[:direction] : \"asc\"\n end", "title": "" }, { "docid": "3c29161d21f345a77aa94910ec5ff399", "score": "0.5225354", "text": "def sort_direction\r\n %w[asc desc].include?(params[:direction]) ? params[:direction] : \"asc\"\r\n end", "title": "" }, { "docid": "b72449f883b074644971ba2827fd4612", "score": "0.52238387", "text": "def ordering(order, cursor)\n raise ArgumentError, \"'#{order}' must be either :asc or :desc\" unless [:asc, :desc].include?(order)\n raise ArgumentError, \"'#{cursor}' must be either nil, :after or :before\" unless [nil, :after, :before].include?(cursor)\n\n if order == :asc\n if cursor.nil?\n return nil, :asc, false # asc - nil\n elsif cursor == :after\n return :gt, :asc, false # asc - after\n else\n return :lt, :desc, true # asc - before\n end\n else\n if cursor.nil?\n return nil, :desc, false # desc - nil\n elsif cursor == :after\n return :lt, :desc, false # desc - after\n else\n return :gt, :asc, true # desc - before\n end\n end\n end", "title": "" }, { "docid": "62dcdb0ebcd871b34b1964ef58db6661", "score": "0.522303", "text": "def priority_order_as=(value)\n value = value.blank? ? nil : value.to_s.upcase\n raise(ArgumentError, \"priority_order_as only accepts a blank string / nil or a string as 'ASC' or 'DESC'\") if !value.blank? && ![\"ASC\", \"DESC\"].include?(value)\n if @priority_order_by\n @priority_order = order_by_to_order(@priority_order_by, value)\n elsif priority_order\n @priority_order.gsub!(/(ASC|DESC)/i, value)\n end\n @priority_order_as = value\n end", "title": "" }, { "docid": "74a8f3fe457e21fb6a27be4130a518f4", "score": "0.51945114", "text": "def order_field_1st; order_by.split(\",\")[0] end", "title": "" } ]
25425b028d29f4fd71381e5374ee75f9
DELETE /shipments/1 DELETE /shipments/1.json
[ { "docid": "5b0fd8c8f5ba8c5d76a5d5754c0a8363", "score": "0.72164303", "text": "def destroy\n @shipment.destroy\n respond_to do |format|\n format.html { redirect_to shipments_url, notice: 'Shipment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "96d120b91aeb28fa37cbe5e6b1d1dbb1", "score": "0.77830756", "text": "def destroy\n @ship_request.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "d1265d5745c4322a5468dacce4714e35", "score": "0.76457053", "text": "def destroy\n @badgeship = Badgeship.find(params[:id])\n @badgeship.destroy\n\n respond_to do |format|\n format.html { redirect_to badgeships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5095949d070a6d15db2d2becdcfb10f8", "score": "0.76047504", "text": "def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n\n respond_to do |format|\n format.html { redirect_to(ships_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "476bd9eea9ca55b3d96169be3694103b", "score": "0.75889516", "text": "def destroy\n @po_shipment = PoShipment.find(params[:id])\n @po_shipment.destroy\n\n respond_to do |format|\n format.html { redirect_to po_shipments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ba2ee55d6b04c91f8ffd30e259f21b6b", "score": "0.75146663", "text": "def destroy\n @shipping = Shipping.find(params[:id])\n @shipping.destroy\n\n respond_to do |format|\n format.html { redirect_to shippings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0bef4548c4c877f419cfb16f0f2e10a3", "score": "0.7499608", "text": "def destroy\n @shipping.destroy\n \n respond_to do |format|\n format.html { }\n format.json { head :no_content }\n redirect_to shippings_url\n end\n end", "title": "" }, { "docid": "1e9421620865e20b931499f88b2da189", "score": "0.74966824", "text": "def destroy\n @shipment.destroy\n respond_to do |format|\n format.html { redirect_to shipments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1e9421620865e20b931499f88b2da189", "score": "0.7496523", "text": "def destroy\n @shipment.destroy\n respond_to do |format|\n format.html { redirect_to shipments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1e9421620865e20b931499f88b2da189", "score": "0.7496523", "text": "def destroy\n @shipment.destroy\n respond_to do |format|\n format.html { redirect_to shipments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cc61d7957d958a7f536ebb74c9c93003", "score": "0.74445087", "text": "def destroy\n # Destroy all associated ship items\n ShipItem.where(:ship_id => @player_ship.id).delete_all\n \n @player_ship.destroy\n respond_to do |format|\n format.html { redirect_to player_ships_path, notice: 'Ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "be12eeb6bf35431cd4664417cd915891", "score": "0.7428757", "text": "def destroy\n @directorship = Directorship.find(params[:id])\n @directorship.destroy\n\n respond_to do |format|\n format.html { redirect_to directorships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6c2aa4fc90afe4275fdf3c727187cc4a", "score": "0.7422348", "text": "def destroy\n @assigned_ship = AssignedShip.find(params[:id])\n @assigned_ship.destroy\n\n respond_to do |format|\n format.html { redirect_to assigned_ships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "80cb5a8089ace94dfe178ee01b851623", "score": "0.73811376", "text": "def destroy\n @guestship.destroy\n respond_to do |format|\n format.html { redirect_to guestships_url, notice: 'Guestship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "44e27cccd6bdd97c4ecdf84ad8141fb6", "score": "0.736886", "text": "def destroy\n followship = Followship.find(params[:followship_id])\n followship.destroy\n render :json => {:ok => true}, :head => :no_content\n end", "title": "" }, { "docid": "356dcfaaf7ce978fccab4f5b21d2c289", "score": "0.73661304", "text": "def destroy\n @shipment.destroy\n respond_to do |format|\n format.html { redirect_to shipments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "051e0bac4d3a376e1261380b2a77798b", "score": "0.73609006", "text": "def destroy\n @ship_type = ShipType.find(params[:id])\n @ship_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(ship_types_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e8c62dd5eb6003e7a49a6de65e27ca49", "score": "0.73591506", "text": "def destroy\n @township = Township.find(params[:id])\n @township.destroy\n\n respond_to do |format|\n format.html { redirect_to townships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbef028befd04b0840f49a304dd9ceae", "score": "0.72963965", "text": "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbef028befd04b0840f49a304dd9ceae", "score": "0.72963965", "text": "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbef028befd04b0840f49a304dd9ceae", "score": "0.72963965", "text": "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbef028befd04b0840f49a304dd9ceae", "score": "0.72963965", "text": "def destroy\n @internship = Internship.find(params[:id])\n @internship.destroy\n\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8047dd6f5823db8d44c415c08cc72db1", "score": "0.7295854", "text": "def destroy\n @ship = Ship.find(params[:id])\n @ship.destroy\n redirect_to root_path, notice: 'ship was successfully destroyed.'\nend", "title": "" }, { "docid": "5cced8e7271d4475f5c8e57c69c72c22", "score": "0.7294113", "text": "def destroy\n @ms_shippment = MsShippment.find(params[:id])\n @ms_shippment.destroy\n\n respond_to do |format|\n format.html { redirect_to(ms_shippments_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2e4c64f480163c352fbb1a37de4e59e4", "score": "0.7279421", "text": "def destroy\n @hostship = Hostship.find(params[:id])\n @hostship.destroy\n\n respond_to do |format|\n format.html { redirect_to hostships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f05c3ac3a6b4605523178be8c717b422", "score": "0.7277009", "text": "def destroy\n @ship_item.destroy\n respond_to do |format|\n format.html { redirect_to player_ships_path, notice: 'Ship item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "35f855b95019effbff1ff0cafdddd0f4", "score": "0.726913", "text": "def destroy\n @shipment = @speciman.shipments.find(params[:id])\n @shipment.destroy\n\n respond_to do |format|\n format.html { redirect_to(speciman_shipments_url(@speciman)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7bd21a25c12edba55d130e60fbabbe13", "score": "0.72686195", "text": "def destroy\n @user_ship.destroy\n respond_to do |format|\n format.html { redirect_to user_ships_url, notice: 'User ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "895d9e22870931f9e8b1c178ba0c49f7", "score": "0.72632605", "text": "def destroy\n @shipping = Shipping.find(params[:id])\n @shipping.destroy\n \n respond_to do |format|\n format.html { redirect_to shippings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "917b6b86eb7aee440f10e08fc4895778", "score": "0.72470576", "text": "def destroy\n @moderatorship = Moderatorship.find(params[:id])\n @moderatorship.destroy\n\n respond_to do |format|\n format.html { redirect_to moderatorships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6ff899d3c49c0b8ebffbcc41842b33ef", "score": "0.72462076", "text": "def destroy\n @discipleship.destroy\n respond_to do |format|\n format.html { redirect_to discipleships_url, notice: 'Discipulado eliminado correctamente' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d06115a1dd55e1658717095b4cebe72c", "score": "0.72337705", "text": "def destroy\n @voivodeship = Voivodeship.find(params[:id])\n @voivodeship.destroy\n\n respond_to do |format|\n format.html { redirect_to voivodeships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f23d270a93ecefe2905e964018084f74", "score": "0.722546", "text": "def destroy\n @shipping.destroy\n respond_to do |format|\n format.html { redirect_to shippings_url, notice: 'El registro se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8cc378b1669aab3ad3b1c9e5286121d8", "score": "0.7198741", "text": "def destroy\n @internship.destroy\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8cc378b1669aab3ad3b1c9e5286121d8", "score": "0.7198741", "text": "def destroy\n @internship.destroy\n respond_to do |format|\n format.html { redirect_to internships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fc945bf52c7db76cc436bffb20059df1", "score": "0.71829957", "text": "def destroy\n @shipper = Shipper.find(params[:id])\n @shipper.kill\n\n respond_to do |format|\n format.html { redirect_to(shippers_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f0fddea3c2dfaf1397189e4cb7941562", "score": "0.716568", "text": "def destroy\n @shipping = Shipping.find(params[:id])\n @shipping.destroy\n\n respond_to do |format|\n format.html { redirect_to(financial_shippings_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b0870847b848fc368b02c4a230e58158", "score": "0.7155028", "text": "def destroy\n @authorship = Authorship.find(params[:id])\n @authorship.destroy\n\n respond_to do |format|\n format.html { redirect_to(authorships_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b0870847b848fc368b02c4a230e58158", "score": "0.7155028", "text": "def destroy\n @authorship = Authorship.find(params[:id])\n @authorship.destroy\n\n respond_to do |format|\n format.html { redirect_to(authorships_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b0870847b848fc368b02c4a230e58158", "score": "0.7155028", "text": "def destroy\n @authorship = Authorship.find(params[:id])\n @authorship.destroy\n\n respond_to do |format|\n format.html { redirect_to(authorships_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d0925594eb55da73ed163efea1391f36", "score": "0.7152061", "text": "def destroy\n @shipment_item.destroy\n respond_to do |format|\n format.html { redirect_to shipment_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3f2b1e8e95228fe7de30039f570fc207", "score": "0.71506274", "text": "def destroy\n @shipping.destroy\n respond_to do |format|\n format.html { redirect_to shippings_url, notice: 'Shipping was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f6fa6d5f0aa5d54dbd6f510cc8aaa883", "score": "0.71310115", "text": "def destroy\n @flower_ship.destroy\n respond_to do |format|\n format.html { redirect_to flower_ships_url, notice: 'Flower ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0bb99b243425d7ded07779744d1410a6", "score": "0.7127283", "text": "def destroy\n @shipment = Shipment.find(params[:id])\n @shipment.kill\n\n respond_to do |format|\n format.html { redirect_to(shipments_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0184f5ba5165e385e5b30b5a06a79c48", "score": "0.7124879", "text": "def destroy\n @api_v1_mentorship_type.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_mentorship_types_url, notice: 'Mentorship type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "daa8d4e931cd8c40417afc6772c49a4a", "score": "0.7124364", "text": "def destroy\n @ship_attribute = ShipAttribute.find(params[:id])\n @ship_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(ship_attributes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "aa6ed10cf1781c58f494ba5ac3809e1d", "score": "0.71156067", "text": "def destroy\n # @shipment.destroy\n respond_to do |format|\n format.html { redirect_to shipments_url, notice: \"Shipment is closed and cannot be modified.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0cc90a0228c4ad59029034da7a8e40e0", "score": "0.7099341", "text": "def destroy\n @contributorship = Contributorship.find(params[:id])\n @contributorship.destroy\n\n respond_to do |format|\n format.html { redirect_to(contributorships_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5c794bc2a21cf75f7625cb817b326661", "score": "0.7073292", "text": "def destroy\n @directorship.destroy\n respond_to do |format|\n format.html { redirect_to directorships_url, notice: 'Directorship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1b623742867f25f32eb52882daaebbda", "score": "0.7063742", "text": "def destroy\n @starship.destroy\n respond_to do |format|\n format.html { redirect_to starships_url, notice: \"Starship was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "50941ac90c6ab49412824f9fc86ca33b", "score": "0.7053444", "text": "def destroy\n @voivodship = Voivodship.find(params[:id])\n @voivodship.destroy\n\n respond_to do |format|\n format.html { redirect_to voivodships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df6c7fcb3d2cfd72551b8e71a1ff46ad", "score": "0.7052689", "text": "def delete_shipment(id, params = nil, headers = nil)\n delete(\"/api/v1/shipments/#{id}\", params, headers)\n end", "title": "" }, { "docid": "d96d806925470041b3917d22b2361a35", "score": "0.70449793", "text": "def destroy\n @voivodeship.destroy\n respond_to do |format|\n format.html { redirect_to voivodeships_url, notice: 'Voivodeship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9f616ee9c0ffe81de681699f2cf4751b", "score": "0.7042123", "text": "def destroy\n @blockship.destroy\n respond_to do |format|\n format.html { redirect_to blockships_url, notice: 'Blockship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1a0b44542c731870b94cc2252374be6e", "score": "0.70387113", "text": "def destroy\n @team_player_ship.destroy\n respond_to do |format|\n format.html { redirect_to team_player_ships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c28ed3fbd2766c3da6871a0e1298470d", "score": "0.70367163", "text": "def destroy\n @companionship = Companionship.find(params[:id])\n @companionship.destroy\n\n respond_to do |format|\n format.html { redirect_to companionships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9e73291ae2011b471052e65fe599f984", "score": "0.7034741", "text": "def destroy\n Authorship.find(params[:id]).destroy\n render :update do |page|\n page[\"authorship#{params[:id]}\"].remove\n end\n end", "title": "" }, { "docid": "96c3e4b03424a74d4c4541ee44008536", "score": "0.70174766", "text": "def destroy\n @roleship.destroy\n respond_to do |format|\n format.html { redirect_to roleships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b54159734aaf1234e426ef230d094090", "score": "0.69899815", "text": "def destroy\n @task_tagship = TaskTagship.find(params[:id])\n @task_tagship.destroy\n\n respond_to do |format|\n format.html { redirect_to task_tagships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ca4f5534ca38f82217afef4049a6407", "score": "0.69879854", "text": "def destroy\n @shipping_type.destroy\n respond_to do |format|\n format.html { redirect_to shipping_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fcdc4e6427598b8ca1104288a6c74f39", "score": "0.69879305", "text": "def destroy\n @shipment_line = ShipmentLine.find(params[:id])\n @shipment_line.destroy\n\n respond_to do |format|\n format.html { redirect_to(shipment_lines_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bfb0d1e7042d412adb7a25f9dcf7e6cf", "score": "0.69834876", "text": "def destroy\n @shipping_method = ShippingMethod.find(params[:id])\n @shipping_method.destroy\n\n respond_to do |format|\n format.html { redirect_to shipping_methods_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bfb0d1e7042d412adb7a25f9dcf7e6cf", "score": "0.69834876", "text": "def destroy\n @shipping_method = ShippingMethod.find(params[:id])\n @shipping_method.destroy\n\n respond_to do |format|\n format.html { redirect_to shipping_methods_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6c78970486ab6ce43bac1c01ed83d641", "score": "0.6983356", "text": "def destroy\n @shipment_line.destroy\n respond_to do |format|\n format.html { redirect_to shipment_lines_url, notice: 'Shipment line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6c78970486ab6ce43bac1c01ed83d641", "score": "0.6983356", "text": "def destroy\n @shipment_line.destroy\n respond_to do |format|\n format.html { redirect_to shipment_lines_url, notice: 'Shipment line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "382c25c6950a57f8ba3afd1c54c64f5a", "score": "0.6983272", "text": "def destroy\n @friend_ship.destroy\n respond_to do |format|\n format.html { redirect_to friend_ships_url, notice: 'Friend ship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8a5474b9128147600955098348de234a", "score": "0.69736904", "text": "def destroy\n @paper_gradeship.destroy\n respond_to do |format|\n format.html { redirect_to paper_gradeships_url, notice: 'Paper gradeship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "44ac7bee4ab141ba3196230f1229e016", "score": "0.6972636", "text": "def destroy\n @shipping_order = ShippingOrder.find(params[:id])\n @shipping_order.destroy\n\n respond_to do |format|\n format.html { redirect_to shipping_orders_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "d3c8333783877f099cf4a9154ccf07cd", "score": "0.69720805", "text": "def destroy\n @supply_shipment.destroy\n respond_to do |format|\n format.html { redirect_to supply_shipments_url, notice: 'Supply shipment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "da2d79f11ea8e1084460c35cc108bb93", "score": "0.69703966", "text": "def destroy\n WasabbiAdminship.transaction do\n @wasabbi_adminship = WasabbiAdminship.find(params[:id])\n @wasabbi_adminship.destroy\n\n respond_to do |format|\n format.html { redirect_to(wasabbi_adminships_url) }\n format.xml { head :ok }\n end\n end\n end", "title": "" }, { "docid": "d95e62f10e89d451b788a744d712ae2e", "score": "0.6958469", "text": "def destroy\n @ship_class = ShipClass.find(params[:id])\n @ship_class.destroy\n\n respond_to do |format|\n format.html { redirect_to(ship_classes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b17bcf081ef8b2414253a9da361fa4ba", "score": "0.69505244", "text": "def destroy\n @ship_hull.destroy\n respond_to do |format|\n format.html { redirect_to ship_hulls_url, notice: 'Ship hull was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f53323e1f992a3750938fc613179d1e9", "score": "0.69403255", "text": "def destroy\n @internship.destroy\n respond_to do |format|\n format.html { redirect_to internships_url, notice: \"Internship was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1483a431994811c55068da4b1e8c2471", "score": "0.693535", "text": "def destroy\n @internship.destroy\n respond_to do |format|\n format.html { redirect_to internships_url, notice: 'Internship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aaa51dfb2472fe376acffc89561de943", "score": "0.6922985", "text": "def destroy\n @receivable = Receivable.find(params[:receivable_id])\n @receivable_shipment = @receivable.receivable_shipments.find(params[:id])\n @receivable_shipment.destroy\n\n respond_to do |format|\n format.html { redirect_to receivable_receivable_shipments_url(receivable) }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "1aece1930a127bace0be641f1c479d09", "score": "0.6919261", "text": "def destroy\n @shipment.destroy\n respond_to do |format|\n format.html { redirect_to shipments_url, notice: 'Shipment was successfully deleted.' }\n format.js\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dc3469f0135c8808513124048deebc12", "score": "0.69103634", "text": "def destroy\n @sponsorship.destroy\n respond_to do |format|\n format.html { redirect_to sponsorships_url, notice: 'Sponsorship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d297a7065146931416c80a536509fea7", "score": "0.6910231", "text": "def destroy\n @ship_share.destroy\n respond_to do |format|\n format.html { redirect_to ship_shares_url, notice: 'Ship share was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c483e13f21e12befd0f21f2468112505", "score": "0.69061947", "text": "def destroy\n @worship.destroy\n respond_to do |format|\n format.html { redirect_to worships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4bc74e7390e264b6f21b0a4a9f83fbb2", "score": "0.6899893", "text": "def destroy\n\n @friendship = Friendship.find(params[:id])\n @friendship.destroy!\n render json: {}\n end", "title": "" }, { "docid": "d278010b6f1f0167a0c91d5d6ebff75b", "score": "0.68991643", "text": "def destroy\n @shipper_order.destroy\n respond_to do |format|\n format.html { redirect_to shippers_url, notice: 'Shipper was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d1bb3d15b809003656205fad44bde1ea", "score": "0.68913513", "text": "def destroy\n @shipment_detail.destroy\n respond_to do |format|\n format.html { redirect_to shipment_details_url, notice: 'Shipment detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4e791a754706755b12869a6f9c0ab3f4", "score": "0.6886836", "text": "def destroy\n @followship = Followship.find(params[:id])\n @followship.destroy\n\n respond_to do |format|\n format.html { redirect_to followships_url }\n format.json { head :no_content }\n format.js\n end\n end", "title": "" }, { "docid": "ec2af944da6728ff402d99237d3b377a", "score": "0.6873759", "text": "def destroy\n @airship.destroy\n respond_to do |format|\n format.html { redirect_to airships_url, notice: 'Airship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "24c86f9afc649e9eac6c6ea19b2f7077", "score": "0.68607914", "text": "def destroy\n @order_shipment.destroy\n respond_to do |format|\n format.html { redirect_to order_shipments_url, notice: 'Order shipment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2e80ce6eeb541dbd42d53fcebc7411e4", "score": "0.6857357", "text": "def destroy\n @heirship.destroy\n respond_to do |format|\n format.html { redirect_to heirships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "53a2fbcb05a1093719a1962177b4cbe0", "score": "0.68515426", "text": "def destroy\n @shipping_destination = ShippingDestination.find(params[:id])\n @shipping_destination.destroy\n\n respond_to do |format|\n format.html { redirect_to shipping_destinations_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cc910074bce0b4a1afa3a4e96beaf6c6", "score": "0.6846031", "text": "def destroy\n @shipping_type = ShippingType.find(params[:id])\n @shipping_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(shipping_types_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2a27c1e74c1ef9cb973834bad7b54046", "score": "0.68214935", "text": "def destroy\n @ship_armor.destroy\n respond_to do |format|\n format.html { redirect_to ship_armors_url, notice: 'Ship armor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5951e2b8d88c17c5728b598b44a06d2c", "score": "0.6818325", "text": "def destroy\n @shipping_detail = ShippingDetail.find(params[:id])\n @shipping_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to(shipping_details_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "888980fb7d952e96f47a23b09eb69051", "score": "0.68163276", "text": "def destroy\n @sponsorship_d.destroy\n respond_to do |format|\n format.html { redirect_to sponsorship_ds_url, notice: 'Sponsorship d was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e43b986e092cfafc129d86e6e53c2785", "score": "0.68098176", "text": "def destroy\n @so_shipment = SoShipment.find(params[:id])\n SoShipment.update_quality_on_hand(@so_shipment)\n # status = @so_shipment.so_shipped_status\n @so_shipment.destroy\n\n respond_to do |format|\n # if status == \"process\"\n format.html { redirect_to new_so_shipment_path, notice: 'SO shipment was successfully deleted.' }\n format.json { head :no_content }\n # else\n # format.html { redirect_to so_shipments_url, notice: 'SO shipment was successfully deleted.' }\n # format.json { head :no_content }\n # end\n end\n end", "title": "" }, { "docid": "e8311d00ff77f69420de5d8f47468c0d", "score": "0.68078524", "text": "def destroy\n @friendship = Friendship.find(params[:id])\n @friendship.destroy\n\n respond_to do |format|\n format.html { redirect_to friendships_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "611602e0b8cd159774470109334c4d98", "score": "0.6807015", "text": "def destroy\n @shipping_line_office = ShippingLineOffice.find(params[:id])\n @shipping_line_office.destroy\n\n respond_to do |format|\n format.html { redirect_to shipping_line_offices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c9e52f4fc722c9835c44b9223bbffe61", "score": "0.6806072", "text": "def destroy\n @friendship = Friendship.find(params[:id])\n @friendship.destroy\n\n respond_to do |format|\n format.html { redirect_to friendships_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "c9e52f4fc722c9835c44b9223bbffe61", "score": "0.6806072", "text": "def destroy\n @friendship = Friendship.find(params[:id])\n @friendship.destroy\n\n respond_to do |format|\n format.html { redirect_to friendships_url }\n format.json { head :ok }\n end\n end", "title": "" } ]
66a1acbbb673f39e8bb81bde8b5f28d9
This method restarts the task
[ { "docid": "3f1d190230ad8915b4b83440d20b06da", "score": "0.0", "text": "def restart!\n update_attributes(completed_at: nil)\n end", "title": "" } ]
[ { "docid": "89e6fa59464d43a7fa32eb6ffe8ad53f", "score": "0.8153247", "text": "def restart!\n restart(true)\n end", "title": "" }, { "docid": "f3d750a5def32d9ec2fd14ff8ca369fd", "score": "0.7959181", "text": "def restart!\n stop!\n start!\n end", "title": "" }, { "docid": "4852928fcd12455db0534772c25ab31c", "score": "0.789453", "text": "def restart\n start\n end", "title": "" }, { "docid": "1588f8fba13d2d0cee6e085c0f7b8e3e", "score": "0.7844573", "text": "def restart\n stop()\n start()\n end", "title": "" }, { "docid": "36b3dae901ea277a2c1748349236e802", "score": "0.7831467", "text": "def restart!\n stop! if running?\n start!\n end", "title": "" }, { "docid": "3af473a8335e7c4dfe1cd11108d68a04", "score": "0.7775108", "text": "def restart\n stop\n start\n end", "title": "" }, { "docid": "3265b72840c3179090637cfee2e1f09b", "score": "0.77673525", "text": "def restart\n stop\n start\n end", "title": "" }, { "docid": "3265b72840c3179090637cfee2e1f09b", "score": "0.77673525", "text": "def restart\n stop\n start\n end", "title": "" }, { "docid": "6843be31c4d95b4d0e61371528f149d8", "score": "0.77118653", "text": "def restart!\n invoke [:restart]\n end", "title": "" }, { "docid": "60a0e4117b2ff2dbcf643d9f759ef547", "score": "0.7702723", "text": "def restart\n self.stop\n self.start\n end", "title": "" }, { "docid": "00e5b0b740d8b7a9c70333865e8673b4", "score": "0.7701133", "text": "def restart\n stop\n reset\n start\n end", "title": "" }, { "docid": "00e5b0b740d8b7a9c70333865e8673b4", "score": "0.7701133", "text": "def restart\n stop\n reset\n start\n end", "title": "" }, { "docid": "becd50bbdb38ed68bb6bc3893e4bf731", "score": "0.7688584", "text": "def restart\n stop\n start\n end", "title": "" }, { "docid": "becd50bbdb38ed68bb6bc3893e4bf731", "score": "0.7688584", "text": "def restart\n stop\n start\n end", "title": "" }, { "docid": "13406c79c9aa400236f5b4ec2eea4f82", "score": "0.7678027", "text": "def restart()\n shutdown()\n start()\n end", "title": "" }, { "docid": "cc7c95f687f1b388c1fcd470bcfa8afe", "score": "0.76498103", "text": "def restart\n stop\n sleep(1)\n start\n end", "title": "" }, { "docid": "bda3b27043f0c1410038c8f2fd9d15c8", "score": "0.76425534", "text": "def restart\n stop\n sleep 1\n start\n end", "title": "" }, { "docid": "798cd447ea0579666cbf2759e6495958", "score": "0.76264435", "text": "def restart\n\t\tstop\n\t\tstart\n\tend", "title": "" }, { "docid": "798cd447ea0579666cbf2759e6495958", "score": "0.76264435", "text": "def restart\n\t\tstop\n\t\tstart\n\tend", "title": "" }, { "docid": "798cd447ea0579666cbf2759e6495958", "score": "0.76264435", "text": "def restart\n\t\tstop\n\t\tstart\n\tend", "title": "" }, { "docid": "a634f3c2de85baf5aef64832921dee0d", "score": "0.7579626", "text": "def restart\n stop if running?\n save\n start\n end", "title": "" }, { "docid": "32013acf90733c2884ae0dd6721414cf", "score": "0.7540594", "text": "def restart\n stop\n sleep self.class.stop_start_delay\n start\n end", "title": "" }, { "docid": "77e21d5382cef2edfc5cdbd412df17a1", "score": "0.75383234", "text": "def restart\n @status = :restart\n @runner.restart\n end", "title": "" }, { "docid": "b7a9909be1dc8a32305ac4a94d4de988", "score": "0.7509953", "text": "def restart\n stop_all\n start\n end", "title": "" }, { "docid": "5ef12c51281ae01beb707e766a8236cc", "score": "0.74927217", "text": "def restart\n request(:restart)\n end", "title": "" }, { "docid": "00998276eee115da3844fb0afba62de2", "score": "0.7488053", "text": "def restart; end", "title": "" }, { "docid": "5718d662f21c50e19a856c1a0d4bf174", "score": "0.74238837", "text": "def restart\n @stop = false\n end", "title": "" }, { "docid": "143b89d6b4d885a976a92f3e2605a587", "score": "0.7326248", "text": "def restart!\n Kernel.exec(*@restart_cmdline)\n end", "title": "" }, { "docid": "1512c602a2e80fb1f15ef3755315af4f", "score": "0.73155683", "text": "def restart\n @context.get(PATH_RESTART)\n end", "title": "" }, { "docid": "b4b5ac09bc5de0d9c4cb897e6f18067d", "score": "0.731399", "text": "def restart\n shutdown if running?\n startup\n end", "title": "" }, { "docid": "66cdc32f551c572462f9062e0de59ded", "score": "0.72258824", "text": "def restart!\n\t\t\t\t@restarts += 1\n\t\t\tend", "title": "" }, { "docid": "e4564d296c21d5c882fcaa8dd1cb766b", "score": "0.71786046", "text": "def restart\n\t\t\tstop\n\t\t\tyield if block_given?\n\t\t\tstart\n\t\tend", "title": "" }, { "docid": "d864357c99432ac53aedae1970801af6", "score": "0.7173306", "text": "def restart\n @timer = VM.tick # Generate an event immediately after restart\n end", "title": "" }, { "docid": "10e1373335135a6406620cc74467a664", "score": "0.714523", "text": "def restart\n raise Restart.new \"restart initiated by #{self.class.name}:#{object_id}\"\n end", "title": "" }, { "docid": "4aded073893b099b203b96522f375c98", "score": "0.7140118", "text": "def restart\n execute(make_xml('RestartRequest', {})).success\n end", "title": "" }, { "docid": "9f51166a6380aed6c8d80ba949ef64e1", "score": "0.7070499", "text": "def restart\n initialize\n end", "title": "" }, { "docid": "0b495625d805f76266085eb8c3cf620c", "score": "0.7061027", "text": "def restart!\n connection.post \"_restart\"\n end", "title": "" }, { "docid": "010be943b65eb23179bb9e3ed028f29e", "score": "0.70513594", "text": "def restartcmd\n end", "title": "" }, { "docid": "010be943b65eb23179bb9e3ed028f29e", "score": "0.70513594", "text": "def restartcmd\n end", "title": "" }, { "docid": "ff420b9e47323d02ff01b60aafa401eb", "score": "0.70325696", "text": "def restart\n raise \"error. %s Does not implement #restart\" % self.class.to_s\n end", "title": "" }, { "docid": "e6e9348b54cc12c4f8c0444468907cbe", "score": "0.7028426", "text": "def restart(options={}, &block); M.restart(options, &block); end", "title": "" }, { "docid": "73294fa480da08364f7b919eb6784156", "score": "0.6995963", "text": "def restart\n stop if running?\n start_event_loop\n end", "title": "" }, { "docid": "7528693614568538967e0c7aa50b3341", "score": "0.6991481", "text": "def restart(id, task = nil)\n connection.post do |req|\n req.url \"client/allocation/#{id}/restart\"\n req.body = { 'Task' => task } unless task.nil?\n end\n end", "title": "" }, { "docid": "7c1f36033a3ab31adce895cca3e6920b", "score": "0.6978882", "text": "def restart(options = {})\n return if stopped?\n stop\n start(options)\n end", "title": "" }, { "docid": "349632c3f562212ac0328c4aadc70d1a", "score": "0.69734716", "text": "def restart\n @target = @time_start = Time.now\n end", "title": "" }, { "docid": "3c3854a2f1f494a451558767f74b5229", "score": "0.6948725", "text": "def resume_task\n Ragweed::Wraposx::task_resume(@task)\n end", "title": "" }, { "docid": "31b5b09cd199b1e4211910a8466c09c6", "score": "0.6938894", "text": "def restart\n @client.restart\n end", "title": "" }, { "docid": "0ff12c40d64f8679324bb4bcd5be6103", "score": "0.693756", "text": "def restart!\n @thread.alive? ? @thread : run!\n end", "title": "" }, { "docid": "83bef554f748c2bb6caba2ff2e36b2d4", "score": "0.6933689", "text": "def restart\n self.current_flow_step = flow_object.first_step_nr\n if FileAdapter.move_to_trash(package_location, package_name) && create_flow_steps\n create_log_entry(\"RESTART\", message)\n save!\n end\n end", "title": "" }, { "docid": "6b393b45967425679838def20ec03c5f", "score": "0.693178", "text": "def restart\n return unless SystemTime.available?\n @target = reschedule\n end", "title": "" }, { "docid": "f26beb36f138817fa4ceb1e113c87df8", "score": "0.687747", "text": "def restart\n if @resource[:restart] or restartcmd\n ucommand(:restart)\n else\n self.stop\n self.start\n end\n end", "title": "" }, { "docid": "788904aa82e70543f71fa797b2385e0a", "score": "0.6875242", "text": "def restart\n @judge_timer.restart\n end", "title": "" }, { "docid": "2cd744dd9e9eba38b4d69a621521686d", "score": "0.6871514", "text": "def restart_task(media_id, task_id)\n make_request(\"RestartMediaTask\") do |q|\n q.mediaid media_id\n q.taskid task_id\n end\n end", "title": "" }, { "docid": "2bfb5bcc74ac0944586a2f6e914da9da", "score": "0.68509334", "text": "def restart_cmd\n @restart_cmd\n end", "title": "" }, { "docid": "533d046ced5e43d2437c83f3aec5cf14", "score": "0.68491435", "text": "def restart!\n if failed? \n update_attributes!(\n :result => nil, \n :progress => nil, \n :started_at => nil, \n :state => \"pending\"\n )\n logger.info(\"BackgroundFu: Job restarted. Job(id: #{id}).\")\n end\n end", "title": "" }, { "docid": "3537a14bf8ecfe70e5cc19c67ae5abb1", "score": "0.6838268", "text": "def restart\n conns = storage.get_all(teams_key)\n storage.pipeline do\n conns.each { |k, _| storage.set(teams_key, k, 'restart') }\n end\n end", "title": "" }, { "docid": "f0a3f268dd96b878ee1436edbec663e0", "score": "0.680255", "text": "def restart_action\n execute \"J 0\"\n update_status\n end", "title": "" }, { "docid": "ef62cdff88b131b048b13cb459018cf2", "score": "0.6796658", "text": "def restart(&block)\n self.stop\n @pid = nil\n\n unless block_given?\n self.start\n else\n self.start &block\n end\n end", "title": "" }, { "docid": "89d4475f559f57d1852b4b4cfb856cea", "score": "0.67843544", "text": "def restart!\n if @thread && @thread.alive?\n @thread\n else\n run!\n end\n end", "title": "" }, { "docid": "03ac98740c5127a5ec8d0886a8416a41", "score": "0.67662734", "text": "def restart(uuid)\n @operation.call(:restart, uuid)\n end", "title": "" }, { "docid": "caa0ff34c54d76fe403ee828f40649fe", "score": "0.67618227", "text": "def restart\n status 'Restarting ...'\n\n project.restart!(options[:environment])\n\n status 'Restarted'\n end", "title": "" }, { "docid": "55b0712286c76f0dc76c96f73fdb9667", "score": "0.6752249", "text": "def restart!\n if failed? \n update_attributes!(\n :result => nil, \n :progress => nil, \n :started_at => nil, \n :state => \"pending\"\n )\n BACKGROUND_LOGGER.info(\"BackgroundFu: Job restarted. #{inspect}.\")\n end\n end", "title": "" }, { "docid": "77ebc8ada029513c55ceec8d1f9b4378", "score": "0.6751359", "text": "def restart(recreate_flow: false)\n Job.transaction do\n if recreate_flow\n flow.apply_flow(job: self, step_nr: nil)\n else\n reset_flow_steps\n end\n flow.folder_paths_array.each do |folder_path|\n DfileApi.move_to_trash(source_dir: Job.substitute_parameters(string: folder_path, job_variables: self.variables, flow_variables: self.flow_parameters_hash))\n end\n self.update_attribute('quarantined', false) if quarantined\n create_log_entry(\"RESTART\", message)\n save!\n end\n end", "title": "" }, { "docid": "a198578dba8436792538eb8ce5453adf", "score": "0.6717358", "text": "def restart\n @attributes[:restart]\n end", "title": "" }, { "docid": "85807d5a966775ed75f6f02b60f174c2", "score": "0.6715694", "text": "def reload\n UI.info 'Restarting clockwork...'\n restart\n end", "title": "" }, { "docid": "5cf2e74a9d699284cc42b54b890f2c78", "score": "0.66907686", "text": "def restart\n\t\tputs \"Restarting node set #{@name}\"\n\t\t@nodes.each do |node|\n\t\t\tnode.restart\n\t\tend\n\tend", "title": "" }, { "docid": "c637431c8f50444803cb053e1f53cc0a", "score": "0.6684486", "text": "def restart\n @curr = @start\n end", "title": "" }, { "docid": "d0aea69d06ff405328312e3fd4d0c1b4", "score": "0.6671447", "text": "def restart\n app.restart\n end", "title": "" }, { "docid": "7ff5f0ecf090bf071ea23f3bf0ea0571", "score": "0.66621906", "text": "def restart_all from, groups=[]\n tasks(groups).each do |t|\n exe_control t, 'restart'\n end\n \"Restarting all tasks...\"\n end", "title": "" }, { "docid": "f709851314721a8bf7716319df8fd869", "score": "0.6657353", "text": "def restarted!\n run_setup\n run_connect\n start!\n end", "title": "" }, { "docid": "5bccd7969029d8be7be5dbb72953a8a0", "score": "0.6652683", "text": "def restart\n\t\tr = lambda { stop; start }\n\t\tif thread == Thread.current\n\t\t\tThread.new &r # Leaks a thread, but works.\n\t\telse\n\t\t\tr.call\n\t\tend\n\tend", "title": "" }, { "docid": "a6f015413558075f599ed2593611d043", "score": "0.6649934", "text": "def restart\n\trequire_relative '../../lib/falcon/command/supervisor'\n\t\n\tFalcon::Command::Supervisor[\"restart\"].call\nend", "title": "" }, { "docid": "5823ff8e3b607e7a8037f9938d4d2520", "score": "0.66489166", "text": "def restart\n @client = Helper.setup(parent_options)\n force = options[:force] ? true : false\n @client.system.restart(force)\n end", "title": "" }, { "docid": "2e000d3fa7fe7feb4d08c8c9b11ef23f", "score": "0.6608243", "text": "def restart\n stop if service.loaded?\n start\n end", "title": "" }, { "docid": "8d81858dcbe5b059ed36b7e30694e68b", "score": "0.66077137", "text": "def restart\n @time += @duration\n end", "title": "" }, { "docid": "2b86098f370c6ade8c11649bfedd7b6c", "score": "0.66030276", "text": "def restart_command\n return unless stop_command\n [stop_command, \"sleep 1\", start_command].join(\" && \")\n end", "title": "" }, { "docid": "113f42f37da8e41f714606c0668f20e4", "score": "0.6585079", "text": "def restart\n @started = true\n @solution_code = Code.random(@code_length)\n @try_count = 1\n run\n end", "title": "" }, { "docid": "942326e9d0b14fe7561ca955944a6adc", "score": "0.6569098", "text": "def restart\n Rupl.register(self)\n end", "title": "" }, { "docid": "5b49844d5031db120b71c875d35db62f", "score": "0.65604484", "text": "def restart_command\n return unless stop_command\n [stop_command, \"sleep 1\", start_command].join(\" && \")\n end", "title": "" }, { "docid": "12d018195462f9e4efc55f6a29127e9d", "score": "0.65430725", "text": "def restart\n return true if @shutdown == false\n @log.info self.class.to_s + \": Restarting after shutdown\"\n @shutdown = false\n start_threads(@num_threads)\n end", "title": "" }, { "docid": "a39d43c6a5792b1ebf5cf3ab2956cdbb", "score": "0.6538347", "text": "def reload\n restart\n end", "title": "" }, { "docid": "f0e17205ad3c2dc15668046ff10a390e", "score": "0.6509989", "text": "def restart\n\t\tself.restarting = true\n\t\tself.log.warn \"Restarting...\"\n\n\t\tif Symphony.config.reload\n\t\t\tself.log.info \" config reloaded\"\n\t\telse\n\t\t\tself.log.info \" no config changes\"\n\t\tend\n\n\t\tself.log.info \" resetting queue\"\n\t\tSymphony::Queue.reset\n\t\tself.queue.shutdown\n\tend", "title": "" }, { "docid": "04d3d1a45981471b4f02ba643369521b", "score": "0.6497363", "text": "def restart_with_threads!\n if stopped? || failed?\n update_attributes!(\n :result => nil, \n :progress => nil, \n :started_at => nil, \n :state => \"pending\"\n ) \n logger.info(\"BackgroundFu: Restarting job. Job(id: #{id}).\")\n end\n end", "title": "" }, { "docid": "645237073a10c73f1d57148c686e82ac", "score": "0.6469091", "text": "def restart!\n lock\n\n begin\n if config.core_base\n @config.state = \"started\"\n write_config current_deployment_number, @config\n @logger.debug \"Restarting core\"\n @starter.restart! config.core_base\n @config.last_start_time = time\n end\n\n @event_dispatcher.dispatch_restart_success_event status\n announce\n return status\n rescue Exception => e\n error_reason = \"Unable to restart: #{e}\"\n error_reason += \"\\n#{e.message}\" if e.class == Galaxy::HostUtils::CommandFailedError\n @logger.error error_reason\n @event_dispatcher.dispatch_restart_error_event error_reason\n raise error_reason\n ensure\n unlock\n end\n end", "title": "" }, { "docid": "bb1b6d140a48a280a46b9f726ba5d2a8", "score": "0.6466213", "text": "def restart!\n CouchRest.post \"#{@uri}/_restart\"\n end", "title": "" }, { "docid": "0f24cfdf3f9f65c37cb079ec9beb62ff", "score": "0.6444053", "text": "def restart!\n CouchSpring.post \"#{uri}/_restart\"\n end", "title": "" }, { "docid": "8fd67a5b4e62364c8898a5ca7d8f3f23", "score": "0.64349157", "text": "def restart\n short_path = Pathname.new(mets_data[:dflow_path]+\"/\"+id.to_s)\n long_path = Pathname.new(mets_data[:dflow_path]+\"/\"+mets_data[:id])\n restarted_path = Pathname.new(mets_data[:dflow_path]+\"/\"+mets_data[:restarted])\n if short_path.exist?\n restarted_path = auto_increment_path(mets_data[:dflow_path]+\"/\"+mets_data[:restarted]+id.to_s)\n short_path.rename(restarted_path.to_s)\n end\n if long_path.exist?\n restarted_path = auto_increment_path(mets_data[:dflow_path]+\"/\"+mets_data[:restarted]+mets_data[:id])\n long_path.rename(restarted_path.to_s)\n end\n end", "title": "" }, { "docid": "a9aa553f2c2f0945e2f6081c4a2d3140", "score": "0.6431761", "text": "def restart\n\t\tself.stop_heartbeat\n\t\tsuper\n\t\tself.start_heartbeat\n\tend", "title": "" }, { "docid": "cd099f748b4259e4581754f926d9f745", "score": "0.64256334", "text": "def restart!(env=:production)\n invoke [:restart], env\n end", "title": "" }, { "docid": "9f642ea0133be9ed36fcec47178617c2", "score": "0.6414775", "text": "def restart\n @mutex_tp.synchronize do\n @thread.kill\n \n if @blockdata\n @blockdata[:runned] = true\n @blockdata[:running] = false\n \n begin\n sleep 0.1\n raise \"The worker was stopped during execution of the block.\"\n rescue => e\n @blockdata[:error] = e\n end\n end\n \n #Dont run the job again - remove it from the queue.\n @tp.blocks.delete(@blockdata)\n @blockdata = nil\n @running = false\n \n #Spawn a new thread - we killed the previous.\n self.spawn_thread\n end\n end", "title": "" }, { "docid": "8264b7d141bcbb86707f2c3487446d67", "score": "0.6408652", "text": "def restart\n Video.restart(@id)\n end", "title": "" }, { "docid": "bd31fbda13e6b25a23004668bc5425d5", "score": "0.639789", "text": "def restart_node(ip)\n\t\tnode_from_long_ip(ip).restart\n\tend", "title": "" }, { "docid": "23cbdc46613c571224377ee28059a2f0", "score": "0.6385762", "text": "def restart\n\t\t# Call back into the continuation that was saved at the beginning of\n\t\t# #each\n\t\t@marker.call if @iterating\n\tend", "title": "" }, { "docid": "f2ffdae85c70bfb11aacf65a1f6473ee", "score": "0.6373238", "text": "def restart\n if managed? && started?\n exec('restart', p: port, c: config.cloud)\n end\n end", "title": "" }, { "docid": "3cd8084db6b376f6ab08c35e8430aee5", "score": "0.6361068", "text": "def continue_run()\n\t\tlog(0, \"Script told to restart.\")\n return unless $run\n\t\tlog(0, \"Script restarting.\")\n $script.pause = false\n $run.run\n end", "title": "" }, { "docid": "ff1ab618a4e3f06547f11fabb8e0b89b", "score": "0.6358242", "text": "def restart(vmname, group = configuration.resource_group)\n vm_operate('restart', vmname, group)\n end", "title": "" }, { "docid": "845ddd0e0ae4a6a763af5e0ffb93275a", "score": "0.6352438", "text": "def reschedule!\n duration = (@retries ** 4) + 5\n @retries += 1\n @run_at += duration\n end", "title": "" }, { "docid": "a2250b70dc25b60e7e52640b011f9baa", "score": "0.6341326", "text": "def restart\n gears.each(&:restart)\n end", "title": "" }, { "docid": "a2250b70dc25b60e7e52640b011f9baa", "score": "0.6341326", "text": "def restart\n gears.each(&:restart)\n end", "title": "" }, { "docid": "3bcc3332ebceebf3029fa693026e06f5", "score": "0.63240916", "text": "def rocket_job_restart_abort\n return unless cron_schedule\n rocket_job_restart_new_instance\n update_attribute(:cron_schedule, nil)\n end", "title": "" }, { "docid": "cc65aebf6e3e2a438f11f65c7bb882a8", "score": "0.631571", "text": "def reload\n UI.info 'Restarting resque-pool...'\n restart\n end", "title": "" } ]
86259b2c50216615ea5a09d264faa3d6
create the stuffix for city and sttate. wiki cities are done in this format "Los_Angeles,_California" basically spaces are converted to underscores states are spelled out. caps for first letter of each word. there is an additional underscrore that prefix the state.
[ { "docid": "065f4a11b1a378fa887605f83a71449e", "score": "0.72027653", "text": "def url_suffix_create(state_code, city_name)\n # fetch state.\n state_name_full = StateUtil.abbv_to_state state_code\n \n # transform the state name.\n # there might be an issue with caps of non proper nouns.\n # names are in this format\n # _District_Of_Columbia\n # first letter is in caps and underscore in front of every word.\n state_name_full = state_name_full.split.map(&:capitalize).join(' ')\n state_name_full = state_name_full.gsub(/ /, '_')\n state_name_full = \"_\" + state_name_full\n \n # transform the city name.\n # Los_Angeles\n # caps for each word and underscore instead of space\n city_name_full = city_name.split.map(&:capitalize).join(' ')\n city_name_full = city_name_full.gsub(/ /, '_')\n \n # final url suffix\n city_name_full + \",\" + state_name_full\n end", "title": "" } ]
[ { "docid": "3f99b38f902ee97073fef45a8b7efb9a", "score": "0.69528973", "text": "def format_city_name\n # Capitalize first letter of each word\n # Convert remaining letters of each word to lower case\n # Remove leading and trailing white space\n # Reduce internal string of multiple white spaces to single white space\n # Preserve non-whitespace, non-word characters as-is (e.g. dashes)\n\n self.city = city.strip.gsub(/\\s\\s+/, ' ').gsub(/(\\w|å|ä|ö|Å|Ä|Ö)+/) do |word|\n word.mb_chars.capitalize.to_s\n end\n end", "title": "" }, { "docid": "eb83f12628ed7e26cf8bc2eb2471d9d3", "score": "0.688906", "text": "def city_suffix; end", "title": "" }, { "docid": "b1c52d29fe8c143d8b4a8312b88204a6", "score": "0.68261003", "text": "def city_state_name\n [city.to_s.titleize, state_abbr_name].compact.join(', ')\n end", "title": "" }, { "docid": "b1c52d29fe8c143d8b4a8312b88204a6", "score": "0.68261003", "text": "def city_state_name\n [city.to_s.titleize, state_abbr_name].compact.join(', ')\n end", "title": "" }, { "docid": "79d16195b5f238d1e1d4a721a5fdcac1", "score": "0.6711784", "text": "def titler\n str_list = self.city_town_name.split\n \n self.city_town_name = str_list.map { |word| word.capitalize\n word.split(\"-\").map{|w| w.capitalize }.join(\"-\")\n }.join(\" \")\n end", "title": "" }, { "docid": "2ed2999f028e893bf747d82b091eb4d0", "score": "0.6611585", "text": "def city_state_name\n [city, state_abbr_name].join(', ')\n end", "title": "" }, { "docid": "2ed2999f028e893bf747d82b091eb4d0", "score": "0.6611585", "text": "def city_state_name\n [city, state_abbr_name].join(', ')\n end", "title": "" }, { "docid": "fdb00b5e1a36a223133bfbe57dd93000", "score": "0.64561194", "text": "def convertCity(city)\n (city.split(\" \").collect do |word| \n word.capitalize \n end).join(\" \")\nend", "title": "" }, { "docid": "51abc8918dae876b1a27b68f7773734b", "score": "0.62401235", "text": "def normalize_city_name(city_name)\n city_name.strip.split(' ').join.downcase\nend", "title": "" }, { "docid": "282c699d54d295818ca8da99f025a307", "score": "0.6191065", "text": "def convert_city(chosen_city)\n city_words = chosen_city.downcase.split(\" \")\n city_words.join(\"_\")\n end", "title": "" }, { "docid": "9b1729ef64873197e254fcbc1d384649", "score": "0.61829466", "text": "def abbrev(s)\n s\n .sub(\"openSUSE\", \"oS\")\n .sub(\"SUSE Linux Enterprise Desktop\", \"SLED\")\n .sub(\"SUSE Linux Enterprise Server\", \"SLES\")\n .sub(\"SUSE Container as a Service Platform 1.0\", \"CaaSP1\")\n .sub(/\\(.*\\)/, \"\") # remove superfluous abbreviation\n .sub(\" SP\", \"-SP\")\n .sub(\" Factory\", \"-TW\") # Tumbleweed\n .tr(\" \", \"\")\nend", "title": "" }, { "docid": "fa8b514d312c5badf04b6dd12b1b237f", "score": "0.61059475", "text": "def full_state_name(state_short)\n case state_short\n when 'AL' then 'Alabama'\r\n when 'AK'\tthen 'Alaska'\r\n when 'AZ'\tthen 'Arizona'\r\n when 'AR'\tthen 'Arkansas'\r\n when 'CA'\tthen 'California'\r\n when 'CO'\tthen 'Colorado'\r\n when 'CT' then 'Connecticut'\r\n when 'DE' then 'Delaware'\r\n when 'FL' then 'Florida'\r\n when 'GA' then\t'Georgia'\r\n when 'HI' then 'Hawaii'\r\n when 'ID' then 'Idaho'\r\n when 'IL'\tthen 'Illinois'\r\n when 'IN' then 'Indiana'\r\n when 'IA' then 'Iowa'\r\n when 'KS' then 'Kansas'\r\n when 'KY' then 'Kentucky'\r\n when 'LA'\tthen 'Louisiana'\r\n when 'ME' then 'Maine'\r\n when 'MD' then 'Maryland'\r\n when 'MA' then 'Massachusetts'\r\n when 'MI'\tthen 'Michigan'\r\n when 'MN'\tthen 'Minnesota'\r\n when 'MS'\tthen 'Mississippi'\r\n when 'MO'\tthen 'Missouri'\r\n when 'MT'\tthen 'Montana'\r\n when 'NE'\tthen 'Nebraska'\r\n when 'NV'\tthen 'Nevada'\r\n when 'NH'\tthen 'New Hampshire'\r\n when 'NJ'\tthen 'New Jersey'\r\n when 'NM' then 'New Mexico'\r\n when 'NY'\tthen 'New York'\r\n when 'NC'\tthen 'North Carolina'\r\n when 'ND'\tthen 'North Dakota'\r\n when 'OH'\tthen 'Ohio'\r\n when 'OK'\tthen 'Oklahoma'\r\n when 'OR'\tthen 'Oregon'\r\n when 'PA'\tthen 'Pennsylvania'\r\n when 'RI' then 'Rhode Island'\r\n when 'SC'\tthen 'South Carolina'\r\n when 'SD'\tthen 'South Dakota'\r\n when 'TN' then 'Tennessee'\r\n when 'TX'\tthen 'Texas'\r\n when 'UT'\tthen 'Utah'\r\n when 'VT'\tthen 'Vermont'\r\n when 'VA'\tthen 'Virginia'\r\n when 'WA'\tthen 'Washington'\r\n when 'WV'\tthen 'West Virginia'\r\n when 'WI'\tthen 'Wisconsin'\r\n when 'WY'\tthen 'Wyoming'\r\n end\nend", "title": "" }, { "docid": "ba9b054d13f1c3f0ea21676850b84cb5", "score": "0.6050543", "text": "def street_suffix; end", "title": "" }, { "docid": "359682ce67cbf416b2c466e4cbc1a53c", "score": "0.6011183", "text": "def city_prefix; end", "title": "" }, { "docid": "236bde03626ca08cf7659e735846a36c", "score": "0.59993607", "text": "def city(string)\n tcs= /\\s/=~string\n tcs=tcs-1\n tcs=string[0..tcs]\n tcs=tcs.capitalize\n return tcs\nend", "title": "" }, { "docid": "6ae118c34cacc3fd541378905c3026e1", "score": "0.57589483", "text": "def state_full_name(state_code,flag = false)\n state = {\n 'AL' => 'Alabama',\n 'AK' => 'Alaska',\n 'AS' => 'America Samoa',\n 'AZ' => 'Arizona',\n 'AR' => 'Arkansas',\n 'CA' => 'California',\n 'CO' => 'Colorado',\n 'CT' => 'Connecticut',\n 'DE' => 'Delaware',\n 'DC' => 'District of Columbia',\n 'FM' => 'Micronesia1',\n 'FL' => 'Florida',\n 'GA' => 'Georgia',\n 'GU' => 'Guam',\n 'HI' => 'Hawaii',\n 'ID' => 'Idaho',\n 'IL' => 'Illinois',\n 'IN' => 'Indiana',\n 'IA' => 'Iowa',\n 'KS' => 'Kansas',\n 'KY' => 'Kentucky',\n 'LA' => 'Louisiana',\n 'ME' => 'Maine',\n 'MH' => 'Islands1',\n 'MD' => 'Maryland',\n 'MA' => 'Massachusetts',\n 'MI' => 'Michigan',\n 'MN' => 'Minnesota',\n 'MS' => 'Mississippi',\n 'MO' => 'Missouri',\n 'MT' => 'Montana',\n 'NE' => 'Nebraska',\n 'NV' => 'Nevada',\n 'NH' => 'New Hampshire',\n 'NJ' => 'New Jersey',\n 'NM' => 'New Mexico',\n 'NY' => 'New York',\n 'NC' => 'North Carolina',\n 'ND' => 'North Dakota',\n 'OH' => 'Ohio',\n 'OK' => 'Oklahoma',\n 'OR' => 'Oregon',\n 'PW' => 'Palau',\n 'PA' => 'Pennsylvania',\n 'PR' => 'Puerto Rico',\n 'RI' => 'Rhode Island',\n 'SC' => 'South Carolina',\n 'SD' => 'South Dakota',\n 'TN' => 'Tennessee',\n 'TX' => 'Texas',\n 'UT' => 'Utah',\n 'VT' => 'Vermont',\n 'VI' => 'Virgin Island',\n 'VA' => 'Virginia',\n 'WA' => 'Washington',\n 'WV' => 'West Virginia',\n 'WI' => 'Wisconsin',\n 'WY' => 'Wyoming'\n }\n code = if flag\n state.key(state_code).present? ? state.key(state_code) : state_code\n else\n state[state_code.upcase].present? ? state[state_code] : state_code\n end\n return code \n end", "title": "" }, { "docid": "ee4532105ec5bec8b1363fad56bef977", "score": "0.5745847", "text": "def century_suffix(century)\n return 'th' if [11, 12, 13].include?(century)\n\n case century\n when /1\\z/\n 'st'\n when /2\\z/\n 'nd'\n when /3\\z/\n 'rd'\n else\n 'th'\n end\nend", "title": "" }, { "docid": "38c328a6ff50ddea9e1775abd509d916", "score": "0.57343966", "text": "def unambiguous_name\n name = [town.name]\n if can_disambiguate? && town.duplicates.to_i > 0\n name << \"(#{town.county_name})\"\n end\n name.join(' ')\n end", "title": "" }, { "docid": "1a0fc2880a17c07de7d9a113211674b0", "score": "0.5722932", "text": "def url_create(state_code, city_name)\n 'http://en.m.wikipedia.org/wiki/' + self.url_suffix_create(state_code, city_name)\n end", "title": "" }, { "docid": "dcd96d15113f33f6e77c0201b727cf10", "score": "0.57092005", "text": "def half_wind_abbreviation; end", "title": "" }, { "docid": "c0424f4b65dd34452717a433e76e58ab", "score": "0.5705373", "text": "def uppercase_name\n self.name = name.split.map(&:capitalize).join(' ')\n self.location = location.split.map(&:capitalize).join(' ')\n end", "title": "" }, { "docid": "37d65ea52fe4c684fc522d09eee9b84e", "score": "0.57029444", "text": "def short_country_name(name)\n if name.include? ' '\n temp = name.split(' ')\n temp[0][0] + temp[1][0]\n else\n name[0..2].upcase\n end\nend", "title": "" }, { "docid": "37d65ea52fe4c684fc522d09eee9b84e", "score": "0.57029444", "text": "def short_country_name(name)\n if name.include? ' '\n temp = name.split(' ')\n temp[0][0] + temp[1][0]\n else\n name[0..2].upcase\n end\nend", "title": "" }, { "docid": "b3aa003d9db71ce6a2678ce87eb5f3ac", "score": "0.5669664", "text": "def city_name\n\t\treturn \"Mysore\"\n\tend", "title": "" }, { "docid": "17c7feaf29ba06e40d1c0cfb9178bf35", "score": "0.5669353", "text": "def citystate\n @cs = ''\n\n if !self.city.nil?\n @cs += self.city\n end\n\n if @cs.length && !self.state.nil?\n @cs += ', '\n end\n\n if !self.state.nil?\n @cs += self.state\n end\n return @cs\n end", "title": "" }, { "docid": "567f30e564abfdb62b3f06ba03cca786", "score": "0.5659757", "text": "def name_with_location\n return \"#{self.name} in #{self.city.name}, #{self.state.abbreviation}\"\n end", "title": "" }, { "docid": "1ce40a3680c473316c1861b6b9bb50a0", "score": "0.56250197", "text": "def century_suffix(century)\n case\n when century.end_with?(*%w(11 12 13)) then 'th'\n when century.end_with?('1') then 'st'\n when century.end_with?('2') then 'nd'\n when century.end_with?('3') then 'rd'\n else 'th'\n end\nend", "title": "" }, { "docid": "dd3076d9c2263b666c3a79bb5623fdbd", "score": "0.55899113", "text": "def full_name\n name = first_name.strip # required\n name << \" #{middle_name.strip}\" if !middle_name.nil?\n name << \" #{last_name.strip}\" # required\n name << \" #{mother_last_name.strip}\" if !mother_last_name.nil?\n\n # capitalize each word and return the capitalized version\n name.split.map(&:capitalize).join(' ')\n end", "title": "" }, { "docid": "0284d313f8df9f9b43ded64ef372ebf5", "score": "0.55604357", "text": "def abbrev_name(name)\r\n # name.split.map { |s| s[0]}.join('.').upcase\r\n # name.upcase.split.map(&:chr).join\".\"\r\n \r\n newname = name.split(' ')\r\n newname[0][0].capitalize + '.' + newname[1][0].capitalize\r\nend", "title": "" }, { "docid": "166587e2a33719e817d60baf90394ad4", "score": "0.55557644", "text": "def format_name(first, last)\n(First[0]+last).downcase\nend", "title": "" }, { "docid": "8d2e10ba338fbb5a3a3c19360ef83600", "score": "0.5548271", "text": "def decode_county\n\t#\tcase county_code.to_s.slice(-2,2)\n\t#\twhat if '01' or '1' or 1 or '12341234123401'\n\t\tcase sprintf('%02d',self.to_i).to_s.slice(-2,2).to_i\n\t#\t\twhen 0 then the given state code was all text\n\t\t\twhen 1 then 'Alameda'\n\t\t\twhen 2 then 'Alpine'\n\t\t\twhen 3 then 'Amador'\n\t\t\twhen 4 then 'Butte' \n\t\t\twhen 5 then 'Calaveras' \n\t\t\twhen 6 then 'Colusa' \n\t\t\twhen 7 then 'Contra Costa' \n\t\t\twhen 8 then 'Del Norte' \n\t\t\twhen 9 then 'El Dorado'\n\t\t\twhen 10 then 'Fresno'\n\t\t\twhen 11 then 'Glenn' \n\t\t\twhen 12 then 'Humboldt' \n\t\t\twhen 13 then 'Imperial' \n\t\t\twhen 14 then 'Inyo' \n\t\t\twhen 15 then 'Kern' \n\t\t\twhen 16 then 'Kings'\n\t\t\twhen 17 then 'Lake' \n\t\t\twhen 18 then 'Lassen' \n\t\t\twhen 19 then 'Los Angeles' \n\t\t\twhen 20 then 'Madera' \n\t\t\twhen 21 then 'Marin' \n\t\t\twhen 22 then 'Mariposa' \n\t\t\twhen 23 then 'Mendocino' \n\t\t\twhen 24 then 'Merced' \n\t\t\twhen 25 then 'Modoc' \n\t\t\twhen 26 then 'Mono' \n\t\t\twhen 27 then 'Monterey' \n\t\t\twhen 28 then 'Napa' \n\t\t\twhen 29 then 'Nevada'\n\t\t\twhen 30 then 'Orange'\n\t\t\twhen 31 then 'Placer'\n\t\t\twhen 32 then 'Plumas'\n\t\t\twhen 33 then 'Riverside'\n\t\t\twhen 34 then 'Sacramento'\n\t\t\twhen 35 then 'San Benito'\n\t\t\twhen 36 then 'San Bernardino'\n\t\t\twhen 37 then 'San Diego' \n\t\t\twhen 38 then 'San Francisco' \n\t\t\twhen 39 then 'San Joaquin'\n\t\t\twhen 40 then 'San Luis Obispo'\n\t\t\twhen 41 then 'San Mateo'\n\t\t\twhen 42 then 'Santa Barbara'\n\t\t\twhen 43 then 'Santa Clara'\n\t\t\twhen 44 then 'Santa Cruz'\n\t\t\twhen 45 then 'Shasta'\n\t\t\twhen 46 then 'Sierra'\n\t\t\twhen 47 then 'Siskiyou'\n\t\t\twhen 48 then 'Solano'\n\t\t\twhen 49 then 'Sonoma'\n\t\t\twhen 50 then 'Stanislaus'\n\t\t\twhen 51 then 'Sutter'\n\t\t\twhen 52 then 'Tehama'\n\t\t\twhen 53 then 'Trinity'\n\t\t\twhen 54 then 'Tulare'\n\t\t\twhen 55 then 'Tuolumne'\n\t\t\twhen 56 then 'Ventura'\n\t\t\twhen 57 then 'Yolo'\n\t\t\twhen 58 then 'Yuba'\n\t\t\telse self.to_s.squish.namerize\n\t\tend\n\tend", "title": "" }, { "docid": "e616282991296fbbcc62951501c06aa6", "score": "0.5520081", "text": "def city_state_zip\n [city_state_name, zip_code].join(' ')\n end", "title": "" }, { "docid": "e616282991296fbbcc62951501c06aa6", "score": "0.5520081", "text": "def city_state_zip\n [city_state_name, zip_code].join(' ')\n end", "title": "" }, { "docid": "e616282991296fbbcc62951501c06aa6", "score": "0.5520081", "text": "def city_state_zip\n [city_state_name, zip_code].join(' ')\n end", "title": "" }, { "docid": "e616282991296fbbcc62951501c06aa6", "score": "0.5520081", "text": "def city_state_zip\n [city_state_name, zip_code].join(' ')\n end", "title": "" }, { "docid": "911c0016e1880bd275ebffa8983327d4", "score": "0.55196464", "text": "def format_name(first, last)\n return nil if first.empty? || last.empty?\n first.gsub! (/[^a-z]/i, \"\")\n last.gsub! (/[^a-z]/i, \"\")\n ((first.split(\" \").join[0]<<last).split(\" \").join.downcase)\n\nend", "title": "" }, { "docid": "8a1a452ec4bb5b693bd6e4ba1fd67eec", "score": "0.5516937", "text": "def city_code(name)\n return nil unless name\n name_array = name.downcase.strip.split\n if name_array.size > 1\n convert_name(name_array.join(\" \"), 2)\n else\n name = name_array[0]\n \"#{name[0..1]}#{name[-2..-1]}\".upcase\n end\n end", "title": "" }, { "docid": "1726cf5f2e736ee1866abd6f6e52826e", "score": "0.5499094", "text": "def profile_home(city,state)\n if !city.blank?\n address = city.humanize\n if !state.blank?\n address << \", \" \n address << state.humanize\n end\n return address \n end \n end", "title": "" }, { "docid": "1a3bb69d6159bc89afe7afaa00a51011", "score": "0.5432998", "text": "def short_place_name\n # Drop the last word, it is always the legal description.\n words = place_name.split\n words.slice!(-1) if words.size > 1\n words.join(' ')\n end", "title": "" }, { "docid": "08dd46930eaf9417a8a7d1518fede71f", "score": "0.5428727", "text": "def get_clean_city_name(city_with_abbr)\n if city_with_abbr\n city_name_match = city_with_abbr.match(/([A-Za-zçã\\s]*).*/)\n city_name_match = city_name_match[1] if city_name_match\n end\n return city_name_match\n end", "title": "" }, { "docid": "9ae944051b168e68b9e4bbd638230219", "score": "0.54167974", "text": "def surnameize\n s = slice(0, 2).upcase\n if s == 'MC' || s == \"O'\"\n s.titleize + slice(2..-1).titleize\n else\n titleize\n end\n end", "title": "" }, { "docid": "5646e1c83dc5bcd75b33ea2dd1c4c47f", "score": "0.54049087", "text": "def public_location\n\t\tself.city.capitalize + \", \" + self.state.upcase\n\tend", "title": "" }, { "docid": "e39f3076f037daedbac4cfac6eb11342", "score": "0.53852504", "text": "def modif_town_hall_name(all_town_hall)\n i = 0\n while i != all_town_hall.length\n all_town_hall[i] = all_town_hall[i].downcase!.split.join('-')\n i += 1\n end\n return all_town_hall\nend", "title": "" }, { "docid": "960c24c10a45cc54a4648d0aa6176491", "score": "0.538058", "text": "def cities_for_solr\n\t\t # if there is a default_contactinfo for that role_contactinfo contactinfo\n\t\t # initialize contactinfo based on default_contactinfo fields and then\n\t\t # index the contactinfo field to default\n \tdefault_contactinfo = get_default_contactinfo\n\t\t contactinfo.initialize_contactinfo_associated_with_another_contactinfo( default_contactinfo ) unless default_contactinfo.blank?\n\t\t \n return \"#{FinderHelper.strip(contactinfo.locality)} - #{FinderHelper.strip(contactinfo.suburb)} \"\n end", "title": "" }, { "docid": "7999dd51d2dfefcced851cfca307415c", "score": "0.5369034", "text": "def build_status city_or_county, state, num_killed, num_injured, url\n status = \"#{city_or_county}, #{state}: \"\n\n if num_killed.zero? && num_injured.zero?\n status.concat('no one was hurt. ')\n elsif num_killed.zero?\n status.concat(\"#{num_injured} \")\n .concat('person'.pluralize(num_injured))\n .concat(' injured. ')\n elsif num_injured.zero?\n status.concat(\"#{num_killed} \")\n .concat('person'.pluralize(num_killed))\n .concat(' killed. ')\n else\n status.concat(\"#{num_killed} \")\n .concat('person'.pluralize(num_killed))\n .concat(' killed and ')\n .concat(\"#{num_injured} \")\n .concat('person'.pluralize(num_injured))\n .concat(' injured. ')\n end\n\n status.concat(\"Full report: #{url}\")\n end", "title": "" }, { "docid": "4719877e5ed3a2a84e56422930828a56", "score": "0.5365883", "text": "def format_name(first, last)\n\treturn nil if first.empty? || last.empty?\n (first.gsub(/[\\W0-9_]/, \"\")[0] + last.gsub(/[\\W0-9_]/, \"\")).downcase\nend", "title": "" }, { "docid": "8b403df3708b49513941b2e5a3924888", "score": "0.5362066", "text": "def state_abbrev\n # user_state = self.addresses.first.state.name\n # REGIONS.named(user_state).code\n return self.addresses.first.state.abbrev_name unless self.addresses.first.nil?\n '-'\n end", "title": "" }, { "docid": "3c2eb033715216378eb387a3b5825b2f", "score": "0.5335054", "text": "def format_name(first, last)\nif first.length<1 || last.length<1\n\tnil\nelse\n first = first.split.join\n last = last.split.join\n str = (first[0]+last).downcase.gsub(/[^0-9a-z]/i, '')\nend\nend", "title": "" }, { "docid": "e34ca03f4e0babf7bf8940c948348f3e", "score": "0.532621", "text": "def to_s_with_city\n \"#{location_name}/#{zip} #{city}\"\n end", "title": "" }, { "docid": "999205dfa7efe25448b7f63a2e9ed199", "score": "0.5321656", "text": "def format_name(first, last)\n return nil if last.empty? || first.empty?\n first = first.gsub(/[^A-Za-z]/, '')\n last = last.gsub(/[^A-Za-z]/, '')\n (first[0] + last).downcase\nend", "title": "" }, { "docid": "999205dfa7efe25448b7f63a2e9ed199", "score": "0.5321656", "text": "def format_name(first, last)\n return nil if last.empty? || first.empty?\n first = first.gsub(/[^A-Za-z]/, '')\n last = last.gsub(/[^A-Za-z]/, '')\n (first[0] + last).downcase\nend", "title": "" }, { "docid": "b8cd4afb4b8e6d6d518c60060880fb94", "score": "0.53212327", "text": "def uppercase\n self.street_name.upcase!\n self.street_direction.upcase!\n end", "title": "" }, { "docid": "3248ec77f897bc2297d6f9aaef5892e4", "score": "0.5319115", "text": "def state_country_name\n [state_abbr_name, country.try(:name)].compact.join(', ')\n end", "title": "" }, { "docid": "3248ec77f897bc2297d6f9aaef5892e4", "score": "0.5319115", "text": "def state_country_name\n [state_abbr_name, country.try(:name)].compact.join(', ')\n end", "title": "" }, { "docid": "558160fb9209214ad5a5516dc2ac8228", "score": "0.53169787", "text": "def abbrev_name(name)\n \"#{name[0]}.#{name.split[1][0]}\".upcase\nend", "title": "" }, { "docid": "f912eb2a4dfb14ace467c3327b538916", "score": "0.5313317", "text": "def cities_helper\n [\n ['基隆市', '基隆市'],\n ['台北市', '台北市'],\n ['新北市', '新北市'],\n ['桃園縣', '桃園縣'],\n ['新竹市', '新竹市'],\n ['新竹縣', '新竹縣'],\n ['苗栗縣', '苗栗縣'],\n ['台中市', '台中市'],\n ['彰化縣', '彰化縣'],\n ['南投縣', '南投縣'],\n ['雲林縣', '雲林縣'],\n ['嘉義市', '嘉義市'],\n ['嘉義縣', '嘉義縣'],\n ['台南市', '台南市'],\n ['高雄市', '高雄市'],\n ['屏東縣', '屏東縣'],\n ['台東縣', '台東縣'],\n ['花蓮縣', '花蓮縣'],\n ['宜蘭縣', '宜蘭縣'],\n ['澎湖縣', '澎湖縣'],\n ['金門縣', '金門縣'],\n ['連江縣', '連江縣']\n ]\n end", "title": "" }, { "docid": "e9e119b682d1ccae7902ae246833616b", "score": "0.53103244", "text": "def two_word_name; end", "title": "" }, { "docid": "ab0cf691acd21c1d207fadd5852dcce6", "score": "0.52942103", "text": "def format_name(first, last)\n\tf_return = \"\"\n\tl_return = \"\"\n\tif first[0]\n\t\tf_return = first.gsub(\" \", \"\")\n\t\tf_return =f_return.gsub(/[^A-Za-z]/, '')\n\t\tf_return = f_return[0].downcase\n\telse\n\t\tf_return = \"\"\n\tend\n\tif last[0]\n\t\tl_return = last.gsub(\" \", \"\")\n\t\tl_return = l_return.gsub(/[^A-Za-z]/, '')\n\t\tl_return.downcase!\n\telse\n\t\tlast = \"\"\n\tend\n if f_return[0] && l_return[0]\n \treturn f_return+l_return\n else\n \treturn nil\n end\nend", "title": "" }, { "docid": "f986dfcbed23c84eec56f4318b0bc1ce", "score": "0.52899903", "text": "def studly(s)\n s.gsub(/_(\\w)/) do |match|\n match.sub! '_', ''\n match.upcase\n end\n end", "title": "" }, { "docid": "3e780aa210e8444234303df8505f599b", "score": "0.5287544", "text": "def cleanup_place\n if place\n normalized_place = place.to_s.dup\n normalized_place.upcase!\n normalized_place.gsub!(\"ST\", \"\")\n normalized_place.gsub!(\"ND\", \"\")\n normalized_place.gsub!(\"RD\", \"\")\n normalized_place.gsub!(\"TH\", \"\")\n normalized_place.delete!(\")\")\n normalized_place = normalized_place.to_i.to_s if normalized_place[/^\\d+\\.0$/]\n normalized_place.strip!\n normalized_place.delete!(\".\")\n self.place = normalized_place\n else\n self.place = \"\"\n end\n end", "title": "" }, { "docid": "fd1955cb4d05a76c070adb8da5d05249", "score": "0.5283539", "text": "def abbrev\n dept_abbr.strip\n end", "title": "" }, { "docid": "fa407e8d035ab51f6f3a3e4a3e586243", "score": "0.5261187", "text": "def fix_capitalized_species_epithet(str)\n # Is second word capitalized?\n return str unless str.match?(/^\\S+ [A-Z]/)\n\n # Trust it if there is actually a name with that author present.\n return str if Name.find_by(search_name: str).present?\n\n # Try converting second word to lowercase.\n str2 = str.sub(/ [A-Z]/, &:downcase)\n\n # Return corrected name if that name exists, else keep original name.\n if Name.where(search_name: str2).or(Name.where(text_name: str2)).present?\n str2\n else\n str\n end\n end", "title": "" }, { "docid": "3a67ba160eba508cb09421eabb931f76", "score": "0.52572495", "text": "def setup_full_name\n self.full_name = \"#{country.name}, #{city}, \" <<\n \"#{street_address1}#{', ' << street_address2 if !(street_address2.nil? or street_address2.blank?)}\" <<\n \"#{', ' << zip if !(zip.nil? or zip.blank?)}, \" <<\n \"#{phone} #{' / ' << extra_phone if !(extra_phone.nil? or extra_phone.blank?)}\"\n end", "title": "" }, { "docid": "2e7ee023c88d8d5cd5e5d1ab82c897ad", "score": "0.52518713", "text": "def assign_quick_city_name(hash,name)\n corrected_name = name.strip.titleize\n if[\n \"Houston\",\n \"Katy\",\n \"Spring\",\n \"Austin\",\n \"Sugar Land\",\n \"Blanco\",\n \"Portland\",\n \"Brenham\",\n \"Conroe\",\n \"Meadows Place\",\n \"League City\",\n \"Pearland\",\n \"College Station\",\n \"Sugarland\",\n \"Bee Cave\",\n \"Round Rock\",\n \"Beecave\",\n \"San Marcos\",\n \"San Antonio\"].include? corrected_name\n hash[:city] = corrected_name\n else\n return false\n end\n true\n end", "title": "" }, { "docid": "0433c0674f97e61196eda3dff30265f1", "score": "0.5250566", "text": "def districts_helper(city)\n districts =\n {\n \"基隆市\" => [\n ['仁愛區'],\n ['信義區'],\n ['中正區'],\n ['中山區'],\n ['安樂區'],\n ['暖暖區'],\n ['七堵區']\n ],\n \"台北市\" => [\n ['中正區'],\n ['大同區'],\n ['中山區'],\n ['松山區'],\n ['大安區'],\n ['萬華區'],\n ['信義區'],\n ['士林區'],\n ['北投區'],\n ['內湖區'],\n ['南港區'],\n ['文山區'],\n ]\n }\n districts[\"#{city}\"]\n end", "title": "" }, { "docid": "0e404d6d9bdb267b6976d348c29113dd", "score": "0.52492803", "text": "def geograpy(city, state)\n puts \"#{city} is the capital of #{state}.\"\nend", "title": "" }, { "docid": "127ccbf65f58ddaf412acbea0c634c05", "score": "0.52488804", "text": "def title_case(title, minor_words = '')\n title.capitalize.split().map{|a| minor_words.downcase.split().include?(a) ? a : a.capitalize}.join(' ')\nend", "title": "" }, { "docid": "d5208a877fed5d8e8757ee1334bc1255", "score": "0.52458054", "text": "def format_name(first, last)\n if first.empty? || last.empty?\n nil\n else\n formatted_first = first.delete(' ')\n formatted_last = last.delete(' ')\n return (formatted_first[0] + formatted_last).downcase\n end\nend", "title": "" }, { "docid": "93235893b3f8a6db609e4c597927a202", "score": "0.5241478", "text": "def format_name(first, last)\n first.gsub!(/\\d|\\W|_/, \"\")\n last.gsub!(/\\d|\\W|_/, \"\")\n if first.empty? || last.empty?\n nil\n else\n first.split(\" \").join.downcase[0] + last.split(\" \").join.downcase\n end\nend", "title": "" }, { "docid": "0036604ed794ed87c1092a4702157bf6", "score": "0.5240459", "text": "def title_case(title, minor_words = '')\n return '' if title.empty?\n \n title.downcase.split(' ').map.with_index do |word, idx|\n minor_words.downcase.split(' ').include?(word) && idx != 0 ? word : word.capitalize\n end.join(' ')\nend", "title": "" }, { "docid": "6895890faa871e0f1c158c45147324ac", "score": "0.52225304", "text": "def shout (maj)\n maj.upcase\nend", "title": "" }, { "docid": "baf6d5c367c5af79fff0393564f8a6d9", "score": "0.5215496", "text": "def full_name\n new_name = first_name.capitalize + \" \" + last_name.capitalize\n final_name = new_name.split(' ').each(&:capitalize!).join(' ')\n end", "title": "" }, { "docid": "eeee0430df4d25eb7c2ea503b2ad6b43", "score": "0.5215412", "text": "def band_name(name)\n return name.to_s.capitalize << name.to_s[1..-1] if name[0] == name[-1]\n\n article = 'The'\n article << ' ' << name.to_s.capitalize\nend", "title": "" }, { "docid": "32d052425ffe495eab75c97277da7e0d", "score": "0.5209887", "text": "def format_town_county_postcode(output, prefix)\n output[\"#{prefix}:AddressTownOrCity\"] = town\n xml_element_if_present(output, \"#{prefix}:AddressCountyOrRegion\", county)\n xml_element_if_present(output, \"#{prefix}:AddressPostcodeOrZip\", postcode)\n xml_element_if_present(output, \"#{prefix}:AddressCountryCode\", country)\n xml_element_if_present(output, \"#{prefix}:QASMoniker\", address_identifier)\n end", "title": "" }, { "docid": "7f0bda4670d3382dfd12d10756f7a4d9", "score": "0.52079856", "text": "def title_case title, minors=\"\"\n sentence = title.downcase.split()\n minor_words = minors.downcase.split()\n\n sentence.map.with_index do |word,i|\n minor_words.include?(word) && i!= 0 ? word : word.capitalize\n end.join(' ')\nend", "title": "" }, { "docid": "2ce367388c1ad7a54150cf119d2a35de", "score": "0.52028173", "text": "def format_name(first, last)\n if (first.empty? || last.empty?)\n nil\n else\n (first.gsub(/\\s+/, '')[0]+last.gsub(/\\s+/, '')).downcase\n end\nend", "title": "" }, { "docid": "5eddf7a3b8d4468ada777ef2bf9540dc", "score": "0.5202597", "text": "def district_name(name)\n if name.to_s[/\\A[\\dA-Z]+\\z/]\n \"District #{name}\"\n else\n name\n end\n end", "title": "" }, { "docid": "f921dab510fe1acee5c574f24ba4a390", "score": "0.51941353", "text": "def word_replace word, first_word\n if word =~ /^[A-Z]*$/ then\n \"_PROPER_\"#proper names\n elsif word =~ /^[A-Z|\\.]*$/ then\n if first_word then\n \"_FIRST_\"\n else\n \"_FNOCO_\" #first name or companies\n end\n elsif word =~ /^[A-Z].+$/ then\n if first_word then\n \"_FIRST_NAME_\"\n else\n \"_NAME_\"\n end\n elsif word =~ /^[0-9|\\-]*$/ then\n \"_NUM_\" #number\n else\n \"_RARE_\"\n end\nend", "title": "" }, { "docid": "2c83b08335414d1a565b29a92f2fd62a", "score": "0.51930135", "text": "def abbr_name\n return first_name + \" \" + last_name[0..0]\n end", "title": "" }, { "docid": "bbf0f6268f569c1338751096c9f30698", "score": "0.51856", "text": "def century_suffix(century)\n return 'th' if [11, 12, 13].include? century % 100\n last_digit = century % 10 # key to validating 1, 2, 3 1\n\n case last_digit\n when 1 then 'st'\n when 2 then 'nd'\n when 3 then 'rd'\n else 'th'\n end\nend", "title": "" }, { "docid": "f9529fddb09b00fa31cfd33fa65325a0", "score": "0.5181373", "text": "def titlify(s)\n s.split(/[ _]/).map(&:capitalize).join(' ')\nend", "title": "" }, { "docid": "ff146a50c065f9773813eacc665dc890", "score": "0.5178849", "text": "def century(year)\n # create century_str--------------\n if year.to_s.end_with?('00')\n century_str = year / 100\n else\n century_str = year / 100 + 1\n end\n century_str = century_str.to_s\n # --------------------------------\n\n # create suffix-------------------\n suffix = nil\n\n if century_str.length == 1\n if century_str == '1'\n suffix = 'st'\n elsif century_str == '2'\n suffix = 'nd'\n elsif century_str == '3'\n suffix = 'rd'\n else\n suffix = 'th'\n end\n\n elsif century_str.length < 4\n if century_str.reverse[1] == '1'\n suffix = 'th'\n elsif century_str.end_with?('1')\n suffix = 'st'\n elsif century_str.end_with?('2')\n suffix = 'nd'\n elsif century_str.end_with?('3')\n suffix = 'rd'\n else\n suffix = 'th'\n end\n\n elsif century_str.length == 3\n # case century_str\n # end\n end\n # --------------------------------\n\n result = \"#{century_str}#{suffix}\"\n\n\n\n p result\nend", "title": "" }, { "docid": "fbf28061aabb15e6c8bc335c4e7ede4c", "score": "0.5176769", "text": "def abbreviation; end", "title": "" }, { "docid": "fbf28061aabb15e6c8bc335c4e7ede4c", "score": "0.5176769", "text": "def abbreviation; end", "title": "" }, { "docid": "fbf28061aabb15e6c8bc335c4e7ede4c", "score": "0.5176769", "text": "def abbreviation; end", "title": "" }, { "docid": "fbf28061aabb15e6c8bc335c4e7ede4c", "score": "0.5176769", "text": "def abbreviation; end", "title": "" }, { "docid": "2cf13c992eee4e903f6b0abce959988a", "score": "0.5173659", "text": "def get_abbr\n s = @name.split(\" \")\n if s.length > 1\n [s[0][0].chr,s[-1][0].chr].map(&:upcase).join\n else\n s[0][0..1].upcase\n end\n end", "title": "" }, { "docid": "e5481b5e33aa409a5cc1a16268b1abe1", "score": "0.5171068", "text": "def uppercase_fields\n\t self.fname.capitalize!\n\t self.lname.capitalize!\n\t self.address.capitalize!\n\t self.city.capitalize!\n\t self.state.upcase!\n\t self.email.downcase!\n\t # self.area.capitalize!\n\t self.discipline.capitalize!\n\tend", "title": "" }, { "docid": "c8cf5b12954f10c897d4eacccfd5107c", "score": "0.5165822", "text": "def decode_state_abbrev\n\t#\tcase state_code.to_s.slice(-2,2)\n\t#\twhat if '5' or '05' or '105' or 5 or 105 or 1234123405?\n\t\tcase sprintf('%02d',self.to_i).to_s.slice(-2,2).to_i\n\t#\t\twhen 0 then the given state code was all text\n\t\t\twhen 1 then 'AL'\n\t\t\twhen 2 then 'AK'\n\t\t\twhen 3 then 'AZ'\n\t\t\twhen 4 then 'AR' \n\t\t\twhen 5 then 'CA' \n\t\t\twhen 6 then 'CO' \n\t\t\twhen 7 then 'CT' \n\t\t\twhen 8 then 'DE' \n\t\t\twhen 9 then 'DC'\n\t\t\twhen 10 then 'FL'\n\t\t\twhen 11 then 'GA' \n\t\t\twhen 12 then 'HI' \n\t\t\twhen 13 then 'ID' \n\t\t\twhen 14 then 'IL' \n\t\t\twhen 15 then 'IN' \n\t\t\twhen 16 then 'IA'\n\t\t\twhen 17 then 'KS' \n\t\t\twhen 18 then 'KY' \n\t\t\twhen 19 then 'LA' \n\t\t\twhen 20 then 'ME' \n\t\t\twhen 21 then 'MD' \n\t\t\twhen 22 then 'MA' \n\t\t\twhen 23 then 'MI' \n\t\t\twhen 24 then 'MN' \n\t\t\twhen 25 then 'MS' \n\t\t\twhen 26 then 'MO' \n\t\t\twhen 27 then 'MT' \n\t\t\twhen 28 then 'NE' \n\t\t\twhen 29 then 'NV'\n\t\t\twhen 30 then 'NH'\n\t\t\twhen 31 then 'NJ'\n\t\t\twhen 32 then 'NM'\n\t\t\twhen 33 then 'NY'\n\t\t\twhen 34 then 'NC'\n\t\t\twhen 35 then 'ND'\n\t\t\twhen 36 then 'OH'\n\t\t\twhen 37 then 'OK' \n\t\t\twhen 38 then 'OR' \n\t\t\twhen 39 then 'PA'\n\t\t\twhen 40 then 'RI'\n\t\t\twhen 41 then 'SC'\n\t\t\twhen 42 then 'SD'\n\t\t\twhen 43 then 'TN'\n\t\t\twhen 44 then 'TX'\n\t\t\twhen 45 then 'UT'\n\t\t\twhen 46 then 'VT'\n\t\t\twhen 47 then 'VA'\n\t\t\twhen 48 then 'WA'\n\t\t\twhen 49 then 'WV'\n\t\t\twhen 50 then 'WI'\n\t\t\twhen 51 then 'WY'\n\t\t\telse self.to_s.squish.upcase\n\t\tend\n\tend", "title": "" }, { "docid": "7a3af057f8facad1b2f6c7825d066859", "score": "0.51639205", "text": "def bystate(str)\n arr = str.to_s.delete(',').split(\"\\n\").sort\n answer = []\n lastState = ''\n lookup = [\n ['AZ','Arizona'],\n ['CA', 'California'],\n ['ID', 'Idaho'],\n ['IN', 'Indiana'], \n ['MA', 'Massachusetts'],\n ['OK', 'Oklahoma'], \n ['PA', 'Pennsylvania'],\n ['VA', 'Virginia']]\n lookup.each do |abbreviation, name|\n while arr.find { |e| /#{abbreviation}/ =~ e } \n foundString = arr.find { |e| (/#{abbreviation}/ =~ e)}\n foundReplaced = \"\\r\\n..... \" + foundString.gsub(/#{abbreviation}/, \"\") + name\n \n if lastState == ''\n answer.concat(Array.new(1, (name + foundReplaced)))\n elsif lastState == name\n answer.concat(Array.new(1, (foundReplaced)))\n else\n answer.concat(Array.new(1, (\"\\r\\n \" + name + \"\\r\\n..... \" + foundString.gsub(/#{abbreviation}/, name))))\n end\n arr = arr.reject{|i| i == foundString}\n lastState = name\n end\n end\n answer.join(\"\")\nend", "title": "" }, { "docid": "4e539368cdf65c14a18e08f6beade600", "score": "0.5163296", "text": "def format_name(first, last)\n if last == '' || first == ''\n word = nil\n else\n user_name = ''\n user_name += first.gsub(' ', '').gsub(/[^0-9A-Za-z]/, '')[0]\n user_name += (last.gsub(' ','').gsub(/[^0-9A-Za-z]/, ''))\n user_name.gsub(/\\d/, '').downcase\n end\nend", "title": "" }, { "docid": "615df74e22a094370b22952030628ede", "score": "0.5156775", "text": "def suggest_def_name(how)\n how.gsub!(/_+/,'_') # double underscores to one\n how.gsub!(/^_/, '') # if it begins with undrscore kill it.\n how.gsub!(/\\s+/, '_') # kill spaces if for some strange reason exist\n how = how[0,1].downcase << how[1,how.size] #downcase firs char\n end", "title": "" }, { "docid": "dd6306899854a18263f4d870b5f88cb4", "score": "0.51456934", "text": "def city_state_country(addr, opts = { :zip => true})\n addr = addr.airport if(addr.airport? && addr.airport )\n zip = addr.zip if opts[:zip] and addr.respond_to?('zip')\n ci_st_co = [addr.city, addr.state, zip, addr.country].delete_if{ |a| a.blank? }\n ci_st_co.join(', ').sub(/, United States$/, '')\n end", "title": "" }, { "docid": "84ef500b696da3e34dee450e2a082c49", "score": "0.51421195", "text": "def undersingularize(noun)\n noun.to_s.underscore.singularize.downcase\n end", "title": "" }, { "docid": "95386dd2bbeae1e1bcb21c0fe9546f69", "score": "0.5140934", "text": "def abbrev\n letter = case @function \n when :pawn then 'p' \n when :knight then 'n'\n else @function.to_s[0,1]\n end\n return letter.send( @side==:white ? :upcase : :downcase )\n end", "title": "" }, { "docid": "400e174515ec2c0316ebec21820aaacc", "score": "0.5140869", "text": "def location\n [city, state, zip_code].join(\" \")\n end", "title": "" }, { "docid": "400e174515ec2c0316ebec21820aaacc", "score": "0.5140869", "text": "def location\n [city, state, zip_code].join(\" \")\n end", "title": "" }, { "docid": "400e174515ec2c0316ebec21820aaacc", "score": "0.5140869", "text": "def location\n [city, state, zip_code].join(\" \")\n end", "title": "" }, { "docid": "5dd7dede3ac9fca10e3271b457f4d96d", "score": "0.51406556", "text": "def make_name(template, clim, building_type, spc_type)\n clim = clim.gsub('ClimateZone ', 'CZ')\n if clim == 'CZ1-8'\n clim = ''\n end\n\n if building_type == 'FullServiceRestaurant'\n building_type = 'FullSrvRest'\n elsif building_type == 'Hospital'\n building_type = 'Hospital'\n elsif building_type == 'LargeHotel'\n building_type = 'LrgHotel'\n elsif building_type == 'LargeOffice'\n building_type = 'LrgOffice'\n elsif building_type == 'MediumOffice'\n building_type = 'MedOffice'\n elsif building_type == 'Mid-riseApartment'\n building_type = 'MidApt'\n elsif building_type == 'Office'\n building_type = 'Office'\n elsif building_type == 'Outpatient'\n building_type = 'Outpatient'\n elsif building_type == 'PrimarySchool'\n building_type = 'PriSchl'\n elsif building_type == 'QuickServiceRestaurant'\n building_type = 'QckSrvRest'\n elsif building_type == 'Retail'\n building_type = 'Retail'\n elsif building_type == 'SecondarySchool'\n building_type = 'SecSchl'\n elsif building_type == 'SmallHotel'\n building_type = 'SmHotel'\n elsif building_type == 'SmallOffice'\n building_type = 'SmOffice'\n elsif building_type == 'StripMall'\n building_type = 'StMall'\n elsif building_type == 'SuperMarket'\n building_type = 'SpMarket'\n elsif building_type == 'Warehouse'\n building_type = 'Warehouse'\n end\n\n parts = [template]\n\n unless building_type.empty?\n parts << building_type\n end\n\n unless spc_type.nil?\n parts << spc_type\n end\n\n unless clim.empty?\n parts << clim\n end\n\n result = parts.join(' - ')\n\n @created_names << result\n\n return result\n end", "title": "" }, { "docid": "90fb6d7282d3189060d0736ec169d6b2", "score": "0.51372486", "text": "def formate_name(name)\n # name.split.map{|p| p.split(\"-\").map{|m| m.split(\"'\").map{|n| (n.length > 1 ? n.capitalize : n) }.join(\"'\")}.join(\"-\")}.join(\" \")\n name.gsub(/[^\\s\\-']{02,}/, &:capitalize)\n\n end", "title": "" } ]
e29a41b02d78fe0180cddff75a45e2c3
model validation error messages (if !object.valid?)
[ { "docid": "9aa166ba465eb57f5b44deac9ab2fefc", "score": "0.0", "text": "def user_error\n @user_error = @user.errors.full_messages.join(\", \") if @user.errors\n end", "title": "" } ]
[ { "docid": "ef8122c28780bd7e23464a08a327ffc6", "score": "0.7287516", "text": "def form_errors(model_obj)\n render partial: 'layouts/form_messages', locals: {model: model_obj}\n end", "title": "" }, { "docid": "e6facb08cc1d5321fc3b9b0a322daad2", "score": "0.72844267", "text": "def form_errors_from_model(obj)\n if obj.respond_to?(:errors)\n obj.errors.each do |key, value|\n if value.respond_to?(:first)\n value = value.first\n end\n \n form_error(key.to_s, value % key)\n end\n end\n end", "title": "" }, { "docid": "e41421365e63862efeb532e61008e3b1", "score": "0.7212006", "text": "def error_messages\n unless @object.errors.count.zero?\n attributes_with_errors = @object.errors.map { |attribute, _| attribute } - ['base']\n content_tag(:p, :class => 'errors') do\n if attributes_with_errors.size > 1\n concat \"Sorry, there were problems with the #{attributes_with_errors.to_sentence}.\"\n elsif attributes_with_errors.size == 1\n concat \"Sorry, there was a problem with the #{attributes_with_errors.first}.\"\n else\n concat \"#{@object.class} #{@object.errors.on(:base)}.\"\n end\n end\n else\n ''\n end\n end", "title": "" }, { "docid": "9ae1e46ad55adb3063507a187139cc4b", "score": "0.720013", "text": "def extra_validations\n success\n end", "title": "" }, { "docid": "f237fba89ec5272495610cc367cad3c5", "score": "0.70059836", "text": "def add_validation_errors(value); end", "title": "" }, { "docid": "19c8ce62ae231f976563ca7cfaa612cc", "score": "0.6987507", "text": "def show_error_validation object\n if object.errors.any?\n str=''\n object.errors.full_messages.each do |msg|\n str +=\"<span class='red'>#{msg}</span>\"\n end\n return str\n end\n end", "title": "" }, { "docid": "a8447fc469e63508bd003c2fb12d81b4", "score": "0.69629824", "text": "def errors_for(_object); end", "title": "" }, { "docid": "2d56884d3ff6bc55cb57ff2b9012a388", "score": "0.69388986", "text": "def error_messages_for(object)\n if object.is_a? Symbol\n object = instance_variable_get(\"@#{object}\")\n end\n \n if object && object.errors.any?\n errors = object.errors.full_messages\n intro = content_tag(:h4, ts(\"Sorry! We couldn't save this %{objectname} because:\", :objectname => object.class.name.to_s.gsub(/_/, ' '))) \n error_messages_formatted(errors, intro)\n end\n end", "title": "" }, { "docid": "01f384ce8fc547c85c07e59c757f1015", "score": "0.6919959", "text": "def model_errors(model)\n result = \"\"\n if model.errors.any?\n result = \"<div class='alert alert-danger'>#{model.errors.full_messages.join('<br>')}</div>\".html_safe\n end\n result\n end", "title": "" }, { "docid": "cf54c0c0780b73d399d8d3bdae30f482", "score": "0.6917578", "text": "def errors\n run_validation\n @errors\n end", "title": "" }, { "docid": "43f89f5462c7761657bc6ff9f9452819", "score": "0.6877487", "text": "def render_error_model(model)\n render_error_messages(model.errors.full_messages)\n end", "title": "" }, { "docid": "6c1d8c11962964c51e9e3f353d830e0d", "score": "0.6861801", "text": "def list_errors\n error_messages = []\n @models.each do |m|\n if !m[:model].valid?\n m[:model].errors.each do |e|\n error_messages << \"#{e.to_s.titlecase} #{m[:model].errors[e][0]} - #{m[:meta][:sheet]}, row #{m[:meta][:row] or 'N/A'}\"\n end\n end\n end\n error_messages\n end", "title": "" }, { "docid": "8efd201f4c272b3b7d459c344da016df", "score": "0.68468136", "text": "def validate!\n # Set @error_text if the options are not valid\n end", "title": "" }, { "docid": "d9f68d6a51b13a07a08608a3a49db37f", "score": "0.68392247", "text": "def error_messages\n self.errors.full_messages\n end", "title": "" }, { "docid": "7c85752efbdf564dbd714fa393890106", "score": "0.67936635", "text": "def load_errors(obj)\n obj.errors.full_messages.each { |m|\n @msg.add(:error, m);\n }\n end", "title": "" }, { "docid": "7658e7232cb23c44b9b08f5cc70cd658", "score": "0.67690223", "text": "def set_errors\n \t@errors = []\n\n \tif self.title == \"\"\n \t@errors << \"Title cannot be blank\"\n \tend\n\n if self.user_id == nil\n @errors << \"Must assign to a user\"\n end\n\n if self.category_id == nil\n @errors << \"Must assign to a category\"\n end\n \tend", "title": "" }, { "docid": "5d8ffcff11c1c007f254038bccdf57df", "score": "0.67532986", "text": "def validate(item)\n __setobj__(item)\n super\n\n item.errors.messages.merge!(errors.messages)\n end", "title": "" }, { "docid": "b2c9c6b12502362420d251c696e708c5", "score": "0.67433023", "text": "def error_messages\n @template.error_messages_for(object)\n end", "title": "" }, { "docid": "1e3d601a77a9468c9898fba534d1f25d", "score": "0.671204", "text": "def validate\n # add errors if not validate\n end", "title": "" }, { "docid": "c8a7808bec615815fa2474219b9fe838", "score": "0.67027247", "text": "def setting_validations\n errors.add(:value, I18n.t(:blank, :scope => 'activerecord.errors.messages')) if validators['presence'] && ['1','true',true].include?(validators['presence']) && self.value.nil?\n errors.add(:value, I18n.t(:inclusion, :scope => 'activerecord.errors.messages')) if valid_values && !valid_values.include?(self.value)\n errors.add(:value, I18n.t(:invalid, :scope => 'activerecord.errors.messages')) if validators['format'] && !(Regexp.new(validators['format']) =~ self.value)\n end", "title": "" }, { "docid": "6d28dd025cb3a264581077bb21aa9b1a", "score": "0.6697772", "text": "def error_messages_for(object_name, options = {})\n options = options.symbolize_keys\n object = instance_variable_get(\"@#{object_name}\")\n if object && !object.errors.empty?\n # build full_messages here with controller current language\n full_messages = []\n object.errors.each do |attr, msg|\n next if msg.nil?\n msg = msg.first if msg.is_a? Array\n if attr == \"base\"\n full_messages << l(msg)\n else\n full_messages << \"&#171; \" + (l_has_string?(\"field_\" + attr) ? l(\"field_\" + attr) : object.class.human_attribute_name(attr)) + \" &#187; \" + l(msg) unless attr == \"custom_values\"\n end\n end \n content_tag(\"div\",\n content_tag(\n options[:header_tag] || \"span\", lwr(:gui_validation_error, full_messages.length) + \":\"\n ) +\n content_tag(\"ul\", full_messages.collect { |msg| content_tag(\"li\", msg) }),\n \"id\" => options[:id] || \"errorExplanation\", \"class\" => options[:class] || \"errorExplanation\"\n )\n else\n \"\"\n end\n end", "title": "" }, { "docid": "b9ad065b1f26387a59d1192232077d7a", "score": "0.6696165", "text": "def failure_message\n \"validation failed with #{@errors.inspect}, expected no validation errors\"\n end", "title": "" }, { "docid": "5430a0d8751752cdc0fcc7065ab9da43", "score": "0.6685636", "text": "def error_messages; end", "title": "" }, { "docid": "4e684889e4aeeea9d2536efd76ad7209", "score": "0.665644", "text": "def valid?\n super\n errors.empty?\n end", "title": "" }, { "docid": "b2ad98447f39f29c57cedef56b15833f", "score": "0.665396", "text": "def errors\n @model_decorator.form_active_errors(@resource)\n end", "title": "" }, { "docid": "002a1aefa03f3ba82ebcac79afef1c50", "score": "0.6643596", "text": "def save_model_error object\n error_str = I18n.t 'term.error'\n error_str += ' : '\n # Grab the error message from the student\n object.errors.each do |attr,msg|\n error_str += \"#{attr} - #{msg},\"\n end\n render :json => { error: error_str }, :status => :unprocessable_entity\n end", "title": "" }, { "docid": "28e746b876f6da5eb1b0eb901a6490fc", "score": "0.6633006", "text": "def add_foreign_key_message_to_errors(val)\n if !val.valid?\n @errors += val.errors\n end\n end", "title": "" }, { "docid": "13f54c3974aa514f10cfc4bda2ce857a", "score": "0.6632397", "text": "def errors_on_object(record)\n record.errors.full_messages\n end", "title": "" }, { "docid": "0243d95bb59c6489350bdff4ea3d62ba", "score": "0.6628487", "text": "def error_message(obj)\n obj.errors.full_messages.join(',')\n end", "title": "" }, { "docid": "c745fd59758091d23b8ad80529febe6e", "score": "0.65809804", "text": "def error_messages_for(object)\n if object.errors[:base].any?\n message = object.errors[:base].first\n %{<div class=\"text-danger\">#{message}</div>}.html_safe\n end\n end", "title": "" }, { "docid": "49035d79e10a5046866fa5de59f5ac4b", "score": "0.65710115", "text": "def error_messages_for(object_name)\n object = instance_variable_get(\"@#{object_name}\") \n if object\n msg = \"\" \n puts \"================\"\n puts object.errors.inspect\n object.errors.each do | attr, msg| \n msg = content_tag(:p, Column[attr]+msg) \n break\n end \n end \n content_tag(:div, msg, :id => \"errorExplanation\") unless msg.blank?\n end", "title": "" }, { "docid": "3db115db65de7516e6e67cc981ae3bcc", "score": "0.6568448", "text": "def validation_error(obj)\n error(406, obj.errors.full_messages)\n end", "title": "" }, { "docid": "86c97588379872d1172fed7a2c13e9b1", "score": "0.65619713", "text": "def errors\n validate_or_get_results :errors\n end", "title": "" }, { "docid": "e217175f46c3b837311c254559670aae", "score": "0.65597045", "text": "def message\n @options[:message] || \"failed validation\"\n end", "title": "" }, { "docid": "1d9238213c6f12edcafc5b983989270c", "score": "0.65505445", "text": "def error_message; end", "title": "" }, { "docid": "4cf38797341089e739fbd0c914695517", "score": "0.6537812", "text": "def include_form_validation_errors(record_object)\n render :partial => \"shared/errors\", :locals => {:record => record_object }\n end", "title": "" }, { "docid": "dd6e94cd7b579d4c83d6666892388ace", "score": "0.65157807", "text": "def errors\n self.class.validator.call self\n end", "title": "" }, { "docid": "fca498e7c3215eaa59f4b0db152266d8", "score": "0.64748454", "text": "def errors\n @validator ? @validator.errors : []\n end", "title": "" }, { "docid": "d19f775b7fa0769a3f7c74cf6cf5abf1", "score": "0.64583266", "text": "def error\n valid? ? nil : @error_message\n end", "title": "" }, { "docid": "2759b0d5e9f83fb77421652273f180e3", "score": "0.64435744", "text": "def errors_for(o);\n mab do\n ul.errors { o.errors.each_full { |er| li er } }\n end if o.errors.any?\n end", "title": "" }, { "docid": "4ad9adfb036e0253d888317af940add0", "score": "0.64432824", "text": "def errors\n \"Missing value for <#{name}> field\" if required && !@value\n end", "title": "" }, { "docid": "a61a48dbf4402396d926864a1089cc2b", "score": "0.6441256", "text": "def error_messages(object)\n return '' if object.errors.empty?\n content_tag('div',\n content_tag('ul', object.errors.collect {|attr_name, msg|\n content_tag('li', msg)}),\n { :class => 'errorExplanation' })\n end", "title": "" }, { "docid": "e691b941af62ca414235f77211cc2c27", "score": "0.64387137", "text": "def check_errors\n unless self.valid?\n bigmessage = self.errors.full_messages.join \"\\n\" \n raise bigmessage unless bigmessage.empty?\n end\n \n documents.each {|obj| obj.check_errors } \n \n invalids = (texts).reject {|obj| obj.valid? } \n bigmessage = invalids.map { |obj| obj.errors.full_messages.join \"\\n\" }.join \"\\n\"\n raise bigmessage unless bigmessage.empty?\n\n invalids = (audios ).reject {|obj| obj.valid? } \n bigmessage = invalids.map { |obj| obj.errors.full_messages.join \"\\n\" }.join \"\\n\"\n raise bigmessage unless bigmessage.empty?\n\n invalids = (images ).reject {|obj| obj.valid? } \n bigmessage = invalids.map { |obj| obj.errors.full_messages.join \"\\n\" }.join \"\\n\"\n raise bigmessage unless bigmessage.empty? \n \n object_formats.each {|obj| obj.check_errors } \n end", "title": "" }, { "docid": "b6540389242150c8dcd59ac86033fa87", "score": "0.64375305", "text": "def describe_error\n message = \"\"\n if self.account_number == nil\n message = message + I18n.t(:wrong_or_missing_account_number, :scope => [:model, :index]) + \" \"\n end\n if self.account_bank_number == nil\n message = message + I18n.t(:wrong_or_missing_account_bank_number, :scope => [:model, :index]) + \" \"\n end\n if self.student.uic == nil\n message = message + I18n.t(:missing_uic, :scope => [:model, :index]) + \" \"\n end\n if self.sident == -666\n message = message + I18n.t(:missing_sident_666, :scope => [:model, :index]) + \" \"\n end\n if self.sident == nil\n message = message + I18n.t(:missing_sident, :scope => [:model, :index]) + \" \"\n end\n return message\n\n end", "title": "" }, { "docid": "3278952845e8d99ded65ec6f20e41e54", "score": "0.6437223", "text": "def model_valid?\n true\n end", "title": "" }, { "docid": "3278952845e8d99ded65ec6f20e41e54", "score": "0.6437223", "text": "def model_valid?\n true\n end", "title": "" }, { "docid": "cb30966a69d2598c6db98413e317404d", "score": "0.6426716", "text": "def valid?\n errors.blank?\n end", "title": "" }, { "docid": "3644c027fe54290bff42ed21949d68c6", "score": "0.6410141", "text": "def negative_failure_message\n \"validation succeeded, expected one or more validation errors\"\n end", "title": "" }, { "docid": "82304517b1b3402913ca7855ebe81b01", "score": "0.63873106", "text": "def flash_errors_model(model)\n flash[:error] = model.errors.full_messages.join(', ')\n end", "title": "" }, { "docid": "b630493193c943c22f3a400643ef1806", "score": "0.63715094", "text": "def validation_tag(model, attribute, options = {})\n return if model.blank? or model.errors.blank? \n unless model.errors[attribute].blank?\n # generate error markup\n content_tag :span, :class => \"error-message\" do\n [model.errors[attribute]].flatten.join(options[:separator] || \", \").to_s\n end\n end\n end", "title": "" }, { "docid": "5bb56804d2ec003acd895a8bbf25ba07", "score": "0.6359698", "text": "def valida_titulo\n errors.add_to_base 'avisotitulo' if tituloes.blank? and titulofr.blank? \nend", "title": "" }, { "docid": "01677cd4c4a7b4d64b6d0bc03829b7c0", "score": "0.6358936", "text": "def check_errors\n unless self.valid?\n bigmessage = self.errors.full_messages.join \"\\n\" \n raise bigmessage unless bigmessage.empty?\n end\n \n documents.each {|obj| obj.check_errors } \n \n invalids = (texts).reject {|obj| obj.valid? } \n bigmessage = invalids.map { |obj| obj.errors.full_messages.join \"\\n\" }.join \"\\n\"\n raise bigmessage unless bigmessage.empty?\n\n invalids = (audios ).reject {|obj| obj.valid? } \n bigmessage = invalids.map { |obj| obj.errors.full_messages.join \"\\n\" }.join \"\\n\"\n raise bigmessage unless bigmessage.empty?\n\n invalids = (images ).reject {|obj| obj.valid? } \n bigmessage = invalids.map { |obj| obj.errors.full_messages.join \"\\n\" }.join \"\\n\"\n raise bigmessage unless bigmessage.empty? \n \n object_formats.each {|obj| obj.check_errors } \n end", "title": "" }, { "docid": "f9aea2c868b2dfd6f21c9c8150f0f42e", "score": "0.6351425", "text": "def run_validations\n true\n end", "title": "" }, { "docid": "9e1a7f6253816b1666937accf5531a60", "score": "0.63468015", "text": "def validations\n {}\n end", "title": "" }, { "docid": "cba4ac7fe52fbc833ef6ae990ab9cdf9", "score": "0.6336809", "text": "def error_messages_for(clazz)\n if clazz.present? && clazz.errors.present? && clazz.errors.count > 0\n return \"Errors: #{clazz.errors.full_messages}\"\n end\n end", "title": "" }, { "docid": "b43cc33b531e02175d731e069a9fd836", "score": "0.6333082", "text": "def format_model_validation_errors(resource)\n resource.errors&.messages&.each_with_object([]) do |(attribute, errors), messages|\n next unless VALIDATION.key?(attribute) || attribute == :base\n\n # NOTE: If the value is a date, the typecast value may not correspond to original user input, so get value_before_type_cast\n unless attribute == :base\n value = VALIDATION.dig(attribute, :checks)&.include?(:date) ? resource.public_send(\"#{attribute}_before_type_cast\") : resource[attribute]\n msg_header = (value ? \"Value '#{value}' for \" : '') + \"'#{VALIDATION[attribute][:label]}'\"\n end\n errors.each do |error_message|\n # Exclude the actual value in logging to avoid PII/PHI\n Rails.logger.info \"Validation Error on: #{attribute}\"\n messages << \"#{msg_header} #{error_message}\".strip\n end\n end\n end", "title": "" }, { "docid": "82968d5eca10ce784a934dffc5e9bda6", "score": "0.63283175", "text": "def set_errors\n @errors = []\n\n if self.name == nil || self.name == \"\"\n @errors << \"Name cannot be blank.\"\n end\n if self.username == nil || self.username == \"\"\n @errors << \"Username cannot be blank.\"\n end\n if self.email == nil || self.email == \"\"\n @errors << \"Email cannot be blank.\"\n end\n if self.password == nil || self.password == \"\"\n @errors << \"Password cannot be blank.\"\n end\n if self.budget == nil || self.budget == \"\"\n @errors << \"Budget cannot be blank.\"\n end\n end", "title": "" }, { "docid": "bcbda1569045cf968caf1e700df7a2e5", "score": "0.6319199", "text": "def error_message_from_model(model, attribute, message, extra = {})\n ::ActiveModel::Errors.new(model).generate_message(attribute, message, extra)\n end", "title": "" }, { "docid": "685d67e5a595bef0fc4012c68aec5aeb", "score": "0.6310759", "text": "def form_errors\n return '' if errors.empty?\n\n messages = errors.full_messages.map { |msg| content_tag(:li, msg) }.join\n sentence = I18n.t('errors.messages.not_saved',\n count: errors.count,\n resource: self.class.model_name.human.downcase)\n\n html = <<-HTML\n <div id='errors' class='alert alert-danger left'>\n <p class='bold'>#{sentence}</p>\n <ul>#{messages}</ul>\n </div>\n HTML\n\n html.html_safe\n end", "title": "" }, { "docid": "b5a25a301e7b017a32a2b7bce9f57348", "score": "0.6307777", "text": "def contact_errors\n error \"name\"\n error \"age\"\n error \"homepage\"\n end", "title": "" }, { "docid": "da08c39f6c9a516bd169bc8e72a69189", "score": "0.63059694", "text": "def validation_tag(model, attribute, options = {})\n return if model.blank? or model.errors.blank? \n unless model.errors[attribute].blank?\n # generate error markup\n return content_tag :span, [model.errors[attribute]].flatten.join(options[:separator] || \", \").to_s, :class => \"error-message\"\n end\n end", "title": "" }, { "docid": "c8a1f9751e6f0e048cbece369d54fb2f", "score": "0.6302988", "text": "def valid?\r\n errors.empty?\r\n end", "title": "" }, { "docid": "c8a1f9751e6f0e048cbece369d54fb2f", "score": "0.6302988", "text": "def valid?\r\n errors.empty?\r\n end", "title": "" }, { "docid": "ccc6820330b06f51ce899fffa35c9fe3", "score": "0.6294291", "text": "def valid?\n _errors_before = self.errors.dup\n _s = super\n validate_attributes\n _errors_before.each { |e| append_error(_errors_before,e) }\n self.errors.empty?\n end", "title": "" }, { "docid": "f1d037a39fe3293504d0af29b76acf21", "score": "0.6290384", "text": "def foi_error_messages_for(*params)\n options = params.last.is_a?(Hash) ? params.pop.symbolize_keys : {}\n objects = params.collect {|object_name| instance_variable_get(\"@#{object_name}\") }.compact\n count = objects.inject(0) {|sum, object| sum + object.errors.count }\n unless count.zero?\n html = {}\n [:id, :class].each do |key|\n if options.include?(key)\n value = options[key]\n html[key] = value unless value.blank?\n else\n html[key] = 'errorExplanation'\n end\n end\n error_messages = objects.map {|object| object.errors.full_messages.map {|msg| content_tag(:li, msg) } }\n content_tag(:div,\n content_tag(:ul, error_messages),\n html\n )\n else\n ''\n end\n end", "title": "" }, { "docid": "b14f8e06b149a17afbc19e4fe3d2d4e5", "score": "0.62902474", "text": "def error_messages_for(object_name, options = {})\n options = options.symbolize_keys\n object = instance_variable_get(\"@#{object_name}\")\n if object && !object.errors.empty?\n content = content_tag(\"div\",\n content_tag(\n options[:header_tag] || \"h2\",\n \"#{pluralize(object.errors.count, \"error\")} prohibited this #{object_name.to_s.gsub(\"_\", \" \")} from being saved\"\n ) +\n content_tag(\"p\", \"There were problems with the following fields:\") +\n content_tag(\"ul\", object.errors.full_messages.collect { |msg| content_tag(\"li\", msg) }),\n \"id\" => options[:id] || \"errorExplanation\", \"class\" => options[:class] || \"errorExplanation\"\n )\n render :partial => \"layouts/errors\", :locals => {:content => content}\n else\n \"\"\n end\n end", "title": "" }, { "docid": "2f2e4e758244b1d774237551ba7e42ec", "score": "0.62894326", "text": "def mark_error(model, attr_name)\n if model.errors.any? && model.errors.get(attr_name) && model.errors.get(attr_name) != \"\"\n return ' error'\n end\n return ''\n end", "title": "" }, { "docid": "1a54baf62bce32e7fc7885370fe3b773", "score": "0.6288658", "text": "def validate!\n raise BadRequestError.new(self.errors.full_messages.uniq.join(', ')) unless valid?\n end", "title": "" }, { "docid": "1a54baf62bce32e7fc7885370fe3b773", "score": "0.6288658", "text": "def validate!\n raise BadRequestError.new(self.errors.full_messages.uniq.join(', ')) unless valid?\n end", "title": "" }, { "docid": "a4b5aa7b7ba6b26e9ceff8288035ca99", "score": "0.6287903", "text": "def validation; end", "title": "" }, { "docid": "a4b5aa7b7ba6b26e9ceff8288035ca99", "score": "0.6287903", "text": "def validation; end", "title": "" }, { "docid": "5b67f1c864a4330ea70b29ab077e3f43", "score": "0.62852204", "text": "def errors; end", "title": "" }, { "docid": "5b67f1c864a4330ea70b29ab077e3f43", "score": "0.62852204", "text": "def errors; end", "title": "" }, { "docid": "5b67f1c864a4330ea70b29ab077e3f43", "score": "0.62852204", "text": "def errors; end", "title": "" }, { "docid": "5b67f1c864a4330ea70b29ab077e3f43", "score": "0.62852204", "text": "def errors; end", "title": "" }, { "docid": "5b67f1c864a4330ea70b29ab077e3f43", "score": "0.62852204", "text": "def errors; end", "title": "" }, { "docid": "5b67f1c864a4330ea70b29ab077e3f43", "score": "0.62852204", "text": "def errors; end", "title": "" }, { "docid": "5b67f1c864a4330ea70b29ab077e3f43", "score": "0.62852204", "text": "def errors; end", "title": "" }, { "docid": "5b67f1c864a4330ea70b29ab077e3f43", "score": "0.62852204", "text": "def errors; end", "title": "" }, { "docid": "5b67f1c864a4330ea70b29ab077e3f43", "score": "0.62852204", "text": "def errors; end", "title": "" }, { "docid": "cfb53999f61e45301d40cdc9bb6d94b6", "score": "0.62808543", "text": "def errors\n return super unless ldp_object.present?\n ldp_object.errors\n end", "title": "" }, { "docid": "69b0317d7463d7c5e132a9382f13326e", "score": "0.6274662", "text": "def assert_valid model, msg=nil\n valid = model.valid?\n msg = [\"Expected #{model.class} to be valid but it had these errors:\",\n *model.errors.full_messages.map { |message| \" - #{message}\" }].join(\"\\n\")\n assert valid, msg\n end", "title": "" }, { "docid": "184bd07cf18f6acd95727893087c2890", "score": "0.62744343", "text": "def setting_validations\n if errors.empty?\n errors.add(:value, :blank) if validators['presence'] && ['1','true',true].include?(validators['presence']) && self.value.nil?\n errors.add(:value, :inclusion) if valid_values && !valid_values.include?(self.value)\n errors.add(:value, :invalid) if validators['format'] && !(Regexp.new(validators['format']) =~ self.value)\n end\n end", "title": "" }, { "docid": "ee823c6d4941c8100a985231dbe9a678", "score": "0.62727326", "text": "def build_model_errors(model, errors)\n return if errors.blank?\n\n model.errors.clear\n errors.each do |err_attr|\n next if err_attr.blank?\n\n # Note lowercase the first letter as some section names have upper case first which does not\n # work with the current message\n err_attr[0] = err_attr[0].downcase\n model.errors.add(:base, :section_not_complete, attr: err_attr)\n end\n end", "title": "" }, { "docid": "4f26a26a9906f7849f20efc7328d1868", "score": "0.62711203", "text": "def check_errors\n unless valid? \n bigmessage = self.errors.full_messages.join \"\\n\" \n raise bigmessage unless bigmessage.empty?\n \n raise \"format should not be nil\" if format.nil?\n raise \"invalid format #{format}\" unless format.valid? \n raise \"#{self.errors.to_a}, error encountered while saving #{@datafile_id}, #{@bitstream_id} \" \n end\n end", "title": "" }, { "docid": "fa97117bac01c1a78f3d6fd3e85e98a7", "score": "0.62587774", "text": "def error_messages(object_name = nil)\n @template.error_messages_for object_name || @object_name\n end", "title": "" }, { "docid": "07414dce9aa0f3db6db234b262d8d6ca", "score": "0.6254411", "text": "def errors(model, field)\n if model && model.errors.any?\n content_tag :div, class: 'errors' do\n model.errors[field].collect do |msg|\n concat(content_tag(:small, model.errors.full_message(field, msg), class: 'error'))\n end\n end\n end\n end", "title": "" }, { "docid": "27c3721ce06bdce999b7f2d8fcf740dc", "score": "0.62505615", "text": "def errors\n @errors ||= ActiveModel::Errors.new(self)\n end", "title": "" }, { "docid": "ca4d03c48aa0521b4e578919d4184940", "score": "0.62441134", "text": "def errors\n bindings[:object].errors[name]\n end", "title": "" }, { "docid": "ca4d03c48aa0521b4e578919d4184940", "score": "0.62441134", "text": "def errors\n bindings[:object].errors[name]\n end", "title": "" }, { "docid": "ca4d03c48aa0521b4e578919d4184940", "score": "0.62441134", "text": "def errors\n bindings[:object].errors[name]\n end", "title": "" }, { "docid": "df6265dcd32e3e6e5418b12279744669", "score": "0.6242841", "text": "def message\n @errormsg\n end", "title": "" }, { "docid": "e2510defa9636d5e4368f9569a235bed", "score": "0.6232379", "text": "def is_valid; end", "title": "" }, { "docid": "2185fe7f0bd547470191831315b3da0d", "score": "0.622261", "text": "def get_error_message\n error_msg = \"\"\n \n self.errors.full_messages.each do |msg|\n if error_msg != \"\"\n error_msg << \"<br>\"\n end\n error_msg << msg\n end\n\n error_msg\n end", "title": "" }, { "docid": "30203bfa974057e9c78d0b353a31d2cd", "score": "0.62224764", "text": "def error_messages(object_name = nil)\n @template.error_messages_for object_name || @object_name\n end", "title": "" }, { "docid": "779cc2ec82d49b4589aec008100870f1", "score": "0.6221906", "text": "def show_errors_if_any(form)\n form.semantic_errors(*form.object.errors.keys)\n end", "title": "" }, { "docid": "ac3efd005a6466234bd6f97e29953d06", "score": "0.6221454", "text": "def error_messages\n errors.messages\n end", "title": "" }, { "docid": "2a173bd9c8305a615013eabb3f059a1b", "score": "0.62181133", "text": "def update_errors\n @errors = []\n @errors << 'One of the cards needs attention' unless cards.all?(&:valid?)\n if email\n @errors << 'Email is not in correct format' unless email_well_formed?\n else\n @errors << 'Email is a required field'\n end\n @errors << 'Wallet token is a required field' unless wallet_token\n @errors\n end", "title": "" }, { "docid": "54d21ef47889fe9748b230e6815eacfc", "score": "0.62167454", "text": "def errors\n super.tap do |errors|\n errors.add(:'user.email', 'is invalid') if errors[:'user.email'].empty?\n end\n end", "title": "" }, { "docid": "ff473c532b5e4ab37b3857a40b9770f3", "score": "0.62153584", "text": "def assert_valid(obj)\n assert obj.valid?, \"Errors: #{pretty_error_messages obj}\"\n end", "title": "" }, { "docid": "813776933a1747fdc5dba2a8084d460f", "score": "0.6209066", "text": "def not_valid_message; nil; end", "title": "" } ]
da94f01095c45155946cd37035ff3d8b
GET /typesobjects/new GET /typesobjects/new.xml
[ { "docid": "a061003c3511d5c4a24a996989b4349d", "score": "0.77001226", "text": "def new\n\t\t@typesobject = Typesobject.new\n\t\t@objectswithtype=Typesobject.get_objects_with_type\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @typesobject }\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "421052e76e62b1fcffcd2a3e99a1ae7c", "score": "0.7467249", "text": "def new\n @object_type = ObjectType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @object_type }\n end\n end", "title": "" }, { "docid": "35ad7c9c2d8c1b5fc54560c101b5d472", "score": "0.7119041", "text": "def new\n @type = Type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @type }\n end\n end", "title": "" }, { "docid": "35ad7c9c2d8c1b5fc54560c101b5d472", "score": "0.7119041", "text": "def new\n @type = Type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @type }\n end\n end", "title": "" }, { "docid": "c5d95a399bd00af711876ab3ad8485c6", "score": "0.7094888", "text": "def new\n @type = Type.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @type }\n end\n end", "title": "" }, { "docid": "747cb048f0097da3178a91be2fc02fef", "score": "0.7071266", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @type }\n end\n end", "title": "" }, { "docid": "dc749d4c889f6762f4652362a2242b85", "score": "0.70029414", "text": "def new\n @type_document = TypeDocument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @type_document }\n end\n end", "title": "" }, { "docid": "d737dfe7878551dc4b337731c9809e07", "score": "0.69490176", "text": "def new\n @typexp = Typexp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @typexp }\n end\n end", "title": "" }, { "docid": "8158105ba743a59751390a286ce380bc", "score": "0.6942287", "text": "def new\n\t\t@statusobject = Statusobject.new\n\t\t@types = ::Typesobject.find(:all, :order => \"name\", :conditions => [\"forobject = '#{@statusobject.forobject}'\"])\n\t\t@objectswithstatus=Statusobject.get_objects_with_status\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @statusobject }\n\t\tend\n\tend", "title": "" }, { "docid": "0fc7fb6ec0dd03c1faab2ef2dea02033", "score": "0.68845147", "text": "def new\n @content_type = ContentType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @content_type }\n end\n end", "title": "" }, { "docid": "0fc7fb6ec0dd03c1faab2ef2dea02033", "score": "0.68845147", "text": "def new\n @content_type = ContentType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @content_type }\n end\n end", "title": "" }, { "docid": "046f5704fd2dd93804bc25010619928c", "score": "0.68415153", "text": "def new\n @tagtype = Tagtype.new\n\t@title = \"New tag type\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tagtype }\n end\n end", "title": "" }, { "docid": "fdb5e63e1e7b2f525c31e3f8572da442", "score": "0.68177867", "text": "def new\n @page_type = PageType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page_type }\n end\n end", "title": "" }, { "docid": "5d61da5c998d32cca38bbbd2cd93a182", "score": "0.6797913", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @document_type }\n end\n end", "title": "" }, { "docid": "79dc70868c05fe8e004c23c25a4c3ecf", "score": "0.6795538", "text": "def new\n @doc_type = DocType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @doc_type }\n end\n end", "title": "" }, { "docid": "8f639b4e5a8799933bf99e0a6aeed667", "score": "0.67685926", "text": "def new\n @attrib_type = AttribType.new\n @entry_types = EntryType.find(:all).collect {|t| [ t.name, t.id ] }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attrib_type }\n end\n end", "title": "" }, { "docid": "ee08f882cd94afd4641ecd346ca4bcf3", "score": "0.67361236", "text": "def new\n\t\t@statusobject = Statusobject.new\n\t\t#rails2@types = ::Typesobject.find(:all, :order => \"name\", :conditions => [\"forobject = '#{@statusobject.forobject}'\"])\n\t\t@types = ::Typesobject.get_types(@statusobject.forobject)\n\t\t@objectswithstatus=Statusobject.get_objects_with_status\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @statusobject }\n\t\tend\n\tend", "title": "" }, { "docid": "c2be97fc25bcb6dfdc4a609505922b85", "score": "0.6717316", "text": "def new\n @resource_type = ResourceType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @resource_type }\n format.xml { render :xml => @resource_type }\n end\n end", "title": "" }, { "docid": "c50718f6adc0ba8d48dfe5c9501b8eed", "score": "0.6692206", "text": "def new\n @ptype = Ptype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ptype }\n end\n end", "title": "" }, { "docid": "cec79a8a693c6c46c3a86b63fcc0ed4f", "score": "0.669096", "text": "def new\n @thing_type1 = ThingType1.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing_type1 }\n end\n end", "title": "" }, { "docid": "752041b9c689e97f300b83ad6710367d", "score": "0.66671276", "text": "def new\n @document_type = DocumentType.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @document_type }\n end\n end", "title": "" }, { "docid": "a77c914fb556389ce3bf1682592d1690", "score": "0.66577995", "text": "def new\n @document_type = DocumentType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @document_type }\n end\n end", "title": "" }, { "docid": "ebcc9bd5793e48fc3eb3c9ecdc744342", "score": "0.66558033", "text": "def new\n @instancetype = Instancetype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instancetype }\n end\n end", "title": "" }, { "docid": "3b521f1bce2ecfccf6d5813db89ca317", "score": "0.6654649", "text": "def new\n @extra_type = ExtraType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @extra_type }\n end\n end", "title": "" }, { "docid": "041b0c48c42a5a9a9b89b9675f0651b5", "score": "0.6648496", "text": "def create(object_type, data)\n url = generate_rest_url(:create, object_type)\n object_name = object_name_for(object_type, :create)\n xml_data = data.to_xml(:root => object_name, :skip_instruct => true, :dasherize => false)\n result = retrieve(url.path, url.method, {'Content-type' => 'application/xml'}, xml_data)\n parsed_result = parse_xml(result)\n find_object_in_result(parsed_result, object_type, :create)\n end", "title": "" }, { "docid": "1401f8ef8e1bc90c1269040a87dbf75a", "score": "0.6645249", "text": "def new\n @utype = Utype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @utype }\n end\n end", "title": "" }, { "docid": "4dbe1b030daac01f61f8a6d89bf79bd9", "score": "0.66278183", "text": "def new\n @archtype = Archtype.new\n @type = Type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @archtype }\n end\n end", "title": "" }, { "docid": "d23ebdae10a2141fba1c34476cd45989", "score": "0.6626805", "text": "def new\n @entitytype = Entitytype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entitytype }\n end\n end", "title": "" }, { "docid": "2e12b5b5fe87b664f1b6e6244876a3b1", "score": "0.6623445", "text": "def new\n @type = Type.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @type }\n end\n end", "title": "" }, { "docid": "2e12b5b5fe87b664f1b6e6244876a3b1", "score": "0.6623445", "text": "def new\n @type = Type.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @type }\n end\n end", "title": "" }, { "docid": "23cdde8d4b1a2be0bc3eecca07b39e74", "score": "0.66175747", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ontology }\n end\n end", "title": "" }, { "docid": "2ce8f01b1c2da50d9413511092a46509", "score": "0.6613567", "text": "def new\n @thing_type2 = ThingType2.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @thing_type2 }\n end\n end", "title": "" }, { "docid": "d14306236635a9c66afddfa62f6f544a", "score": "0.65987194", "text": "def new\n @name_type = NameType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @name_type }\n end\n end", "title": "" }, { "docid": "6e5026c432a22d874fa78547520a3ea4", "score": "0.6577713", "text": "def new\n @action_type = ActionType.new\n\n respond_to do |format|\n format.html # new.html.erb\n# format.xml { render :xml => @action_type }\n end\n end", "title": "" }, { "docid": "91f6cb7da866b604b00c9ac68b60e0ef", "score": "0.65490425", "text": "def new\n @cattype = Cattype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cattype }\n end\n end", "title": "" }, { "docid": "a3b4130a7d8905341d5dfafd14be16e9", "score": "0.65478706", "text": "def new\n @event_type = EventType.new\n @root = EventType.find(2)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_type }\n end\n end", "title": "" }, { "docid": "cc059dd7e20fbd5f20e52137718bf901", "score": "0.65446866", "text": "def new\r\n @acttype = Acttype.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @acttype }\r\n end\r\n end", "title": "" }, { "docid": "94ceaaf9250cdc3d062aeb18bbab1a52", "score": "0.65408856", "text": "def new\n @newstuff = Newstuff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newstuff }\n end\n end", "title": "" }, { "docid": "cf1ecf7a126c54d8d8cfe2d7d209bdc6", "score": "0.65386677", "text": "def new\n @type = Type.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @type }\n end\n end", "title": "" }, { "docid": "ff2229ecc86a18fbce5c3d0953eb0ec5", "score": "0.6537583", "text": "def new\n @status_type = StatusType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @status_type }\n end\n end", "title": "" }, { "docid": "62aca668f286085ed65baa411b950bf7", "score": "0.6527986", "text": "def new\n @content_type = ContentType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @content_type }\n end\n end", "title": "" }, { "docid": "a48fbe1698af337d584a12f5e579538b", "score": "0.6518523", "text": "def new\n @type = Type.new \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @type }\n end\n end", "title": "" }, { "docid": "39f4f4ded2a80e86209897cf84ca59c1", "score": "0.6513665", "text": "def new\n @objeto = Objeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @objeto }\n end\n end", "title": "" }, { "docid": "1a78c5a9753a1e6d032337b0f22629a9", "score": "0.6513096", "text": "def new\n @doc_type = DocType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @doc_type }\n end\n end", "title": "" }, { "docid": "e12bca77f84047f802fbfa9db9c2876b", "score": "0.65066934", "text": "def new\n @page_title = 'Create Document Type'\n @document_type = DocumentType.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document_type }\n end\n end", "title": "" }, { "docid": "d296959e73a04b3c6e2de13210a564a3", "score": "0.6504703", "text": "def new\n @clone_item_type = CloneItemType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @clone_item_type }\n end\n end", "title": "" }, { "docid": "b8a7a1cf6c93e2768d8bfb7ac9b361c7", "score": "0.6485926", "text": "def new\n @obj_rel = ObjRel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @obj_rel }\n end\n end", "title": "" }, { "docid": "0729b65faabddf3cb6ab21aca0120465", "score": "0.6463089", "text": "def new\n @dynamic_object_type = DynamicObjectType.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dynamic_object_type }\n end\n end", "title": "" }, { "docid": "f5f33ecab56c588e5e05abacdf0efcc7", "score": "0.6461505", "text": "def new\n @threat_type = ThreatType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @threat_type }\n end\n end", "title": "" }, { "docid": "dc8ad0097ccdb54bb39fa8494629ff16", "score": "0.64586544", "text": "def new\n @rt = Rt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rt }\n end\n end", "title": "" }, { "docid": "ab66dd6668d49678a4aba5a0d650f2fd", "score": "0.6455704", "text": "def new\n @time_type = TimeType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @time_type }\n end\n end", "title": "" }, { "docid": "7bda4a192832611f4f1652a3da78f160", "score": "0.6455684", "text": "def new\n @sub_type = SubType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sub_type }\n end\n end", "title": "" }, { "docid": "286789d6ec06058a7006ebc2762cf42d", "score": "0.6451303", "text": "def new\n @type = ReferenceNumberType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @type }\n end\n end", "title": "" }, { "docid": "1572043787fb1ce6cc13d4a754584bc7", "score": "0.64482856", "text": "def new_rest\n @item = Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end", "title": "" }, { "docid": "27a8017dd722d229822078185eb600ba", "score": "0.64461327", "text": "def new\n @person_type = PersonType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person_type }\n end\n end", "title": "" }, { "docid": "4c0086621c322a2ade8cf080abb48bfb", "score": "0.64395225", "text": "def new\n @data_type = DataType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @data_type }\n end\n end", "title": "" }, { "docid": "a9449592b504cb8524784cddef122a92", "score": "0.64375645", "text": "def new\n @type = Type.new\n\n respond_to do |format|\n format.html { render }\n format.json { render json: @type }\n end\n end", "title": "" }, { "docid": "2048827e02580f8ffaa44b0f7f865b41", "score": "0.643149", "text": "def new\n @part_type = PartType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @part_type }\n end\n end", "title": "" }, { "docid": "ac03fbfa9aee30ed09125ab492c08528", "score": "0.642805", "text": "def new\n @type = params[:types].singularize\n @object = Kilt::Object.new(@type)\n end", "title": "" }, { "docid": "16b9569dda70acebb63f5bd8a1a2b09a", "score": "0.64275646", "text": "def new_rest\n @page_usage = PageUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page_usage }\n end\n end", "title": "" }, { "docid": "57f8ffc04f9a977a52d8247875230dc2", "score": "0.6426346", "text": "def new\n @download_type = DownloadType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @download_type }\n end\n end", "title": "" }, { "docid": "de3c1804874114cd978cccdb2064edf5", "score": "0.6422026", "text": "def new\n @catalogs_event_type = Catalogs::EventType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalogs_event_type }\n end\n end", "title": "" }, { "docid": "fde9e7722c83417da6c4272bac64696f", "score": "0.64214087", "text": "def new\n @photo_type = PhotoType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo_type }\n end\n end", "title": "" }, { "docid": "ff1cac2754fd104790601cca54b8b721", "score": "0.6418206", "text": "def new\n @entry_type = EntryType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entry_type }\n end\n end", "title": "" }, { "docid": "3411d0541ce3fe2d89a6bf3d516d99d3", "score": "0.64104736", "text": "def new\n @type_info = TypeInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @type_info }\n end\n end", "title": "" }, { "docid": "0935b79a999afa49eae8c99920350755", "score": "0.64098996", "text": "def new\n @model_type = ModelType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @model_type }\n end\n end", "title": "" }, { "docid": "b250cbd9171a55026ec8c96bd1ead84a", "score": "0.640296", "text": "def new\n @project_type = ProjectType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @project_type }\n end\n end", "title": "" }, { "docid": "27c0c707902504f94c9396fac2f5d1b3", "score": "0.6391071", "text": "def new\n @event_type = EventType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event_type }\n end\n end", "title": "" }, { "docid": "e77d3bb9182179ebb17e291169508f41", "score": "0.6389265", "text": "def new\n @events_type = EventsType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @events_type }\n end\n end", "title": "" }, { "docid": "9d71438bf9ddaf5a4735369b6e9127fb", "score": "0.6380774", "text": "def new\n @article_type = ArticleType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @article_type }\n end\n end", "title": "" }, { "docid": "ab9edba2bfb02817a652ace685d0682c", "score": "0.6377419", "text": "def new\n @modeltype = Modeltype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @modeltype }\n format.csv { render :csv => @modeltype }\n format.json { render :json => @modeltype }\n end\n end", "title": "" }, { "docid": "164f1f64efda00c20ed61374ce37868a", "score": "0.6375487", "text": "def new\n @activity_types = ActivityType.find(:all)\n\n @activity = Activity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity }\n end\n end", "title": "" }, { "docid": "8e680849be608b307dbc7844ce0ed421", "score": "0.63743234", "text": "def new\n @the_thing = the_model_name.constantize.new\n #build_children\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @the_thing }\n end\n end", "title": "" }, { "docid": "1455af70c61412dfe18639c86f8572aa", "score": "0.6369174", "text": "def new\n @pubtype = Pubtype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pubtype }\n end\n end", "title": "" }, { "docid": "050b6c4567f2eace509dca939517a76b", "score": "0.6367868", "text": "def new_rest\n @entry_item = EntryItem.new\n\n respond_to do |format|\n #format.html # new.html.erb\n format.xml { render :xml => @entry_item }\n end\n end", "title": "" }, { "docid": "772bcd9e8249d3495979c6ee4f8d7365", "score": "0.6367618", "text": "def new\n @item_type = ItemType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_type }\n end\n end", "title": "" }, { "docid": "772bcd9e8249d3495979c6ee4f8d7365", "score": "0.6367618", "text": "def new\n @item_type = ItemType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_type }\n end\n end", "title": "" }, { "docid": "3ceccca3dd5d117c73d3cd6a8797e276", "score": "0.6364518", "text": "def new\n @resource_type = ResourceType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_type }\n end\n end", "title": "" }, { "docid": "3ceccca3dd5d117c73d3cd6a8797e276", "score": "0.6364518", "text": "def new\n @resource_type = ResourceType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_type }\n end\n end", "title": "" }, { "docid": "1124c4bcf0eaef86b8a06ef4dd61bf8d", "score": "0.63639724", "text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @toolkit_resource_type }\n end\n end", "title": "" }, { "docid": "9e4d478f793b666234ea27c9ad65f5e9", "score": "0.6360675", "text": "def new\r\n redirect_to \"/404.html\" and return\r\n @tasktype = Tasktype.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @tasktype }\r\n end\r\n end", "title": "" }, { "docid": "956e26da4152e342df19446149b50737", "score": "0.63597035", "text": "def new\n #@clazz = Clazz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @clazz }\n end\n end", "title": "" }, { "docid": "089fac13c5a0974babc78c22efef1b5f", "score": "0.63518983", "text": "def new\n @sobject = Sobject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sobject }\n end\n end", "title": "" }, { "docid": "e10c5710bcf0bbfcb4364aa92ec26523", "score": "0.6346161", "text": "def new\n @tyml = Tyml.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tyml }\n end\n end", "title": "" }, { "docid": "256a9495a0a5ee5115b5ecb4e3c3f2bf", "score": "0.63450897", "text": "def new\n @taxe_type = Taxe::Type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @taxe_type }\n end\n end", "title": "" }, { "docid": "4437960e2d842f2d49a3370090406d69", "score": "0.63427997", "text": "def new\n @location = Location.new\n @location_types = LocationType.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "43257cfcd8505e07ca11b8e3cf548a5f", "score": "0.6342448", "text": "def new\n @documenttype = Documenttype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @documenttype }\n end\n end", "title": "" }, { "docid": "3f93efef0d8e470db27c78861fe20cd6", "score": "0.63401634", "text": "def new\n @basic_object = BasicObject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @basic_object }\n end\n end", "title": "" }, { "docid": "d08e3db1721ad241239a94e99783400f", "score": "0.6333744", "text": "def create\n\t\tfname=\"#{self.class.name}.#{__method__}\"\n\t\t#LOG.info (fname){\"params=#{params}\"}\n\t\t@typesobject = Typesobject.new(params[:typesobject])\n\t\t@objectswithtype=Typesobject.get_objects_with_type\n\t\trespond_to do |format|\n\t\t\tif params[:fonct] == \"new_dup\"\n\t\t\t\tobject_orig=Typesobject.find(params[:object_orig_id])\n\t\t\tst = @typesobject.create_duplicate(object_orig)\n\t\t\telse\n\t\t\tst = @typesobject.save\n\t\t\tend\n\t\t\tif st\n\t\t\t\tflash[:notice] = t(:ctrl_object_created,:typeobj =>t(:ctrl_typesobject),:ident=>@typesobject.ident)\n\t\t\t\tformat.html { redirect_to(@typesobject) }\n\t\t\t\tformat.xml { render :xml => @typesobject, :status => :created, :location => @typesobject }\n\t\t\telse\n\t\t\t\tflash[:error] = t(:ctrl_object_not_created,:typeobj =>t(:ctrl_typesobject),:ident=>@typesobject.name, :msg => nil)\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @typesobject.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "2d30f0822e6198a4922f7f0bb75977d2", "score": "0.63315046", "text": "def new\n @clazz = Clazz.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @clazz }\n end\n end", "title": "" }, { "docid": "3dfb86fb8917f2ace9f01e58de8b7b9d", "score": "0.6322285", "text": "def new\n @sample_type = SampleType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sample_type }\n end\n end", "title": "" }, { "docid": "ea516fd4dc0283b3e5ace859c0aedde8", "score": "0.6319792", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @structure }\n end\n end", "title": "" }, { "docid": "70a29d8cfd81e44a1fba682dabd19d94", "score": "0.6319342", "text": "def new\n @pet_type = PetType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pet_type }\n end\n end", "title": "" }, { "docid": "8a3e64e94e2289c4291ddda7362acc80", "score": "0.6317797", "text": "def new\n @typedocument = Typedocument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @typedocument }\n end\n end", "title": "" }, { "docid": "a6c95bdcf875370676e77948cce46de6", "score": "0.6313195", "text": "def new\n @proc_type = ProcType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @proc_type }\n end\n end", "title": "" }, { "docid": "cd7c47e32b92c5ba4e647c15fc32d61c", "score": "0.63085747", "text": "def new\n @refdttype = Refdttype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @refdttype }\n end\n end", "title": "" }, { "docid": "44b0858ae074527c22ebc8f11be7de42", "score": "0.6306354", "text": "def new\n @element_type = ElementType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @element_type }\n end\n end", "title": "" }, { "docid": "df62c1f660612060082a998964a12f89", "score": "0.63034153", "text": "def new\n @document = Document.new(:doc_type=>params[:doc_type])\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @document }\n end\n end", "title": "" }, { "docid": "62ffcf8233ac6861485d53c41e3552fc", "score": "0.62957716", "text": "def new\n @term_type = TermType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @term_type }\n end\n end", "title": "" }, { "docid": "02d8ca928dfd49f464234b41db3795c8", "score": "0.6292736", "text": "def new\n @taxonomy = Taxonomy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @taxonomy }\n end\n end", "title": "" } ]
cf86d6537e12c1b11306217c30e2bcfc
PUT /formats/1 PUT /formats/1.xml
[ { "docid": "54f4af95b15cb6a376fba5bc3f22b0b9", "score": "0.6582662", "text": "def update\n @format = Format.find(params[:id])\n\n respond_to do |format|\n if @format.update_attributes(params[:format])\n format.html { redirect_to(@format, :notice => 'Format was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @format.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "13394c10035cc389a9117b14f69e7d02", "score": "0.622841", "text": "def update\n @format_type = FormatType.find(params[:id])\n\n respond_to do |format|\n if @format_type.update_attributes(params[:format_type])\n format.html { redirect_to @format_type, notice: 'Format type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @format_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f591facf8d884b73f29d3ac7d54fa546", "score": "0.6188952", "text": "def uri\n '/formats/' + @id\n end", "title": "" }, { "docid": "d8a0ffc3ff88e9c344243c00b2503688", "score": "0.60511935", "text": "def update\n respond_to do |format|\n if @format_mime.update(format_mime_params)\n format.html { redirect_to @format_mime, notice: 'Format mime was successfully updated.' }\n format.json { render :show, status: :ok, location: @format_mime }\n else\n format.html { render :edit }\n format.json { render json: @format_mime.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3be61078393dabd5c0138bfad0c7104b", "score": "0.60444915", "text": "def set_format\n request.format = 'xml'\n end", "title": "" }, { "docid": "881a4a0d2d2dacb4ac2aa18ff6c12d50", "score": "0.6026537", "text": "def update\n @video_format = VideoFormat.find(params[:id])\n\n respond_to do |format|\n if @video_format.update_attributes(params[:video_format])\n flash[:notice] = 'VideoFormat was successfully updated.'\n format.html { redirect_to(@video_format) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @video_format.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f491f989de86b482e76c31de1fa4b34", "score": "0.6017385", "text": "def update\n respond_to do |format|\n if @format.update(format_params)\n format.html { redirect_to @format, notice: 'Format was successfully updated.' }\n format.json { render :show, status: :ok, location: @format }\n else\n format.html { render :edit }\n format.json { render json: @format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b271e1c7924267c0b2d6ca0298d950bf", "score": "0.5988628", "text": "def update\n flash[:notice] = t('scaffold.notice.updated', :item => SicossFormat.model_name.human) if @sicoss_format.update_attributes(params[:sicoss_format])\n respond_with(@sicoss_format, :location => sicoss_formats_path)\n end", "title": "" }, { "docid": "9fbc73ebf61fa24c9cfdf30a39f7d3b7", "score": "0.59823287", "text": "def update\n respond_to do |format|\n if admin? and @file_format.update(file_format_params)\n format.html { redirect_to @file_format, notice: 'File format was successfully updated.' }\n format.json { render :show, status: :ok, location: @file_format }\n else\n format.html { render :edit }\n format.json { render json: @file_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38979984bdedacd95706689e25f09f9e", "score": "0.5969294", "text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end", "title": "" }, { "docid": "d733691e748f1a2cc6edb477e5e48f75", "score": "0.593366", "text": "def update\n @store_format = StoreFormat.find(params[:id])\n\n respond_to do |format|\n if @store_format.update_attributes(params[:store_format])\n format.html { redirect_to @store_format, notice: 'Store format was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @store_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "79680237c0fde20881aa3259a2564e2e", "score": "0.592921", "text": "def put payload, format\n call(\n method: :put,\n uri: uri('/put'),\n payload: payload,\n accept: format\n )\n end", "title": "" }, { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.59078723", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end", "title": "" }, { "docid": "0e0da2b52a2a6699e59fbae2932266e5", "score": "0.58818763", "text": "def put(url, format)\n document = http.put_uri(url, serialize, format).body\n deserialize(document)\n end", "title": "" }, { "docid": "ae8bcf95f6329b20aa5420a1ddfdc617", "score": "0.58133656", "text": "def destroy\n @format = Format.find(params[:id])\n @format.destroy\n\n respond_to do |format|\n format.html { redirect_to(formats_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9cfdcb96bf3b7ed1ac417ece93833e71", "score": "0.5803908", "text": "def update\n\t\t# 2 modes of operation\n\t\trespond_to do |format|\n\t\t\tformat.html do\n\t\t\t\t# TODO: write me!\n\t\t\tend\n\t\t\t\n\t\t\tformat.xml do\n\t\t\t\t# TODO: write me!\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "bea790954b5b3a22d25a520c1d314c37", "score": "0.57971615", "text": "def update\n @product_format = ProductFormat.find(params[:id])\n\n respond_to do |format|\n if @product_format.update_attributes(params[:product_format])\n format.html { redirect_to(@product_format, :notice => 'Product format was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product_format.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2479be5177a8ec714cbcd23069bae80e", "score": "0.5790673", "text": "def update\n respond_to do |format|\n if @aiki_format.update(aiki_format_params)\n format.html { redirect_to @aiki_format, notice: 'Format was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @aiki_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "013f6724c1c3d878579d99bd82fdfbcc", "score": "0.5776195", "text": "def update\n respond_to do |format|\n if @dataset_format.update(dataset_format_params)\n format.html { redirect_to @dataset_format, notice: 'Dataset format was successfully updated.' }\n format.json { render :show, status: :ok, location: @dataset_format }\n else\n format.html { render :edit }\n format.json { render json: @dataset_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d25ef80f24ac76d07633edc79f20cc24", "score": "0.57423556", "text": "def update\n respond_to do |format|\n if @mformat.update(mformat_params)\n format.html { redirect_to @mformat, notice: \"Format saved\" }\n format.json { render :show, status: :ok, location: @mformat }\n else\n format.html { render :edit, error: \"Error when saving\" }\n format.json { render json: @mformat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa916ea178e5eba470a62186f8b3d4bb", "score": "0.5716924", "text": "def update\n respond_to do |format|\n if @book_format_type.update(book_format_type_params)\n format.html { redirect_to @book_format_type, notice: 'Book format type was successfully updated.' }\n format.json { render :show, status: :ok, location: @book_format_type }\n else\n format.html { render :edit }\n format.json { render json: @book_format_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40a4264cd98505406f535e3276d30dc0", "score": "0.56996983", "text": "def update\n @content_type = ContentType.find(params[:id])\n\n respond_to do |format|\n if @content_type.update_attributes(params[:content_type])\n format.html { redirect_to(@content_type, :notice => 'Content type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "efc05b1cf3c7a874baedd0b2ff6f7259", "score": "0.5688995", "text": "def update\n @vod_format = VodFormat.find(params[:id])\n\n respond_to do |format|\n if @vod_format.update_attributes(params[:vod_format])\n flash[:notice] = 'VodFormat was successfully updated.'\n format.html { redirect_to(@vod_format) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vod_format.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2086f4ce9ebb4fde8b4136da2ca697fc", "score": "0.5687974", "text": "def put(format)\n if format.is_a? Class\n format = format.new\n end\n \n @by_name[format.name] = format \n @by_mime_type[format.mime_type] = format \n @by_extension[format.extension] = format \n end", "title": "" }, { "docid": "807ad1abe8fecab11b0d2d3f42142888", "score": "0.56850934", "text": "def update\n respond_to do |format|\n if @admin_store_format.update(admin_store_format_params)\n format.html { redirect_to @admin_store_format, notice: 'Store format was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_store_format }\n else\n format.html { render :edit }\n format.json { render json: @admin_store_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be46eba8507e9fafa4486c84e78c7f98", "score": "0.56845796", "text": "def update\n @mime_type = MimeType.find(params[:id])\n\n respond_to do |format|\n if @mime_type.update_attributes(params[:mime_type])\n flash[:notice] = 'MimeType was successfully updated.'\n format.html { redirect_to mime_type_url(@mime_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mime_type.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "5cc3b01d9abdca6bcf57f6abb1925857", "score": "0.5678151", "text": "def update\n respond_to do |format|\n if @format_extent.update(format_extent_params)\n format.html { redirect_to @format_extent, notice: 'Format extent was successfully updated.' }\n format.json { render :show, status: :ok, location: @format_extent }\n else\n format.html { render :edit }\n format.json { render json: @format_extent.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b3610ce762c94d28dc6339b9a04bbd20", "score": "0.56622064", "text": "def format_fix\n unless %w{json html rss}.include? params[:format]\n params[:path] << \".#{params[:format]}\" if params[:path]\n params[:id] << \".#{params[:format]}\" if params[:id]\n params.delete 'format'\n end\n end", "title": "" }, { "docid": "0cb89163f58eac8e7a7b0671a6bdf13c", "score": "0.5581929", "text": "def update\n respond_to do |format|\n if @mime_type.update(mime_type_params)\n format.html { redirect_to @mime_type, notice: 'Mime type was successfully updated.' }\n format.json { render :show, status: :ok, location: @mime_type }\n else\n format.html { render :edit }\n format.json { render json: @mime_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ccba75b7b65ed06f167f550b294674ca", "score": "0.55637276", "text": "def set_format\n @format = Format.find(params[:id])\n end", "title": "" }, { "docid": "ccba75b7b65ed06f167f550b294674ca", "score": "0.55637276", "text": "def set_format\n @format = Format.find(params[:id])\n end", "title": "" }, { "docid": "465bc99d3c7155467b099302f90fd1cd", "score": "0.5563035", "text": "def update\n respond_to do |format|\n format.html {render :nothing => true, :status => 204}\n format.xml {render :nothing => true, :status => 204}\n format.json {render :nothing => true, :status => 204}\n end\n end", "title": "" }, { "docid": "7d868f55620039e008a54d003c439f79", "score": "0.55570114", "text": "def update\n @product_format = ProductFormat.find(params[:id])\n\n respond_to do |format|\n if @product_format.update_attributes(params[:product_format])\n format.html { redirect_to @product_format, notice: 'Product format was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9dda52bf4aebfd943198b5bf2748da7", "score": "0.5554148", "text": "def update\n respond_to do |format|\n if @videoformat.update(videoformat_params)\n format.html { redirect_to @videoformat, notice: 'Videoformat was successfully updated.' }\n format.json { render :show, status: :ok, location: @videoformat }\n else\n format.html { render :edit }\n format.json { render json: @videoformat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2bbfc383e6615e3c2132f45353dcdbd0", "score": "0.55143064", "text": "def update\n @tutorial_media_type = TutorialMediaType.find(params[:id])\n\n respond_to do |format|\n if @tutorial_media_type.update_attributes(params[:tutorial_media_type])\n format.html { redirect_to(@tutorial_media_type, :notice => 'Tutorial media type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tutorial_media_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aeeebb07a3afb077ca7bc085ef909b1a", "score": "0.5497517", "text": "def list_metadata_formats\n parameters = expect_args optional: [:identifier]\n\n respond_to do |format|\n format.xml do\n render :list_metadata_formats, locals: { supported_formats: SUPPORTED_FORMATS, parameters: parameters }\n end\n end\n end", "title": "" }, { "docid": "12ddfd0a2fd119d8a1416125a603fc50", "score": "0.5494544", "text": "def verif_format\n raise ActionController::RoutingError.new(\"Invalid format\") unless [\"json\", \"xml\"].include? params[:format]\n end", "title": "" }, { "docid": "bfa50b18769ee010d94d95b0354a30b7", "score": "0.5481526", "text": "def set_format\n @format = Format.find(params[:id])\n end", "title": "" }, { "docid": "a1654dea2c4afab80d9462a5ac2da885", "score": "0.5476623", "text": "def update\n @content_type = ContentType.find(params[:id])\n\n respond_to do |format|\n if @content_type.update_attributes(params[:content_type])\n format.html { redirect_to @content_type, notice: 'Content type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7dcf61d28367255f0ec9cea7ade341de", "score": "0.546922", "text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end", "title": "" }, { "docid": "43613bafe8057a075037380d268d4765", "score": "0.54563254", "text": "def set_provided_formats(*formats, &block)\n raise_if_content_type_already_set!\n @_provided_formats = []\n @_provided_format_arguments = {}\n provides(*formats.flatten, &block)\n end", "title": "" }, { "docid": "20524ba3c55a39ed11b8900fa46a97b4", "score": "0.5449851", "text": "def update\n respond_to do |format|\n if @tape_format.update(tape_format_params)\n format.html { redirect_to @tape_format, notice: 'Tape format was successfully updated.' }\n format.json { render :show, status: :ok, location: @tape_format }\n else\n format.html { render :edit }\n format.json { render json: @tape_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad8a6fbecb09691baaac5d79c3a13a23", "score": "0.5449777", "text": "def format(v)\r\n case @format = v\r\n when :text\r\n set_content_type(\"text/plain\")\r\n when :xml\r\n set_content_type(\"application/xml\")\r\n when :json\r\n set_content_type(\"application/json\")\r\n when :yaml\r\n set_content_type(\"text/yaml\")\r\n else\r\n set_content_type(\"application/x-www-form-urlencoded\")\r\n end\r\n end", "title": "" }, { "docid": "12bbad04a8c6e10ba240594ed4352fd7", "score": "0.54496145", "text": "def update\n respond_to do |format|\n format.xml { head :method_not_allowed }\n format.json { head :method_not_allowed }\n end\n end", "title": "" }, { "docid": "12bbad04a8c6e10ba240594ed4352fd7", "score": "0.54496145", "text": "def update\n respond_to do |format|\n format.xml { head :method_not_allowed }\n format.json { head :method_not_allowed }\n end\n end", "title": "" }, { "docid": "12bbad04a8c6e10ba240594ed4352fd7", "score": "0.54496145", "text": "def update\n respond_to do |format|\n format.xml { head :method_not_allowed }\n format.json { head :method_not_allowed }\n end\n end", "title": "" }, { "docid": "24a88f2d56df4fc948dfa4b844355618", "score": "0.5444851", "text": "def format_params\n params.require(:format).permit(:title, :description, :link, :version)\n end", "title": "" }, { "docid": "e3b3ca90007f7f8b7d11814f8572eae0", "score": "0.54207844", "text": "def set_file_format\n @file_format = FileFormat.find(params[:id])\n end", "title": "" }, { "docid": "37a676dcf557187eb490d8413eb2f781", "score": "0.5407561", "text": "def update\n authorize! :manage_content, @object\n\n # if this object has been submitted, doesnt have an open version, and isnt sitting at sdr-ingest with a hold, they cannot change it.\n return render_error('Object cannot be modified in its current state.') unless @object.allows_modification?\n return render_error('Invalid new content type.') unless valid_content_type?\n return render_error('Object doesnt have a content metadata datastream to update.') unless has_content?\n\n @object.contentMetadata.set_content_type(\n params[:old_content_type],\n params[:old_resource_type],\n params[:new_content_type],\n params[:new_resource_type]\n )\n\n respond_to do |format|\n if params[:bulk]\n format.html { render plain: 'Content type updated.' }\n else\n format.any { redirect_to solr_document_path(params[:item_id]), notice: 'Content type updated!' }\n end\n end\n @object.save\n ActiveFedora.solr.conn.add(@object.to_solr) unless params[:bulk]\n end", "title": "" }, { "docid": "cc0a1f3f256f536d490e805480523d60", "score": "0.5405696", "text": "def update\n respond_to do |format|\n if @banner_format.update(banner_format_params)\n format.html { redirect_to @banner_format, notice: 'Banner format was successfully updated.' }\n format.json { render :show, status: :ok, location: @banner_format }\n else\n format.html { render :edit }\n format.json { render json: @banner_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "847c04a19de1aaf863ea41b682a67949", "score": "0.5396823", "text": "def reformat(data, format=params[:format])\n content_type CONTENT_TYPES[format], :charset => 'utf-8'\n case format\n when 'txt'\n data.to_s\n when 'yaml'\n YAML::dump(data)\n when 'xml'\n data.to_xml\n when 'json'\n data.to_json\n else\n raise 'Unknown format: ' + format\n end\n end", "title": "" }, { "docid": "4856778ecbdb75e5d5edcc810ca1f987", "score": "0.5392101", "text": "def update\n respond_to do |format|\n if @format_form.update(format_form_params)\n format.html { redirect_to @format_form, notice: 'Format form was successfully updated.' }\n format.json { render :show, status: :ok, location: @format_form }\n else\n format.html { render :edit }\n format.json { render json: @format_form.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c1c166965e3aef299634e467e226ef9", "score": "0.5384375", "text": "def update\n @content_type = ContentType.find(params[:id])\n\n respond_to do |format|\n if @content_type.update_attributes(params[:content_type])\n format.html { redirect_to(admin_content_type_path, :notice => 'ContentType was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c924dbec77d85c5be433f38cbaee798", "score": "0.5363689", "text": "def create\n @format = Format.new(params[:format])\n\n respond_to do |format|\n if @format.save\n format.html { redirect_to(@format, :notice => 'Format was successfully created.') }\n format.xml { render :xml => @format, :status => :created, :location => @format }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @format.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c04706750bda45430c931021c5a995a7", "score": "0.53535205", "text": "def put(url, format)\n response = http.put_uri(url, serialize, format)\n handle_response(response)\n self\n end", "title": "" }, { "docid": "3daa555836d1586cdd91e6c3afcf9c7e", "score": "0.5351256", "text": "def update\n\n respond_to do |format|\n if @document_type.update_attributes(params[:document_type])\n format.html { redirect_to(@document_type, :notice => 'Document type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67047b20fd8cb2249bb6f51e81699680", "score": "0.534311", "text": "def update\n @gst_type = GstType.find(params[:id])\n\n respond_to do |format|\n if @gst_type.update_attributes(params[:gst_type])\n format.html { redirect_to gst_types_path, notice: \"#{I18n.t \"html.save_success\"}\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gst_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9f7aba13a1377376c18bc67ea70c428", "score": "0.5341559", "text": "def format=(mime_type_reference_or_format); end", "title": "" }, { "docid": "e58b4d4a1f6320c092a5baf2ad49f84f", "score": "0.5337332", "text": "def set_format_mime\n @format_mime = FormatMime.find(params[:id])\n end", "title": "" }, { "docid": "fe8ed5c45ecabf6510fc64da8afe9bc5", "score": "0.5336979", "text": "def update\n respond_to do |format|\n if @therapy_format.update(therapy_format_params)\n format.html { redirect_to @therapy_format, notice: 'Therapy format was successfully updated.' }\n format.json { render :show, status: :ok, location: @therapy_format }\n else\n format.html { render :edit }\n format.json { render json: @therapy_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f05fe289ab03dc43f153c88067216394", "score": "0.5326585", "text": "def update!(**args)\n @enabled_video_formats = args[:enabled_video_formats] if args.key?(:enabled_video_formats)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "f05fe289ab03dc43f153c88067216394", "score": "0.5326585", "text": "def update!(**args)\n @enabled_video_formats = args[:enabled_video_formats] if args.key?(:enabled_video_formats)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "dd1dfb96fd3abe6b09455ff83dac17bd", "score": "0.5320849", "text": "def update\n respond_to do |format|\n if @atom_type.update(atom_type_params)\n format.html { redirect_to @atom_type, notice: 'Atom type was successfully updated.' }\n format.json { render :show, status: :ok, location: @atom_type }\n else\n format.html { render :edit }\n format.json { render json: @atom_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bfea044dc3f6ce25ed9e8f98d41d9e4d", "score": "0.5318324", "text": "def update_rest\n @instrument_content = InstrumentContent.find(params[:id])\n\n respond_to do |format|\n if @instrument_content.update_attributes(params[:instrument_content])\n flash[:notice] = 'InstrumentContent was successfully updated.'\n format.html { redirect_to(@instrument_content) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument_content.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6109548c3281832ecabf0564bcc67946", "score": "0.5314157", "text": "def put(path, options={}, format=format)\n respond request(:put, path, options, format)\n end", "title": "" }, { "docid": "0c8345930ebb69775c19e200aad9678d", "score": "0.5301969", "text": "def update\n respond_to do |format|\n if @file_type.update(file_type_params)\n format.html { redirect_to @file_type, notice: 'File type was successfully updated.' }\n format.json { render :show, status: :ok, location: @file_type }\n else\n format.html { render :edit }\n format.json { render json: @file_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f5532e1204f333e9516d1740985b7fa", "score": "0.52972674", "text": "def update\n @file_type = FileType.find(params[:id])\n\n respond_to do |format|\n if @file_type.update_attributes(params[:file_type])\n format.html { redirect_to @file_type, notice: 'File type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @file_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8533699cbc113fd121b6a36ae6e3514c", "score": "0.5290068", "text": "def reformat(data, format=params[:format])\n content_type CONTENT_TYPES[format], :charset => 'utf-8'\n case format\n when 'txt'\n data.to_s\n when 'yaml'\n YAML::dump(data)\n when 'xml'\n data.to_xml\n when 'json'\n data.to_json\n else\n raise 'Unknown format: ' + format\n end\n end", "title": "" }, { "docid": "f4d33290448e4796f1b27c50ffd267e6", "score": "0.5285199", "text": "def update\n @disc_format = DiscFormat.find(params[:id])\n\n respond_to do |format|\n if @disc_format.update_attributes(params[:disc_format])\n format.html { redirect_to @disc_format, notice: 'Format was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disc_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0947bf046a0307e306964e7aaff56a5e", "score": "0.5276261", "text": "def update\n respond_to do |format|\n if @document_type.update_attributes(params[:document_type])\n flash[:notice] = 'Document type was successfully updated.'\n format.html { redirect_to(@document_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.5275057", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "50acb81a550392db46e5fec78c00954f", "score": "0.52727336", "text": "def update\n respond_to do |format|\n if @mediatype.update(mediatype_params)\n format.html { redirect_to @mediatype, notice: 'Mediatype was successfully updated.' }\n format.json { render :show, status: :ok, location: @mediatype }\n else\n format.html { render :edit }\n format.json { render json: @mediatype.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38448ab04266a022a4bec65518404f01", "score": "0.52725184", "text": "def update\n @type_document = TypeDocument.find(params[:id])\n\n respond_to do |format|\n if @type_document.update_attributes(params[:type_document])\n format.html { redirect_to(@type_document, :notice => 'Type document was successfully updated.') }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>@type_document}}\n \n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @type_document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4f9938984500b8bb302b714e4030c730", "score": "0.52675384", "text": "def respond_to(*formats)\n set :formats, formats\n end", "title": "" }, { "docid": "3108ce6d5637accfa2ca5f2ec36e2221", "score": "0.5264109", "text": "def edit\n @change = params[:format]\n end", "title": "" }, { "docid": "219675f818311e83d809ad50537f49e6", "score": "0.5259372", "text": "def apis\n respond_to do |format|\n format.xml\n end\n end", "title": "" }, { "docid": "3422f37ccce28549630cd8538eca1a59", "score": "0.5255136", "text": "def test_format_conversions\n formats = supported_formats\n\n formats.each do |input_format|\n restub_source('rms', input_format)\n\n formats.each do |output_format|\n restub('rms.' + output_format)\n\n tested\n\n assert_path_exists filename\n FileUtils.rm filename\n end\n end\n end", "title": "" }, { "docid": "78a3fc85f75ce32737d899f285482b0f", "score": "0.5253982", "text": "def accepted_api_formats\n @accepted_api_formats || [:xml, :json]\n end", "title": "" }, { "docid": "495049618b13c60a5c170c102f002c37", "score": "0.5251556", "text": "def full_upload_get_api_paths\n @id = params[:id]\n respond_to do |format|\n format.xml \n end\n\n end", "title": "" }, { "docid": "c282862f3d06519a849dae652e48395e", "score": "0.52377295", "text": "def update\n respond_to do |format|\n if @domain_format.update(domain_format_params)\n format.html { redirect_to @domain_format, notice: 'Domain format was successfully updated.' }\n format.json { render :show, status: :ok, location: @domain_format }\n else\n format.html { render :edit }\n format.json { render json: @domain_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e8bc4a3a774a003ffc7bc33068eb49b", "score": "0.5230731", "text": "def process_action(*) # :nodoc:\n self.formats = request.formats.filter_map(&:ref)\n super\n end", "title": "" }, { "docid": "df73891e4589d2225e5646d200b6122f", "score": "0.52278584", "text": "def update\n @census_format = CensusFormat.find(params[:id])\n\n respond_to do |format|\n if @census_format.update_attributes(params[:census_format])\n format.html { redirect_to @census_format, notice: 'Census format was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @census_format.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bcd961352efdd74545698e234d25056e", "score": "0.52237475", "text": "def update\n update! do |format|\n format.all { head :ok }\n end\n end", "title": "" }, { "docid": "9788a6f1923c1cec2472f3e06a0b7b1f", "score": "0.5220862", "text": "def update\n respond_to do |format|\n if @configuration_detail_type.update(name: params[:name], description: params[:description], configure_format: params[:cofigure_format])\n format.json { render json: @configuration_detail_type }\n end\n end\n end", "title": "" }, { "docid": "8a4aea7abf3328ab9f6e886cead6860e", "score": "0.5219981", "text": "def update\n respond_to do |format|\n if @xml_datastream.update(xml_datastream_params)\n format.html { redirect_to edit_xml_datastream_path(@xml_datastream), notice: 'Xml datastream was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @xml_datastream.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fbccb1c1cff830ab4bcec2118cdcb24f", "score": "0.5210005", "text": "def update(media_id, formats=[])\n response = make_request(\"UpdateMedia\") do |q|\n q.mediaid media_id\n formats = [formats] if !formats.kind_of?(Array)\n formats.each {|format| format.build_xml(q) }\n end\n (msg = response.xpath(\"/response/message\").text) && msg == \"Updated\"\n end", "title": "" }, { "docid": "0d22ceb884067aaaa8e45cc50ce44120", "score": "0.5209749", "text": "def edit\n @media = Media.find(params[:id])\n \n respond_to do |format|\n format.html\n format.any(:xml, :json) { render request.format.to_sym => @media }\n end\n end", "title": "" }, { "docid": "c6f71e5b958e4dcc77dc5eeac562a6ae", "score": "0.5206875", "text": "def update\n respond_to do |format|\n if @typeface.update(typeface_params)\n format.html { redirect_to @typeface, notice: 'Typeface was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @typeface.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1899be60e10c7aba45913607c4fa190c", "score": "0.5202264", "text": "def default_format_xml\n request.format = \"json\" unless params[:format]\n end", "title": "" }, { "docid": "5f427e0983e3f63367d558c6a541f550", "score": "0.5196453", "text": "def update\n respond_to do |format|\n if 1==1\n format.html { redirect_to @file, notice: 'File was successfully updated.' }\n format.json { render :show, status: :ok, location: @file }\n else\n format.html { render :edit }\n format.json { render json: @file.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ed3cb98b3d73958eb6f69f02157033b", "score": "0.5186493", "text": "def show\n @format = Format.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @format }\n end\n end", "title": "" }, { "docid": "f3311732163ffc8596b65ab58cf4f4c3", "score": "0.5184877", "text": "def destroy\n @format_type = FormatType.find(params[:id])\n @format_type.destroy\n\n respond_to do |format|\n format.html { redirect_to format_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4624ba5429da58b55374517ea141e370", "score": "0.5184041", "text": "def update\n respond_to do |format|\n if @documentation.update(documentation_params)\n format.html { redirect_to url_for(@documentation.metamorphosize),\n notice: 'Documentation was successfully updated.' }\n format.json { render :show, status: :ok, location: @documentation }\n else\n format.html { render :edit }\n format.json { render json: @documentation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89488bd1f035a2e12750965862793dfc", "score": "0.51839155", "text": "def update\n respond_to do |format|\n if @archetype.update(resource_params)\n format.html { redirect_to @archetype, notice: 'Archetype was successfully updated.' }\n format.json { render :show, status: :ok, location: @archetype }\n else\n format.html { render :edit }\n format.json { render json: @archetype.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "718b7342536bcbe7cde8c7590edf73de", "score": "0.51815665", "text": "def update\n respond_to do |format|\n if @metamediatype.update(metamediatype_params)\n format.html { redirect_to @metamediatype, notice: 'Metamediatype was successfully updated.' }\n format.json { render :show, status: :ok, location: @metamediatype }\n else\n format.html { render :edit }\n format.json { render json: @metamediatype.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7123aa4f7fc8b65060728ca6c7530bb1", "score": "0.5181391", "text": "def update!(**args)\n @content = args[:content] if args.key?(:content)\n @file_format = args[:file_format] if args.key?(:file_format)\n end", "title": "" }, { "docid": "290beddd5d19c390365af7714285d2bd", "score": "0.5174501", "text": "def mark\n @booking = _get_parents(params[:id])\n @booking.mark_for_upload(params[:rec_formats])\n\n # if there is an immediate param set to true, call the uploader\n # service manual upload url.\n start_uploader_service if !params[:immediate].blank? && params[:immediate] == 'true'\n\n respond_to do |format|\n format.html { render inline: 'ok' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c16e8da224c52c856a9283b7f7c163e0", "score": "0.51685345", "text": "def update\n @comptype = Comptype.find(params[:comptype][:id])\n\n respond_to do |format|\n if @comptype.update_attributes(params[:comptype])\n format.xml { head :ok }\n end\n end\n end", "title": "" }, { "docid": "31673fda9306a025a9ef53438789f3f9", "score": "0.5165961", "text": "def destroy\n @video_format = VideoFormat.find(params[:id])\n @video_format.destroy\n\n respond_to do |format|\n format.html { redirect_to(video_formats_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6ece290fe6dc98fc9156b4b8f137f57c", "score": "0.516265", "text": "def update\n @mediatype = Mediatype.find(params[:id])\n\n respond_to do |format|\n if @mediatype.update_attributes(params[:mediatype])\n format.html { redirect_to @mediatype, notice: 'Mediatype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mediatype.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "545dadbe32aa3d9d0edf1d22293783fc", "score": "0.5161048", "text": "def test_put_existing\n request = Http::Request.new('PUT', '/file1', {}, 'bar')\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'bar',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('bar')}\\\"\"]\n },\n response.headers\n )\n end", "title": "" } ]
04eee0db1c2c91ea433766676e0167e2
Smoke Test File! Tests! Test 1: Featured listing, click left arrow
[ { "docid": "005c2c8d3375edac1207c54ff248bdbf", "score": "0.0", "text": "def test01_D1FLT01_TC_24317\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory)\n\t\t$directory_scroll_left.click\n\t\t$directory_scroll_left.click\n\t\t$directory_scroll_left.click\n\t\t$directory_scroll_left.click\n\tend", "title": "" } ]
[ { "docid": "f7b8ee061886816e3224074f8deb1d3f", "score": "0.6844305", "text": "def test_list_page_for_current\n end", "title": "" }, { "docid": "a04fabbef35856a4f31f90bc445c2ced", "score": "0.66253537", "text": "def select_a_new_testcollection_menu\n # First we select projects\n\n open_menu('Projects')\n\n # Then our plans, based on project\n open_menu('Plans')\n\n # By now we should have all required arguments to do stuff in testlink\n # To verify this, (and also set them so we can check current_build before fetching tests)\n # We query Testcollection\n if @test_collection.prepared?\n # [{:name=>\"MDP 2.3.4.1\", :id=>778}, {:name=>\"MDP 2.3.4.11\", :id=>901}, {:name=>\"first-automation\", :id=>712}, {:name=>\"mdp_2.3.3.5_dev_1.2.11_books_1.1.5\", :id=>784}]\n # Let user pick build if there's more than 1 open build. TestCollection handles the evaluation of open_builds in other cases.\n open_menu('Builds') if @test_collection.open_builds.length > 1\n\n puts 'Fetching tests, this may take a while...'\n print \"Tests found: \"\n fetch_tests do |i|\n print i\n sleep 0.01\n i.to_s.length.times { print \"\\b\"}\n end\n open_menu('Tests')\n end\n # And then save, or save + run now\n\n end", "title": "" }, { "docid": "7fa52533235ddfbc63d5e92853646408", "score": "0.64009154", "text": "def test02_find_more_top_right_TC_24407\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch)\n\t\tsleep 2\n\t\t$group_more_groups_top.fire_event(\"onclick\")\n\t\tsleep 2\n\n\t\tassert $browser.text.include? \"Featured Groups\"\n\tend", "title": "" }, { "docid": "246f59123b395f7cb5eb1f122d833c49", "score": "0.63969123", "text": "def testDetailedListShort\n executeInstall(['-e'])\n end", "title": "" }, { "docid": "503f8a46e10fbd420979e669b71956d9", "score": "0.6361744", "text": "def test05_L1DLT05_TC_24418\n\t\t$browser.goto($patch_login)\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_listing_manager.when_present.click\n\t\t\n\t\tsleep 2\n\t\tassert $browser.text.include? \"Recent Activity\"\n\tend", "title": "" }, { "docid": "1a3ea19ce4ee511458b4c53177224ff4", "score": "0.63580847", "text": "def test_searchList\r\n end", "title": "" }, { "docid": "2faec81c1146de2fc79ad0f350f0d6df", "score": "0.63120455", "text": "def test_dtm_st_053\n printf \"\\n+ Test 053\"\n open_target_setting_page\n assert $display_metric[\"add_subtask_button\"], @selenium.get_text($display_metric_xpath[\"add_subtask_button\"])\n logout\n end", "title": "" }, { "docid": "1bc7eedee06047b445325f7f0f833c87", "score": "0.6277264", "text": "def test_add_item_tools_menu_index_0\n menu = UI.menu(\"Tools\")\n item = menu.add_item(\"Test\", 0) {}\n assert_not_nil(item)\n end", "title": "" }, { "docid": "f3d278d6c785c154f9158565e9178753", "score": "0.62445563", "text": "def test_add_item_cmd_file_index_1\n cmd = UI::Command.new(\"Test\") {}\n cmd.menu_text = \"File Command 1\"\n item = UI.menu(\"File\").add_item(cmd, 1)\n assert_not_nil(item)\n end", "title": "" }, { "docid": "66910376c3606e6f370bf49e05b56799", "score": "0.62357974", "text": "def testListShort\n executeInstall(['-l'])\n end", "title": "" }, { "docid": "00d34ac456a68fbc4cb7682665786f5f", "score": "0.62164575", "text": "def test_index\n login\n get(:index)\n\n assert_displayed_title(\"Locations by Name\")\n end", "title": "" }, { "docid": "1fb83e6c1694a9f2b4f44ec12364b450", "score": "0.62116814", "text": "def testDetailedList\n executeInstall(['--detailedlist'])\n end", "title": "" }, { "docid": "d65b853572dccddda61f6f1bbab934a4", "score": "0.6185599", "text": "def browse_by_menu_list\n\t\t$tracer.trace(__method__)\n\t\t# unit_test_no_generate: browse_by_menu_list, div.className(create_ats_regex_string(\"ats-browsebytab\")); ImpulseHeaderMenuList\n\t\treturn ImpulseHeaderMenuList.new(ToolTag.new(div.className(create_ats_regex_string(\"ats-browsebytab\")), __method__, self), self)\n\tend", "title": "" }, { "docid": "71b7d9e719e7ac223de91f7581f54928", "score": "0.61795527", "text": "def test_add_item_help_menu_index_0\n menu = UI.menu(\"Help\")\n item = menu.add_item(\"Test\", 0) {}\n assert_not_nil(item)\n end", "title": "" }, { "docid": "b68b84f995dc329e224b18a500da8992", "score": "0.6170973", "text": "def test_should_show_story_on_index\r\n get :index\r\n assert_select 'h2', 'Showing 1 front page story'\r\n assert_select 'div#content div.story', :count => 1\r\n end", "title": "" }, { "docid": "69d5dc26b0555ad554893f13081b6401", "score": "0.61281806", "text": "def atest_ID_25853_manage_groups_ui\n #This test is covered by : test_ID_25851_ui_of_the_manage_group\n end", "title": "" }, { "docid": "1c89885ac4fac57e656d4089db25cd58", "score": "0.6115444", "text": "def test_click_headlines\n \t@browser.goto \"http://www.nytimes.com/column/state-of-the-art\"\n\n=begin\n\t\th2s = @browser.h2s :class => \"headline\"\n\t\tassert h2s.length > 0\n\t\theadlines = Array.new\n\t\th2s.each do |h2|\n\t\t\theadlines << h2.text\n\t\t\t#assert @browser.text.include? headline\n\t\t\t#@browser.back\n\t\tend\n\n=end\n\n\t\tlinks = @browser.links :class => \"story-link\"\n\t\tassert links.length > 0\n\t\t\n\t\tlinks.each_with_index do |link,index|\n \t\t\tputs links[index].text\n \t\t\tlinks[index].click\n \t\t\t@browser.back\n \t\t\tlinks = @browser.links :class => \"story-link\"\n\t\tend\t\n\n\n\tend", "title": "" }, { "docid": "424f2b00ed70207c1eafa8be9a1e0e51", "score": "0.61148584", "text": "def lettered_list_rendering_test_method; end", "title": "" }, { "docid": "cd0410cc57556171d3b0bbf7fec06587", "score": "0.6098895", "text": "def test_add_item_camera_menu_index_0\n menu = UI.menu(\"Camera\")\n item = menu.add_item(\"Test\", 0) {}\n assert_not_nil(item)\n end", "title": "" }, { "docid": "92ad99fe969fdfd71d8f527fe5fe38b1", "score": "0.6097328", "text": "def test02_LI2_view_event\n\t\t$browser.goto($patch_login)\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_directory_listing)\n\t\t$directory_upcoming_events.click\n\t\t\n\t\tsleep 5\n\t\tassert assert $browser.text.include? \"All Events\"\n\tend", "title": "" }, { "docid": "90fc37b5bd2324fa250032e2e615c31e", "score": "0.6094618", "text": "def test_037\n #login\n login\n # PU management page\n open_pu_management_page_1\n #A new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n #PU index page\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n # Pu setting page\n click $xpath[\"misc\"][\"PU_setting_page\"]\n sleep 4\n # open a subwindow\n click $xpath[\"misc\"][\"analyze_rule_numbers\"]\n sleep 4\n\n # \"Selection\" link under a QAC analytical rule setup is clicked.\n #The minimum analytical rule number of QAC is 9.\n # first rule number is checked.\n assert_equal \"9\", get_text($xpath[\"misc\"][\"rule_list_tr1\"])\n\n\n #logout\n logout\n\n end", "title": "" }, { "docid": "7b672ff27e5369f8e7c1629c7bfa12ae", "score": "0.609049", "text": "def test_add_item_cmd_file_no_index\n cmd = UI::Command.new(\"Test\") {}\n cmd.menu_text = \"File Command\"\n item = UI.menu(\"File\").add_item(cmd)\n assert_not_nil(item)\n end", "title": "" }, { "docid": "e3da59aed01b3954a272b13f36df1347", "score": "0.6089248", "text": "def test_add_item_submenu_submenu_index\n tools_menu = UI.menu(\"Tools\")\n submenu = tools_menu.add_submenu(\"&Submenu Tests\")\n item = submenu.add_item(\"Zero\", 0) {}\n assert_not_nil(item)\n end", "title": "" }, { "docid": "e0021d4f3ff42122c465640aed52748b", "score": "0.60888755", "text": "def test02_find_more_top_right_TC_24407\n\t\t\n\t\tloginGroup\n\t\t$group_more_groups_top.when_present.fire_event(\"onclick\")\n\t\tsleep 2\n\t\t\n\t\tbegin\n\t\tassert $browser.text.include? \"Featured Groups\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"GS1_T2: FAILED! Unable click top Find More Groups link.\"\n\t\tend\t\n\tend", "title": "" }, { "docid": "0f5eae35330d873a10f3f76e88beb265", "score": "0.6080788", "text": "def test_add_item_cmd_tools_index_1\n cmd = UI::Command.new(\"Test\") {}\n cmd.menu_text = \"Tools Command 1\"\n item = UI.menu(\"Tools\").add_item(cmd, 1)\n assert_not_nil(item)\n end", "title": "" }, { "docid": "6c4dfff5d3595855effcc2758531af11", "score": "0.6080333", "text": "def tests_and_quizzes\n # Need this logic to determine whether user\n # is a student or instructor/admin\n @browser.link(:class, \"icon-sakai-siteinfo\").exist? ? x=0 : x=1\n @browser.link(:text=>\"Tests & Quizzes\").click\n x==0 ? AssessmentsList.new(@browser) : TakeAssessmentList.new(@browser)\n end", "title": "" }, { "docid": "6c4dfff5d3595855effcc2758531af11", "score": "0.6080333", "text": "def tests_and_quizzes\n # Need this logic to determine whether user\n # is a student or instructor/admin\n @browser.link(:class, \"icon-sakai-siteinfo\").exist? ? x=0 : x=1\n @browser.link(:text=>\"Tests & Quizzes\").click\n x==0 ? AssessmentsList.new(@browser) : TakeAssessmentList.new(@browser)\n end", "title": "" }, { "docid": "ff88b3d8924ef0eeaa566150e0ed203b", "score": "0.6067311", "text": "def test_wd_st_009\n printf \"\\n+ Test 009\"\n open_diff_result_summary_page(1)\n file_name = @selenium.get_text($diff_result_summary_xpath[\"file_link\"])\n click $diff_result_summary_xpath[\"file_link\"]\n sleep SLEEP_TIME\n assert is_text_present($diff_result_summary[\"summary_page_title\"].sub(\"__INDEX__\",file_name))\n logout\n end", "title": "" }, { "docid": "ea34198946902a21e68ade38db713cab", "score": "0.6061816", "text": "def test_wd_st_007\n printf \"\\n+ Test 007\"\n open_diff_result_summary_page(1)\n module_name = @selenium.get_text($diff_result_summary_xpath[\"module_link\"])\n click $diff_result_summary_xpath[\"module_link\"]\n sleep SLEEP_TIME\n assert is_text_present($diff_result_summary[\"summary_page_title\"].sub(\"__INDEX__\",module_name))\n logout\n end", "title": "" }, { "docid": "b0e153a52c3eb14a2468326af2f848a2", "score": "0.6059544", "text": "def test02_D1FLT04_TC_24428_24316\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory)\n\t\t$directory_title.fire_event(\"onclick\")\n\t\t\n\t\tbegin\n\t\tassert $directory_business.exists?\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"D1FLT04: FAILED! Unable to click directory listing\"\n\t\tend\t\t\t\n\tend", "title": "" }, { "docid": "910765e40fe37dde7b754c7363a1a814", "score": "0.6055897", "text": "def test_wd_st_003\n printf \"\\n+ Test 003\"\n login\n sleep SLEEP_TIME\n assert @selenium.is_element_present($diff_administration_xpath[\"menu_link\"])\n click $diff_administration_xpath[\"menu_link\"]\n assert @selenium.is_text_present($diff_administration[\"title\"])\n logout\n end", "title": "" }, { "docid": "5a4368df559844a140ba9e8390368f2b", "score": "0.60383296", "text": "def test_add_item_edit_menu_index_0\n menu = UI.menu(\"Edit\")\n item = menu.add_item(\"Test\", 0) {}\n assert_not_nil(item)\n end", "title": "" }, { "docid": "8f60e4d3506f34948274b8f8b2cc339c", "score": "0.60287774", "text": "def test_add_item_cmd_camera_index_1\n cmd = UI::Command.new(\"Test\") {}\n cmd.menu_text = \"Camera Command 1\"\n item = UI.menu(\"Camera\").add_item(cmd, 1)\n assert_not_nil(item)\n end", "title": "" }, { "docid": "df9b3144a11ba11ba1dd032f05f6f87e", "score": "0.60272145", "text": "def test_dtm_st_002\n printf \"\\n+ Test 002\"\n login\n open \"/devgroup/pu_index/1\"\n sleep SLEEP_TIME\n assert_equal $display_metric[\"name\"], @selenium.get_text($display_metric_xpath[\"menu\"])\n logout\n end", "title": "" }, { "docid": "e69424962b677da6e4f3355fe8fbdeb1", "score": "0.60230196", "text": "def load_a_saved_testcollection_menu\n\n file_path = @cli.ask(\"Enter path/filename to load testcollection from \")do |q|\n q.default = \"./tests.torti\"\n end\n\n\n @test_collection.load!(file_path)\n\n puts 'TestCollection loaded!'\n sleep 1\n\n end", "title": "" }, { "docid": "b7584b3f0e675487035367ee3eedc8bd", "score": "0.6012125", "text": "def testCommandLineDetailedList\n executeMaster( [ '--detailedlist' ] )\n end", "title": "" }, { "docid": "10f508ff46f73af8a17e081de40789cb", "score": "0.60072595", "text": "def testcase_grader\n end", "title": "" }, { "docid": "3897136cfeb61acd564acc994c8cfaf2", "score": "0.60037494", "text": "def test_p1_00150_homepage_feature_a_disc\n @homepage.network_landing($network)\n @homepage.about_login(\"regular\", \"logged\")\n @homepage.topic_detail(\"A Watir Topic\")\n @homepage.choose_post_type(\"discussion\")\n @homepage.conversation_detail(\"discussion\")\n conv_title = @homepage.conv_title.text\n if @homepage.conv_feature.present?\n @homepage.unfeature_root_post\n end\n @homepage.feature_root_post\n @homepage.goto_homepage\n @homepage.check_featured_discussion_widget\n @homepage.check_featured_discussion_icon\n @homepage.check_featured_discussion_conv\n assert @homepage.featured_discussion_conv.text.include? conv_title\n\n @homepage.check_featured_d_conv_link\n @homepage.unfeature_root_post\n @homepage.goto_homepage\n @homepage.check_featured_discussion_widget\n @homepage.check_featured_discussion_conv\n assert (@homepage.featured_discussion_conv.text.include?(conv_title) != true)\n @homepage.newline\n end", "title": "" }, { "docid": "7aaaacbe9dbaebc8d1a2904c6f895bb1", "score": "0.60035235", "text": "def test_add_item_edgecases\n plugins_menu = UI.menu(\"Plugins\")\n item = plugins_menu.add_item(\"Test\") {}\n assert_not_nil(item)\n end", "title": "" }, { "docid": "428b5d1eaf9535043f41374ccd294f0d", "score": "0.5991825", "text": "def test_steps; end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.5991271", "text": "def tests; end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.5991271", "text": "def tests; end", "title": "" }, { "docid": "18a44f342e301d47ad65a321e0df54e8", "score": "0.5990627", "text": "def second_bulleted_list_rendering_test_method; end", "title": "" }, { "docid": "327c8a72c08fb60b904e51ff0a9d1307", "score": "0.5982649", "text": "def scenario; end", "title": "" }, { "docid": "327c8a72c08fb60b904e51ff0a9d1307", "score": "0.5982649", "text": "def scenario; end", "title": "" }, { "docid": "0dd0f7830a9a0b1151fa537122eeb7bf", "score": "0.5979627", "text": "def test_051\n #login\n login\n # PU management page\n open_pu_management_page_1\n #A new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n #PJ management page\n open_pj_management_page(@@pu.id)\n # A new PJ\n\n\n @@pj = Pj.find_by_name('SamplePJ1')\n #Task setting page\n open(\"/task/add_task2/#{@@pu.id}/#{@@pj.id}\")\n wait_for_page_to_load \"30000\"\n\n #Execution setting tab\n click $xpath[\"misc\"][\"execution_setting_tab\"]\n sleep 4\n # The message which tells renewal of an execution setup is displayed on the screen upper left.\n type \"make_options\", \"options\"\n #Click save a setup button\n click $xpath[\"misc\"][\"save_a_setup_button\"]\n sleep 4\n assert get_text(\"log_contents\").include?(_(\"Execution setting was updated.\"))\n\n\n\n #logout\n logout\n\n end", "title": "" }, { "docid": "4951a779954b8c3ec1c55d99b8575094", "score": "0.597928", "text": "def test_add_item_cmd_tools_no_index\n cmd = UI::Command.new(\"Test\") {}\n cmd.menu_text = \"Tools Command\"\n item = UI.menu(\"Tools\").add_item(cmd)\n assert_not_nil(item)\n end", "title": "" }, { "docid": "3c981dc9aa505648671fcb0ae751a0ef", "score": "0.59679496", "text": "def show_feature_detail\n @testresults = Testresult.get_test_result_with_feature_name(params[:feature_name])\n end", "title": "" }, { "docid": "70eaaf344c72d71bb7cf0dc88917cf90", "score": "0.5955247", "text": "def task_list_open\n #task_list_button = buttons.detect {|item| item.text == \"Task List\"}\n task_list_button.click\n end", "title": "" }, { "docid": "09883716eca68f09603e828ecc13dae0", "score": "0.5949732", "text": "def solutions_tab\r\n \t@browser.a(:xpath, \"//div/div[2]/ul/li[2]/a\").when_present.click\r\n end", "title": "" }, { "docid": "18b39c478bf14f970353f379b84a9470", "score": "0.5948319", "text": "def test_055\n #login\n login\n # PU management page\n open_pu_management_page_1\n #A new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n #PJ management page\n open_pj_management_page(@@pu.id)\n # A new PJ\n\n\n @@pj = Pj.find_by_name('SamplePJ1')\n #Task setting page\n open(\"/task/add_task2/#{@@pu.id}/#{@@pj.id}\")\n wait_for_page_to_load \"30000\"\n\n #Execution setting tab\n click $xpath[\"misc\"][\"execution_setting_tab\"]\n sleep 4\n select \"tool_name\", \"label=qacpp\"\n sleep 4\n # The message which tells renewal of an execution setup is displayed on the screen upper left.\n type \"make_options\", \"options\"\n #Click save a setup button\n click $xpath[\"misc\"][\"save_a_setup_button\"]\n sleep 4\n assert get_text(\"log_contents\").include?(_(\"Execution setting was updated.\"))\n\n\n #logout\n logout\n\n end", "title": "" }, { "docid": "092d7e27c204390ecfe6dff427af4f0e", "score": "0.59339046", "text": "def test03_flag_board_post_admin\n\tlogin $admin_1_email, $master_password\n\t$browser.goto($patch_news_school_group)\n\tsleep 4 \n\t$news_page_top_post_link.click #select first post listed\n\twait_for_ajax\n\tassert $post_delete_post.exists?\n\t@title = $post_headline_title.text\n\n\t$post_flag_link.click\n sleep 4 \n assert $browser.text.include? \"Flag this content?\"\n \n $post_flag_submit.click\n sleep 4\n assert !($browser.text.include? @title) #verify article is not listed in the news section anymore\t\n end", "title": "" }, { "docid": "3b60c88ad9e0ffab3d4bb2a901823db1", "score": "0.59272945", "text": "def test_054\n #login\n login\n # PU management page\n open_pu_management_page_1\n #A new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n #PJ management page\n open_pj_management_page(@@pu.id)\n # A new PJ\n\n\n @@pj = Pj.find_by_name('SamplePJ1')\n #Task setting page\n open(\"/task/add_task2/#{@@pu.id}/#{@@pj.id}\")\n wait_for_page_to_load \"30000\"\n\n #Execution setting tab\n click $xpath[\"misc\"][\"execution_setting_tab\"]\n sleep 4\n type \"make_options\", \"options\"\n click $xpath[\"misc\"][\"save_a_setup_button\"]\n sleep 4\n # Text area replaces setup information just before changing to a setup of QAC++.\n select \"tool_name\", \"label=qacpp\"\n sleep 4\n select \"tool_name\", \"label=qac\"\n sleep 4\n assert_equal \"options\", get_value(\"make_options\")\n\n #logout\n logout\n\n end", "title": "" }, { "docid": "316d7acc62cc36e7767cdd711103195a", "score": "0.5924945", "text": "def test_add_item_cmd_help_index_1\n cmd = UI::Command.new(\"Test\") {}\n cmd.menu_text = \"Help Command 1\"\n item = UI.menu(\"Help\").add_item(cmd, 1)\n assert_not_nil(item)\n end", "title": "" }, { "docid": "d285330569724a97a8aa752c68ec3296", "score": "0.5924295", "text": "def test_add_item_plugins_menu_index_0\n menu = UI.menu(\"Plugins\")\n item = menu.add_item(\"Test\", 0) {}\n assert_not_nil(item)\n end", "title": "" }, { "docid": "63860ae6163d773f963ed1e75025c225", "score": "0.59229434", "text": "def show\n @test_cases = @scenario.test_cases\n end", "title": "" }, { "docid": "5e05942615855cc379a99abef728ac22", "score": "0.5904184", "text": "def test_add_item_draw_menu_index_0\n menu = UI.menu(\"Draw\")\n item = menu.add_item(\"Test\", 0) {}\n assert_not_nil(item)\n end", "title": "" }, { "docid": "33116f57e0bd3987e8fcec82d725b214", "score": "0.59010476", "text": "def testCase_8\n puts \"\\nTest case: 8. Click on random freelancer's title\"\n # NOTE: If was clicked on Freelancers' TITLE - his name appears in browser title\n puts \"RandomIndex: #{getRandomIndex+1}\" #DEBUG:\n title_link = @driver.find_elements(:class, 'air-card-hover')[getRandomIndex]\n .find_element(:class, 'display-inline-block').find_element(:class, 'freelancer-tile-name')\n # NOTE: If was clicked on section --- search result title will be displayed on the browser title.\n puts \"Clicked on '#{@FcSearchResult[getRandomIndex].getFcName}' title: #{title_link.click==nil ? 'Passed':'Failed'}\"\nend", "title": "" }, { "docid": "9f316d60021a03a1c538c4c45d7c1ce7", "score": "0.58987695", "text": "def test_add_item_cmd_camera_no_index\n cmd = UI::Command.new(\"Test\") {}\n cmd.menu_text = \"Camera Command\"\n item = UI.menu(\"Camera\").add_item(cmd)\n assert_not_nil(item)\n end", "title": "" }, { "docid": "a9f4c2a19b80ba89e2afaa1cdd14095b", "score": "0.589747", "text": "def test_case; end", "title": "" }, { "docid": "a9f4c2a19b80ba89e2afaa1cdd14095b", "score": "0.589747", "text": "def test_case; end", "title": "" }, { "docid": "ec9de1305599b2c0a06f14f10f05d56d", "score": "0.5894376", "text": "def test_add_item_cmd_view_index_1\n cmd = UI::Command.new(\"Test\") {}\n cmd.menu_text = \"View Command 1\"\n item = UI.menu(\"View\").add_item(cmd, 1)\n assert_not_nil(item)\n end", "title": "" }, { "docid": "118030ed2051d3ef52d0bd3ed6807cc2", "score": "0.58724487", "text": "def test_add_item_window_menu_index_0\n menu = UI.menu(\"Window\")\n item = menu.add_item(\"Test\", 0) {}\n assert_not_nil(item)\n end", "title": "" }, { "docid": "d2cb44957dd8d96aa3b19f578eb76ddd", "score": "0.587062", "text": "def test_create_todo_list\n assert_equal(1,@todo_list.count)\n assert_equal(\"My List\",@todo_list.title)\n end", "title": "" }, { "docid": "db8aa4569c44d36e01cfd95f0864408d", "score": "0.5859219", "text": "def test_wd_st_016\n printf \"\\n+ Test 016\"\n open_diff_administration_page\n selected_pu_id = @selenium.get_selected_value($diff_administration_xpath[\"new_pj_select\"])\n tasks = Task.find_all_by_pj_id(selected_pu_id)\n all_tasks = []\n tasks.each do |task|\n all_tasks << task.name\n end\n new_tasks = @selenium.get_select_options($diff_administration_xpath[\"new_task_select\"])\n assert_equal all_tasks, new_tasks\n logout\n end", "title": "" }, { "docid": "ef4e2e3888fa81719d1e53c5a0e95e59", "score": "0.5854181", "text": "def test_045\n #login\n login\n # PU management page\n open_pu_management_page_1\n #A new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n #PJ management page\n open_pj_management_page(@@pu.id)\n # A new PJ\n\n\n @@pj = Pj.find_by_name('SamplePJ1')\n #PU index page\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n # Pu setting page\n click $xpath[\"misc\"][\"PU_setting_page\"]\n sleep 4\n\n click $xpath[\"misc\"][\"save_all_setup_button\"]\n sleep 4\n assert get_text(\"log_contents\").include?(_(\"PU setting was saved.\"))\n\n\n #logout\n logout\n\n end", "title": "" }, { "docid": "f42960d19f7bfd4375a1d92c13005575", "score": "0.5851754", "text": "def test04_flag_board_post_editor\n\tlogin $admin_1_email, $master_password\n\t$browser.goto($patch_news_school_group)\n\tsleep 4 \n\t$news_page_top_post_link.click #select first post listed\n\twait_for_ajax\n\tassert $post_delete_post.exists?\n\t@title = $post_headline_title.text\n\n\t$post_flag_link.click\n sleep 4 \n assert $browser.text.include? \"Flag this content?\"\n \n $post_flag_submit.click\n sleep 4\n assert !($browser.text.include? @title) #verify article is not listed in the news section anymore\t\n end", "title": "" }, { "docid": "6f0efb5d3469799f6109817c5db0ded4", "score": "0.58513725", "text": "def test_should_show_list\n login_as :admin\n \n # No parameters.\n get :list\n assert_response :success\n assert_template 'list'\n assert_equal assigns(:title), \"Manage Sections\"\n assert_not_nil assigns(:sections)\n end", "title": "" }, { "docid": "651f8cb3f49a34ff2bba72cc4d731295", "score": "0.58504015", "text": "def test_058\n #login\n login\n # PU management page\n open_pu_management_page_1\n #A new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n #PJ management page\n open_pj_management_page(@@pu.id)\n # A new PJ\n\n\n @@pj = Pj.find_by_name('SamplePJ1')\n #Task setting page\n open(\"/task/add_task2/#{@@pu.id}/#{@@pj.id}\")\n wait_for_page_to_load \"30000\"\n\n #Execution setting tab\n click $xpath[\"misc\"][\"execution_setting_tab\"]\n sleep 4\n\n # Text area replaces setup information just before changing to a setup of QAC.\n select \"tool_name\", \"label=qac\"\n sleep 4\n select \"tool_name\", \"label=qacpp\"\n sleep 4\n type \"make_options\", \"options\"\n assert_equal \"options\", get_value(\"make_options\")\n\n\n #logout\n logout\n\n\n\n end", "title": "" }, { "docid": "914c35c3d485371458bd979179102ebf", "score": "0.5848288", "text": "def test_039\n #login\n login\n # PU management page\n open_pu_management_page_1\n #A new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n #PU index page\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n # Pu setting page\n click $xpath[\"misc\"][\"PU_setting_page\"]\n sleep 4\n # \"Selection\" link under a QAC++ analytical rule setup is clicked.\n click $xpath[\"misc\"][\"analytical_rule_setup\"]\n sleep 4\n # The minimum analytical rule number of QAC++ is 10.\n # first rule number is checked.\n assert_equal \"10\", get_text($xpath[\"misc\"][\"rule_list_tr1\"])\n\n\n #logout\n logout\n\n end", "title": "" }, { "docid": "afaf12e762f10d9b13fbc44ba242de9a", "score": "0.58463204", "text": "def test_001\n test_000\n login(\"root\",\"root\")\n ## open default pu \"SamplePU1\".\n open_pu_member_page(SAMPLE_PU)\n ## user pj_member has been added in fixtures.\n all_members = @selenium.get_select_options($link_texts[\"pu_user\"][\"member\"])\n assert_not_equal all_members.index(USER_LAST_NAME),nil\n logout\n end", "title": "" }, { "docid": "60fcd1997945a8c518615646e92bca9f", "score": "0.5843263", "text": "def test_wd_st_020\n printf \"\\n+ Test 020\"\n open_diff_administration_page\n selected_pu_id = @selenium.get_selected_value($diff_administration_xpath[\"old_pj_select\"])\n tasks = Task.find_all_by_pj_id(selected_pu_id)\n all_tasks = []\n tasks.each do |task|\n all_tasks << task.name\n end\n new_tasks = @selenium.get_select_options($diff_administration_xpath[\"old_task_select\"])\n assert_equal all_tasks, new_tasks\n logout\n end", "title": "" }, { "docid": "3f280c87fe3f8e9fdf293a6a5315df33", "score": "0.5843145", "text": "def test_step; end", "title": "" }, { "docid": "3f280c87fe3f8e9fdf293a6a5315df33", "score": "0.5843145", "text": "def test_step; end", "title": "" }, { "docid": "3f280c87fe3f8e9fdf293a6a5315df33", "score": "0.5843145", "text": "def test_step; end", "title": "" }, { "docid": "3f280c87fe3f8e9fdf293a6a5315df33", "score": "0.5843145", "text": "def test_step; end", "title": "" }, { "docid": "15f3d747475fbc6cc6a403aeb995b041", "score": "0.58427525", "text": "def test_numbered_lists\n end", "title": "" }, { "docid": "af49a3162fa0dcd42b750479023b8f12", "score": "0.58345556", "text": "def test_alpha_lists\n end", "title": "" }, { "docid": "ef4675cf367dae8a06bfea6fa4b72738", "score": "0.58244395", "text": "def init_menu\n @menus.set_selected(\"tests\")\n end", "title": "" }, { "docid": "1af7415f4bc3d1294c2948fd241238ef", "score": "0.5823848", "text": "def test_add_item_cmd_help_no_index\n cmd = UI::Command.new(\"Test\") {}\n cmd.menu_text = \"Help Command\"\n item = UI.menu(\"Help\").add_item(cmd)\n assert_not_nil(item)\n end", "title": "" }, { "docid": "422c05e843bfec1c923702b17234e67e", "score": "0.5823303", "text": "def test_004\n test_000\n login(\"root\",\"root\")\n ## add user \"pj_member\" to pu admin list\n add_pu_admin\n ## open pj admin page\n open_pj_admin_page(SAMPLE_PU,SAMPLE_PJ)\n begin\n assert_equal [\"#{USER_LAST_NAME}\"], @selenium.get_select_options($link_texts[\"pj_user\"][\"admin\"])\n rescue Test::Unit::AssertionFailedError\n printf \"This Test Fail!\\n\"\n @verification_errors << $!\n end\n logout\n end", "title": "" }, { "docid": "262d8c08f8f9db8fea32db7551226410", "score": "0.58231425", "text": "def select_puppy(name = 'Maggie Mae')\n index = index_for(name)\n # view_detail_elements[index].click\n button_element(:value => 'View Details' , :index => index).click\n end", "title": "" }, { "docid": "78bc3734981b5a13e5df5a35f314ba18", "score": "0.58167046", "text": "def test_TrainingMaterial\n\nbegin\n\n @@title=$title\n $action.open($link+\"/Stuff/TrainStuffList.aspx\")\n assert_equal(@@loginpage.getTitle,\"EF Online Academy\")\n @@trainingmaterialpage.addNew\n @@trainingmaterialpage.formatType(\"PDF\")\n @@trainingmaterialpage.title(@@title)\n @@trainingmaterialpage.description(\"sunnytestAutomation\")\n @@trainingmaterialpage.trainingTime(\"10\")\n @@trainingmaterialpage.uniqueId(Time.now.to_s)\n @@trainingmaterialpage.selectlocalfile(\"C:\\\\Users\\\\sunny.yu2\\\\Desktop\\\\test.pdf\")\n @@trainingmaterialpage.selectsourcefile(\"C:\\\\Users\\\\sunny.yu2\\\\Desktop\\\\test.pdf\")\n @@trainingmaterialpage.top\n @@trainingmaterialpage.shareFile\n @@trainingmaterialpage.tag\n sleep 3\n @@trainingmaterialpage.ok\n sleep 6\n @@trainingmaterialpage.titleFilter(\"jifjisdjsi \")\n @@trainingmaterialpage.search\n sleep 3\n\n assert($action.findelementByName(\"ctl00$cphMain$rptList$ctl00$imgBtnEdit\"))\n $log.puts(__method__.to_s+\" -------------------pass \\n\")\n\n rescue\n $log.puts(__method__.to_s+\" -------------------fail \\n\")\n $action.screenshot($path)\n puts \":error:#{$!}-----at:#{$@} \\n\"\n end\n end", "title": "" }, { "docid": "1068832c8229c37488788b46a0871f26", "score": "0.5814494", "text": "def testing\n end", "title": "" }, { "docid": "6720ef87a124e6fa82d8493366b238be", "score": "0.5814384", "text": "def testCommandLineDetailedListShort\n executeMaster( [ '-e' ] )\n end", "title": "" }, { "docid": "23aedb1f4ff28280dbb6767747232632", "score": "0.5811942", "text": "def test_all\n\t\ttest_cmd_list\n\t\ttest_cmd_mkd\n\t\ttest_cmd_stor\n\tend", "title": "" }, { "docid": "ce8fb785395545906b7d6c48db34ddb6", "score": "0.5810503", "text": "def test_current_menu\n\t\tcurrent_savings_link = @my_driver.find_element(:xpath, '//*[@id=\"nav\"]/div/div/div[2]/ul[1]/li[2]/a')\n\t\tcurrent_savings_link.click\n\t\tputs \"Current & Savings link click successful\"\n\t\tonline_banking_link = @my_driver.find_element(:link, 'Online Banking')\n\t\tonline_banking_link.click\n\t\t@open_accounts_title = @wait.until {@my_driver.find_elements(:xpath, '//html/body/div[4]/div/div')}\n\t\tputs \"-->#{@open_accounts_title[0].text}\"\n\t\tassert(@open_accounts_title[0].text, @online_banking_slide_title)\n\t\t@open_accounts_button = @wait.until {@my_driver.find_element(:link, 'Apply Now')}\n\t\tputs \"Online Banking link click successfully navigated to the right\"\n\tend", "title": "" }, { "docid": "5b634708a946345e068cd5af7691f967", "score": "0.5809595", "text": "def test_wd_st_007\n printf \"\\n+ Test 007\"\n open_diff_administration_page\n assert @selenium.is_element_present($diff_administration_xpath[\"execute_diff_button\"])\n logout\n end", "title": "" }, { "docid": "f1aabc4418ed2205a71febbc310b89be", "score": "0.5809252", "text": "def test_bot_tour_test\n # This is set by the crud_dsl, from application_test. It makes sure we don't run a show test if theres no show action\n tests = defined?(current_crud_tests) ? current_crud_tests : []\n tests = tests - [:tour, 'tour'] # Ensure tour doesn't somehow get in here, as it'll recurse forever\n\n tests.each { |test| send(\"test_bot_#{test}_test\") }\n\n visit resources_path\n save_test_bot_screenshot\n end", "title": "" }, { "docid": "df253471434dfaf9b1597f6ac46e844e", "score": "0.5807521", "text": "def test_wd_st_028\n printf \"\\n+ Test 028\"\n open_diff_administration_page\n click $diff_administration_xpath[\"diff_result\"]\n sleep SLEEP_TIME\n assert is_text_present($diff_administration[\"title\"])\n logout\n end", "title": "" }, { "docid": "12fc31b3992ccb9bc3861a2f7a0c0808", "score": "0.5803949", "text": "def test_case_index; end", "title": "" }, { "docid": "2e260924bf5d2f2e26b8407e178a6842", "score": "0.5801106", "text": "def show\n @title = @test_case.name\n end", "title": "" }, { "docid": "06672fe2493b09f36b3a36f7b39c78fb", "score": "0.5800587", "text": "def test02_recommend_event_landing_sorted\n\t\tlogin $user_2_email, $master_password\n\t\t$browser.goto($patch_new_event)\n\t\tcreate_event \"Event for Recommend Sorted Landing #{random}\"\n\t\tsleep 2\n\t\tlogout_common\n\t\tsleep 15 #lets content populate properly\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_event_landing)\n\t\twait_for_ajax\n\t\tsleep 3\n\t\t$events_family.click\n\t\tsleep 2\n\t\tassert $events_family_header.exists?\n\n\t\t$post_recommend_icon.click\n\t\tsleep 1\n\t\tassert $browser.text.include? \"Thanks for helping your neighbors find the good stuff.\"\n\t\t$post_recommend_flash_close.click\n\t\tsleep 2\n\t\tassert !$post_recommend_flash_close.exists?\n\tend", "title": "" }, { "docid": "f1173854950b1f44c9a7a9909a0f1bae", "score": "0.5797017", "text": "def atest_ID_25876_edit_user_profile_ui\n #This test is covered on edit_profile\n end", "title": "" }, { "docid": "c8588c750d9eadcc88ef116a1273da5f", "score": "0.5791809", "text": "def test_view_kit_info_flow\n navigate_through_view_kit\n @control.run\n expected_operations = [:test_authentication, :main_menu, \n :list_and_select_kit, :select_kit_action, :view_kit,\n :after_view, :quit]\n assert_equal expected_operations, @control.operations_log\n end", "title": "" }, { "docid": "e35ac7e39197306e56daa493bb8b1737", "score": "0.5788589", "text": "def test_add_item_cmd_edit_index_1\n cmd = UI::Command.new(\"Test\") {}\n cmd.menu_text = \"Edit Command 1\"\n item = UI.menu(\"Edit\").add_item(cmd, 1)\n assert_not_nil(item)\n end", "title": "" }, { "docid": "887618f5381131b619c3a9d8e0fc5a72", "score": "0.5782512", "text": "def run_list_features(stub)\n p 'ListFeatures'\n p '------------'\n resps = stub.list_features(LIST_FEATURES_RECT)\n resps.each do |r|\n p \"- found '#{r.name}' at #{r.location.inspect}\"\n end\nend", "title": "" }, { "docid": "c3a259325c87d9615281ba0b5978ece7", "score": "0.57810247", "text": "def test04_D1FLT04_TC_24428_24316\n\t\t$browser.goto($patch_login)\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_directory)\n\t\t$directory_title.fire_event(\"onclick\")\n\t\t\n\t\tassert $directory_business.exists?\t\t\n\tend", "title": "" }, { "docid": "d55cb16fbe00510dbdeb1cdb9b91ebf2", "score": "0.5778547", "text": "def atest_ID_25855_verify_the_links_on_the_side_bar_of_manage_groups\n #This test is covered by : test_ID_25851_ui_of_the_manage_group\n end", "title": "" }, { "docid": "a251949932122a5cccb3a9f96e635ae8", "score": "0.5778311", "text": "def test_008\n test_000\n login(\"root\",\"root\")\n ## open SamplePJ1 member page\n open_pj_member_page(SAMPLE_PU,SAMPLE_PJ)\n @selenium.add_selection $link_texts[\"pj_user\"][\"member\"], \"label=#{USER_LAST_NAME}\"\n @selenium.click($xpath[\"pj_user\"][\"remove_user_pj\"])\n sleep WAIT_TIME\n @selenium.add_selection $link_texts[\"pj_user\"][\"non_member\"], \"label=#{USER_LAST_NAME}\"\n @selenium.click($xpath[\"pj_user\"][\"add_user_pj\"])\n assert !@selenium.is_editable($xpath[\"pj_user\"][\"add_user_pj\"])\n sleep WAIT_TIME\n logout\n end", "title": "" }, { "docid": "11f91397f2e5f3cb32334afc5d2891ba", "score": "0.5776025", "text": "def test_047\n #login\n login\n # PU management page\n open_pu_management_page_1\n #A new PU\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n #PJ management page\n open_pj_management_page(@@pu.id)\n # A new PJ\n\n\n @@pj = Pj.find_by_name('SamplePJ1')\n #Pu index page\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n # Pu setting page\n click $xpath[\"misc\"][\"PU_setting_page\"]\n sleep 4\n click $xpath[\"misc\"][\"display_page\"]\n\n # the button \"which saves a setup\" is clicked.\n type \"make_options\", \"options\"\n click $xpath[\"misc\"][\"save_a_setup_button\"]\n sleep 4\n #The message which tells saving of an execution setup is displayed on the screen upper left.\n assert get_text(\"log_contents\").include?(_(\"Execution setting was updated.\"))\n\n #PJ setting page\n open \"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n # Pj setting page\n click $xpath[\"misc\"][\"PJ_setting_page\"]\n sleep 4\n click $xpath[\"misc\"][\"display_page\"]\n sleep 4\n # C47\n type \"make_options\", \"options\"\n click $xpath[\"misc\"][\"save_a_setup_button\"]\n sleep 4\n assert get_text(\"log_contents\").include?(_(\"Execution setting was updated.\"))\n\n\n #logout\n logout\n\n end", "title": "" } ]
3d314f7a2f507095c205230e9172a254
Update CustomerGroup by ID
[ { "docid": "d0fff296b88b1efd557fd75d81ac09e5", "score": "0.6664279", "text": "def update_customer_group_by_id(project_key, id, customer_group_update, opts = {})\n data, _status_code, _headers = update_customer_group_by_id_with_http_info(project_key, id, customer_group_update, opts)\n data\n end", "title": "" } ]
[ { "docid": "33bb815a38e5abeaf5a8e392a19df2fa", "score": "0.7733331", "text": "def update\n @customer_group = CustomerGroup.find(params[:id])\n @customer_group.update_attributes(params[:customer_group])\n get_data\n end", "title": "" }, { "docid": "328de023dbcf0daf9b6bc38dd230f5e4", "score": "0.7476437", "text": "def set_customer_group\n @customer_group = CustomerGroup.find(params[:id])\n end", "title": "" }, { "docid": "00ec3dab74c2f7677098cbda91f432e8", "score": "0.7375961", "text": "def update_customer_group(group_id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/customers/groups/{group_id}',\n 'default')\n .template_param(new_parameter(group_id, key: 'group_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "title": "" }, { "docid": "114b08068067eb12493708c7f7d5df4a", "score": "0.68578917", "text": "def update_customer_group_by_id_with_http_info(project_key, id, customer_group_update, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.update_customer_group_by_id ...'\n end\n # verify the required parameter 'project_key' is set\n if @api_client.config.client_side_validation && project_key.nil?\n fail ArgumentError, \"Missing the required parameter 'project_key' when calling DefaultApi.update_customer_group_by_id\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling DefaultApi.update_customer_group_by_id\"\n end\n # verify the required parameter 'customer_group_update' is set\n if @api_client.config.client_side_validation && customer_group_update.nil?\n fail ArgumentError, \"Missing the required parameter 'customer_group_update' when calling DefaultApi.update_customer_group_by_id\"\n end\n # resource path\n local_var_path = '/{projectKey}/customer-groups/{ID}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'ID' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_group_update)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CustomerGroup'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['oauth_2_0']\n\n new_options = opts.merge(\n :operation => :\"DefaultApi.update_customer_group_by_id\",\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: DefaultApi#update_customer_group_by_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ce371b597ff6be1189ee4774918e8d3d", "score": "0.68172413", "text": "def update\n respond_to do |format|\n if @customer_group.update(customer_group_params)\n format.html { redirect_to @customer_group, notice: \"Customer group was successfully updated.\" }\n format.json { render :show, status: :ok, location: @customer_group }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @customer_group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2bb2bfb356dbf35f5c8c0915471f61eb", "score": "0.6325221", "text": "def update( params )\n deleted! if @deleted\n params.delete( :id ) # Prevent overwriting ID\n params.delete( :group ) # Prevent overwriting group\n params_to_account( params )\n save\n end", "title": "" }, { "docid": "c0cf08766a305c6d7e77cce4e184d18c", "score": "0.6314287", "text": "def save_customer(id)\n update_attribute :customer_id, id\n end", "title": "" }, { "docid": "ec36e491aa5e69bc0da0412d4ac49ae8", "score": "0.62712115", "text": "def update_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "2c60a533470d8275139b2f9c3fe9d1a4", "score": "0.6258864", "text": "def update_customer(id, data)\n put(\"customers/#{id}\", { body: data })\n end", "title": "" }, { "docid": "2c60a533470d8275139b2f9c3fe9d1a4", "score": "0.6258864", "text": "def update_customer(id, data)\n put(\"customers/#{id}\", { body: data })\n end", "title": "" }, { "docid": "dcea0058fd3b37c8b06d814c2e754f05", "score": "0.62576914", "text": "def update_group(group_id, request)\n start.uri('/api/group')\n .url_segment(group_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "3c63640171985909c4180420f5deb9e4", "score": "0.6166246", "text": "def update\n\t\t@ad_group = AdGroup.includes(:campaign).where(\"campaigns.account_id = ?\", @auth_user.account_id).find(params[:id])\n\t\t@ad_group.user_account_id = @auth_user.account_id\n\n\t\trespond_to do |format|\n\t\t\tif @ad_group.update_attributes(params[:ad_group])\n\t\t\t\tformat.html { redirect_to(@ad_group, :notice => 'Ad group was successfully updated.') }\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @ad_group.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "0c7b70822105dff17c2002a586ebfad5", "score": "0.6154213", "text": "def update\n @contact_group = current_user.contact_groups.find(params[:id])\n @contact_group.update_attributes(params[:contact_group])\n respond_to do |format|\n format.js\n end\n end", "title": "" }, { "docid": "f04e5741d02910170544ebcaffd31c5b", "score": "0.6123289", "text": "def update_by_id(params, options = {})\n path = \"#{base_uri}/#{params[:id]}\"\n request(path, options.merge(method: :post), params).if_404_raise(Neutrino::Gateway::Exceptions::AzureAdGroupNotFoundError)\n .if_400_raise(Neutrino::Gateway::Exceptions::AzureAdGroupInvalidError)\n .to_hash\n end", "title": "" }, { "docid": "da383ad3893439a7d1723ad9a3ae4eef", "score": "0.6106248", "text": "def set_group_update\n @group_update = GroupUpdate.find(params[:id])\n end", "title": "" }, { "docid": "43eddf3003ee521d1a9a355ad2fa653a", "score": "0.6096306", "text": "def update_observations_group_id(obs_map)\n Observation.where(obs_id: obs_map.values).limit(nil).each do |obs|\n obs.update(obs_group_id: obs_map[obs.obs_group_id]) unless obs.obs_group_id.blank?\n end\n end", "title": "" }, { "docid": "8acfdb9f754d73a3b1f5ec86b8b1ac49", "score": "0.6072", "text": "def update_customer_group_by_key_with_http_info(project_key, key, customer_group_update, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.update_customer_group_by_key ...'\n end\n # verify the required parameter 'project_key' is set\n if @api_client.config.client_side_validation && project_key.nil?\n fail ArgumentError, \"Missing the required parameter 'project_key' when calling DefaultApi.update_customer_group_by_key\"\n end\n # verify the required parameter 'key' is set\n if @api_client.config.client_side_validation && key.nil?\n fail ArgumentError, \"Missing the required parameter 'key' when calling DefaultApi.update_customer_group_by_key\"\n end\n # verify the required parameter 'customer_group_update' is set\n if @api_client.config.client_side_validation && customer_group_update.nil?\n fail ArgumentError, \"Missing the required parameter 'customer_group_update' when calling DefaultApi.update_customer_group_by_key\"\n end\n # resource path\n local_var_path = '/{projectKey}/customer-groups/key={key}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'key' + '}', CGI.escape(key.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_group_update)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CustomerGroup'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['oauth_2_0']\n\n new_options = opts.merge(\n :operation => :\"DefaultApi.update_customer_group_by_key\",\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: DefaultApi#update_customer_group_by_key\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "95ebe44bdba451b98b0dbd1556b3b24f", "score": "0.60717744", "text": "def patch_update\n group = @company.public_send(ScimRails.config.scim_groups_scope).find(params[:id])\n\n json_scim_missing_field_response(params) and return if patch_path.blank?\n\n if patch_path == :members\n case patch_operation.downcase\n when \"add\"\n add_members(group) if members_param.present?\n when \"remove\"\n remove_members(group) if members_param.present?\n end\n else\n update_attribute(group)\n end\n\n json_scim_response(object: group)\n end", "title": "" }, { "docid": "04df5bfd152cbb8216d5f4d5ab067375", "score": "0.60700154", "text": "def update\n @breadcrumb = 'update'\n @accounting_group = AccountingGroup.find(params[:id])\n @accounting_group.updated_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @accounting_group.update_attributes(params[:accounting_group])\n format.html { redirect_to @accounting_group,\n notice: (crud_notice('updated', @accounting_group) + \"#{undo_link(@accounting_group)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @accounting_group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "09947dbdf12c02815e9f95f932283e7d", "score": "0.60638696", "text": "def update_groups\n\n # get nearby clients\n\n relevant_envs = self.nearby\n\n # all clients in the same group as a nearby client\n\n @grouped_envs = relevant_envs.inject([]) do |result, element|\n element.all_in_group.each do |group_env|\n unless result.include?( group_env )\n result << group_env\n end\n end\n result\n end\n\n # create new group id and assign to all clients in the new group\n\n new_group_id = rand(Time.now.to_i)\n\n group_uuids = @grouped_envs.map { |e| e.client_uuid }\n puts \"creating new group with id #{new_group_id} and clients #{group_uuids.inspect}\"\n\n ( @grouped_envs | relevant_envs ).each do |foobar|\n foobar[:group_id] = new_group_id\n foobar.save\n end\n\n reload\n end", "title": "" }, { "docid": "d346210d7d34b3285d562930b42dede2", "score": "0.60541356", "text": "def update_customer_group_by_key(project_key, key, customer_group_update, opts = {})\n data, _status_code, _headers = update_customer_group_by_key_with_http_info(project_key, key, customer_group_update, opts)\n data\n end", "title": "" }, { "docid": "b7b40dea42f988c5a58b473552d72016", "score": "0.6053291", "text": "def set_capitalizable_group\n @capitalizable_group = CapitalizableGroup.find(params[:id])\n end", "title": "" }, { "docid": "382297fd5df99c03296feb13a20d466b", "score": "0.6041035", "text": "def update\n ::Domain::Person::Group::Command::UpdateCommand.call(\n id_param: person_group_params[:id_param],\n name: person_group_params[:name],\n parent_group_id_param: person_group_params[:parent_group_id_param]\n )\n\n redirect_to debug_person_groups_path, notice: 'Group was successfully updated.'\n end", "title": "" }, { "docid": "ba7a2388a626ae10a85c348c13e5f3bb", "score": "0.6038527", "text": "def update #update users group\n @user_group = UserGroup.find(params[:id])\n @user_group.update(user_group_params)\n @user_group.save\n render json: @user_group\n end", "title": "" }, { "docid": "93eb5fbce46eef87f6f02fe01b79425b", "score": "0.60357124", "text": "def update_group_membership!\n group_resource.update_members(mentors.collect(&:uw_net_id))\n end", "title": "" }, { "docid": "ec98f662e8f460e40a4852d69813b268", "score": "0.6016214", "text": "def update_group\n @reservation = get_reservation\n if params[:group_id] != \"\"\n @id = params[:group_id].to_i\n @group = Group.find(@id)\n else\n @id = nil\n @group = Group.find(@reservation.group_id)\n end\n @reservation.update_attributes :group_id => @id\n @group.update_attributes :expected_number => Reservation.find_all_by_group_id(@group.id).count\n render(:nothing => true)\n end", "title": "" }, { "docid": "0cc48c7f6fc562e54c2dba6a780ef960", "score": "0.60143703", "text": "def update\n @group = Api::V1::Group.find(params[:id])\n\n if @group.update(group_params)\n head :ok\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "1d97d93d9c9fd2bc319dea44e739bc49", "score": "0.6006629", "text": "def update\n \n if @client_group.update(client_group_params)\n redirect_to account_account_client_group_path(@account, @client_group)\n else\n redirect_to edit_account_account_client_group_path(@account, @client_group)\n end \n end", "title": "" }, { "docid": "476cff7eacd5f2cff85c876d70afe91e", "score": "0.5993197", "text": "def update_customer(customer_id, options={})\n commit_put('customer', options, customer_id)\n end", "title": "" }, { "docid": "8c3f5aee573b9e57677252df8838868c", "score": "0.599129", "text": "def update_group(group_id, data)\n post \"/groups/#{group_id}/update\", data\n end", "title": "" }, { "docid": "94b370821a9725df4b8a6bc05489806e", "score": "0.5981179", "text": "def update_batch_group\n @batch_group = BatchGroup.shod(params[:batch_group][:batch_group_id])\n @batch_group.update(name: params[:batch_group][:name])\n @course = @batch_group.course\n flash[:notice] = t('batch_group_updated')\n end", "title": "" }, { "docid": "2de3f255ea1d881d22a3420fa2db38e8", "score": "0.5978124", "text": "def assign_group\n if self.id == 1\n self.group_id = 1\n end\n end", "title": "" }, { "docid": "93570fdb2cd50ef40204ebe3fb909af8", "score": "0.59662145", "text": "def update_order_item_from_order_item_group(order_item_id, group_id, data)\r\n url = \"/ecommerce/order-items/update/#{order_item_id}/order-items-groups/#{group_id}\"\r\n @client.raw('put', url, nil, data_transform(data), @contact_v1_url)\r\n end", "title": "" }, { "docid": "8b1c98d70399f628315d8be2b3ef76bc", "score": "0.5963207", "text": "def set_group\n @group = Group.find_by_id(params[:id])\n end", "title": "" }, { "docid": "9c218cc3f9739f8b556ce1fcda9d1f8b", "score": "0.5962256", "text": "def update\n @group = Group.find(params[:id])\n @group.campaign_id = session[:campaign_id]\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, :notice => 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9f4a0b9bd06ca0ece62d05b18fe85ce", "score": "0.5951078", "text": "def update_babysitter_group(group)\n self.update_attribute(:group_id, group.id)\n end", "title": "" }, { "docid": "610090e4ca00dc4396023ff0424064fc", "score": "0.59233934", "text": "def set_group\n @group = Group.find_by_id(params[:id])\n end", "title": "" }, { "docid": "fc2fb5c1ba41354fdf3bdd090afc0ce0", "score": "0.59158725", "text": "def set_client_group\n id = params[:id] ||= params[:client_group_id]\n @client_group = ClientGroup.cached_find(id)\n end", "title": "" }, { "docid": "b0b46f4ea47fce44e35bd5039788bd00", "score": "0.59096634", "text": "def update\n params.permit!\n @group = Group.find(params[:id])\n redirect_to group_path(@group.course_id) if @group.update(params[:group])\n end", "title": "" }, { "docid": "2aaaf47e48ce47523897ea8b9bb07e92", "score": "0.5903782", "text": "def update_group(group_id, name)\n params = { name: name }\n\n request :patch,\n \"/v3/team/groups/#{group_id}.json\",\n params\n end", "title": "" }, { "docid": "2f5e83abfca694a7247c5f726763db56", "score": "0.59035194", "text": "def set_group\n @group = current_store.groups.find(params[:id])\n end", "title": "" }, { "docid": "ff80b4d4d999e146a8b9da166cfa15a9", "score": "0.5879054", "text": "def update\n respond_to do |format|\n @group.users.clear\n users = get_users_from_select(params['group']['users'])\n unless users.blank?\n @group.users = users\n end\n if @group.update({name: params['group']['name']})\n flash.notice = t('global.model_modified', type: t('global.group').downcase)\n format.html { redirect_to @group }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7ee8e96429d4d80c9e80caaae9e89c7", "score": "0.58732206", "text": "def update\n @group = Group.find_by_id(params[:id])\n \n respond_to do |format|\n if Group.find_all_by_user_id(current_user).include?(@group)\n if @group.update_attributes(params[:group])\n format.html { redirect_to groups_path, notice: \"Group '#{@group.name}' was successfully updated.\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n else\n flash[:error] = \"Group was not found\"\n format.html { redirect_to action: \"index\" }\n end\n end\n end", "title": "" }, { "docid": "953391b6360635142b5ea786d977676e", "score": "0.5864169", "text": "def update\n @group = Group.find_by_id(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "876a2105fed6c9ddec200d12af92e0c3", "score": "0.5859873", "text": "def add_to_group(group)\n @api.do_request(\"PUT\", group.get_base_api_path() + \"/contacts/\" + get('id'));\n @group_ids_set[group.id] = true\n end", "title": "" }, { "docid": "cd76f04d17ec9272f3543e7ef9329011", "score": "0.58537924", "text": "def update\n @test_group = TestGroup.find(params[:id])\n end", "title": "" }, { "docid": "67d1f8eb626948649fecd5d2f23c4a21", "score": "0.5851169", "text": "def update\n @group = Group.find(params[:id], include: :users)\n\n\n respond_to do |format|\n if @group.update_attributes(permitted_params.group)\n\n @group_context = GroupContext.where(:group_id => @group._id)\n GroupContext.destroy(@group_context)\n\n @group_context = GroupContext.new\n @context = params[:context]\n @group_context.context_id = @context[:id]\n @group_context.group_id = @group._id\n @group_context.save\n\n\n flash[:notice] = l(:notice_successful_update)\n format.html { redirect_to(groups_path) }\n format.xml { head :ok }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1b6f508fcb6837e8efb1368e8f9dc59", "score": "0.58394486", "text": "def update\n \n @group.who_updated_id = session[:user_id]\n \n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec573819536b3e4edf187793d21c3982", "score": "0.5830531", "text": "def set_group\n @group = Group.find( params[ :id ])\n end", "title": "" }, { "docid": "c0abb66d78ade11ccdca30fd25d66454", "score": "0.582305", "text": "def update_customer(customer)\n params = customer.to_source_hash\n params[\"CustomerID\"] = customer.id\n\n resp = post(\"/customer/update\", params)\n resp[\"Success\"] == true\n end", "title": "" }, { "docid": "2e3adb33f941bc142f215b66df924ccc", "score": "0.5822428", "text": "def update\n @cling_group = ClingGroup.find(params[:id])\n\n respond_to do |format|\n if @cling_group.update_attributes(params[:cling_group])\n flash[:notice] = 'ClingGroup was successfully updated.'\n format.html { redirect_to(@cling_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cling_group.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "411c3237aa7f7fd7570c63858103f21b", "score": "0.582022", "text": "def set_id\r\n\t\tset_id = 'UPDATE groups SET ship_id = ? WHERE name = ?'\r\n\t\t@db.execute(set_id, [find_ship_id, @name])\r\n \tend", "title": "" }, { "docid": "eb59c345b2fdb052222a9c9b763fe56c", "score": "0.58122224", "text": "def delete_customer_group_by_id_with_http_info(project_key, id, version, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.delete_customer_group_by_id ...'\n end\n # verify the required parameter 'project_key' is set\n if @api_client.config.client_side_validation && project_key.nil?\n fail ArgumentError, \"Missing the required parameter 'project_key' when calling DefaultApi.delete_customer_group_by_id\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling DefaultApi.delete_customer_group_by_id\"\n end\n # verify the required parameter 'version' is set\n if @api_client.config.client_side_validation && version.nil?\n fail ArgumentError, \"Missing the required parameter 'version' when calling DefaultApi.delete_customer_group_by_id\"\n end\n # resource path\n local_var_path = '/{projectKey}/customer-groups/{ID}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'ID' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'version'] = version\n query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CustomerGroup'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['oauth_2_0']\n\n new_options = opts.merge(\n :operation => :\"DefaultApi.delete_customer_group_by_id\",\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(:DELETE, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#delete_customer_group_by_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "b2db980b5226d781deed11be6c51368c", "score": "0.5810047", "text": "def update_customer(opts)\n requires!(opts, :id)\n r = req(opts.merge(:method => 'update_customer'))\n Response.new(r)\n end", "title": "" }, { "docid": "45aa30dd50ca591bb625f0ba5c619b41", "score": "0.5808761", "text": "def update_customer\n @customer.details.merge(@customer_details)\n @customer.save!\n\n success\n end", "title": "" }, { "docid": "df05ed8730ebad48f7d7f735ac25e773", "score": "0.5805719", "text": "def update\n @restaurant_group = Restaurant::Group.find(params[:id])\n\n respond_to do |format|\n if @restaurant_group.update_attributes(params[:restaurant_group])\n format.html { redirect_to @restaurant_group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: 'edit' }\n format.json { render json: @restaurant_group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5410373915be5e3c41c729d0260ce496", "score": "0.5801357", "text": "def set_group\n @group = Xmt::Rbac::Group.find(params[:id])\n end", "title": "" }, { "docid": "5e7fb064be732eb402a34a66959416ee", "score": "0.5800476", "text": "def update\n @cost_group = CostGroup.find(params[:id])\n\n respond_to do |format|\n if @cost_group.update_attributes(params[:cost_group])\n format.html { redirect_to @cost_group, notice: 'Cost group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cost_group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "063255fae277677e9d5d83214855a72f", "score": "0.57974225", "text": "def update_contact(id, cnt_info, groups)\n DB[:contacts]\n .where(id: id)\n .update(\n first_name: cnt_info[0],\n last_name: cnt_info[1],\n email: cnt_info[3],\n number: cnt_info[2]\n )\n\n DB[:groups_contacts].where(contact_id: id).delete\n assing_contact_to_goup(groups, id)\n end", "title": "" }, { "docid": "d77d1a1bfc83934dcb95b692bc615eb8", "score": "0.5795166", "text": "def set_group\n @group = FortyTwo::Group.find(params[:id])\n end", "title": "" }, { "docid": "a82a9e2899f2b53d661d0161661c6f95", "score": "0.5790227", "text": "def update\n #@group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n @group.recompute_members_quotas\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b8398bb4161bdb3c6a46e0323b35d3e0", "score": "0.57841474", "text": "def update\n if @merchant_merchant_group.update(merchant_merchant_group_params)\n record_activities('修改', '商户群组', @merchant_merchant_group.name)\n flash[:success] = '修改成功'\n redirect_to merchant_merchant_groups_path\n else\n flash[:error] = \"修改失败: #{@merchant_merchant_group.errors.full_message}\"\n render :edit\n end\n end", "title": "" }, { "docid": "d62cc0f726b75509dcc554dae939ee43", "score": "0.5783438", "text": "def update_appointment_group(id,appointment_group__context_codes__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :appointment_group__context_codes__,\n :appointment_group__sub_context_codes__,\n :appointment_group__title__,\n :appointment_group__description__,\n :appointment_group__location_name__,\n :appointment_group__location_address__,\n :appointment_group__publish__,\n :appointment_group__participants_per_appointment__,\n :appointment_group__min_appointments_per_participant__,\n :appointment_group__max_appointments_per_participant__,\n :appointment_group__new_appointments_____x__,\n :appointment_group__participant_visibility__,\n \n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n raise \"appointment_group__context_codes__ is required\" if appointment_group__context_codes__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id,\n :appointment_group__context_codes__ => appointment_group__context_codes__\n )\n\n # resource path\n path = path_replace(\"/v1/appointment_groups/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:put, path, query_params, form_params, headers)\n response\n \n end", "title": "" }, { "docid": "6b9fba149a644fb47f2d694f4145dde4", "score": "0.5780624", "text": "def update\n @group = Group.find_by_alias params[:id]\n user = User.wrap(params[:group][:owner_id])\n user.join_group(@group)\n\n if @group.update_attributes group_params\n redirect_to edit_admin_group_path(@group)\n else\n render :edit\n end\n end", "title": "" }, { "docid": "4f1f05f7e8963426e7e15adfcf823d1d", "score": "0.5780539", "text": "def edit\n id = params[:id]\n @group = Group.find_by_id(id)\n end", "title": "" }, { "docid": "7c86e6817373716ea2dd57ee32583cad", "score": "0.5777156", "text": "def customer_group_params\n params.require(:customer_group).permit(:user_id, :group_id)\n end", "title": "" }, { "docid": "84229d59e693db4682a0a44a96969ecd", "score": "0.5777075", "text": "def update_customer(info={})\n info.stringify_keys!\n chargify_id = info.delete('id')\n response = Hashie::Mash.new(self.class.put(\"/customers/#{chargify_id}.json\", :body => {:customer => info}))\n return response.customer unless response.customer.blank?\n response\n end", "title": "" }, { "docid": "689102c1d79e8cccae21c360891f243e", "score": "0.57762504", "text": "def update_order_item_from_order_item_group(order_item_id, group_id, data)\n # TODO: Research use\n url = \"/ecommerce/order-items/update/#{order_item_id}/order-items-groups/#{group_id}\"\n @client.raw('put', url, nil, data_transform(data))\n end", "title": "" }, { "docid": "c48c3b01603b33fa5ed25a292b6001ba", "score": "0.57707614", "text": "def update_customer(customer_id, data)\n MercadoPago::CustomCheckout::Customers.update(@custom_checkout_access_token, customer_id, data)\n end", "title": "" }, { "docid": "ba60092203d445aa394db8c49425d508", "score": "0.57699734", "text": "def update_group(group)\n ar_group = Group.find(group.id)\n updated_attrs = group.instance_values\n\n updated_attrs.each do |attr, value|\n setter = (attr + \"=\").to_sym\n ar_group.send(setter, value) unless setter == :users=\n end\n\n # add user to group if user not yet in group membership\n group.users.each do |user|\n Membership.create(user_id: user.id, group_id: group.id)\n end\n\n # delete user from group if updated group no longer has the user\n ar_group.users.each do |ar_user|\n Membership.find_by_user_id(ar_user.id).delete if !group.users.find { |user| user.id == ar_user.id }\n end\n\n ar_group.save\n end", "title": "" }, { "docid": "35400633781e3ed1d98bb2392e4823b0", "score": "0.5768785", "text": "def update\n @group = TvGroup.find(params[:id])\n @group.update_attributes(params[:group])\n \n redirect_to :action => :show, :id => @group\n end", "title": "" }, { "docid": "9cad57e0ced50330d6bc7160c96a0469", "score": "0.5766924", "text": "def update(group)\n # remove members of the group from pending lists\n for id in group.members\n @pending.delete(id)\n end\n\n # capture group\n @group = group\n end", "title": "" }, { "docid": "ef41290f6aa04795a9672480e448ff42", "score": "0.5764928", "text": "def set_group\n @group = Group.find(params[:id])\n \n end", "title": "" }, { "docid": "cee607d39331fd76f2d859ffce187512", "score": "0.57635957", "text": "def set_id_group1\r\n\t\tset_id = 'UPDATE battlegroups SET group1_id = ? WHERE name = ?'\r\n\t\t@db.execute(set_id, [find_group_id(@group1_name), @name])\r\n\tend", "title": "" }, { "docid": "20b925ce425bcd3260f5acb925361c4d", "score": "0.5760946", "text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if not params[:group][:users].nil?\n @user = User.find(params[:group][:users])\n params[:group].delete :users\n if @group.users.include?(@user)\n flash[:error] = \"A user may not be added to the same group multiple times.\"\n redirect_to @group\n return\n else\n @group.users << @user\n end\n end\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "719df563944ead79238b1e8dd0fabbab", "score": "0.5759466", "text": "def set_group\n group = Group.find(params[:id])\n end", "title": "" }, { "docid": "0c29d956eeeaca3a5f4dafde9ea4cc6c", "score": "0.5753331", "text": "def set_group\n @group = Group.find(params[:group_id] || params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "358121ba40019ba4e498ad04e4c458bc", "score": "0.5750334", "text": "def set_group\n @group = Group.find(params[:id])\n end", "title": "" }, { "docid": "4c293cc0056c7ad1d215a6b5fe050ae4", "score": "0.57499546", "text": "def set_group\n @group = LDAP::Group.find(params[:id])\n end", "title": "" }, { "docid": "caa8e17418e0904960937a23cb8b517f", "score": "0.5746737", "text": "def set_group\n @group = Group.find(params[:id] || params[:group_id])\n end", "title": "" }, { "docid": "198cd83e0ea481ec0aa6639918ad581a", "score": "0.57453346", "text": "def set_campaigns_group\n @campaigns_group = CampaignsGroup.find(params[:id])\n end", "title": "" }, { "docid": "ea8f8fb2b30967667d624373d6353d43", "score": "0.57444793", "text": "def group_id=(value)\n @group_id = value\n end", "title": "" } ]
5c3188755ea9963d99cdd68a9e8c16d1
Called on file(s) modifications that the Guard plugin watches.
[ { "docid": "e9a17ec2b165e5a204785c81992ee1c2", "score": "0.0", "text": "def run_on_modifications(paths)\n results = runner.test_paths(paths)\n throw :task_has_failed if results.failed?\n end", "title": "" } ]
[ { "docid": "f56f8960280e8ca4b07d37ef43930e69", "score": "0.72702163", "text": "def notify(changed_files)\n ::Guard.guards.each do |guard|\n paths = Watcher.match_files(guard, changed_files)\n guard.run_on_change(paths) unless paths.empty?\n end\n end", "title": "" }, { "docid": "a389df19b2488e1474d1b7b7575c5dfa", "score": "0.7052962", "text": "def run_on_changes(paths)\n #paths.each do |p| ::Guard::UI.info(\"Files effect : #{p}\") end\n @command.sync\n end", "title": "" }, { "docid": "a6edbcb68d78880cf0eaacef97dea1f5", "score": "0.6976313", "text": "def file_watcher; end", "title": "" }, { "docid": "e87033e4dc363c2e5d279a2c9276efb0", "score": "0.69261116", "text": "def run_on_changes(_paths)\n jammit\n end", "title": "" }, { "docid": "99b9a307bcb1b5c8d928c82e24cbe740", "score": "0.68297863", "text": "def start_watch_files\n watched_files.each do |file|\n @notifier.watch(file, :modify) do\n Js2coffee.watch_file(file)\n end\n end\n end", "title": "" }, { "docid": "e7351abba95613f8a7923c7c6faf6a3d", "score": "0.68139493", "text": "def run_on_change(paths)\n jammit\n end", "title": "" }, { "docid": "1a26a135e9cd540938154bed95e57d75", "score": "0.6683839", "text": "def watchable_files; end", "title": "" }, { "docid": "06a2908bf75f3e78fe87ec1423b54b16", "score": "0.6680169", "text": "def watch(&block)\n path = File.expand_path(@path)\n @logger.info(\"Watching for changes to #{path}\")\n dir = File.dirname(path)\n fname = File.basename(path)\n Listen.to(dir, :filter => /#{Regexp.quote(fname)}/) do |modified, added, removed|\n begin\n @logger.info(\"Change to control file detected...\")\n inifile = IniFile.load(path)\n distributions = parse!(inifile)\n\n @watch_mutex.synchronize do\n @distributions = distributions\n end\n @logger.info(\"...rebuilt\")\n yield if block_given?\n rescue => e\n @logger.error(\"Error reloading changes: #{e}\")\n @logger.error(e)\n end\n end\n end", "title": "" }, { "docid": "d7423c61f783e6f40b80cf03798bd788", "score": "0.6642701", "text": "def run_on_changes(modified, added, removed)\n ::Guard::UI.clearable\n\n #TODO: this should be handled like every other plugin\n if ::Guard::Watcher.match_guardfile?(modified)\n ::Guard.evaluator.reevaluate_guardfile\n end\n\n _scoped_plugins do |guard|\n modified_paths = ::Guard::Watcher.match_files(guard, modified)\n added_paths = ::Guard::Watcher.match_files(guard, added)\n removed_paths = ::Guard::Watcher.match_files(guard, removed)\n\n ::Guard::UI.clear if _clearable?(guard, modified_paths, added_paths, removed_paths)\n\n _run_first_task_found(guard, MODIFICATION_TASKS, modified_paths) unless modified_paths.empty?\n _run_first_task_found(guard, ADDITION_TASKS, added_paths) unless added_paths.empty?\n _run_first_task_found(guard, REMOVAL_TASKS, removed_paths) unless removed_paths.empty?\n end\n end", "title": "" }, { "docid": "fdb53f455b756c4a0d31b2537d044450", "score": "0.6638374", "text": "def reload!\n # Detect changed files\n rotation do |file, mtime|\n # Retrive the last modified time\n new_file = MTIMES[file].nil?\n previous_mtime = MTIMES[file] ||= mtime\n logger.devel \"Detected a new file #{file}\" if new_file\n # We skip to next file if it is not new and not modified\n next unless new_file || mtime > previous_mtime\n # Now we can reload our file\n apps = mounted_apps_of(file)\n if apps.present?\n apps.each { |app| app.app_obj.reload! }\n else\n safe_load(file, :force => new_file)\n # Reload also apps\n Padrino.mounted_apps.each do |app|\n app.app_obj.reload! if app.app_obj.dependencies.include?(file)\n end\n end\n end\n end", "title": "" }, { "docid": "021b7a8c212eb28843da1be20f5bf7f6", "score": "0.6564384", "text": "def scan_changed(&block) # :yields: file\n known_files.each do |known_file|\n new_mtime = mtime_for(known_file)\n if new_mtime != last_mtime[known_file]\n block.call(known_file)\n last_mtime[known_file]= new_mtime\n end\n end\n end", "title": "" }, { "docid": "f50ed3dcd4b63d3d7c090032a6705850", "score": "0.64958084", "text": "def run_on_modifications(files)\n files.each do |path|\n puts \"Performing Code Climate analysis of #{path.inspect}\"\n ::Guard::Dsl.new.eager(\"codeclimate analyze #{Shellwords.escape(path)}\")\n end\n end", "title": "" }, { "docid": "2369c132114751a9a9673b045ccdc37c", "score": "0.64865696", "text": "def run_on_changes(paths)\n paths.each do |file|\n ::Guard::UI.info \"Testing #{file}.\"\n test file\n end\n end", "title": "" }, { "docid": "0394ff5ea23144641c0f84f5437dd9be", "score": "0.648265", "text": "def changed!(file)\n mapped_files = mapper.map(file)\n case mapped_files\n when [] # Run all tests\n unfocus!\n when nil # Reset\n reset!\n else\n mapped_files.each do |mapped_file|\n mapper.log \"#{file} => #{mapped_file}\"\n self.changed_file = mapped_file\n file_changed!\n end\n end\n end", "title": "" }, { "docid": "1a7519faa6a0612321e6eb190d52157c", "score": "0.64771044", "text": "def listeners\n watch_paths.map do |pth|\n gem_path_dir = File.join(@gem_base, pth)\n Listen.to(gem_path_dir, only: /\\.html\\.erb$/) do |modded, added, removed|\n Rails.logger.warn(\"[#{self.class}] : updates: changed => #{modded}, added: #{added}, removed: #{removed}\")\n (modded + added).each do |f|\n dest = Rails.root.join(pth, File.basename(f))\n Rails.logger.info(\"Updating #{f} to #{dest}\")\n FileUtils.copy_file(f, dest)\n end\n end\n end\n end", "title": "" }, { "docid": "6a159b26940d8126f430b032c0605886", "score": "0.644947", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end", "title": "" }, { "docid": "6a159b26940d8126f430b032c0605886", "score": "0.644947", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end", "title": "" }, { "docid": "9f675bdab9c72ec476195154994a87ad", "score": "0.64493823", "text": "def run_on_changes(paths)\n paths.each do |path|\n file_changed(path)\n end\n end", "title": "" }, { "docid": "9f675bdab9c72ec476195154994a87ad", "score": "0.64493823", "text": "def run_on_changes(paths)\n paths.each do |path|\n file_changed(path)\n end\n end", "title": "" }, { "docid": "1eb34ad8eceed9ee45bba0b5cd48fbd7", "score": "0.64487463", "text": "def run_on_change(files)\n run do\n run_on_guards do |guard|\n run_on_change_task(files, guard)\n end\n end\n end", "title": "" }, { "docid": "5ebfd1bc78320c0f13b6b1c501453ab0", "score": "0.64388156", "text": "def run_all\n run_on_modifications(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end", "title": "" }, { "docid": "1d7f33e3cad39e9acb809fafbaa7c4e5", "score": "0.64142585", "text": "def run_on_changes(paths)\n # UI.info 'changes'\n shoot(paths)\n end", "title": "" }, { "docid": "25d9f491e9e3e9330099fd6e0e08118a", "score": "0.638685", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob('**/*')))\n end", "title": "" }, { "docid": "2600429e1fc40f3a58d12773719ff3cc", "score": "0.6370391", "text": "def _after_reevaluate_guardfile\n ::Guard::Notifier.turn_on if ::Guard::Notifier.enabled?\n\n if ::Guard.plugins.empty?\n ::Guard::Notifier.notify('No plugins found in Guardfile, please add at least one.', title: 'Guard re-evaluate', image: :failed)\n else\n msg = 'Guardfile has been re-evaluated.'\n ::Guard::UI.info(msg)\n ::Guard::Notifier.notify(msg, title: 'Guard re-evaluate')\n\n ::Guard.runner.run(:start)\n end\n end", "title": "" }, { "docid": "f71e3bdcd6ab8506c9ccb7c5b42e6937", "score": "0.63466156", "text": "def on_other_file; end", "title": "" }, { "docid": "66c96c4e21f318e07ac44b18d0622b6d", "score": "0.6346409", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob('{,**/}*{,.*}').uniq))\n end", "title": "" }, { "docid": "66c96c4e21f318e07ac44b18d0622b6d", "score": "0.6346409", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob('{,**/}*{,.*}').uniq))\n end", "title": "" }, { "docid": "b06e9af25723502c42c543fe6d63a288", "score": "0.63446397", "text": "def run_on_change(paths)\n partials = paths.select { |f| ignored?(f) }\n return run_all unless partials.empty?\n\n changed_files = paths.reject{ |f| ignored?(f) }.map do |file|\n css_file = get_output(file)\n begin\n contents = build_sass(file)\n if contents\n if options[:noop]\n ::Guard::UI.info \"-> verified #{file}\", :reset => true\n ::Guard::Notifier.notify(\"verified #{file}\", :title => \"Guard::Sass\", :image => :success) if options[:notification] && !options[:hide_success]\n else\n File.open(css_file, 'w') {|f| f.write(contents) }\n ::Guard::UI.info \"-> rebuilt #{file}\", :reset => true\n ::Guard::Notifier.notify(\"rebuilt #{file}\", :title => \"Guard::Sass\", :image => :success) if options[:notification] && !options[:hide_success]\n end\n end\n css_file\n rescue ::Sass::SyntaxError => e\n ::Guard::UI.error \"Sass > #{e.sass_backtrace_str(file)}\"\n ::Guard::Notifier.notify((options[:noop] ? 'validation' : 'rebuild') + \" failed > #{e.sass_backtrace_str(file)}\", :title => \"Guard::Sass\", :image => :error) if options[:notification]\n nil\n end\n end.compact\n notify changed_files\n end", "title": "" }, { "docid": "cd6c928348f8b6ffddd83f5fe0d7d935", "score": "0.6335202", "text": "def run_on_change(paths)\n paths.each do |file|\n output_file = get_output(file)\n FileUtils.mkdir_p File.dirname(output_file)\n\n FileUtils.cp(file, output_file)\n ::Guard::UI.info \"# copied '#{file}' to '#{output_file}'\"\n ::Guard::Notifier.notify(\"# copied #{file}\", :title => \"Guard::Copy\", :image => :success) if @options[:notifications]\n end\n notify paths\n end", "title": "" }, { "docid": "c86be67e5ffa2bd69ee9671762c71e7f", "score": "0.6325248", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob(File.join('**', '[^_]*.*'))))\n end", "title": "" }, { "docid": "5f4f9c4eb52452f7bb9837a3bad8e433", "score": "0.62924916", "text": "def run_on_modifications(paths)\n # UI.debug 'modifications'\n shoot(paths)\n end", "title": "" }, { "docid": "d89ff591afdbdd692630681a86707bbc", "score": "0.6268918", "text": "def did_change(path)\n return if ignored?(path)\n puts \"== File Change: #{path.relative_path_from(@app.root_path)}\" if @app.logging?\n @known_paths << path\n self.run_callbacks(path, :changed)\n end", "title": "" }, { "docid": "0da23e3f29e1e4932cafc6a7e20c7537", "score": "0.6266047", "text": "def run_on_changes(paths)\n run_on_modifications(paths)\n end", "title": "" }, { "docid": "9847ff5253110e6224c83fb52b1ac897", "score": "0.6260649", "text": "def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end", "title": "" }, { "docid": "6bb7db79bddf9ae8b33a7b12797849d1", "score": "0.626002", "text": "def run_all\n run_on_changes files.reject {|f| partial?(f) }\n end", "title": "" }, { "docid": "6bb7db79bddf9ae8b33a7b12797849d1", "score": "0.626002", "text": "def run_all\n run_on_changes files.reject {|f| partial?(f) }\n end", "title": "" }, { "docid": "0cf08535efde0903e9a4ea773235b770", "score": "0.6256974", "text": "def scan_changed_with_spec(&block) # :yields: file, spec\n scan_changed do |file|\n spec = spec_for(file)\n block.call(file, spec) if File.exists?(spec)\n end\n end", "title": "" }, { "docid": "1e931d7196f1361d42997965c6ae80e0", "score": "0.6219769", "text": "def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob('**{,/*/**}/*').uniq.compact))\n end", "title": "" }, { "docid": "96aa591c2b897eaf30554bf2021d8518", "score": "0.6203834", "text": "def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob(\"**/*\")))\n end", "title": "" }, { "docid": "b2e0619953589214a8ab90f9d893fcb4", "score": "0.6182521", "text": "def run_all\n patterns = @watchers.map { |w| w.pattern }\n files = Dir.glob('**/*.*')\n r = []\n files.each do |file|\n patterns.each do |pattern|\n r << file if file.match(Regexp.new(pattern))\n end\n end\n run_on_change(r)\n end", "title": "" }, { "docid": "f410d37ac5e35a6e2f6ea87f7c975220", "score": "0.61567813", "text": "def reevaluate_guardfile\n ::Guard.guards.clear\n ::Guard.reset_groups\n @@options.delete(:guardfile_contents)\n Dsl.evaluate_guardfile(@@options)\n msg = 'Guardfile has been re-evaluated.'\n UI.info(msg)\n Notifier.notify(msg)\n end", "title": "" }, { "docid": "0895a866b0a00a57de02ab674521f74b", "score": "0.6143507", "text": "def FileWatchAlter(*args, &block)\n\t\tFileWatch(ModificationTracker, *args, &block)\n\tend", "title": "" }, { "docid": "a42ea3dcea59ca81aef53d447e5f29f9", "score": "0.61429346", "text": "def on_other_file\n # Typically do nothing here\n end", "title": "" }, { "docid": "498205c0191a43a54caee4902f7a25e3", "score": "0.61229837", "text": "def run_on_change(paths)\n changed_files = paths.reject{ |f| File.basename(f)[0] == \"_\" }.map do |file|\n css_file = get_output(file)\n begin\n File.open(css_file, 'w') {|f| f.write(build_sass(file)) }\n ::Guard::UI.info \"-> rebuilt #{file}\", :reset => true\n ::Guard::Notifier.notify(\"rebuilt #{file}\", :title => \"Guard::Sass\", :image => :success) if @options[:notifications]\n css_file\n rescue ::Sass::SyntaxError => e\n ::Guard::UI.error \"Sass > #{e.sass_backtrace_str(file)}\"\n ::Guard::Notifier.notify(\"rebuild failed > #{e.sass_backtrace_str(file)}\", :title => \"Guard::Sass\", :image => :error) if @options[:notifications]\n nil\n end\n end.compact\n notify changed_files\n end", "title": "" }, { "docid": "f8069790cb4bb8f0898fcad9016acbe2", "score": "0.61212665", "text": "def run_on_modifications(paths)\n throw :task_has_failed unless ::ErbLatex::GuardRunner.run( paths, watchers, options )\n end", "title": "" }, { "docid": "aaf4adaa6e2c4b14fbb777e57e3234ed", "score": "0.6116042", "text": "def run_on_change(paths)\n true\n end", "title": "" }, { "docid": "ee1120909aa6e6a9999bfb7fc33249d7", "score": "0.61100984", "text": "def run_on_modifications(paths)\n end", "title": "" }, { "docid": "70ffe4dcdd40ceae6d6ac78e73ccf7ab", "score": "0.61039484", "text": "def run_all\n run_on_modifications( Watcher.match_files(self, Dir.glob('**{,/*/**}/*.{tex,erb.tex,tex.erb}')) )\n end", "title": "" }, { "docid": "873eb70640ee4871871d99d0b6829af5", "score": "0.6089153", "text": "def watch_feature_files\n files.each do |file|\n watch(file)\n end \n end", "title": "" }, { "docid": "fbc024943e0844aab0f4fa5fcaee4be4", "score": "0.6085147", "text": "def _guardfile_deprecated_check(modified)\n modified.map!(&:to_s)\n guardfiles = modified.select { |path| /^(?:.+\\/)?Guardfile$/.match(path) }\n return if guardfiles.empty?\n\n if guardfiles.any? { |path| /^Guardfile$/.match(path) }\n UI.warning <<EOS\nGuardfile changed - Guard will exit so you can restart it manually.\n\nMore info here: https://github.com/guard/guard/wiki/Guard-2.10.3-exits-when-Guardfile-is-changed\nEOS\n exit 2 # nonzero to break any while loop\n else\n msg = \"Config changed: %s - Guard will exit so it can be restarted.\"\n UI.info format(msg, guardfiles.inspect)\n exit 0 # 0 so any shell while loop can continue\n end\n end", "title": "" }, { "docid": "57a1d1df242c1611a914c6a8e48e7feb", "score": "0.6084417", "text": "def watch\n raise 'Missing block - what should I do if a file changes?' unless block_given?\n\n if linux?\n @notifier.watch(@watched_files, :modify) do |file|\n yield file\n end\n elsif mac?\n dirs = @watched_files.map{|f| File.dirname(f)}\n\n @notifier.watch(dirs, file_events: true) do |files|\n files.each do |file|\n yield file if @watched_files.include?(file)\n end\n end\n end\n end", "title": "" }, { "docid": "1f01f651f81d606760e24d537dc1c964", "score": "0.60681635", "text": "def reload!\n changed_files = []\n\n @monitor_dirs.keys.each do |dir|\n check_monitor_dir(dir, changed_files)\n end\n\n removed_files = []\n delete_hooks = []\n\n @monitor_files.to_a.each do |file, (time, delete_hook)|\n if File.file?(file)\n if file_changed?(file, time)\n changed_files << file\n end\n else\n delete_hooks << [delete_hook, file] if delete_hook\n removed_files << file\n end\n end\n\n remove_files(removed_files)\n delete_hooks.each{|hook, file| hook.call(file)}\n\n return if changed_files.empty?\n\n unless @dependencies.empty?\n changed_files = Unreloader.expand_directory_paths(reload_files(changed_files))\n \n order = @dependency_order\n order &= changed_files\n changed_files = order + (changed_files - order)\n end\n\n unless @skip_reload.empty?\n changed_files -= Unreloader.expand_directory_paths(@skip_reload)\n end\n\n changed_files.select! do |file|\n @monitor_files.has_key?(file)\n end\n changed_files.each do |file|\n safe_load(file)\n end\n end", "title": "" }, { "docid": "d1bcf6f4d883857fe5f48802f4d4a9bd", "score": "0.6067205", "text": "def run_on_changes(paths)\n paths.each do |file|\n output_file = get_output(file)\n FileUtils.mkdir_p File.dirname(output_file)\n File.open(output_file, 'w') { |f| f.write(compile_haml2erb(file)) }\n ::Guard::UI.info \"# compiled haml in '#{file}' to erb in '#{output_file}'\"\n ::Guard::Notifier.notify(\"# compiled haml to erb in #{file}\", :title => \"Guard::Haml2erb\", :image => :success) if @options[:notifications]\n end\n notify paths\n end", "title": "" }, { "docid": "605a6bd28f00aebdb84134043f14efd7", "score": "0.6066744", "text": "def changed?(file); end", "title": "" }, { "docid": "dd195b200b05b781902a55671f67b1d6", "score": "0.6062409", "text": "def watch()\n GALogger.log(\"Watching...\")\n system(\"filewatcher '*.{m,swift}' 'xctestfile $FILENAME'\", out: $stdout, err: :out)\n end", "title": "" }, { "docid": "b1771e09fc699ddf449482af3474bc9f", "score": "0.6054706", "text": "def run_on_change(paths)\n copy_all_templates \"Templates have changed, copying over\"\n end", "title": "" }, { "docid": "a8ff9c1fc3ae72e658ea133a675795b0", "score": "0.604089", "text": "def started(_files_to_lint)\n end", "title": "" }, { "docid": "f36d720514fd345cb313a16884fa6eb8", "score": "0.6038766", "text": "def file_watcher=(_arg0); end", "title": "" }, { "docid": "198546d090dd7d2a38018baba4b02733", "score": "0.60177785", "text": "def run_on_modifications(paths)\n reload\n end", "title": "" }, { "docid": "74415093bb9cc5ecd579e9c0c0c6025c", "score": "0.6015996", "text": "def run_on_changes(paths)\n # Total errors across all files\n error_count = 0\n\n paths.each do |path|\n errors = lint_and_report(path)\n\n error_count += errors.length\n end\n\n notify(paths, error_count)\n\n true\n end", "title": "" }, { "docid": "f168385c9f6ac1116855256567f67c9d", "score": "0.6003093", "text": "def run_on_modifications(paths)\n return_code = run_julia_command(paths)\n guard_notify(paths, return_code)\n end", "title": "" }, { "docid": "9cda591e8f10e8a43bc7e64b8477bf96", "score": "0.6001406", "text": "def run_all\n patterns = @watchers.map {|w| w.pattern}\n files = Dir.glob('**/*.*')\n r = []\n files.each do |file|\n patterns.each do |pattern|\n r << file if file.match(Regexp.new(pattern))\n end\n end\n run_on_change(r)\n end", "title": "" }, { "docid": "c3e77d1a4e4bdc674632ac33e574c24d", "score": "0.59990734", "text": "def add_to_guardfile\n if evaluator.guardfile_include?(name)\n UI.info \"Guardfile already includes #{name} guard\"\n else\n content = File.read(\"Guardfile\")\n File.open(\"Guardfile\", \"wb\") do |f|\n f.puts(content)\n f.puts(\"\")\n f.puts(plugin_class.template(plugin_location))\n end\n\n UI.info INFO_ADDED_GUARD_TO_GUARDFILE % name\n end\n end", "title": "" }, { "docid": "e7a0c71445cd0b409198f0aae5a3972e", "score": "0.5988597", "text": "def run_on_change(paths)\n UI.info \"Assets have changed, rebuilding...\"\n ::Forge::Guard.builder.clean_images\n ::Forge::Guard.builder.build_assets\n end", "title": "" }, { "docid": "4d77410a6c2c68e3f2c04c06a4979945", "score": "0.59885323", "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": "1886aab6448dd411f3b349b9c0f62a0a", "score": "0.5987328", "text": "def run_on_changes(paths)\n restart\n end", "title": "" }, { "docid": "1886aab6448dd411f3b349b9c0f62a0a", "score": "0.5987328", "text": "def run_on_changes(paths)\n restart\n end", "title": "" }, { "docid": "1886aab6448dd411f3b349b9c0f62a0a", "score": "0.5987328", "text": "def run_on_changes(paths)\n restart\n end", "title": "" }, { "docid": "1886aab6448dd411f3b349b9c0f62a0a", "score": "0.5987328", "text": "def run_on_changes(paths)\n restart\n end", "title": "" }, { "docid": "b135bfab1cf14d198fd5bdab33ea6fb6", "score": "0.59812903", "text": "def run_on_modifications(paths)\n _changed_files, success = Runner.run(Inspector.clean(paths), @patterns, options)\n\n throw :task_has_failed unless success\n end", "title": "" }, { "docid": "2d93e976754e1fd3689012c2b74e399e", "score": "0.5979205", "text": "def run_on_change(paths)\n paths.each do |file|\n unless File.basename(file)[0] == \"_\"\n UI.info \"Running commit for #{file}...\"\n commit_result = `krl commit`\n UI.info commit_result\n icon = commit_result.match(/Committed version: \\d+/) ? :success : :failed\n Notifier.notify commit_result, :title => \"KRL Watcher\", :image => icon\n end\n end\n end", "title": "" }, { "docid": "c89085bfe752911dedf30b037e3bee8e", "score": "0.59756273", "text": "def run_on_change(paths)\n run!\n end", "title": "" }, { "docid": "1d0cfcb05b1260487c0b7660f946be18", "score": "0.59539604", "text": "def run_on_changes(paths)\n report_location = report(critique(paths))\n UI.info \"New critique at #{report_location}\"\n end", "title": "" }, { "docid": "b5f097d8a60cd873848d970a05dfd599", "score": "0.5947639", "text": "def run_on_changes(paths)\n reload\n end", "title": "" }, { "docid": "3a28f48f55e0fab9378fe94fa286b934", "score": "0.5947555", "text": "def do_compile\n # Do watch\n puts \"Watching #{@extension} files in #{@destination}\"\n compile = true\n\n FileWatcher.new([\"#{@destination}/*#{@extension}\", \"#{@destination}/**/#{@extension}\"]).watch do |filename|\n puts \"Compile: \" + compile.to_s\n\n if compile \n # filename: ./_site/assets/styles/atoms/test.liquid\n puts \"Updated \" + filename\n\n # replace ./_site with absolute path\n absolute = filename.sub \"./\", \"#{@root}/\"\n #puts \"Absolute \" + absolute\n\n # replace .liquid with .scss\n scss = absolute.sub \".liquid\", \".scss\"\n\n # remove _site\n scss = scss.sub \"_site/\", \"\"\n #puts \"Subs \" + scss\n \n # rename \"test\" to \"_test\" since we are using SASS partials\n scss = scss.sub @file, \"_#{@file}\"\n\n # copy .liquid to .liquid.scss\n system(\"sudo cp -f #{absolute} #{scss}\");\n\n # tell this script do not enter in an endless loop\n compile = false\n else\n compile = true\n end\n end\n end", "title": "" }, { "docid": "13bea4ac76cc659347a83e54ff0728d6", "score": "0.59439725", "text": "def run_on_modifications(_paths)\n restart\n end", "title": "" }, { "docid": "74ca73bbde49c7824ea22e7fa5abdd4b", "score": "0.59401053", "text": "def run_on_change(paths)\n start\n end", "title": "" }, { "docid": "d0f513e26ca5948e022d6be640efd2e9", "score": "0.5937898", "text": "def watching(filepath)\n \n notifier = INotify::Notifier.new\n notifier.watch(filepath, :close_write) do |event|\n # The #name field of the event object contains the name of the affected file\n @file = event.name\n @fullpath = filepath + event.name\n puts @file\n end\n notifier.run\n end", "title": "" }, { "docid": "d7416bc0dfd9b0e87ceace1e7e15ca8b", "score": "0.5935323", "text": "def on_config_file_changed(notify_event, path)\n filename = path\n if filename == File.expand_path(@config.cfg_filename)\n print \"config_file_changed - \"\n elsif filename == File.expand_path(@config.db_filename)\n print \"database updated - \"\n end\n puts Inotify::InotifyBitmask.new(notify_event.mask).as_array_of_symbols\n end", "title": "" }, { "docid": "3c34ec1a4a4cb794af9ca10b7bf1d75d", "score": "0.59335876", "text": "def modifyfile\n @modified = Time.now\n end", "title": "" }, { "docid": "a1701e15127ad2261ed43c496603fe27", "score": "0.59154356", "text": "def update_file_vulnerabilities(files, c)\n # For every change in this commit\n c.diff(c.parents.first).each_patch do |patch|\n delta = patch.delta\n # If it's a modification change\n if delta.modified?\n filepath = delta.old_file[:path]\n # And the path to the changed file isn't to be ignored\n if !should_ignore_file(filepath)\n # Then update that file's status with more churn and bug data\n file = files.get_file(filepath)\n file.vulnerabilities += 1\n end\n end\n end\nend", "title": "" }, { "docid": "4de2660deeecc29393abc0a2ac0c6442", "score": "0.5895643", "text": "def watch_change\n @watch_change = true\n until @stop\n if RbConfig::CONFIG['build'] =~ /java/ || IO.select([worker.to_io], [], [], @latency)\n break if @stop\n\n sleep(@latency)\n worker.process\n\n files = modified_files(@files.shift(@files.size).map { |f| File.dirname(f) }.uniq)\n @callback.call(files) unless files.empty?\n end\n end\n @watch_change = false\n end", "title": "" }, { "docid": "263403b71dcf25c95f1415481025ad7e", "score": "0.58921087", "text": "def run_on_changes(paths)\n run_all\n end", "title": "" }, { "docid": "1bec2b429e0608cd2784c9d4434b80a6", "score": "0.5891359", "text": "def check!\n return unless @files\n @file_list = file_list( @files )\n new_signature = signature( @file_list )\n if @signature != new_signature\n # reload file list\n puts \"* Aerogel::Reloader reloading: #{@file_list}, group: #{@group}\"\n if @group\n # invoke :before group actions\n Aerogel::Reloader.reloaders.select{|r| r.group == @group && r.opts[:before] }.each do |r|\n r.action.call @file_list\n end\n end\n @action.call @file_list\n @signature = new_signature\n if @group\n # invoke :after group actions\n Aerogel::Reloader.reloaders.select{|r| r.group == @group && r.opts[:after] }.each do |r|\n r.action.call @file_list\n end\n end\n end\n end", "title": "" }, { "docid": "b2515865f85d9cf5e6d173b00c924c41", "score": "0.5889633", "text": "def watch_change\n until @stop\n start = Time.now.to_f\n files = modified_files([@directory], :all => true)\n @callback.call(files) unless files.empty?\n nap_time = @latency - (Time.now.to_f - start)\n sleep(nap_time) if nap_time > 0\n end\n end", "title": "" }, { "docid": "70b04d30d96aa0ddc5e935cab5d6c224", "score": "0.5889198", "text": "def run_on_change(paths)\n UI.info \"Project config changed, reloading\"\n ::Forge::Guard.project.load_config\n ::Forge::Guard.builder = ::Forge::Builder.new(::Forge::Guard.project)\n # Rebuild everything if the config changes\n ::Forge::Guard.builder.build\n end", "title": "" }, { "docid": "f444538b28b5ae5b8fe2c8cc6b034fc9", "score": "0.5884661", "text": "def run_on_change(paths)\n paths.each do |file|\n unless File.basename(file)[0] == \"_\"\n File.open(get_output(file), 'w') {|f| f.write(build_sass(file)) }\n end\n puts \"-> rebuilt #{file}\"\n end\n end", "title": "" }, { "docid": "d1ef06c50550b0f4e63721c39e6e0591", "score": "0.58817416", "text": "def handle(updated_files)\n # notifier.spotted(updated_files.first)\n # send them to mapper\n Runners.files = updated_files\n runner.handle(updated_files.first)\n # run appropriate tests in runner\n end", "title": "" }, { "docid": "d1ef06c50550b0f4e63721c39e6e0591", "score": "0.58817416", "text": "def handle(updated_files)\n # notifier.spotted(updated_files.first)\n # send them to mapper\n Runners.files = updated_files\n runner.handle(updated_files.first)\n # run appropriate tests in runner\n end", "title": "" }, { "docid": "e720bd2bcb24c02623bcabc87baddc1e", "score": "0.58744735", "text": "def monitor_changes\n # Check to see if we've got any new changes\n new_changes = false\n while ( (events = @inotify.next_events(true)).size > 0 ) do\n $stdout.puts \"Detected #{events.size} new events\\n\" if @is_debug\n new_changes = true if events.find { |event| @exclude.nil? || event.filename !~ @exclude }\n $stdout.puts \"Has synchronizable changes\\n\" if new_changes && @is_debug\n end\n \n # Check if we've got any pending changes those need to be synced and timeout has passed indicating that we're ready to go\n if (@pending_changes && !new_changes) then\n $stdout.puts \"Synchronizing...\\n\" if @is_debug\n self.synchronize\n @pending_changes = false\n end\n \n # Update pending status and wait for a timeout\n @pending_changes = true if new_changes\n $stdout.puts \"Pending changes\\n\" if @pending_changes && @is_debug\n sleep @timeout\n \n end", "title": "" }, { "docid": "41002a60fb8d6262af0d279cb66b97d1", "score": "0.58647287", "text": "def on_change\n notifier = INotify::Notifier.new\n notifier.watch(@state_file, :modify) do\n yield\n end\n notifier.run\n end", "title": "" }, { "docid": "de2d46b4e009f058e81db7ed8455775b", "score": "0.58635366", "text": "def reload_modified_files!\n LOADED_FILES.each do |path, last_modified|\n reload_file(path) if File.mtime(path) > last_modified\n end\n end", "title": "" }, { "docid": "02771b4f8d150be0d3614a3c0031607b", "score": "0.58603114", "text": "def updated_source_file; end", "title": "" }, { "docid": "24cba60616ffd12180cd55a9d86e0cf6", "score": "0.5857041", "text": "def watch(fs_listener_factory, &block)\n path = File.expand_path(@path)\n dir = File.dirname(path)\n fname = File.basename(path)\n @logger.info(\"Watching for changes to #{path}\")\n fs_listener_factory.new(dir, /#{Regexp.quote(fname)}/) do |modified, added, removed|\n begin\n @logger.info(\"Change to control file detected...\")\n reload!\n yield if block_given?\n @logger.info(\"...rebuilt\")\n rescue => e\n @logger.error(\"Error reloading changes: #{e}\")\n @logger.error(e)\n end\n end.start.join\n end", "title": "" }, { "docid": "d9eb595883162a7499737511aae02e7b", "score": "0.5854712", "text": "def check_files\n return if busy # if working on something already, skip the iteration\n updated = []\n files.each do |filename, mtime| \n begin\n current_mtime = File.stat(filename).mtime\n rescue Errno::ENOENT\n # file was not found and was probably deleted\n # remove the file from the file list \n files.delete(filename)\n puts \"=> ERROR: #{filename} not found, ignoring\" if Bolt.verbose?\n next\n end\n if current_mtime != mtime \n updated << filename\n # update the mtime in file registry so we it's only send once\n files[filename] = current_mtime\n $stdout.puts \">> Spotted change in #{filename}\" if Bolt.verbose?\n end\n end\n parent.handle(updated) if updated != []\n false\n end", "title": "" }, { "docid": "6e290a7778c29988b31bc73b9192af08", "score": "0.5844812", "text": "def watch_filepaths(filepaths)\n listener = Listen.to(*filepaths) do |modified, added, removed|\n on_change(modified, added, removed)\n end\n listener.start\n end", "title": "" }, { "docid": "dff131747166359bd82b645f52c56056", "score": "0.5839604", "text": "def apply_changes\n RubyEdit::File::Writer.new.write\n end", "title": "" }, { "docid": "8317f33d9bcc57238d66f0ebe703d2a4", "score": "0.5835602", "text": "def add_watch(n_file)\n \t@notifier.watch(n_file,:all_events) do |event|\n \t\tputs \"event name :- #{event.name} and event flags :- #{event.flags}\"\n \t\tcheck_event_status(event,n_file)\n \tend\n end", "title": "" }, { "docid": "e24bb6a2c0af72132a42538304e455a3", "score": "0.58315873", "text": "def run_on_change(changed_paths)\n extra = @delete ? ['--delete'] : []\n standard_rsync(extra + ['-v'])\n end", "title": "" }, { "docid": "45a460098b99083f20059ac04fb63d26", "score": "0.58189166", "text": "def run_on_change(paths)\n\t\t paths.each do |path|\n\t\t results = `jshint #{path} --config #{@options[:config]}`\n\t\t if results.include? 'Lint Free!'\n\t\t \tif options[:notify]\n\t\t \t::Guard::Notifier.notify('No errors found.', :title => 'JSHint', :image => :success)\n\t\t end\n\t\t else\n\t\t \tif options[:notify]\n\t\t \t::Guard::Notifier.notify(results, :title => 'JSHint Errors', :image => :failed)\n\t\t end\n\t\t print results\n\t\t end\n\t\t end\n\t end", "title": "" }, { "docid": "58cb08a4d7feeb63528e99e41b8ce81a", "score": "0.5809598", "text": "def run_on_change(paths)\n build_extension\n end", "title": "" } ]
6344c4cb2cde200f7a935a734df6eeeb
GET /settings/account def account end PATCH /settings/account
[ { "docid": "43bfc8009ad94b7a809c5e9cab53d861", "score": "0.71110857", "text": "def update_account\n if current_user.update(account_params)\n redirect_to settings_account_path, notice: \"Account successfully updated.\"\n else\n render :account\n end\n end", "title": "" } ]
[ { "docid": "3b31e0d330d14b29b191cdbab3fcd4e9", "score": "0.7423612", "text": "def account\n get('/account')\n end", "title": "" }, { "docid": "f8e530ea3cd510b4ec5c2e1dae391439", "score": "0.73434764", "text": "def account\n get('account')\n end", "title": "" }, { "docid": "0e6bad5986964f4ab838b6db9191c335", "score": "0.7326896", "text": "def settings\n if request.put?\n if current_account.update_attributes params[:account]\n flash[:notice] = \"Account updated.\"\n redirect_to settings_path\n else\n flash[:alert] = \"Account could not be updated.\"\n\n render :action => \"settings\", :controller => \"texter\"\n end\n end\n end", "title": "" }, { "docid": "895b5f569d6bddfd72438376a8736c3a", "score": "0.7129034", "text": "def account\n @account = current_account_settings\n end", "title": "" }, { "docid": "fcb10a514c86e97ae124c932d9f09ac2", "score": "0.71225244", "text": "def account\n end", "title": "" }, { "docid": "406dfc9e1116f353de1c2ff046d48715", "score": "0.71121895", "text": "def account\n perform_get_request('/account')\n end", "title": "" }, { "docid": "186100f847ab5f20e03fe780d8afec71", "score": "0.7098867", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to edit_admin_account_path, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: root_url }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "21e60a2764ea38cc162442abcbb1dd1f", "score": "0.7089161", "text": "def update\n unless admin_logged_in then return end\n \n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to \"/admin\", :notice => 'Account was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd01745ecbb2c19fd1980da414b938b3", "score": "0.707918", "text": "def update\t\t\n\t\t@account = Account.find(params[:id])\n\t\t@account.updating_password = false\n\n\t\tif @account.update_attributes(edit_account_params)\n\t\t\tflash[:success] = \"Your account settings have been successfully updated.\"\n\t\t\tredirect_to @account\n\t\telse\n\t\t\trender 'edit'\n\t\tend\n\tend", "title": "" }, { "docid": "e42dc1b5cfa60451a8f1f39f42528611", "score": "0.70536387", "text": "def update\n\t\trespond_to do |format|\n\t\t\tif @account.update(account_params)\n\t\t\t\tformat.html { redirect_to @account, notice: 'Account was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @account.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "2e0c39bca50342c7434d4fb46148ec60", "score": "0.70131135", "text": "def update\n @user = current_user\n @user.update_attributes(params[:account])\n\n respond_with(@user, :location => edit_account_settings_path(:user => @user.username))\n end", "title": "" }, { "docid": "ed37122cb91f74f5b05ab27bf9eb6219", "score": "0.7009736", "text": "def account\n end", "title": "" }, { "docid": "c89d89e071c3f7ce267042d5f7193db4", "score": "0.700215", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to account_root_path(@account), notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3977b7341f05534ebf48ca1623522958", "score": "0.69946927", "text": "def update_account(opts)\n HelloSign::Resource::Account.new post('/account', :body => opts)\n end", "title": "" }, { "docid": "d7899a48d8e86f7b3c5d5f153c990b31", "score": "0.69860643", "text": "def update\n @account = Account.find(params[:id])\n @account.attributes = params[:account]\n @account.password = Digest::SHA1.hexdigest(@account.password)\n @account.password_confirmation = Digest::SHA1.hexdigest(@account.password_confirmation)\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'アカウントが正常に更新されました。' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a35ff877e985a819589e30b550133f5", "score": "0.6980958", "text": "def update\n render status: 403\n return\n if @account.update(account_params)\n render json: @account\n else\n render json: @account.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b8f74207549e5edb2abb93440d45ade8", "score": "0.6977064", "text": "def update\n @account = current_user.accounts.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ff99486bd117ea96875caa9752b087a", "score": "0.69701767", "text": "def update\n @account = current_user.accounts.find(params[:id])\n\n if @account.update(account_params)\n head :no_content\n else\n render json: @account.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "67b41021b1a4e652907be82ac9aa9edc", "score": "0.6957018", "text": "def set_account\n @account = Account.find(params[:account_id]) # new, edit, create, update, destroy\n end", "title": "" }, { "docid": "67b41021b1a4e652907be82ac9aa9edc", "score": "0.6957018", "text": "def set_account\n @account = Account.find(params[:account_id]) # new, edit, create, update, destroy\n end", "title": "" }, { "docid": "72aa0e79cc7c5b7c9d63ebbbff0de21b", "score": "0.69256717", "text": "def update\n # find and update the account\n end", "title": "" }, { "docid": "122b91bb18dd8d5a19d77d2365a35c07", "score": "0.6882802", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: t('.notice') }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb7dd641338995abd0b9181fbd7a825b", "score": "0.68825185", "text": "def update\n respond_to do |format|\n if @account_setting.update_attributes(params[:account_setting])\n format.html { redirect_to @account_setting, notice: 'Account setting was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account_setting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32a2689c549692434b5e8781041d0c91", "score": "0.6880532", "text": "def update\n # @account.user = current_user\n\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to account_path(@account), notice: 'account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n \n end", "title": "" }, { "docid": "8dfb11ee2b6ee820789fa078e3ebe4a9", "score": "0.6853764", "text": "def edit\n respond_with(@account)\n end", "title": "" }, { "docid": "2576a8845bf1dcc8b55c06c06382a762", "score": "0.683874", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :index, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b24afbebe4c59e700867f808c081fad", "score": "0.6822794", "text": "def update\n @account = Account.find(params[:id])\n @account.name = params[:account][:name]\n @account.allowance = params[:account][:allowance]\n @account.password = params[:account][:password] unless params[:account][:password].length == 0\n \n respond_to do |format|\n if @account.save\n format.html { redirect_to bank_accounts_path(@bank), :notice => 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e82b5de3f6613897cf5121436b8cf7e4", "score": "0.6821934", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html {redirect_to user_account_path(@user, @account), notice: 'Account was successfully updated.'}\n format.json {render :show, status: :ok, location: @account}\n else\n format.html {render :edit}\n format.json {render json: @account.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "4fbfa7bba1d4034b3e47187e242e2389", "score": "0.68217754", "text": "def set_account\r\n @account = Account.find(params[:id])\r\n end", "title": "" }, { "docid": "6d4553dc0d97cde9ca8070edfe8a4676", "score": "0.6815688", "text": "def account\n # TODO exclude promotional money\n @account = @person.account\n render \"api/v1/accounts/show\"\n end", "title": "" }, { "docid": "ff5671c7d7471f13c542e5388f679f62", "score": "0.68128633", "text": "def update\n @account = Account.find(params[:id])\n flash[:notice] = 'Account was successfully updated.' if @account.update_attributes(params[:account])\n respond_with(:admin, @account)\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99a2001f54bcba1a2211124b05d56bad", "score": "0.6804727", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "55c57be0cc91dd23335bb92a8a5b3c7a", "score": "0.67986953", "text": "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to accounts_path, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd272aa91438fb291e34020c5df902c0", "score": "0.6794973", "text": "def set_account\n @account = Account.find(params[:account_id])\n end", "title": "" }, { "docid": "2fa76b1927d8a6a9cb9bf8c95ce61f80", "score": "0.6792824", "text": "def account_settings\n @user = User.find_by_id(params[:id])\n end", "title": "" }, { "docid": "9a766082afb8907706ce1510dfc485cf", "score": "0.6781193", "text": "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to :back, notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "de00b92261f728630783f6b8e6e1dcb3", "score": "0.67809224", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "de00b92261f728630783f6b8e6e1dcb3", "score": "0.67809224", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "de00b92261f728630783f6b8e6e1dcb3", "score": "0.67809224", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "de00b92261f728630783f6b8e6e1dcb3", "score": "0.67809224", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "de00b92261f728630783f6b8e6e1dcb3", "score": "0.67809224", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "de00b92261f728630783f6b8e6e1dcb3", "score": "0.67809224", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "de00b92261f728630783f6b8e6e1dcb3", "score": "0.67809224", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "de00b92261f728630783f6b8e6e1dcb3", "score": "0.67809224", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "de00b92261f728630783f6b8e6e1dcb3", "score": "0.67809224", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "de00b92261f728630783f6b8e6e1dcb3", "score": "0.67809224", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "de00b92261f728630783f6b8e6e1dcb3", "score": "0.67809224", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "1d131d39645dfeeffecf15ed5548246a", "score": "0.678042", "text": "def set_account\n @account = @user.accounts.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67778796", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "ed5176731ddb4947f02d5baaebc85a97", "score": "0.67775184", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67774886", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.6777254", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "4b998a98b719aa605bce4a1282fdce14", "score": "0.6776832", "text": "def update\n if @account.update(update_account_params)\n render_success @account\n else\n render_jsonapi_errors @account\n end\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" }, { "docid": "13aa64dcc6c2e8812c25a9b132483185", "score": "0.67766136", "text": "def set_account\n @account = Account.find(params[:id])\n end", "title": "" } ]
e2966f224f7fd9a7871f4bb91ae4e4c7
GET /dmvideos GET /dmvideos.json
[ { "docid": "3f0e8b2109a3c8dbcc8edb9b83f1b549", "score": "0.7501118", "text": "def index\n @dmvideos = Dmvideo.all\n end", "title": "" } ]
[ { "docid": "0d7fadc9ed2f9e2b425b1fa79bc4efca", "score": "0.7283964", "text": "def videos( params={} )\n videos = get_connections(\"videos\", params)\n return map_connections videos, :to => Facebook::Graph::Video\n end", "title": "" }, { "docid": "0d7fadc9ed2f9e2b425b1fa79bc4efca", "score": "0.7283964", "text": "def videos( params={} )\n videos = get_connections(\"videos\", params)\n return map_connections videos, :to => Facebook::Graph::Video\n end", "title": "" }, { "docid": "5924bd15508e8a45ccf1116353146c98", "score": "0.7269364", "text": "def video(video_id)\n make_request(:get, \"/videos/#{video_id}\")\n end", "title": "" }, { "docid": "98ef5c4d4ee1bc126a4128dfffae270d", "score": "0.724962", "text": "def get_video videos_url \n @doc = get_root videos_url\n \n @video = @doc.elements['entry']\n end", "title": "" }, { "docid": "f061267ca712f77654829576ae68e6c5", "score": "0.7243339", "text": "def videos\n @client = YouTubeIt::Client.new\n @videos = @client.videos_by(:query => params[:description])\n @lifts = Lift.all\n @video = Video.new\n end", "title": "" }, { "docid": "82eda3d8611ea0670dbd5fe47b717135", "score": "0.72171766", "text": "def videos(product_id, params = {})\n response, status = BeyondApi::Request.get(@session,\n \"/products/#{product_id}/videos\",\n params)\n\n handle_response(response, status)\n end", "title": "" }, { "docid": "24b55059068ab0d5a2d271c5910b82f2", "score": "0.71530914", "text": "def all_videos\n videos = Video.all\n\n if videos\n render json: {\n videos: videos\n }\n else\n render json:{\n status: 500\n }\n end\n end", "title": "" }, { "docid": "2b20f06f06aa34fe31f9e5eebb507622", "score": "0.7139986", "text": "def videos\n @heading = \"Popular Videos\"\n @stories = Story.find_all_by_media(\"video\")\n\n respond_to do |format|\n format.html { render :action => \"index\" }\n format.xml { render :xml => @stories }\n end\n end", "title": "" }, { "docid": "459668c768fa7d304b324db74a4aeecf", "score": "0.7135847", "text": "def show\n get_videos\n end", "title": "" }, { "docid": "8792645b731c0618180d96ed722c7ba5", "score": "0.71294034", "text": "def videos options = {}\n perform_get_with_object(\"/channels/#{get_id}/videos\", options, Vimeo::Entities::Video)\n end", "title": "" }, { "docid": "1d29ce1e84c8bb9b6c8c66deb98f51ff", "score": "0.71259534", "text": "def get_video\n video = Video.find(params[:video_id])\n if video\n render json: video\n else\n render json:{\n status: 500\n }\n end\n end", "title": "" }, { "docid": "a23c26b1f574cb01e4c215ea26484ca2", "score": "0.71150905", "text": "def get_videos videos_url\n @videos = [] if @videos.nil?\n doc.elements.each('entry') do |v|\n @videos << Video.new(:video => v)\n end\n end", "title": "" }, { "docid": "8541143638d23dd90ca306b7f6169cfa", "score": "0.7083894", "text": "def videos options = {}\n perform_get_with_object(\"/groups/#{get_id}/videos\", options, Vimeo::Entities::Video)\n end", "title": "" }, { "docid": "ad2a9f85df59ac7ac1a554cf4b151a2f", "score": "0.7068917", "text": "def index\n @videodb = Video.all\n \n @config = YAML::load(ERB.new(IO.read(File.join(Rails.root.to_s, 'config', 'viddler.yml'))).result)[Rails.env]\n \n viddler = Viddler::Client.new(@config[\"api_token\"])\n viddler.authenticate! @config[\"login\"], @config[\"password\"]\n \n @videos = viddler.get 'viddler.videos.getByUser', :user => @config[\"login\"]\n puts @videos\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @videodb }\n end\n end", "title": "" }, { "docid": "fd99a05e27ec448d36c8569730165dce", "score": "0.70609456", "text": "def videos options = {}\n perform_get_with_object(\"/users/#{get_id}/videos\", options, Vimeo::Entities::Video)\n end", "title": "" }, { "docid": "b7c850924c7fc67e0b615c846d8dc843", "score": "0.70221007", "text": "def list\r\n deleted = params[:deleted] == \"true\" ? true : false\r\n videos = Video.where(deleted: deleted)\r\n render json: videos\r\n end", "title": "" }, { "docid": "b06b0f724b72a8235522d02fd09a588b", "score": "0.69991606", "text": "def get_videos(day)\n response = Typhoeus::Request.get(\n \"https://www.googleapis.com/youtube/v3/playlistItems?part=#{PART}&maxResults=#{MAX_RESULTS}&playlistId=#{PLAYLIST_ID}&key=#{API_KEY}\",\n headers: { 'Content-Type' => \"application/json\" }\n )\n\n data = JSON.parse(response.response_body)\n\n # Gets urls of videos uploaded within last 24 hours from current DateTime\n data['items'].each do |item|\n if item['snippet']['publishedAt'] > (day).to_s\n video_id = item['snippet']['resourceId']['videoId']\n (@video_ids ||=[]).push(video_id) # Create video_ids array and add video_id\n end\n end\n # puts @video_ids.inspect\n end", "title": "" }, { "docid": "d79d7c4fd0b6d2d5cb0b64c660066c06", "score": "0.6996564", "text": "def get_videos(page)\n x = current_user.own_media_elements(page, VIDEOS_FOR_PAGE, Filters::VIDEO, true)\n @videos = x[:records]\n @tot_pages = x[:pages_amount]\n end", "title": "" }, { "docid": "7dd9ab0cedf1dbd0ccf916a643a1be83", "score": "0.69889086", "text": "def show\n @videos = @video_set.videos\n end", "title": "" }, { "docid": "deec3e4f5344ad16ed652d0680e20a19", "score": "0.6974214", "text": "def get_videos(options)\n options[:page] = integer_or_default(options[:page], 1)\n params = {}\n params['max-results'] = integer_or_default(options[:per_page], 25)\n params['start-index'] = calculate_offset(options[:page], params['max-results'] )\n params['q'] = options[:query]\n url_params = join_params(params)\n url_params = videos_link.include?(\"?\") ? \"&#{url_params}\" : \"?#{url_params}\"\n url = \"#{videos_link}#{url_params}\"\n logger.debug \"Submitting request [url=#{url}].\" if logger\n YouTubeG::Parser::VideosFeedParser.new(url).parse\n end", "title": "" }, { "docid": "6a8422ac261b578cfb7fb06720110fd5", "score": "0.6961148", "text": "def list(options = {})\n make_request(:get, \"/videos\", options)\n end", "title": "" }, { "docid": "f5a62510a07abda9f01dc9c729ace82f", "score": "0.6957453", "text": "def get_video(video_id)\n get(\"/videos/#{video_id}\")\n end", "title": "" }, { "docid": "1b8afccf642a07e2352ea86e94ba4b3d", "score": "0.6916309", "text": "def index\n @videos = Video.all\n if @videos\n render json: { \n status: 'SUCCESS', \n message: 'Load successfully!', \n data: @videos \n }, status: :ok\n else\n render json: { \n status: 'ERROR', \n message: 'Failed to load videos!', \n }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b2591d35758ebdd6602f79fda53ab498", "score": "0.6893207", "text": "def videos(search_parameters)\n self.class.get(\"/search/\", :query => {\n :q => 'violencia',\n :apikey => 'tGJdxmKnlDjOgXgGgWmXtULMwpPGxE0R',\n :format => 'json'\n })\n end", "title": "" }, { "docid": "06e83f6290570a3ce3b71c5b85dcaa95", "score": "0.6885241", "text": "def videos(options = {})\n uri = videos_url(options)\n doc = establish_connection(uri)\n (doc/:video).inject([]){ |r, i| r << parse_single_xml(i, Video) }\n end", "title": "" }, { "docid": "c63dd82e1d7b8841f29c0bcc68e1ce8f", "score": "0.6869453", "text": "def video_info_by_id(service, part, **params)\n params = params.delete_if { |p, v| v == ''}\n response = service.list_videos(part, params).to_json\n JSON.parse(response).fetch(\"items\")[0]\nend", "title": "" }, { "docid": "cf6985ecef180f2ad2e5e742de178eb8", "score": "0.6857617", "text": "def user_videos\n if params[:user_id] == session[:user_id]\n videos = Video.where(user_id: session[:user_id])\n end\n if videos\n render json: {\n videos: videos\n }\n else\n render json:{\n status: 500\n }\n end\n end", "title": "" }, { "docid": "1f980ba0d0e43b007e2c5c8f55b3372d", "score": "0.68546075", "text": "def json_video(videos)\n json_videos = []\n videos.each do |video|\n youtube_id = /(?:&|\\?)v=([^&]+)/.match(video.content)[1]\n json_videos << {\n youtube_id: youtube_id,\n thumb: \"http://img.youtube.com/vi/#{youtube_id}/0.jpg\",\n image: \"http://img.youtube.com/vi/#{youtube_id}/0.jpg\",\n title: video.title\n }\n end\n json_videos\n end", "title": "" }, { "docid": "0398f042f2ef2a034da4967b32b36113", "score": "0.6809721", "text": "def show\n @video_category = VideoCategory.find(params[:id])\n @videos = @video_category.videos \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video_category }\n end\n end", "title": "" }, { "docid": "fa4650928c92a5eca6789239e3cadb9c", "score": "0.68051815", "text": "def show\n @api_v1_video = Api::V1::Video.find(params[:id])\n\n render json: @api_v1_video\n end", "title": "" }, { "docid": "d63a988ba69ef4a4ec3a64608f44ae89", "score": "0.680358", "text": "def index\n @videos = current_site.videos\n @content_for_title = \"Videos\"\n respond_with(@videos)\n end", "title": "" }, { "docid": "c11f746cfd8980cf4853a7ef1b94dc0a", "score": "0.6766768", "text": "def show\r\n video = Video.find_by_token(params[:token])\r\n render json: video\r\n end", "title": "" }, { "docid": "b419397377053728c70753e7af779849", "score": "0.6735256", "text": "def showVideos\n\n end", "title": "" }, { "docid": "eafc9c4ba8b13ca3369e423dabade322", "score": "0.67262745", "text": "def show\n render json: @video\n end", "title": "" }, { "docid": "83974b7c01aa08c7d7f77bbe5db440da", "score": "0.6709899", "text": "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end", "title": "" }, { "docid": "83974b7c01aa08c7d7f77bbe5db440da", "score": "0.6709899", "text": "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end", "title": "" }, { "docid": "83974b7c01aa08c7d7f77bbe5db440da", "score": "0.6709899", "text": "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end", "title": "" }, { "docid": "25506437c497986719cde4adc00c16cd", "score": "0.6709842", "text": "def index\n @videos = @user.videos\n end", "title": "" }, { "docid": "83974b7c01aa08c7d7f77bbe5db440da", "score": "0.6707598", "text": "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end", "title": "" }, { "docid": "7626bcc13c252e5ad88ae36ffd366f41", "score": "0.66989976", "text": "def index\n # video = Video.new()\n @video_list = Video.get_list()\n end", "title": "" }, { "docid": "a23736874359c6932c4592c34c695148", "score": "0.66985214", "text": "def show\n @video = Video.find(params[:id])\n\n\n respond_to do |format|\n format.html {\n }\n\n format.json {\n render json: { video: @video }\n }\n end\n\n end", "title": "" }, { "docid": "b908cd681440e614df4ec881de37fd53", "score": "0.66930825", "text": "def video_for_lesson_editor\n get_videos(1)\n end", "title": "" }, { "docid": "aa7abb4dd8b510f53e6a8016972860e7", "score": "0.6683184", "text": "def get(video_id)\n params = {:id => video_id, :part => 'snippet,statistics'}\n request = Yourub::REST::Videos.list(self,params)\n Yourub::Result.format(request).first\n end", "title": "" }, { "docid": "84ee145e6b2f5503c6d507ba6207c120", "score": "0.66755766", "text": "def index\n @videos = @owner.videos\n respond_with @videos\n end", "title": "" }, { "docid": "86dcc34b32a9ece56582bf17bb16c69c", "score": "0.6668665", "text": "def index\n @videos = Video.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @videos }\n end\n end", "title": "" }, { "docid": "56aeead6afef5fed0d9ee12e67428685", "score": "0.6658878", "text": "def index\n @videos = current_user.videos\n @purchased_videos = current_user.purchased_videos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @videos }\n end\n end", "title": "" }, { "docid": "75eb0d59006d8c5bb618f6841aaf27be", "score": "0.6651494", "text": "def portfilio_videos portfolio_id, options = {}\n perform_get(\"/users/#{get_id}/portfolios/#{portfolio_id}/videos\")\n end", "title": "" }, { "docid": "8b8020d3630e5d6b262859be1067b577", "score": "0.66511655", "text": "def get_video(account_id, video_id)\n api(\"accounts/#{account_id}/videos/#{video_id}\")\n end", "title": "" }, { "docid": "0925b910a2763f8c4524fe0c1177d339", "score": "0.66309726", "text": "def videos\n @artist = Artist.find(params[:id])\n @videos = @artist.active_videos(current_user)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @artist }\n end\n end", "title": "" }, { "docid": "5e129c86facfd807d7ca6f0898f021a9", "score": "0.6624683", "text": "def index\n respond_with @user.videos\n end", "title": "" }, { "docid": "a321908e0b7fe6d3c73a39680b60437d", "score": "0.6622397", "text": "def index\n #@videos = Video.find_all_by_account_id(session[:account_id])\n @videos = Video.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @videos }\n format.json { render :json => @videos }\n end\n end", "title": "" }, { "docid": "af628a8352025a616d4c101c63692306", "score": "0.6596474", "text": "def video(id)\n response = establish_connection(\"videos/#{id}.xml\")\n parse_single_xml(response.at(:video), Video)\n end", "title": "" }, { "docid": "5d02d2d355bd7f2b3dad988418076336", "score": "0.6586924", "text": "def index\n @videos = Video.find(:all, :order => \"created_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @videos }\n end\n end", "title": "" }, { "docid": "28389d22c3375b1c1029d9c13386969c", "score": "0.65771425", "text": "def videos_for(identifier)\n find_elements(\"videos(identifier)\", Elements::Video, identifier, 'video')\n end", "title": "" }, { "docid": "87de73a502e440645ebedab5bb81984b", "score": "0.6557662", "text": "def index\n\t\t@admin_videos = Admin::Video.paginate(page: params[:page]).order('created_at DESC')\n end", "title": "" }, { "docid": "77b490019aa750abc7b9a9d9953c18a8", "score": "0.6551969", "text": "def show\n render :json => @video_motif\n end", "title": "" }, { "docid": "cb997ad7adad2fb42acc48be57da6ec3", "score": "0.6540717", "text": "def index\n @videos = current_user.videos.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "b0d8c297fbfa8912fd7607609e93066a", "score": "0.6534097", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "e66bbff6d23a9b220ebeb640b68c0da5", "score": "0.6527906", "text": "def index\n @videos = Video.actives.order_by_id.paginate(page: params[:page], per_page: @@VIDEOS_PER_PAGE)\n end", "title": "" }, { "docid": "61ec480da953d3ffaf9fb7f9e4ad49e2", "score": "0.65267146", "text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "title": "" }, { "docid": "61ec480da953d3ffaf9fb7f9e4ad49e2", "score": "0.65267146", "text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "title": "" }, { "docid": "61ec480da953d3ffaf9fb7f9e4ad49e2", "score": "0.65267146", "text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "title": "" }, { "docid": "61ec480da953d3ffaf9fb7f9e4ad49e2", "score": "0.65267146", "text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "title": "" }, { "docid": "61ec480da953d3ffaf9fb7f9e4ad49e2", "score": "0.65267146", "text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "title": "" }, { "docid": "61ec480da953d3ffaf9fb7f9e4ad49e2", "score": "0.65267146", "text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @video }\n end\n end", "title": "" }, { "docid": "1936becce51102f8ddc8c5807902c422", "score": "0.6524476", "text": "def album_videos album_id, options = {}\n perform_get_with_object(\"/users/#{get_id}/albums/#{album_id}/videos\", options, Vimeo::Entities::Video)\n end", "title": "" }, { "docid": "16f733c713ff440ff2a0a944ea16d093", "score": "0.6523865", "text": "def index\n @embedded_videos = EmbeddedVideo.all\n end", "title": "" }, { "docid": "7f620bca7cbe81a182b56ebccc481c70", "score": "0.65201145", "text": "def index\n @videos = Video.all.page(params[:page])\n end", "title": "" }, { "docid": "638cb2e08e735be39a9f02db84cbbae4", "score": "0.65121573", "text": "def index\n @videos = Video.all \n end", "title": "" }, { "docid": "078b5df9ab8b0033eb70494e73377f9d", "score": "0.649311", "text": "def index\n\t\t@gallery_videos = @gallery.videos\n\tend", "title": "" }, { "docid": "b63a0b91cc3f3753abc1c7d41e76dc6c", "score": "0.6487952", "text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @video }\n end\n end", "title": "" }, { "docid": "dd8dbaede0474143d51892cbcf07d3c7", "score": "0.6487133", "text": "def show\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "title": "" }, { "docid": "0b7a95b9e1fe3d8de05c899ab3d8b88c", "score": "0.6483161", "text": "def index\n @guides_videos = Guides::Video.all\n end", "title": "" }, { "docid": "0f2f3056a9539c0c38c9c777ff4fb50d", "score": "0.64759254", "text": "def show\n # Pull the selected video, if approved.\n @video = Video.approved.find(params[:id])\n\n respond_to do |format|\n format.json do\n if !@video.screenshot.blank?\n screenshot = {\n url: @video.screenshot.url,\n filename: File.basename(@video.screenshot.url)\n }\n end\n render json: {\n id: @video.id,\n video_playlist_id: @video.video_playlist_id,\n embed_code: @video.embed_code,\n embed_id: @video.embed_id,\n title: @video.title,\n subtitle: @video.subtitle,\n caption: @video.caption,\n position: @video.position,\n screenshot: screenshot,\n tags: @video.video_tags.select([:id, :tag]),\n created_at: @video.created_at,\n updated_at: @video.updated_at\n }\n end\n end\n end", "title": "" }, { "docid": "82920e2d3a6d4293ab380488b5fe2b4a", "score": "0.6475141", "text": "def video\n\t\tVideo.find(self.video_id)\n\tend", "title": "" }, { "docid": "dc578d7692e2c44628803ba35c81f292", "score": "0.6464084", "text": "def show_topic_videos\n \n @topic = Topic.find(params[:id])\n begin\n # Fetch topic related resources\n #@resource_array = Resource.find_all_by_topic_id @topic.id\n @resource_array_videos = Resource.paginate(\n :conditions => \"topic_id = #{@topic.id} && type_id = 'video'\",\n :per_page => 10,\n :page => params[:page],\n :order => 'up_count DESC, created_at DESC, add_count DESC, down_count ASC'\n )\n rescue ActiveRecord::RecordNotFound\n nil\n end\n\n respond_to do |format|\n format.html {\n if request.xhr?\n render :partial => \"topic_resources_videos\", :collection => @resource_array_videos\n end\n }\n format.json { render json: @topic }\n end\n end", "title": "" }, { "docid": "2904d11875f0106d64c60e945bc3229b", "score": "0.6457329", "text": "def find_video_details\n video_response = HTTParty.get('https://youtube.googleapis.com/youtube/v3/videos', query: {part: 'snippet,contentDetails', id: video_id, key: ENV.fetch('YOUTUBE_V3_API_KEY')})\n if (video_response.ok?)\n channel_respone = HTTParty.get('https://youtube.googleapis.com/youtube/v3/channels', query: {part: 'snippet', id: video_response.dig('items', 0, 'snippet', 'channelId'), key: ENV.fetch('YOUTUBE_V3_API_KEY')})\n {\n title: video_response.dig('items', 0, 'snippet', 'title'),\n duration: find_duration(video_response.dig('items', 0, 'contentDetails', 'duration')),\n owner: channel_respone.dig('items', 0, 'snippet', 'title'),\n id: video_id\n }\n end\n end", "title": "" }, { "docid": "82ce9b9bcef582ee920ee27d68d61740", "score": "0.6454639", "text": "def show\n get_all_categories\n @video = Video.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @video }\n end\n end", "title": "" }, { "docid": "8161e9c702cfe7b6d3cb3130612d34b9", "score": "0.64533585", "text": "def show\n if @video\n render json: { \n status: 'SUCCESS', \n message: 'Load successfully!', \n data: @video \n }, status: :ok\n else\n render json: { \n status: 'ERROR', \n message: 'Video not found!', \n }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "1cd60052489080c4f479743e4083d993", "score": "0.64430493", "text": "def show\r\n @video = Video.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @video }\r\n end\r\n end", "title": "" }, { "docid": "00166a237da81997109b94b0aae5e7b9", "score": "0.64388293", "text": "def index\n @videos = Video.all\n end", "title": "" }, { "docid": "1cbfe11213b9b6f15199dc55be387b35", "score": "0.64386946", "text": "def show\n respond_to do |format|\n format.html\n format.json { render json: @video }\n end\n end", "title": "" } ]
56e6429ca7a079fb9a27d7d54150d188
Return an instance of Cozy::FluentFixtures::FluentFactory for the base fixture of the receiving module.
[ { "docid": "3c214a15c37752bb648165f869727ad9", "score": "0.7814884", "text": "def factory( *args, &block )\n\t\treturn FluentFixtures::Factory.new( self, *args, &block )\n\tend", "title": "" } ]
[ { "docid": "80ecb106f9d662576c7f98e879ed8c93", "score": "0.5592979", "text": "def build(name, overrides = {})\n FixtureFactory.build(\n name, overrides: overrides, context: self, scope: self.class\n )\n end", "title": "" }, { "docid": "14760c11b88b766b7f2351e9670bf285", "score": "0.5425635", "text": "def instantiate_from_fixture(fixture)\n new(fixture)\n end", "title": "" }, { "docid": "666c2525cd99fc64b12c43457de874c4", "score": "0.538562", "text": "def factory\n @@factory ||= Factory.new(self)\n end", "title": "" }, { "docid": "7a31735e2af5b143a9e9ceff52dcc0da", "score": "0.5361225", "text": "def extended( fixture_mod )\n\t\tsuper\n\n\t\tfixture_mod.extend( Loggability )\n\t\tfixture_mod.log_to( :fluent_fixtures )\n\n\t\tfixture_mod.extend( FluentFixtures::DSL )\n\t\tfixture_mod.instance_variable_set( :@decorators, {} )\n\t\tfixture_mod.instance_variable_set( :@decorator_options, {} )\n\t\tfixture_mod.instance_variable_set( :@fixtured_class, nil )\n\t\tfixture_mod.instance_variable_set( :@base_fixture, nil )\n\n\t\tfixture_mod.collection = self\n\n\t\tif default_name = self.default_base_fixture_name( fixture_mod )\n\t\t\tself.add_base_fixture( default_name, fixture_mod )\n\t\tend\n\tend", "title": "" }, { "docid": "90bcfab79e2ee8279dbfb2f6b5a70d5c", "score": "0.5351958", "text": "def base( name=nil, &block )\n\t\tname ||= self.collection.default_base_fixture_name( self )\n\n\t\tself.base_fixture = name\n\t\tself.decorators[ :_ ] = block if block\n\n\t\tself.collection.add_base_fixture( name, self )\n\tend", "title": "" }, { "docid": "3562bea688d5c76bc8b2e9d70e0734c2", "score": "0.5345285", "text": "def fixture; end", "title": "" }, { "docid": "82eeb8b9dee0ae0e0fe2a3ded2667dd8", "score": "0.52989614", "text": "def fixture(*args, &blk)\n new(fixture_attributes(*args), &blk)\n end", "title": "" }, { "docid": "43e499ebf3dde1b32369a288320f5148", "score": "0.52704036", "text": "def parent\n Setup.for(clazz.superclass)\n end", "title": "" }, { "docid": "01766b90508748f9c32528e9d5d10f24", "score": "0.5193795", "text": "def create_factory\n Factory(klass_name_symbol, @options)\n end", "title": "" }, { "docid": "969c42eb19fd8d6c73721433ea6fc979", "score": "0.5187533", "text": "def mock_factory\n Factory.new(self)\n end", "title": "" }, { "docid": "6c7c82a7dbaf7c040e325266aff7f538", "score": "0.5177686", "text": "def define_factories(&block)\n self.fixture_factory_definitions = {}.with_indifferent_access\n instance_exec(&block) if block.present?\n end", "title": "" }, { "docid": "91275bce629e7be154f7276d178a52f5", "score": "0.5176892", "text": "def build\n # Truncate all tables\n unless skip_database_cleaner\n cleaner = Utils::DatabaseCleaner.new(db, database_cleaner_tables)\n cleaner.clean\n end\n\n fixture_path, fixture_dir = File.split(path_to_fixtures)\n\n Sequel::Fixture.path = fixture_path\n\n Sequel::Fixture.new(fixture_dir.to_sym, db)\n end", "title": "" }, { "docid": "bc521c54dd6f98acb87d599f2ce05c47", "score": "0.51719606", "text": "def factory\n @factory\n end", "title": "" }, { "docid": "5622469b0177ce219a42f91943c95182", "score": "0.51362926", "text": "def make_with(factory_name, *args, &block)\n factory_bot_delegate :build, factory_name, *args, &block\n end", "title": "" }, { "docid": "c0596f892dadf3e962d9ad478bb7e311", "score": "0.5118455", "text": "def instance( args={}, &block )\n\t\tinstance = self.fixture_module.\n\t\t\tfixtured_instance( *self.constructor_args, &self.constructor_block )\n\n\t\tself.decorators.each do |decorator_name, decorator_args, block|\n\t\t\t# :TODO: Reify other fixtures in `decorator_args` here?\n\t\t\tif !decorator_name\n\t\t\t\tself.apply_inline_decorator( instance, block )\n\t\t\telsif self.fixture_module.decorators.key?( decorator_name )\n\t\t\t\tinstance = self.apply_named_decorator( instance, decorator_args, decorator_name )\n\t\t\telse\n\t\t\t\tself.apply_method_decorator( instance, decorator_args, decorator_name, block )\n\t\t\tend\n\t\tend\n\n\t\targs.each_pair do |attrname, value|\n\t\t\t# :TODO: Reify the `value` if it responds to #create?\n\t\t\tinstance.public_send( \"#{attrname}=\", value )\n\t\tend\n\n\t\t# If the factory was called with a block, use it as a final decorator before\n\t\t# returning it.\n\t\tif block\n\t\t\tself.log.debug \"Applying inline decorator %p\" % [ block ]\n\t\t\tif block.arity.zero?\n\t\t\t\tinstance.instance_exec( &block )\n\t\t\telse\n\t\t\t\tblock.call( instance )\n\t\t\tend\n\t\tend\n\n\t\treturn instance\n\tend", "title": "" }, { "docid": "2c9fe638d3be1b65635640cfb057cc60", "score": "0.5118347", "text": "def make_with!(factory_name, *args, &block)\n factory_bot_delegate :create, factory_name, *args, &block\n end", "title": "" }, { "docid": "4f2c7903d7d80789a8ecd5dfe5aa1186", "score": "0.50631475", "text": "def testFixtureSetup()\n end", "title": "" }, { "docid": "4f2c7903d7d80789a8ecd5dfe5aa1186", "score": "0.50631475", "text": "def testFixtureSetup()\n end", "title": "" }, { "docid": "29d4e803840f83fbdb2875eb3dd34214", "score": "0.5038297", "text": "def fixture_path\n File.expand_path('../fixtures', __FILE__)\nend", "title": "" }, { "docid": "019bfcad2928fffc8e5da7774da29849", "score": "0.49560866", "text": "def create(name, overrides = {})\n FixtureFactory.create(\n name, overrides: overrides, context: self, scope: self.class\n )\n end", "title": "" }, { "docid": "89960000b86c8df83edf228ba5b31f56", "score": "0.49501646", "text": "def fixture_root\n proj_root + 'spec' + 'fixtures'\n end", "title": "" }, { "docid": "ae99480743f31a88201be0f08198d3d7", "score": "0.49347615", "text": "def clone\n Factory.new(self)\n end", "title": "" }, { "docid": "81ff22dccab8896fed3fd116ab5fe59e", "score": "0.49152762", "text": "def fixture_path\n FIXTURE_PATH\n end", "title": "" }, { "docid": "5a273d732a293bf707213d4eb4d56456", "score": "0.48907638", "text": "def fixture(template)\n Formdown::Renderer.new(File.read(File.join('spec/fixtures/', template)))\n end", "title": "" }, { "docid": "e26b98cb0a6aaed3d238863316c436a2", "score": "0.48897827", "text": "def m_factory\n @mfactory\n end", "title": "" }, { "docid": "659881b5766f91aa5e08d18577a4102e", "score": "0.4885961", "text": "def factory(parent, cfg)\n throw 'cfg must have a dialect' unless cfg['dialect']\n throw \"dialect not found #{cfg['dialect']}\" unless @dialect_factories[cfg['dialect']]\n Construqt::Flavour::Delegate::FlavourDelegate.new(\n dialect_factory.new(@dialect_factories[cfg['dialect']].produce(parent, cfg))\n )\n end", "title": "" }, { "docid": "71b585b2f5260df2de2a9f351e047cac", "score": "0.48748657", "text": "def fixture(path)\n File.new(File.join(File.dirname(__FILE__), \"fixtures\", path))\nend", "title": "" }, { "docid": "8526c02493597906676ffbc76d812948", "score": "0.48733333", "text": "def fixtures_root\n File.join(File.dirname(__FILE__), 'fixtures')\nend", "title": "" }, { "docid": "e58878417bfeed1759059a86ad6eb975", "score": "0.4870018", "text": "def fixture(name, opts = {})\n Fixture.new(name, opts).to_s\nend", "title": "" }, { "docid": "2897d6bdc963841481fefdf2e92e0f08", "score": "0.48650634", "text": "def fedora_fixture(file)\n File.new(File.join(File.dirname(__FILE__), 'fixtures', 'fedora', file))\nend", "title": "" }, { "docid": "0f31dca09170b5fac6dab318588937a7", "score": "0.48642227", "text": "def fixture_path\n File.join File.dirname(__FILE__), 'fixtures'\n end", "title": "" }, { "docid": "221aea6b905fcca06a6fa04492b1b361", "score": "0.48586273", "text": "def fixture_dir\n @fixture_dir\n end", "title": "" }, { "docid": "ea09dc0fba59527fc4b839793442f6c5", "score": "0.4852152", "text": "def fixtures_path\n Pathname.new(File.dirname(__FILE__)).join('fixtures').realpath\nend", "title": "" }, { "docid": "16e5b3305a9ddbf7f710ab82931d7e11", "score": "0.48350236", "text": "def instantiate_fixture druid, klass = ActiveFedora::Base\n @fixture_dir = fixture_dir = File.join(File.dirname(__FILE__),\"fixtures\")\n mask = File.join(@fixture_dir,\"*_#{druid.sub(/:/,'_')}.xml\")\n fname = Dir[mask].first\n return nil if fname.nil?\n item_from_foxml(File.read(fname), klass)\nend", "title": "" }, { "docid": "877e6b418d2962f08fcbe53b00c09636", "score": "0.4815266", "text": "def get_message_factory\n\t\tend", "title": "" }, { "docid": "cca9067ed1fba1b1f3783e96d1953795", "score": "0.48064062", "text": "def fixture_path\n configuration.fixture_path\n end", "title": "" }, { "docid": "bec03fd04741cc5d75e6baa8d138c686", "score": "0.48018545", "text": "def my_fixture_dir\n callers = caller\n while (line = callers.shift)\n next unless (found = line.match(%r{/spec/(.*)_spec\\.rb:}))\n\n return fixtures(found[1])\n end\n raise \"sorry, I couldn't work out your path from the caller stack!\"\n end", "title": "" }, { "docid": "64b2dc3cd032c9b679d3e5cbbc9e7e19", "score": "0.47875887", "text": "def factory_namespace\n if @namespace\n @namespace\n else\n ChooseClass::Util.module_parent @base_class\n end\n end", "title": "" }, { "docid": "d01cbbe1729e3d50e3df18d2f78a44b4", "score": "0.4786169", "text": "def fixtures_path\n \"#{root}/test/fixtures\"\n end", "title": "" }, { "docid": "2988e6ec331db6df0b5a73f174c8b90c", "score": "0.47848326", "text": "def factory(dependency, &block)\n define dependency, FactoryResolver.new(block)\n end", "title": "" }, { "docid": "bedc2b6459414c251c395f9c10e596a4", "score": "0.47774538", "text": "def Factory(*args)\n\t\tFactoryBot.create(*args)\n\tend", "title": "" }, { "docid": "11a0ee598924014394ee9f0543184f59", "score": "0.4775099", "text": "def factory_override\n\t\t\tFactory[self]\n\t\tend", "title": "" }, { "docid": "7088d247e446b112058fe5fdef439310", "score": "0.47677618", "text": "def factory_generator\n @factory_generator\n end", "title": "" }, { "docid": "35e849d36f9c6aa597da750c0d565a8e", "score": "0.4766786", "text": "def fixtures_path\n Pathname.new(File.expand_path('../fixtures', __dir__))\n end", "title": "" }, { "docid": "408bd5dd9bda8593ce1e707405e1432d", "score": "0.4756434", "text": "def fixture_dir\n File.expand_path('../../fixtures', __FILE__)\n end", "title": "" }, { "docid": "36623abfc840202397fd1c3f90e16bf0", "score": "0.47543082", "text": "def build_test_fixtures \n return if skip_method(__method__)\n \n puts \"build RSpec fixture for #{model_name} in spec/fixtures\"\n \n filename = \"#{plural_table_name}.yml\"\n template = File.read(template(File.join(\"spec\", \"fixtures.yml.erb\")))\n #text = ERB.new(template, nil, '-').result(binding)\n text = Erubis::Eruby.new(template).evaluate( self )\n\n path = File.join(\"spec\",\"fixtures\",filename)\n write_artifact(path,text) \n end", "title": "" }, { "docid": "88389de336d8bff8c8dfd1b31e2c8a52", "score": "0.4748628", "text": "def fixture(file)\n File.new(File.join(File.dirname(__FILE__), 'fixtures', file))\n end", "title": "" }, { "docid": "47643a7c3846fbbd0ecfd0da19639082", "score": "0.47479746", "text": "def fixture(file)\n File.new(File.join(File.dirname(__FILE__), 'fixtures', file))\nend", "title": "" }, { "docid": "edb0039c437ebbc5c9628f9ce8d3b1fc", "score": "0.4742309", "text": "def setup_couchdb_fixtures; end", "title": "" }, { "docid": "a3b01ac47f79404eb24b395549404dd0", "score": "0.47367522", "text": "def class\n Builder\n end", "title": "" }, { "docid": "bb7a8ebad57d1e877a466d8f8bbc76e8", "score": "0.47313458", "text": "def fixture(filename='')\n File.join(File.dirname(__FILE__), 'fixtures', filename)\nend", "title": "" }, { "docid": "609266e2dab9c062de8e8f50eb1abd06", "score": "0.47237647", "text": "def build_bad_factory(filename)\n file = File.open(Rails.root.join(\"spec\", \"fixtures\", filename))\n build = Factory.build(:build, :bundle => file)\n file.close\n build\n end", "title": "" }, { "docid": "06de56d5a62728fc2dd350d9dd97c2f3", "score": "0.4707318", "text": "def fixtures; end", "title": "" }, { "docid": "062a61315672e19c9544226b55deb5c0", "score": "0.4700682", "text": "def fixture_path\n File.expand_path('fixtures', 'spec')\n end", "title": "" }, { "docid": "d8de17d1b57a21e6f2d717a509304941", "score": "0.46922797", "text": "def setup\n # Retrieve fixtures via their name\n # @first = projects(:first)\n end", "title": "" }, { "docid": "e042f010ebda58dc1e0ca0515c7da03e", "score": "0.46909654", "text": "def factory_type\n\t\tbase = nil\n\t\tself.ancestors.each do |klass|\n\t\t\tif klass.instance_variables.include?( :@derivatives ) ||\n\t\t\t\tklass.instance_variables.include?( \"@derivatives\" )\n\t\t\t\tbase = klass\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\n\t\traise FactoryError, \"Couldn't find factory base for #{self.name}\" if\n\t\t\tbase.nil?\n\n\t\tif base.name =~ /^.*::(.*)/\n\t\t\treturn $1\n\t\telse\n\t\t\treturn base.name\n\t\tend\n\tend", "title": "" }, { "docid": "2f19e7219deb173d5c8a892327dd520b", "score": "0.46852583", "text": "def fixtures\n @_fixtures ||= File.dirname(__FILE__) + '/../fixtures'\nend", "title": "" }, { "docid": "d76d3b63bfec92a420eb6a556d41c715", "score": "0.46835846", "text": "def setup\n # Retrieve fixtures via their name\n # @first = invoices(:first)\n end", "title": "" }, { "docid": "9e8e011ce49e6c669e6359ad27c83931", "score": "0.46777335", "text": "def setup\n # Retrieve fixtures via their name\n # @first = contacts(:first)\n end", "title": "" }, { "docid": "ca09d2713d0389ceedceada53f03a938", "score": "0.46715438", "text": "def parent\n sample || test_subject\n end", "title": "" }, { "docid": "83595516aecd80ae989e87cc2dcbcb9b", "score": "0.46657", "text": "def setup\n # Retrieve fixtures via their name\n # @first = contact_types(:first)\n end", "title": "" }, { "docid": "178e45b11163aa137df9e25f3da1cdbf", "score": "0.4662408", "text": "def entity_factory\n @entity_factory\n end", "title": "" }, { "docid": "c50c0ed12ac0636ef711dc3511f72c26", "score": "0.46624005", "text": "def setup\n # Retrieve fixtures via their name\n # @first = customers(:first)\n end", "title": "" }, { "docid": "7cf2f2b97d96414e0a28f2fee8a26716", "score": "0.46593374", "text": "def get_fixture(fn, local = '')\n if local\n File.join(test_root(), File.basename(File.dirname(local)), 'fixtures', fn)\n else\n File.join(test_root(), 'fixtures', fn)\n end\nend", "title": "" }, { "docid": "b6ff4a12c47fd2493eb4092219b1b406", "score": "0.4658904", "text": "def setup\n # Retrieve fixtures via their name\n # @first = people(:first)\n end", "title": "" }, { "docid": "4eb9a3c0fb2e9b0b48749c97d3cb1dd0", "score": "0.46586826", "text": "def prepare_fixtures\n Fixtures.new(@tmp_keeper.fixtures)\n end", "title": "" }, { "docid": "5623af718b3dd8f926ba7ec7002d58f1", "score": "0.4654528", "text": "def uses_fixture(fixture_name)\n require File.join(File.dirname(__FILE__), 'fixtures', fixture_name.to_s)\nend", "title": "" }, { "docid": "f07d7fb42f552db4a4abeccf7c3162c8", "score": "0.46534857", "text": "def builder\n return @builder ||= begin\n Template::Builder.const_get(type.capitalize).new(\n self\n )\n end\n end", "title": "" }, { "docid": "7d7bfcd78240120f281a7b27a4cad35f", "score": "0.465076", "text": "def factory!(source_data: [], table_name: nil, klass_namespaces: [], klass_basename: nil, columns: [], timestamps: true, connection_params: DEFAULT_CONNECTION_PARAMS, &block)\n factory = _factory(source_data: source_data, table_name: table_name, klass_namespaces: klass_namespaces, klass_basename: klass_basename, columns: columns, timestamps: timestamps, connection_params: connection_params, &block)\n factory.run!\n end", "title": "" }, { "docid": "41c32070c5bd0406318c15a5b1a3d51f", "score": "0.46452153", "text": "def fixture(name)\n File.read(fixture_path(name))\nend", "title": "" }, { "docid": "41c32070c5bd0406318c15a5b1a3d51f", "score": "0.4644926", "text": "def fixture(name)\n File.read(fixture_path(name))\nend", "title": "" }, { "docid": "0bee588bcfc643d187028d3d506934ed", "score": "0.46422285", "text": "def create_builder\n # Each worker creates a new instance\n builder = Cyclid.builder.new\n raise \"couldn't create a builder\" \\\n unless builder\n\n return builder\n end", "title": "" }, { "docid": "1371521523d20e78ea62c97619e12b0d", "score": "0.4641011", "text": "def add_base_fixture( name, fixture_mod )\n\t\tself.log.debug \"Adding a base fixture to %p: %p as %p\" % [ self, fixture_mod, name ]\n\n\t\tif previous_name = self.modules.key( fixture_mod )\n\t\t\tself.modules.delete( previous_name )\n\t\t\t# ugh, no remove_singleton_method\n\t\t\tself.singleton_class.instance_exec( previous_name ) do |methodname|\n\t\t\t\tremove_method( methodname )\n\t\t\tend\n\t\tend\n\n\t\tif self.modules.key?( name )\n\t\t\traise ScriptError,\n\t\t\t\t\"Already have a base fixture called %s: %p\" % [ name, self.modules[name] ]\n\t\tend\n\n\t\tself.modules[ name ] = fixture_mod\n\t\tdefine_singleton_method( name, &fixture_mod.method(:factory) )\n\tend", "title": "" }, { "docid": "8f4323526cac354c68b29b4d19d00966", "score": "0.46361363", "text": "def xml_fixture(file)\n return REXML::Document.new(fixture(file))\n end", "title": "" }, { "docid": "8f4323526cac354c68b29b4d19d00966", "score": "0.46361363", "text": "def xml_fixture(file)\n return REXML::Document.new(fixture(file))\n end", "title": "" }, { "docid": "c41c2bdb64dcd502a190ef2ed333ce45", "score": "0.46350485", "text": "def fixture(fixture_name=nil, data=false)\n f_name = \"#{self.to_s.underscore.pluralize.downcase}.yml\" \n f_title = fixture_name.nil? ? f_name : \"#{f_name} displaying #{fixture_name}\"\n border = \"=\" * f_title.length\n ary = [\"#{f_title}\", border]\n # taken from rails' own fixtures.rb YAML::Omap::Fixtures#read_fixture_files\n yaml_string = \"\"\n yaml_file = \"test/fixtures/#{f_name}\"\n yaml_string << IO.read(yaml_file)\n # not all of our fixtures are using the new foxy_fixtures method and therefore we need to accomodate to both\n # types of fixtures\n fixtures = using_foxy_fixtures? ? YAML::load(erb_render(yaml_string)) : YAML::load(yaml_string)\n if fixtures == false\n # if the fixture file can't be read then the fixture file probably hasn't been filled in...\n data ? {} : puts(\"Looks like the #{self.to_s.downcase.pluralize} fixture file hasn't been filled in...\")\n else\n # attach the id to each of the fixture hashes : this is dependent on foxy_fixtures\n fixtures.each_key { |f| fixtures[f].update(\"id\" => Fixtures.identify(f.to_sym)) } if using_foxy_fixtures?\n\n # this is here for deprecation reasons... some old projects are still using fixture_references\n fix_hash = Hash.new\n relationships = nil\n \n fixtures.each do |key,val|\n if key.to_s =~ /fixtures/\n fix_hash[key.split(\"\\n\")[1]] = val\n relationships = key.split(\"\\n\")[0]\n else \n fix_hash[key] = val\n end\n end\n fixtures = fix_hash\n \n load_fix = fixture_name.nil? ? fixtures.sort.map { |r| [\"----\\n#{r[0]}\\n---\"] << r[1..r.length] << [\"---\"] } : fixtures[\"#{fixture_name}\"]\n ary << load_fix\n ary << [\"====\",\"LOADED FIXTURES\",\"====\",relationships] unless relationships.nil?\n data ? (fixture_name.nil? ? fixtures.symbolize_keys : fixtures[\"#{fixture_name}\"].symbolize_keys) : y(ary.flatten)\n end\n end", "title": "" }, { "docid": "65f62918b782d23e09d406d1e3dcf6ff", "score": "0.46346378", "text": "def when_creating_a klass, options = {}\n Object.factory.when_creating_a klass, options\nend", "title": "" }, { "docid": "1c734cc7897e855b93c7dc458f4e08d4", "score": "0.4629939", "text": "def fixture name\n File.read ROOT + '/fixtures/' + name\nend", "title": "" }, { "docid": "29308e334f672bab1468257223363542", "score": "0.46288934", "text": "def create(*args, &block)\n opts = Hash === args.last ? args.last : {}\n if opts[:shared]\n key = :default\n elsif opts[:behaviour_type]\n key = opts[:behaviour_type]\n elsif opts[:spec_path] =~ /spec(\\/|\\\\)+(view|helper|controller|model)s/\n key = $2.to_sym\n else\n key = :default\n end\n return BEHAVIOUR_CLASSES[key].new(*args, &block)\n end", "title": "" }, { "docid": "f59e355067186b6c5d5450ad85912893", "score": "0.46282688", "text": "def active_fedora_fixture(file)\n File.new(File.join(File.dirname(__FILE__), 'fixtures', file))\n end", "title": "" }, { "docid": "497f7e543d168726ac4f71b7febf88e1", "score": "0.46243227", "text": "def file_fixture(path)\n return File.expand_path(File.join(File.dirname(__dir__), \"test\", \"fixtures\", path))\nend", "title": "" }, { "docid": "497f7e543d168726ac4f71b7febf88e1", "score": "0.4623085", "text": "def file_fixture(path)\n return File.expand_path(File.join(File.dirname(__dir__), \"test\", \"fixtures\", path))\nend", "title": "" }, { "docid": "ef6e5aa56c69341a65eac89087f2be71", "score": "0.46176618", "text": "def setup\n # Retrieve fixtures via their name\n # @first = contact_method_types(:first)\n end", "title": "" }, { "docid": "cac3e0751bb428cb3404d42c43dac101", "score": "0.46150157", "text": "def builder\n return @builder if @builder\n attributes = YAML.load_file(data_file).merge(:gem_name => @gem_name)\n @builder = Builder.new(@gem_name, attributes)\n end", "title": "" }, { "docid": "74495fa3032cb95f90806865649c232d", "score": "0.46079186", "text": "def fixture_project(*paths)\n SC::Project.new fixture_path(*paths), :parent => builtin_project\n end", "title": "" }, { "docid": "1d800a0f37be6818257c355b656f1f41", "score": "0.4606607", "text": "def fixture(name)\n File.new(File.expand_path(\"../../fixtures/#{name}.json\", __FILE__))\n end", "title": "" }, { "docid": "a05f8512331a393b6fad2d82d98d80e3", "score": "0.4605016", "text": "def my_fixture(name)\n file = File.join(my_fixture_dir, name)\n raise \"fixture '#{name}' for #{my_fixture_dir} is not readable\" unless File.readable? file\n\n file\n end", "title": "" }, { "docid": "5357b5fa553b42dff8ac93aab9168a9b", "score": "0.458487", "text": "def fixtures_folder\n File.expand_path(File.join(File.dirname(__FILE__), 'fixtures'))\n end", "title": "" }, { "docid": "d7bab51da91bfa6191cd0ba7a74f114b", "score": "0.45828202", "text": "def file_fixture(fixture_name)\n file = File.expand_path(fixture_name, RSpec.configuration.fixture_path)\n File.new(file)\nend", "title": "" }, { "docid": "b54a4a43244b93ce65875a3cf7edd842", "score": "0.45786422", "text": "def fixture(file)\n fixture_path = File.expand_path('../../fixtures', __FILE__)\n File.new(File.join(fixture_path, file))\nend", "title": "" }, { "docid": "75b95e056d31c8fba4a3b2118909690d", "score": "0.45722276", "text": "def app_fixture(name)\n @app_fixture = name.to_s\n end", "title": "" }, { "docid": "ed5aa8c98e7eec0206ed0bf2d2164e09", "score": "0.4571682", "text": "def setup\r\n # Retrieve fixtures via their name\r\n # @first = types(:first)\r\n end", "title": "" }, { "docid": "a30d6891f570c567360ab9b6d5b605bb", "score": "0.45613915", "text": "def exact_factory\n @exact_factory\n end", "title": "" }, { "docid": "81a16a451f36dd7bf87a3d75fb315f85", "score": "0.45539075", "text": "def factory; end", "title": "" }, { "docid": "6c7063e841754a3195889551e7c1e5d3", "score": "0.4545073", "text": "def path\n File.expand_path('fixtures/', __FILE__)\n end", "title": "" }, { "docid": "02e574565344017b994511e3d8547c9c", "score": "0.45287392", "text": "def builder\n return @builder ||= begin\n Template.const_get(type.capitalize).new(\n self\n )\n end\n end", "title": "" }, { "docid": "7b9077c22de1895c05b15c2ff55d5016", "score": "0.45236793", "text": "def fixtures_path\n @_fixtures_path ||= app_root.join('spec/fixtures').expand_path\n end", "title": "" }, { "docid": "60fbf2abd2e626a5014f46922de919ff", "score": "0.4520857", "text": "def fixtures(path = '.fixture.yml')\n @fixtures ||= begin\n @fixtures = YAML.safe_load(File.read(path)).freeze\n logger.debug function: 'PuppetModule.fixtures',\n file_path: path, text: 'loaded'\n @fixtures.freeze\n end\n rescue Errno::ENOENT\n logger.debug function: 'PuppetModule.fixtures',\n file_path: path, text: 'not found'\n\n PuppetForge.user_agent = \"msmfg_spec_helper/#{MSMFGSpecHelper::VERSION}\"\n PuppetForge.host = ENV['PUPPETFORGE_HOST'] if ENV['PUPPETFORGE_HOST']\n logger.debug function: 'PuppetModule.fixtures',\n text: \"PuppetForge.host = #{PuppetForge.host}\"\n\n Github.configure do |conf|\n conf.basic_auth = \"#{ENV['GITHUB_USER']}:#{ENV['GITHUB_PASSWORD']}\"\n basic_auth = \"#{ENV['GITHUB_USER']}:i_didn_t_start_yesterday\"\n logger.debug function: 'PuppetModule.fixtures',\n text: \"Github.basic_auth = #{basic_auth}\"\n\n conf.endpoint = ENV['GITHUB_ENDPOINT'] if ENV['GITHUB_ENDPOINT']\n logger.debug function: 'PuppetModule.fixtures',\n text: \"GitHub.endpoint = #{conf.endpoint}\"\n\n conf.site = \"https://#{ENV['GITHUB_SITE']}\" if ENV['GITHUB_SITE']\n logger.debug function: 'PuppetModule.fixtures',\n text: \"GitHub.site = #{conf.site}\"\n end\n\n @fixtures = {\n 'fixtures' => {\n 'symlinks' => {\n class_name => '#{source_dir}'\n }\n }\n }\n\n repositories, forge_modules = find_dependencies\n\n @fixtures['repositories'] = repositories if repositories.any?\n @fixtures['forge_modules'] = forge_modules if forge_modules.any?\n @fixtures.freeze\n end", "title": "" }, { "docid": "4026f2e57b253a62d537eaa1c167ac85", "score": "0.45186424", "text": "def overridable_factory(factory_name, *args, &block)\n return if FactoryBot.factories.registered? factory_name\n FactoryBot.define do\n factory factory_name, *args do\n instance_eval(&block)\n end\n end\nend", "title": "" }, { "docid": "197b982e030f704def6412b1680a9160", "score": "0.4516213", "text": "def constructor\n self.parent\n end", "title": "" } ]
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "ef8ccfe785be3d78897059af177d59b3", "score": "0.0", "text": "def user_params\n params.require(:user).permit(:name, :email, :phone, :address, :password, :role_id)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.6948149", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.68135875", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "7ac5f60df8240f27d24d1e305f0e5acb", "score": "0.68015283", "text": "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.67953765", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.6745843", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.67416775", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.652725", "text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.6521263", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "7a24fee4eabdabf0eae6fc4a9442b5d4", "score": "0.649084", "text": "def whitelisted_args\n args.select &:allowed\n end", "title": "" }, { "docid": "89821ecc64d69b0e108ff0205d42848d", "score": "0.64307743", "text": "def safe_list_sanitizer; end", "title": "" }, { "docid": "89821ecc64d69b0e108ff0205d42848d", "score": "0.64307743", "text": "def safe_list_sanitizer; end", "title": "" }, { "docid": "89821ecc64d69b0e108ff0205d42848d", "score": "0.64307743", "text": "def safe_list_sanitizer; end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.6398334", "text": "def filtered_parameters; end", "title": "" }, { "docid": "21b124098cb3c128802e22b776b3f0ec", "score": "0.63553715", "text": "def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.6355045", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.6346211", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "9f3b62fe05ad1542504f6ef13056ac4e", "score": "0.63444513", "text": "def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.6338212", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "ecb9b1c8e860f69081e55e2f9432197e", "score": "0.63267356", "text": "def safe_list_sanitizer=(_arg0); end", "title": "" }, { "docid": "ecb9b1c8e860f69081e55e2f9432197e", "score": "0.63267356", "text": "def safe_list_sanitizer=(_arg0); end", "title": "" }, { "docid": "ecb9b1c8e860f69081e55e2f9432197e", "score": "0.63267356", "text": "def safe_list_sanitizer=(_arg0); end", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.6313931", "text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.6299263", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6265104", "text": "def check_params; true; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.62611383", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.625886", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "0e757d0df3a64e9e53edcc2ec32e976f", "score": "0.6236423", "text": "def allowed?(*_)\n true\n end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.6227454", "text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "d06d4a4f5db50f0e92ab46e724235bf9", "score": "0.6221617", "text": "def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\n end", "title": "" }, { "docid": "aabfd0cce84d7f71b1ccd2df6a6af7c3", "score": "0.621861", "text": "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "title": "" }, { "docid": "5f16bb22cb90bcfdf354975d17e4e329", "score": "0.6208846", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.61991566", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.6197083", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "d17287b48784257580d7e0971173c983", "score": "0.61742204", "text": "def permit( params, whitelist, name = nil )\n raise 'Parametrization not yet configured' unless @configured\n whitelist ||= []\n px = params.respond_to?( :permit ) ? params : ActionController::Parameters.new( params )\n px = dig(px, name)\n px.permit( *whitelist )\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6158123", "text": "def valid_params?; end", "title": "" }, { "docid": "7a218670e6f6c68ab2283e84c2de7ba8", "score": "0.615595", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "014122b5717338df29c0e4d5adba899e", "score": "0.61518705", "text": "def url_allowlist=(_arg0); end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.6136204", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.6122425", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "2b19f8222e09c2518b0d19b4bf1f69d3", "score": "0.6110132", "text": "def list_params\n params.permit(:list_name)\n end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.60754627", "text": "def valid_params_request?; end", "title": "" }, { "docid": "b074031c75c664c39575ac306e13028f", "score": "0.6071519", "text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "title": "" }, { "docid": "64a51034b538cd75dee66f5200107c1f", "score": "0.60591763", "text": "def param_list(param_type, name, type, required, description = nil, allowed_values = [], hash = {})\n hash.merge!({allowable_values: {value_type: \"LIST\", values: allowed_values}})\n param(param_type, name, type, required, description, hash)\n end", "title": "" }, { "docid": "030323bf4ecb827028514f0ceb36cb9b", "score": "0.60557497", "text": "def safelists; end", "title": "" }, { "docid": "4c4d28432d3282cbb227f3039cf94caf", "score": "0.6044194", "text": "def authorize_own_lists\n authorize_lists current_user.lists\n end", "title": "" }, { "docid": "bc65ba6d2f3ef5cb8923d613e49b8274", "score": "0.60346204", "text": "def listed_params\n params.permit(:listed, :list_id, :listable_id, :listable_type, :campsite_id)\n end", "title": "" }, { "docid": "44ade9754ddcdac40382d0923cd63048", "score": "0.6019527", "text": "def lists_params\n params.require(:list).permit(:name)\n\n end", "title": "" }, { "docid": "39096b2b2caa0b5a8223deec5f5b0f9f", "score": "0.601663", "text": "def list_params\n params.require(:list).permit(:name, :user_id)\n end", "title": "" }, { "docid": "e3b7e73d151796bb56ed85e0f3116fa9", "score": "0.6015115", "text": "def list_params\n params.require(:list).permit(:name, :description, :type, :privacy, :allow_edit, :rating, :votes_count, :user_id)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.6010948", "text": "def check_params\n true\n end", "title": "" }, { "docid": "c341544076effe9e0db47fa6752829ff", "score": "0.6008702", "text": "def authorize_own_or_shared_lists\n authorize_lists current_user.all_lists\n end", "title": "" }, { "docid": "66334278044b7f2b0463ae63d80ca602", "score": "0.60073566", "text": "def may_contain!(*keys)\n self.allow_only_permitted = true\n self.permitted_keys = [*permitted_keys, *keys].uniq\n end", "title": "" }, { "docid": "b7a657010a7f394737d8c2d719a06993", "score": "0.60066646", "text": "def user_pref_list_params\n\t\tparams.require(:user).permit(:preference_list)\n\tend", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.6004288", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.6004288", "text": "def filter_parameters; end", "title": "" }, { "docid": "6bc2c20d55fe920f0edd90f300d70955", "score": "0.5997833", "text": "def whitelist; end", "title": "" }, { "docid": "423b4bad23126b332e80a303c3518a1e", "score": "0.5994331", "text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "title": "" }, { "docid": "ad2d2efdf4826b61db96adbdcdb0135b", "score": "0.5991589", "text": "def list_params\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.59836817", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "09ccbed54e2a0b8847b53b642b40efb5", "score": "0.597015", "text": "def recipient_list_params\n params.require(:recipient_list).permit(:name, :list, :references)\n end", "title": "" }, { "docid": "93783c9b6c03c3bd41f75234b31911f8", "score": "0.5969646", "text": "def cancan_parameter_sanitizer\n resource = controller_name.singularize.to_sym\n method = \"#{resource}_params\"\n params[resource] &&= send(method) if respond_to?(method, true)\n end", "title": "" }, { "docid": "29eec3df393336ba76ae5f63ed9b4858", "score": "0.5964819", "text": "def whitelist_place_params\n params.require(:place).permit(:place_name, :unlock, :auth, :is_deep_checked, :parent_ADM4, :parent_ADM3, :parent_ADM2, :parent_ADM1, :parent_country, feature_code: [], same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "title": "" }, { "docid": "54e04b941ee9071107179fe993e57c26", "score": "0.59645337", "text": "def list_params\n params.require(:list).permit(:name).merge(user_id: current_user.id)\n end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.59611744", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "3697f53f660a77b18ff5af51bcf1ca8d", "score": "0.5960612", "text": "def list_params\n params.fetch(:list, {}).permit(:user_id, :name, :active)\n end", "title": "" }, { "docid": "ab49b0baeea5bf6f204adca9e864094e", "score": "0.5934404", "text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.5929178", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.59219354", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "31fc4d8ac77808ea64c22b8bff20997d", "score": "0.5907885", "text": "def price_list_params\n params.fetch(:price_list, {}).permit(:name, :valid_from, :valid_to, :active,\n :all_warehouses, :all_users, :all_contact_groups,\n warehouse_ids: [], price_lists_user_ids: [], contact_group_ids: [])\n end", "title": "" }, { "docid": "4658b5ebaf35abb1b89c071aed7e018c", "score": "0.590441", "text": "def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\n end", "title": "" }, { "docid": "1791be75c23b0ab94b8d566561cf903e", "score": "0.59011626", "text": "def params(list)\n @declared_params = list\n end", "title": "" }, { "docid": "ca90e8f0ec041d26b42d00aa2cbda1e5", "score": "0.5892072", "text": "def saved_list_params\n params.require(:saved_list).permit(:user_id)\n end", "title": "" }, { "docid": "043c7c33fa58658709ce0014319e7aec", "score": "0.5888967", "text": "def allow(ids); end", "title": "" }, { "docid": "34c6b2119736eea4b71998dec50f5f1a", "score": "0.58803886", "text": "def list_params\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "34c6b2119736eea4b71998dec50f5f1a", "score": "0.58803886", "text": "def list_params\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "34c6b2119736eea4b71998dec50f5f1a", "score": "0.58803886", "text": "def list_params\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "e310f8ae001392da6281c299a2572677", "score": "0.58721274", "text": "def filter_params(param_set, **kwargs)\r\n begin\r\n key = kwargs[:key]\r\n params.require(key).permit(*param_set)\r\n rescue Exception\r\n params.permit(*param_set)\r\n end\r\n end", "title": "" }, { "docid": "4d77abbae6d3557081c88dad60c735d0", "score": "0.5860506", "text": "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "title": "" }, { "docid": "37656a050c4e4765c2ea464cd3d4e764", "score": "0.5853492", "text": "def validate_paramified_params\n self.class.paramify_methods.each do |method|\n params = send(method)\n transfer_errors_from(params, TermMapper.scope(params.group)) if !params.valid?\n end\n end", "title": "" }, { "docid": "7befdf5d03aadb61b4c6e74ed07cd447", "score": "0.58448124", "text": "def secure_params\n return @secure_params if @secure_params\n\n @implementation_class = implementation_class\n resname = @implementation_class.name.ns_underscore.gsub('__', '_').singularize.to_sym\n @secure_params = params.require(resname).permit(*permitted_params)\n end", "title": "" }, { "docid": "102e96b584d087beda32598a28a382f5", "score": "0.5843388", "text": "def list_params\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "2554d771097b60c5d766de7d29c2dfe5", "score": "0.5833722", "text": "def refine_permitted_params(param_list)\n res = param_list.dup\n\n ms_keys = res.select { |a| columns_hash[a.to_s]&.array }\n ms_keys.each do |k|\n res.delete(k)\n res << { k => [] }\n end\n\n res\n end", "title": "" }, { "docid": "43f8788590c98e3b2ddf0bd6c62b24c8", "score": "0.58308357", "text": "def recipient_list_params\n params.require(:recipient_list).permit(:name, :description, recipient_id_array: [])\n end", "title": "" }, { "docid": "d6bf948034a6c8adc660df172dd7ec6e", "score": "0.58292884", "text": "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "title": "" }, { "docid": "81d27d51beb59227f68929587fe9a1be", "score": "0.5828597", "text": "def safelist; end", "title": "" }, { "docid": "68815c1979e028984e7c2d5abadc2552", "score": "0.5819076", "text": "def valid_for_params_auth?; end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.5815077", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.5814125", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "d4c0e2d7913e01bfa09b10bbeb5341ac", "score": "0.58102316", "text": "def shopping_list_params\n params.require(:shopping_list).permit!\n end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.58023965", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.58023965", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "3a9a65d2bba924ee9b0f67cb77596482", "score": "0.58011293", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "7c51a57439a63c303a45aca2ac638401", "score": "0.5794943", "text": "def permitters\n @_parametrizr_permitters || {}\n end", "title": "" }, { "docid": "c8d1b09827dbe3a963c60c741dc68594", "score": "0.5784728", "text": "def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end", "title": "" }, { "docid": "0cbc6ed0eac413e6d26c1e1418b6c62e", "score": "0.57806283", "text": "def list_params\n if current_user && current_user.role == 'admin'\n params.require(:list).permit(:name, :url, :description, :user_id,\n ideas_attributes: [:id, :list_id, :body, :due_date, :completion_status, :_destroy])\n else\n params.require(:list).permit(:name, :description,\n ideas_attributes: [:body, :due_date, :completion_status]) \n end\n end", "title": "" }, { "docid": "7a108e48bed2cdf492c12286b1c59903", "score": "0.577702", "text": "def whitelist(params)\n send_request_of_type(GlobalConstant::PrivateOpsApi.private_ops_api_type, 'post', '/token-sale/whitelist', params)\n end", "title": "" }, { "docid": "572ddb6fcaa0b57a2624259cc183bdb0", "score": "0.57749134", "text": "def valid_access_params\n params.require(:valid_access).permit(:wish_list_id, :user_id)\n end", "title": "" }, { "docid": "0b6129d775136b0d6037453613f331dd", "score": "0.5768169", "text": "def ensure_redirected_params_are_safe!(passed_params)\n unless passed_params.is_a?(ActionController::Parameters) && passed_params.permitted?\n error_message = if passed_params.is_a?(ActionController::Parameters)\n unsafe_parameters = passed_params.send(:unpermitted_keys, params)\n \"[Rails::Prg] Error - Must use permitted strong parameters. Unsafe: #{unsafe_parameters.join(', ')}\"\n else\n \"[Rails::Prg] Error - Must pass strong parameters.\"\n end\n raise error_message\n end\n end", "title": "" }, { "docid": "09edac0c32ae61b998679363610353e6", "score": "0.57677364", "text": "def url_allowlist; end", "title": "" }, { "docid": "2be6c6279f55d8b4842688b8f3cc75f1", "score": "0.57623225", "text": "def data_collection_params\n allow = [:name,:description,:institution,:collection_name,:country_id,:province_id,:city_id]\n params.require(:data_collection).permit(allow)\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.57581526", "text": "def quote_params\n params.permit!\n end", "title": "" } ]
ee18535b0c593e2cf01f0fd468bc94f8
Adds support for defining the attribute predicate, while providing compatibility with the default predicate which determines whether anything is set for the attribute's value
[ { "docid": "fac5ba728b1f1f04be7ad4d3e86c8f0c", "score": "0.0", "text": "def define_state_predicate\n name = self.name\n\n # Still use class_eval here instance of define_instance_method since\n # we need to be able to call +super+\n @instance_helper_module.class_eval do\n define_method(\"#{name}?\") do |*args|\n args.empty? ? super(*args) : self.class.state_machine(name).states.matches?(self, *args)\n end\n end\n end", "title": "" } ]
[ { "docid": "305d457fc19bb18e752e819c2877da17", "score": "0.76535916", "text": "def predicate_attr( *symbols )\n\t\t\tsymbols.each do |attrname|\n\t\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\t\tinstance_variable_defined?( \"@#{attrname}\" ) &&\n\t\t\t\t\t\tinstance_variable_get( \"@#{attrname}\" ) ? true : false\n\t\t\t\tend\n\t\t\t\tdefine_method( \"#{attrname}=\" ) do |newval|\n\t\t\t\t\tinstance_variable_set( \"@#{attrname}\", newval ? true : false )\n\t\t\t\tend\n\t\t\t\talias_method \"is_#{attrname}?\", \"#{attrname}?\"\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "37c54719dd4d5974ea4eb60001b843b1", "score": "0.75930583", "text": "def attr_with_predicates(*args)\n attr_without_predicates(*args)\n attr_predicate(args.first)\n end", "title": "" }, { "docid": "8cc9a852dc8da5e5b3d4c023ec9f2cad", "score": "0.75752294", "text": "def attr_predicate( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\tinstance_variable_get( \"@#{attrname}\" ) ? true : false\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "8cc9a852dc8da5e5b3d4c023ec9f2cad", "score": "0.75752294", "text": "def attr_predicate( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\tinstance_variable_get( \"@#{attrname}\" ) ? true : false\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "8cc9a852dc8da5e5b3d4c023ec9f2cad", "score": "0.75752294", "text": "def attr_predicate( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\tinstance_variable_get( \"@#{attrname}\" ) ? true : false\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "8cc9a852dc8da5e5b3d4c023ec9f2cad", "score": "0.75752294", "text": "def attr_predicate( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\tinstance_variable_get( \"@#{attrname}\" ) ? true : false\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "cdcff855fd93874ab1789d7c93f55cb4", "score": "0.7396964", "text": "def attr_predicate_accessor( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tattr_writer( attrname )\n\t\t\tattr_predicate( attrname )\n\t\tend", "title": "" }, { "docid": "cdcff855fd93874ab1789d7c93f55cb4", "score": "0.7396964", "text": "def attr_predicate_accessor( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tattr_writer( attrname )\n\t\t\tattr_predicate( attrname )\n\t\tend", "title": "" }, { "docid": "cdcff855fd93874ab1789d7c93f55cb4", "score": "0.7396964", "text": "def attr_predicate_accessor( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tattr_writer( attrname )\n\t\t\tattr_predicate( attrname )\n\t\tend", "title": "" }, { "docid": "cdcff855fd93874ab1789d7c93f55cb4", "score": "0.7396964", "text": "def attr_predicate_accessor( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tattr_writer( attrname )\n\t\t\tattr_predicate( attrname )\n\t\tend", "title": "" }, { "docid": "cdcff855fd93874ab1789d7c93f55cb4", "score": "0.7396964", "text": "def attr_predicate_accessor( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tattr_writer( attrname )\n\t\t\tattr_predicate( attrname )\n\t\tend", "title": "" }, { "docid": "9e5aec1e6c0516259e6491ad3c1a17a6", "score": "0.73937684", "text": "def attr_predicate( attrname )\n\t\t\tattrname = attrname.to_s.chomp( '?' )\n\t\t\tdefine_method( \"#{attrname}?\" ) do\n\t\t\t\tivar = \"@#{attrname}\"\n\t\t\t\tinstance_variable_defined?( ivar ) && instance_variable_get( ivar ) ?\n\t\t\t\t\ttrue :\n\t\t\t\t\tfalse\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "ce68ebe872edf2655d038572537c22ec", "score": "0.7381252", "text": "def define_predicate_method attr\n self.class.send(:define_method, \"#{attr}?\") do\n !attr_falsey_or_empty?(attr)\n end\n end", "title": "" }, { "docid": "05aaef3ebc69c81dc6273630f9447097", "score": "0.7203002", "text": "def predicate_attr_reader(*attrs)\n attrs.each do |attr|\n define_predicate_method(attr)\n end\n end", "title": "" }, { "docid": "2a0b160d316890c484a09c1aa9680781", "score": "0.6745983", "text": "def attr_predicate(symbol)\n define_method(\"#{symbol}?\") do\n value = instance_variable_get(\"@#{symbol}\")\n if value.respond_to?(:blank?)\n # Use ActiveSupport's implementation\n !value.blank?\n elsif value.respond_to?(:empty?)\n !value.empty?\n else\n !!value\n end\n end\n end", "title": "" }, { "docid": "d125e1117556622aa0c35ca93e614cd9", "score": "0.6687481", "text": "def define_predicate_method(key, *key_path)\n define_method(:\"#{key}?\") { !attr_falsey_or_empty?(key_path << key) }\n end", "title": "" }, { "docid": "a35bbd28cc78fecfd061ced93f827011", "score": "0.66215956", "text": "def define_predicate_method(key1, key2 = key1)\n define_method(:\"#{key1}?\") do ||\n !@attrs[key2].nil? && @attrs[key2] != false\n end\n memoize(:\"#{key1}?\")\n end", "title": "" }, { "docid": "bbe1cfec56468f18493687c58516b7c0", "score": "0.65518606", "text": "def define_attribute_method_matchers\n attribute_method_suffix '='\n attribute_method_suffix '?'\n end", "title": "" }, { "docid": "5bf790489497b464c02e3a91f3cfa33a", "score": "0.65111697", "text": "def require_attr(attr, expression = {})\n value = send(attr)\n\n # NOTE: There's some written philosophy on the subject.\n # See notes \"#ruby `Feature::RequireAttr`\", something like that.\n\n # IMPORTANT: Execution speed is important. Carefully consider it in the implementation logic below.\n\n # NOTE: There are 2 types of exceptions below: 1) true \"production\" exceptions;\n # 2) exceptions caused by programmer's mis-use of our method as such.\n # For added clarity, programmer errors are commented \"PE\".\n\n # Validate expression. It's important to avoid confusion below.\n raise ArgumentError, \"Expression must be Hash: #{expression.inspect}\" if not expression.is_a? Hash\n\n if expression.empty?\n # Trivial case.\n raise \"Attribute must be set: #{attr}\" if value.nil?\n else\n # NOTE: At the moment there are no options other than predicates. When options appear, this will need to be removed.\n raise ArgumentError, \"Expression too long: #{expression.inspect}\" if expression.size > 1 # PE.\n\n # NOTE: Some predicates assume other predicates.\n\n # We've got an exactly 1-key hash.\n if (cls = expression[:to_be_a])\n if cls.is_a? Array\n raise \"Attribute `#{attr}` must be a #{cls.join(' or ')} (value:#{value.inspect})\" if not cls.any? {|c| value.is_a? c}\n else\n # NOTE: We don't check `cls` for being a Class, Ruby will take care of that.\n raise \"Attribute `#{attr}` must be a #{cls} (value:#{value.inspect})\" if not value.is_a? cls\n end\n elsif (m = expression[:to_respond_to])\n raise \"Attribute `#{attr}` must respond to `#{m}` (value:#{value.inspect})\" if not value.respond_to? m\n elsif (cond = expression[:to_be])\n m = \"#{cond}?\"\n require_attr(attr, to_respond_to: m)\n raise \"Attribute `#{attr}` must be #{cond} (value:#{value.inspect})\" if not value.send(m)\n elsif (cond = expression[:not_to_be])\n m = \"#{cond}?\"\n require_attr(attr, to_respond_to: m)\n raise \"Attribute `#{attr}` must not be #{cond} (value:#{value.inspect})\" if value.send(m)\n else\n raise ArgumentError, \"Invalid expression: #{expression.inspect}\"\n end\n end # if expression.empty?\n\n nil\n end", "title": "" }, { "docid": "e9bc1118b6909d2f96c5656dc245291b", "score": "0.64616704", "text": "def define_predicate_method(key1, method_alias: key1, target_alias: key1, include_keys: nil, extra_key: nil)\r\n define_method(:\"#{method_alias}?\") do ||\r\n !@attrs[key1].nil? && @attrs[key1] != false && !(@attrs[key1].respond_to?(:empty?) && @attrs[key1].empty?)\r\n end\r\n memoize(:\"#{method_alias}?\")\r\n end", "title": "" }, { "docid": "d53ae775a9906a383a0b1741db477b7d", "score": "0.6422776", "text": "def predicate_method?; end", "title": "" }, { "docid": "d53ae775a9906a383a0b1741db477b7d", "score": "0.6422776", "text": "def predicate_method?; end", "title": "" }, { "docid": "22c012a3e9476f51a17e6dc1d630ed84", "score": "0.63693553", "text": "def attribute_reader attrs\n attrs.each do |key, value|\n define_attribute_method(key)\n define_predicate_method(key)\n end\n end", "title": "" }, { "docid": "e8cfe717929624c28db9e818922d19e5", "score": "0.63208055", "text": "def default_predicate=(name)\n self.options[:default_predicate] = name\n end", "title": "" }, { "docid": "480fb0135b273495cda90b1003814deb", "score": "0.6300586", "text": "def define_predicate_method(key1, key2 = key1)\n define_method(:\"#{key1}?\") do\n !attr_falsey_or_empty?(key2)\n end\n memoize(:\"#{key1}?\")\n end", "title": "" }, { "docid": "480fb0135b273495cda90b1003814deb", "score": "0.6300586", "text": "def define_predicate_method(key1, key2 = key1)\n define_method(:\"#{key1}?\") do\n !attr_falsey_or_empty?(key2)\n end\n memoize(:\"#{key1}?\")\n end", "title": "" }, { "docid": "4b44c0f23ca3690aa5f8e1ace42f6e5e", "score": "0.62363005", "text": "def write_attribute(predicate, values)\n predicate = predicate.respond_to?(:uri) ? predicate.uri.to_s : predicate.to_s\n values = [ values ] unless(values.respond_to?(:each))\n @builder.attribute do \n @builder.predicate { @builder.text!(predicate) }\n values.each { |val| write_target(val) }\n end\n end", "title": "" }, { "docid": "10eb3960696d455de224a43e1202ed12", "score": "0.623119", "text": "def predicate(prop, object, node, is_unique)\n qname = get_qname(prop)\n raise RDF::WriterError, \"No qname generated for <#{prop}>\" unless qname\n\n # See if we can serialize as attribute.\n # * untyped attributes that aren't duplicated where xml:lang == @lang\n # * typed attributes that aren't duplicated if @dt_as_attr is true\n # * rdf:type\n as_attr = false\n as_attr ||= true if [:untyped, :typed].include?(@attributes) && prop == RDF.type\n\n # Untyped attribute with no lang, or whos lang is the same as the default and RDF.type\n add_debug(\"as_attr? #{@attributes}, plain? #{object.plain?}, lang #{@lang || 'nil'}:#{object.language || 'nil'}\") if object.is_a?(RDF::Literal)\n as_attr ||= true if [:untyped, :typed].include?(@attributes) &&\n object.is_a?(RDF::Literal) && (object.plain? || (@lang && object.language.to_s == @lang.to_s))\n \n as_attr ||= true if [:typed].include?(@attributes) && object.is_a?(RDF::Literal) && object.typed?\n\n as_attr = false unless is_unique\n \n # Can't do as an attr if the qname has no prefix and there is no prefixed version\n if @default_namespace && prop.vocab.to_s == @default_namespace.to_s\n if as_attr\n if @default_namespace_prefix\n qname = \"#{@default_namespace_prefix}:#{prop.qname.last}\"\n else\n as_attr = false\n end\n else\n qname = prop.qname.last.to_s\n end\n end\n\n add_debug \"predicate: #{qname}, as_attr: #{as_attr}, object: #{object.inspect}, done: #{is_done?(object)}, sub: #{@subjects.include?(object)}\"\n qname = \"rdf:li\" if qname.match(/rdf:_\\d+/)\n pred_node = Nokogiri::XML::Element.new(qname, node.document)\n \n if object.is_a?(RDF::Literal) || is_done?(object) || !@subjects.include?(object)\n # Literals or references to objects that aren't subjects, or that have already been serialized\n \n args = xml_args(object)\n add_debug \"predicate: args=#{args.inspect}\"\n attrs = args.pop\n \n if as_attr\n # Serialize as attribute\n pred_node.unlink\n pred_node = nil\n node[qname] = object.is_a?(RDF::URI) ? relativize(object) : object.value\n add_debug(\"node[#{qname}]=#{node[qname]}, #{object.class}\")\n else\n # Serialize as element\n add_debug(\"serialize as element: #{attrs.inspect}\")\n attrs.each_pair do |a, av|\n next if a.to_s == \"xml:lang\" && av.to_s == @lang # Lang already specified, don't repeat\n av = relativize(object) if a == \"rdf:resource\"\n add_debug \" elt attr #{a}=#{av}\"\n pred_node[a] = av.to_s\n end\n add_debug \" elt #{'xmllit ' if object.is_a?(RDF::Literal) && object.datatype == RDF.XMLLiteral}content=#{args.first}\" if !args.empty?\n if object.is_a?(RDF::Literal) && object.datatype == RDF.XMLLiteral\n pred_node.add_child(Nokogiri::XML::CharacterData.new(args.first, node.document))\n elsif args.first\n pred_node.content = args.first unless args.empty?\n end\n end\n else\n require 'rdf/rdfxml/patches/seq' unless RDF::Graph.respond_to?(:seq)\n \n # Check to see if it can be serialized as a collection\n col = @graph.seq(object)\n conformant_list = col.all? {|item| !item.is_a?(RDF::Literal)}\n o_props = @graph.properties(object)\n if conformant_list && o_props[RDF.first.to_s]\n # Serialize list as parseType=\"Collection\"\n pred_node[\"rdf:parseType\"] = \"Collection\"\n col.each do |item|\n # Mark the BNode subject of each item as being complete, so that it is not serialized\n @graph.query(:predicate => RDF.first, :object => item) do |statement|\n subject_done(statement.subject)\n end\n @force_RDF_about[item] = true\n subject(item, pred_node)\n end\n else\n if @depth < @max_depth\n @depth += 1\n subject(object, pred_node)\n @depth -= 1\n elsif object.is_a?(RDF::Node)\n pred_node[\"rdf:nodeID\"] = object.id\n else\n pred_node[\"rdf:resource\"] = relativize(object)\n end\n end\n end\n node.add_child(pred_node) if pred_node\n end", "title": "" }, { "docid": "d717db3848574aa65d7761fac6a4a5a8", "score": "0.62137896", "text": "def attr_reader(*attrs)\r\n attrs.each do |attr|\r\n define_attribute_method(attr)\r\n define_predicate_method(attr)\r\n end\r\n end", "title": "" }, { "docid": "980f1ecce12cb6af88aea60e530e6082", "score": "0.61223763", "text": "def attr_allowed(attribute, *args)\n opt = args.last.is_a?(Hash) ? args.pop : {}\n vals = {}\n args.flatten.map { |v| vals[v.to_sym] = v.to_s }\n defn = Definition.new(attribute, vals, opt)\n easy_attribute_accessors(attribute, defn)\n end", "title": "" }, { "docid": "d5246685b25faadadaf91e9fad37c712", "score": "0.6077533", "text": "def format_predicate(attribute)\n original_format_predicate(attribute)\n rescue ArgumentError\n arel_pred = arel_predicate_for_attribute(attribute)\n attribute.attr.public_send(arel_pred)\n end", "title": "" }, { "docid": "722e835583cb1972f804b9a601411a1d", "score": "0.60719514", "text": "def define_state_predicate\n attribute = self.attribute\n \n # Still use class_eval here instance of define_instance_method since\n # we need to be able to call +super+\n owner_class.class_eval do\n define_method(\"#{attribute}?\") do |*args|\n args.empty? ? super(*args) : self.class.state_machines[attribute].states.matches?(self, *args)\n end\n end\n end", "title": "" }, { "docid": "13b569fa3d9f313eaad6615b22fcec99", "score": "0.6058311", "text": "def predicate_matchers\n @predicate_matchers ||= {:exist => :exist?}\n end", "title": "" }, { "docid": "4cd5fa323a3a0f54af2c45d1b3f43418", "score": "0.60302114", "text": "def method_missing(arg)\n ATTRIBUTE_MAPPING.keys.include?(arg) ? value(arg) : super\n end", "title": "" }, { "docid": "51dd010e6e4aaa5f63893dd12a94620b", "score": "0.6020217", "text": "def attribute_method?(attribute); end", "title": "" }, { "docid": "5307c2b399b7a4775761e33db274f6ed", "score": "0.60181767", "text": "def has_attribute(name, predicate, multiple: false, solrize_for: [], type: :string)\n raise JupiterCore::PropertyInvalidError unless name.is_a? Symbol\n raise JupiterCore::PropertyInvalidError if predicate.blank?\n raise JupiterCore::PropertyInvalidError if solrize_for.blank?\n # A \"json_array\" is a single valued property, because the array gets serialized to a single json string when saved\n # the main use-case for this is an ordered creator field\n raise JupiterCore::PropertyInvalidError if (type == :json_array) && (multiple == true)\n\n # TODO: keep this conveinience, or push responsibility for [] onto the callsite?\n solrize_for = [solrize_for] unless solrize_for.is_a? Array\n\n # index should contain only some combination of :search, :sort, :facet, :symbol, and :pathing\n # this isn't an exhaustive layering over this mess\n # https://github.com/mbarnett/solrizer/blob/e5dd2bd571b9ebdb8a8ab214574075c28951e53e/lib/solrizer/default_descriptors.rb\n # but it helps\n if solrize_for.count { |item| !SOLR_DESCRIPTOR_MAP.keys.include?(item) } > 0\n raise JupiterCore::PropertyInvalidError\n end\n\n unless [:string, :text, :path, :boolean, :date, :integer, :float, :json_array].include?(type)\n raise JupiterCore::PropertyInvalidError, \"Unknown type #{type}\"\n end\n\n self.attribute_names << name\n\n # json arrays are stored in Solr and Fedora as a single string\n # otherwise, things are stored as what they're declared as.\n solr_type = (type == :json_array ? :string : type)\n\n solr_name_cache ||= []\n solrize_for.each do |descriptor|\n solr_name = Solrizer.solr_name(name, SOLR_DESCRIPTOR_MAP[descriptor], type: solr_type)\n solr_name_cache << solr_name\n self.reverse_solr_name_cache[solr_name] = name\n end\n\n facet_name = if solrize_for.include?(:facet)\n Solrizer.solr_name(name, SOLR_DESCRIPTOR_MAP[:facet], type: solr_type)\n elsif solrize_for.include?(:pathing)\n Solrizer.solr_name(name, SOLR_DESCRIPTOR_MAP[:pathing], type: solr_type)\n end\n\n self.facets << facet_name if facet_name.present?\n\n self.attribute_cache[name] = {\n predicate: predicate,\n multiple: multiple,\n solrize_for: solrize_for,\n type: type,\n solr_names: solr_name_cache\n }\n\n # define the read-only attribute method for the locked object\n #\n # TODO: right now the \"canonical solr name\" is the solr name we use for the value retrived by the reader method\n # ie. if you have title_tesim, title_sim, title_ssi etc in your solr document, the canonical_solr_name is one\n # of those, and its that key's value that the +title+ method returns. Right now we use the first +solrize_for+\n # value as the \"canonical solr name\", but it should probably be selected more intelligently, somehow, by, say\n # prefering :sort, or something.\n define_cached_reader(name, multiple: multiple, type: type, canonical_solr_name: solr_name_cache.first)\n\n define_method \"#{name}=\" do |*_args|\n raise JupiterCore::LockedInstanceError, 'The Locked LDP object cannot be mutated outside of an unlocked block'\\\n 'or without calling unlock_and_fetch_ldp_object to load a writable'\\\n ' copy (SLOW).'\n end\n\n derived_af_class.class_eval do\n property name, predicate: predicate, multiple: multiple do |index|\n index.type solr_type if type.present?\n index.as(*(solrize_for.map { |idx| SOLR_DESCRIPTOR_MAP[idx] }))\n end\n end\n\n # A thrilling tale of Yet Another Community Bug™\n #\n # Suppose you have an ActiveFedora class, Item, with a property, embargo_date, type: date.\n #\n # item.embargo_date = Time.now + 20.years\n # => #<Item id: \"829ad1b6-c54d-460f-a3c5-6dd716464f06\", embargo_date: 2037-09-15T15:59:58.724Z>\n #\n # Looks good!\n #\n # item.save\n # => true\n # item\n # => #<Item id: \"829ad1b6-c54d-460f-a3c5-6dd716464f06\", embargo_date: 2017-09-15T22:05:15.000Z>\n #\n # WHAT JUST HAPPENED TO OUR EMBARGO DATE?!\n #\n # We verified that the date was correct in the item, until we saved, at which IT SILENTLY BECAME TODAY (!!!!)\n #\n # Dive about 30 layers deep into the call stack, and you'll eventually discover that this happens because:\n #\n # 1) ActiveFedora pretty much ignores declared types and just slings around whatever an object happens to be\n # after assignment, type declarations on properties be damned.\n #\n # Combined with:\n #\n # 2)\n # (Time.now + 20.years).class\n # => Time\n #\n # 3) a 7 year old bug in the RDF gem (https://github.com/ruby-rdf/rdf/blob/d7add8de9ce12c10192eaadb654fa5adc1a66277/lib/rdf/model/literal.rb#L123)\n # based on the erroneous assumption that they can treat the Ruby Time class as representing a time-of-day\n # independent of date, despite this never having ever been remotely true of the Ruby Time class, which\n # represents seconds since the UNIX epoch, and thus has always _fundamentally_ represented a specific date AND\n # time, despite the comment on that code suggesting that this is some kind of odd and unexpected corner case.\n #\n # I don't think that anyone would claim that this kind of silent, destructive data-loss \"works as intended\", or\n # represents sane and safe API design, but at this point the semantics of all of the above, however poorly\n # thought out, appear to be deeply entrenched in a lot of people's code in a lot of projects, and I don't see\n # a way to fix that other than breaking a lot of years-old assumptions and refactoring the way ActiveFedora,\n # Solrizer, ActiveTriples, and RDF (fail to) talk to one another -- so the cleanest and easiest way to fix this\n # appears to be to paper over it all on our end.\n #\n # Prior to discovering this mess, we just let the ActiveFedora property declartion in the derived AF class\n # create the setters on the unlocked object. Now, we're going to shadow all of ActiveFedora's property\n # setters, coerce the argument to the declared type or complain if that burden should fall on the caller, and\n # then pass it along to ActiveFedora, in the hope that this way we can limit the opportunities for the rest\n # of the stack to silently do the wrong thing by confining ourselves to types where the behaviour (so far)\n # seems moderately sane.\n #\n # (ノಥ益ಥ)ノ ┻━┻\n derived_af_class.class_eval do\n # alias AF assignment method\n alias_method :\"shadowed_assign_#{name}\", :\"#{name}=\"\n\n define_method \"#{name}=\" do |arg|\n converted_arg = if arg.is_a?(Array) && type != :json_array\n arg.map { |val| convert_value(val, to: type) }\n else\n convert_value(arg, to: type)\n end\n # call the shadowed AF assignment method\n self.send(\"shadowed_assign_#{name}\", converted_arg)\n end\n\n # To work around a lack of ordering in multivalued attributes in Fedora, we need to serialize the :creators\n # array into a single-valued string, so that we can maintain a fixed order. We corerce it and other\n # \"json_array\" properties back into arrays when reading them.\n if type == :json_array\n alias_method :\"shadowed_#{name}\", :\"#{name}\"\n\n define_method name.to_s do\n owning_class.coerce_value(self.send(\"shadowed_#{name}\"), to: :json_array)\n end\n end\n end\n end", "title": "" }, { "docid": "92d6d275c2df6718a3e58f9419011cd2", "score": "0.6017927", "text": "def predicate(prop, object, node, is_unique)\n qname = prop.to_qname(uri_binding)\n raise RdfException, \"No qname generated for <#{prop}>\" unless qname\n\n # See if we can serialize as attribute.\n # * untyped attributes that aren't duplicated where xml:lang == @lang\n # * typed attributes that aren't duplicated if @dt_as_attr is true\n # * rdf:type\n as_attr = false\n as_attr ||= true if [:untyped, :typed].include?(@attributes) && prop == RDF_TYPE\n\n # Untyped attribute with no lang, or whos lang is the same as the default and RDF_TYPE\n as_attr ||= true if [:untyped, :typed].include?(@attributes) &&\n (object.is_a?(Literal) && object.untyped? && (object.lang.nil? || object.lang == @lang))\n \n as_attr ||= true if [:typed].include?(@attributes) && object.is_a?(Literal) && object.typed?\n\n as_attr = false unless is_unique\n \n # Can't do as an attr if the qname has no prefix and there is no prefixed version\n if @default_ns && prop.namespace.uri == @default_ns.uri\n if as_attr\n if @prefixed_default_ns\n qname = \"#{@prefixed_default_ns.prefix}:#{prop.short_name}\"\n else\n as_attr = false\n end\n else\n qname = prop.short_name\n end\n end\n\n puts \"predicate: #{qname}, as_attr: #{as_attr}, object: #{object.inspect}, done: #{is_done?(object)}, sub: #{@subjects.include?(object)}\" if ::RdfContext::debug?\n qname = \"rdf:li\" if qname.match(/rdf:_\\d+/)\n pred_node = Nokogiri::XML::Element.new(qname, node.document)\n \n if object.is_a?(Literal) || is_done?(object) || !@subjects.include?(object)\n # Literals or references to objects that aren't subjects, or that have already been serialized\n \n args = object.xml_args\n puts \"predicate: args=#{args.inspect}\" if ::RdfContext::debug?\n attrs = args.pop\n \n if as_attr\n # Serialize as attribute\n pred_node.unlink\n pred_node = nil\n node[qname] = object.is_a?(URIRef) ? relativize(object) : object.to_s\n else\n # Serialize as element\n attrs.each_pair do |a, av|\n next if a == \"xml:lang\" && av == @lang # Lang already specified, don't repeat\n av = relativize(object) if a == \"#{RDF_NS.prefix}:resource\"\n puts \" elt attr #{a}=#{av}\" if ::RdfContext::debug?\n pred_node[a] = av.to_s\n end\n puts \" elt #{'xmllit ' if object.is_a?(Literal) && object.xmlliteral?}content=#{args.first}\" if ::RdfContext::debug? && !args.empty?\n if object.is_a?(Literal) && object.xmlliteral?\n pred_node.add_child(Nokogiri::XML::CharacterData.new(args.first, node.document))\n elsif args.first\n pred_node.content = args.first unless args.empty?\n end\n end\n else\n # Check to see if it can be serialized as a collection\n col = @graph.seq(object)\n conformant_list = col.all? {|item| !item.is_a?(Literal)}\n o_props = @graph.properties(object)\n if conformant_list && o_props[RDF_NS.first.to_s]\n # Serialize list as parseType=\"Collection\"\n pred_node[\"rdf:parseType\"] = \"Collection\"\n col.each do |item|\n # Mark the BNode subject of each item as being complete, so that it is not serialized\n @graph.triples(Triple.new(nil, RDF_NS.first, item)) do |triple, ctx|\n subject_done(triple.subject)\n end\n @force_RDF_about[item] = true\n subject(item, pred_node)\n end\n else\n if @depth < @max_depth\n @depth += 1\n subject(object, pred_node)\n @depth -= 1\n elsif object.is_a?(BNode)\n pred_node[\"rdf:nodeID\"] = object.identifier\n else\n pred_node[\"rdf:resource\"] = relativize(object)\n end\n end\n end\n node.add_child(pred_node) if pred_node\n end", "title": "" }, { "docid": "736471c63430ca09794a21e3d2e5900d", "score": "0.600258", "text": "def add_predicate\n # Checks whether the current value matches this state\n machine.define_helper(:instance, \"#{qualified_name}?\") do |machine, object|\n machine.states.matches?(object, name)\n end\n end", "title": "" }, { "docid": "cf28061ced7189c9e77b68449f4aa583", "score": "0.6001956", "text": "def method_missing(meth,*args)\n if /=$/=~(meth=meth.id2name) then\n self[meth[0...-1]] = (args.length<2 ? args[0] : args)\n elsif @attributes[meth]\n @attributes[meth]\n else\n false\n end\n end", "title": "" }, { "docid": "455564bc08475c4c897c28dfb6951a5c", "score": "0.5995659", "text": "def attr_reader(*attrs)\n attrs.each do |attr|\n define_attribute_reader_method(attr)\n define_predicate_method(attr)\n end\n end", "title": "" }, { "docid": "0ff9853a7e78fe3e4304dd2826fe82b7", "score": "0.5986555", "text": "def has_attribute?(name) # rubocop:disable Naming/PredicateName\n self.class.filters.key?(name.to_sym)\n end", "title": "" }, { "docid": "0e2756d45791a3ba93eb299b1ebb8a18", "score": "0.5973182", "text": "def predicate\n options[:predicate]\n end", "title": "" }, { "docid": "0e2756d45791a3ba93eb299b1ebb8a18", "score": "0.5973182", "text": "def predicate\n options[:predicate]\n end", "title": "" }, { "docid": "1af5db74eaab5c2aca0662802f1b577c", "score": "0.5973111", "text": "def singleton_predicate_accessor( *symbols )\n\t\t\tsingleton_class.extend( Chione::MethodUtilities )\n\t\t\tsingleton_class.attr_predicate_accessor( *symbols )\n\t\tend", "title": "" }, { "docid": "1af5db74eaab5c2aca0662802f1b577c", "score": "0.5973111", "text": "def singleton_predicate_accessor( *symbols )\n\t\t\tsingleton_class.extend( Chione::MethodUtilities )\n\t\t\tsingleton_class.attr_predicate_accessor( *symbols )\n\t\tend", "title": "" }, { "docid": "6a4cddfea9e2180573e2da43f8cc404d", "score": "0.59655815", "text": "def define_filtered_attr_writer(attribute, filter)\n define_method(\"#{attribute}=\") do |value|\n result =\n case filter\n when Symbol\n value.respond_to?(filter) ? value.send(filter) : value\n when Regexp\n value.respond_to?(:gsub) ? value.gsub(filter, '') : value\n when Proc\n filter.call(value)\n else # nil\n end\n\n if defined?(super)\n super(result)\n else\n # Required for non-column attributes:\n instance_variable_set(\"@#{attribute}\".to_sym, result)\n write_attribute(attribute.to_sym, result)\n end\n end\n end", "title": "" }, { "docid": "513839e71e4f527423599568b8eeefce", "score": "0.5962749", "text": "def boolean_attribute_set(instance, name, attributes)\n default_attribute_set(instance, name, attributes)\n end", "title": "" }, { "docid": "72954c3c303eb29ce5cf431a146fa0bd", "score": "0.595715", "text": "def have_attribute(label, value)\n HaveAttributeMatcher.new(label, value)\n end", "title": "" }, { "docid": "8a7e481c4c2af587f7bf9e912916ee27", "score": "0.59421766", "text": "def singleton_predicate_accessor( *symbols )\n\t\t\tsingleton_class.extend( Strelka::MethodUtilities )\n\t\t\tsingleton_class.attr_predicate_accessor( *symbols )\n\t\tend", "title": "" }, { "docid": "9553485e67fed4c943f7034c0c8c0471", "score": "0.5926744", "text": "def strict_predicate_matchers; end", "title": "" }, { "docid": "5e858997da3be535a6b098133c36f030", "score": "0.59166574", "text": "def predicate_matchers\n @predicate_matchers ||= {:exist => :exist?, :an_instance_of => :is_a?}\n end", "title": "" }, { "docid": "d7fbb092960c0a2627681860633e9d23", "score": "0.5903421", "text": "def attribute_present?(attr_name); end", "title": "" }, { "docid": "bb6dd131c4b5cc44759d05073ed1da62", "score": "0.5886446", "text": "def method_missing(method, *args, &block)\n # I'd normally shy away from using method_missing, but there's no\n # good alternative here since a user may register their own matchers\n # later in the load process.\n\n if @matcher\n @matcher.__send__(method, *args, &block)\n elsif Ward::Matchers.matchers.has_key?(method)\n @matcher = Ward::Matchers.matchers[method].new(*args, &block)\n elsif method.to_s =~ /\\?$/\n @matcher = Ward::Matchers::Predicate.new(method, *args, &block)\n else\n attribute(method, *args, &block)\n end\n\n self\n end", "title": "" }, { "docid": "9b761d9ea020dce8893aba61cb258e53", "score": "0.5880411", "text": "def predicate_builder; end", "title": "" }, { "docid": "9b761d9ea020dce8893aba61cb258e53", "score": "0.5880411", "text": "def predicate_builder; end", "title": "" }, { "docid": "9b761d9ea020dce8893aba61cb258e53", "score": "0.5880411", "text": "def predicate_builder; end", "title": "" }, { "docid": "9b761d9ea020dce8893aba61cb258e53", "score": "0.5880411", "text": "def predicate_builder; end", "title": "" }, { "docid": "601b04b1aff3567d458d2d380e6620ce", "score": "0.58795756", "text": "def store_attributes(typecast_method, predicate=nil, attributes=[], default_value=nil)\n attributes = [attributes] unless attributes.respond_to?(:each)\n attributes.each do |key|\n store_attribute key, typecast_method, predicate, default_value\n end\n end", "title": "" }, { "docid": "68363c8c5419ec508c635a4745eaf554", "score": "0.58782065", "text": "def is_attribute?; end", "title": "" }, { "docid": "cb0975526ae65b1ca57c9ed3042cb02a", "score": "0.5836012", "text": "def method_missing(method, *args, &block)\n prefix, *predicate = method.to_s.split(\"_\")\n predicate.shift if [\"a\", \"an\"].include?(predicate.first)\n return Inspector::Constraints::Predicate.new(predicate.join(\"_\"), *args, &block) if prefix == \"be\"\n # return Inspector::Constraints::Has.new(method, *args, &block) if method.to_s =~ /^have_/\n super\n end", "title": "" }, { "docid": "e7ebaf30591f66f2dca8bb602efe7d42", "score": "0.5818922", "text": "def predicate_set(namespace, name, value)\n predicate(namespace, name) << value\n end", "title": "" }, { "docid": "e7ebaf30591f66f2dca8bb602efe7d42", "score": "0.5818563", "text": "def predicate_set(namespace, name, value)\n predicate(namespace, name) << value\n end", "title": "" }, { "docid": "24e19143328d74403afa2ee3a1439cf8", "score": "0.5810815", "text": "def get_predicate\n @predicate\n end", "title": "" }, { "docid": "648434523845f05df13afede8801d589", "score": "0.5806647", "text": "def evaluate_attr(arguments, context)\n if arguments[1] and arguments[1].type == :true\n names = [arguments[0].value.to_s, arguments[0].value.to_s + '=']\n else\n names = arguments.map { |arg| arg.value.to_s }\n end\n\n names.each do |name|\n define_attribute(name, context)\n end\n end", "title": "" }, { "docid": "075a4b5767b152b7eedad79e1f861368", "score": "0.580127", "text": "def define_attribute_method attr\n self.class.send(:define_method, attr) do\n if attr_falsey_or_empty?(attr)\n NullObject.new\n else\n @attrs[attr]\n end\n end\n end", "title": "" }, { "docid": "5f4c1bb6c25bf2667b88b7ea39cf7025", "score": "0.58000225", "text": "def singleton_predicate_reader( *symbols )\n\t\t\tsingleton_class.extend( Chione::MethodUtilities )\n\t\t\tsingleton_class.attr_predicate( *symbols )\n\t\tend", "title": "" }, { "docid": "5f4c1bb6c25bf2667b88b7ea39cf7025", "score": "0.58000225", "text": "def singleton_predicate_reader( *symbols )\n\t\t\tsingleton_class.extend( Chione::MethodUtilities )\n\t\t\tsingleton_class.attr_predicate( *symbols )\n\t\tend", "title": "" }, { "docid": "f085a929733155ea6db32fd2d2f92308", "score": "0.57943153", "text": "def attribute?(attr,value=nil, method: :all?)\n\t\t\t\tif value\n\t\t\t\t\tmethod.to_proc.call([*value]) {|v| infos[:attributes][attr]&.include?(v)}\n\t\t\t\telse\n\t\t\t\t\tinfos[:attributes].key?(attr)\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "2cdcf01f917029c97a168ff123ad263b", "score": "0.5791352", "text": "def object_attr_reader(klass, key1, **args)\r\n define_attribute_method(key1, klass, args)\r\n define_predicate_method(key1, args)\r\n end", "title": "" }, { "docid": "63a9c62055201a19cdb86e7fbf7fa4cd", "score": "0.5789718", "text": "def attr_init(attr, val = nil, &block)\n if _all_attributes.include?(attr)\n unless instance_variable_defined?('@' + attr.to_s)\n _set(attr, block_given? ? yield : val)\n end\n return true\n else\n PEROBS.log.fatal \"'#{attr}' is not a defined persistent \" +\n \"attribute of class #{self.class}\"\n end\n\n false\n end", "title": "" }, { "docid": "cbecb16d250b2f7ad1807f056e355f8a", "score": "0.577321", "text": "def attribute_conditional attr, value\n \"#{attribute_condition_column attr}#{attribute_condition value}\"\n end", "title": "" }, { "docid": "a310e2e2203e68484328df84df9e504d", "score": "0.5768112", "text": "def has_attribute?(attr_name); end", "title": "" }, { "docid": "a310e2e2203e68484328df84df9e504d", "score": "0.5768112", "text": "def has_attribute?(attr_name); end", "title": "" }, { "docid": "9d9eec1274f2e2ef8453b3662e850ad3", "score": "0.57606375", "text": "def predicate_matchers\n @predicate_matchers ||= {:exist => :exist?, :an_instance_of => :is_a?}\n end", "title": "" }, { "docid": "85c89db8a7a9f5ea3e1ef8711922a01c", "score": "0.5759671", "text": "def singleton_predicate_reader( *symbols )\n\t\t\tsingleton_class.extend( Strelka::MethodUtilities )\n\t\t\tsingleton_class.attr_predicate( *symbols )\n\t\tend", "title": "" }, { "docid": "917a53e4b363986323e826eefc9c44a0", "score": "0.5758475", "text": "def predicate; end", "title": "" }, { "docid": "917a53e4b363986323e826eefc9c44a0", "score": "0.5758475", "text": "def predicate; end", "title": "" }, { "docid": "917a53e4b363986323e826eefc9c44a0", "score": "0.5758475", "text": "def predicate; end", "title": "" }, { "docid": "917a53e4b363986323e826eefc9c44a0", "score": "0.5758475", "text": "def predicate; end", "title": "" }, { "docid": "917a53e4b363986323e826eefc9c44a0", "score": "0.5758475", "text": "def predicate; end", "title": "" }, { "docid": "917a53e4b363986323e826eefc9c44a0", "score": "0.5758475", "text": "def predicate; end", "title": "" }, { "docid": "b038972544bb6dff98228d50beb44f13", "score": "0.5746199", "text": "def on_ifop(predicate, truthy, falsy); end", "title": "" }, { "docid": "119fc285225cf55781b6b4e7ba11d1f5", "score": "0.5726592", "text": "def coerce_to_predicate(predicate = Undefined)\n case predicate\n when Undefined\n Evaluator::Context.new(header) { |context| yield context }.yield\n when Enumerable\n predicate.reduce(TAUTOLOGY) do |entry, (name, value)|\n entry.and(header[name].eq(value))\n end\n else\n predicate\n end\n end", "title": "" }, { "docid": "8fd154e7a71c5593affb1a1593afd768", "score": "0.5723155", "text": "def strict_predicate_matching= value\n @strict_predicate_matching = !!value\n end", "title": "" }, { "docid": "2988ac602aafbe797c25b289c3103d85", "score": "0.5720447", "text": "def predicate() abstract end", "title": "" }, { "docid": "f909f6d73b77932ee9528bb538471209", "score": "0.56915456", "text": "def method_missing(attribute, *args, &blk)\n @attributes[attribute] = blk || args.first\n end", "title": "" }, { "docid": "05120da6c62bc98989491b8987ff9c59", "score": "0.5689448", "text": "def define_attribute_tester(field_name, field_type, visibility)\n field = fields[field_name]\n define_meta_module_method(\"#{field_name}?\", visibility) do\n attribute_set?(field_name) || field.has_default?\n end\n end", "title": "" }, { "docid": "6eed37ee6a095e9dbbb7f78467cd0e28", "score": "0.56767535", "text": "def on_ifop(predicate, truthy, falsy)\n predicate.merge(\n type: :ifop,\n body: [predicate, truthy, falsy],\n el: falsy[:el],\n ec: falsy[:ec]\n )\n end", "title": "" }, { "docid": "a25515e3c6e36efcdb30a45244bde250", "score": "0.56706125", "text": "def method_missing(method, *args, &block)\n k = attribute_name(method)\n v = method.to_s[-1..-1] == '=' ? args[0] : nil\n attributes[k] = v\n end", "title": "" }, { "docid": "ca4ff84f5ae757b5a46e936205614684", "score": "0.56681263", "text": "def predicate_matchers\n @predicate_matchers ||= {:an_instance_of => :is_a?}\n end", "title": "" }, { "docid": "89708b0d1379ce1507c267457bd416dd", "score": "0.56590295", "text": "def attr_in(attr_name, *values)\n predicate! do |batch, candidate|\n candidate.respond_to?(attr_name) &&\n values.include?(candidate.send(attr_name))\n end\n end", "title": "" }, { "docid": "cea10299ceb7ba2232efa2d3c91b55ae", "score": "0.5646914", "text": "def attribute?() @type.downcase.start_with?( 'attribute' ); end", "title": "" }, { "docid": "ee99dbe691ee60b3e4cb278e7f455ab9", "score": "0.56406087", "text": "def filter_one_attribute(obj, attr, value)\n filters = lookup_filter(attr)\n if filters\n filters.each do |p|\n value = case p\n when Symbol\n obj.send(p, attr, value)\n when String\n obj.send(p.to_sym, attr, value)\n when Proc\n p.call(obj, attr, value)\n else\n raise \"internal error: bad attribute filter class #{p.class}\"\n end\n end\n end\n\n value\n end", "title": "" }, { "docid": "af295670ea7e4dac159873db1233019d", "score": "0.5639469", "text": "def predicate\n header.reduce(Function::Proposition::Tautology.instance) do |predicate, attribute|\n predicate.and(attribute.eq(self[attribute]))\n end\n end", "title": "" }, { "docid": "6f3d63690199249955623376d4fa77dc", "score": "0.5639195", "text": "def method_missing(attribute_method, *args, &body)\n if legal_attribute_method?(attribute_method) \n use_and_set_attribute_cache(attribute_method) { get_attribute_value(attribute_method) }\n else\n super\n end\n end", "title": "" }, { "docid": "3833d48cb6752c62aa7f186a3707ae77", "score": "0.5635594", "text": "def method_missing(method, *args, &block)\n if respond_to_without_attributes?(method, true)\n super\n else\n match = matched_attribute_method(method.to_s)\n match ? attribute_missing(match, *args, &block) : super\n end\n end", "title": "" }, { "docid": "b2ab04e7ab42e85327db89a13578c2e8", "score": "0.56348366", "text": "def add_checked_attribute_1(clazz, attribute)\n eval \"\n class #{clazz}\n def #{attribute}=(value)\n raise 'Invalid attribute' unless value #if value is nil or false\n @#{attribute} = value\n end\n\n def #{attribute}\n @#{attribute}\n end\n end\n \"\nend", "title": "" }, { "docid": "9c525bf36b23a6c563bc64dd63752060", "score": "0.5620575", "text": "def method_missing(m, *a, &b)\n ms = m.to_s\n if a.length == 0 && has_attribute?(ms)\n attribute(ms)\n elsif a.length == 1 && ms[-1] == ?= && has_writable_attribute?(ms[0..-2])\n set_attribute(ms[0..-2], *a)\n else\n super\n end\n end", "title": "" }, { "docid": "61d2fb1b83ffd0c30de7fff95042bcbb", "score": "0.5615001", "text": "def method_missing(method, *args)\n if block_given?\n return super\n end\n\n method_string = method.to_s\n\n attribute_value = get(method)\n\n if args.length > 0\n\n # It's a question method; the return value should be true or false or\n # nil.\n if method_string =~ /\\?\\z/\n attribute_name = method_string[0..-2]\n value = get(attribute_name)\n attribute_value = args.include? value\n else\n attribute_value = set(method, args[0])\n end\n end\n\n attribute_value\n end", "title": "" }, { "docid": "b71973aaa189eb147e80db0a870fcac4", "score": "0.5603793", "text": "def normalize(attr, obj)\n self.semantic_attributes[attr].predicates.inject(obj) { |val, predicate| val = predicate.normalize(val) }\n end", "title": "" }, { "docid": "4b39a7d6081d9bc88c0677531bbb20e0", "score": "0.5597349", "text": "def boolean_attribute_get(instance, name)\n default_attribute_get(instance, name)\n end", "title": "" } ]
ccf1f2a0a8390da5516d0bfad7f18ad5
Plugin initialization extension point (after a successful ES connection).
[ { "docid": "5bc8ea75cbe137a0fca65155fe1132a8", "score": "0.0", "text": "def finish_register\n end", "title": "" } ]
[ { "docid": "ff1f9e95ddfed1ca3eb98a2ad2529fd2", "score": "0.71061766", "text": "def plugin_setup!; end", "title": "" }, { "docid": "9cfd9c55a5321072672bb8a9e87ff572", "score": "0.6907093", "text": "def after_initialize(plugins); end", "title": "" }, { "docid": "376fcc31ae304fde01a137141801afd1", "score": "0.67515403", "text": "def initialize\n\t\t\tplugins.init(self)\n\t\tend", "title": "" }, { "docid": "4c8439db0eda07a0e24e524732fafa74", "score": "0.6456414", "text": "def on_initialization_finished()\n end", "title": "" }, { "docid": "b04379bd69e2d611d38ac5d53a132a13", "score": "0.6406182", "text": "def on_init; end", "title": "" }, { "docid": "b04379bd69e2d611d38ac5d53a132a13", "score": "0.6406182", "text": "def on_init; end", "title": "" }, { "docid": "b8c747f1ae759ce76e74a3d4560c820d", "score": "0.640532", "text": "def initialize_plugins\n Hoe.plugins.each do |plugin|\n msg = \"initialize_#{plugin}\"\n warn msg if $DEBUG\n send msg if self.respond_to? msg\n end\n end", "title": "" }, { "docid": "b71533860e7e8473e04ae793f2cc3763", "score": "0.6373176", "text": "def post_init\n end", "title": "" }, { "docid": "21a00e6cc259cb82743125c30921794f", "score": "0.63389295", "text": "def initPlugin\n initTestCase do\n require \"WEACEToolkit/Slave/Adapters/#{@ProductID}/#{@ToolID}/#{@ScriptID}\"\n lActionPlugin = eval(\"WEACE::Slave::Adapters::#{@ProductID}::#{@ToolID}::#{@ScriptID}.new\")\n yield(lActionPlugin)\n end\n end", "title": "" }, { "docid": "5edac9eb313dd2d82caf4151ca49e7b0", "score": "0.6286515", "text": "def post_init\n end", "title": "" }, { "docid": "868bee689e613366bcde437be63323ba", "score": "0.6254971", "text": "def init\n\n end", "title": "" }, { "docid": "a37878619e66ac01fafa94f42cad7feb", "score": "0.62085414", "text": "def pre_connect_hooks; end", "title": "" }, { "docid": "a37878619e66ac01fafa94f42cad7feb", "score": "0.62085414", "text": "def pre_connect_hooks; end", "title": "" }, { "docid": "1e02cc223ab6b0621531c2b6a8cfa0fb", "score": "0.6186384", "text": "def post_init\n @connector = Aeon::Connector.new(self)\n end", "title": "" }, { "docid": "1e02cc223ab6b0621531c2b6a8cfa0fb", "score": "0.6186384", "text": "def post_init\n @connector = Aeon::Connector.new(self)\n end", "title": "" }, { "docid": "dc90d29d71dcbecfbdd1751b07b0b039", "score": "0.61843663", "text": "def init\n end", "title": "" }, { "docid": "dc90d29d71dcbecfbdd1751b07b0b039", "score": "0.61843663", "text": "def init\n end", "title": "" }, { "docid": "dc90d29d71dcbecfbdd1751b07b0b039", "score": "0.61843663", "text": "def init\n end", "title": "" }, { "docid": "39d7c1621353cd0a66970dba16276cf1", "score": "0.6178625", "text": "def after_initialize(opts)\n end", "title": "" }, { "docid": "b45986db855ec6d9f9ee416418b0ff05", "score": "0.61732787", "text": "def plugin_init\n arm_subscribe('ricer/messaged') do |sender, message|\n # begin\n # user.localize!\n # encoding = user.encoding || server.encoding\n # args[1].force_encoding(encoding.to_label)\n # rescue StandardError => e\n # bot.log.exception(e)\n # end\n end\n end", "title": "" }, { "docid": "9527b8d8c29a753045e2a70ac000949b", "score": "0.6138135", "text": "def post_init\n puts \"#{self.class}/#{self} client post_init runs\"\n end", "title": "" }, { "docid": "b39da31c0be918b4e30fd9a065b6908d", "score": "0.6122753", "text": "def post_init\n\tend", "title": "" }, { "docid": "18260a485a987101366313fa090e5f94", "score": "0.61107665", "text": "def init_plugins\n\t\t\tmethods.grep(/^init_plugin_/).each{|method_name| send(method_name) }\n\t\tend", "title": "" }, { "docid": "b99e27e2659ea2bdd58dc46869ff36c7", "score": "0.60962254", "text": "def post_connect_hooks; end", "title": "" }, { "docid": "b99e27e2659ea2bdd58dc46869ff36c7", "score": "0.60962254", "text": "def post_connect_hooks; end", "title": "" }, { "docid": "f9032db5f0d7fdb56d73b9073088275f", "score": "0.60795236", "text": "def eds_init\n setup_eds_session(session)\n end", "title": "" }, { "docid": "51f8c040504388a71534ab20920d6ec1", "score": "0.6074151", "text": "def after_initialize(&block); end", "title": "" }, { "docid": "3479a20c3f153abfe120b94af592f187", "score": "0.6068079", "text": "def at_init\n\n\t\tend", "title": "" }, { "docid": "9bd4fdbe3a490f4af793a8dbc3b2d662", "score": "0.6058332", "text": "def post_init()\n puts \"#{self} post_init done!\"\n end", "title": "" }, { "docid": "9bd4fdbe3a490f4af793a8dbc3b2d662", "score": "0.6058332", "text": "def post_init()\n puts \"#{self} post_init done!\"\n end", "title": "" }, { "docid": "a233748e45ad89c0b87e3bd72ccce557", "score": "0.60401237", "text": "def before_initialize(&block); end", "title": "" }, { "docid": "f32e72f5460f822c27b31f19f2214d57", "score": "0.6022131", "text": "def load_plugins; end", "title": "" }, { "docid": "ad6b8b428acc280b6082895fc9f22ec6", "score": "0.60093546", "text": "def adapter_initialize\n end", "title": "" }, { "docid": "0fd1622aca10459096acbe8d072cf47f", "score": "0.60077643", "text": "def after_init\n end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.60006875", "text": "def post_setup\n end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.5995671", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.5995671", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.5995671", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.5995671", "text": "def init; end", "title": "" }, { "docid": "9dd71f97345eb6e0ed5e3cf1a17f30ea", "score": "0.5971004", "text": "def initialize\n super\n self.plugins = []\n if configuration['plugin']\n configuration['plugin'].each do |config|\n plugin_class = config['class'].split('::').inject(Object) {|mod, string| mod.const_get(string)}\n self.plugins << plugin_class.new(self, config['parameters'])\n end\n end\n self.store = self.class.store\n end", "title": "" }, { "docid": "3ced0fb217b84f14e83fa1377ec63e77", "score": "0.59644836", "text": "def after_initialized\n end", "title": "" }, { "docid": "757b6ae3fbc37391a2bdc7a07eeaa7d8", "score": "0.5950869", "text": "def plugin_manager; end", "title": "" }, { "docid": "77a0383706f20cdcfd188d3f3e5ed29d", "score": "0.59436584", "text": "def post_initialize\n # raise NotImplementedError\n end", "title": "" }, { "docid": "13b9375f562efba744b3b4bd50348c60", "score": "0.5941865", "text": "def plugins; end", "title": "" }, { "docid": "13b9375f562efba744b3b4bd50348c60", "score": "0.5941865", "text": "def plugins; end", "title": "" }, { "docid": "13b9375f562efba744b3b4bd50348c60", "score": "0.5941865", "text": "def plugins; end", "title": "" }, { "docid": "13b9375f562efba744b3b4bd50348c60", "score": "0.5941865", "text": "def plugins; end", "title": "" }, { "docid": "d745376a2ec2423e41bb6b257b1193cc", "score": "0.5939072", "text": "def initialize_plugins\n plugins.each do |name, klass|\n msg = \"initialize_#{name}\"\n klass.send msg if klass.respond_to? msg\n end\n end", "title": "" }, { "docid": "07beb738cd852eebdd30951e53e91f0a", "score": "0.5932845", "text": "def post_initialize\n end", "title": "" }, { "docid": "1aefbe450255c3e4da01e04c5b07f911", "score": "0.5914952", "text": "def after_initialize_with_engine_additions\r\n Engines.after_initialize\r\n after_initialize_without_engine_additions\r\n end", "title": "" }, { "docid": "b698dc9ecb50773fe9279eabd839d746", "score": "0.591468", "text": "def init_client; end", "title": "" }, { "docid": "b374d248b15abfa5838d6d7a7f1e27a6", "score": "0.59075606", "text": "def init\n\nend", "title": "" }, { "docid": "dce706dc635e62da0683f06c94ad33eb", "score": "0.58989257", "text": "def plugins=(_arg0); end", "title": "" }, { "docid": "adfd75599e9fe9addd5ecc48ad25ab2d", "score": "0.5874084", "text": "def initialize\n init\n end", "title": "" }, { "docid": "839654d72228338f7d3907cabdad57ca", "score": "0.5852774", "text": "def after_initialize; end", "title": "" }, { "docid": "839654d72228338f7d3907cabdad57ca", "score": "0.5852774", "text": "def after_initialize; end", "title": "" }, { "docid": "839654d72228338f7d3907cabdad57ca", "score": "0.5852774", "text": "def after_initialize; end", "title": "" }, { "docid": "839654d72228338f7d3907cabdad57ca", "score": "0.5852774", "text": "def after_initialize; end", "title": "" }, { "docid": "a89f1d035df9f7f22654b26aa3d75433", "score": "0.58525807", "text": "def InitializeHooks\n end", "title": "" }, { "docid": "fee9310e451e3bec6c9ea9dc938f4b2f", "score": "0.5849522", "text": "def on_ready\n end", "title": "" }, { "docid": "93b41cb5e670cc34fa04338aa4bda8cd", "score": "0.5834715", "text": "def plugin_manager=(_arg0); end", "title": "" }, { "docid": "703119d2b0362d449b0c32f8aeb14ba8", "score": "0.5834271", "text": "def initialize\n set_config\n end", "title": "" }, { "docid": "ce21cfb76f5f8e0a10bcfc0310dc7365", "score": "0.58292335", "text": "def do_initialize\n begin\n Puppet.initialize_settings\n Puppet[:parser] = 'future' # this is required in order to work with puppet 3.8\n Puppet[:trusted_node_data] = true\n rescue ArgumentError => e\n\n rescue Puppet::DevError => e\n # do nothing otherwise calling init twice raises an error\n end\n end", "title": "" }, { "docid": "f174b1672c086fba72b0371d2ba85cf8", "score": "0.58272237", "text": "def initialize\n # complete\n end", "title": "" }, { "docid": "40baa6255b638c3fd98a3e534d94735f", "score": "0.5826768", "text": "def run_init_script; end", "title": "" }, { "docid": "7b2a9c01c879a0b2fdf74f0f38b03e4e", "score": "0.58120716", "text": "def initialize\n initialize!\n end", "title": "" }, { "docid": "7b2a9c01c879a0b2fdf74f0f38b03e4e", "score": "0.58120716", "text": "def initialize\n initialize!\n end", "title": "" }, { "docid": "23a8616da8bd80cab5969060dbb1b4e3", "score": "0.58079666", "text": "def initialize_connection\n self.send(Response.new(action: 'init'))\n end", "title": "" }, { "docid": "68db1686d96d78491307459788039bf0", "score": "0.58015984", "text": "def init\n @init.call if @init\n end", "title": "" }, { "docid": "92318f54bb01164584a4605422ff18b8", "score": "0.58008", "text": "def after_initialize_with_appable_plugins\n after_initialize_without_appable_plugins\n inject_controller_paths\n \n # Inject dependencies when being loaded after initialization in case\n # loaded_plugins was loaded as a gem midway through application initialization\n inject_dependencies(:after_initialize)\n end", "title": "" }, { "docid": "f630169fc864e11a4224e896295bd2a2", "score": "0.5795822", "text": "def after_initialize\n end", "title": "" }, { "docid": "f630169fc864e11a4224e896295bd2a2", "score": "0.5795822", "text": "def after_initialize\n end", "title": "" }, { "docid": "ea299e6a97a07a5f8c3494419e5a9dab", "score": "0.5783872", "text": "def Init()\n end", "title": "" }, { "docid": "9ce7c3e8754fd11eee9311b894ebe458", "score": "0.57677853", "text": "def init_ext()\n \n end", "title": "" }, { "docid": "18aa0584e23408de0e740b2f5c12dc90", "score": "0.57673955", "text": "def init; end", "title": "" }, { "docid": "8bb27fa937cd10a63d5b7040eb9dcd38", "score": "0.5755633", "text": "def do_initialize\n Puppet.initialize_settings\n Puppet[:parser] = 'future' # this is required in order to work with puppet 3.8\n Puppet[:trusted_node_data] = true\n rescue ArgumentError => e\n rescue Puppet::DevError => e\n # do nothing otherwise calling init twice raises an error\n end", "title": "" }, { "docid": "c2b960725b980e2e3a892ff170d29e54", "score": "0.5745141", "text": "def on_initialize\n end", "title": "" }, { "docid": "9f125d7bb038ca436f8c2ffebb28a234", "score": "0.57359606", "text": "def post_init\n puts \"connection established\"\n \n # store the eventmachine connection object id\n @connection.id = self.object_id\n end", "title": "" }, { "docid": "0e56f1ec91ff4ccee1c6f585e5520902", "score": "0.57187915", "text": "def after_initialize(options={}) ; end", "title": "" }, { "docid": "45479b6a8edeee4d1afa2eabba06a52d", "score": "0.57184345", "text": "def startup_hook; end", "title": "" }, { "docid": "db69f3a49dc502fff00990f386aaec27", "score": "0.57117534", "text": "def post_init(&block)\n @hooks[:post_init] = block\n end", "title": "" }, { "docid": "70fcf3cacd571fb70a78371b27a0c3ff", "score": "0.5707668", "text": "def initialize_connection(env)\n end", "title": "" }, { "docid": "513b41b46e702d8ef6873ab9c492925d", "score": "0.56747836", "text": "def init\n # hook method (called when checker is being initialized)\n end", "title": "" }, { "docid": "c190892d9f5ee47f0c476c096680a3c2", "score": "0.56592035", "text": "def post_initialize(args = {})\r\n nil\r\n end", "title": "" }, { "docid": "25bdb701df2684cc63ddad1c5f87fe98", "score": "0.5658186", "text": "def plugins ; @plugins ; end", "title": "" }, { "docid": "59670c61812d03a3cdaf0f0d7863df3e", "score": "0.5648396", "text": "def after_initialize\n end", "title": "" }, { "docid": "c81c5ee355f51086bd1045c75a3c5c34", "score": "0.56338036", "text": "def init_script\n @adapter.init_script\n end", "title": "" }, { "docid": "beabdf38c7bf8850e9cf4e7a6767638d", "score": "0.56265265", "text": "def user_init; end", "title": "" }, { "docid": "f3824cb1d14175be80c3410ce7c9f0a6", "score": "0.5622245", "text": "def after_initialize\n end", "title": "" }, { "docid": "d08f0cfe2b2b8c3c738e72226f397b1f", "score": "0.5622011", "text": "def initialize\n\n\n\n end", "title": "" }, { "docid": "f476285d7c7d8ea69ae8b7780d8bf3c6", "score": "0.56217957", "text": "def initialize\n get_enterprise_token\n initialize_client\n end", "title": "" }, { "docid": "36f07c04bfba5c7b7fa59dc5c7ccf0a7", "score": "0.561449", "text": "def after_init(&block)\n config.internal.after_init = block\n end", "title": "" }, { "docid": "eabc50e447f1a06ac1a76f2e4cf34b99", "score": "0.56097174", "text": "def initialize(host, port)\n super()\n @logger.info(\"Create the ES client: host=#{host}, port=#{port}\")\n @host = host\n @port = port\n connect()\n end", "title": "" }, { "docid": "d7e07efa809589ace86c4dabac43d9f8", "score": "0.560953", "text": "def initialize\n\tinit\n\tsuper\nend", "title": "" }, { "docid": "b2abe32b540ec7931884263a132a075c", "score": "0.5606671", "text": "def initialize_after_opts\n end", "title": "" }, { "docid": "bc1d2dff3253fceaa6ad08ac5a19d9c5", "score": "0.56018925", "text": "def initialize()\r\n\r\n end", "title": "" }, { "docid": "cac3a24101f97677dcad9a0926067047", "score": "0.5599845", "text": "def initialize!\n load_passenger\n initialize_ush_api\n initialize_debugging\n undo_bundler\n end", "title": "" }, { "docid": "4c245b583ca4682a268252dee4d956b4", "score": "0.5595949", "text": "def pre_initialize; end", "title": "" }, { "docid": "30db4e5d165a6098d1aeb8f8dd7b66e8", "score": "0.55920637", "text": "def initialize() end", "title": "" }, { "docid": "51d74ab5bfdc86c1560e3fc1f05d6a04", "score": "0.5591813", "text": "def initialize\n load_site\n load_creds\n end", "title": "" }, { "docid": "913d5db5a357c4ac5444cd4a9747a88f", "score": "0.5590642", "text": "def post_init\n @connected = true\n end", "title": "" } ]
ce4e7835404a70d3b4f2da95838b8548
Moves Prospector to next Town
[ { "docid": "e540dbf121a1cfa9633d5e65dd1b42bc", "score": "0.6394756", "text": "def move\r\n next_town = @town.next\r\n unless next_town.nil?\r\n puts \"Heading from #{@town.name} to #{next_town.name}.\"\r\n @town = @town.next\r\n end\r\n @visits += 1\r\n end", "title": "" } ]
[ { "docid": "3d48dbea53d953699d081adadaf2c410", "score": "0.5609544", "text": "def move_next\n self.current = self.current&.next\n end", "title": "" }, { "docid": "f948967fa809b4e4ba740ea09bc5e9dc", "score": "0.56023014", "text": "def test_move_nowhere\r\n\t\tdef @t.next; nil; end\r\n\t\t@p.move\r\n \t\tassert_equal 1, @p.visits\r\n \t\tassert_equal @t, @p.town\r\n\tend", "title": "" }, { "docid": "631f333ad07d2bc102535182ee0b758f", "score": "0.55391383", "text": "def next_move\n end", "title": "" }, { "docid": "108aac9b7b0fa093a3b18a40f12fdcd1", "score": "0.5533218", "text": "def move_to_next_attribute()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "097c0250c2dd383f9b69450d34dd41d7", "score": "0.5498035", "text": "def nextMove\n end", "title": "" }, { "docid": "e5397a3e6aa0288386ac039994575890", "score": "0.5489472", "text": "def move() \n super()\n @dancers.each do |dancer|\n dancer.move()\n end\n end", "title": "" }, { "docid": "f14b27435727da26c304f82c710f7fe5", "score": "0.54830956", "text": "def next\n if @lord.nil? then\n return self\n else\n return @lord.forward(index)\n end\n end", "title": "" }, { "docid": "eb9967dce5939d6a50080ef2e5b70dba", "score": "0.5460424", "text": "def iterate(curr_prospector, curr_location, num_turns)\n loop do\n curr_prospector.prospect(curr_location)\n @num_turns += 1\n\n break if @num_turns == num_turns\n\n old_location = curr_location\n curr_location = old_location.next_location\n puts \"Heading from #{old_location.name} to #{curr_location.name}.\"\n end\n end", "title": "" }, { "docid": "bdda10d98d96651ad8b9f0e3f0a25c32", "score": "0.5409649", "text": "def dive\n @current_depth += 1\n end", "title": "" }, { "docid": "ab2bb79efa225ca4fb85f3d8a464f307", "score": "0.53891575", "text": "def next_turn\n throw :next_actor\n end", "title": "" }, { "docid": "67064f8c5aaa9f9beac57e43ea6c8bca", "score": "0.53270113", "text": "def mouse_next\n $game_system.se_play($data_system.decision_se)\n @party_index += 1\n @party_index = 0 if @party_index >= @party.size\n update_switch_pokemon\n end", "title": "" }, { "docid": "6500bde8383859e09690c51edadfbbb1", "score": "0.52933514", "text": "def about_the_property_next_step\n return STEPS if @property.flbt_type == 'CONVEY'\n\n dump_property_into_lbtt_wizard\n\n returns_lbtt_summary_path\n end", "title": "" }, { "docid": "2d5ba87ee5083bec34ec20b8b0e7c252", "score": "0.5287644", "text": "def next_turn\n\t\tif @turn == Nought\n\t\t\t@turn = Cross\n\t\telsif @turn == Cross\n\t\t\t@turn = Nought\n\t\tend\n\tend", "title": "" }, { "docid": "534824b25cd0801bac05664f46a4186d", "score": "0.5264734", "text": "def next; self.class.next; end", "title": "" }, { "docid": "f9c66a0a93b4bea5660c1b29937f3e48", "score": "0.5250997", "text": "def menu_actor_next\r\n index = members.index(menu_actor) || -1\r\n index = (index + 1) % members.size\r\n self.menu_actor = members[index]\r\n end", "title": "" }, { "docid": "072c3e5db578b9a3a9ae992c94237ed9", "score": "0.52309996", "text": "def move_to_position(next_position)\n @first_move = false\n super(next_position)\n end", "title": "" }, { "docid": "1a47e093b39d887b2976920ebb144523", "score": "0.52117264", "text": "def trampoline\n\t\tmove(@direction)\n\tend", "title": "" }, { "docid": "9ef717b7d06ccced6cec2427c3cda616", "score": "0.5206991", "text": "def next\n\t\t@current = @current.next\n\tend", "title": "" }, { "docid": "d4f3c5e14e68946a9f371141380159ee", "score": "0.51963687", "text": "def next!\n @next\n end", "title": "" }, { "docid": "af72120e79cea4c69d9295ce577cab2f", "score": "0.51475817", "text": "def move_next\n self.current = self.current&.next\nend", "title": "" }, { "docid": "5c5d03ab244879be2082dc925ec3c634", "score": "0.51290095", "text": "def begin_next_dance\n partner = @dance_card[0]\n @dance_card.shift\n p @dance_card\n p \"Now dancing with #{partner}.\"\n end", "title": "" }, { "docid": "5fe523f14566c8a8b979878e3b59faae", "score": "0.51278096", "text": "def next_step!\n self.stepper_current_step = self.next_step\n self\n end", "title": "" }, { "docid": "ca8626e664fe483842b7f319c56d41fd", "score": "0.5122409", "text": "def player_to_move; self.send(self.next_to_move); end", "title": "" }, { "docid": "4c0bc6974662a7af3f5af53edf649c8d", "score": "0.51145804", "text": "def park_at_next_junction\n\t\t@driving_instructions << :ParkNext\n\tend", "title": "" }, { "docid": "3638035b43b43ace0233162ad15d6088", "score": "0.51089996", "text": "def next\n @next\n end", "title": "" }, { "docid": "186739aa5ea4d188878fd0e8fa48a6ae", "score": "0.5095903", "text": "def next_step\r\n @step += 1\r\n end", "title": "" }, { "docid": "7d8486d95827f0c0ca1df016810abf3a", "score": "0.50900006", "text": "def move_train_to_the_next_station\n t = find_train\n t.move_to_the_next_station\n press_enter_to_continue\n end", "title": "" }, { "docid": "238794bcb9325ee14704fb8f37daf3c0", "score": "0.50749207", "text": "def next!\n @_next\n end", "title": "" }, { "docid": "d1a77e969e6f2931b3b89396b2add684", "score": "0.5069972", "text": "def turn_up\n @turn += 1\n end", "title": "" }, { "docid": "495bee4d5ad2bd4fa75fdcf6654bc86f", "score": "0.5063947", "text": "def drop!\n self.next_elf = self.next_elf.next_elf\n end", "title": "" }, { "docid": "5a671c225ac0f65c324f2557b0f9506a", "score": "0.5060003", "text": "def next\n dup.tap(&:next!)\n end", "title": "" }, { "docid": "366d116ebbc10626cf393ddcccd4e7d7", "score": "0.5042344", "text": "def next\n @next\n end", "title": "" }, { "docid": "0a1ed677ce948cc0cb895bfd71db861c", "score": "0.50288534", "text": "def next!(pops_depth_level)\n @run_mode_mutex.synchronize do\n @mode = :next\n @options = {\n :pops_depth_level => pops_depth_level\n }\n end\n end", "title": "" }, { "docid": "b2a26d203571ab851b6dd8e789a226d3", "score": "0.50274336", "text": "def step_over\n # so\n # TODO: implement with a breakpoint\n end", "title": "" }, { "docid": "1502e30a644821400079f8ef3803ac4c", "score": "0.5024135", "text": "def after_turn\n if @top_card.penalized.nil?\n reverse if @top_card.internal_value == 10 # Reverse\n skip if @top_card.internal_value == 11 # Skip\n end\n increment_player\n end", "title": "" }, { "docid": "394adb8b6c37423b69505cfef48b054d", "score": "0.50227815", "text": "def next_actor\n @actor = $game_party.menu_actor_next\n on_actor_change\n end", "title": "" }, { "docid": "36762ac265924296631f49e3d110c53a", "score": "0.5017171", "text": "def next(step)\r\n end", "title": "" }, { "docid": "a45a018e6dcbb9c8d1e97c9a63d67a66", "score": "0.5005769", "text": "def next_step\n reference_step_position(1)\n end", "title": "" }, { "docid": "c929f00725e2e8c4c91885cff20555cd", "score": "0.5002072", "text": "def next_round\n puts \"----------\"\n puts \"Turn ##{@turn}\"\n puts \"----------\"\n @turn += 1\n @question1 = Question.new()\n @question2 = Question.new()\n end", "title": "" }, { "docid": "0323e83501c561dd3e26786c8c58bbf8", "score": "0.4999461", "text": "def tapout_after_case(testcase)\n @level -= 1\n end", "title": "" }, { "docid": "7b34c424751bc704c4a61fe975960a6a", "score": "0.49984398", "text": "def next!\n run_mode.next!(@debug_session.puppet_session_state.saved.pops_depth_level)\n @debug_session.puppet_session_state.saved.clear!\n unassert_flag(:session_paused)\n end", "title": "" }, { "docid": "62904cb4460ae96314bfe4f1a29fcf99", "score": "0.49866584", "text": "def print_with_successors(indent='')\n raise \"Error: loop detected while printing #{self}\" if @visited\n puts \"#{indent}[#{@source}->#{@destination}]\"\n @visited = true\n for action in @successors\n action.print_with_successors(indent + INDENT_LEVEL)\n end\n @visited = false\n end", "title": "" }, { "docid": "ad4a7d27f90bb52bcfba446a34dbacf3", "score": "0.49823704", "text": "def begin_next_dance\n partner = @card[0]\n @card.delete(@card[0])\n \"Now dancing with #{partner}.\"\n end", "title": "" }, { "docid": "f42ed38b8631d640badcf2b13aca83a9", "score": "0.49676427", "text": "def next_sibling()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "f42ed38b8631d640badcf2b13aca83a9", "score": "0.49676427", "text": "def next_sibling()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "e08ee6f8d45d4d7fadb47f42c5311fc4", "score": "0.49567083", "text": "def update_stepping\n FollowingMoveRoute([PBMoveRoute::StepAnimeOn])\n end", "title": "" }, { "docid": "15bd602fbfea6107a0411515bf01e628", "score": "0.495433", "text": "def advance; end", "title": "" }, { "docid": "71c6eb6486a4e4fb5345b4f623982ec6", "score": "0.49529794", "text": "def next_step\n @step = @step + 1\n end", "title": "" }, { "docid": "bc2ac402a146f2774099f3ca0d431159", "score": "0.4946339", "text": "def skip\n self + 2\n end", "title": "" }, { "docid": "4c3f6afccacb9c5107e9d51a8f6dcecd", "score": "0.49454027", "text": "def next_secondary\n secondary = self.chosen_secondary\n if secondary\n unless secondary.next_ammo\n @chosen_secondary_index += 1\n end\n end\n end", "title": "" }, { "docid": "f8b6f59d3d73b84dc6c597cb58ac8cde", "score": "0.4942922", "text": "def next\n after.first\n end", "title": "" }, { "docid": "046550abf75d9cdc10ef5ffa873f82d3", "score": "0.49410513", "text": "def next_step!\n cnt = 0\n @cur_piece.move_down!\n unless @cur_piece.can_be_set?\n @cur_piece.move_up!\n new_piece!\n cnt = clear_rows!\n end\n cnt\n end", "title": "" }, { "docid": "36c2acb569b2fdc22250056f743e1124", "score": "0.4937756", "text": "def pen_up\n @segment = nil\n end", "title": "" }, { "docid": "cf89d32deef3e83578e65d792152b0a7", "score": "0.49365965", "text": "def change_next_node\n @head[0].next_node = @head[1]\n end", "title": "" }, { "docid": "5fafa0934f8fc3816232b8c3efb2661d", "score": "0.4932614", "text": "def next_turn\n\t\tputs \"~~~~~~~~~~~~~~~~NEXT TURN\"\n\t\t# save turn\n\t\t@current_turn.save!\n\t\t# check if we are done\n\t\t# if not, create a new turn which is a deep clone of the previous with turn_count incremented\n\t\ttemp_turn = @simulation.sim_turns.new(:turn_count => @current_turn.turn_count + 1)\n\t\t@current_turn.sim_armies.each do |sim_army|\n\t\t\ttemp_army = temp_turn.sim_armies.new(:army_id => sim_army.army_id)\n\t\t\tsim_army.sim_units.each do |sim_unit|\n\t\t\t\ttemp_unit = temp_army.sim_units.new(:unit_id => sim_unit.unit_id, :hp => sim_unit.hp)\n\t\t\tend\n\t\tend\n\t\ttemp_turn.save!\n\t\t@current_turn = temp_turn\n\tend", "title": "" }, { "docid": "d2bed3441df9da764b93a3ce0cd14537", "score": "0.4927212", "text": "def move_rovers\n @rovers.each do |rover|\n rover.move\n end\n end", "title": "" }, { "docid": "6df6efcbbe3763d5e27504d8d0a154d4", "score": "0.49183166", "text": "def go_head\n @current = @head\n end", "title": "" }, { "docid": "e1513c9632569fe5fb9917fb176751c6", "score": "0.49031806", "text": "def level_up; @level += 1; end", "title": "" }, { "docid": "2ccde3c6d2afbe6840e33a5995c7b17d", "score": "0.48975474", "text": "def next\n Chain.next chain, self\n end", "title": "" }, { "docid": "0a841c7e2dd67e7d400e2b10b0c615f9", "score": "0.48946723", "text": "def next_actor_to_place\n party_members = $game_party.all_members\n for i in 0...party_members.size\n #select next actor\n @index += 1 \n @index %= party_members.size\n actor = party_members[@index]\n next unless actor.hidden? and !@place_loc.include?(actor.pos)\n return\n end\n end", "title": "" }, { "docid": "cc0867f3c070ce568c16a34f8724a91f", "score": "0.4892635", "text": "def nextTurn\n stateOK = nextTurnAllowed\n if stateOK\n @currentMonster = @dealer.nextMonster\n @currentPlayer = nextPlayer\n if @currentPlayer.isDead\n @currentPlayer.initTreasures\n end\n end\n stateOK\n end", "title": "" }, { "docid": "584d8fde3a6fccb6979224c2590c0189", "score": "0.48902398", "text": "def next_actor\n @actor_index += 1\n @actor_index %= $game_party.members.size\n $scene = Scene_Skill.new(@actor_index)\n end", "title": "" }, { "docid": "5fdadb7bc4bd7861b19677819919f46f", "score": "0.4881904", "text": "def next!\n self.rank += 1\n self\n end", "title": "" }, { "docid": "2877cc6e054ab644eefc0e7a1fccfb52", "score": "0.48811308", "text": "def iterate_depth\n\t\t\n\t\tif is_reply?\n\t\t\tself.depth = 1\n\t\telsif is_retort?\n\t\t\t#self.depth = + 1 # is parent depth + 1\n\t\tend\n\tend", "title": "" }, { "docid": "60a3c0152ed40e421ae19be9c9f78ddd", "score": "0.48811123", "text": "def next\n end", "title": "" }, { "docid": "60a3c0152ed40e421ae19be9c9f78ddd", "score": "0.48811123", "text": "def next\n end", "title": "" }, { "docid": "60a3c0152ed40e421ae19be9c9f78ddd", "score": "0.48811123", "text": "def next\n end", "title": "" }, { "docid": "820ce0d414668d1108eec8e8c1a7c189", "score": "0.48642802", "text": "def next\n @container.back\n end", "title": "" }, { "docid": "820ce0d414668d1108eec8e8c1a7c189", "score": "0.48642802", "text": "def next\n @container.back\n end", "title": "" }, { "docid": "bb368421cc87aa62699c53b40538a319", "score": "0.48614964", "text": "def next=( next_obj )\n @next_obj = next_obj\n end", "title": "" }, { "docid": "a5492016ccee57796c30ebad27e82167", "score": "0.48610216", "text": "def switch_actor\n # get next actor in line\n @actor = $game_party.actors[(@actor.index+1)%$game_party.actors.size]\n # refresh display\n refresh\n # if previous actor had more skills than the current one\n if @index >= @item_max\n # set cursor to last skill\n @index = @item_max - 1\n # update cursor\n update_cursor_rect\n end\n end", "title": "" }, { "docid": "a5492016ccee57796c30ebad27e82167", "score": "0.48610216", "text": "def switch_actor\n # get next actor in line\n @actor = $game_party.actors[(@actor.index+1)%$game_party.actors.size]\n # refresh display\n refresh\n # if previous actor had more skills than the current one\n if @index >= @item_max\n # set cursor to last skill\n @index = @item_max - 1\n # update cursor\n update_cursor_rect\n end\n end", "title": "" }, { "docid": "5d0e59e4e5c7d870bec6ac620b219704", "score": "0.48601472", "text": "def next!\n\t\t\tthrow :next\n\t\tend", "title": "" }, { "docid": "35749a1d00a5b58a6e2caba94b1c3b66", "score": "0.48587883", "text": "def switch_actor\n # get next actor in line\n @actor = $game_party.actors[(@actor.index + 1) % $game_party.actors.size]\n # refresh display\n refresh\n # if previous actor had more skills than the current one\n if @index >= @item_max\n # set cursor to last skill\n @index = @item_max - 1\n # update cursor\n update_cursor_rect\n end\n end", "title": "" }, { "docid": "35002f72bea67d26c8d41217b901031a", "score": "0.4847767", "text": "def next_direction\n raise 'Subclasses have to implement this method'\n end", "title": "" }, { "docid": "7ef3287c0c51328d77ec3982dcae82f7", "score": "0.48436594", "text": "def traverse(&block)\n\t\t\t@_level += 1\n\t\t\tinstance_eval(&block)\n\t\t\t@setups.pop\n\t\t\t@_level -= 1\n\t\tend", "title": "" }, { "docid": "3fccfd5ce49470b2f140d81577146bc4", "score": "0.48391995", "text": "def next_turn\n @current_player = @players[@current_turn]\n increment_turn\n end", "title": "" }, { "docid": "453bf50eb84d5640b709eabc6650b515", "score": "0.4839044", "text": "def next()\n \n end", "title": "" }, { "docid": "bc1852ea5429e3d9a5f440e462bbc495", "score": "0.48353806", "text": "def advance\n @linenum += 1\n end", "title": "" }, { "docid": "2006d02d9251d0103750874e962509ea", "score": "0.48350802", "text": "def next_player!\r\n @current_player = @players.rotate!.first\r\n next_player! if @loosers[@current_player.name] == true\r\n end", "title": "" }, { "docid": "d30139a3ff7c24033897203ef0e3aeff", "score": "0.48344848", "text": "def next(m)\n move_made = super \n\n # Almacenamos la jugada opuesta, en caso contrario no se hace nada\n case m \n when Rock\n self.moves[:Paper] += 1\n when Scissors\n self.moves[:Rock] += 1\n when Paper\n self.moves[:Scissors] += 1\n end\n\n move_made\n end", "title": "" }, { "docid": "ff8b48febd8e474581d56d3d1dd1f081", "score": "0.48341805", "text": "def next_species_list # :nologin: :norobots:\n redirect_to_next_object(:next, SpeciesList, params[:id])\n end", "title": "" }, { "docid": "9a472ba1e575a2c180275923718e4c0c", "score": "0.48236343", "text": "def deleteAfter\n self.next = self.next.next\n end", "title": "" }, { "docid": "dd4470ace1c9070a34ca48d752061edb", "score": "0.48160705", "text": "def advance\n @board = next_state\n end", "title": "" }, { "docid": "88a414a2f39bacc0f1e6c3f32e8c5a7a", "score": "0.4814317", "text": "def next_step\n self.current_step = steps[steps.index(current_step)+1]\n end", "title": "" }, { "docid": "ba036f7b8861700b3222967d1ca60751", "score": "0.48032555", "text": "def move_up\n switch_with_sibling_at_offset(-1) unless at_top?\n end", "title": "" }, { "docid": "c743a401134b0644c9088252f31614db", "score": "0.4799571", "text": "def pass!\n @direct.next!\n end", "title": "" }, { "docid": "e1069251b9ca1c6e757d15ddbdbba967", "score": "0.47969633", "text": "def next!\n next_node = @nodes[@current_index]\n @current_index += 1\n next_node\n end", "title": "" }, { "docid": "e1069251b9ca1c6e757d15ddbdbba967", "score": "0.47969633", "text": "def next!\n next_node = @nodes[@current_index]\n @current_index += 1\n next_node\n end", "title": "" }, { "docid": "94072679c988f7d663b6d154bd0f3be6", "score": "0.47961733", "text": "def next_actor_command()\n @actor_index += 1\n @actor_index %= $game_party.members.size\n $scene = Scene_Status.new(@actor_index)\n end", "title": "" }, { "docid": "1f1393f5896608dfb47e8eaff0bb8df9", "score": "0.4790446", "text": "def move_to_next_stage\n return unless submission\n self.move_to = submission.next_stage\n end", "title": "" }, { "docid": "cb69bd2e9217634d7d2e912360870f3b", "score": "0.47874784", "text": "def on_progression\n\t\tls = n_step.door.ls\n\t\t\n\t\tif !ls.aligned?\n\t\t\tls_hash = generate_ls_hash(ls)\n\t\t\tappend_new_traversal(@c_room.id, ls_hash.keys[0], :departing,\n\t\t\t\tls_hash)\n\t\telse @index += 1\n\t\tend\n\tend", "title": "" }, { "docid": "49a6e407c9b1c5d9d77c36489a15ecb4", "score": "0.4786252", "text": "def test_move_somewhere\r\n\t\tdef @t.next\r\n\t\t\ttnext = Minitest::Mock.new(\"town2\")\r\n\t\t\ttnext.expect(:name,\"Next Mock Town\")\r\n\t\tend\r\n\t\tassert_output (\"Heading from Mock Town to Next Mock Town.\\n\") {@p.move}\r\n\t\tassert_equal 1, @p.visits\r\n\t\trefute_equal @t, @p.town\r\n\tend", "title": "" }, { "docid": "e32f04515192d3eb4cc54d0053f68861", "score": "0.47825313", "text": "def advance_step\n @step += 1\n @scheduling.step\n end", "title": "" }, { "docid": "f8cdd163f797a791ce5a9b37d5bef878", "score": "0.47799692", "text": "def next\r\n @root + dress_up(@cycler.next)\r\n end", "title": "" }, { "docid": "6fe1cff2e1ea71bfd4db09646e96c8a3", "score": "0.47772092", "text": "def level_up!\n @level += 1\n end", "title": "" }, { "docid": "96b8eb39d30fdca8694614c99c72f7fc", "score": "0.47760576", "text": "def up\n yield north if block_given?\n\n move(:up) if can_move?(:up)\n end", "title": "" }, { "docid": "f169a5a796549975b589c459c7138f71", "score": "0.47756302", "text": "def next_round!\n @round =\n case @round\n when G18EU::Round::FinalExchange\n new_stock_round\n when Engine::Round::Stock\n @operating_rounds = @phase.operating_rounds\n reorder_players\n new_operating_round\n when Engine::Round::Operating\n if @round.round_num < @operating_rounds\n or_round_finished\n new_operating_round(@round.round_num + 1)\n else\n @turn += 1\n or_round_finished\n or_set_finished\n if @minor_exchange == :triggered\n new_minor_exchange_round\n else\n new_stock_round\n end\n end\n when init_round.class\n init_round_finished\n reorder_players\n new_operating_round(@round.round_num)\n end\n end", "title": "" }, { "docid": "e6ddf962eafd9b367951d40e15bc0577", "score": "0.47753978", "text": "def turn_up\n sprite.turn_up\n @dir = :up\n end", "title": "" }, { "docid": "c544c6eaf31d7c850748e60b0362dced", "score": "0.47735655", "text": "def next_move\n @point.add(next_point)\n end", "title": "" } ]
e79b4d67eafacb59323ddc274e2e4014
Merge Sort End Radix Sort Start
[ { "docid": "228b0bcc321ae7c32882d631ab58eced", "score": "0.67668396", "text": "def radix_sort\n if !self.array_list.empty?\n max_element_length = self.array_list.max.to_s.length\n max_element_length.times do |t|\n index_value = (t + 1)*-1\n temp_array = []\n self.array_list.each do |v|\n ordering_value = v.to_s[index_value]\n if !ordering_value.nil?\n temp_array[ordering_value.to_i] ||= []\n temp_array[ordering_value.to_i] << v\n else\n temp_array[0] ||= []\n temp_array[0] << v\n end\n end\n self.array_list = temp_array.flatten.compact\n end\n end\n self.sorted_list = self.array_list\n end", "title": "" } ]
[ { "docid": "b5ce6778b0ce7a6dc7cb90dbf864736f", "score": "0.714381", "text": "def mergesort(sequence, left = 0, right = sequence.size-1)\n if left < right\n mid = ((left + right) / 2.0).floor\n mergesort(sequence, left, mid)\n mergesort(sequence, mid + 1, right)\n merge(sequence, left, mid, right)\n end\nend", "title": "" }, { "docid": "b7b728ad7f33aa70623b2f71eaaad3a4", "score": "0.7121129", "text": "def merge_sort_bubble(array, start_index, end_index)\n\n if start_index == end_index\n return\n end\n partition_point = ((start_index + end_index ) / 2).floor #ensure the left subarry is smaller\n\n #sort left sub-array\n merge_sort_bubble( array, start_index, partition_point )\n merge_sort_bubble( array, partition_point + 1 , end_index)\n \n #merge step \n right_array_cur = end_index \n\n while right_array_cur >= ( partition_point + 1)\n if array[partition_point] < array[right_array_cur]\n #do nothing\n else\n #swap the larger element up\n tmp = array[partition_point] \n array[partition_point] = array[right_array_cur]\n array[right_array_cur] = tmp\n \n #element swap in the right sub array , need to matain it's local sort order\n maintain_sort(array, start_index, partition_point)\n end\n \n right_array_cur -= 1\n end\n\n\nend", "title": "" }, { "docid": "09c5f0c51e8f83c5802eb0cb25572a11", "score": "0.7078976", "text": "def merge_sort\n return self if length <= 1\n middle = (length / 2).floor\n left = self[0..middle - 1].merge_sort\n right = self[middle..length].merge_sort\n merge left, right\n end", "title": "" }, { "docid": "f0e45bcc857e0205e5e74d47b734e8a4", "score": "0.70248544", "text": "def merge_sort(array, start_index, end_index)\n\n if start_index == end_index\n return [ array[start_index] ]\n end\n partition_point = ((start_index + end_index ) / 2).floor #ensure the left subarry is smaller\n\n #sort left sub-array\n left_array = merge_sort( array, start_index, partition_point )\n right_array = merge_sort( array, partition_point + 1 , end_index)\n \n #merge step \n new_array = []\n\n while left_array.size > 0 or right_array.size >0\n if !left_array.empty? and !right_array.empty?\n if left_array[0] >= right_array[0]\n new_array.push( right_array.delete_at(0) )\n \n else\n new_array.push( left_array.delete_at(0) )\n \n end\n elsif !left_array.empty?\n \n new_array.push( left_array.delete_at(0) )\n \n \n elsif !right_array.empty?\n \n new_array.push( right_array.delete_at(0) )\n\n end\n end\n\n return new_array\n\nend", "title": "" }, { "docid": "853e2e0b1909ea3ff853f3b719534604", "score": "0.69971657", "text": "def autionEndMergesortAs(items)\n return items if items.size <= 1\n mid = items.size/2\n left = items[0, mid]\n right = items[mid, items.size]\n autionEndMergeAs(autionEndMergesortAs(left), autionEndMergesortAs(right))\n end", "title": "" }, { "docid": "808aa4147ab30d250d4dfc0a70b28614", "score": "0.6989057", "text": "def autionEndMergesortDes(items)\n return items if items.size <= 1\n mid = items.size/2\n left = items[0, mid]\n right = items[mid, items.size]\n autionEndMergeDes(autionEndMergesortDes(left), autionEndMergesortDes(right))\n end", "title": "" }, { "docid": "7e917c644462c8b470705074e9c32722", "score": "0.6986358", "text": "def merge_sort(sequence, left, right)\n if left < right\n mid = ((left + right) / 2.0).floor\n inversions_left = merge_sort(sequence, left, mid)[1]\n inversions_right = merge_sort(sequence, mid + 1, right)[1]\n inversions_split = merge_inversions(sequence, left, mid, right)[1]\n [sequence, inversions_left + inversions_right + inversions_split]\n else\n [sequence, 0]\n end\nend", "title": "" }, { "docid": "4a979835c9fbbf314ac91ea00bb7aab8", "score": "0.6983576", "text": "def merge_sort(numbers)\n\n if numbers.length <= 1 #if the index is less than 1 or equal to 1\n numbers # put the number\n else #but if the index is > 1\n middle = (numbers.length/2)#divide the numbers to split in two\n #when two sides are creates, the left side needs to take in the\n #numbers from the left then go thru them to the end\n #after that, id the right position of each number\n left_side = merge_sort(numbers[0..middle -1])\n right_side = merge_sort(numbers[middle..-1])\n # bring all of the numbers back together\n #create a method for that\n merge(left_side, right_side)\n end\nend", "title": "" }, { "docid": "8f57b5905855d597a4445be74eee7994", "score": "0.69706935", "text": "def merge_sort\n @inversions = 0\n recursive_split self.deep_dup\n end", "title": "" }, { "docid": "21e92507b36f9c325223a008a00ffeb5", "score": "0.69547296", "text": "def merge_sort\n return self if self.size <= 1\n\n mid = (self.length / 2).floor\n\n # divide the array\n lhs = self.slice(0, mid).merge_sort\n rhs = self.slice(mid, self.length).merge_sort\n\n merge(lhs, rhs)\n end", "title": "" }, { "docid": "51c56b6339eba6946571506b1892762d", "score": "0.6944828", "text": "def merge_sort(chrs)\n\treturn chrs if chrs.length <= 1\n\n\tmidpoint = chrs.length / 2\n\n\tleft = merge_sort(chrs[0..midpoint-1])\n\tright = merge_sort(chrs[midpoint..-1])\n\n\tarr = []\n\n\twhile left.length > 0 && right.length > 0\n\t\tif left.first < right.first\n\t\t\tarr << left.shift\n\t\telse\n\t\t\tarr << right.shift\n\t\tend\n\tend\n\n\tarr + left + right\nend", "title": "" }, { "docid": "d0093f548c8f286fdac373e9b947ac7a", "score": "0.6932531", "text": "def merge_sort\n return [self] if self.length <= 1\n \n mid = self.length / 2\n left = self[0...mid].merge_sort\n right = self[mid..-1].merge_sort\n sorted = []\n\n until left.empty? || right.empty?\n if left[0] >= right[0]\n sorted << right.shift\n else\n sorted << left.shift\n end\n end\n\n sorted += left\n sorted += right\n\n sorted\n end", "title": "" }, { "docid": "7bf9c5c6018f3a24e7732ac073e2efbe", "score": "0.69193053", "text": "def merge_sort!\n @inversions = 0\n sort = recursive_split self\n (self.clear << sort).flatten!\n end", "title": "" }, { "docid": "f272efe256ac76c699542e30d8a3eba5", "score": "0.6883904", "text": "def fixed_merge_sort\n return self if size <= 1 # Fix for B\n\n left = self[0, size/2] # Fix...\n right = self[size/2, size - size/2] # for A\n list1 = left.merge_sort\n list2 = right.merge_sort\n result = []\n until list1.empty? || list2.empty? do\n if list1.first < list2.first\n result << list1.first\n list1 = list1[1..-1]\n else\n result << list2.first\n list2 = list2[1..-1]\n end\n end\n return result + list1 + list2\n end", "title": "" }, { "docid": "5fce3c4a91792097037e5130bc350546", "score": "0.6868389", "text": "def merge_sort_compressed(arr)\n return arr unless arr.size > 1\n mid = arr.size/2\n a, b, sorted = merge_sort_compressed(arr[0...mid]), merge_sort_compressed(arr[mid..-1]), []\n sorted << (a[0] < b[0] ? a.shift : b.shift) while [a,b].none?(&:empty?)\n sorted + a + b\nend", "title": "" }, { "docid": "97f403403549a1d22e936f16b800f370", "score": "0.68449646", "text": "def mergesort!\n width = 7\n @scratch = Rubinius::Tuple.new @tuple.size\n\n # do a pre-loop to create a bunch of short sorted runs; isort on these\n # 7-element sublists is more efficient than doing merge sort on 1-element\n # sublists\n left = @start\n finish = @total + @start\n while left < finish\n right = left + width\n right = right < finish ? right : finish\n last = left + (2 * width)\n last = last < finish ? last : finish\n\n isort!(left, right)\n isort!(right, last)\n\n left += 2 * width\n end\n\n # now just merge together those sorted lists from the prior loop\n width = 7\n while width < @total\n left = @start\n while left < finish\n right = left + width\n right = right < finish ? right : finish\n last = left + (2 * width)\n last = last < finish ? last : finish\n\n bottom_up_merge(left, right, last)\n left += 2 * width\n end\n\n @tuple, @scratch = @scratch, @tuple\n width *= 2\n end\n\n @scratch = nil\n self\n end", "title": "" }, { "docid": "dffb905e74c55e63a27e6f6d1cd8e8ce", "score": "0.6836144", "text": "def merge_sort(arr) \n n = arr.length/2 \n left_half = arr[0...n].sort \n right_half = arr[n..-1].sort \n left_index = 0 \n right_index = 0\n sorted = []\n loop do\n if left_half[left_index] == nil \n sorted += right_half[right_index..-1]\n break\n elsif right_half[right_index] == nil\n sorted += left_half[left_index..-1]\n break\n elsif left_half[left_index] < right_half[right_index] \n sorted << left_half[left_index]\n left_index += 1\n else\n sorted << right_half[right_index]\n right_index += 1\n end\n end\n sorted\nend", "title": "" }, { "docid": "cb2813f88893a0383cc5d119b5adcd7c", "score": "0.6825466", "text": "def merge_sort(list) #spliting part\n\treturn list if list.length <= 1 #check if list is already sorted\n\n\tmid = (list.length / 2).floor #set a mid point for array, round the number down if array size is odd\n\tleft = merge_sort(list[0..mid - 1]) #split left array to single number array recursiely without the mid point\n\tright = merge_sort(list[mid..list.length]) #split right array to single number array recursiely with the mid point\n\tmerge(left, right) #merging recursiely\nend", "title": "" }, { "docid": "64214b4a10ee163ff370c37a7d3547a8", "score": "0.6813271", "text": "def block_sort(arr)\n return arr if arr.size.zero?\n\n power_of_two = floor_power_of_two(arr.size)\n scale = arr.size / power_of_two\n start = 0\n while start < power_of_two\n start *= scale\n finish = arr.size > 16 ? (start + 16) * scale : (start + arr.size) * scale\n insertion_sort(arr, [start, finish])\n start = arr.size > 16 ? start + 16 : start + arr.size - start\n finish = arr.size > 16 ? (start + 16) * scale : (start + arr.size) * scale\n end\n\n size = arr.size > 16 ? 16 : arr.size\n while size < power_of_two\n low = 0\n while low < power_of_two\n low *= scale\n mid = (low + size - 1) * scale\n high = [arr.count - 1, low + 2 * size - 1].min * scale\n if arr[high - 1] < arr[low]\n rotate(arr, mid - low, [low, high])\n else\n merge(arr, Range.new(low, mid - 1), Range.new(mid, high))\n end\n low += size * 2\n end\n size += size\n end\n arr\nend", "title": "" }, { "docid": "427c93f2ea383c95bdfe57eac943cb94", "score": "0.67743033", "text": "def merge_sort(arr) # [3, 2, 1, 4] 2) [3, 2]\n return arr if arr.length <= 1\n\n midpoint = arr.length / 2 # midpoint = 2 2) midpoint = 1\n left = merge_sort(arr.take(midpoint)) # 1) [3, 2] gets merge sorted 2) left = merge_sort([3]) = [3]\n right = merge_sort(arr.drop(midpoint)) # 2) right = merge_sort([2]) = [2]\n\n merged = [] # 2) left = [3] and right = [2]\n\n until left.empty? || right.empty? \n if left.first <= right.first \n merged << left.shift\n elsif left.first > right.first # 2) merged = [2]\n merged << right.shift # 2) right = []\n end\n end\n\n merged + left + right # 2) [2] + [3] + [] returns [2, 3] -- now we go back to stack 1\n # merged = all the stuff that has been shoveled in\n # left = empty \n # right = stuff that doesn't need to be compared bc we already know it's sorted\n # and the stuff in the right is ALWAYS bigger than the stuff in merged \nend", "title": "" }, { "docid": "6f50e0c2eb72860f76824da14fe968fb", "score": "0.67742485", "text": "def mergesort(data, buffer, left, right) # half-open interval\n\treturn if left+1 == right\n\tmid = (left+right)/2\n\tmergesort(data, buffer, left, mid)\n\tmergesort(data, buffer, mid, right)\n\tpos_left = left\n\tpos_right = mid\n\tpos_buffer = left\n\twhile true\n\t\tif data[pos_left] <= data[pos_right]\n\t\t\tbuffer[pos_buffer] = data[pos_left]\n pos_buffer += 1\n pos_left += 1\n if pos_left == mid\n while pos_right != right\n buffer[pos_buffer] = data[pos_right]\n pos_buffer += 1\n pos_right += 1\n\t\t\t\tend\n break\n\t\t\tend\n else\n buffer[pos_buffer] = data[pos_right]\n pos_buffer += 1\n pos_right += 1\n if pos_right == right\n while pos_left != mid\n buffer[pos_buffer] = data[pos_left]\n pos_buffer += 1\n pos_left += 1\n\t\t\t\tend\n break\n\t\t\tend\n\t\tend\n\tend\n\t(left...right).each {|i| data[i] = buffer[i] }\nend", "title": "" }, { "docid": "2a1743d033e26572494a1b6dda465d1e", "score": "0.67681617", "text": "def merge_sort(arr)\n midpoint = arr.length / 2\n if arr.length > 2\n first_half = arr[0...midpoint]\n second_half = arr[midpoint...arr.length]\n #debugger\n return merge(merge_sort(first_half), merge_sort(second_half))\n #return merge(merge_sort(arr[0...midpoint]), merge_sort(arr[midpoint...arr.length]))\n p \"merge complete\"\n #debugger\n elsif arr.length == 1\n return arr\n else\n if arr[0] < arr[1]\n return arr\n else\n return [arr[1], arr[0]]\n end\n end\nend", "title": "" }, { "docid": "b4e876841e5d91c75cfa77dae1d8489b", "score": "0.67680854", "text": "def mergesort(lst)\n if lst.size <= 1\n return lst\n else \n left = mergesort(lst[0...lst.size/2])\n right = mergesort(lst[lst.size/2...lst.size])\n sorted = []\n until left.empty? || right.empty?\n if left[0] <= right[0]\n sorted << left.shift\n else\n sorted << right.shift\n end\n end\n return sorted + left + right\n end\nend", "title": "" }, { "docid": "f9931cb96a838460fa747166628504f6", "score": "0.67655116", "text": "def merge_sort(arr, left, right)\n if left < right\n mid = ((left + right)/ 2).floor\n merge_sort(arr, left, mid)\n merge_sort(arr, mid + 1, right)\n\n merge(arr, left, mid, right)\n end\n end", "title": "" }, { "docid": "b2d21ac06c72d5861fa55954c1a64cd0", "score": "0.67640066", "text": "def merge_sort (a1, a2, l, r)\n if l < r then\n m = (l + r) / 2\n merge_sort(a1, a2, l, m)\n merge_sort(a1, a2, m + 1, r)\n merge(a1, a2, l, m, r)\n end\nend", "title": "" }, { "docid": "4262dc399bea443e1a8874b8b6f64f52", "score": "0.6751814", "text": "def merge_sort2(array)\n if array.size <= 1\n array\n else\n midpoint = (array.size - 1) / 2\n merge2(merge_sort2(array[0..midpoint]), merge_sort2(array[midpoint+1...array.size]))\n end\nend", "title": "" }, { "docid": "b785c71664abf519f59fb2519a8a6c9e", "score": "0.6719567", "text": "def merge_sort_with_extra_arrays(array)\n\n if array.size <= 1\n return array\n end\n \n partition = ((array.size - 1 ) / 2).floor \n \n left_array = []\n right_array = []\n sorted_array = []\n \n array.each_index do |index|\n if index <= partition\n left_array.push(array[index])\n else\n right_array.push(array[index])\n end\n \n end\n\n left_array = merge_sort_with_extra_arrays(left_array)\n right_array = merge_sort_with_extra_arrays(right_array)\n\n index = 0\n r_index = 0\n times = 0\n while (index + r_index) < array.size\n # puts \"left #{index} right #{index}, #{left_array.size + right_array.size}\"\n # p left_array\n # p right_array\n # p sorted_array\n if index < left_array.size and r_index < right_array.size\n if left_array[index] <= right_array[r_index]\n sorted_array.push(left_array[index])\n index += 1 \n else\n sorted_array.push(right_array[r_index])\n r_index += 1\n end\n elsif index == (left_array.size ) and r_index < right_array.size\n sorted_array.push(right_array[r_index])\n r_index += 1\n elsif r_index == (right_array.size ) and index < left_array.size\n sorted_array.push(left_array[index])\n index += 1\n end\n end\n return sorted_array\nend", "title": "" }, { "docid": "814249023df89fc9f1539239991de5c5", "score": "0.670885", "text": "def mergesort(a)\n n = a.length()\n from = Array.new(n)\n for i in 0..(n-1)\n from[i] = [a[i]]\n end\n while n > 1\n to = Array.new((n+1)/2)\n for i in 0..(n/2-1)\n to[i] = merge(from[i*2], from[i*2+1])\n end\n if !is_even(n)\n to[(n+1)/2-1] = from[n-1]\n end\n from = to\n n = (n+1)/2\n end\n from[0]\nend", "title": "" }, { "docid": "c7521153fb8aa62e2488e185f0904b4b", "score": "0.6698013", "text": "def merge_sort2(arr)\n\treturn arr if arr.length < 2\n\tleft = arr.slice(0...arr.length/2)\n\tright = arr.slice(arr.length/2..arr.length)\n\tprint merge_sort2(left)\n\tprint merge_sort2(right)\n\t#merge(merge_sort(left),merge_sort(right),arr)\nend", "title": "" }, { "docid": "ee8860314155821474e39959494f432d", "score": "0.66924906", "text": "def autionEndMergeDes(left, right)\n sorted = []\n until left.empty? or right.empty?\n if left.first.auction_end >= right.first.auction_end\n sorted << left.shift\n else\n sorted << right.shift\n end\n end\n sorted.concat(left).concat(right)\n end", "title": "" }, { "docid": "996c27cc9b2adf056a4a844abb86cd7f", "score": "0.6689919", "text": "def mergesort(nums)\n return nums if nums.length == 1\n\n mid = nums.length / 2\n\n left = mergesort(nums[0...mid])\n right = mergesort(nums[mid..-1])\n\n merge(left, right)\nend", "title": "" }, { "docid": "34f4760a4f9af535e4c45dc74db02fc6", "score": "0.66694367", "text": "def merge_sort(arr)\n def merge(left_sorted, right_sorted)\n result = []\n l = 0\n r = 0\n\n loop do\n break if r >= right_sorted.length && l >= left_sorted.length\n\n if r >= right_sorted.length || ((l < left_sorted.length) && (left_sorted[l] < right_sorted[r]))\n result << left_sorted[l]\n l += 1\n else\n result << right_sorted[r]\n r += 1\n end\n end\n\n return result\n end\n\n def mergesort_iter(array_sliced)\n return array_sliced if array_sliced.length <= 1\n\n mid = array_sliced.length/2 - 1\n\n left_sorted = mergesort_iter(array_sliced[0..mid])\n right_sorted = mergesort_iter(array_sliced[mid+1..-1])\n\n return merge(left_sorted, right_sorted)\n end\n\n mergesort_iter(arr)\nend", "title": "" }, { "docid": "9b7569d2e716a1a4a9c5a38ff42c832f", "score": "0.66597897", "text": "def merge_sort\n return self if size <= 1\n pieces = split_for_merge_sort # => [left half, right half which may be one item larger]\n left = pieces[0].merge_sort\n right = pieces[1].merge_sort\n result = left.join_for_merge_sort(right)\n end", "title": "" }, { "docid": "d47537f4299fe2708caa33ed4b9286b3", "score": "0.6650239", "text": "def merge_sort(array)\n return array if array.length <= 1\n\n half_index = array.length.odd? ? array.length / 2 : (array.length / 2) - 1\n left = array[0..half_index]\n right = array[half_index+1..-1]\n\n \n merge(merge_sort(left), merge_sort(right))\n\nend", "title": "" }, { "docid": "29a5412668d9918b0115313c97af84d8", "score": "0.66465956", "text": "def merge_sort(arr)\n return arr if arr.length <= 1\n\n mid = arr.length / 2\n left = merge_sort(arr.take(mid))\n right = merge_sort(arr.drop(mid))\n\n finished = helper_merge(left,right)\n \nend", "title": "" }, { "docid": "f8e42b9a4370d90b680c52b660340b21", "score": "0.66294295", "text": "def new_merge(arr)\n if arr.length <2 \n return arr\n # elsif arr.length == 2\n # if arr[0] > arr[1]\n # return [arr[1], arr[0]]\n # else\n # return arr\n # end\n else\n #sort left\n l = new_merge(arr[0, (arr.length/2)+ arr.length % 2])\n #sort right\n r = new_merge(arr[(arr.length/2)+ arr.length % 2, arr.length])\n #merge\n num_times = l.length + r.length\n l_place = 0\n r_place = 0\n merged_array =[]\n num_times.times {\n if l_place == l.length\n merged_array.push(r[r_place, r.length])\n elsif r_place == r.length\n merged_array.push(l[l_place, l.length]) \n elsif l[l_place] < r[r_place]\n merged_array.push(l[l_place])\n l_place += 1\n else\n merged_array.push(r[r_place])\n r_place += 1\n end\n }\n return merged_array.flatten\n end\nend", "title": "" }, { "docid": "72290bacefc4895c371874d8a2433bce", "score": "0.6623326", "text": "def merge_sort(arr) #[3,1]\n return nil if arr.length == 0\n return arr if arr.length == 1\n return merge([arr[0]], [arr[1]]) if arr.length == 2\n\n mid = arr.length/2 #mid: 1\n left_array = arr[0...mid] #[3]\n right_array = arr[mid..-1] #[1]\n \n \n merge_sort(left_array) + merge_sort(right_array)\n\n \nend", "title": "" }, { "docid": "69c2743032628acab17c995deaf7fd5d", "score": "0.6619286", "text": "def merge_sort(arr)\n return arr if arr.count <= 1\n\n mid = arr.count / 2\n\n left_sorted = merge_sort(arr[0...mid])\n right_sorted = merge_sort(arr[mid..-1])\n\n merged = []\n\n until left_sorted.empty? && right_sorted.empty? do\n if (!left_sorted.empty? && (right_sorted.empty? || left_sorted[0] < right_sorted[0]))\n merged << left_sorted.shift\n else\n merged << right_sorted.shift\n end\n end\n\n merged\nend", "title": "" }, { "docid": "ee90399a2506644484c73076e05216f0", "score": "0.6615268", "text": "def merge_sort(array)\r\n return array if array.length < 2\r\n mid = array.length/2\r\n left = array.take(mid)\r\n right = array.drop(mid)\r\n # debugger\r\n left_sorted = merge_sort(left)\r\n right_sorted = merge_sort(right)\r\n\r\n merge(left_sorted, right_sorted)\r\nend", "title": "" }, { "docid": "04209d5897e4eee40d6534b926f78f70", "score": "0.6615104", "text": "def merge_sort(arr) # sorts ascending\n return arr if arr.size <=1\n mid_idx = arr.size/2\n left = arr.take(mid_idx)\n right = arr.drop(mid_idx)\n merge(merge_sort(left), merge_sort(right))\nend", "title": "" }, { "docid": "10accce71bbd69556a15ca9d43f7f5e4", "score": "0.6600127", "text": "def merge(arr, start, mid, to)\n l = arr[start..mid]\n r = arr[(mid+1)..to]\n\n nl = l.length\n nr = r.length\n\n j = i = 0\n # first index of the sub array\n k = start\n # we position the first item in left or right\n while j < nl && i < nr\n if l[j] <= r[i]\n arr[k] = l[j]\n j+=1\n else\n arr[k] = r[i]\n i+=1\n end\n k+=1\n end\n\n # position the remaining left items if the left and right array doesn't have the same size\n while j < nl\n arr[k] = l[j]\n j+=1\n k+=1\n end\n while i < nr\n arr[k] = r[i]\n i+=1\n k+=1\n end\n\n arr\nend", "title": "" }, { "docid": "e62588223df3adfb33e592a3939a24b3", "score": "0.65993285", "text": "def merge_sort(arr, low = 0, hi = arr.length-1)\n if low != hi\n mid = (low+hi)/2\n merge_sort(arr, low, mid)\n merge_sort(arr, mid+1, hi)\n merge(arr, low, mid, mid+1, hi)\n end\nend", "title": "" }, { "docid": "34d65b9421d6d40bb17cd444983533f0", "score": "0.6599222", "text": "def merge_sort(arr, result=[])\n return arr if arr.size == 1\n\n # Store arr size for the sake of cleaner code.\n size = arr.size\n\n # Split arr into two halves (+-1).\n arr1 = arr[0...size/2]\n arr2 = arr[size/2..size]\n\n # Call recursive merge_sort on arr halves.\n arr1 = merge_sort(arr1)\n arr2 = merge_sort(arr2)\n\n # Create pointers.\n arr_p = 0\n arr1_p = 0\n arr2_p = 0\n\n # Pick smaller element from two pointers and append to result array.\n while arr1_p < arr1.size && arr2_p < arr2.size\n if arr1[arr1_p] < arr2[arr2_p]\n result << arr1[arr1_p]\n\n arr1_p += 1 # Increment arr 1pointer.\n else\n result << arr2[arr2_p]\n arr2_p += 1 # Increment arr2 pointer.\n end\n arr_p += 1 # Increment arr pointer.\n end\n\n # When one list (arr) is exhausted, copy elements of other arr into result array.\n if arr1_p == arr1.size\n result += arr2[arr2_p..arr2.size] # Appent remaining arr2 elements to result.\n else\n result += arr1[arr1_p..arr1.size] # Appent remaining arr1 elements to result.\n end\n\n return result\n\nend", "title": "" }, { "docid": "9b9ed8320b9530ec85602456a7fcd8eb", "score": "0.6598623", "text": "def merge_sort arr\n if arr.length <= 1\n arr\n else\n mid = arr.length/2\n left_half = arr.slice(0...mid)\n right_half = arr.slice(mid...arr.length)\n merge merge_sort(left_half), merge_sort(right_half)\n end\nend", "title": "" }, { "docid": "ccdcb5dc9cb9aaa286013760b5420ca3", "score": "0.6598136", "text": "def merge_sort(lst)\n if lst.length <= 1\n lst\n else\n mid = (lst.length / 2).floor\n left = merge_sort(lst[0..mid - 1])\n right = merge_sort(lst[mid..lst.length])\n merge(left, right)\n end\nend", "title": "" }, { "docid": "5a2196e3d2576e67dbebe01d04bd9a8b", "score": "0.65973043", "text": "def merge_sort(arr)\n return arr unless arr.size > 1\n mid = arr.size/2\n a, b, sorted = merge_sort(arr[0...mid]), merge_sort(arr[mid..-1]), []\n sorted << (a[0] < b[0] ? a.shift : b.shift) while [a,b].none?(&:empty?)\n sorted + a + b\nend", "title": "" }, { "docid": "734a339e2f60fa0f52fbaec038b94518", "score": "0.6592215", "text": "def merge_and_sort!(left, right)\n array = []\n left.first < right.first ? array.push(left.shift) : array.push(right.shift) until left.empty? || right.empty?\n right.empty? ? array.concat(left) : array.concat(right)\n array\nend", "title": "" }, { "docid": "f5bf26244b71dc02fab9bdd5686a17bb", "score": "0.65919966", "text": "def merge_sort(num,offset)\n return if num <= 1\n\n m = num/2\n # Divide numbers\n merge_sort(m,offset)\n merge_sort(num-m,offset + m)\n\n # Merge\n buffer = []\n i = 0\n while i < m\n buffer[i] = $g_sort[i+offset]\n i += 1\n end\n j = m\n i = k = 0\n while i < m && j < num\n if buffer[i] <= $g_sort[j+offset]\n $g_sort[k+offset] = buffer[i]\n k += 1\n i += 1\n else\n $g_sort[k+offset] = $g_sort[j+offset]\n k += 1\n j += 1\n end\n end\n while i < m\n $g_sort[k+offset] = buffer[i]\n k += 1\n i += 1\n end\nend", "title": "" }, { "docid": "00d1baad05b29e164bea5f36e2b81d33", "score": "0.6590421", "text": "def merge_sort(arr) # [5,1,7,10,15]\n return [] if arr.length == 0\n return arr if arr.length == 1\n mid = arr.length / 2 # mid = 2\n #merge_sort([1,5,7]) merge_sort([10,15])\n # p arr\n merge(merge_sort(arr[0...mid]), merge_sort(arr[(mid + 1)..-1]))\n\nend", "title": "" }, { "docid": "97b50eb42447d39cf9f0533a9e920719", "score": "0.65871936", "text": "def merge_sort(arr)\n\n # pp arr\n\n # Base case when arr's length is only 1\n\n len = arr.length\n return arr if len < 2\n\n # Find mid index and split array into two\n\n mid = (len.to_f/2).round - 1\n left = arr[0..mid]\n right = arr[mid+1..len-1]\n\n # Switch left with right if left is bigger\n\n if left[0] > right[0]\n temp = left\n left = right\n right = temp\n end\n\n # Recursion until every chunk has been sorted\n\n left = merge_sort(left)\n right = merge_sort(right)\n\n # Merge each half into whole\n\n total_len = left.length + right.length\n merge(left, right, total_len)\nend", "title": "" }, { "docid": "885b4bcc706208df1608f4c6a00c1929", "score": "0.6586047", "text": "def combine(nums, left, mid, right)\n left_index = left\n right_index = mid\n res = []\n\n while left_index < mid && right_index < right\n if nums[left_index] <= nums[right_index]\n res << nums[left_index]\n left_index += 1\n else\n res << nums[right_index]\n right_index += 1\n end\n end\n\n while left_index < mid\n res << nums[left_index]\n left_index += 1\n end\n\n while right_index < right\n res << nums[right_index]\n right_index += 1\n end\n\n i = 0\n while i + left < right\n nums[i + left] = res[i]\n i += 1\n end\nend", "title": "" }, { "docid": "ad397bad3b3220d1d2e55ba34c66f443", "score": "0.65818185", "text": "def mergesort(array)\n def merge(left_sorted, right_sorted)\n res = []\n l = 0\n r = 0\n\n loop do\n break if r >= right_sorted.length and l >= left_sorted.length\n\n if r >= right_sorted.length or (l < left_sorted.length and left_sorted[l] < right_sorted[r])\n res << left_sorted[l]\n l += 1\n else\n res << right_sorted[r]\n r += 1\n end\n end\n\n return res\n end\n\n def mergesort_iter(array_sliced)\n return array_sliced if array_sliced.length <= 1\n\n mid = array_sliced.length/2 - 1\n left_sorted = mergesort_iter(array_sliced[0..mid])\n right_sorted = mergesort_iter(array_sliced[mid+1..-1])\n return merge(left_sorted, right_sorted)\n end\n\n mergesort_iter(array)\nend", "title": "" }, { "docid": "ad397bad3b3220d1d2e55ba34c66f443", "score": "0.65818185", "text": "def mergesort(array)\n def merge(left_sorted, right_sorted)\n res = []\n l = 0\n r = 0\n\n loop do\n break if r >= right_sorted.length and l >= left_sorted.length\n\n if r >= right_sorted.length or (l < left_sorted.length and left_sorted[l] < right_sorted[r])\n res << left_sorted[l]\n l += 1\n else\n res << right_sorted[r]\n r += 1\n end\n end\n\n return res\n end\n\n def mergesort_iter(array_sliced)\n return array_sliced if array_sliced.length <= 1\n\n mid = array_sliced.length/2 - 1\n left_sorted = mergesort_iter(array_sliced[0..mid])\n right_sorted = mergesort_iter(array_sliced[mid+1..-1])\n return merge(left_sorted, right_sorted)\n end\n\n mergesort_iter(array)\nend", "title": "" }, { "docid": "f9f6ac978ea25cb1385bd32dac5b81cf", "score": "0.6579184", "text": "def split_for_merge_sort\n [self[0, size/2], self[size/2, size - size/2]]\n end", "title": "" }, { "docid": "a091803c1531ba633fa503ae70e1438b", "score": "0.6578639", "text": "def merge_sort(array)\n return array if array.length <= 1\n middle_index = array.length/2-1\n arry1 = array[0..middle_index]\n arry2 = array[(middle_index + 1)..-1]\n #Should be sorted by the time it reaches merge\n b = merge_sort(arry1)\n c = merge_sort(arry2)\n merge(b,c)\n\nend", "title": "" }, { "docid": "65a0cf28475f4ce1bc9120a3373c79e8", "score": "0.6576709", "text": "def merge_sort(arr)\n return arr if arr.length <= 1\n mid = arr.length / 2\n sorted_left = merge_sort(arr.take(mid))\n sorted_right = merge_sort(arr.drop(mid))\n merge(sorted_left, sorted_right)\n end", "title": "" }, { "docid": "4c5389d05b23538312b15bada3b5b0b1", "score": "0.6570082", "text": "def merge_sort(&prc)\n return self if length <= 1\n prc ||= Proc.new { |x,y| x.length <=> y.length }\n\n mid = count / 2\n sorted_left = self.take(mid).merge_sort(&prc)\n sorted_right = self.drop(mid).merge_sort(&prc)\n\n result = Array.merge(sorted_left, sorted_right, &prc)\n end", "title": "" }, { "docid": "2984cd0ada9e906c03a98c14ef705ed2", "score": "0.6568668", "text": "def merge_sort(ary)\r\n # i don't particularly like an algorithm that counts the number of elements\r\n # in order to determine the length of the data set for each subset. Since\r\n # the length can be counted the very first time, the subsequent lengths\r\n # should simply be calculated and passed along instead of counted. \r\n # However since the problem statement specifies the argument for merge_sort \r\n # is only an array i can not pass the calculated length to each recursive \r\n # merge_sort.\r\n length = ary.length\r\n return ary if length == 1\r\n # shift right is more efficient that divide by 2\r\n middle = length>>1\r\n #puts \"middle = #{middle}\"\r\n #print ary\r\n #puts\r\n left = merge_sort(ary[0..middle-1])\r\n right = merge_sort(ary[middle..length-1])\r\n merge(left,right)\r\nend", "title": "" }, { "docid": "f89480177f272c525697a71f9dfd762e", "score": "0.6566597", "text": "def merge_sort(list)\n if list.length <= 1\n list\n else\n mid = (list.length / 2).floor\n left = merge_sort(list[0..mid -1])\n right = merge_sort(list[mid..list.length])\n merge(left,right)\n end\n\nend", "title": "" }, { "docid": "1672e3e6f7c2c173c00cdaab9597e826", "score": "0.6565475", "text": "def merge_sort(list)\n sorted = []\n if list.size < 2\n return list\n else\n # divide\n left, right = list.each_slice( (list.size/2.0).round ).to_a\n left = merge_sort(left)\n right = merge_sort(right)\n\n # conquer\n until left.empty? || right.empty?\n if left.first < right.first\n sorted << left.shift\n else\n sorted << right.shift\n end\n end\n\n sorted += left unless left.empty?\n sorted += right unless right.empty?\n end\n sorted\nend", "title": "" }, { "docid": "a184b35d6c2690334983cd50671a4c76", "score": "0.65653175", "text": "def mergesort(array)\n n = array.length\n if(n < 2)\n return array \n else\n left = array[0..((n.to_f/2).ceil-1)]\n right = array[(n.to_f/2).ceil..(n-1)]\n return merge(mergesort(left), mergesort(right))\n end\nend", "title": "" }, { "docid": "0842413694f59ee2fe78e1eea2054487", "score": "0.6564889", "text": "def merge_sort(arr)\n midpoint = arr.length / 2\n return arr if arr.length == 1\n\n first_half = arr[0..(midpoint-1)]\n second_half = arr[midpoint..-1]\n\n merge(merge_sort(first_half), merge_sort(second_half))\nend", "title": "" }, { "docid": "c80393356144bee206b3277b53297a63", "score": "0.6554234", "text": "def merge_sort(&prc)\n return self if self.length <= 1\n\n prc ||= Proc.new { |n1,n2| n1<=>n2 } # Default incase no block is passed in\n mid = self.length/2\n left,right = self[0...mid],self[mid..-1]\n\n Array.merge(left.merge_sort(&prc),right.merge_sort(&prc),&prc)\n end", "title": "" }, { "docid": "e0d7582903640e37e12bcb0e31dfea80", "score": "0.65533537", "text": "def merge_sort(ar)\n n = ar.length\n\n mid = n/2\n left_ar = ar[0..mid-1]\n right_ar = ar[mid..n-1]\n\n if ar == nil\n return nil\n end\n if n < 2\n return ar\n end\n\n merge_sort(left_ar) # sort left sub list\n merge_sort(right_ar) # sort right sub list\n merge_ar(left_ar,right_ar,ar) # merge left and right sub-list\n\nend", "title": "" }, { "docid": "124ed83966a5faebbd9b67a9a8958b2e", "score": "0.6550713", "text": "def merge_sort(arr)\n return arr if arr.length == 1\n midpoint = (arr.length - 1) / 2\n\n arr_1 = merge_sort(arr[0..midpoint])\n arr_2 = merge_sort(arr[(midpoint + 1)..(arr.length - 1)])\n\n return merge(arr_1, arr_2)\nend", "title": "" }, { "docid": "6d56717fa7dcb3284912216d5ef3670d", "score": "0.65417814", "text": "def merge_sort(arr)\n return arr if arr.length <= 1\n\n pivot = arr[0]\n left = arr[1..-1].select { |num| num <= pivot }\n right = arr[1..-1].select { |num| num > pivot }\n\n return merge_sort(left) + [pivot] + merge_sort(right)\nend", "title": "" }, { "docid": "5b87f17a4100434a58044a70fea2d54a", "score": "0.65364236", "text": "def merge_sort(arr)\n return arr if arr.length < 2\n mid = arr.length / 2\n \n left = arr.take(mid)\n right = arr.drop(mid)\n sorted_left = merge_sort(left)\n sorted_right = merge_sort(right)\n merge(sorted_left, sorted_right)\nend", "title": "" }, { "docid": "67f4018b090981168fe1919b682d6d53", "score": "0.65309787", "text": "def merge_sort\nend", "title": "" }, { "docid": "a25f1481c97955c30d3b2f79eaf076d7", "score": "0.65305537", "text": "def merge_sort(arr)\n return arr if arr.size < 2\n\n midpoint = arr.size / 2\n left = arr.take(midpoint)\n right = arr.drop(midpoint)\n\n merge(merge_sort(left), merge_sort(right))\nend", "title": "" }, { "docid": "6150968aed2ff26e3af9fe04685cc615", "score": "0.652969", "text": "def merge_sort(array, left, right)\n if right - left <= 0\n return\n end\n\n middle = left + (right - left) / 2\n\n # Break out into subarrays\n merge_sort(array, left, middle)\n merge_sort(array, middle + 1, right)\n\n # Merge the arrays\n merge(array, left, middle, right)\n\n array\nend", "title": "" }, { "docid": "997fc6c9f6f41c159207a815b6c5358e", "score": "0.65222913", "text": "def merge_sort(a, p, r)\n\tif p < r\n\t\tq = (p + r) / 2\n\t\tmerge_sort(a, p, q)\n\t\tmerge_sort(a, q + 1, r)\n\t\tmerge(a, p, q, r)\t\n\t\t#merge_s(a, p, q, r)\t\n\tend\n\ta[p..r]\nend", "title": "" }, { "docid": "5e871415d1472a041467a0347bfa3f8a", "score": "0.6520162", "text": "def mergesort(input)\nend", "title": "" }, { "docid": "d4a2e651247342c650de2ddf06957830", "score": "0.65199935", "text": "def merge_sort(arr)\n #base cases\n return arr if arr.empty?\n return arr if arr.length == 1\n\n #inductive step\n mid = arr.length / 2\n merge(merge_sort(arr[0...mid]), merge_sort(arr[mid..-1]))\nend", "title": "" }, { "docid": "2d30d92ee317293d81eed024fc9628e0", "score": "0.65175843", "text": "def merge_sort(arr)\n return arr if arr.length <= 1\n index = arr.length / 2\n left = merge_sort(arr[0...index])\n right = merge_sort(arr[index..-1])\n merge(left, right)\nend", "title": "" }, { "docid": "e848f730fa7885fa1ab58badbece9ff9", "score": "0.6514458", "text": "def merge_sort(arr)\n if arr.length <= 1\n arr\n else\n mid = (arr.length / 2).floor\n left = merge_sort(arr[0..mid - 1])\n right = merge_sort(arr[mid..arr.length])\n merge(left, right)\n end\nend", "title": "" }, { "docid": "4089de50bcca2307d8b327b8a99a2e4c", "score": "0.6511328", "text": "def merge_sort(unsorted_arr)\n return unsorted_arr if unsorted_arr.length <= 1\n\n left = merge_sort( unsorted_arr[0..(unsorted_arr.length/2 - 1) ] )\n right = merge_sort( unsorted_arr[(unsorted_arr.length/2)..-1])\n merge(left, right)\nend", "title": "" }, { "docid": "3ddfd08665bb302403ea33b4fd7f4590", "score": "0.65077585", "text": "def merge_sort(array_of_ints)\n \n array_length = array_of_ints.length \n \n return array_of_ints if array_length === 1\n\n right_array = array_of_ints[0..(array_length/2-1)]\n left_array = array_of_ints[array_length/2..(array_length-1)]\n \n right_array = merge_sort(right_array)\n left_array = merge_sort(left_array)\n\n return merge(right_array, left_array)\nend", "title": "" }, { "docid": "61b414914f4a393aafba99280a24fd0a", "score": "0.6504785", "text": "def merge_sort(arr)\n return arr if arr.length <= 1\n mid_idx = arr.length / 2\n left = merge_sort(arr[0...mid_idx])\n right = merge_sort(arr[mid_idx..-1])\n merge(left, right)\nend", "title": "" }, { "docid": "5894ebdd4dad81ec505a90ab39e2da4f", "score": "0.6504676", "text": "def merge_sort(unsorted)\n # first divide halves, when array only has one left = done\n if unsorted.length <=1 \n return unsorted\n else\n mid = unsorted.length/2\n half1 = merge_sort(unsorted.slice(0...mid))\n half2 = merge_sort(unsorted.slice(mid...unsorted.length))\n merge(half1, half2)\n end\nend", "title": "" }, { "docid": "7b719152381b7ddfd0e90b4378b46f78", "score": "0.6503397", "text": "def mergesort(arr)\n return arr if arr.length < 2\n\n left_merged_stuff = mergesort(arr[0..((arr.length/2)-1)])\n right_merged_stuff = mergesort(arr[(arr.length/2)..-1])\n merge(left_merged_stuff, right_merged_stuff)\nend", "title": "" }, { "docid": "709d093c8d5b8dd042c613f45f73f002", "score": "0.65009546", "text": "def merge_sort(array)\n if(array.length <= 1)\n return array;\n end\n\n left = merge_sort(array[0..(array.length/2-1)]);\n right = merge_sort(array[((array.length/2))..(array.length-1)]);\n\n return merge(left,right);\n\nend", "title": "" }, { "docid": "23ddabc3c7c52f62eb745a7cd989baf1", "score": "0.64890033", "text": "def merge_sort(list)\n if list.length <= 1\n list\n else\n mid = (list.length / 2).floor\n left = merge_sort(list[0..mid - 1])\n right = merge_sort(list[mid..list.length])\n merge(left, right)\n end\nend", "title": "" }, { "docid": "75893989d59974c64ed9101104533064", "score": "0.648862", "text": "def merge(left, right) \n sorted = []\n until left.empty? || right.empty?\n if left.first <= right.first\n sorted << left.shift\n else\n sorted << right.shift\n end \n end \n sorted.concat(left).concat(right)\nend", "title": "" }, { "docid": "b33c8e6985d5e814f78cbbe667c3cf98", "score": "0.6488537", "text": "def merge(left, right)\n #set your counters\n i, j = 0, 0\n #create an array to store sorted values within\n merged_list = []\n\n length_left_side, length_right_side = left.length, right.length\n\n while i < length_left_side || j < length_right_side\n if i < length_left_side && j < length_right_side\n if left[i] <= right[j]\n merged_list << left[i]\n i += 1\n else\n merged_list << right[j]\n j += 1\n end \n elsif i < length_left_side\n merged_list << left[i]\n i += 1\n elsif j < length_right_side\n merged_list << right[j]\n j+= 1\n end\n end\n merged_list\nend", "title": "" }, { "docid": "7e71cff3dcd65c27a0d3acbf13a882da", "score": "0.64866906", "text": "def merge_sort(array)\n\tp \"Array : #{array}\"\n\treturn array if array.length <= 1\n\n\tleft = merge_sort(array[0...array.size/2])\n\tright = merge_sort(array[(array.size/2)...array.size])\n\t\n\tnew_array = []\n\tleft_index = 0\n\tright_index = 0\n\n\twhile left.length >= 1 && right.length >= 1\n\t\tif left_index == left.size\n\t\t\tnew_array << right[right_index...right.size]\n\t\t\tbreak\n\t\telsif right_index == right.size\n\t\t\tnew_array << left [left_index...left.size]\n\t\t\tbreak\n\t\tend\n\n\t\tif left[left_index] < right[right_index]\n\t\t\tnew_array << left[left_index]\n\t\t\tleft_index += 1\n\t\telse\n\t\t\tnew_array << right[right_index]\n\t\t\tright_index += 1\n\t\tend\n\tend\n\tnew_array.flatten\nend", "title": "" }, { "docid": "6b9b600ea4d997172f0ecae3957d4bad", "score": "0.6478128", "text": "def merge_sort(arr)\n return arr if arr.length <= 1\n mid = (arr.length / 2)\n left = merge_sort(arr[0...mid])\n right = merge_sort(arr[mid..-1])\n merge(left,right)\nend", "title": "" }, { "docid": "e3d59892d9dcfd74b90e42e61f9b5297", "score": "0.647727", "text": "def merge_sort(arr)\n return arr if arr[1].nil?\n middle = (arr.length - 1) / 2\n # debugger\n merge_helper(merge_sort(arr[0..middle]), merge_sort(arr[middle + 1..-1]))\nend", "title": "" }, { "docid": "65368add482c0d3f8370acf98c92d25f", "score": "0.64762723", "text": "def mergesort(list)\n if list.length <= 1\n list\n end\n\n mid = list.length/2\n\n merge(mergesort(list[0,mid]),\n mergesort(list[mid, list.length]))\n\nend", "title": "" }, { "docid": "65368add482c0d3f8370acf98c92d25f", "score": "0.64762723", "text": "def mergesort(list)\n if list.length <= 1\n list\n end\n\n mid = list.length/2\n\n merge(mergesort(list[0,mid]),\n mergesort(list[mid, list.length]))\n\nend", "title": "" }, { "docid": "ef895a0e4c3483166a103fd7181fe703", "score": "0.64740473", "text": "def merge_sort(list)\n if list.length <= 1\n list\n else\n mid = (list.length / 2).floor\n left = merge_sort(list[0..mid -1])\n right = merge_sort(list[mid..list.length])\n merge(left, right)\n end\nend", "title": "" }, { "docid": "ddb94eb7754e740288e03941936e57e7", "score": "0.64707696", "text": "def merge_sort(arr)\n return arr if arr.length <= 1\n mid = arr.length / 2\n\n left = merge_sort(arr.take(mid))\n right = merge_sort(arr.drop(mid))\n merge(left, right)\nend", "title": "" }, { "docid": "80fe7a50fe0a9a16d3fc6715181e1894", "score": "0.64685965", "text": "def merge_sort(arr)\n return arr if arr.length <= 1\n split_index = arr.length/2\n # the key is that the recursive call is *before* the return so all of the individual elements will be returned before they are merged amazing\n left_half = merge_sort(arr[0...split_index]) # these will just return all the individual elements broken down, then merged, pretty amazing\n right_half = merge_sort(arr[split_index..-1]) # these will also return all the individual elements broken down\n merge(left_half, right_half) # this will merge them all back together\nend", "title": "" }, { "docid": "c2f7fc6802a263bbf581865df234bbea", "score": "0.6464172", "text": "def merge_sort(arr)\n return arr if arr.size < 2\n\n left, right = merge_sort(arr.slice(0..(arr.size/2)-1)), merge_sort(arr.slice((arr.size/2)..arr.size))\n\n result = []\n result.push(left.first < right.first ? left.shift : right.shift) while !left.empty? && !right.empty?\n\n result.push(left) unless left.empty?\n result.push(right) unless right.empty?\n result.flatten\nend", "title": "" }, { "docid": "d23bf16b6e74e79afd2a58f71eb833f6", "score": "0.6463519", "text": "def merge_sort(arr)\n return arr if arr.length < 2\n\n h = arr.length / 2\n left_half = arr.slice(0, h)\n right_half = arr.slice(h, arr.length)\n merged_arr = (merge_sort(left_half).concat(merge_sort(right_half))).sort\nend", "title": "" }, { "docid": "65c3d885fcb4124af98b6d79f5d76ef8", "score": "0.6462476", "text": "def merge_sort()\nend", "title": "" }, { "docid": "c0683d55578c7bf0e8c47ccc4a4fce64", "score": "0.64618456", "text": "def merge_sort(arr)\n return arr if arr.length == 1\n\n mid = arr.length/2\n left = arr.drop(mid)\n right = arr.take(mid)\n\n sorted_left = merge_sort(left)\n sorted_right = merge_sort(right)\n return merge(sorted_left,sorted_right)\nend", "title": "" }, { "docid": "d033ca15691c2b3c7f97aaf16fcc2733", "score": "0.6461715", "text": "def merge_sort(arr)\n return arr if arr.length <= 1\n # first_part = arr[0..arr.length / 2]\n first_part = arr[0..arr.length / 2 - 1]\n # p first_part\n second_part = arr[arr.length / 2..-1]\n # p second_part\n merge(merge_sort(first_part), merge_sort(second_part))\nend", "title": "" }, { "docid": "a5b75e8a3195a71182cf9b26aada46b4", "score": "0.64616513", "text": "def merging(left=[], right=[], sorted=[])\n\ti_left = 0\n\ti_right = 0\n\ti_sorted = 0\n\twhile (i_left < left.length) && (i_right < right.length)\n\t\tif left[i_left] < right[i_right]\n\t\t\tsorted << left[i_left]\n\t\t\ti_left +=1\n\t\telse\n\t\t\tsorted << right[i_right]\n\t\t\ti_right += 1\n\t\tend\n\t\ti_sorted += 1\n\tend\n\tif i_left == left.length\n\t\twhile i_right < right.length\n\t\t\tsorted << right[i_right]\n\t\t\ti_right += 1\n\t\tend\n\telsif i_right == right.length\n\t\twhile i_left < left.length\n\t\t\tsorted << left[i_left]\n\t\t\ti_left += 1\n\t\tend\n\tend\n\tsorted\nend", "title": "" }, { "docid": "01f5e08582bc2a3dc37c479a2c4a4d36", "score": "0.6460313", "text": "def merge_sort_array(a)\n\tk = 4\n\t#merge_sort(a, 0, a.length-1)\n\tmerge_sort_insertion(a, 0, a.length - 1, k)\nend", "title": "" }, { "docid": "e17817b8f72783a6290b36a4e8e4ede5", "score": "0.6457394", "text": "def merge_sort(list)\n return list if list.length <= 1\n mid = (list.length / 2).floor\n left = merge_sort(list[0..mid - 1])\n right = merge_sort(list[mid..list.length])\n merge(left, right)\nend", "title": "" } ]
2a30caf9042ba8ac77e7c2b53a206e7f
Trabajare en el mismo archivo, por lo que no sera necesario usar los strings en este metodo
[ { "docid": "593d716c724ba7db0a702731021dffc1", "score": "0.0", "text": "def add_list(array1)\n\tfile = File.open(\"index.html\", 'a') do |file|\n\t\tfile.puts \"<ol>\"\n\t\tarray1.each { |ele| file.puts \"<li> #{ele} </li>\"} if array1.any?\n\t\tfile.puts \"</ol>\"\n\t\tfile.close\n\tend\n\tnil\nend", "title": "" } ]
[ { "docid": "b563e7e0a504f19bca3b4a4968688638", "score": "0.63660467", "text": "def file= string\n end", "title": "" }, { "docid": "ae6d4c8f614705a01b72a53aa2798d06", "score": "0.6301332", "text": "def raw_text\n raw_text = File.read(file_name)\n #raw_text = File.read(\"tmp/insert_sexual_lines.txt\")\n #raw_text = File.read(\"tmp/insert_internals_hash.txt\")\n end", "title": "" }, { "docid": "a1ee21d9cbf24b36345737c7029bcf05", "score": "0.6230471", "text": "def translate(filename)\n \n end", "title": "" }, { "docid": "211b1bcc1128deed63ae8fe93e1611d9", "score": "0.62165374", "text": "def cargar(nombre)\n CSV.parse(\n File.read(nombre.to_s),\n headers: true,\n encoding: 'UTF-8'\n )\nend", "title": "" }, { "docid": "058ea519205c209c70bf9f92b0a041c4", "score": "0.619802", "text": "def readFile name\n end", "title": "" }, { "docid": "42b16cc4e7b5eac7db71663bd610a3cd", "score": "0.6188632", "text": "def fichier_de_donnees_pour(nb_items)\n \"testdata/#{nb_items}Words.txt\"\nend", "title": "" }, { "docid": "42b16cc4e7b5eac7db71663bd610a3cd", "score": "0.6188632", "text": "def fichier_de_donnees_pour(nb_items)\n \"testdata/#{nb_items}Words.txt\"\nend", "title": "" }, { "docid": "cc3a78bf02f37f9b1154856466c880eb", "score": "0.6034794", "text": "def file_name\n #file_name = (\"tmp/insert_anagrams.txt\")\n #file_name = (\"tmp/insert_externals.txt\")\n #file_name = (\"tmp/insert_internals.txt\")\n #file_name = (\"tmp/insert_internals_hash.txt\")\n #file_name = (\"tmp/insert_sexual_lines.txt\")\n file_name = (\"tmp/insert_words_list.txt\")\n #file_name = (\"../../Documents/20110731-research.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready-015.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready_hash-015.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready_hash_test.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready_hashlines-015.txt\")\n end", "title": "" }, { "docid": "1a7ddb8921adc7537e0362f1e872ea27", "score": "0.5967969", "text": "def loadFile(fileName)\n chararr = []\n File.open(\".#{fileName}\", \"r\") do |f|\n f.each_line do |line|\n tmparr = line.split('')\n tmparr.each do |t|\n chararr.push(t)\n end\n end\n end\n chararr\nend", "title": "" }, { "docid": "dd99d3d19156be310fb01033d05b4688", "score": "0.5962895", "text": "def leer_archivo(ruta)\n archivo = {}\n File.foreach(ruta) do |line|\n pal1, pal2 = line.split(' ')\n archivo[pal2] = pal1\n end\n archivo\nend", "title": "" }, { "docid": "fc55507c57ee54764393bd814562fe68", "score": "0.5957696", "text": "def loadFile()\n\t\t@tabTexte = Array.new;\n\t\tfic = File.open(\"langue/\"+@langue+\".txt\",'r')\n\t\tfic.each_line{ |ligne|\n\t\t\ttab = ligne.split(\";\")\n\t\t\t@tabTexte.push(tab)\n\t\t}\n\t\t#self.debugAfficherTab\n\t\treturn self;\n\tend", "title": "" }, { "docid": "017bd02d0558ae5e8c9f65ca6a76da9b", "score": "0.5926864", "text": "def read_from_file; end", "title": "" }, { "docid": "017bd02d0558ae5e8c9f65ca6a76da9b", "score": "0.5926864", "text": "def read_from_file; end", "title": "" }, { "docid": "206a1739782aefd8e42c054096dc5b2e", "score": "0.59244436", "text": "def escribirArchivo(palabra)\n file = File.open(\"traducido.rb\", \"a+\")\n if palabraReservada?(palabra)\n file.write($traducciones[palabra])\n else\n file.write(palabra)\n end\n file.close\nend", "title": "" }, { "docid": "2f738df2e04ca4b3cbe593f36bd1f4f6", "score": "0.5894875", "text": "def file_string\n str1 = self.display_name\n str1.gsub!(\" \", '_')\n str1.gsub!(\"/\",\"~\")\n str1.gsub!(\"\\(\", \"\")\n str1.gsub!(\"\\)\", \"\")\n str1\n end", "title": "" }, { "docid": "ab5d5952fe6e27201b93210986826667", "score": "0.5877475", "text": "def load file_name\n\t\t\tFile.open(file_name).each_line do |line|\n\t\t\t\tadd(line.chomp)\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "be8f4e74f10ad502fa18d8ad0aef21a0", "score": "0.587321", "text": "def load(dir)\n #nacteni souboru v adresari\n formule = Array.new\n Dir.new(dir).entries.each do |filename|\n next if filename == '.' || filename == '..' || filename == '.svn'\n #cteni dat ze souboru\n f = File.new(dir+'/'+filename, \"r\")\n data = Array.new\n while (line = f.gets())\n next if line.start_with?('c') || line.start_with?('p') #zatim neresim jina data/pocty promennych\n break if line.start_with?('%')\n nums = line.split(\" \")\n k = Array.new\n for i in (0..2)\n k.push(Literal.new(nums.at(i).to_i))\n end\n data.push(Klauzule.new(k))\n end\n formule.push(Formule.new(data))\n end\n return formule\nend", "title": "" }, { "docid": "38d433ff8522cfcaa56b4efe8e6f1de3", "score": "0.5871412", "text": "def addMolid2File(ifn, ofn)\n if File::exists?(ifn)\n lines = File.open(ifn).readlines\n added_lines = addMolid(lines, key=\"$$$$\")\n File.open(ofn, 'w') {|file| file.write(added_lines.join)}\n else\n raise \"#{ifn} does not exist\\n\"\n end\n\nend", "title": "" }, { "docid": "b1b42baaf6e410269f58155649796ff4", "score": "0.5862243", "text": "def convert_file(srcFileName, desFileName, srcEncoding, desEncoding)\n f_src = File.open(srcFileName,\"r:utf-8\")\n f_des= File.open(desFileName,\"w:utf-8\")\n\n if srcEncoding == ENCODING_UNICODE and desEncoding == ENCODING_TRIPLE then\n while f_src.eof? == false do\n line = f_src.readline()\n buf = to_triple_array(line)\n f_des.write(buf+\"\\n\")\n end\n elsif srcEncoding == ENCODING_TRIPLE && desEncoding == ENCODING_UNICODE then\n while f_src.eof? == false do\n line = f_src.readline\n buf = to_string(line)\n bw.write(buf+\"\\n\")\n end\n\t\tend\n end", "title": "" }, { "docid": "b87e8b3fcd3b55d9b7d19ae16222568e", "score": "0.5842349", "text": "def from_file(filename); end", "title": "" }, { "docid": "b87e8b3fcd3b55d9b7d19ae16222568e", "score": "0.5842349", "text": "def from_file(filename); end", "title": "" }, { "docid": "5703f5628a74d6899640e79aa0e03120", "score": "0.58407277", "text": "def file_string\n str1 = self.name\n # str1.gsub!(\"(region)\", \"region\")\n str1 = \"\" if str1 == \"(region)\"\n # str1.gsub!(\"(section)\", \"section\")\n str1 = \"\" if str1 == \"(section)\"\n str1.gsub!(\" \", '_')\n str1.gsub!(\"/\",\"~\")\n str1.gsub!(\"\\(\", \"\")\n str1.gsub!(\"\\)\", \"\")\n str1\n end", "title": "" }, { "docid": "104857dbeced386d9c64e3d4fc72382d", "score": "0.5838018", "text": "def replace_contents(file)\n file\n .encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')\n .gsub(/MyFirstHorosPlugin/, $plugin_name).gsub(/CURRENT_YEAR/, $cur_year).gsub(/YOUR_NAME/, $your_name)\nend", "title": "" }, { "docid": "8dab9eaeaf7a1d5f0fe6b8fbde873e3e", "score": "0.5827213", "text": "def generate_file\n\t\tputs \"Realizando Tradução... / Loading Translate\"\n\t\tputs get_translation\n\t\ttime = Time.new\n\n \n\t\tfile = File.open(time.strftime(\"%m-%d-%Y.%H.%M.%S\") + \".txt\", 'w') do |fline|\n\t\t\tfline.puts @lang\n\t\t\tfline.puts (\"#############################\")\n\t\t\tfline.puts get_translation\n\t\t\tfline.puts (\"#############################\")\n\n\t\tend\n\tend", "title": "" }, { "docid": "0151327366e309b316d5fe6ddf5d18f3", "score": "0.58224255", "text": "def convert_encoded_instructions(filename); end", "title": "" }, { "docid": "a59c6c348985e97ca534c96fc28e193f", "score": "0.58208036", "text": "def load_file\n File.read('./data2.txt')\nend", "title": "" }, { "docid": "7ff63b75d41ee6979e3eea01109218bc", "score": "0.5783549", "text": "def sorted_names_file\n 'data/sorted_names.text'\nend", "title": "" }, { "docid": "364f0516df59a41acb810603f5ba4932", "score": "0.57750857", "text": "def create_endnote_files\n # this has 5 references in it \n @file_with_many = File.read(File.dirname(__FILE__) + '/../fixtures/test_files/simpleendnote_test.txt')\n\n @file_with_one = \"%0 Journal Article\n %T Something great happened Here\n %A OhBrother, F.\n %J Journal of Hymenoptera Research\n %V 3\n %P 1-222\n %D 1972\"\n end", "title": "" }, { "docid": "c0c010166f656707f2622dabd5633ea2", "score": "0.5766618", "text": "def textLoadFile(w,file)\n w.delete('1.0', 'end')\n f = open(file, 'r')\n while(!f.eof?)\n w.insert('end', f.read(1000))\n end\n f.close\nend", "title": "" }, { "docid": "a7e5649d1038390bc9f990a2bdb7475b", "score": "0.5760599", "text": "def gener_file_by file_name, module_folder, content=\"\"\n begin\n if content == \"\"\n File.open(\"./#{module_folder}/#{file_name}.php\",\"w\") do |f|\n f.syswrite(\"\")\n end\n else\n if file_name.kind_of?(Array)\n temp_name = \"\"\n for i in file_name do\n temp_name += upper_first_alphabet i\n end\n file_name = upper_first_alphabet temp_name.downcase\n class_name = temp_name.sub(/Filter$/, '')\n else\n class_name = file_name\n end\n File.open(\"./#{module_folder}/#{file_name}.php\",\"w\") do |f|\n f.syswrite(content.gsub!(/(\\#\\{.*?\\})/) {|word| class_name })\n end\n end\n rescue => exception\n #puts exception\n Dir.mkdir(\"./#{module_folder}\")\n retry\n end\n puts \"生成了 #{file_name}.php\"\nend", "title": "" }, { "docid": "cb402a5ec1d5e95e37dbfbfb24e505ed", "score": "0.57515424", "text": "def logo_ascii\n file = File.open(\"lib/ascii/logo.txt\")\n ascii = file.read\n puts ascii\nend", "title": "" }, { "docid": "f573814cef26139df2b47e103cf42627", "score": "0.57433885", "text": "def ascii_title\n File.readlines('./resources/ascii_title.txt') do |line|\n puts line\n end\nend", "title": "" }, { "docid": "0461e8ed4f9812f0043381e517ae0bcc", "score": "0.57398146", "text": "def prepare\n begin\n raw_string = File.read(@path)\n rescue Errno::ENOENT\n # Notify developers\n raise StandardError, 'File with data does not exist'\n end\n\n raw_string.gsub!(\"\\n\", \",\\n\")\n \"[#{raw_string.chomp.chomp(',')}]\"\n end", "title": "" }, { "docid": "8fea96096a92068f4b77170fa65583b2", "score": "0.5733067", "text": "def mv(files)\n begin\n p file1_path = File.join(@l_dir,'text',files[0])\n p file2_path = File.join(@l_dir,'text',files[1])\n rescue => evar\n puts evar.to_s\n puts \"error on move_files, check the input format, especially comma separation.\"\n exit\n end\n return if file1_path==file2_path\n if File.exist?(file2_path) then\n print (\"moving target #{files[1]} exists.\\n\")\n print (\"first remove#{files[1]}.\\n\")\n return\n else\n File.rename(file1_path,file2_path)\n end\n\n info=InfoDB.new(@l_dir)\n\n db = info.db\n\n pp file0=db[files[0]]\n db.delete(files[0])\n db[files[1]]=file0\n db[files[1]][:title]=files[1] if db[files[1]][:title]==files[0]\n pp db[files[1]]\n\n db.each{|ele|\n ref = ele[1][:references]\n if ref.include?(files[0]) then\n p link_file=ele[0]\n link_path = File.join(@l_dir,'text',link_file)\n\n cont = File.read(link_path)\n if Kconv.iseuc(cont) then\n print \"euc\\n\"\n utf8_cont=cont.toutf8\n utf8_cont.gsub!(/#{files[0]}/,\"#{files[1]}\")\n cont = utf8_cont.toeuc\n else\n cont.gsub!(/#{files[0]}/,\"#{files[1]}\")\n end\n\n File.write(link_path,cont)\n\n ref.delete(files[0])\n ref << files[1]\n\n p cache_path = File.join(@l_dir,'cache/parser',link_file)\n begin\n File.delete(cache_path)\n rescue => evar\n puts evar.to_s\n end\n end\n }\n\n info.dump\n end", "title": "" }, { "docid": "1681159d7ed53568d5de82739f0404cf", "score": "0.5726824", "text": "def sensuroija()\n\n teksti_a = []\n teksti_b = \"\"\n uusi_teksti = \"\"\n \n tiedosto = File.open(\"6-3a_tiedosto.txt\",\"r\")\n # luetaan tiedoston rivit taulukkoon teksti_a\n tiedosto.each {|rivi| teksti_a.push(rivi.chomp)}\n\n tiedosto = File.open(\"6-3c_tiedosto.txt\",\"r\")\n # luetaan tiedoston rivit taulukkoon teksti_b\n tiedosto.each_line do |rivi|\n teksti_b += rivi\n end\n\n # loopataan ja korvataan teksti_a:n sisältämät sanat teksti_b:ssä\n for i in teksti_a\n uusi_teksti = teksti_b.gsub(i,'*****')\n teksti_b = uusi_teksti\n end\n\n tiedosto = File.open(\"6-3b_tiedosto.txt\",\"a\")\n # kirjoitetaan uusi_teksti muuttujan sisältö tiedostoon 6-3b_tiedosto.txt \n tiedosto.puts(uusi_teksti)\n puts \"Tallennetaan siistitty versio...\"\n\n tiedosto.close\n \n return puts \"Valmis! Lopetetaan.\"\nend", "title": "" }, { "docid": "3a186eb2087cca4947aa5142569d7767", "score": "0.57251704", "text": "def load_from_file(afile)\n end", "title": "" }, { "docid": "ea3f5a58212ac3e798f0cd4a85a8f00c", "score": "0.57157326", "text": "def monta_header_arquivo\n header_arquivo = '' # CAMPO TAMANHO\n header_arquivo += cod_banco # codigo do banco 3\n header_arquivo << '0000' # zeros 4\n header_arquivo << '1' # registro header do lote 1\n header_arquivo << 'R' # tipo operacao: R-remessa 1\n header_arquivo << ''.rjust(7, '0') # zeros 7\n header_arquivo << ''.rjust(2, ' ') # brancos 2\n header_arquivo << info_conta # informacoes da conta 22\n header_arquivo << ''.rjust(30, ' ') # brancos 30\n header_arquivo << empresa_mae.format_size(30) # nome da empresa 30\n header_arquivo << ''.rjust(80, ' ') # brancos 80\n header_arquivo << sequencial_remessa.to_s.rjust(8, '0') # numero seq. arquivo 8\n header_arquivo << data_geracao # data geracao 8\n header_arquivo << complemento_header # complemento do arquivo 44\n header_arquivo\n end", "title": "" }, { "docid": "1a870150448cdff61966b25b9af92168", "score": "0.57155526", "text": "def in_file(filename); end", "title": "" }, { "docid": "99b202b0566787e5bcb53ec36e8928d8", "score": "0.57090974", "text": "def transform_files!(type) \n files = Files.send(type.to_s + \"_files\")\n files.each do |file|\n parsed = \"\"\n namespace = [DEFAULT_LANGUAGE, 'txt', type] + Base.get_namespace(file, type)\n puts \"Converting: \" + file + \" into namespace: \"\n puts namespace.map {|x| \"[\\\"#{x}\\\"]\"}.join(\"\")\n \n namespace = Namespace.new(namespace)\n contents = File.read(file)\n parsed << GettextI18nConvertor.string_to_i18n(contents, namespace)\n\n File.open(file, 'w') { |file| file.write(parsed)}\n \n namespace.merge(@translations)\n end\n end", "title": "" }, { "docid": "66b5faa8d0e0eb5407604df1fa4f1434", "score": "0.56935704", "text": "def add_txt(file)\n\t\tFile.open(file) do |f| add_str(f.read) end\n\tend", "title": "" }, { "docid": "be1522111d8917106522815db3659143", "score": "0.5693109", "text": "def formate_balises_include\n str = self\n str.gsub!(/INCLUDE\\[(.*?)\\]/){\n sfile = SuperFile.new($1.split('/'))\n if sfile.exist?\n \"\\n\\n\" + sfile.read + \"\\n\\n\"\n else\n # TODO Ici, alerte administrateur\n \"INSERTION FICHIER INTROUVABLE : #{sfile.path}\"\n end\n }\n str\n end", "title": "" }, { "docid": "183ca58fe2d711a947300d3410af02fb", "score": "0.5688164", "text": "def load_data(filename)\n\nend", "title": "" }, { "docid": "76fd9ac740a637f6e411f418bd3aefa6", "score": "0.5680257", "text": "def reformarString(archivo,cola)\r\n\tline2 = false\r\n\tcom = true\r\n\terrorApertura = false\r\n\terrorCerradura = false\r\n\tcolError = 0\r\n\tfilaError = 0\r\n\tfor i in 0..Integer(archivo.size)-1\r\n\t \tpos1 = 0\r\n\t \tpos2 = 0\r\n\t \tpos3 = 0\r\n\t \tpos4 = 0\r\n\t \tcom = true\r\n\t \tif(archivo[i].length == 0)\r\n\t \t\tarchivo[i] = \" \"\r\n\t \tend\r\n\t \tfor j in 0..Integer(archivo[i].size)-1\r\n\t \t\tif(archivo[i][j] == \"\\t\")\r\n\t\t \t\tarchivo[i][j] = \" \"\r\n\t\t \tend\r\n\t\tend\r\n\t\tif((/%%/).match(archivo[i]))\r\n\t\t\tpos3 = (/%%/) =~ archivo[i]\r\n\t\t\tif((/%{/).match(archivo[i]))\r\n\t\t\t \tpos4 = (/%{/) =~ archivo[i]\r\n\t\t\t\tif(pos3 < pos4)\r\n\t\t\t\t\tfor j in pos3..Integer(archivo[i].size)-1\r\n\t\t\t\t\t\tarchivo[i][j] = \" \"\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\t\t\telse\r\n\t\t\t\tfor j in pos3..Integer(archivo[i].size)-1\r\n\t\t\t\t\tarchivo[i][j] = \" \"\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\t \tif(line2)\r\n\t\t\tif((/\\}%/).match(archivo[i]))\r\n\t\t \t\tpos2 = (/\\}%/) =~ archivo[i]\r\n\t\t \t\tfor j in 0..pos2+1\r\n\t\t \t\t\tif(archivo[i][j] != \"\\t\")\r\n\t\t \t\t\t\tarchivo[i][j] = \" \"\r\n\t\t \t\t\tend\r\n\t\t \t\tend\r\n\t\t \t\tline2 = false\r\n\t\t \t\terrorApertura = false\r\n\t\t \t\tcolError = 0\r\n\t\t \t\tfilaError = 0\r\n\t\t \telse\r\n\t\t\t \tfor j in 0..Integer(archivo[i].size)-1\r\n\t\t \t\t\tif(archivo[i][j] != \"\\t\")\r\n\t\t \t\t\t\tarchivo[i][j] = \" \"\r\n\t\t \t\t\tend\r\n\t\t\t \tend\r\n\t\t\t \terrorApertura = true\r\n\t\t\tend\r\n\t\tend\r\n\t \twhile(com)\r\n\t \t\tpos1 = 0\r\n\t \t\tpos2 = 0\r\n\t\t \tif((/%{/).match(archivo[i]))\r\n\t\t \t\tpos1 = (/%{/) =~ archivo[i]\r\n\t\t \t\tcolError = pos1\r\n\t\t \t\tfilaError = i+1\r\n\t\t \t\tif((/\\}%/).match(archivo[i]))\r\n\t\t \t\t\tpos2 = (/\\}%/) =~ archivo[i]\r\n\t\t \t\tend\r\n\t\t \t\tif(pos2 == 0)\r\n\t\t \t\t\tline2 = true\r\n\t\t \t\t\tcom = false\r\n\t\t \t\t\terrorApertura = true\r\n\t\t \t\t\tfor j in pos1..Integer(archivo[i].size)-1\r\n\t\t \t\t\t\tif(archivo[i][j] != \"\\t\")\r\n\t\t \t\t\t\t\tarchivo[i][j] = \" \"\r\n\t\t \t\t\t\tend\r\n\t\t \t\t\tend\r\n\t\t \t\telse\r\n\t\t \t\t\tfor j in pos1..pos2+1\r\n\t\t \t\t\t\tif(archivo[i][j] != \"\\t\")\r\n\t\t \t\t\t\t\tarchivo[i][j] = \" \"\r\n\t\t \t\t\t\tend\r\n\t\t \t\t\tend\r\n\t\t \t\tend\r\n\t\t \telse\r\n\t\t \t\tcom = false\r\n\t\t \tend\r\n\t\tend\r\n\tend\r\n\tif(errorApertura)\r\n\t\ttokenAux = Token.new(\"%{\", \"Error\", filaError, colError)\r\n\t\tcola.push(tokenAux)\r\n\tend\r\n\treturn archivo\r\nend", "title": "" }, { "docid": "0c586b73bee9054e154f09ce856c1977", "score": "0.56756693", "text": "def mandar_archivo(file)\n @modelo.file = file\n end", "title": "" }, { "docid": "caa38bcef08ea84d4aca8cfdc63de6a7", "score": "0.5670632", "text": "def filemachine(line)\r\n out_array = Array.new\r\n asd = String.new\r\n line.strip!\r\n line[0] = ''\r\n line.strip!\r\n if File::exists?(\"#{line}\") \r\n\t input = File.open(\"#{line}\")\r\n\t input.each{|ot| out_array << ot if !ot.empty?}\r\n\t converter(out_array,@outfile)\r\n\t input.close\r\n\telse\r\n\t raise StandardError, \"Please ensure #{line} file exists\" \r\n\tend\r\n out_array.clear\r\n end", "title": "" }, { "docid": "bbe2b98f9400585702ca7ad7fa6dbb66", "score": "0.5669669", "text": "def fin; end", "title": "" }, { "docid": "bbe2b98f9400585702ca7ad7fa6dbb66", "score": "0.5669669", "text": "def fin; end", "title": "" }, { "docid": "bfd6abba73629163e30cb516088c97de", "score": "0.5666008", "text": "def initialize texte_name, test_file\n @texte_name = texte_name\n @test_file = test_file.sub(/^#{APPFOLDER}\\//,'')\n end", "title": "" }, { "docid": "651ab42dec31b7f2dc69ad18ef07dca4", "score": "0.5665047", "text": "def readFile(labelFile, index, toBeReplaced, newLabelFile, labelAry)\n if(index == 0)\n while (line = labelFile.gets)\n labelAry.push(line)\n end\n end\n labelFile.seek(0,IO::SEEK_SET)\n row = 0\n while (line = labelFile.gets)\n text = line.split(' ')\n if (text[0]== toBeReplaced)\n text[0] = index\n labelAry[row] = text[0].to_s+' '+text[1].to_s\n end\n row = row + 1\n end\nend", "title": "" }, { "docid": "fee61422cbb2fd938412e76b7f29761d", "score": "0.5662706", "text": "def read_string(string_name) \n string_result = \"\"\n\n if string_name.include? \".txt\"\n path_string = \"../Data/#{string_name}\"\n elsif string_name.include? \"error.html\"\n path_string = \"../public/#{string_name}\"\n elsif string_name.include? \".css\"\n path_string = \"../styles/#{string_name}\"\n elsif\n path_string = \"../#{string_name}\"\n end\n\n path = Dir.glob(path_string).first\n File.open(path) do |f|\n f.each do |line|\n string_result << line\n end\n end\n string_result\nend", "title": "" }, { "docid": "7136780e969968e840cb42c08e7feead", "score": "0.56619745", "text": "def unsorted_names_file\n 'data/unsorted_names.txt'\nend", "title": "" }, { "docid": "f7ff70f5ca14c13acb434e723b445d57", "score": "0.5654782", "text": "def read_save_data(file)\n #noinspection RubyUnusedLocalVariable\n Logger.info 'leggo i dati di gioco...'\n characters = Marshal.load(file)\n Graphics.frame_count = Marshal.load(file)\n @last_bgm = Marshal.load(file)\n @last_bgs = Marshal.load(file)\n $game_system = Marshal.load(file)\n $game_message = Marshal.load(file)\n $game_switches = Marshal.load(file)\n $game_variables = Marshal.load(file)\n $game_self_switches = Marshal.load(file)\n $game_actors = Marshal.load(file)\n $game_party = Marshal.load(file)\n $game_troop = Marshal.load(file)\n $game_map = Marshal.load(file)\n $game_player = Marshal.load(file)\n if $game_system.version_id != $data_system.version_id\n $game_map.setup($game_map.map_id)\n $game_player.center($game_player.x, $game_player.y)\n end\n Logger.info 'file di gioco caricati.'\n end", "title": "" }, { "docid": "fc4f84e42bd5ceae2f26638332e583b3", "score": "0.56546336", "text": "def add_file(values); end", "title": "" }, { "docid": "bc521031bb7acf2c7374c97edda7bfa4", "score": "0.56511027", "text": "def aozora_file_text(html=nil)\n html = html || Rails.env.production? ? URI.open(aozora_raw_file_url)&.read : File.open(aozora_file_path, &:read)\n\n charset = 'CP932'\n doc = Nokogiri::HTML.parse(html, nil, charset)\n\n # ルビと外字(img)のtagを外してプレーンテキストにする\n rubys = {}\n doc.search('ruby').each do |ruby|\n # ルビ内に外字がある場合、外字を*に置き換えてルビを削除(あとで同じ外字に一括ルビ振り)\n if ruby.css('rb img.gaiji').first\n ruby.css('rb img.gaiji').each do |img|\n img.replace('※'.encode('Shift_JIS', invalid: :replace, undef: :replace))\n end\n rb = ruby.css('rb').inner_text\n rubys[rb] = \"#{rb}(#{ruby.css('rt').inner_text})\"\n ruby.replace(rb.encode('Shift_JIS', invalid: :replace, undef: :replace))\n # 外字なしのルビは、常用漢字の有無でルビを残すか判定\n else\n rb = ruby.css('rb').inner_text\n # 常用漢字なし:ルビを残す\n if (rb.split('') & USUAL_KANJIS).empty?\n ruby.replace(\"#{rb}(#{ruby.css('rt').inner_text})\".encode('Shift_JIS', invalid: :replace, undef: :replace))\n # 常用漢字あり:ルビを削除\n else\n ruby.replace(rb.encode('Shift_JIS', invalid: :replace, undef: :replace))\n end\n end\n end\n # ルビなしの外字はすべて*に置換(一度ルビが振られてたものは後で一括ルビ振り)\n doc.search('img.gaiji').each do |img|\n img.replace('※'.encode('Shift_JIS', invalid: :replace, undef: :replace))\n end\n\n # 古いファイルは.main_textがないので、body配下の全文を本文扱いする\n main_text = doc.css('.main_text').presence || doc.css('body')\n text = main_text.inner_text\n .gsub(/(\\R{1,})/, '\\1' + \"\\r\\n\") # 元からある改行を1つ増やす\n .gsub(/\\R/, \"\\r\\n\") # 改行コードを\\r\\nに変える\n .gsub(/#{rubys.keys.join(\"|\")}/, rubys) # 外字にルビを振る\n .gsub(/(。)(?=[^(]*)|[^「]*」)/, '★★★') # ()と「」内の文末句点を★★★に一時変更\n .gsub(/(。)/, '\\1' + \"\\r\\n\") # その他の句点に改行追加\n .gsub(/★★★/, '。') # ★を句点に戻す\n .strip\n footnote = doc.css('.bibliographical_information').inner_text.strip\n\n [text, footnote]\n end", "title": "" }, { "docid": "5cd6d9fe01f05eccc9d86be25659ba94", "score": "0.5650653", "text": "def read_data filename\r\n\t\tdata = File.readlines(filename)\r\n\t\tdata.each do |line|\r\n\t\t\tstring = line.chomp\r\n\t\t\tstr10 = string[0..9]\r\n\t\t\tstr20 = string[10..-1]\r\n\t\t\tinsert(str10,str20)\r\n\r\n\t\tend\r\n\r\n\tend", "title": "" }, { "docid": "c750bd83e3742e11f6b085c10ac122ea", "score": "0.5636287", "text": "def write(nombre_archivo,string)\n archivo = File.open(nombre_archivo, 'w')\n archivo.write \"#{string}\"\n archivo.close\nend", "title": "" }, { "docid": "fa59d0930deb59c18b5cb70bea9c58bd", "score": "0.5627552", "text": "def load_file(filename); end", "title": "" }, { "docid": "fa59d0930deb59c18b5cb70bea9c58bd", "score": "0.5627552", "text": "def load_file(filename); end", "title": "" }, { "docid": "cc54f71c7afe978c80be29b935bed37d", "score": "0.5623778", "text": "def test_that_it_can_source_a_file\r\n n = File.split(__FILE__)[0] + '/' + 'file_test.txt'\r\n s = XfOOrth::FileSource.new(n)\r\n refute(s.eol?)\r\n refute(s.eof?)\r\n assert_equal('T', s.get)\r\n assert_equal('1', s.get)\r\n assert_equal('2', s.get)\r\n assert_equal('3', s.get)\r\n refute(s.eol?)\r\n refute(s.eof?)\r\n assert_equal(' ', s.get)\r\n assert(s.eol?)\r\n refute(s.eof?)\r\n\r\n assert_equal('9', s.get)\r\n assert_equal('A', s.get)\r\n assert_equal('B', s.get)\r\n assert_equal('C', s.get)\r\n refute(s.eol?)\r\n refute(s.eof?)\r\n assert_equal(' ', s.get)\r\n assert(s.eol?)\r\n refute(s.eof?)\r\n\r\n assert_equal(nil, s.get)\r\n assert(s.eol?)\r\n assert(s.eof?)\r\n end", "title": "" }, { "docid": "9362fb3f4dc288dc9eb8e62855b42b42", "score": "0.5623497", "text": "def traite_fichiers\n\t\tencodage = Cesar.new(@motpasse.size) \t\t\n\t\t#Création de la VARIABLE \"encodage\" ayant pour INSTANCE la CLASS \"Cesar\"\n\t\t#Elle va permettre de crypter le message (Encodage/Cryptage)\n\t\tFile.open(@fichier_sortie, \"w\") do |sortie|\n\t\t#=Ouvrir le fichier spécifier dans la VARIABLE d'INSTANCE \"@fichi...\" en écriture(\"w\") selon VARIABLE \"sortie\"\n\t\tIO.foreach(@fichier_entree) do |ligne|\n\t\t#=Lecture du fichier d'entrée ligne par ligne\n\t\t#IO=Entrer/Sortie\n\t\tconversion_ligne = convertit(encodage, ligne)\n\t\tsortie.puts conversion_ligne\n\t\t#=a la sortie ecrire le contenue de la VARIABLE \"conver...\"\n\t\tend\n\tend\n\tend", "title": "" }, { "docid": "664f347f665c413192b69323f2664537", "score": "0.562063", "text": "def read(filepath); end", "title": "" }, { "docid": "f98f6065e7c2043e832404d35b72a7ff", "score": "0.56158394", "text": "def load_descripcion\n if params[:file]\n Indicator.load_descripcion(params[:file])\n redirect_to configs_path, :flash => {:notice => \"Datos guardados éxito!\"}\n else\n redirect_to configs_path, :flash => {:error => \"Por favor seleccionar un archivo CSV\"}\n end\n end", "title": "" }, { "docid": "4eabb235f1e5a9048d7c01497055806d", "score": "0.56155175", "text": "def monta_header_arquivo\n header_arquivo = '' # CAMPO TAMANHO\n header_arquivo += cod_banco # codigo do banco 3\n header_arquivo << '0000' # lote do servico 4\n header_arquivo << '0' # tipo de registro 1\n header_arquivo << ''.rjust(9, ' ') # uso exclusivo FEBRABAN 9\n header_arquivo << Brcobranca::Util::Empresa.new(documento_cedente, false).tipo # tipo inscricao 1\n header_arquivo << documento_cedente.to_s.rjust(14, '0') # numero de inscricao 14\n header_arquivo << codigo_convenio # codigo do convenio no banco 20\n header_arquivo << info_conta # informacoes da conta 20\n header_arquivo << empresa_mae.format_size(30) # nome da empresa 30\n header_arquivo << nome_banco.format_size(30) # nome do banco 30\n header_arquivo << ''.rjust(10, ' ') # uso exclusivo FEBRABAN 10\n header_arquivo << '1' # codigo remessa 1\n header_arquivo << data_geracao # data geracao 8\n header_arquivo << hora_geracao # hora geracao 6\n header_arquivo << sequencial_remessa.to_s.rjust(6, '0') # numero seq. arquivo 6\n header_arquivo << versao_layout_arquivo # num. versao arquivo 3\n header_arquivo << densidade_gravacao # densidade gravacao 5\n header_arquivo << uso_exclusivo_banco # uso exclusivo 20\n header_arquivo << uso_exclusivo_empresa # uso exclusivo 20\n header_arquivo << complemento_header # complemento do arquivo 29\n header_arquivo\n end", "title": "" }, { "docid": "bb65f9da33cbc27cc6656b5c790fb0aa", "score": "0.5615455", "text": "def bilingual_words\n #if filename =~ /_portrait|_landscape/i\n # return [ \"#{self.initial}??\", \"O_missing\"]\n #end\n if filename =~ /(.*)\\(.*\\)/\n regex_incasinata = /(.+)\\((.+)\\)/\n [ \n filename[regex_incasinata, 1] ,\n\n filename[regex_incasinata, 2] ,\n ]\n else\n [ basename, basename]\n end\n end", "title": "" }, { "docid": "06896e0ed23257ed797a4f25d16fbd33", "score": "0.5609582", "text": "def prepare(filename, case_matters=false)\n File.open(filename, 'r').readlines.to_s.just_letters(case_matters) \n end", "title": "" }, { "docid": "3a971dd65042fd2009b7cc0179e41298", "score": "0.56074125", "text": "def readFileTranslator(fileName)\n lines = []\n\n #new read only file object with the filename passed above\n inFile = File.new(fileName, \"r\")\n\n while (line = inFile.gets)\n #removing comments and empty lines\n if line[0] != \"/\" and line[1] != \"/\" and line != \"\\n\"\n lines << line\n end\n end\n\n inFile.close\n\n #returns an array each element is a string of a line of the file\n return lines\n\nend", "title": "" }, { "docid": "5840cf9bf3d3dd245d7e092857f6c10b", "score": "0.56055087", "text": "def code\n @code ||= File.read(path_texte)\n end", "title": "" }, { "docid": "e9a10fbaafce740790e555079b2883e9", "score": "0.55957985", "text": "def get_examplefile_name(whichone)\r\n path = File.dirname(__FILE__) + \"/../w_data/\"\r\n fname = File.join(path, 'format_' + whichone + '.txt')\r\nend", "title": "" }, { "docid": "74a75ecd15591d48bb8320348506bff9", "score": "0.5589524", "text": "def translate(file)\n [file]\n end", "title": "" }, { "docid": "1c02c568a50c9a9044980b26b793dff0", "score": "0.5586684", "text": "def pleaseReadFile(pathToFile)\n contentFile = ''\n\n File.open(pathToFile, 'r:ascii-8bit') do |file|\n file.each_line do |line|\n contentFile += line\n end\n end\n\n return contentFile\nend", "title": "" }, { "docid": "0800dac3bbd040b9ab09280eef5d96ef", "score": "0.558463", "text": "def monta_header_arquivo\n header_arquivo = '' # Descrição Posição Tamanho\n header_arquivo << cod_banco # Código do Banco na Compensação [1.. ...3] 03\n header_arquivo << '0000' # Lote de Serviço [4.. ...7] 04\n header_arquivo << '0' # Tipo de Registro [8.. ...8] 01\n header_arquivo << ''.rjust(9, ' ') # Uso Exclusivo FEBRABAN / CNAB [9.....17] 09\n header_arquivo << Brcobranca::Util::Empresa.new(documento_cedente, false).tipo # Tipo de Inscrição da Empresa [18....18] 01\n header_arquivo << documento_cedente.to_s.rjust(14, '0') # Número de Inscrição da Empresa [19....32] 14\n header_arquivo << codigo_convenio # Código do Convênio no Banco [33....52] 20\n header_arquivo << agencia.rjust(5, '0') # Agência Mantenedora da Conta [53....57] 05\n header_arquivo << digito_agencia # Dígito Verificador da Agência [58....58] 01\n header_arquivo << conta_corrente.ljust(12, ' ') # Número da Conta Corrente [59....70] 12\n header_arquivo << digito_conta # Dígito Verificador da Conta [71....71] 01\n header_arquivo << ' ' # Dígito Verificador da AG/Conta [72....72] 01\n header_arquivo << empresa_mae.format_size(30) # Nome da Empresa [73...102] 30\n header_arquivo << nome_banco.format_size(30) # Nome do Banco [103..132] 30\n header_arquivo << ''.rjust(10, ' ') # Uso Exclusivo FEBRABAN / CNAB [133..142] 10\n header_arquivo << '1' # Código Remessa / Retorno [143..143] 01\n header_arquivo << data_geracao # Data de Geração do Arquivo [144..151] 08\n header_arquivo << hora_geracao # Hora de Geração do Arquivo [152..157] 06\n header_arquivo << sequencial_remessa.to_s.rjust(6, '0') # Número Seqüencial do Arquivo [158..163] 06\n header_arquivo << versao_layout_arquivo # No da Versão do Layout do Arquivo [164..166] 03\n header_arquivo << densidade_gravacao # Densidade de Gravação do Arquivo [167..171] 05\n header_arquivo << ''.rjust(20, ' ') # Para Uso Reservado do Banco [172..191] 20\n header_arquivo << ''.rjust(20, ' ') # Para Uso Reservado da Empresa [192..211] 20\n header_arquivo << ''.rjust(11, ' ') # Uso Exclusivo FEBRABAN / CNAB [212..222] 11\n header_arquivo << 'CSP' # Identificação da Cobrança sem Papel [223..225] 03\n header_arquivo << '000' # Uso Exclusivo da VANs [226..228] 03\n header_arquivo << ''.rjust(2, ' ') # Tipo de Serviço Cobrança sem Papel [229..230] 02\n header_arquivo << ''.rjust(10, ' ') # Cód. Ocor. Cobrança sem Papel [231..240] 10\n header_arquivo\n end", "title": "" }, { "docid": "bc7bbc2546af4afbbbfbc165a3f8f186", "score": "0.5580439", "text": "def strings_to_lines_textualed\n strings = File.read(file_name)\n\tnew = strings.to_textual\n end", "title": "" }, { "docid": "e2e079f3cfd7132ac18ac6669e9bb5ff", "score": "0.5579667", "text": "def dados_do_arquivo\n\t\t\t\t\treturn if self.invalid?\n\n\t\t\t\t\t# contador dos registros do lote\n\t\t\t\t\tcontador = 1\n\n\t\t\t\t\t# Metodo 'monta_header_arquivo' implementado no module -> BrBoleto::Remessa::Cnab240::Helper::HeaderArquivo\n\t\t\t\t\tarquivo = [monta_header_arquivo] \n\t\t\t\t\tcontador += 1\n\n\t\t\t\t\tlotes.each_with_index do |lote, index|\n\t\t\t\t\t\tnovo_lote = monta_lote(lote, (index + 1))\n\t\t\t\t\t\tarquivo.push novo_lote\n\t\t\t\t\t\tnovo_lote.each { |_lote| contador += 1 }\n\t\t\t\t\tend\n\n\t\t\t\t\t# Metodo 'monta_trailer_arquivo' implementado no module -> BrBoleto::Remessa::Cnab240::Helper::TrailerArquivo\n\t\t\t\t\tarquivo << monta_trailer_arquivo(lotes.count, contador)\n\n\t\t\t\t\tretorno = ActiveSupport::Inflector.transliterate(arquivo.join(\"\\n\")).to_ascii.upcase\n\t\t\t\t\tretorno << \"\\n\"\n\t\t\t\t\tretorno.encode(retorno.encoding, :universal_newline => true).encode(retorno.encoding, :crlf_newline => true)\n\t\t\t\tend", "title": "" }, { "docid": "d6c9456ab97339ba6d26e0d659e8cff8", "score": "0.5577594", "text": "def convert_create_test_file (filename)\n File.open(filename, \"w\") do |f|\n f.puts \"Mrs. Theresa E. Stamm\\t1-678-523-6736\\tReinger\\tkieran@runte.biz\"\n f.puts \"Keara Maggio\\t1-399-471-4388 x9581\\t@weber\\tcayla@lubowitz.com\"\n f.puts \"Daren S. Padberg DVM\\t240-399-5583 x73790\\tHessel\\taugusta@stoltenberg.com\"\n f.puts \"Claud Auer\\t(561)024-9548 x165\\t@Mraz\\tjettie_friesen@weber.com\"\n f.puts \"Mrs. Sam Parisian\\t818-657-9309 x5633\\t@Quigley\\tlavon.quitzon@schinnercain.biz\"\n f.puts \"Ciara X. Windler II\\t575-225-1469 x240\\tLabadie\\tryan_moore@hagenesmiller.com\"\n f.puts \"Davion G. Streich\\t333-783-4674 x18711\\tSchneider\\tole.bashirian@murazikmonahan.org\"\n end\nend", "title": "" }, { "docid": "c8b00ac185946caf07225988c808954f", "score": "0.5573856", "text": "def file_name\n file_name = (\"../../Desktop/tmp/turkish-earthlings/turkish-earthlings-in.txt\")\n #file_name = (\"./tmp/database_doings/doing_lenses/lenses_sorted.txt\")\n #file_name = (\"../../Desktop/tmp/turkish-earthlings/turkish-earthlings-sequence_textual-out.txt\")\n end", "title": "" }, { "docid": "d7ce165d49527220284998d0070f286c", "score": "0.5565416", "text": "def LoadFile ()\n\t\n\tinput = \"\"\n\tFile.foreach(\"../Data Files/022-Names.txt\") {|x| input = x }\n\tnames = input.split(\",\")\n\t\n\treturn names;\nend", "title": "" }, { "docid": "3841361d053abe0f270730fdaf227965", "score": "0.55556065", "text": "def contenu_fichier( nom_fichier )\n IO.readlines(nom_fichier).map(&:chomp)\nend", "title": "" }, { "docid": "a4c599a2b15a2aba7e1cfb879c39b246", "score": "0.5551279", "text": "def file_name\n file_name = (\"./tmp/database_doings/doing_research/insert_research_lines-03.txt\")\n #file_name = (\"../../Documents/20110731-research.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready-015.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready_hash-015.txt\")\n #file_name = (\"../consummates/lib/databasers/mysql_database_safe_lines/mysql_database_ready_hashlines-015.txt\")\n end", "title": "" }, { "docid": "583410baf06548a0d844e63b3eba5b8d", "score": "0.5539547", "text": "def convert_value_to_text file, crow\n if @short\n file\n else\n if crow == @_header_row_index\n return file\n else\n # OUCH i don't know if its a header !!\n fullname = File.join(@current_path, file)\n fname = file\n stat = File::Stat.new fullname\n time = stat.mtime.to_s[0..18]\n attr = stat.directory? ? \"d\" : \"-\"\n attr << (stat.writable? ? \"w\" : \"-\")\n attr << (stat.readable? ? \"r\" : \"-\")\n attr << (stat.executable? ? \"x\" : \"-\")\n fname << \"/\" if stat.directory? && fname[-1] != \"/\"\n value = \" %s %8d %s %s\" % [attr, stat.size, time, fname]\n return value\n end\n end\n end", "title": "" }, { "docid": "a7d1c2e9187365d9735172702c354f2f", "score": "0.55346143", "text": "def read_data(file_name)\r\n\r\n\r\n file = File.open(file_name,\"r\")\r\n\r\n\r\n object = eval(file.gets.untaint.encode('UTF-8', :invalid => :replace))\r\n\r\n\r\n file.close()\r\n\r\n\r\n return object\r\n\r\n\r\nend", "title": "" }, { "docid": "60d27f1b27f669b5121b2815870fdc1a", "score": "0.5515623", "text": "def filecoding(line,fn)\n case line\n when /^START-OF-LOG:\\s+[vV]?[23](\\.[0-9])?/i \n :Cabrillo\n when Regexp.new('^\\xef\\xbb\\xbfSTART-OF-LOG:\\s+[vV]?[23](\\.[0-9])?',Regexp::IGNORECASE,'n')\n # some versions of N3FJP add 3 >128 characters to the first line... otherwise the file seems fine\n line.sub!(/.../,'')\n :Cabrillo\n when /<(eoh|eor)>/mi \n :ADIF\n when /^ADIF/i\n :ADIF\n when /^<[^:]+:\\d+>/\n :ADIF\n when /^<\\?xml.*\\r?\\n\\s*<ADX>/mi\n :ADX\n when /^%PDF/\n :PDF\n when /^\\{\\\\rtf/\n :RTF\n when /^QSO:/i\n :CabrilloQSOonly\n when /^\\[REG1TEST;1\\]/\n # Region 1 Contest: IARU for > 30MHz\n # http://vkvzavody.moravany.com/EDI.TXT\n :REG1TEST\n when /^\\d{1,2}\\/\\d{1,2}\\/\\d{1,2}\\s+/\n :RawLogDateFirst\n \n \n # careful Office 2007 files seem to be ZIP archives that hold Open XML files\n # All Office 2007 \"x\" format files have the following pattern\n #\n # from IRB after IO.binread\n # PK\\x03\\x04\\x14\\x00\\b\\b\\b\\x00!z\\x96D\n #\n # And OpenDocument Format can also be in an archive\n # need to do research to know the files that are indicative \n # of ODF\n #\n # from IRB after IO.binread\n # PK\\x03\\x04\\x14\\x00\\x00\\b\\x00\\x00/z\\x96D\\x85l9\\x8A.\\x00\\x00\n #\n # Ruby 1.9.3 has issue with \\b aka \\x08\n \n when Regexp.new('^PK\\x03\\x04\\x14\\x00\\x00\\x08',nil,'n')\n :ODS\n when Regexp.new('^PK\\x03\\x04\\x14\\x00\\x08\\x08',nil,'n')\n :EXCEL\n \n when /^PK/\n :ZIP\n \n when Regexp.new('^(\\x00{4}\\x01)',nil,'n') \n # By AE6Y\n :CQPWIN\n when /^\\x00{6} {10}/ && /^.{20}CQPIN/\n # this test is hacked ... if you add %% /^.{20}CQPIN to CQPWIN test then this test is never found\n :CQPDOS\n \n # Generic MS-Office file Multi-Stream Object Header D0 CF 11 E0 A1 B1 1A E1\n when Regexp.new('^\\xd0\\xcf\\x11\\xe0\\xa1\\xb1\\x1a\\xe1\\x00',nil,'n')\n :EXCEL\n #when /^\\s*(#{@de}|#{@me}|#{@be}\\s+){1,3}/\n # @ftype=\"ASCII log\"\n when Regexp.new('^\\x1B\\x43\\x00\\f',nil,'n')\n # ESC C NUL FF <- EPSON printer code to set page length\n :PrinterCode\n when /^[A-Z0-9 .-:\\/]*,[A-Z0-9 .-:\\/]*,[A-Z0-9 .-:\\/]*,[A-Z0-9 .-:\\/]*/i\n :CSV\n when /^[ -~\\n\\t\\r\\f]+$/ #catchall test for ASCII file This must be last one checked\n :ASCII\n when Regexp.new('^\\x52\\x61\\x72\\x21\\x1A',nil,'n')\n # Rar! \n # RAR Archive\n :RAR\n when Regexp.new('^\\x1F\\x8b\\x08',nil,'n')\n # GZIP file\n :GZIP\n when Regexp.new('^..\\x00\\x00\\x47\\x5A\\x49\\x50',nil,'n')\n # ....GZIP\n # GZIP compressed archive\n :GZA\n when /^\\?xml\\s+/\n # General XML file (ADIF 3.0 looks like this)\n :XML\n else \n #\n # If we get here then it's some binary file that we do not know about\n #\n #print fn, ':',@data[0].unpack(\"AAAAAAAAAAA\"),\" Hex:\",@data[0].unpack(\"H2 H2 H2 H2 H2 H2 H2 H2 H2\"),\"\\n\"\n :binary\n end\n end", "title": "" }, { "docid": "06262bf016b1408619fd52f13bdfc3d8", "score": "0.54991174", "text": "def load_input file_path\n if File.exist?(file_path)\n if File.extname(file_path) != \".txt\"\n return \"This file looks like a non txt file, use a '.txt' file\"\n end\n file = File.open(file_path, \"r\")\n data = file.map { |command| command.split(\"\\n\").first.split(' ') }\n file.close\n return \"Oops! Empty file it seems.\" if data.flatten.empty?\n return data\n else\n return \"No such file present, kindly check the path\"\n end\nend", "title": "" }, { "docid": "48e38a9fa454d2ace3aab4e6ecdf7a39", "score": "0.54982346", "text": "def construir_header_arquivo\n header_file = '' # Descrição Posição Tamanho\n header_file << codigo_banco # Código do Banco 001..003 9(003)\n header_file << bloco_zerado(4) # Lote de Serviço 004..007 9(004)\n header_file << '0' # Tipo de Registro 008..008 9(001)\n header_file << bloco_zerado(9) # Filler 009..017 X(009)\n header_file << kind_profile(document_payer) # Tipo de Inscrição da Empresa 018..018 9(001)\n header_file << formata_documento(document_payer, 14) # Número Inscrição da Empresa 019..032 9(014)\n header_file << campo_texto(contract_number, 20) # Código do Convenio no Banco 033..052 X(020)\n header_file << campo_numerico(agency, 5) # Agência Mantenedora da Conta 053..057 9(005)\n header_file << campo_texto(agency_cd, 1) # Dígito Verificador da Agência 058..058 X(001)\n header_file << campo_numerico(account, 12) # Número da Conta Corrente 059..070 9(012)\n header_file << campo_texto(account_cd, 1) # Dígito Verificador da Conta 071..071 X(001)\n header_file << campo_texto(check_digit, 1) # Dígito Verificador da Agência / Conta 072..072 X(001)\n header_file << campo_texto(company_payer, 30) # Nome da Empresa 073..102 X(030)\n header_file << nome_banco # Nome do Banco 103..132 X(030)\n header_file << bloco_zerado(10) # Filler 133..142 X(010)\n header_file << kind_file # Código Remessa / Retorno 143..143 9(001)\n header_file << formatar_datahora(date_file(timestamp), :date_long) # Data da Geração do Arquivo 144..151 9(008)\n header_file << formatar_datahora(time_file(timestamp), :time_long) # Hora da Geração do Arquivo 152..157 9(006)\n header_file << campo_numerico(number_sequential, 6) # Número Seqüencial do Arquivo 158..163 9(006)\n header_file << versao_layout # Número da Versão do Layout 164..166 9(003)\n header_file << bloco_zerado(5) # Densidade de Gravação Arquivo 167..171 9(005)\n header_file << bloco_zerado(20) # Uso Reservado do Banco 172..191 X(020)\n header_file << bloco_zerado(20) # Uso Reservado da Empresa 192..211 X(020)\n header_file << bloco_zerado(19) # Filler 212..230 X(019)\n header_file << campo_texto(occurrence, 10) # Ocorrências para o Retorno 231..240 X(010)\n clear_line(header_file)\n end", "title": "" }, { "docid": "02eec941817ecdf306a5d10aa9359a35", "score": "0.54977906", "text": "def read_file(alphabet, read_file, split_string, direction, write_file)\n line = \"\"\n\n # open test file to translate\n words_file = File.open(read_file)\n\n # loop through file, capitalize and add text to string\n while ! words_file.eof?\n line += words_file.gets.chomp.upcase\n end\n\n # populate array by splitting all characters in string\n data_array = line.split(split_string)\n\n # close text file\n words_file.close\n\n # invoke translate method for translation\n translated_text = translate(alphabet, data_array, direction)\n\n # invoke write method to write out to flat file\n write_file(write_file, translated_text)\n\n return translated_text # string returned for printing to screen\nend", "title": "" }, { "docid": "4f24dea336fb22569f0e543e43d94fe1", "score": "0.54929024", "text": "def carga_archivos\n archivo1=Objeto.new(\"hola.txt\",666,true)\n archivo1.contenido=\"Soy el archivo 1\\n\"\n @archivos.push(archivo1)\n archivo2=Objeto.new(\"sistemasoperativo.txt\",2048,false)\n archivo2.contenido=\"Soy el archivo sistemasoperativos.txt\\n\"\n @archivos.push(archivo2)\n archivo3=Objeto.new(\"multilinea.lst\",1111,true)\n archivo3.contenido=\"Linea 1\\nLinea 2\\nLinea3\\n\"\n @archivos.push(archivo3)\n end", "title": "" }, { "docid": "4d4f671a4921c9532172d8c9306d5524", "score": "0.5491795", "text": "def test_set_description_file\n FilePath.new(@testrun_directory, \"test-set-description.txt\")\n end", "title": "" }, { "docid": "8082def06881edba4ff82062eaec34fb", "score": "0.5489957", "text": "def replaceStringsInFile(filename)\n text = File.read(filename)\n text = text.gsub(/GROUPID/, @groupId)\n text = text.gsub(/PROJECTNAME/, @projectName)\n text = text.gsub(/SERVICENAME/, @serviceName)\n text = text.gsub(/PACKAGENAME/, @serviceName)\n text = text.gsub(/PROJECTVERSION/, @version)\n text = text.gsub(/JDKVERSION/, @jdkVersion)\n File.open(filename, \"w\") { |file| file << text }\n end", "title": "" }, { "docid": "aa9404d4e52331312444b5e4521972c9", "score": "0.54877496", "text": "def archivo_local\n\n if file.is_a? ActionDispatch::Http::UploadedFile\n uploaded_io = file\n uploaded_io.original_filename= uploaded_io.original_filename.gsub(/[^0-9a-zA-z.]/, '')\n\n name_file = (Digest::MD5.hexdigest(name+uploaded_io.original_filename) + uploaded_io.original_filename).gsub(/[^0-9a-zA-Z.]/, '')\n\n #relativo a Rails.root\n short_file = File.join('public', 'resources', type_file, name_file)\n path_file = Rails.root.join('public', 'resources', type_file, name_file)\n\n FileUtils.cp uploaded_io.tempfile, path_file\n\n\n self.file = short_file\n\n end\n end", "title": "" }, { "docid": "104563df39af7499a17482bad7b43ca4", "score": "0.54856384", "text": "def path_fichier_brin_de perso_id\n File.join(@dosext, \"full_brin_#{perso_id}.html\")\n end", "title": "" }, { "docid": "b72041bf750af376263d211a1ad42f8e", "score": "0.5480043", "text": "def file_name\n @file_name = (\"./lib/anagrams/anagrams_table_data.txt\")\n## @file_name = (\"./lib/externals/externals_table_data_input_hash.txt\")\n##\t@file_name = (\"./lib/20100511-test-two.txt\")\n##\t@file_name = (\"./lib/databasers/20100903-researches.txt\")\n##\t@file_name = (\"./lib/databasers/database_ready.txt\")\n##\t@file_name = (\"./lib/databasers/database_sort.txt\")\n## @file_name = (\"./lib/databasers/database_ready-one.txt\")\n##\t@file_name = (\"./lib/databasers/database_ready_one.txt\")\n## @file_name = (\"./lib/databasers/database_ready_one_temp.txt\")\n##\t@file_name = (\"./lib/databasers/database_ready-zero.txt\")\n##\t@file_name = (\"./lib/databasers/database_ready-three.txt\")\n##\t@file_name = (\"./lib/databasers/database_ready-four.txt\")\n##\t@file_name = (\"./lib/databasers/database_ready-five.txt\")\n##\t@file_name = (\"./lib/databasers/database_ready-six.txt\")\n##\t@file_name = (\"./lib/databasers/database_ready-seven.txt\")\n## @file_name = (\"./lib/databasers/fibered_files_output.txt\")\n##\t@file_name = (\"./lib/databasers/fibering_files_output.txt\")\n##\t@file_name = (\"../../Documents/20100814-sort.txt\")\n end", "title": "" }, { "docid": "b69e76261572c2431035f1ce33310991", "score": "0.5478623", "text": "def write_clues_to_txt(puz_filenames, txt_filename)\n clues = []\n i_clue = 0\n puz_filenames.each do |puz_filename|\n puz_date = Date.strptime(File.basename(puz_filename)[0..-5], '%b%d%y')\n ac = Acrosslite.new(:filepath => puz_filename)\n (ac.down + ac.across).each do |x|\n clues << {:i => i_clue, :clue => x.clue, :answer => x.answer, :length => x.length, \n :day_of_week => puz_date.wday, :year => puz_date.year, :fname => puz_filename}\n i_clue = i_clue + 1\n end\n end\n\n File.open(txt_filename, \"w\") do |f|\n clues.each{ |clue| f.puts clue.values.join(\"\\t\") }\n end\n return true\nend", "title": "" }, { "docid": "ed2802a8ab77c780e867162f3799bfca", "score": "0.5469318", "text": "def build_txt_file\n # `textutil -format rtf -convert txt -stdout \"#{path}\"`\n `textutil -format rtf -convert txt -stdout \"#{path}\" >> \"#{txt_file_path}\"`\n return true\nrescue Exception => e\n erreur(e)\n return false\nend", "title": "" }, { "docid": "12a005a2cae81f70e71b817cb646474d", "score": "0.5469239", "text": "def deco_file; end", "title": "" }, { "docid": "e876df340c6f8571d7b23aa2ffa074e9", "score": "0.54658896", "text": "def load_file(path); end", "title": "" }, { "docid": "e876df340c6f8571d7b23aa2ffa074e9", "score": "0.54658896", "text": "def load_file(path); end", "title": "" }, { "docid": "465a26df58d2b9ac3e9209a34b46b0c8", "score": "0.54653716", "text": "def insert_strings_from_file(file_path)\n file = File.new(file_path, \"r\")\n while (line = file.gets)\n self << line.chomp if line != \"\"\n end\n file.close\n return self\n end", "title": "" }, { "docid": "7cdaf799d14d258bccd612e0c35e88d8", "score": "0.54634243", "text": "def add_details_from_file(file2)\n # binding.pry\n #file2 = {bio: ..., supername: ..., realname: ..., gender:..., aliases:..., powers: ...}\n file2.each {|key, value| self.send(\"#{key}=\", \"#{value}\")}\n end", "title": "" }, { "docid": "55d1fae11e72fa8e3070420299003db2", "score": "0.5460109", "text": "def load_file\n @text = File.open('TodoList.txt', 'r') if File.exist?('TodoList.txt')\n @temp = []\n @text.each_line { |line| @temp.push(line) }\n end", "title": "" }, { "docid": "10a369cf5543b0f2f53ea4215cecc352", "score": "0.5457779", "text": "def read_original_file(file)\n open(File.expand_path(file), 'r'){ |f|\n f.each do |l|\n ary = l.chomp.split(\"\\t\")\n # 1998--- などに対応するためスキップ\n next if ary[1].include?(\"---\")\n\n year = ary[1].split(\"-\").join(\"\").to_i\n next if year < @lim\n @data[year].push ary[2..-1]\n end\n }\n\n @files.push File.basename(file)\n @save_path = File.dirname(File.expand_path(file))\n end", "title": "" }, { "docid": "abb21828f3c97cbd860d73bfe1caf788", "score": "0.5454097", "text": "def filepath; end", "title": "" }, { "docid": "6bc88e10d0db7adba0866cc6b3e5d0b7", "score": "0.5448735", "text": "def getText(file)\n \n base = File.expand_path(File.dirname(__FILE__))\n\n dest = File.join(base, file)\n\n return fileToString(dest) \nend", "title": "" } ]
2f8f610a37661c557affa9a32aeb5439
method to get a split view
[ { "docid": "d0bbfe85613f6238136f7e3dd562e583", "score": "0.0", "text": "def split(split_name)\n @localhost_mode_features.find { |x| x[:feature] == split_name }\n end", "title": "" } ]
[ { "docid": "faa62838841f69e0a0f02bcbc1fc413a", "score": "0.7230927", "text": "def splitView splitView, constrainMaxCoordinate:proposed_max, ofSubviewAt:divider_index\n\t\t300.0\n\tend", "title": "" }, { "docid": "06051f319bef71ce279aedeed5b84345", "score": "0.7062316", "text": "def splitView(aSplitView, shouldAdjustSizeOfSubview:subview)\n subview.className != \"FBSidePanelView\"\n end", "title": "" }, { "docid": "959cb023a45b4109241ab6246fa71c2f", "score": "0.6775383", "text": "def splitView(aSplitView, constrainMaxCoordinate:proposedMax, ofSubviewAt:dividerIndex)\n dividerIndex == 0 ? 350 : proposedMax\n end", "title": "" }, { "docid": "e551c8ab54875bad8eb9025d089be491", "score": "0.65764815", "text": "def splitView(aSplitView, constrainMinCoordinate:proposedMin, ofSubviewAt:dividerIndex)\n dividerIndex == 0 ? 150 : proposedMin\n end", "title": "" }, { "docid": "4934051eecb9adcf7675dc5748e81504", "score": "0.62373734", "text": "def splitView(splitView, drawDividerInRect:dividerRectValue)\n\t\tsplitViewDividerColor.setFill\n\t\tNSRectFill(dividerRectValue.rectValue)\n\tend", "title": "" }, { "docid": "940a9c208034f5b06f2480c676292fc4", "score": "0.62006795", "text": "def splitView(sender, resizeSubviewsWithOldSize:oldSize)\n if sender == @masterSplitView\n right = @masterSplitView.subviews.last\n rightFrame = right.frame\n rightFrame.size.width += @masterSplitView.frame.size.width - oldSize.width\n right.frame = rightFrame\n @masterSplitView.adjustSubviews\n else\n @contentSplitView.adjustSubviews\n end\n end", "title": "" }, { "docid": "70b357ec60d57c6ec1212515ce7fe78f", "score": "0.60923725", "text": "def splits\n return [] if !@config.valid_mode || @splits_repository.nil?\n\n if !ready?\n @config.logger.error(\"splits: the SDK is not ready, the operation cannot be executed\")\n return []\n end\n\n @splits_repository.splits.each_with_object([]) do |(name, split), memo|\n split_view = build_split_view(name, split)\n\n next if split_view[:name] == nil\n\n memo << split_view unless Engine::Models::Split.archived?(split)\n end\n end", "title": "" }, { "docid": "7f7508369b529d495f1bd335201de2fe", "score": "0.5869759", "text": "def splitViewController(svc, willChangeToDisplayMode: display_mode)\n vc = svc.viewControllers.first\n vc = vc.topViewController if vc.respond_to?(:topViewController)\n case display_mode\n # when UISplitViewControllerDisplayModeAutomatic then do_something?\n when UISplitViewControllerDisplayModePrimaryHidden\n self.splitViewController(svc, willHideViewController: vc, withBarButtonItem: nil, forPopoverController: nil)\n # TODO: Add `self.master_screen.try(:will_hide_split_screen)` or similar?\n when UISplitViewControllerDisplayModeAllVisible\n self.splitViewController(svc, willShowViewController: vc, invalidatingBarButtonItem: nil)\n # TODO: Add `self.master_screen.try(:will_show_split_screen)` or similar?\n # when UISplitViewControllerDisplayModePrimaryOverlay\n # TODO: Add `self.master_screen.try(:will_show_split_screen_overlay)` or similar?\n end\n end", "title": "" }, { "docid": "11d433b31c6fae9775d3ee9661f07c19", "score": "0.57465154", "text": "def split_h win\n h = win.height\n w = win.width\n off = get_offset()\n #lay1 = { :height => h/2-0, :width => w-2, :top => 0, :left => off }\n #lay2 = { :height => h/2-1, :width => w-2, :top => h/2+1, :left => 1 }\n lay1 = { :height => h/2-0, :width => w-2, :top => off, :left => off }\n lay2 = { :height => h/2-1, :width => w-2, :top => h/2+1, :left => off }\n split1 = win._subwin(lay1)\n split2 = win._subwin(lay2)\n win.mvwhline( h/2, 0, ACS_HLINE, w+2)\n\n if @draw_boxes\n split1.box(0,0)\n split2.box(0,0)\n end\n # if a window is split, then tab doesn't go there, it goes to its two subwins\n @focusables.delete win\n @wins << split1\n @wins << split2\n @focusables << split1 << split2\n spl = Split.new :HORIZONTAL, split1, split2, win\n spl.divider_location(h/2,0)\n @splits[split1] = spl\n @splits[split2] = spl\n @children[win] = [ split1, split2 ]\n #return split1, split2\n return spl\n end", "title": "" }, { "docid": "a06aa6583a60ea81c7da0daec09bb66d", "score": "0.5654331", "text": "def mainSplitViewWillResizeSubviewsHandler(object)\n @lastSplitViewSubViewLeftWidth = @left_view.frame.size.width\n end", "title": "" }, { "docid": "1b180ea0e7b321696383c46b91d72d93", "score": "0.56462336", "text": "def index\n @splittings = Splitting.all\n end", "title": "" }, { "docid": "9ad77d9e4c01a7973f5a5cf98a94f569", "score": "0.56448483", "text": "def new_view b\n template(:new_view).result(b)\n end", "title": "" }, { "docid": "d02ea3686eb7a90f57a0b6e7f28bc22f", "score": "0.5571388", "text": "def index\n @splits = Split.all\n end", "title": "" }, { "docid": "d02ea3686eb7a90f57a0b6e7f28bc22f", "score": "0.5571388", "text": "def index\n @splits = Split.all\n end", "title": "" }, { "docid": "fc0c3daecb5e7cba89186112a19158c7", "score": "0.5568506", "text": "def partial_view\n end", "title": "" }, { "docid": "c985709147443588acb989e17d05564e", "score": "0.55523425", "text": "def split_mode\n end", "title": "" }, { "docid": "58a146191055a2714309fda6dbf8c1f1", "score": "0.553823", "text": "def sidebar_split\n\t\tsidebar_section_end + sidebar_section_start\n\tend", "title": "" }, { "docid": "88c863eb07bf8a8f254599552e25eeed", "score": "0.55376357", "text": "def pane; end", "title": "" }, { "docid": "88c863eb07bf8a8f254599552e25eeed", "score": "0.55376357", "text": "def pane; end", "title": "" }, { "docid": "6802414ceab75f739bc981fe99a29ec5", "score": "0.55280715", "text": "def view\n return @view\n end", "title": "" }, { "docid": "47e38b91085eb514fa640c66020b953f", "score": "0.55094427", "text": "def view_instance\n view = ActionView::Base.new(controller.class.view_paths, {}, controller)\n view.extend master_helper_module\n end", "title": "" }, { "docid": "e52261c20f4deb4095d1e2079f750a4b", "score": "0.54898685", "text": "def part(view)\n CoffeeShop::Template.load(\"parts/#{view}\", binding)\n end", "title": "" }, { "docid": "4fea4451a2dea26a6aaa9ead5ba67637", "score": "0.5473829", "text": "def top_view(root)\nend", "title": "" }, { "docid": "3c334742b99c8243e1c4b51c53d43e1e", "score": "0.54580724", "text": "def view_module route\n # return view module for the route\n end", "title": "" }, { "docid": "29990a4214ec5a1bb28aa47678fb5d32", "score": "0.5453571", "text": "def Button_GetSplitInfo(hwnd, pInfo) send_button_control_message(hwnd, :GETSPLITINFO, lparam: pInfo) end", "title": "" }, { "docid": "36d627858fafa0c65b24a3a8eed89e0f", "score": "0.53718764", "text": "def get\n visual_top.method(:page_view)\n end", "title": "" }, { "docid": "7906a048867d40fb40192d5499f8a2ea", "score": "0.53615236", "text": "def splitViewController(svc, willHideViewController:vc, withBarButtonItem:barButtonItem, forPopoverController:pc)\n @masterViewController = vc\n # We ignore withBarButtonItem and forPopoverController to better control the display\n navigationItem.leftBarButtonItem = @button \n end", "title": "" }, { "docid": "4a5e739ec07e779f2a7001b8b7e9e42a", "score": "0.5357325", "text": "def split(instance)\n end", "title": "" }, { "docid": "3973ee9e8a9a9aca78df9e8bdb022058", "score": "0.5352626", "text": "def subfolderViews\n folders.collect { |folder| folder.open? ? folder.subfolderView : NilArray }\n end", "title": "" }, { "docid": "4148de8deb2ebac96af1ed5a32315813", "score": "0.53305835", "text": "def view_helper\n ViewHelper.instance\n end", "title": "" }, { "docid": "f06616ea61b2b4812dd09649e7d2cebe", "score": "0.5329941", "text": "def splitViewController(svc, willHideViewController: vc, withBarButtonItem: button, forPopoverController: _)\n button ||= self.displayModeButtonItem if self.respond_to?(:displayModeButtonItem)\n return unless button\n button.title = @pm_split_screen_button_title || vc.title\n svc.detail_screen.navigationItem.leftBarButtonItem = button\n end", "title": "" }, { "docid": "2ffdb72a40dc5547310c47057a5b1494", "score": "0.53172594", "text": "def view_instance\n @view_instance ||= Factory.view_instance\n end", "title": "" }, { "docid": "48e1b14e2f8a6771fcc32f25832a8881", "score": "0.53113955", "text": "def superview\n @superview\n end", "title": "" }, { "docid": "f812b7d5461d938781193067f27555e9", "score": "0.52915055", "text": "def view\n @_visual_child.view\n end", "title": "" }, { "docid": "63786263f3a33ef76656d677a303a5de", "score": "0.5280376", "text": "def split_panes(*args)\n # Call freeze panes but add the type flag for split panes.\n freeze_panes(args[0], args[1], args[2], args[3], 2)\n end", "title": "" }, { "docid": "63786263f3a33ef76656d677a303a5de", "score": "0.5280376", "text": "def split_panes(*args)\n # Call freeze panes but add the type flag for split panes.\n freeze_panes(args[0], args[1], args[2], args[3], 2)\n end", "title": "" }, { "docid": "cd01f9a0eafa236e1847dbb666b5f11c", "score": "0.52696234", "text": "def view_helper\n Helper.instance\n end", "title": "" }, { "docid": "c91c0ac504f3eb75756ec185eef04c02", "score": "0.5264316", "text": "def fringe\n Area.new @id.next, @view\n end", "title": "" }, { "docid": "75a48d122fa9a9db3023d4f79589c5c3", "score": "0.5259256", "text": "def view_first\n return self\n end", "title": "" }, { "docid": "a524157527a615753d934944fc82c1a9", "score": "0.52441835", "text": "def render_split_feature(feature, opt={})\n small_image_panel = content_tag :div,\n class: \"hide-for-medium-up show-for-small small-12 columns\" do\n translate_image_tag(feature, :image, size: :large)\n end\n image_panel = content_tag :div, raw('&nbsp;'),\n class: \"medium-7 hide-for-small columns image-container\",\n style: \"background-image: url(#{feature.image.url});\",\n data: { 'equalizer-watch': \"feature_#{feature.to_param}\" }\n text_panel = content_tag :div, render_feature_text(feature, opt),\n class: \"medium-5 small-12 columns\",\n data: { 'equalizer-watch': \"feature_#{feature.to_param}\" }\n content_tag :div, class: \"row collapse split-feature\", data: { equalizer: \"feature_#{feature.to_param}\" } do\n if feature.content_position.to_s == \"right\"\n small_image_panel + image_panel + text_panel\n else\n small_image_panel + text_panel + image_panel\n end\n end\n end", "title": "" }, { "docid": "9e6d341d12e2c53257101f0b04756519", "score": "0.5240646", "text": "def choose_view\n choice = Prompt.choose_from(views.sort, prompt: 'Choose a view > ', fzf_args: ['--height=60%'])\n choice ? choice.strip : choice\n end", "title": "" }, { "docid": "1df441fa0a8812683c704aea0bcca041", "score": "0.52343607", "text": "def show_view b\n template(:show_view).result(b)\n end", "title": "" }, { "docid": "b567c5a9aa5b30aad5f896ee769124fc", "score": "0.52325463", "text": "def newViewFor(target, parent_window, subclasses_set=subclasses())\n new_for_exact_target(target, parent_window, subclasses_set)\n\t\tend", "title": "" }, { "docid": "17ff2215a14f7c7867abf79e5dfd7546", "score": "0.5230369", "text": "def add_central_widgets(splitter)\n @model_selector = ModelSelector.new\n splitter.add_widget(model_selector)\n\n # Create a central stacked layout\n @display = Qt::WebView.new\n @display.extend WebViewExtension\n @display.metaruby_browser = self\n self.page = Page.new(@model_selector, display.page)\n\n splitter.add_widget(display)\n splitter.set_stretch_factor(1, 2)\n\n model_selector.connect(SIGNAL(\"model_selected(QVariant)\")) do |mod|\n mod = mod.to_ruby\n push_to_history(mod)\n render_model(mod)\n end\n end", "title": "" }, { "docid": "18362da27fb3966ac2a80ac45e32ec42", "score": "0.519253", "text": "def views; end", "title": "" }, { "docid": "18362da27fb3966ac2a80ac45e32ec42", "score": "0.519253", "text": "def views; end", "title": "" }, { "docid": "3d71f5207e7e578120bce3b4e140ca0b", "score": "0.5187227", "text": "def view\n unless is_parent_layout?\n return parent_layout.view\n end\n @view ||= build_view\n end", "title": "" }, { "docid": "5c0e7fec991fee3500913b8850901b97", "score": "0.5186718", "text": "def show\n render layout:\"layouts/twoColumn\"\n end", "title": "" }, { "docid": "311179792c626df3c799976835800531", "score": "0.51804537", "text": "def split(t)\n raise NotImplementedError, \"Implementors of SegmentLike must implement #split\"\n end", "title": "" }, { "docid": "a464ab3dd8a7ab9e0f10409373fcd0db", "score": "0.5177576", "text": "def split_and_select_layout(window_index, pane_title, layout)\n Tmux.split_window(window_index, pane_title).tap do\n Tmux.select_layout(window_index, layout)\n end\n end", "title": "" }, { "docid": "92cdaf096d23d93236110c6ec8c380d1", "score": "0.5174476", "text": "def view_partial\n \"generic_viewer\"\n end", "title": "" }, { "docid": "cae46e65e4d9fb0ab6d6478360fff1c6", "score": "0.5163134", "text": "def split(feature_flag_name)\n return unless @config.valid_mode && @splits_repository && @config.split_validator.valid_split_parameters(feature_flag_name)\n\n if !ready?\n @config.logger.error(\"split: the SDK is not ready, the operation cannot be executed\")\n return\n end\n\n sanitized_feature_flag_name = feature_flag_name.to_s.strip\n\n if feature_flag_name.to_s != sanitized_feature_flag_name\n @config.logger.warn(\"split: feature_flag_name #{feature_flag_name} has extra whitespace, trimming\")\n feature_flag_name = sanitized_feature_flag_name\n end\n\n split = @splits_repository.get_split(feature_flag_name)\n\n if ready? && split.nil?\n @config.logger.warn(\"split: you passed #{feature_flag_name} \" \\\n 'that does not exist in this environment, please double check what feature flags exist in the Split user interface')\n end\n\n return if split.nil? || Engine::Models::Split.archived?(split)\n\n build_split_view(feature_flag_name, split)\n end", "title": "" }, { "docid": "f28c31c2d11292765bdf18e3d4cc2459", "score": "0.5147687", "text": "def tmux_split(along:, percent: 50)\n flag =\n case along.to_sym\n when :| ; \"-h\"\n when :- ; \"-v\"\n end\n cmd = %q( split-window %s -p %d ) % [ flag, percent ]\n\n tmux_run cmd\n end", "title": "" }, { "docid": "f28c31c2d11292765bdf18e3d4cc2459", "score": "0.5147687", "text": "def tmux_split(along:, percent: 50)\n flag =\n case along.to_sym\n when :| ; \"-h\"\n when :- ; \"-v\"\n end\n cmd = %q( split-window %s -p %d ) % [ flag, percent ]\n\n tmux_run cmd\n end", "title": "" }, { "docid": "fc1d31be16e4217a594c2eaa8f84c76b", "score": "0.51396924", "text": "def layouter\n Views::Widget::TournamentSeries\n end", "title": "" }, { "docid": "7a239eff81e500167f47ac30a2860d6f", "score": "0.5138275", "text": "def title(_)\n 'LogicalView'\n end", "title": "" }, { "docid": "71df7933517272b1893cbd8e0068a5a6", "score": "0.51349443", "text": "def set_splitting\n @splitting = Splitting.find(params[:id])\n end", "title": "" }, { "docid": "6ce65b351cc254ca6ea3828fba0bb629", "score": "0.5133503", "text": "def chooseView\n # views = choose(@schemas)[1][:views]\n # choose(views)\n @st.addView[:NAME]\n end", "title": "" }, { "docid": "9a75f75ca22ded1704ad1c2cb4cfd954", "score": "0.5129315", "text": "def split(table_or_region_name, split_point)\n if split_point == nil\n @admin.split(table_or_region_name)\n else\n @admin.split(table_or_region_name, split_point)\n end\n end", "title": "" }, { "docid": "2156888a012f4ecc6a4df0f3bfe2c0f4", "score": "0.51275766", "text": "def choose_layout\n if (action_name == \"new\" || action_name == \"show\") && @run.embedded?\n \"taverna_player/embedded\"\n else\n ApplicationController.new.send(:_layout).virtual_path\n end\n end", "title": "" }, { "docid": "713996e91aba164eef856ba0d17484cf", "score": "0.5121869", "text": "def view\n end", "title": "" }, { "docid": "ed6bf7d101eb17616557182214234e22", "score": "0.51145065", "text": "def current_split\n split_info_for(@current_component).which\n end", "title": "" }, { "docid": "026f83d80a51683fc194d013422684d7", "score": "0.5113087", "text": "def set_split\n @split = Split.find(params[:id])\n end", "title": "" }, { "docid": "026f83d80a51683fc194d013422684d7", "score": "0.5113087", "text": "def set_split\n @split = Split.find(params[:id])\n end", "title": "" }, { "docid": "bff55c723e09bf3758798c435a41eab2", "score": "0.51106125", "text": "def get_current_view\n return @cleartool.invoke(\"lsview -s -cview\").rstrip\n end", "title": "" }, { "docid": "5b0ec72358ec669f0789a5d82a62b383", "score": "0.5107715", "text": "def loc_view\n \n end", "title": "" }, { "docid": "112e32241167fcbf55f0d8318549d1ef", "score": "0.5105787", "text": "def multipage_layout\n return @multipage_layout\n end", "title": "" }, { "docid": "112e32241167fcbf55f0d8318549d1ef", "score": "0.5105787", "text": "def multipage_layout\n return @multipage_layout\n end", "title": "" }, { "docid": "fae607c72be308c84d421d164f501a4f", "score": "0.5102041", "text": "def render_with_layout(view)\n body = ERB.new(File.read(File.join(VIEW_PATH, 'layouts/newrelic_default.rhtml')))\n body.result(Proc.new {}.binding)\n end", "title": "" }, { "docid": "0847769f3bb84459dfe794c09eaf0990", "score": "0.5097367", "text": "def split_leaderboard(n, rs)\n p = rs.index(self)\n\n case p\n when 0\n return rs.slice(0..4)\n when 1\n return rs.slice(0..4)\n else\n if p == n-1\n s = p-4\n e = n \n elsif p == n-2\n s = p-3\n e = n\n else\n s = p - 2\n e = p + 2\n end\n return rs.slice(s..e)\n end\n end", "title": "" }, { "docid": "9aa2510060bb7979eccb095aabe9ecf8", "score": "0.50880975", "text": "def views(&block)\n API::Composition.build(&block)\n end", "title": "" }, { "docid": "59844c9b7b53edd3d8db803bd939fc2b", "score": "0.50876564", "text": "def split(handIndex)\n\t\traise NotImplementedError\n\tend", "title": "" }, { "docid": "fba8c213ff2deb734dd9893276dd27a3", "score": "0.5085222", "text": "def part\n self\n end", "title": "" }, { "docid": "cd08bbfb344ea714491e1e3cc30c87d2", "score": "0.50818264", "text": "def create_view_child\n children << CompGallery.new(:page => self.page,\n :style_class => pol_cfg.comp_gallery_view_style)\n end", "title": "" }, { "docid": "34bdf7ca16d7846eb9494674b4668a83", "score": "0.50809604", "text": "def splitViewController(splitController,\n willHideViewController:viewController,\n withBarButtonItem:barButtonItem,\n forPopoverController:popoverController)\n barButtonItem.title = \"Master\" # NSLocalizedString(\"Master\", \"Master\")\n self.navigationItem.setLeftBarButtonItem(barButtonItem, animated:true)\n @masterPopoverController = popoverController\n end", "title": "" }, { "docid": "74a63bfd550d41654fb51e2c0543037c", "score": "0.50756234", "text": "def _layout; end", "title": "" }, { "docid": "f0223da5d41ad8583d6a4a8a959c08bb", "score": "0.50654125", "text": "def get_view(params)\n return Board_View.new(self, params[:rotate])\n end", "title": "" }, { "docid": "1210fd616025d6afde142d95f685a46c", "score": "0.50531393", "text": "def split\n debug '#split'\n # They may have (and often have) selected more to move...\n add_entries_to_session if params[:split_hierarchy_entry_id]\n if session[:split_hierarchy_entry_id].length > 1\n clear_entries_from_session\n flash[:error] = I18n.t(:classifications_split_one_classification_only)\n else\n @target_params[:confirm] = 'split' # hard-coded string, no need to translate.\n end\n end", "title": "" }, { "docid": "45a67a17e3826a80850f642cf1ff6fc9", "score": "0.5050317", "text": "def modul_a_1\n render layout: 'narrow1'\n end", "title": "" }, { "docid": "175eeb2bd9cb28d580e1f10f53e6d4b3", "score": "0.5049813", "text": "def split\n @player.split(self)\n end", "title": "" }, { "docid": "2954491261ba4a620b47a97188bda562", "score": "0.5046917", "text": "def view_of(klass, x = 0, y = 0, w = nil, h = nil, &block)\n child = klass.new(x, y, w, h, self, &block)\n return add_child(child)\n end", "title": "" }, { "docid": "7f378cfaf2ef0cc2edc4c2c8d0b0a6bc", "score": "0.50366974", "text": "def nth_view(element_id, index)\n element = nth(element_id)\n if element.is_a?(Layout)\n element = element.view\n end\n element\n end", "title": "" }, { "docid": "a0e84a95d5ca26bf7049129815df1b2f", "score": "0.5029664", "text": "def views\n []\n end", "title": "" }, { "docid": "be502a6be999812bc71e577b626bd1e4", "score": "0.5016663", "text": "def controller\n @app ||= TestDelegate.new\n @master = MasterScreen.new(nav_bar: true)\n @detail = DetailScreen.new(nav_bar: true)\n @controller ||= @app.create_split_screen @master, @detail, { button_title: \"Test Title\" }\n end", "title": "" }, { "docid": "c578c3b16b6edf7fe9746aa188a4c3b9", "score": "0.501058", "text": "def view\n definition.view\n end", "title": "" }, { "docid": "38354c0dd0c314483e4c023b64e49f68", "score": "0.50013417", "text": "def view; end", "title": "" }, { "docid": "38354c0dd0c314483e4c023b64e49f68", "score": "0.50013417", "text": "def view; end", "title": "" }, { "docid": "d918bf49841c0f95e5db146a40ae0e78", "score": "0.49993312", "text": "def renderer\n # view = if controller.response.template\n # controller.response.template\n # else\n View.new controller, master_helper_module\n # end\n \n # view.extend Extensions::View\n end", "title": "" }, { "docid": "d5d9a252ed6315e21e77fd4176ff25f1", "score": "0.4993021", "text": "def toggleSidebar(sender)\n\n frame = @left_view.frame\n\n if frame.size.width == 0.0\n @splitView.setPosition(200.0, ofDividerAtIndex:0)\n else\n @splitView.setPosition(0.0, ofDividerAtIndex:0)\n end\n\n end", "title": "" }, { "docid": "84d4e5782bcf9104341d2b87afbffd2e", "score": "0.49921086", "text": "def views_to_switch\n [\n ViewSwitcher.new(:catalog, :search_catalog_url),\n ViewSwitcher.new(:report, :report_url),\n ViewSwitcher.new(:workflow_grid, :report_workflow_grid_url),\n ViewSwitcher.new(:profile, :search_profile_url)\n ]\n end", "title": "" }, { "docid": "11d8e4138565c517732c7b947911f3c5", "score": "0.49914435", "text": "def right_side_view(root)\n result = []\n helper(root, result, 0)\n result\nend", "title": "" }, { "docid": "3e22b8aaa47fb91a5a0d820f6408dfed", "score": "0.4986808", "text": "def view\n end", "title": "" }, { "docid": "26a8b31fc81c287ffd133a134bceaf64", "score": "0.49854425", "text": "def view\n JenkinsPipelineBuilder::View.new(self)\n end", "title": "" }, { "docid": "64de3d399f99632d6da5bc275562a069", "score": "0.4984412", "text": "def view(&block)\n view_set = Stencil::ViewHost::view(DSL::CommandView, &block)\n define_method(:view) do\n return view_set.viewset(self)\n end\n end", "title": "" }, { "docid": "7c2783e17335b619a081a09f80cff68b", "score": "0.4981024", "text": "def sheet_view; end", "title": "" }, { "docid": "ed7c585289855d7da8833792f891298b", "score": "0.4974856", "text": "def index\n get_groups\n\n respond_to do |format|\n format.html { render :layout => 'sufia-one-column' }\n end\n end", "title": "" }, { "docid": "d1085b5156ff0a705cf7ac5a1ebcd0bb", "score": "0.49741364", "text": "def view\n @view ||=begin\n view = View.new\n view.name = scene_name\n view\n end\n end", "title": "" }, { "docid": "6835af809f68c9fde943059d44526e8c", "score": "0.4969565", "text": "def show\n render :layout => \"workspace\"\n end", "title": "" }, { "docid": "7f35dbaefc46a2e5bd4ff62483edef9c", "score": "0.49630383", "text": "def view\n\t\t\n\tend", "title": "" }, { "docid": "7f35dbaefc46a2e5bd4ff62483edef9c", "score": "0.49621934", "text": "def view\n\t\t\n\tend", "title": "" }, { "docid": "2271db0465822f9660f5ae5426d3407f", "score": "0.49599648", "text": "def default_view\n @_visual_child.default_view\n end", "title": "" } ]
3828b6efb2853b685e31a51ea41d337c
`Lynr::Workerqueue_info` Return a String with information about the process where the worker is running and the name of the consumer.
[ { "docid": "a3fda5565d5bc31416aa84ce0adabba7", "score": "0.8086867", "text": "def queue_info\n \"pid=#{Process.pid} queue=#{queue_name}\"\n end", "title": "" } ]
[ { "docid": "f0604fe7882d8ff320795120653f4145", "score": "0.69559497", "text": "def queue_info(queue = nil)\n if queue\n select_hashes('SELECT * FROM pgq.get_queue_info(?)', queue.to_s).first\n else\n select_hashes('SELECT * FROM pgq.get_queue_info()')\n end\n end", "title": "" }, { "docid": "66e4261f672fafe7ac06a565fafa99d8", "score": "0.67815673", "text": "def info\n @queue << \"info\"\n end", "title": "" }, { "docid": "15294d88576ef36e466030933eb7b7b4", "score": "0.64871377", "text": "def consumer_info(queue, consumer = nil)\n if consumer\n select_hashes('SELECT * FROM pgq.get_consumer_info(?, ?)', queue.to_s, consumer.to_s).first\n else\n select_hashes('SELECT * FROM pgq.get_consumer_info(?)', queue.to_s)\n end\n end", "title": "" }, { "docid": "d1e690c700c77905d5726617cea8105e", "score": "0.6472513", "text": "def info\n {\n pending: queues.inject(0) { |m, k| m + size(k) },\n #:processed => Stat[:processed],\n #:queues => queues.size,\n #:workers => workers.size.to_i,\n #:working => working.size,\n #:failed => Stat[:failed],\n servers: [redis_id],\n environment: ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'\n }\n end", "title": "" }, { "docid": "04dc512a957ae4a77dc5af4370ecc8bf", "score": "0.6468833", "text": "def worker_info\n t_connections = middle_man.backend_connections\n result = t_connections.map { |conn| conn.worker_info(compact(:worker => worker_name,:worker_key => worker_key)) }\n return_result(result)\n end", "title": "" }, { "docid": "734ed1561f327e6889f49a9522788768", "score": "0.63671345", "text": "def get_job_info_by_queue queue\n full_queue_name = queue.url.split('/').last\n # full_queue_name is something like queue_name_ENV\n queue_name = /.*_(.*)$/.match(full_queue_name)[1]\n config[:jobs].select{ |k,v| v[:queue_name] == queue_name }.first.last\n end", "title": "" }, { "docid": "ea3787fd6ead92c45fbd3450b6102cbf", "score": "0.6308165", "text": "def queue_name\n task_id\n end", "title": "" }, { "docid": "98b513927a0314cd2adb4b18b1484d55", "score": "0.6287745", "text": "def queue_name\r\n return @queue_name\r\n end", "title": "" }, { "docid": "81f8096b9b24f2230cde10a08cda1ff9", "score": "0.624828", "text": "def queue_name; end", "title": "" }, { "docid": "81f8096b9b24f2230cde10a08cda1ff9", "score": "0.624828", "text": "def queue_name; end", "title": "" }, { "docid": "81f8096b9b24f2230cde10a08cda1ff9", "score": "0.624828", "text": "def queue_name; end", "title": "" }, { "docid": "84c06768670cbc04d37baea5f1d199cc", "score": "0.62353015", "text": "def process_info\n process_id = \"#{pid}:\" if pid\n fname = file_name_and_line\n fname ? \"[#{process_id}#{thread_name} #{fname}]\" : \"[#{process_id}#{thread_name}]\"\n end", "title": "" }, { "docid": "c5d1e468ec9fd1021f7fcd56719faa2a", "score": "0.6189681", "text": "def name\n ['worker', self.class.kname, workerid].flatten.join '-'\n end", "title": "" }, { "docid": "65a15c474fb188169e9d947c6b4894e2", "score": "0.61284614", "text": "def worker_info\n\n (@context.storage.get('variables', 'workers') || {})['workers']\n end", "title": "" }, { "docid": "437ee1a6c348633dfef4e8b329117da8", "score": "0.61283636", "text": "def queue_name\n self.class.queue_name\n end", "title": "" }, { "docid": "5c3ed8b6c2e15141ca813cd9af7f9e40", "score": "0.6118213", "text": "def getCommandQueueInfo(param_name, command_queue: @command_queue, error_info: nil)\n # size_t : param_value_size\n # void * : param_value\n # size_t * : param_value_size_ret\n param_value_buf_length = 1024\n param_value_buf = ' ' * param_value_buf_length\n param_value_size_ret_buf = ' ' * 4\n\n err = OpenCL.clGetCommandQueueInfo(command_queue, param_name, param_value_buf_length, param_value_buf, param_value_size_ret_buf)\n error_info << err if error_info != nil\n\n param_value_size_ret = param_value_size_ret_buf.unpack(\"L\")[0]\n\n unpack_format = @@param2unpack[param_name]\n return param_value_buf.unpack(unpack_format)[0]\n end", "title": "" }, { "docid": "07937ffa38ade1775a95ccbafa63b23c", "score": "0.60972345", "text": "def info\n return {\n :pending => queue_sizes.inject(0) { |sum, (_queue_name, queue_size)| sum + queue_size },\n :processed => Stat[:processed],\n :queues => queues.size,\n :workers => workers.size.to_i,\n :working => working.size,\n :failed => data_store.num_failed,\n :servers => [redis_id],\n :environment => ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'\n }\n end", "title": "" }, { "docid": "9632202f16383e0ad73b94118fb074e2", "score": "0.60785353", "text": "def queue_name\n raise NotImplementedError\n end", "title": "" }, { "docid": "d9e37169e5afd66e2c49b11980f0b70c", "score": "0.60782915", "text": "def info\n return {\n :pending => queues.inject(0) { |m,k| m + size(k) },\n :processed => Stat[:processed],\n :queues => queues.size,\n :workers => workers.size.to_i,\n :working => working.count,\n :failed => Stat[:failed],\n :servers => to_s,\n :environment => ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'\n }\n end", "title": "" }, { "docid": "fcbceb7f435e0f66326bb3917d2d3d42", "score": "0.6065031", "text": "def queue_name\n if @queue_name.is_a?(Proc)\n @queue_name = self.class.queue_name_from_part(instance_exec(&@queue_name))\n end\n @queue_name\n end", "title": "" }, { "docid": "c05e1de9573d87d7c6f1008b8759b0a4", "score": "0.6056714", "text": "def info\n return {\n :pending => queues.inject(0) { |m,k| m + size(k) },\n :processed => Stat[:processed],\n :queues => queues.size,\n :workers => workers.size.to_i,\n :working => working.size,\n :failed => Stat[:failed],\n :servers => [doozer_id],\n :environment => ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'\n }\n end", "title": "" }, { "docid": "71d89516a139ff61f4002aacb333333f", "score": "0.6052362", "text": "def info\n return {\n :pending => queues.inject(0) { |m,k| m + size(k) },\n #:processed => Stat[:processed],\n #:queues => queues.size,\n #:workers => workers.size.to_i,\n #:working => working.size,\n #:failed => Stat[:failed],\n :servers => [redis_id],\n :environment => ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'\n }\n end", "title": "" }, { "docid": "9a0d78d85ba2ad9d0ae8d79611b9fbca", "score": "0.60417277", "text": "def info\n tag = \"job.id=#{self.delivery_info.delivery_tag}\" if delivered?\n \"job.type=#{self.class.name} #{tag}\".chomp(' ')\n end", "title": "" }, { "docid": "cf2c7450cbed5c79b444fe97a9d2f76d", "score": "0.60343283", "text": "def get_queue_name()\n 'file_stats'\n end", "title": "" }, { "docid": "a25a56846e5c4dd52d3210ca705f8fe4", "score": "0.6034245", "text": "def get_queue name\n queue_name = \"Queue-#{name}\"\n\n queue = @control.add_queue name\n\n notice \"found #{queue_name} at #{queue.__drburi}\"\n\n queue\n end", "title": "" }, { "docid": "8cf4e49c07653c7233c2d19779681c0e", "score": "0.5961076", "text": "def pgq_get_queues_info\n connection.select_values('SELECT pgq.get_queue_info()')\n end", "title": "" }, { "docid": "b082cbe897f068bd4872bb48b475420a", "score": "0.5937562", "text": "def pgq_get_queues_info\n connection.select_values(\"SELECT pgq.get_queue_info()\")\n end", "title": "" }, { "docid": "6cab599d6060dfe8a4ddc44224eb363d", "score": "0.593292", "text": "def processing_queue_name\n name.include?(email) ? name.to_s : \"#{name} (#{email})\"\n end", "title": "" }, { "docid": "2537025091816f539275dfffec77c9f2", "score": "0.5925115", "text": "def info\r\n \"state: #{state} (#{State.state_str(state)}) queue: #{queue.size}\"\r\n end", "title": "" }, { "docid": "8b8c007b541ffc8b2a86be12f61d661f", "score": "0.5899227", "text": "def make_consumer_tag\n\t\treturn \"%s.%s.%d\" % [\n\t\t\tself.queue_name,\n\t\t\tSocket.gethostname.gsub(/\\..*$/, ''),\n\t\t\tProcess.pid,\n\t\t]\n\tend", "title": "" }, { "docid": "efa8d977b961f979249b8e36707066fd", "score": "0.58930486", "text": "def for(queue:, worker: nil)\n worker_name = worker.to_s.underscore.tr(\"/\", \"_\") if worker\n [namespace, queue, worker_name].compact.join(\".\")\n end", "title": "" }, { "docid": "179e70c8433573be7a7097744e3ef552", "score": "0.58876824", "text": "def info\n return {\n :pending => queues.inject(0) { |m,k| m + size(k) },\n :processed => Stat[:processed],\n :queues => queues.size,\n :workers => workers.size.to_i,\n :working => working.size,\n :failed => Stat[:failed],\n :servers => \"#{@con.primary[0]}:#{@con.primary[1]}/#{@db.name}/#{@mongo.name}\",\n :environment => ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development',\n }\n end", "title": "" }, { "docid": "424f913a483a3ae1cefdba660edad444", "score": "0.5872174", "text": "def info_handle\n @queue << \"i h\"\n end", "title": "" }, { "docid": "2aed41774b5fc22df8c7d5ca65350b4b", "score": "0.5865751", "text": "def queue_name\r\n raise 'must be implemented in subclasses'\r\n end", "title": "" }, { "docid": "d70a840a2533ec739c27e60d4d5ef64a", "score": "0.5842281", "text": "def info(qname)\n queue = q(qname)\n { :visibility_timeout => queue.visibility, :size => queue.size }\n end", "title": "" }, { "docid": "52186092be6b7c2e406d764400377ac0", "score": "0.5820922", "text": "def to_s\n @to_s ||= \"#{hostname}:#{pid}:#{@worker_queues}\"\n end", "title": "" }, { "docid": "4b95d2b5c0205784890cbd3728caaa8a", "score": "0.5807918", "text": "def name\r\n @multi_queue\r\n end", "title": "" }, { "docid": "0db2a9d6d82f23f79843bc7061bece99", "score": "0.5805935", "text": "def msg_worker\n [\"*Worker:* #{@failure.worker} failed processing*\",\"*Queue:* #{@failure.queue}\"]\n end", "title": "" }, { "docid": "ac33a0bc6946802371bdab0c5623e8d4", "score": "0.5799032", "text": "def queues\n puts '(pid | priority | cpu | created_at)'\n puts manager.display_queues\n end", "title": "" }, { "docid": "9ed0ea66e3eed07ef9bf171d36d07e5a", "score": "0.5776794", "text": "def info(id)\n args = []\n args.concat [\"-s\", scheduler] unless scheduler.nil?\n args.concat [\"-ji\", id]\n\n stat_output = call(\"ccqstat\", args: args)\n\n # WARNING: code path differs here than info_all because the output\n # from ccqstat -ji $JOBID is much more data than just the 4\n # columns that ccqstat gives.\n info_from_ccqstat_extended(stat_output)\n end", "title": "" }, { "docid": "79a4ed97f8e53b1623cb5385af64bd5c", "score": "0.57485837", "text": "def worker_name\n @parameters[:worker_name]\n end", "title": "" }, { "docid": "e655dade82c625c8c0b80a8049b23f36", "score": "0.5740389", "text": "def info_display\n @queue << \"i d\"\n end", "title": "" }, { "docid": "2417ab533cde465d737690331a5682e4", "score": "0.57245266", "text": "def worker_class_name\n payload[:worker]\n end", "title": "" }, { "docid": "c52c577fd59ee30f428927cd4019305e", "score": "0.5719983", "text": "def worker\n read_attribute(:worker) || extract_worker || ''\n end", "title": "" }, { "docid": "59a74dadc93fb2226aebb121246eae8c", "score": "0.5699351", "text": "def show_queue(queue)\n qstr = \":#{queue}:\"\n # TODO: Use SCAN after upgrade to Redis 2.8\n redis.keys(rk_args(get_qnid(queue, '*'))).map {|k| k.split(qstr, 2).last }\n end", "title": "" }, { "docid": "0e5b99c2449bd3b2271f5ca3cc9e4623", "score": "0.56921315", "text": "def get_worker_version\n mq.get_worker_version\n end", "title": "" }, { "docid": "aebfd79f158f2825c0744659ac21d897", "score": "0.56816316", "text": "def name\n @name ||= @queue_url.split(/\\//).last\n end", "title": "" }, { "docid": "576c456d4fa06c650e337fb367ab654e", "score": "0.566241", "text": "def queue_name\n @queue_name ||= if class_name == 'Robots::DorRepo::Assembly::Jp2Create'\n # Special case because this robot can eats up too much memory if more\n # than one instance is running on a worker box simultaneously\n 'assemblyWF_jp2'\n else\n \"#{step.workflow}_#{step.lane_id}\"\n end\n end", "title": "" }, { "docid": "06f4ad817f13a0fa0c466a39f3ef1ca6", "score": "0.5654122", "text": "def all_worker_info(t_data)\n info_response = []\n reactor.live_workers.each do |key,value|\n worker_key = (value.worker_key.to_s).gsub(/#{value.worker_name}_?/,\"\")\n info_response << { :worker => value.worker_name,:worker_key => worker_key,:status => :running }\n end\n send_object(info_response)\n end", "title": "" }, { "docid": "bf11a6141f1a8114972123e65315a31b", "score": "0.5644713", "text": "def queue_name\n @queue_name ||= name.chomp(Subscriber.name.demodulize).underscore.dasherize\n end", "title": "" }, { "docid": "cf29c31aea8a2df9a165288aa7149dbd", "score": "0.5588555", "text": "def get_queue(queue)\n resource_entry(:queue, _name_for(queue))\n end", "title": "" }, { "docid": "c838cc86e020a761595818861785914c", "score": "0.55879974", "text": "def job_class_name\n worker_name\n end", "title": "" }, { "docid": "3ee6021786c72597463f54af5d2e80a0", "score": "0.55859965", "text": "def get_details_of_queue(queue, host) \n AMQP.start(:host => host) do\n jobs = MQ.queue(queue)\n jobs.status do |msgs, cns| \n @messages = msgs\n @count = cns \n end\n AMQP.stop{ EM.stop }\n end\nend", "title": "" }, { "docid": "d30de0511071c16564da8d981051a099", "score": "0.5581683", "text": "def info\n queue = IreulWeb::Application.ireul_client.queue_status\n upcoming = queue.upcoming || []\n history = queue.history || []\n\n unless queue.current.nil?\n handle = queue.current.instance_variable_get('@track').handle\n song_id = IreulWeb::Application.handle_map[handle]\n song = Song.find_by_id(song_id)\n bg_image = BackgroundImage.where(song_id: song.id).first if song\n image_url = bg_image.image.url(:small) if bg_image # TODO: Add fallback images\n niceness = IreulWeb::Application.nice_map[handle] || 0\n end\n\n render json: {\n image: image_url || nil,\n niceness: niceness,\n current: queue_track_to_json(queue.current),\n upcoming: upcoming.map { |t| queue_track_to_json(t) },\n history: history.map { |t| queue_track_to_json(t) },\n icecast: IreulWeb::Application.icecast_service.info,\n time: Time.now.utc.iso8601\n }\n end", "title": "" }, { "docid": "4be73bd6cd4cb6fd4620650c28d936f4", "score": "0.5577201", "text": "def queue_adapter_name; end", "title": "" }, { "docid": "437e97b5490d639c77662d7e64006b59", "score": "0.5563717", "text": "def naming\n Hightops::Naming::Queue.new(worker_class: self)\n end", "title": "" }, { "docid": "a50f196b94309f84d15fd45efd32cebe", "score": "0.55582273", "text": "def show\n @queue_info = Combined::QueueInfo.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @queue_info }\n end\n end", "title": "" }, { "docid": "87989303db80d945fb8f71e47b51df3c", "score": "0.55577207", "text": "def inspect\n queue.inspect\n end", "title": "" }, { "docid": "d84b64eb4bc8553ea38ae9758491f74f", "score": "0.55377734", "text": "def get_details(task_name)\n @logger.info \"Obtaining the details of task '#{task_name}' from the\" +\n \" build queue\"\n response_json = @client.api_get_request(\"/queue\")\n details = {}\n response_json[\"items\"].each do |item|\n details = item if item[\"task\"][\"name\"] == task_name\n end\n details\n end", "title": "" }, { "docid": "d01592b3679e0a0e761be33e3abd21c3", "score": "0.5533793", "text": "def get_queue_name(target,type)\n MQ_CONFIG[target][type]\n end", "title": "" }, { "docid": "f0855da4d637799231c1c256a3c79d75", "score": "0.5519748", "text": "def display_queues\n \"\\nWaiting: #{waiting.to_s}\\nReady: #{ready.to_s}\\nRunning: #{running.to_s}\\n\"\n end", "title": "" }, { "docid": "fef4640a9727d86401fcd64cbe5a0d70", "score": "0.55146736", "text": "def info_stack\n @queue << \"i s\"\n end", "title": "" }, { "docid": "5e44252e67bc34319520e86272a811a5", "score": "0.55011624", "text": "def read_friendly\n \"Messages: #{queuesize}, Queue: #{queue}\"\n end", "title": "" }, { "docid": "8712f5a8a59ad19fd330132bd57eee1b", "score": "0.54902756", "text": "def full_queue_name name\n \"#{name}_#{environment_suffix}\"\n end", "title": "" }, { "docid": "81c8223a0b5c4ff4fbeb2e6e6cb39bf5", "score": "0.54856473", "text": "def job_queue\n (@job_queue ||= self.class.cloudtasker_options_hash[:queue] || Config::DEFAULT_JOB_QUEUE).to_s\n end", "title": "" }, { "docid": "3fe63136289aa8534af7a86dfded5f7f", "score": "0.5473918", "text": "def queue_name\n match_data = (token_hash['queue']||'').match(/^((?!(aws|amazon|\\.))[a-z,0-9,_,\\-,\\.]{1,256})$/i)\n match_data[0] if match_data\n end", "title": "" }, { "docid": "7b3c110e00caf1b47b7c97d2a7054033", "score": "0.5462435", "text": "def msg_worker\n \"#{@failure.worker} failed processing #{@failure.queue}\"\n end", "title": "" }, { "docid": "73a82a32d2310ed0cef1ca29baa28abe", "score": "0.5456317", "text": "def queue\n Queue.for(queue_name)\n end", "title": "" }, { "docid": "980cdcd7a07e9fb7abec7d0fa437507b", "score": "0.5453765", "text": "def process_info(thread_name_length = 30)\n file, line = file_name_and_line(true)\n file_name = \" #{file}:#{line}\" if file\n\n format \"#{$PROCESS_ID}:%.#{thread_name_length}s#{file_name}\", thread_name\n end", "title": "" }, { "docid": "92f71e6d8825506049a0ed8ffabafa55", "score": "0.54386157", "text": "def inspect\n \"#<Mongo::Server::ConnectionPool:0x#{object_id} queue=#{queue.inspect}>\"\n end", "title": "" }, { "docid": "cf61f0cb12d638c947571ac8c09f308b", "score": "0.54347765", "text": "def read_queue_name_attribute\n attribute(:queue_name)\n end", "title": "" }, { "docid": "320277d410723d6d95082c28655fb9ec", "score": "0.54278535", "text": "def get_info_enqueued_job(job_id)\n job_info = OodCore::Job::Info.new(id: job_id.to_s, status: :completed)\n argv = ['qstat', '-r', '-xml', '-j', job_id.to_s]\n\n begin\n results = call(*argv)\n listener = QstatXmlJRListener.new\n REXML::Parsers::StreamParser.new(results, listener).parse\n\n job_hash = listener.parsed_job\n\n if job_hash[:id]\n update_job_hash_status!(job_hash)\n else\n job_hash[:id] = job_id\n job_hash[:status] = :completed\n end\n\n job_info = OodCore::Job::Info.new(**job_hash)\n rescue REXML::ParseException => e\n # If the error is something other than a job not being found by qstat re-raise the error\n unless results =~ /unknown_jobs/\n raise e, \"REXML::ParseException error and command '#{argv.join(' ')}' produced results that didn't contain string 'unknown_jobs'. ParseException: #{e.message}\"\n end\n rescue StandardError => e\n # Note that DRMAA is not guaranteed to be defined, hence the tests\n raise e unless ( can_use_drmaa? && e.is_a?(DRMAA::DRMAAInvalidJobError)) # raised when job is not found\n end\n\n job_info\n end", "title": "" }, { "docid": "8f743819ae47b7efb45c4dcb5519f901", "score": "0.5417579", "text": "def worker_name(id_number)\n # Name of the node in format \"worker-01\", \"worker-32\", etc.\n 'worker-' + id_number.to_s.rjust(2, '0')\nend", "title": "" }, { "docid": "e8bd696cb31278093045abc6cc851d41", "score": "0.54135364", "text": "def info_swfs\n @queue << \"i sw\"\n end", "title": "" }, { "docid": "160eea147fb5b131e52affe4b62635f6", "score": "0.53904855", "text": "def get_queue_name\n return @queue_name unless @queue_name.nil?\n queue_name = self.name.gsub(/::/, ':')\n queue_name.gsub!(/([^A-Z:])([A-Z])/) { \"#{$1}_#{$2}\" }\n queue_name.downcase\n end", "title": "" }, { "docid": "9a0412cdf0ca539f30d44cbfbd9647ef", "score": "0.53845745", "text": "def sidekiq_worker_message; end", "title": "" }, { "docid": "90e3ffc3efa8f54d2b78b6ab58364f7c", "score": "0.53676003", "text": "def name\n return \"INVALID_COMMAND_QUEUE\"\n end", "title": "" }, { "docid": "78e54486d83e785eff6a10bc92f54f48", "score": "0.5362905", "text": "def inspect\n \"#<Mongo::Pool::Queue:0x#{object_id} min_size=#{min_size} max_size=#{max_size} \" +\n \"wait_timeout=#{wait_timeout} current_size=#{queue.size}>\"\n end", "title": "" }, { "docid": "253e2fe4030c2b4e554a0b2f96196ddf", "score": "0.5352825", "text": "def to_s\n \"#{ @metadata.queue.name }##{ id } [#{ serialized_data }]\"\n end", "title": "" }, { "docid": "7e54f55a0b57aad2e9750634cab3359a", "score": "0.5347874", "text": "def get_parsed_queue_string\n queue.map{ |api_call| \"Analytics.#{api_call}\" }.join(\"\\n\")\n end", "title": "" }, { "docid": "8a209a044a8ef2caee38204cff106cc0", "score": "0.5341056", "text": "def inspect\n \"job-#{id}\"\n end", "title": "" }, { "docid": "8a209a044a8ef2caee38204cff106cc0", "score": "0.5341056", "text": "def inspect\n \"job-#{id}\"\n end", "title": "" }, { "docid": "fc65eb7c1e583ab37024fadc4e0b61fd", "score": "0.53402627", "text": "def queue_name=(_arg0); end", "title": "" }, { "docid": "b69cb0295dc05580dff38bcb47ebd424", "score": "0.5334646", "text": "def to_queue_json\n {\n name: self.name\n }\n end", "title": "" }, { "docid": "24df228d57bee7c169eed027b2d6e8d6", "score": "0.53207177", "text": "def queue_name\n if qualified_klass = self.qualified_const_get(klass) \n queue_name = qualified_klass.instance_variable_get(\"@queue\")\n end\n\n queue_name || :default\n end", "title": "" }, { "docid": "76e5eff8ca82936fab6a4aa1aed1b762", "score": "0.5317537", "text": "def redis_key_for_queue_also(queue)\r\n \"queue:#{queue}\"\r\n end", "title": "" }, { "docid": "e586e041a2d04c02eb2c4cd83588f42d", "score": "0.52990323", "text": "def info_arguments\n @queue << \"i a\"\n end", "title": "" }, { "docid": "5dc7961052c46fdcc197e4eb9e79aa44", "score": "0.52974087", "text": "def queue_name\n @a561facf ||= begin\n queue_name = @metadata.channel.queues.keys.detect { |q| q == @metadata.exchange }\n if queue_name\n @a561facf = remove_namespace(queue_name)\n else\n raise UnknownQueue, \"Queue not found. You are probably you are using fanout queues: #{remove_namespace(@metadata.exchange)}\"\n end\n end\n end", "title": "" }, { "docid": "116f4b9f06fd8fd409c1dc0353b623d2", "score": "0.52877957", "text": "def name\n running? ? @proc.process_name.to_s : nil\n end", "title": "" }, { "docid": "a1f5b71b17daca97e3764efdd331799a", "score": "0.5279486", "text": "def procname\n\t\treturn \"%s %s: Symphony: %p (%s) -> %s\" % [\n\t\t\tRUBY_ENGINE,\n\t\t\tRUBY_VERSION,\n\t\t\tself.class,\n\t\t\tself.class.work_model,\n\t\t\tself.class.queue_name\n\t\t]\n\tend", "title": "" }, { "docid": "81b2ebcd4f7d56ca7fc3f935add6b726", "score": "0.5279397", "text": "def inspect\n \"#<Mongo::Server::ConnectionPool::Queue:0x#{object_id} min_size=#{min_size} max_size=#{max_size} \" +\n \"wait_timeout=#{wait_timeout} current_size=#{queue_size}>\"\n end", "title": "" }, { "docid": "7ff67f71e51203f790e0f679de823261", "score": "0.5271776", "text": "def to_s\n \"#<#{self.class.name}:#{object_id} #{connection_info}, queue=#{@name}>\"\n end", "title": "" }, { "docid": "a67faac8ddb2b37680bda26c9bb30e49", "score": "0.5269596", "text": "def queue_resource_name\n @queue_resource_name ||= Maitredee.queue_resource_name(topic_name, queue_name)\n end", "title": "" }, { "docid": "28f0f41675d8e0fda93a277d19e0ed0e", "score": "0.5251892", "text": "def pass_worker_info(t_data)\n worker_name_key = gen_worker_key(t_data[:worker],t_data[:worker_key])\n worker_instance = reactor.live_workers[worker_name_key]\n info_response = { :worker => t_data[:worker],:worker_key => t_data[:worker_key]}\n worker_instance ? (info_response[:status] = :running) : (info_response[:status] = :stopped)\n send_object(info_response)\n end", "title": "" }, { "docid": "786c1bd045cbc48beb3ac17b5cbab3bc", "score": "0.52494544", "text": "def queue_name_for_ems(ems)\n end", "title": "" }, { "docid": "a57fe44f90bd0e5180e70adb2fa4de8f", "score": "0.5246711", "text": "def waiting_by_queue\n Hash[@resque_data_store.queue_names.map { |queue_name|\n [queue_name,@resque_data_store.queue_size(queue_name)]\n }]\n end", "title": "" }, { "docid": "2cf6430ba4516909a58d494ee4f08c90", "score": "0.5239298", "text": "def worker_queue_attributes message = nil\n @queue ||= []\n {:queue => @queue, :dequeue => :pop, :enqueue => :push}\n end", "title": "" }, { "docid": "47ead3583f407c3b0a71476d282d7841", "score": "0.5233477", "text": "def queue_name\n QueueNames::DEFAULT\n end", "title": "" }, { "docid": "cbdec5bfc200f31a46304b26953e2414", "score": "0.5232053", "text": "def info_files\n @queue << \"i f\"\n end", "title": "" }, { "docid": "0c8445eb1c777cf3e1c0d55a7ae6a211", "score": "0.52292824", "text": "def queue(name)\n queue_provider.queue(name)\n end", "title": "" } ]
1317322e310cde506d4b2ed323e9a2b1
List of commands that require a device
[ { "docid": "bd71ba2acca52d594d9d5eb148e84c91", "score": "0.7805442", "text": "def device_commands\n @device_commands ||= []\n end", "title": "" } ]
[ { "docid": "cbb0e0146716ca394629feb29999e663", "score": "0.7536319", "text": "def device_commands\n [:sideload, :package, :test, :deeplink, :delete, :navigate, :navigator,\n :text, :monitor, :screencapture, :applist, :profile, :key, :genkey ]\n end", "title": "" }, { "docid": "1591701524e354f7af79b6fd19e45d79", "score": "0.7155604", "text": "def commands\n all = {\n 'supported_idx' => 'suppored USB indexes',\n 'idx' => 'sets an active idx',\n 'freq' => 'sets the frequency',\n 'modulation' => 'sets the modulation',\n 'flen' => 'sets the fixed length packet size',\n 'vlen' => 'sets the variable length packet size',\n 'xmit' => 'transmits some data',\n 'recv' => 'receive a packet of data',\n 'enable_crc' => 'enables crc',\n 'enable_manchester' => 'enables manchester encoding',\n 'channel' => 'sets channel',\n 'channel_bw' => 'sets the channel bandwidth',\n 'baud' => 'sets the baud rate',\n 'deviation' => 'sets the deviation',\n 'sync_word' => 'sets the sync word',\n 'preamble' => 'sets the preamble number',\n 'lowball' => 'sets lowball',\n 'power' => 'sets the power level',\n 'maxpower' => 'sets max power'\n }\n\n all\n end", "title": "" }, { "docid": "42f793f00db36a7ca262ada1ae845766", "score": "0.7092058", "text": "def commands\n all = {\n 'supported_buses' => 'Get supported buses',\n 'busconfig' => 'Get baud configs',\n 'connect' => 'Get HW supported methods for a bus',\n 'cansend' => 'Send a CAN packet',\n 'isotpsend' => 'Send an ISO-TP Packet and get a response',\n 'testerpresent' => 'Sends TesterPresent Pulses to the bus'\n }\n\n reqs = {\n 'supported_buses' => ['get_supported_buses'],\n 'busconfig' => ['get_bus_config'],\n 'connect' => ['get_supported_methods'],\n 'cansend' => ['cansend'],\n 'testerpresent' => ['testpresent']\n }\n\n # Ensure any requirements of the command are met\n all\n end", "title": "" }, { "docid": "c84f493901469dee6df556962fa48f52", "score": "0.6967914", "text": "def supported_commands\n []\n end", "title": "" }, { "docid": "6d45b429ecc0a7d277a6f4e476dadfa4", "score": "0.6937668", "text": "def commands\n\t\t{\n\t#\t\t\"dev_image\" => \"Attempt to grab a frame from webcam\",\n\t#\t\t\"dev_audio\" => \"Attempt to record microphone audio\",\n\t\t\t\"screengrab\" => \"Attempt to grab screen shot from process's active desktop\"\n\t\t}\n\tend", "title": "" }, { "docid": "cc12139602ac8445ffbbaf93e1381530", "score": "0.68841696", "text": "def commands\n all = {\n 'supported_devices' => 'Get supported ZigBee devices',\n 'target' => 'Set the target device id',\n 'channel' => 'Set the channel'\n }\n\n all\n end", "title": "" }, { "docid": "fc77c9cb4304ca359d45639c836722f6", "score": "0.67606765", "text": "def list_commands\n puts \"Commands: #{ACTIONS.map(&:to_s).join(' ')}\"\n puts \" If you want to buy something then enter buy ABC where ABC means the product you want to buy\"\n end", "title": "" }, { "docid": "007a8c54b985440042078d704c59735a", "score": "0.67597413", "text": "def command_list\n \"#{AVAILABLE_COMMANDS} \\n\" + USER_COMMANDS.join(\"\\n\")\n end", "title": "" }, { "docid": "b6771d79448c346bd19eaec4bc3b546f", "score": "0.6733112", "text": "def commands\n []\n end", "title": "" }, { "docid": "41b4271e6379f1c602904522190fe361", "score": "0.67282254", "text": "def commands\n []\n end", "title": "" }, { "docid": "8d98018e6da0ba8db6f26e6be6514e85", "score": "0.66321826", "text": "def deviceListUsage()\n ioDeviceMap=findBusIoDevices\n if ioDeviceMap != \"\"\n keys=[]\n ioDeviceMap.each_key do |key|\n keys.push(key)\n map=ioDeviceMap[key]\n puts(\"pcibusid: #{key} - device: #{map[:deviceName]} [#{map[:vendorId]}:#{map[:deviceId]}]\")\n end\n line=\"#{keys.shift}\"\n if keys.length != 0\n line = line + \",(\" + keys.join(\",\") + \")\"\n end\n puts(\"Usage: vagrant --pcibusid=#{line} <vagrant command>\")\n else\n puts(\"No Sandisk Mass Storage Controller Found to pass through, aborting\")\n end\nend", "title": "" }, { "docid": "7b3f37830a5385197890adb2b02989fd", "score": "0.6627482", "text": "def commands\n @commands.map{ |c| c[:name] }\n end", "title": "" }, { "docid": "3171b89969ac9a32127bde984be6b382", "score": "0.6570401", "text": "def list_command(opts)\n usage = \"Agent exposes the following commands:\\n\"\n COMMANDS.reject { |k, _| k == :list || k.to_s =~ /test/ }.each do |c|\n c.each { |k, v| usage += \" - #{k.to_s}: #{v}\\n\" }\n end\n CommandIO.instance.reply(opts[:conn], usage)\n end", "title": "" }, { "docid": "a0ba7517715914c09beaf46f2af9fedf", "score": "0.6532721", "text": "def list_devices\n response = send(Command::LIST_DEVICES).wait_ok.payload\n size = response.unpack(\"Q<\")[0]\n MessagePack.unpack(response[8, size])\n end", "title": "" }, { "docid": "07c5efeabd4c355e86f17c1a4fb63c98", "score": "0.6504641", "text": "def list_commands\n commands = CustomCommands.select(:command).map do |c|\n c.command\n end\n\n commands\n end", "title": "" }, { "docid": "f1ac47b9872f4ae128e9057eda6e47df", "score": "0.6493469", "text": "def receivedCommandsListByDevice(deviceId, params)\n @client.get(\"/devices/#{deviceId}/commands\", nil, params, \"Content-Type\" => \"application/json\")\n end", "title": "" }, { "docid": "8ea9d18e207779e126084e0356a6f882", "score": "0.6493115", "text": "def list_command(opts)\n usage = \"Agent exposes the following commands:\\n\"\n COMMANDS.reject { |c| c.include?(:list) }.each do |c|\n c.each { |k, v| usage += \" - #{k.to_s}: #{v}\\n\" }\n end\n CommandIO.instance.reply(opts[:conn], usage)\n end", "title": "" }, { "docid": "1be8d22bd73d6c3b5488e6e6a08d00a3", "score": "0.64928526", "text": "def commands\n @commands ||= []\n end", "title": "" }, { "docid": "1be8d22bd73d6c3b5488e6e6a08d00a3", "score": "0.64928526", "text": "def commands\n @commands ||= []\n end", "title": "" }, { "docid": "4dc9bd7cf5b9a2623370479868431edd", "score": "0.6470915", "text": "def commands\n @commands\n end", "title": "" }, { "docid": "4dc9bd7cf5b9a2623370479868431edd", "score": "0.6470915", "text": "def commands\n @commands\n end", "title": "" }, { "docid": "a540eeffe2739f44adb7d22b637dabed", "score": "0.6468731", "text": "def commands\n all = {\n 'dump_sms' => 'Get sms messages',\n 'dump_contacts' => 'Get contacts list',\n 'geolocate' => 'Get current lat-long using geolocation',\n 'dump_calllog' => 'Get call log',\n 'check_root' => 'Check if device is rooted',\n 'device_shutdown' => 'Shutdown device',\n 'send_sms' => 'Sends SMS from target session',\n 'wlan_geolocate' => 'Get current lat-long using WLAN information',\n 'interval_collect' => 'Manage interval collection capabilities',\n 'activity_start' => 'Start an Android activity from a Uri string',\n 'hide_app_icon' => 'Hide the app icon from the launcher',\n 'sqlite_query' => 'Query a SQLite database from storage',\n 'set_audio_mode' => 'Set Ringer Mode',\n 'wakelock' => 'Enable/Disable Wakelock',\n }\n reqs = {\n 'dump_sms' => [COMMAND_ID_ANDROID_DUMP_SMS],\n 'dump_contacts' => [COMMAND_ID_ANDROID_DUMP_CONTACTS],\n 'geolocate' => [COMMAND_ID_ANDROID_GEOLOCATE],\n 'dump_calllog' => [COMMAND_ID_ANDROID_DUMP_CALLLOG],\n 'check_root' => [COMMAND_ID_ANDROID_CHECK_ROOT],\n 'device_shutdown' => [COMMAND_ID_ANDROID_DEVICE_SHUTDOWN],\n 'send_sms' => [COMMAND_ID_ANDROID_SEND_SMS],\n 'wlan_geolocate' => [COMMAND_ID_ANDROID_WLAN_GEOLOCATE],\n 'interval_collect' => [COMMAND_ID_ANDROID_INTERVAL_COLLECT],\n 'activity_start' => [COMMAND_ID_ANDROID_ACTIVITY_START],\n 'hide_app_icon' => [COMMAND_ID_ANDROID_HIDE_APP_ICON],\n 'sqlite_query' => [COMMAND_ID_ANDROID_SQLITE_QUERY],\n 'set_audio_mode' => [COMMAND_ID_ANDROID_SET_AUDIO_MODE],\n 'wakelock' => [COMMAND_ID_ANDROID_WAKELOCK],\n }\n filter_commands(all, reqs)\n end", "title": "" }, { "docid": "31b4efa97fe12b60e43dce84d64f270b", "score": "0.6460104", "text": "def command_list\n @command_list ||= [\n 'cleanup', 'contents', 'install', 'list', 'open', 'push', 'query', 'read',\n 'specification', 'uninstall', 'unpack', 'update', 'which'\n ]\n end", "title": "" }, { "docid": "c2b77613ae0f0989f25ae0d4cf48dafa", "score": "0.6443375", "text": "def commands\n @commands ||= RequestList.new\n end", "title": "" }, { "docid": "217de173dd874893b911a6e46dfcc3bf", "score": "0.64425766", "text": "def available_commands\n return @client.operations\n end", "title": "" }, { "docid": "50c742d1a3234d9d74381600ad31cfb0", "score": "0.6429064", "text": "def command_names\n commands.map(&:name)\n end", "title": "" }, { "docid": "3d4a73dc95257315aed7e20cde0200ca", "score": "0.6427969", "text": "def cmd_supported_devices\n devices = client.zigbee.supported_devices\n if !devices or !devices.has_key? \"devices\"\n print_line(\"error retrieving list of devices\")\n return\n end\n devices = devices[\"devices\"]\n unless devices.size > 0\n print_line(\"none\")\n return\n end\n set_target_device(devices[0]) if devices.size == 1\n str = \"Supported Devices: \"\n str << devices.join(', ')\n str << \"\\nUse device name to set your desired device, default is: #{self.target_device}\"\n print_line(str)\n end", "title": "" }, { "docid": "332334a47884fefe623f7b546a9d9352", "score": "0.64160126", "text": "def commandlist()\r\n sendmessage(\"Available commands:\")\r\n @callbacks.each do |name|\r\n str = \"#{name[0]}\"\r\n puts \"--> \"+str\r\n sendmessage(str)\r\n end\r\n end", "title": "" }, { "docid": "f96f32d4ae614acffea9db2e244e3b88", "score": "0.6413591", "text": "def commands\n puts \"Available commands:\"\n puts @commands.join(' ')\n @stop = true\n end", "title": "" }, { "docid": "0c8e48d1657cc7aa296cdf78cfcda374", "score": "0.64021677", "text": "def list_disk_devices\n if File.executable?(\"/bin/lsblk\")\n shell_out(%Q{/bin/lsblk -i -p -r -n | egrep ' disk( |$)'}).stdout.each_line.map { |l|\n l.chomp.sub(/ .*/, '')\n }\n else\n # XXX something dumber\n nil\n end\n end", "title": "" }, { "docid": "b25330380a02c84ffbacd1ddd4dd3bf8", "score": "0.63958436", "text": "def list_devices\n devices = get_devices\n print_devices_table(devices)\n end", "title": "" }, { "docid": "bbe9ee106b802d5bbc66fd08e5c144de", "score": "0.6381643", "text": "def commands\n\t\tself.class.commands_list.each do |name, description|\n\t\t\tprintf \"#{name.ljust(10)} : #{description}\\n\"\n\t\tend\n\tend", "title": "" }, { "docid": "06e205394e324729caee9315738bf9c6", "score": "0.6375853", "text": "def commands\n Command.where(events: 'on_001')\n end", "title": "" }, { "docid": "188acf7e25bf155b21005fcf5567cf52", "score": "0.6363296", "text": "def command_names\n commands.keys.compact\n end", "title": "" }, { "docid": "36a963f3a7ef9dc97b315717edbaf561", "score": "0.6360688", "text": "def list_commands(args)\n puts Commands.instance_methods(false).reject { |item| item[/(^list_|exec)/] }\n end", "title": "" }, { "docid": "b8271ed1757bf748c36a475db9787319", "score": "0.63504803", "text": "def get_commands\n @commands\n end", "title": "" }, { "docid": "f567d46fbdf2d573d32a9f0cb06d760d", "score": "0.6349138", "text": "def commands\n all = {\n 'ipconfig' => 'Display interfaces',\n 'ifconfig' => 'Display interfaces',\n 'route' => 'View and modify the routing table',\n 'portfwd' => 'Forward a local port to a remote service',\n 'arp' => 'Display the host ARP cache',\n 'netstat' => 'Display the network connections',\n 'getproxy' => 'Display the current proxy configuration',\n 'resolve' => 'Resolve a set of host names on the target',\n }\n\n reqs = {\n 'ipconfig' => [COMMAND_ID_STDAPI_NET_CONFIG_GET_INTERFACES],\n 'ifconfig' => [COMMAND_ID_STDAPI_NET_CONFIG_GET_INTERFACES],\n 'route' => [\n # Also uses these, but we don't want to be unable to list them\n # just because we can't alter them.\n #COMMAND_ID_STDAPI_NET_CONFIG_ADD_ROUTE,\n #COMMAND_ID_STDAPI_NET_CONFIG_REMOVE_ROUTE,\n COMMAND_ID_STDAPI_NET_CONFIG_GET_ROUTES\n ],\n # Only creates tcp channels, which is something whose availability\n # we can't check directly at the moment.\n 'portfwd' => [],\n 'arp' => [COMMAND_ID_STDAPI_NET_CONFIG_GET_ARP_TABLE],\n 'netstat' => [COMMAND_ID_STDAPI_NET_CONFIG_GET_NETSTAT],\n 'getproxy' => [COMMAND_ID_STDAPI_NET_CONFIG_GET_PROXY],\n 'resolve' => [COMMAND_ID_STDAPI_NET_RESOLVE_HOST],\n }\n\n filter_commands(all, reqs)\n end", "title": "" }, { "docid": "7c8e0b1ecf16154749ea7ed036277c62", "score": "0.6348609", "text": "def commands\n [:sideload, :package, :test, :deeplink,:configure, :validate, :delete,\n :navigate, :navigator, :text, :build, :monitor, :update, :screencapture,\n :key, :genkey, :screen, :screens, :applist, :print, :profile, :dostage,\n :dounstage]\n end", "title": "" }, { "docid": "03371bf0c8572e9b383b020bbf8539d1", "score": "0.63168573", "text": "def commands\n com = \"\"\n @@commands.each do |command, help|\n com << help << \"\\n\"\n end\n com\n end", "title": "" }, { "docid": "85d5ef8dfd3ace0c5dc03256624676cf", "score": "0.6310364", "text": "def commands\n {}\n end", "title": "" }, { "docid": "85d5ef8dfd3ace0c5dc03256624676cf", "score": "0.6310364", "text": "def commands\n {}\n end", "title": "" }, { "docid": "9524eae5d15a50d768afa35d4c517f93", "score": "0.6308656", "text": "def find_devices\n # Search for devices without number\n devices = []\n\n # Return parameter value if it's defined\n if config[:devices] != 'all'\n config[:devices].split(',').each do |dev|\n jconfig = @hardware.find { |d| d[:path] == dev }\n\n if jconfig.nil?\n override = nil\n ignore = nil\n else\n override = jconfig[:override]\n ignore = jconfig[:ignore]\n end\n devices << Disk.new(dev.to_s, override, ignore)\n end\n return devices\n end\n\n `lsblk -nro NAME,TYPE`.each_line do |line|\n name, type = line.split\n\n if type == 'disk'\n jconfig = @hardware.find { |h1| h1[:path] == name }\n\n if jconfig.nil?\n override = nil\n ignore = nil\n else\n override = jconfig[:override]\n ignore = jconfig[:ignore]\n end\n\n device = Disk.new(name, override, ignore)\n\n output = `sudo #{config[:binary]} -i #{device.device_path}`\n\n # Check if we can use this device or not\n available = !output.scan(/SMART support is:\\s+Available/).empty?\n enabled = !output.scan(/SMART support is:\\s+Enabled/).empty?\n devices << device if available && enabled\n end\n end\n\n devices\n end", "title": "" }, { "docid": "22d83e50667bac08f4e33ad1e358e602", "score": "0.6297123", "text": "def commands\n {\n \"db_masscan\" => \"Scan port using masscan.\", \n \"db_masscan_help\" => \"Help about db_masscan.\"\n }\n end", "title": "" }, { "docid": "9a1756729c12241df548b4ea269f6eb8", "score": "0.62866867", "text": "def list_commands\n @command_map.keys\n end", "title": "" }, { "docid": "0edf195602a470868b4306be314a3e64", "score": "0.6283051", "text": "def list_devicetypes\n Executor.execute(command_for('list', '-j', 'devicetypes')) do |json|\n SimCtl::List.new(json['devicetypes'].map { |devicetype| DeviceType.new(devicetype) })\n end\n end", "title": "" }, { "docid": "33cee9779a499bb37708d9a4cd8d9514", "score": "0.62810826", "text": "def commands\n puts ('Available commands are: inventory, goto, lookaround, health, use, quit') \n end", "title": "" }, { "docid": "731d66945f465d83276cacf8fb0b7716", "score": "0.62441015", "text": "def available_commands\n commands = commands_directory.map do |command|\n unless blacklisted?(command)\n find(command)\n end\n end\n \n if configuration.respond_to?(:additional_modules)\n module_directory.each do |command|\n configuration.additional_modules.each do |additional_module|\n if command =~ /\\/modules\\/(#{additional_module})\\/command\\.rb/\n commands << $1\n end\n end\n end\n end\n \n commands.flatten.compact.uniq\n end", "title": "" }, { "docid": "d0e64b2100a5b0746bc3f7fa4035c4b7", "score": "0.6236686", "text": "def commands()\n return @commands\n end", "title": "" }, { "docid": "9a8de78611d10c7d9dffbcd73b166ed5", "score": "0.62037444", "text": "def _commands\n []\n end", "title": "" }, { "docid": "6356d19678bfe5792bcf8489422cf7bb", "score": "0.6199963", "text": "def commands\n unless defined? @commands\n @commands = []\n end\n return @commands\n end", "title": "" }, { "docid": "ed53a3e63e142309ecb775d38e1ecf2f", "score": "0.6196383", "text": "def commands\n @commands ||= {}\n end", "title": "" }, { "docid": "ed53a3e63e142309ecb775d38e1ecf2f", "score": "0.6196383", "text": "def commands\n @commands ||= {}\n end", "title": "" }, { "docid": "405b59a4e872a02cae2381933e55e1d6", "score": "0.61931074", "text": "def get_devices\n WIDEQ.get_list(post('device/deviceList'), 'item')\n end", "title": "" }, { "docid": "b7049aa7c5e851475fdefb9b954bc668", "score": "0.6187058", "text": "def discovery_commands\n if options[:active_discovery_command].nil?\n case options[:vm_os].downcase.to_sym\n when :linux\n \"ip address show scope global | grep global | cut -b10- | cut -d/ -f1\"\n when :windows\n [\"sleep 5\", \"ipconfig\"]\n # \"ipconfig /renew\"\n # \"wmic nicconfig get IPAddress\",\n # \"netsh interface ip show ipaddress #{options[:vm_win_network]}\"\n end\n else\n options[:active_discovery_command]\n end\n end", "title": "" }, { "docid": "4585f3c120663ed88f76d46942b3a239", "score": "0.6186217", "text": "def adb_scan()\n adb_devices = []\n cmd = [ 'adb', 'devices' ]\n Open3.popen3(*cmd) { |sin, sout, serr, thr|\n pid = thr[:pid]\n outlines = sout.readlines\n errlines = serr.readlines\n\n if errlines.length > 0\n $stderr.puts \"ERROR:\"\n\n errlines.each { |ln|\n $stderr.puts ln\n }\n end\n\n outlines.each { |ln|\n ln.chomp!\n next if ln.length < 1\n next if ln == \"List of devices attached \"\n\n parts = ln.split(\"\\t\")\n serial = parts.first\n adb_devices << serial\n }\n }\n\n return adb_devices\nend", "title": "" }, { "docid": "e8f9e5999a2a755506e9dcb3e18266d5", "score": "0.6165879", "text": "def commands\n attributes.fetch(:commands)\n end", "title": "" }, { "docid": "df7d4cd42324476c69e23da74f75c1da", "score": "0.6152943", "text": "def devices; end", "title": "" }, { "docid": "8ccd07fe5834dde234abccb2fd915db6", "score": "0.6106492", "text": "def commands\n load_commands unless @commands\n @commands\n end", "title": "" }, { "docid": "cb08653631022fea0e70290cfa41281c", "score": "0.61053723", "text": "def available_commands(quick_action_target)\n @quick_action_target = quick_action_target\n\n self.class.command_definitions.map do |definition|\n next unless definition.available?(self)\n\n definition.to_h(self)\n end.compact\n end", "title": "" }, { "docid": "aa828e1232d30e9b3077ab91678b19ac", "score": "0.60924125", "text": "def available_tasks\n task_lines = `tddium --help`.split(\"\\n\")\n inside_tasks = false\n task_lines.map do |line|\n inside_tasks = true and next if line == \"Commands:\"\n inside_tasks = false and next if inside_tasks and line =~ /^\\S/\n line.strip.split(/\\s+/)[1] if inside_tasks\n end.compact\nend", "title": "" }, { "docid": "a1f1b298a8060295a1077ab1456393eb", "score": "0.6080175", "text": "def accepted_commands(command)\n @COMMANDS = [\n '/food',\n '/shopping',\n '/transport',\n '/misc',\n '/save',\n '/cancel',\n '/spendings',\n '/id'\n ]\n return @COMMANDS.index(command)\n end", "title": "" }, { "docid": "19f20f8370e243a1fef2c544b75213a1", "score": "0.60693556", "text": "def commands\n [name, *aliases].map(&:to_s)\n end", "title": "" }, { "docid": "19f20f8370e243a1fef2c544b75213a1", "score": "0.60693556", "text": "def commands\n [name, *aliases].map(&:to_s)\n end", "title": "" }, { "docid": "19f20f8370e243a1fef2c544b75213a1", "score": "0.60693556", "text": "def commands\n [name, *aliases].map(&:to_s)\n end", "title": "" }, { "docid": "866baaf4cd01572397bb10f71621f29f", "score": "0.6063577", "text": "def get_list_of_cli_command_executions_by_jobid_and_serial_number(args = {}) \n get(\"/commands.json/device\", args)\nend", "title": "" }, { "docid": "89eeaea5bec74cadbdbdeeafb24da55f", "score": "0.6052725", "text": "def commands_help\n help = [\"\\nAvailable commands:\"]\n commands.sort_by(&:to_s).each do |cmd, info|\n help << (\" %-27s %s\" % [cmd, info[:description]]) unless info[:internal]\n info[:config].param_lines[1..-1].each{|line| help << \" #{line}\" } rescue nil\n end\n help << \"\\nRun `#{script_base_and_command.first} help COMMAND' for more help on COMMAND\" if commands.include?(:help)\n help.flatten.join(\"\\n\")\n end", "title": "" }, { "docid": "1aba944bfdd15ffc2703fc01ef2c7032", "score": "0.60463136", "text": "def commands\n version_commands + support_commands\n end", "title": "" }, { "docid": "02f16293785fe009a3d3efdc313caaba", "score": "0.6041164", "text": "def commands\n {\n :pause => 'p',\n :continue => 'p',\n :love => '+',\n :ban => '-',\n :bookmark => 'b',\n :info => 'i',\n :skip => 'n',\n :next => 'n',\n :quit => 'q',\n :change_station => 's',\n :stations => 's',\n :tired => 't',\n :upcomming => 'u',\n :quick_mix => 'x',\n }\n end", "title": "" }, { "docid": "8ffa46f49589cfebc06b72e4fc18812c", "score": "0.6029481", "text": "def commands\n @commands ||= {\n 'start' => resource.start_command,\n 'stop' => resource.stop_command,\n 'restart' => resource.restart_command,\n 'refresh' => resource.refresh_command\n }\n end", "title": "" }, { "docid": "d22beb1328ac2fe1194889a0bbdf7ae9", "score": "0.60128945", "text": "def commands\n @commands ||= Array.new\n end", "title": "" }, { "docid": "d22beb1328ac2fe1194889a0bbdf7ae9", "score": "0.60128945", "text": "def commands\n @commands ||= Array.new\n end", "title": "" }, { "docid": "cc57b14d63e44b9af2744dab62b1ff99", "score": "0.60055614", "text": "def get_commands\n opts = %w{ test testend archive delete markread markunread spam star unstar open header savecontact connect connectas compose refresh }\n current_component = @vim.current_component\n case current_component\n when @lb2\n opts.push *%w{ select nextm prev nextunread prevunread savecontact header }\n when @tv\n opts.push *%w{ saveas reply replyall nextm prev nextunread prevunread munpack }\n end\n opts\nend", "title": "" }, { "docid": "9735060e22754bb7c17784887a18537d", "score": "0.6002266", "text": "def commands\n @commands ||= Foreman::Thor::CoreExt::OrderedHash.new\n end", "title": "" }, { "docid": "ba7066321afe2072eaf041d7b7f3d525", "score": "0.60018426", "text": "def commands\n version = invoke_and_process(\"JSONRPC.Version\")\n if (version[\"version\"] == 2)\n @commands ||= invoke_and_process(\"JSONRPC.Introspect\", :getdescriptions => true)[:commands].map {|c| Xbmc::Command.new(c)}\n else\n @commands ||= invoke_and_process(\"JSONRPC.Introspect\", :getdescriptions => true)[:methods].map {|c| \n attrList = c.at(1)\n attrList[\"command\"] = c.at(0)\n Xbmc::Command.new(attrList)\n }\n end\n end", "title": "" }, { "docid": "7f2ba5fb5c149a44edfd12867b625c12", "score": "0.59991324", "text": "def get_connected_devices\n get_adb_command_output('devices')\n .drop(1)\n .map { |line| line.split[0] }\n .reject { |d| d.nil? || d.empty? }\n end", "title": "" }, { "docid": "05ae896e074be23a1682814dbe4ffd96", "score": "0.5999104", "text": "def devices\n get_data_elements('device')\n end", "title": "" }, { "docid": "9ae0865da373c53f61885101f7bd9ef3", "score": "0.59924424", "text": "def commands\n self.class.instance_variable_get(:@commands)\n end", "title": "" }, { "docid": "4bc70fc16a5721c962e89940537dd8c7", "score": "0.5988807", "text": "def describe\n\t\t\"Show the list of all available commands.\"\n\tend", "title": "" }, { "docid": "c9809f6590ddc37bf54c83960b01db9c", "score": "0.59849566", "text": "def commands(*args)\n @commands = [] if @commands == UNSET_VALUE\n\n if args.empty?\n @commands\n else\n @commands << {cmd: args[0], opts: args[1] || {}}\n end\n end", "title": "" }, { "docid": "475ffa49a03936bc7826b0620089d9d9", "score": "0.5983124", "text": "def help\n if channel.nil? then # list private commands\n commands = self.class.commands.select {|c| [:private, :auto].include?(c[1]) }\n else # list channel commands\n commands = self.class.commands.select {|c| [:channel, :auto].include?(c[1]) }\n end\n automsg \"!#{self.class.get_token} (#{ commands.map{|c| c[0].to_s }.join(\"|\") })\" if commands && commands.size > 0\n end", "title": "" }, { "docid": "2aba3733efd0ca7aac697b4728b76ac2", "score": "0.59762466", "text": "def command_names\n @commands.keys.collect {|key| key.to_s}.sort\n end", "title": "" }, { "docid": "2aba3733efd0ca7aac697b4728b76ac2", "score": "0.59762466", "text": "def command_names\n @commands.keys.collect {|key| key.to_s}.sort\n end", "title": "" }, { "docid": "f63b3876f32db376fde26c5c71b1b253", "score": "0.5970811", "text": "def list_commands\n puts '--- Library: Available user commands ---'.center(70)\n print 'List available user commands:'.ljust(30)\n puts 'downtown_library.list_commands'.rjust(40)\n print 'List all books on all shelves:'.ljust(30)\n puts 'downtown_library.list_books'.rjust(40)\n print 'List all books alphabetically:'.ljust(30)\n puts 'downtown_library.list_books_alpha'.rjust(40)\n print 'List total number of shelves:'.ljust(30)\n puts 'downtown_library.num_shelves'.rjust(40)\n print 'List specific shelf:'.ljust(30)\n puts 'downtown_library.list_shelf([shelf number])'.rjust(40)\n print 'Check out a book:'.ljust(30)\n puts 'downtown_library.check_out([book ID])'.rjust(40)\n print 'Check in a book:'.ljust(30)\n puts 'downtown_library.check_in([book ID])'.rjust(40)\n puts '--- End ---'.center(70)\n end", "title": "" }, { "docid": "a69e0758cbc145b2fa7436a9a52bb2e3", "score": "0.59704745", "text": "def command_names\n @@commands.keys.map { |c| c.to_s }\n end", "title": "" }, { "docid": "a053461cbb3a857550e744cb3877118e", "score": "0.59681964", "text": "def command_names\r\n @commands.keys.collect { |key| key.to_s }.sort\r\n end", "title": "" }, { "docid": "fc2903d078920a0e9371a39569c0d01d", "score": "0.5964368", "text": "def commands\n [:start, :stop, :status, :init, :report, :begin, :end]\n end", "title": "" }, { "docid": "6f34f4295135e1f2198cf11e1152f12e", "score": "0.59641236", "text": "def cmd_list_commands(player, input)\n commands = $commands.keys\n\n print_line commands.join(\" \")\n print_line\nend", "title": "" }, { "docid": "6ddbdeb41e726424de0dbeae6e715622", "score": "0.5953263", "text": "def commands() = %i[]", "title": "" }, { "docid": "d5d13ecd682ca65b3f5ec387b740a1bf", "score": "0.59472543", "text": "def verbs\n COMMANDS.merge(EXTERNAL_COMMANDS)\n end", "title": "" }, { "docid": "098d23569fb18135ecfc1d146a9c6a3e", "score": "0.5938286", "text": "def commands\n\t\t{\n\t\t\t\"sniffer_interfaces\" => \"Enumerate all sniffable network interfaces\",\n\t\t\t\"sniffer_start\" => \"Start packet capture on a specific interface\",\n\t\t\t\"sniffer_stop\" => \"Stop packet capture on a specific interface\",\n\t\t\t\"sniffer_stats\" => \"View statistics of an active capture\",\n\t\t\t\"sniffer_dump\" => \"Retrieve captured packet data to PCAP file\",\n\t\t}\n\tend", "title": "" }, { "docid": "632f1906c6dce100e43866748177d2e5", "score": "0.5932541", "text": "def get_commands\n %w{ choose_forum next_forum prev_forum }\n end", "title": "" }, { "docid": "6e91b49ef9cecbcc042b1fe295e8cdd8", "score": "0.5928386", "text": "def commands\n\t\t{\n\t\t\t\"check\" => \"Check to see if a target is vulnerable\",\n\t\t\t\"exploit\" => \"Launch an exploit attempt\",\n\t\t\t\"rcheck\" => \"Reloads the module and checks if the target is vulnerable\",\n\t\t\t\"rexploit\" => \"Reloads the module and launches an exploit attempt\",\n\t\t}\n\tend", "title": "" }, { "docid": "5d46662d8ca0081a8b65a891ba3f834c", "score": "0.592552", "text": "def commands\n pmgr = GemPlugin::Manager.instance\n list = pmgr.plugins[\"/commands\"].keys\n return list.sort\n end", "title": "" }, { "docid": "276745def7d50d43f8c58155b8324cef", "score": "0.5923049", "text": "def spec_commands\n if (spec = `which spec`.chomp) && !spec.empty?\n return [spec]\n end\n [File.join('bin', 'spec'),\n File.join(Config::CONFIG['bindir'], 'spec')]\n end", "title": "" }, { "docid": "f93e103a61750a7795a2da45bce6d047", "score": "0.5920503", "text": "def showAvailableCommands\r\n evalAvailableCommands\r\n puts \"\\nCommands available:\"\r\n puts\r\n puts \" quit(q): End this command session\"\r\n puts \" usage: Show how to use this program\"\r\n puts \" ruby 'rubycode': run a line of ruby language code\"\r\n puts \" run(r) 'filename': run the commands in a file\"\r\n puts \" record 'filename': records your commands in a file\"\r\n @availableCommands.sort().each { |cmd| puts \" #{cmdString( cmd )}\" }\r\n puts \"\\n\"\r\n end", "title": "" }, { "docid": "3f818e4b55aff14f950b60d82f4308cc", "score": "0.591489", "text": "def listCommands()\n puts(\"q - quit\")\n puts(\"h - help\")\n puts(\"f - feed\")\n puts(\"p - play\")\n puts(\"\")\nend", "title": "" }, { "docid": "4c172033e969c0d8bd3385039e18dac0", "score": "0.5913435", "text": "def command_names\n @commands.keys.collect {|key| key.to_s}.sort\n end", "title": "" }, { "docid": "68cd23ee7ce474a41c9c5a55121f1b4e", "score": "0.59127724", "text": "def valid_commands\n methods.grep(/_command$/).map {|c| c.to_s.gsub(\"_command\", \"\")}\n end", "title": "" }, { "docid": "68cd23ee7ce474a41c9c5a55121f1b4e", "score": "0.59127724", "text": "def valid_commands\n methods.grep(/_command$/).map {|c| c.to_s.gsub(\"_command\", \"\")}\n end", "title": "" }, { "docid": "907eead599951f320bdde3f9184014f8", "score": "0.5912001", "text": "def visible_commands\n visible = {}\n commands.each do |key, command|\n visible[key] = command if command.description && !command.description.empty?\n end\n visible\n end", "title": "" } ]
016ff203c9ebf638c017f80b9d1021fc
Returns a string which describes this task.
[ { "docid": "ec69608a9183e0cfed1c645c5fb64e3a", "score": "0.0", "text": "def description\n \"This task hits the Google API and creates an entity for all discovered subdomains.\"\nend", "title": "" } ]
[ { "docid": "5a52fee7fb53a9f27533fbf67cc21188", "score": "0.799827", "text": "def to_s # Method to display completion status and description of Task\n \"#{represent_status} : #{description}\"\n end", "title": "" }, { "docid": "143fa5cee066761ab85fe41555c8eb9f", "score": "0.7680068", "text": "def task_details_for_log\n \"Node #{@puppet_mclient.node_id}, task #{@task}, manifest \"\\\n \"#{@puppet_mclient.manifest}\"\n end", "title": "" }, { "docid": "7e7e42ecea1f1d0255d46013c21286dc", "score": "0.7404178", "text": "def taskDescription _args\n \"taskDescription _args;\" \n end", "title": "" }, { "docid": "2255171a42000c438bda03cf2c543170", "score": "0.7316715", "text": "def description\n \"This is an example Tapir task. It associates a random host with the calling entity.\"\n end", "title": "" }, { "docid": "1f90a5705b26a9fca695803a8a28146b", "score": "0.7292764", "text": "def exp_task\n\t\texperiments.each do |e|\n\t\t\tif !e.task_desc.nil?\n\t\t\t\te.task_desc + ' '\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "1f26c0c4d3bd8ace3e55142d9eac3e7d", "score": "0.72387326", "text": "def description\n\t\t\"Msf Pro Wrapper Task\"\n\tend", "title": "" }, { "docid": "075e72a6c9fbf5ab4f35c01e366a041b", "score": "0.71553576", "text": "def to_machine # To_machine method to display completion status and description of Task\n \"#{represent_status} : #{description}\"\n end", "title": "" }, { "docid": "3d4a29cf32b9e4b61d95bf89c710c97a", "score": "0.714361", "text": "def description\n\t\t\"Msf Wrapper Task\"\n\tend", "title": "" }, { "docid": "430971277a551df7a435717995789fff", "score": "0.7133372", "text": "def name\n\t\t\t@task\n end", "title": "" }, { "docid": "caaa78160c42abec6086e45895c7e5b3", "score": "0.7100784", "text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.TaskContext #{context}>\"\n end", "title": "" }, { "docid": "a14abf796ca171749692193536516cd5", "score": "0.70201147", "text": "def inspect\n context = @solution.map {|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.TaskContext #{context}>\"\n end", "title": "" }, { "docid": "f3a4c84ffc4fb0678a62686c0ab183bf", "score": "0.70195675", "text": "def description\n \"This task simply attaches a note entity to the current entity.\"\nend", "title": "" }, { "docid": "0482fea6efa7b420c131ed1fb8c158cb", "score": "0.7015218", "text": "def description\n \"This task hits the corpwatch API and adds detail for the organization.\"\nend", "title": "" }, { "docid": "8bec56470e7b4cf2c830db25063f089a", "score": "0.7006205", "text": "def getTaskName\r\n\t\t\t\t\treturn @taskName\r\n\t\t\t\tend", "title": "" }, { "docid": "e27bcbadb83455d770f0fad75b176e5b", "score": "0.6996942", "text": "def description\n \"This is an example Tapir task. It associates a random host with the calling entity.\"\nend", "title": "" }, { "docid": "0d424806418fad799448a50be851ffbb", "score": "0.6971912", "text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.TaskContext #{context}>\"\n end", "title": "" }, { "docid": "56c12114c27e64844855034286a72b6b", "score": "0.69639343", "text": "def to_s\n if completed?\n \"- #{@identifier} -!- #{@estimated_time} -!- #{@priority} -!- #{@completed_at}\\n\"\n else\n \"* #{@identifier} -!- #{@estimated_time} -!- #{@priority}\\n\"\n end\n end", "title": "" }, { "docid": "9658cd6651850b958ff11580ed0152bb", "score": "0.694675", "text": "def to_s\n context = @solution.map {|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.TaskContext #{context}>\"\n end", "title": "" }, { "docid": "1af1c2491a72807f7bdf66947171bdf8", "score": "0.69346523", "text": "def description\n\t\"This task scrapes Hoovers for company info.\"\nend", "title": "" }, { "docid": "62e4b3383eae350c4c97515899f20836", "score": "0.6879938", "text": "def what_task\n if running_task?\n puts \"Current task: \" + get_last_task_name + \", #{(Time.now.to_i - get_last_task_stime.to_i).duration}\"\n else\n puts \"No task running!\"\n end\n end", "title": "" }, { "docid": "6b5148ddcff255930d7659eb9c0d7da2", "score": "0.6846278", "text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Taskrouter.V1.TaskInstance #{values}>\"\n end", "title": "" }, { "docid": "75b87376d8956975bcb154a041fc06dd", "score": "0.68454546", "text": "def task_title\n return @task_title if @task_title\n task.nil? ? \"\" : task.title \n end", "title": "" }, { "docid": "691651228770ce909485966dcff5a480", "score": "0.6843762", "text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Taskrouter.V1.TaskInstance #{values}>\"\n end", "title": "" }, { "docid": "bf2dca73131fcd8ff988f809336d6850", "score": "0.68351305", "text": "def desc(*args)\n Rake.application.DescribeTask(*args)\n end", "title": "" }, { "docid": "5d6637206debaaf39450a005ef3436d0", "score": "0.6822743", "text": "def description\n \"This task can be used to guess usernames, given a user.\"\nend", "title": "" }, { "docid": "68c5326b304da4f274f57c6d85cd0b38", "score": "0.68074805", "text": "def description\n \"This task converts a netblock into host records\"\nend", "title": "" }, { "docid": "3b1f49521543e4626fa829d9d729caac", "score": "0.67849845", "text": "def inspect\n \"<Celluloid::Task:0x#{object_id.to_s(16)} @type=#{@type.inspect}, @running=#{@fiber.alive?}>\"\n end", "title": "" }, { "docid": "ffabf5c4b32b5f33cd989e0a9ab96f85", "score": "0.67673016", "text": "def describe(detail=0, indent=0)\n i = ' ' * indent\n lines = [\"#{i}#{name} (#{self.class}) {\"]\n @tasks.each_value { |t|\n lines << t.describe(detail, indent + 2)\n }\n lines << i + \"}\"\n lines.join(\"\\n\")\n end", "title": "" }, { "docid": "b971d6ebf1fef39798d8b85816fac083", "score": "0.6765918", "text": "def print_task()\n puts @task_name\n puts \" Assigned to: #{@assigned_to}\"\n puts \" Priority: #{@priority}\"\n print \" Start Date: #{@date_start.month}/\"\n print \"#{@date_start.day}/\"\n puts \"#{@date_start.year}\"\n print \" End Date: #{@date_end.month}/\"\n print \"#{@date_end.day}/\"\n puts \"#{@date_end.year}\"\n self.get_duration\n end", "title": "" }, { "docid": "4050cedab20a07ec1ffb468b77996682", "score": "0.67570215", "text": "def to_s\n str = \"Name: #{name}\\n\" \\\n \"Created By: #{creator.name}(#{creator.email})\\n\" \\\n \"Created At: #{created_at.to_s}\\n\" \\\n \"Belongs To: #{task.name}\\n\"\n unless assignee.blank?\n str += \"Assignee: #{assignee.name}(#{assignee.email})\\n\"\n end\n str\n end", "title": "" }, { "docid": "8b49ba59522eea877c20c257041374a3", "score": "0.6742065", "text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Autopilot.V1.TaskStatisticsContext #{context}>\"\n end", "title": "" }, { "docid": "190e963b87984a5df5399652ef602b7a", "score": "0.6700911", "text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Autopilot.V1.TaskStatisticsContext #{context}>\"\n end", "title": "" }, { "docid": "8fc346dc3e5ca7a94b5e6f881d51f9dc", "score": "0.66901654", "text": "def task\n @keys[:task]\n end", "title": "" }, { "docid": "13b30eb5766d810fe8544eee529367b8", "score": "0.66557264", "text": "def details\n\t\t\"#{self.title} - #{self.due_date} - #{self.is_completed}\"\n\tend", "title": "" }, { "docid": "66551e6a4003b0e2e310a4f676dbd61f", "score": "0.6591787", "text": "def task_info_tip(task)\n values = []\n values << [ _(\"Description\"), task.description ]\n comment = task.last_comment\n if comment\n values << [ _(\"Last Comment\"), \"#{ comment.user.shout_nick }:<br/>#{ comment.body.gsub(/\\n/, '<br/>') }\" ]\n end\n\n return task_tooltip(values)\n end", "title": "" }, { "docid": "c0fb385ea89e87cc0cca7ffbe647a486", "score": "0.65542644", "text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Autopilot.V1.TaskStatisticsInstance #{values}>\"\n end", "title": "" }, { "docid": "2d060d2b99dde2a7ff7e4a5d3c0138c6", "score": "0.6548843", "text": "def print_task(task)\n print \"==> \".info, task.bold, \"\\n\"\nend", "title": "" }, { "docid": "360fcd594004906244b0a136d5f24dd0", "score": "0.65383977", "text": "def description\n \"This task searches for common social media profiles\"\nend", "title": "" }, { "docid": "360fcd594004906244b0a136d5f24dd0", "score": "0.65383977", "text": "def description\n \"This task searches for common social media profiles\"\nend", "title": "" }, { "docid": "5e524d673120986f074c05279e6f0bf7", "score": "0.6538305", "text": "def get_identifier\n return @task_arn\n end", "title": "" }, { "docid": "58d91d681b6453b198ba916bfb4e1ebd", "score": "0.6533593", "text": "def to_s\n [@header, @tasks.map(&:to_s), nil].flatten.join(\"\\n\")\n end", "title": "" }, { "docid": "7344978e8f68c118817bd3726c758f0d", "score": "0.6496616", "text": "def current_task_name\n return nil unless enabled?\n self.class.current_task_name\n end", "title": "" }, { "docid": "717207a9e3e71b95de2f78d10f27462e", "score": "0.64946824", "text": "def get_description(task)\n desc = @last_description\n @last_description = nil\n desc\n end", "title": "" }, { "docid": "890215e0758474872b2972a09c9869fb", "score": "0.6493662", "text": "def description\n \"This task hits the Google API and finds related content. Discovered domains are created.\"\nend", "title": "" }, { "docid": "890215e0758474872b2972a09c9869fb", "score": "0.6493662", "text": "def description\n \"This task hits the Google API and finds related content. Discovered domains are created.\"\nend", "title": "" }, { "docid": "1cba3575b4c4af8657389fdfa5007786", "score": "0.6468468", "text": "def task_name\n @default_options.fetch(:name, nil)\n end", "title": "" }, { "docid": "e8669e1f75a1ad1ee4374a4cab746f07", "score": "0.64585805", "text": "def build_run_msg(task)\n date = Time.now.strftime(\"%b %d %H:%M:%S\")\n hostname = Socket.gethostname\n username = Etc.getpwuid(Process.uid).name\n \"#{date} #{hostname} #{$$} (#{username}) JOB (#{task})\"\n end", "title": "" }, { "docid": "c355ac3f7534f710ba7574e981822227", "score": "0.6429899", "text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Taskrouter.V1.TaskInstance #{values}>\"\n end", "title": "" }, { "docid": "5636cba093e3a17686a663fcd1a38129", "score": "0.6428003", "text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Taskrouter.V1.TaskInstance #{values}>\"\n end", "title": "" }, { "docid": "ab969ec1aebfa6209e1652f99574f4dd", "score": "0.6427838", "text": "def DescribeTask(*args)\n descriptionLines = []\n args.each() do |arg|\n if(arg.is_a?(String))\n descriptionLines.push(arg)\n end\n end\n @ProjectFileLoader.CurrentlyLoadedProjectFile().AddTaskDescriptions(descriptionLines)\n end", "title": "" }, { "docid": "b236b52700b0bed73a2e57e42f92e228", "score": "0.6399115", "text": "def task_help(shell, task_name)\n meth = normalize_task_name(task_name)\n task = all_tasks[meth]\n handle_no_task_error(meth) unless task\n\n shell.say \"Usage:\"\n shell.say \" #{banner(task)}\"\n shell.say\n class_options_help(shell, nil => task.options.map { |_, o| o })\n if task.long_description\n shell.say \"Description:\"\n shell.print_wrapped(task.long_description, :ident => 2)\n else\n shell.say task.description\n end\n end", "title": "" }, { "docid": "706ad276f76e43d06a2c118439ec0276", "score": "0.6392707", "text": "def description\n case @status\n when \"running\"\n \"#{@number}: INSTANCE: #{name} - #{@ip} - #{@instance_id} - #{@launching_time}\"\n when \"shutting-down\"\n \"(terminating) INSTANCE: #{name} - #{@ip} - #{@instance_id} - #{@launching_time}\"\n when \"pending\"\n \"(booting) INSTANCE: #{name} - #{@ip} - #{@instance_id} - #{@launching_time}\"\n end\n end", "title": "" }, { "docid": "27b88c5d08ddff7f902c0c757eede93f", "score": "0.6374912", "text": "def to_s\n \"Target - #{@name}\"\n end", "title": "" }, { "docid": "02e1a11a6d66cd4ce5c63aba55107408", "score": "0.63720816", "text": "def task_class_name\n \"#{process_definition_key}::#{activity_id}\"\n end", "title": "" }, { "docid": "a8c856112296fc535e40317473da2df2", "score": "0.6355403", "text": "def info_string\n \"#{step}: #{process}\"\n end", "title": "" }, { "docid": "a58c7ca3dd4b5c353eaf46d958af1b23", "score": "0.63162816", "text": "def to_s\n [\n @name.to_s,\n \" - Time Elapsed: #{duration.round(3)}\",\n \" - Started: #{@start_time.strftime('%T')}\",\n \" - Ended: #{@end_time.strftime('%T')}\"\n ].join(\"\\n\")\n end", "title": "" }, { "docid": "8832a3a0507db3e2f44ba75e09413712", "score": "0.6301531", "text": "def display_task(task)\n\t\t\tsplit_task(task.name).each_with_index do |name_line, line_index|\n\t\t\t\tcol_1 = pad((task.start_time if line_index==0), 5)\n\t\t\t\tcol_2 = pad(name_line, @name_width)\n\t\t\t\tcol_3 = pad((task.elapsed_time if line_index==0), @elapsed_time_width)\n\n\t\t\t\tif task.current? and TrackingConfig[:color_current_task]\n\t\t\t\t\tcurrent_task_color = TrackingConfig[:current_task_color]\n\t\t\t\t\tcurrent_task_color = TrackingConfig.defaults[:current_task_color] unless String.colors.include? current_task_color\n\n\t\t\t\t\tcol_1 = col_1.colorize current_task_color\n\t\t\t\t\tcol_2 = col_2.colorize current_task_color\n\t\t\t\t\tcol_3 = col_3.colorize current_task_color\n\t\t\t\tend\n\n\t\t\t\tputs \"| #{col_1} | #{col_2} | #{col_3} |\"\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "6630d356c1f3a875e5dec4d87153874a", "score": "0.6292381", "text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Autopilot.V1.TaskStatisticsInstance #{values}>\"\n end", "title": "" }, { "docid": "256aff74221914442c8d9431083faf0a", "score": "0.6290517", "text": "def task_description(id)\n task = @xml.search(\"object[@id='#{id}']\")\n title = task.search(\"attribute[@name='title']\")\n clean(title.innerHTML.to_s)\n end", "title": "" }, { "docid": "2075322c8c9e71553d95238a4b6ebca5", "score": "0.62875557", "text": "def to_s\n resolve\n desc.to_s\n end", "title": "" }, { "docid": "52deeaa1df7ee9decf4c822b2fc9fc3f", "score": "0.6287337", "text": "def to_s\n super + \" Task is due: #{@due_date.to_s}.\"\n end", "title": "" }, { "docid": "2b3cfa7b13b1f00a0ca7845235896ac7", "score": "0.6280821", "text": "def to_s\n out = ''\n self.metadata.each{|k,v| out << \"#{k}: #{v}\\n\"}\n out << \"--------------------\\n\"\n self.steps.each{|s| out << s.to_s }\n out\n end", "title": "" }, { "docid": "29662d7026cbedcfa2b856e3060e1a65", "score": "0.62795204", "text": "def to_s ### return all parameters\r\n return \"#{@name} uses a #{@tool} #{@phtest_writer} and can be reached at email: #{@email} or phone: #{@phone} and the total number of all state changes was #{@@totalInstances} workers\"\r\n end", "title": "" }, { "docid": "d6d31519b99f036b40f78f262c6b02a2", "score": "0.62767506", "text": "def details\n return @description + \"; is set to: \" + \"#{@duration}\" + \"hour - at a cost of: \" + \"#{@cost}\"\n end", "title": "" }, { "docid": "8801b629bebd089ffdfe6862a2af6e7b", "score": "0.62725925", "text": "def print_task_info(task:)\n path = task.files.first['path'].chomp(\"/tasks/#{task.files.first['name']}\")\n module_dir = if path.start_with?(Bolt::Config::Modulepath::MODULES_PATH)\n \"built-in module\"\n else\n path\n end\n @stream.puts task.to_h.merge(module_dir: module_dir).to_json\n end", "title": "" }, { "docid": "079a1ff9b9c28b2fce3d3620853e1160", "score": "0.6269338", "text": "def task\n return @task\n end", "title": "" }, { "docid": "3a6651e01de779da57316c5f02c52b8a", "score": "0.6247868", "text": "def definition; Mrowka::Tasks[self.type.to_sym]; end", "title": "" }, { "docid": "d66bc90ed68944f6ef62a2a4aa1b1a24", "score": "0.6237618", "text": "def details\n return @description + \": \" +\n @duration.to_s + \" hour for \" +\n @cost.to_s + \" euros.\"\n end", "title": "" }, { "docid": "59a4c0eec269dbc48ae92bcba0318a66", "score": "0.62211365", "text": "def dump_info_to\n \"to task #{ target_task_id } as '#{ status }'#{ ' >obsolete<' if obsolete }\"\n end", "title": "" }, { "docid": "5c122c2f8f8a7c118a174332c9a5c26c", "score": "0.62174094", "text": "def help_task(task)\n package, name = Bee::Util::get_package_name(task)\n if not @packages[package]\n @packages[package] = Bee::Task::PackageManager.load_package(package, @build)\n end\n help = {}\n if name == '?'\n methods = @packages[package].class.public_instance_methods(false)\n for method in methods\n help[method] = @packages[package].class.method_info(method).comment\n end\n return help\n else\n error \"Task '#{name}' not found in package '#{package}'\" if\n not @packages[package].respond_to?(name)\n help[task] = @packages[package].class.method_info(name).comment\n end\n return help\n end", "title": "" }, { "docid": "0605b8fb34825033d9688f64042f6e35", "score": "0.6200908", "text": "def info\n str = <<INFO\nScenario: #{ name }\nSummary: #{ summary }\nDescription: #{ description_without_summary }\nINFO\n variables.each do |key, value|\n str << \"#{ key }: #{ value.inspect }\\n\"\n end\n str\n end", "title": "" }, { "docid": "95e06758eee61376da49ded6d06226dd", "score": "0.6196592", "text": "def to_s\n \"workflow #{ id } from task #{ source_task_id } to task #{ target_task_id } with status <#{ status_id }>\"\n end", "title": "" }, { "docid": "04f3d96012b52ca02848ba8099220eb4", "score": "0.61933494", "text": "def create_task_hash name\n { name: name,\n schedule: \"To-Do\",\n priority: \"Normal\",\n due_days: 2,\n due_hours: \"0\",\n due_minutes: \"00\",\n followup: \"\",\n assigned_to: \"Negotiator\",\n fees_assigned: \"0.00\",\n task_description: \"#{name} task description\",\n letter_agreement: \"\",\n }\nend", "title": "" }, { "docid": "7a7f86ea9ace21dbd0a3a51f66339d62", "score": "0.61926717", "text": "def label(task)\n label = task.label if task.respond_to?(:label)\n label || task.class.to_s.gsub(CLASS_NAME_REGEXP, '')\n end", "title": "" }, { "docid": "5c3337c1aacdc65d3d2d93bcbe71d3c7", "score": "0.6182015", "text": "def task_status\n return '' if description.blank?\n\n sum = tasks.summary\n \"#{sum.item_count} tasks (#{sum.complete_count} completed, #{sum.incomplete_count} remaining)\"\n end", "title": "" }, { "docid": "ee96181f498eed2f633efdb2b302f0b6", "score": "0.6178875", "text": "def desc(task, description)\n Task.new(task).description = description\n end", "title": "" }, { "docid": "7d52950b97412a43111956cd6ef5f0fe", "score": "0.6163377", "text": "def task_name\n raise \"This Stage has not been bound to a name\" if @name.nil?\n name.name\n end", "title": "" }, { "docid": "ce93a85536002e35b2b33dd2ed14cd3b", "score": "0.6162429", "text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext #{context}>\"\n end", "title": "" }, { "docid": "e4ea57aade0c3ae4a6ddcafcb842353c", "score": "0.61553395", "text": "def task_definition_id\n return @task_definition_id\n end", "title": "" }, { "docid": "05046bc64773b7ad4835bf77cea768f5", "score": "0.6152667", "text": "def details\n return \"ID = #{@id}\\n\" + \n \"Name = #{@name}\\n\" + \n \"Topic = #{@topic}\\n\" + \n \"Member Count = #{@member_count}\"\n end", "title": "" }, { "docid": "bc1d9b88bef45f499f66c5a30296e3c3", "score": "0.61522526", "text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext #{context}>\"\n end", "title": "" }, { "docid": "274113ed46f57bfa9dff2c6e9caa2001", "score": "0.61415386", "text": "def task_help(name)\n load_tasks\n\n klass, task = find_by_namespace(name)\n\n # set '$thor_runner' to true to display full namespace\n $thor_runner = true\n\n klass.task_help(shell , task)\n end", "title": "" }, { "docid": "30365c06872148e43286b8c29a32971e", "score": "0.6134721", "text": "def task_for_configuration(config_name)\n \"#{@project_name}:#{config_name}\"\n end", "title": "" }, { "docid": "ff9b5a426e08b5d319ba7356b9a74e8c", "score": "0.6124882", "text": "def to_s\n status = done? ? \"[X]\" : \"[ ]\"\n \"#{status} \"\\\n \"Name: #{@name} | \"\\\n \"Description: #{@description[0..20]} | \"\\\n \"Prep: #{@prep_time}\"\n end", "title": "" }, { "docid": "830c15aa5a4d3ae50d07023ec610cde9", "score": "0.6122708", "text": "def timeline_title\n if completed?\n \"Hearing type converted from #{appeal.readable_previous_hearing_request_type_for_task(id)}\"\\\n \" to #{appeal.readable_current_hearing_request_type_for_task(id)}\"\n end\n end", "title": "" }, { "docid": "d1a4f067bd0855d691bf9f8c1e3d27ea", "score": "0.6120691", "text": "def file_name\n \"#{task_name}.rake\"\n end", "title": "" }, { "docid": "9c98ecf0c43e5d2f4ae8ba7db5557fdf", "score": "0.6118438", "text": "def status_message\n (+'').tap do |ret|\n if task.progress\n ret << \"#{(task.progress * 100).to_i}%\"\n ret << ': ' if task.progress_message.present?\n end\n ret << task.progress_message if task.progress_message.present?\n end\n end", "title": "" }, { "docid": "277df2af6c86da2a13b99d661304ebda", "score": "0.611139", "text": "def currentTask _args\n \"currentTask _args;\" \n end", "title": "" }, { "docid": "ae02375e0f32ab0c4a96aae172f39090", "score": "0.6108104", "text": "def description\n project.description\n end", "title": "" }, { "docid": "ae02375e0f32ab0c4a96aae172f39090", "score": "0.6108104", "text": "def description\n project.description\n end", "title": "" }, { "docid": "bb5e4993e48f514763cb307fc051ea7c", "score": "0.6101437", "text": "def description\n\t\t\"This task creates & associates a host for every object it is given.\"\n\tend", "title": "" }, { "docid": "3f11c58a6776445c0d63d266bd0b4fa0", "score": "0.6078244", "text": "def to_s\n context = @solution.map {|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.WorkflowStatisticsContext #{context}>\"\n end", "title": "" }, { "docid": "d1127d85e0703699b6cbdd80f1623fd6", "score": "0.6068266", "text": "def to_s\n context = @solution.map {|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext #{context}>\"\n end", "title": "" }, { "docid": "b85e6fc0ea681eca6fad457dc9170788", "score": "0.60670894", "text": "def description\n \"This task hits the Corpwatch API and creates an object for all found entities.\"\nend", "title": "" }, { "docid": "c6801e1af27d48684f7cab9088d3a5c3", "score": "0.6061789", "text": "def getTaskURL\r\n\t\t\t\t\treturn @taskUrl\r\n\t\t\t\tend", "title": "" }, { "docid": "f87ce79839f725b324eda1d18c901c83", "score": "0.6054542", "text": "def description\n return @description\n end", "title": "" }, { "docid": "f87ce79839f725b324eda1d18c901c83", "score": "0.6054542", "text": "def description\n return @description\n end", "title": "" }, { "docid": "f87ce79839f725b324eda1d18c901c83", "score": "0.6054542", "text": "def description\n return @description\n end", "title": "" }, { "docid": "f87ce79839f725b324eda1d18c901c83", "score": "0.6054542", "text": "def description\n return @description\n end", "title": "" }, { "docid": "f87ce79839f725b324eda1d18c901c83", "score": "0.6054542", "text": "def description\n return @description\n end", "title": "" }, { "docid": "f87ce79839f725b324eda1d18c901c83", "score": "0.6054542", "text": "def description\n return @description\n end", "title": "" } ]
3700c095e022f30d2a2a9bfd98a18efe
DELETE /body_materials/1 DELETE /body_materials/1.xml
[ { "docid": "9a660ab411b991c2968fd9cb7189ed73", "score": "0.7715465", "text": "def destroy\n @body_material = BodyMaterial.find(params[:id])\n @body_material.destroy\n\n respond_to do |format|\n format.html { redirect_to(body_materials_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "4a8ec1fab31d3493e8061b3616f76f83", "score": "0.73584646", "text": "def destroy\n @boat_body_material = BoatBodyMaterial.find(params[:id])\n @boat_body_material.destroy\n\n respond_to do |format|\n format.html { redirect_to(boat_body_materials_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3144bdb447da28404bc8a7391cd59a47", "score": "0.68240094", "text": "def destroy\n @material = Material.find(params[:id])\n @material.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_materials_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3144bdb447da28404bc8a7391cd59a47", "score": "0.68240094", "text": "def destroy\n @material = Material.find(params[:id])\n @material.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_materials_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "694f4f51530e11f066bca0f92d984256", "score": "0.67861104", "text": "def destroy\n @material.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "824f7b64dbbbf440a3c3d5f576229e94", "score": "0.67786914", "text": "def destroy\n @material = Material.find(params[:id])\n @material.destroy\n\n respond_to do |format|\n format.html { redirect_to(materials_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "19d16289c159642c84fe0d7e6ef6f626", "score": "0.674526", "text": "def destroy\n @material.destroy\n @testfiles = Testfile.find(:all, :conditions => [\"id = ? AND material_type = ?\", @material.id, @material.material_type])\n @testfiles.each do |testfile|\n testfile.destroy\n end\n respond_to do |format|\n format.html { redirect_to materials_url, notice: 'Material was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9ac6d61c35168943a405923b4372564d", "score": "0.6738529", "text": "def destroy\n @rawmaterial = Rawmaterial.find(params[:id])\n @rawmaterial.destroy\n\n respond_to do |format|\n format.html { redirect_to(rawmaterials_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "05847023cdca02c7377601625ae93950", "score": "0.6647942", "text": "def destroy\n @celestial_body = CelestialBody.find(params[:id])\n @celestial_body.destroy\n\n respond_to do |format|\n format.html { redirect_to(celestial_bodies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dc6e0488fe037a6c0b9b5610a8fa5234", "score": "0.66423523", "text": "def destroy\n @billmaterial = Billmaterial.find(params[:id])\n @billmaterial.destroy\n\n respond_to do |format|\n format.html { redirect_to(billmaterials_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e565608e908838e867d9ccd2b0c63dbc", "score": "0.66348386", "text": "def destroy\n @documented_material = DocumentedMaterial.find(params[:id])\n @documented_material.destroy\n\n respond_to do |format|\n format.html { redirect_to documented_materials_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "63c52f9df21593ae98004f0caf92c3bd", "score": "0.6617608", "text": "def destroy\n @entrada_material = EntradaMaterial.find(params[:id])\n @entrada_material.destroy\n\n respond_to do |format|\n format.html { redirect_to(entrada_materials_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a9451384c96b37a78347168c5e34ebaa", "score": "0.6593311", "text": "def destroy\n @material.destroy\n resond_with :materials\n end", "title": "" }, { "docid": "ec44a5f0bc1573f4a2a338d8c3efa251", "score": "0.6590466", "text": "def destroy\n @antibody = Antibody.find(params[:id])\n @antibody.destroy\n\n respond_to do |format|\n format.html { redirect_to(antibodies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bc76280e5ce59cc7cce0d55faf5a814d", "score": "0.6576495", "text": "def destroy\n @matter = matter.find(params[:id])\n @matter.destroy\n\n respond_to do |format|\n format.html { redirect_to(matters_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2ac3f1169ccc7efa8466bc4c55e714ec", "score": "0.657173", "text": "def destroy\n @material = Material.find(params[:id])\n @material.destroy\n head :no_content\n end", "title": "" }, { "docid": "1915a9764cbd602652ebf34aa0fd07c1", "score": "0.65585566", "text": "def destroy\n @body = Body.find(params[:id])\n @body.destroy\n\n respond_to do |format|\n format.html { redirect_to(bodies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2a2ecb16eb42e5e24552cbf7f4aed3e3", "score": "0.6554472", "text": "def destroy\n @sent_material = SentMaterial.find(params[:id])\n @sent_material.destroy\n\n respond_to do |format|\n format.html { redirect_to sent_materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1c22a0945ac37f41e54cd5c335158344", "score": "0.6457911", "text": "def destroy\n @item_material = ItemMaterial.find(params[:id])\n @item_material.destroy\n\n respond_to do |format|\n format.html { redirect_to item_materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6f17dc049ceff2224a51a9a9aaf75bf3", "score": "0.6440674", "text": "def destroy\n @reference_material = ReferenceMaterial.find(params[:id])\n @reference_material.destroy\n\n respond_to do |format|\n format.html { redirect_to reference_materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "88012ef642d9dda544972818d2cb1f75", "score": "0.64083827", "text": "def destroy\n @raw_material.update(deleted: 1)\n \n respond_to do |format|\n format.html { redirect_to raw_materials_url, notice: 'تم حذف المادة الخام بنجاح.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a85460b88e5186af62e129a51b33f4a4", "score": "0.63932866", "text": "def destroy\n\t\t@material = Material.find(params[:id])\n#\t\tredirect_to(@material, :notice => 'NOTICE: During initial testing, the deletion of objects has been turned off.')\n#\t\treturn\n\t\tBrowse.material_changed(nil, @material.to_solr())\n\t\tsolr().remove_object(@material.to_solr())\n\t\t@material.remove_references()\n\t\t@material.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to({:controller => 'admin', :action => 'index'}) }\n\t\tend\n\tend", "title": "" }, { "docid": "aa2ceea9e7e14052eb6773327fbab1d1", "score": "0.6393133", "text": "def destroy\n @job_material = JobMaterial.find(params[:id])\n @job_material.destroy\n\n respond_to do |format|\n format.html { redirect_to(job_materials_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e36f7626510d40594c73ea7e7bb12346", "score": "0.63562286", "text": "def destroy\n @body_weight.destroy\n respond_to do |format|\n format.html { redirect_to body_weights_url, notice: 'Body weight was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7cb95ecdbcce4b09e7bc60f3dbf5aac9", "score": "0.63481474", "text": "def destroy\n @raw_material = RawMaterial.find(params[:id])\n @raw_material.destroy\n\n respond_to do |format|\n format.html { redirect_to raw_materials_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "1a4facede73278121bdb6dd6c2f6add8", "score": "0.63403213", "text": "def destroy\n @issue_raw_material = IssueRawMaterial.find(params[:id])\n @issue_raw_material.destroy\n\n respond_to do |format|\n format.html { redirect_to(issue_raw_materials_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "251ae5b2ff0cf0159024ec4f0919fb92", "score": "0.6313374", "text": "def destroy\n @material.destroy\n respond_to do |format|\n format.html { redirect_to materials_url, notice: '删除原材料档案成功!' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "24d996d3a0213251b825dd8937d2f54a", "score": "0.6298844", "text": "def destroy\n @embody = Embody.find(params[:id])\n @embody.destroy\n\n respond_to do |format|\n format.html { redirect_to embodies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "04ce29465b5a20fbf1c6b314b4e072f5", "score": "0.628308", "text": "def destroy\n @material = Material.find(params[:id])\n @material.destroy\n\n respond_to do |format|\n format.html { redirect_to materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "04ce29465b5a20fbf1c6b314b4e072f5", "score": "0.628308", "text": "def destroy\n @material = Material.find(params[:id])\n @material.destroy\n\n respond_to do |format|\n format.html { redirect_to materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "04ce29465b5a20fbf1c6b314b4e072f5", "score": "0.628308", "text": "def destroy\n @material = Material.find(params[:id])\n @material.destroy\n\n respond_to do |format|\n format.html { redirect_to materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "690b637d9911a7e1fe0aa0881fb5451e", "score": "0.62813854", "text": "def destroy\r\n @bodypart = Bodypart.find(params[:id])\r\n @bodypart.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to bodyparts_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "1199b8bdb391fcd002b25ed44207b1df", "score": "0.62737644", "text": "def destroy\n @type_material = TypeMaterial.find(params[:id])\n @type_material.destroy\n\n respond_to do |format|\n format.html { redirect_to type_materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2aa07add95993a8a7d015dd684b94d03", "score": "0.62656736", "text": "def destroy\n @material.destroy\n respond_to do |format|\n format.html { redirect_to materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0eaaac8059424bc7afc9f75502af5ee", "score": "0.62576467", "text": "def destroy\n @consumable_material.destroy\n respond_to do |format|\n format.html { redirect_to consumable_materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3ed8e81d4303b765583512576708b087", "score": "0.62467307", "text": "def destroy\n @material_type = MaterialType.find(params[:id])\n @material_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(material_types_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6815eaccf3a4f827a84dcf956174848b", "score": "0.6235734", "text": "def destroy\n @antibody = Antibody.find(params[:id])\n @antibody.destroy\n\n respond_to do |format|\n format.html { redirect_to antibodies_url, notice: 'Antibody was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2c9b159ed37883c4bbd4873bf14941dd", "score": "0.623094", "text": "def destroy\n @material.destroy\n respond_to do |format|\n format.html { redirect_to materials_url, notice: 'Fördermaterial wurde gelöscht.' }\n end\n end", "title": "" }, { "docid": "5ae365f3df8759d9b26f278e06bf7824", "score": "0.62273526", "text": "def destroy\n @body_shape = BodyShape.find(params[:id])\n @body_shape.destroy\n\n respond_to do |format|\n format.html { redirect_to(body_shapes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "62237e19f85a8916229fe99420030c7a", "score": "0.6227151", "text": "def destroy\n @affected_body_part.destroy\n respond_to do |format|\n format.html { redirect_to affected_body_parts_url, notice: 'Affected body part was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "533732a37a90a97a692e3975ffdcc60d", "score": "0.62128943", "text": "def destroy\r\n @body_system = BodySystem.find(params[:id])\r\n @body_system.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to body_systems_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "c14c5e16d0f0fa028fdd09fb2ea307d8", "score": "0.6211154", "text": "def destroy\r\n @request_material.destroy\r\n respond_to do |format|\r\n format.html { redirect_to request_materials_url, notice: 'Request material was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "8f96e685ba5e075a6009e8a1de24e957", "score": "0.6202424", "text": "def destroy\n @applied_material = AppliedMaterial.find(params[:id])\n @applied_material.destroy\n end", "title": "" }, { "docid": "b9a83493f601442966c14dfd59e2ffb8", "score": "0.6197786", "text": "def destroy\n Umaterial.find(params[:id]).destroy\n render json: 'deleted'\n end", "title": "" }, { "docid": "9681069774c25ffd8e3885db0d8531b6", "score": "0.61840034", "text": "def destroy\n @item = Item.find(params[:id])\n @item.item_attachments.all.find(params[:attachment_id]).destroy\n end", "title": "" }, { "docid": "b07534e03b889ec0e832bb58888828ba", "score": "0.61770433", "text": "def destroy\n @material_actual = MaterialActual.find(params[:id])\n @material_actual.destroy\n\n respond_to do |format|\n format.html { redirect_to(material_actuals_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "42362a0b80a04916fcc2ed918ccacca7", "score": "0.61739993", "text": "def delete\n delete_request($uri + \"/#{$key}/groups/#{group.id}/scenes/#{id}\")\n Scene.update_cache\n end", "title": "" }, { "docid": "657fdb87263eadfe925b1cde9322341f", "score": "0.6169491", "text": "def destroy\n @material.destroy\n respond_to do |format|\n format.html { redirect_to project_materials_url(@project) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a80def84ea23217edae634ee9fbca9c5", "score": "0.6167507", "text": "def destroy\n @used_material_item = UsedMaterialItem.find(params[:id])\n @used_material_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(used_material_items_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9307d4bd59843d110e9828f2e899cd38", "score": "0.6153308", "text": "def destroy\n @content = Content.find(params[:id])\n @course = @content.course_id\n LearningMaterial.destroy_content(@content)\n @content.destroy\n\n respond_to do |format|\n format.html { redirect_to course_path(@course), notice: 'El tema ha sido exitosamente eliminado' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4e596b6b7932559044cb68972ef979f9", "score": "0.6151989", "text": "def destroy\n @matter = Matter.find(params[:id])\n @matter.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_matters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5fa86087dedbc9926945f23586720060", "score": "0.6147832", "text": "def destroy\n @body_mass_percentile = BodyMassPercentile.find(params[:id])\n @body_mass_percentile.destroy\n\n respond_to do |format|\n format.html { redirect_to(body_mass_percentiles_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a75336750f48b4da69c7005cebcf9d68", "score": "0.61396664", "text": "def destroy\n @located_material = LocatedMaterial.find(params[:id])\n @located_material.destroy\n\n respond_to do |format|\n format.html { redirect_to located_materials_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "afe94ecbf570007b0d803bfa9541fa5e", "score": "0.61392003", "text": "def remove(material)\n end", "title": "" }, { "docid": "d9c9d082e72ca6ebd31e19d03558bbd9", "score": "0.61376023", "text": "def destroy\n @ezr_content_object_attribute = EzrContentObjectAttribute.find(params[:id])\n @ezr_content_object_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(ezr_content_object_attributes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c1790f09e13c35cccdf252c49ce0fd35", "score": "0.6126064", "text": "def destroy\n if @pattern\n @materials = @pattern.materials.find_by(id: params[:id])\n else\n @material = Material.find_by(id: params[:id])\n end\n @material.destroy\n end", "title": "" }, { "docid": "09ad36beb7928f6eaa4fb665096f4561", "score": "0.61130035", "text": "def destroy\n @contract_material.destroy\n\n respond_to do |format|\n format.html { redirect_to contract_materials_url(:contract_id => @contract_material.contract_id) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cd165a951d71b63b481761507651d00a", "score": "0.6112688", "text": "def destroy \n Block.connection.execute(\"delete from blocks where id in (#{params[:id].join(',')})\") unless params[:id].blank?\n respond_to do |format|\n format.html { redirect_to(blocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c6e5dcd000fc4a574f31663c7820a980", "score": "0.6107154", "text": "def remove_materials_standard\n\n uri = params[:identifier]\n type = params[:material_type]\n id = params[:material_id]\n\n existing = StandardStatement.find_by_uri_and_material_type_and_material_id(\n uri,\n type,\n id )\n if existing.nil?\n render json: { :message => \"No existing standard statement to delete.\" },\n :status => 200\n else\n existing.destroy\n\n render json: { :message => \"Successfully removed standard.\" },\n :status => 200\n end\n end", "title": "" }, { "docid": "4a6a18b2d581c906da7533f399bb57e2", "score": "0.61018014", "text": "def destroy\n @glaze_material.destroy\n respond_to do |format|\n format.html { redirect_to glaze_materials_url, notice: 'Glaze material was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "19268d5f0be1f249b3d08046d05b5a00", "score": "0.60664976", "text": "def destroy\n @materials_collection = MaterialsCollection.find(params[:id])\n @materials_collection.destroy\n respond_to do |format|\n format.html { redirect_to materials_collections_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5102fcb0f9654d97898b2b82b8773bf7", "score": "0.6060375", "text": "def destroy\n @content_block = ContentBlock.find(params[:id])\n @content_block.destroy\n\n respond_to do |format|\n format.html { redirect_to(content_blocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d15d0da8c0ddaf5fdc210c856a9a4fbe", "score": "0.6053562", "text": "def destroy\n puts \"********************in distroy****\"\n @course_material.destroy\n respond_to do |format|\n format.html { redirect_to course_materials_url, notice: 'Course material was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e76d409e79cc96946b3cb49acc04d5bd", "score": "0.6053239", "text": "def destroy\n @material.destroy\n respond_to do |format|\n format.html { redirect_to materials_url, notice: 'Material was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e76d409e79cc96946b3cb49acc04d5bd", "score": "0.6053239", "text": "def destroy\n @material.destroy\n respond_to do |format|\n format.html { redirect_to materials_url, notice: 'Material was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e76d409e79cc96946b3cb49acc04d5bd", "score": "0.6053239", "text": "def destroy\n @material.destroy\n respond_to do |format|\n format.html { redirect_to materials_url, notice: 'Material was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "52301cec048933de02e537ad707a1080", "score": "0.6052163", "text": "def destroy\n @material_element.destroy\n end", "title": "" }, { "docid": "93cdfd22795da40f1c9ac832a5e7a6a7", "score": "0.6045171", "text": "def destroy\n @material.destroy\n respond_to do |format|\n format.html { redirect_to materiais_url, notice: t('messages.delecao_sucesso', :model => \"Material\") }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "72685b967eba45dbe124d08c5f459c52", "score": "0.6044248", "text": "def destroy\n @material_category = MaterialCategory.find(params[:id])\n @material_category.destroy\n\n respond_to do |format|\n format.html { redirect_to(material_categories_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1825a2b7538876fa7da4a900c54d97bc", "score": "0.6040992", "text": "def destroy\n @type_material.destroy\n respond_to do |format|\n format.html { redirect_to type_materials_url, notice: 'Type material was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1825a2b7538876fa7da4a900c54d97bc", "score": "0.6040992", "text": "def destroy\n @type_material.destroy\n respond_to do |format|\n format.html { redirect_to type_materials_url, notice: 'Type material was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6d3d5c2903da04e5086694ef9dd1249d", "score": "0.6039364", "text": "def delete\n api_xml(category(target),:delete) if options.data or options.category\n if options.itemdef\n parse_itemdef\n uid=find_definition_uid_by_name(itemdef.name)\n response=admin_xml(\"/itemDefinitions/#{uid}\")\n verbose \"About to delete: #{REXML::XPath.first(response,'//Name/text()').value} item definition.\\n\"\n admin_xml(\"/itemDefinitions/#{uid}\",\n :delete) if itemdef.name\n end\n end", "title": "" }, { "docid": "4ed332483459da6205d34d3c015d9ee9", "score": "0.60392886", "text": "def destroy\n @matter = Matter.find(params[:id])\n @matter.destroy\n\n respond_to do |format|\n format.html { redirect_to matters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e13fb4a48d3dbc1e092fd22bab0eeadc", "score": "0.6027869", "text": "def destroy\n @body.destroy\n respond_to do |format|\n format.html { redirect_to bodies_url, notice: 'Body was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "44b318ce24c007da71a8d0462ec015c4", "score": "0.6026872", "text": "def destroy\n @learning_material = LearningMaterial.find(params[:id])\n @learning_material.destroy\n\n respond_to do |format|\n format.html { redirect_to learning_materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "67e4dd702f7a422084e762757cf6c373", "score": "0.601479", "text": "def destroy\n @fitting_material.destroy\n respond_to do |format|\n format.html { redirect_to fitting_materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ae3f248a9777c180221b635b67dc53df", "score": "0.6013903", "text": "def destroy\n @material = Material.find(params[:id])\n @material.destroy\n respond_to do |format|\n format.html { redirect_to materials_path, notice: 'Equipment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9fdcefaa222cc6beeb927edbfb8e146c", "score": "0.6012757", "text": "def destroy\n @sale_material.destroy\n respond_to do |format|\n format.html { redirect_to sale_materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2c5551a6cec6eccfff55eae40a24e69f", "score": "0.60118484", "text": "def destroy\n @bodypart.destroy\n respond_to do |format|\n format.html { redirect_to bodyparts_url, notice: 'Bodypart was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9285e53c2ffd52042f53228d888c462a", "score": "0.60074395", "text": "def destroy1\n @smile = Smile.find(params[:id])\n @smile.destroy\n\n respond_to do |format|\n format.html { redirect_to(smiles_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.6006767", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "8ed0f3928c52971005fa20a519b93697", "score": "0.6005459", "text": "def destroy\n @bbs_body = BbsBody.find(params[:id])\n @bbs_body.destroy\n\n respond_to do |format|\n format.html { redirect_to bbs_bodies_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "8977cd26b8a47d274685c32cf365d416", "score": "0.5993935", "text": "def destroy\n get_event\n @event_matter = @event.matters.find(params[:id])\n @event_matter.document = nil # remove the attachment first\n @event_matter.save\n @event_matter.destroy\n end", "title": "" }, { "docid": "a45321065cc9e0e3b3d157817476ca4f", "score": "0.5992213", "text": "def destroy\n logger.info(\"blaaaaaaaa\")\n @forum_attachment = ForumAttachment.find(params[:id])\n @forum_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(forum_attachments_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d257d62837f2e1218d411c8d0b354b12", "score": "0.5990043", "text": "def destroy\n request.format = 'xml'\n @m3_level = M3Level.find(params[:id])\n @m3_board = M3Board.find(@m3_level.m3_board_id)\n @m3_level.destroy\n @m3_board.destroy\n @data = '<success status=\"ok\">'\n respond_with(@data)\n end", "title": "" }, { "docid": "239674753bf90f9e5e57c8889cbee5fa", "score": "0.5982346", "text": "def destroy\n @ebm = Ebm.find(params[:id])\n @ebm.destroy\n\n respond_to do |format|\n format.html { redirect_to ebms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cdd23683923e27ef9708c977c191f875", "score": "0.59820455", "text": "def destroy\n @item_lines = ItemLine.find(params[:id])\n @item_lines.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "f4d5f7f45ac23c3f4ad5c173e791c78d", "score": "0.59781903", "text": "def delete_bodysize_files\r\n FileUtils.rm_rf(\"#{BODYSIZE_DATA_STORAGE_PATH}/#{id}\")\r\n end", "title": "" }, { "docid": "44021fca51f36daa55e7bb406e0aa98f", "score": "0.59779555", "text": "def destroy\n @matter.destroy\n respond_to do |format|\n format.html { redirect_to matters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "44021fca51f36daa55e7bb406e0aa98f", "score": "0.59779555", "text": "def destroy\n @matter.destroy\n respond_to do |format|\n format.html { redirect_to matters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d2d6590390bffa55b55040d63f71c9db", "score": "0.59725153", "text": "def destroy\n @materials_type.destroy\n respond_to do |format|\n format.html { redirect_to materials_types_url, notice: 'Materials type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f85db27f0cbc2af8252915fd85747902", "score": "0.5972453", "text": "def destroy\n @raw_material.destroy\n end", "title": "" }, { "docid": "f9f9b53bbb66942fa11bb8757aa791a5", "score": "0.59722364", "text": "def destroy\n @material = Tour.find(params[:tour_id]).material.where(id: params[:id]).first\n @material.destroy\n\n respond_to do |format|\n format.html { redirect_to materials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "50097c1a609bf10073e547238737f6f3", "score": "0.59697586", "text": "def destroy\n @matrix_content_type = MatrixContentType.find(params[:id])\n @matrix_content_type.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_matrix_content_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b3a5d864f06746858ec2225bf5399dcb", "score": "0.5967043", "text": "def destroy\n @magazine = Magazine.find(params[:id])\n @magazine.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_magazines_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "454d0d1087f55ca781eca8db16f0d31b", "score": "0.5955347", "text": "def destroy\n @material.destroy\n respond_to do |format|\n flash[:notice] = \"Inventory successfully updated.\"\n format.html { redirect_to materials_url, notice: 'Material was successfully removed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ddd04f0f0316b18915a4932cf66e3acd", "score": "0.59541816", "text": "def destroy\n @matter = Matter.find(params[:id])\n @matter.destroy\n \n respond_to do |format|\n format.html { redirect_to matters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "63c342b3a3f9ae72de4ffe2488bf6604", "score": "0.59540844", "text": "def destroy\n @antibody.destroy\n respond_to do |format|\n format.html { redirect_to antibodies_url, notice: 'Antibody was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "00030b9bfa985463030a72be5644ff26", "score": "0.59508705", "text": "def destroy\n @armor.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "bd141671efab133d62696e2975060714", "score": "0.59468067", "text": "def destroy\n @stored_material.destroy\n respond_to do |format|\n format.html { redirect_to stored_materials_url, notice: 'Stored material was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df58e48a8bb0986cbbab4de8ab37761e", "score": "0.5944109", "text": "def delete_mutant(m_id)\n\n request = API_URL + \"mutants/#{m_id}\"\n @response = RestClient.delete request\n log_mutant(\"deleted\")\n return\nend", "title": "" } ]
26aae0123f755dac1c02cfb52a183a55
Central update, that works through all the mixin updates
[ { "docid": "a513af90ab35b92e98dd0aa9f74a8228", "score": "0.0", "text": "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n # All done if we're still moving\n return if movable_moving?\n\n # We've reached the end of our last movement, so pick a new destination\n\n # Pick a side to move to\n speed = 80 + 40.randomize(:ratio)\n case 4.randomize(:ratio).to_i\n when 0\n movable_location(0, (args.grid.h - @h - 10).randomize(:ratio), speed)\n when 1\n movable_location((args.grid.w - @w).randomize(:ratio), 0, speed)\n when 2\n movable_location((args.grid.w - @w), (args.grid.h - @h - 10).randomize(:ratio), speed)\n when 3\n movable_location((args.grid.w - @w).randomize(:ratio), (args.grid.h - @h - 10), speed)\n end\n\n # And give it a new kick of spin\n movable_spin((50 + 30.randomize(:ratio)).randomize(:sign))\n\n end", "title": "" } ]
[ { "docid": "cb2162d3a1fd3434effd12aa702f250f", "score": "0.6929733", "text": "def update() end", "title": "" }, { "docid": "9f9a41a48a178283b3abec1599c9dcf0", "score": "0.6853206", "text": "def update\r\n super\r\n end", "title": "" }, { "docid": "8c7fce96cd02d1aeaedd78c6205de412", "score": "0.68294454", "text": "def update; update!; end", "title": "" }, { "docid": "8c7fce96cd02d1aeaedd78c6205de412", "score": "0.68294454", "text": "def update; update!; end", "title": "" }, { "docid": "5ca2caa1a207739e77f437de35e41cf1", "score": "0.6824354", "text": "def update ; end", "title": "" }, { "docid": "102fb8400bcdb9e8fa9c871265ef6c55", "score": "0.6804881", "text": "def update\n\t\tsuper\n\tend", "title": "" }, { "docid": "102fb8400bcdb9e8fa9c871265ef6c55", "score": "0.6804881", "text": "def update\n\t\tsuper\n\tend", "title": "" }, { "docid": "42c60da3ecc7672a1b014157e51a82d4", "score": "0.6804237", "text": "def update\n # update execution\n update_execution\n # call superclass method\n super\n end", "title": "" }, { "docid": "d694448b7e9b599161522edd15f5f40b", "score": "0.6754585", "text": "def update\n \tsuper\n \tend", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.6740493", "text": "def update; end", "title": "" }, { "docid": "6649e23ae4dd426f80be1bf4c834b4a8", "score": "0.67370695", "text": "def update()\n end", "title": "" }, { "docid": "9aafc5babc51a45267196c1ee41da372", "score": "0.67051524", "text": "def update\n install_level_methods\n end", "title": "" }, { "docid": "ce60f292db7097a45dc499861d31cc58", "score": "0.6697804", "text": "def updated_data\n\t super if defined? super\n\tend", "title": "" }, { "docid": "4b14ed86ca8df0880fdfed72382ec79b", "score": "0.6697349", "text": "def update\n # Install in yaourt can be used for update, too\n self.install\n end", "title": "" }, { "docid": "581efef9c2edb5428f48ce257277b75a", "score": "0.6692477", "text": "def update(&block); end", "title": "" }, { "docid": "5e0af7dffaacc3da6ea6f024927dca68", "score": "0.6674949", "text": "def update\n # update only if actove\n super if self.active\n end", "title": "" }, { "docid": "5e0af7dffaacc3da6ea6f024927dca68", "score": "0.6674949", "text": "def update\n # update only if actove\n super if self.active\n end", "title": "" }, { "docid": "5e0af7dffaacc3da6ea6f024927dca68", "score": "0.6674949", "text": "def update\n # update only if actove\n super if self.active\n end", "title": "" }, { "docid": "dbf3adaf64613c3fef4d6d2c6b2cba7d", "score": "0.6667836", "text": "def update ; end", "title": "" }, { "docid": "eef0cf9dc4768ed80bf563cf4e138998", "score": "0.6659577", "text": "def preUpdate()\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "db1d0ba8fe6e0cab79828d519532505c", "score": "0.6620576", "text": "def update\n super\n end", "title": "" }, { "docid": "ef5ee04b5734f1c360d9640033a9a2be", "score": "0.66140544", "text": "def update\n super\n end", "title": "" }, { "docid": "ef5ee04b5734f1c360d9640033a9a2be", "score": "0.66140544", "text": "def update\n super\n end", "title": "" }, { "docid": "8f6f1ec70622ebd51100c9dc09f5f551", "score": "0.6606291", "text": "def update()\n end", "title": "" }, { "docid": "6249943d1eeff63f8f611fcf73254058", "score": "0.65677416", "text": "def update\n \n end", "title": "" }, { "docid": "07a9655addf916aebb65a219cd84adec", "score": "0.65649605", "text": "def update\n super\n \n end", "title": "" }, { "docid": "ca691d60f20384e372bdc98065a87470", "score": "0.65524656", "text": "def update()\n\n end", "title": "" }, { "docid": "205a482f9bdfb11a4a57c511f3086d75", "score": "0.65509576", "text": "def update();end", "title": "" }, { "docid": "2ddd30c0f53c916b7bcf435ad6935d41", "score": "0.653653", "text": "def before_update() end", "title": "" }, { "docid": "2ddd30c0f53c916b7bcf435ad6935d41", "score": "0.653653", "text": "def before_update() end", "title": "" }, { "docid": "41856301264c2ed0e6575416ac0a0fee", "score": "0.65344703", "text": "def base_update\n updaters.each { |updater| updater.update }\n update\n updaters.reject! { |updater| updater.update_completed? }\n end", "title": "" }, { "docid": "545f4954957ca90d5e1cec891ea42946", "score": "0.65228766", "text": "def after_update() end", "title": "" }, { "docid": "545f4954957ca90d5e1cec891ea42946", "score": "0.65228766", "text": "def after_update() end", "title": "" }, { "docid": "da63345424fc9aecef032928485bd149", "score": "0.6505311", "text": "def update\n \n end", "title": "" }, { "docid": "caabce3fd5013061e1298dee080f2194", "score": "0.6497187", "text": "def update\n super if self.active\n end", "title": "" }, { "docid": "caabce3fd5013061e1298dee080f2194", "score": "0.6497187", "text": "def update\n super if self.active\n end", "title": "" }, { "docid": "caabce3fd5013061e1298dee080f2194", "score": "0.6497187", "text": "def update\n super if self.active\n end", "title": "" }, { "docid": "3ce75b16c461369fed98c557ba4efdb0", "score": "0.64897686", "text": "def update\n #\n # NO-OP for simplicity\n #\n end", "title": "" }, { "docid": "f98b1b6659ecc20e553d498bc70fbebb", "score": "0.64689875", "text": "def update!(*)\n raise NotImplementedError\n end", "title": "" }, { "docid": "0d78ffae4d3e4848f398a9ded9beacc5", "score": "0.6465326", "text": "def update \n#--{{{\n init_logging\n updater = Updater::new self\n updater.update\n#--}}}\n end", "title": "" }, { "docid": "72dbc93d7332ebc3a0627981ddc712fd", "score": "0.6457594", "text": "def update\n\t\t\t\tputs \"Not implemented yet\"\n\t\t\tend", "title": "" }, { "docid": "09e0e1c97529002ec644bfc1eb642f04", "score": "0.6446002", "text": "def update\n super\n end", "title": "" }, { "docid": "575f3d0c94f466263e302883e13868a6", "score": "0.6431525", "text": "def _update\n update!\n end", "title": "" }, { "docid": "e33db952ab354b85b157fe1ec9d6f904", "score": "0.64163184", "text": "def update\n self.install(false)\n end", "title": "" }, { "docid": "e33db952ab354b85b157fe1ec9d6f904", "score": "0.64163184", "text": "def update\n self.install(false)\n end", "title": "" }, { "docid": "6eac22c8bcd08a18e5ada52d49e546bc", "score": "0.6414118", "text": "def update\n\n # lets fix this later\n end", "title": "" }, { "docid": "e1f766468b11768b786daa133483b157", "score": "0.6378454", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "3c9838ba31e732a25709f7f82181d684", "score": "0.6347793", "text": "def update(*) end", "title": "" }, { "docid": "31a9232048942cea0c8643f7c8c310fa", "score": "0.6344117", "text": "def update(*args) end", "title": "" }, { "docid": "d9ec7ddecf81af12f0b3b8c8f44deaef", "score": "0.63178664", "text": "def update(opts); end", "title": "" }, { "docid": "2cfbd230e37ca1e65aac410e9d1c5d9b", "score": "0.62884253", "text": "def apply_update(version)\n end", "title": "" }, { "docid": "d19ae5a398e9316cb25b7df3968eba65", "score": "0.62697357", "text": "def update\n colourable_update\n movable_update\n end", "title": "" }, { "docid": "50bbf7c9209140bf1801758d4fe9ea79", "score": "0.62572086", "text": "def update\n # not implemented yet\n end", "title": "" }, { "docid": "50bbf7c9209140bf1801758d4fe9ea79", "score": "0.62572086", "text": "def update\n # not implemented yet\n end", "title": "" }, { "docid": "89e59ef239d16c38d7a2b3ae9ff23b7b", "score": "0.6219812", "text": "def update_internal\n # Does nothing\n end", "title": "" }, { "docid": "e4d321807f2228331e0a15be703fc3cb", "score": "0.62071496", "text": "def do_update\n raise NotImplementedError\n end", "title": "" }, { "docid": "3b112fc5609bf6e0a5e5988ea71375dc", "score": "0.62032", "text": "def refresh\n super 0.1\n end", "title": "" }, { "docid": "bebf9538a37947035ccd2818032ebc40", "score": "0.61980426", "text": "def refresh_support; end", "title": "" }, { "docid": "bebf9538a37947035ccd2818032ebc40", "score": "0.61980426", "text": "def refresh_support; end", "title": "" }, { "docid": "bebf9538a37947035ccd2818032ebc40", "score": "0.61980426", "text": "def refresh_support; end", "title": "" }, { "docid": "bebf9538a37947035ccd2818032ebc40", "score": "0.61980426", "text": "def refresh_support; end", "title": "" }, { "docid": "bebf9538a37947035ccd2818032ebc40", "score": "0.61980426", "text": "def refresh_support; end", "title": "" }, { "docid": "0e78fd5718e68d4584687b4e8b7d068a", "score": "0.6196309", "text": "def update\n\t\t \t\n\t\t end", "title": "" }, { "docid": "996934fd3ad12974d3387fd5b0fd529d", "score": "0.6196285", "text": "def update\n _update\n end", "title": "" }, { "docid": "ed3183b58086f05b7988405471eeca20", "score": "0.6178494", "text": "def before_update(obj); end", "title": "" }, { "docid": "e20cdb844cdf3d843eda2ba70b8e8459", "score": "0.6165643", "text": "def update\n raise \"not implemented\"\n end", "title": "" }, { "docid": "e20cdb844cdf3d843eda2ba70b8e8459", "score": "0.6165643", "text": "def update\n raise \"not implemented\"\n end", "title": "" }, { "docid": "e20cdb844cdf3d843eda2ba70b8e8459", "score": "0.6165643", "text": "def update\n raise \"not implemented\"\n end", "title": "" }, { "docid": "07ef36661a6ac3121102a2a3779a2e3c", "score": "0.61209327", "text": "def _trigger_update_callback; end", "title": "" }, { "docid": "6b8119275b5aa8b261188ac99fc92649", "score": "0.61157143", "text": "def update!\n # Trello doesn't support this yet. But Daniel is working on it as I\n # place this comment here!\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9a39dc978a432c8df1249d8f6bc47e00", "score": "0.0", "text": "def auto_model_params\n params.require(:auto_model).permit(:name, :auto_model_photo, :auto_brand_id)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.67419964", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.674013", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.6734356", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.6591046", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.6502396", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "3a9a65d2bba924ee9b0f67cb77596482", "score": "0.6496313", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.6480641", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.64565", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.6438387", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.63791263", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.63740575", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "9735bbaa391eab421b71a4c1436d109e", "score": "0.6364131", "text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.63192815", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.62991166", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.62978333", "text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "title": "" }, { "docid": "822c743e15dd9236d965d12beef67e0c", "score": "0.6292148", "text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "title": "" }, { "docid": "7f0fd756d3ff6be4725a2c0449076c58", "score": "0.6290449", "text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.6290076", "text": "def valid_params_request?; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.62894756", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "5f16bb22cb90bcfdf354975d17e4e329", "score": "0.6283177", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "1dfca9e0e667b83a9e2312940f7dc40c", "score": "0.6242471", "text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "title": "" }, { "docid": "a44360e98883e4787a9591c602282c4b", "score": "0.62382483", "text": "def allowed_params\n params.require(:allowed).permit(:email)\n end", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.6217549", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "7a218670e6f6c68ab2283e84c2de7ba8", "score": "0.6214457", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "b074031c75c664c39575ac306e13028f", "score": "0.6209053", "text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "title": "" }, { "docid": "0cb77c561c62c78c958664a36507a7c9", "score": "0.6193042", "text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.6177802", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.6174604", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.61714715", "text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "title": "" }, { "docid": "9d589006a5ea3bb58e5649f404ab60fb", "score": "0.6161512", "text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "title": "" }, { "docid": "d578c7096a9ab2d0edfc431732f63e7f", "score": "0.6151757", "text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "title": "" }, { "docid": "38a9fb6bd1d9ae5933b748c181928a6b", "score": "0.6150663", "text": "def safe_params\n params.require(:user).permit(:name)\n end", "title": "" }, { "docid": "7a6fbcc670a51834f69842348595cc79", "score": "0.61461", "text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.61213595", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.6106206", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.6105114", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6089039", "text": "def valid_params?; end", "title": "" }, { "docid": "34d018968dad9fa791c1df1b3aaeccd1", "score": "0.6081015", "text": "def paramunold_params\n params.require(:paramunold).permit!\n end", "title": "" }, { "docid": "6d41ae38c20b78a3c0714db143b6c868", "score": "0.6071004", "text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "49052f91dd936c0acf416f1b9e46cf8b", "score": "0.6019971", "text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "title": "" }, { "docid": "5eaf08f3ad47cc781c4c1a5453555b9c", "score": "0.601788", "text": "def filtering_params\n params.permit(:email, :name)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.6011056", "text": "def check_params\n true\n end", "title": "" }, { "docid": "3b17d5ad24c17e9a4c352d954737665d", "score": "0.6010898", "text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "74c092f6d50c271d51256cf52450605f", "score": "0.6001556", "text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "title": "" }, { "docid": "75415bb78d3a2b57d539f03a4afeaefc", "score": "0.6001049", "text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.59943926", "text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "title": "" }, { "docid": "65fa57add93316c7c8c6d8a0b4083d0e", "score": "0.5992201", "text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "title": "" }, { "docid": "865a5fdd77ce5687a127e85fc77cd0e7", "score": "0.59909594", "text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "ec609e2fe8d3137398f874bf5ef5dd01", "score": "0.5990628", "text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "title": "" }, { "docid": "423b4bad23126b332e80a303c3518a1e", "score": "0.5980841", "text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "title": "" }, { "docid": "48e86c5f3ec8a8981d8293506350accc", "score": "0.59669393", "text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "title": "" }, { "docid": "9f774a9b74e6cafa3dd7fcc914400b24", "score": "0.59589154", "text": "def active_code_params\n params[:active_code].permit\n end", "title": "" }, { "docid": "a573514ae008b7c355d2b7c7f391e4ee", "score": "0.5958826", "text": "def filtering_params\n params.permit(:email)\n end", "title": "" }, { "docid": "2202d6d61570af89552803ad144e1fe7", "score": "0.5957911", "text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "title": "" }, { "docid": "8b571e320cf4baff8f6abe62e4143b73", "score": "0.5957385", "text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "title": "" }, { "docid": "d493d59391b220488fdc1f30bd1be261", "score": "0.5953072", "text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "title": "" }, { "docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a", "score": "0.59526145", "text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "title": "" }, { "docid": "4e6017dd56aab21951f75b1ff822e78a", "score": "0.5943361", "text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.59386164", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "5060615f2c808bab2d45f4d281987903", "score": "0.5933856", "text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "title": "" }, { "docid": "7fa620eeb32e576da67f175eea6e6fa0", "score": "0.59292704", "text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "title": "" }, { "docid": "d9483565c400cd4cb1096081599a7afc", "score": "0.59254247", "text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "title": "" }, { "docid": "f7c6dad942d4865bdd100b495b938f50", "score": "0.5924164", "text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "title": "" }, { "docid": "70fa55746056e81854d70a51e822de66", "score": "0.59167904", "text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.59088355", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.5907542", "text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "753b67fc94e3cd8d6ff2024ce39dce9f", "score": "0.59064597", "text": "def url_whitelist; end", "title": "" }, { "docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c", "score": "0.5906243", "text": "def admin_social_network_params\n params.require(:social_network).permit!\n end", "title": "" }, { "docid": "5bdab99069d741cb3414bbd47400babb", "score": "0.5898226", "text": "def filter_params\n params.require(:filters).permit(:letters)\n end", "title": "" }, { "docid": "7c5ee86a81b391c12dc28a6fe333c0a8", "score": "0.589687", "text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "title": "" }, { "docid": "de77f0ab5c853b95989bc97c90c68f68", "score": "0.5896091", "text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "title": "" }, { "docid": "29d030b36f50179adf03254f7954c362", "score": "0.5894501", "text": "def sensitive_params=(params)\n @sensitive_params = params\n end", "title": "" }, { "docid": "bf321f5f57841bb0f8c872ef765f491f", "score": "0.5894289", "text": "def permit_request_params\n params.permit(:address)\n end", "title": "" }, { "docid": "5186021506f83eb2f6e244d943b19970", "score": "0.5891739", "text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "title": "" }, { "docid": "b85a12ab41643078cb8da859e342acd5", "score": "0.58860534", "text": "def secure_params\n params.require(:location).permit(:name)\n end", "title": "" }, { "docid": "46e104db6a3ac3601fe5904e4d5c425c", "score": "0.5882406", "text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "title": "" }, { "docid": "abca6170eec412a7337563085a3a4af2", "score": "0.587974", "text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "title": "" }, { "docid": "26a35c2ace1a305199189db9e03329f1", "score": "0.58738774", "text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "title": "" }, { "docid": "de49fd084b37115524e08d6e4caf562d", "score": "0.5869024", "text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "title": "" }, { "docid": "7b7ecfcd484357c3ae3897515fd2931d", "score": "0.58679986", "text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "0016f219c5d958f9b730e0824eca9c4a", "score": "0.5867561", "text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "title": "" }, { "docid": "8aa9e548d99691623d72891f5acc5cdb", "score": "0.5865932", "text": "def url_params\n params[:url].permit(:full)\n end", "title": "" }, { "docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3", "score": "0.5864461", "text": "def backend_user_params\n params.permit!\n end", "title": "" }, { "docid": "be95d72f5776c94cb1a4109682b7b224", "score": "0.58639693", "text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "title": "" }, { "docid": "967c637f06ec2ba8f24e84f6a19f3cf5", "score": "0.58617616", "text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "title": "" }, { "docid": "e4a29797f9bdada732853b2ce3c1d12a", "score": "0.5861436", "text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "title": "" }, { "docid": "d14f33ed4a16a55600c556743366c501", "score": "0.5860451", "text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "title": "" }, { "docid": "46cb58d8f18fe71db8662f81ed404ed8", "score": "0.58602303", "text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "title": "" }, { "docid": "7e9a6d6c90f9973c93c26bcfc373a1b3", "score": "0.5854586", "text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "title": "" }, { "docid": "ad61e41ab347cd815d8a7964a4ed7947", "score": "0.58537364", "text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "title": "" }, { "docid": "8894a3d0d0ad5122c85b0bf4ce4080a6", "score": "0.5850427", "text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "title": "" }, { "docid": "53d84ad5aa2c5124fa307752101aced3", "score": "0.5850199", "text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "title": "" } ]
5a6d2b3d69bbb819633e23f415f0fbdb
meth check_parms needs to be called whenever the min_max pRadius have been changed. Normally this is only during reset or initialization could not figure out how to get the constructor to call it or would have done automatically. As it is the constructor sets a flag and any method that may need to have bit_adjusted pRadius dimensions should call check_parms.
[ { "docid": "0def713c2a4423eb6e3412853a529aeb", "score": "0.78377134", "text": "def check_parms\r\n # - - - - - - - - - - - - - - - - - -\r\n if (@needs_check_parms == false)\r\n return false # didn't need to run\r\n else\r\n @needs_check_parms = false\r\n # reset flag so we don't keep\r\n # adjusting the parms which would\r\n # keep deducting the pRadius from\r\n # them.\r\n end #if\r\n\r\n # Swap if needed to make sure min\r\n # really is smallest on beginning\r\n if (@beg_min_radius > @beg_max_radius)\r\n tt = @beg_min_radius\r\n @beg_min_radius = @beg_max_radius\r\n @beg_max_radius = tt\r\n end #if\r\n\r\n # swap if needed to make sure\r\n # min really is smallest on \r\n # beginning\r\n if (@end_min_radius > @end_max_radius)\r\n tt = @end_min_radius\r\n @end_min_radius = @end_max_radius\r\n @end_max_radius = tt\r\n end # if\r\n\r\n \r\n #print \"(check_parms @beg_min_radius=\", pBeg_min_radius, \" bit_radius=\", bit_radius,\")\\n\"\r\n\r\n # Adjust for Bit pRadius\r\n @beg_min_radius += bit_radius\r\n @end_min_radius += bit_radius\r\n @beg_max_radius -= bit_radius\r\n @end_max_radius -= bit_radius\r\n return self\r\n end", "title": "" } ]
[ { "docid": "63ec93168720325eb032362ea093219c", "score": "0.5806253", "text": "def initialize(srcMin=0.0, srcMax=1.0, dstMin=0.0, dstMax=1.0, base=0.001)\n \t\tsuper\n @base = base\n \t\trecalc_internals()\n \tend", "title": "" }, { "docid": "ad9ca0c64abb79f1c8429d390164d84b", "score": "0.57517016", "text": "def initialize(raw_range)\n super()\n @rmin=round_min(raw_range.rmin) if not raw_range.rmin.nil?\n @rmax=round_max(raw_range.rmax) if not raw_range.rmax.nil?\n @lmax=label_step if not raw_range.rmax.nil?\n end", "title": "" }, { "docid": "ecb9a93a35d373c815ecfc92a84566a1", "score": "0.54744947", "text": "def initialize(min_value_range, max_value_range, min_output, max_output, round)\n @min_value_range = min_value_range\n @max_value_range = max_value_range\n @min_output = min_output\n @max_output = max_output\n @round = round\n end", "title": "" }, { "docid": "74eadf27127d6634b42aaefae0bc21d6", "score": "0.54232454", "text": "def define_min_and_max\n @min = acceptable_min\n @max = acceptable_max\n\n # If necessary, adjust a value depending on the other\n @min ||= floor\n @max ||= @min + ceiling || ceiling # rubocop:disable Naming/MemoizedInstanceVariableName\n end", "title": "" }, { "docid": "86a1c0d43e6242a9bf31bb8b8f3bc92d", "score": "0.53794813", "text": "def initialize(params={})\n super\n\n @current_angle = 0\n additional_params = params.fetch(:additional_params, {})\n min_max = additional_params.fetch(:range, {:min => 30, :max => 150})\n @angle_range = Range.new(min_max[:min],min_max[:max])\n end", "title": "" }, { "docid": "57ccfbf47544c0866403f714d278dee0", "score": "0.5357651", "text": "def initialize(p1,r)\r\n \r\n @p1 = p1\r\n @radius = r * 1.0\r\n \r\n end", "title": "" }, { "docid": "e6b9b192ec7d91c6afd4f72c32e7a132", "score": "0.53503144", "text": "def ensure_params_have_values\n @attributes[:lat] = 33.1243208 unless @attributes[:lat].present? \n @attributes[:lon] = -117.32582479999996 unless @attributes[:lon].present? \n @attributes[:radius].present? ? @_search_radius = @attributes[:radius] : self.set_radius\n end", "title": "" }, { "docid": "3851d5c698649bd0704d364828587197", "score": "0.5302977", "text": "def initialize(r)\n\t\t@radius = r\n\tend", "title": "" }, { "docid": "e2adbb9c8d6a365073b65fa50eda5bd5", "score": "0.53016514", "text": "def check_min_max\n\nend", "title": "" }, { "docid": "ee208ace25b0344516521d141a08b961", "score": "0.5293727", "text": "def initialize(*args)\n @options = args.last.is_a?(Hash) ? args.pop : {}\n @args = args\n @args = @args.first if @args.first.is_a?(Array)\n ensure_arg_values_within_valid_bounds unless @options[:ensure_bounds] == false\n end", "title": "" }, { "docid": "c2f3acdc4a91ed77cfa11530a8452e8a", "score": "0.5288058", "text": "def check_limits_on_x_and_y\n\t\tself.x = self.window.limit_max_x if x > self.window.limit_max_x \n\t\tself.y = self.window.limit_min_y if y > self.window.limit_max_y \n\tend", "title": "" }, { "docid": "4b3f34ea41e823e7a7b98fc25dcc5172", "score": "0.52457625", "text": "def initialize(*args)\n x = []\n y = []\n args.each do |arg|\n case arg\n when Boundable\n x += arg.loose_bounds.collect { |p| p.x }\n y += arg.loose_bounds.collect { |p| p.y }\n when Point\n x.push arg.x\n y.push arg.y\n end\n end\n @min = Point.new(x.min, y.min)\n @max = Point.new(x.max, y.max)\n end", "title": "" }, { "docid": "8e7d1365cf835a0282faf99e5494ad2b", "score": "0.5238946", "text": "def initialize(xlimit, ylimit)\n\t\t@xlimit = xlimit.to_i\n\t\t@ylimit = ylimit.to_i\n\t\traise RangeError, \"Zero (0) is not acceptable as a grid\" if @xlimit <= 0 || @ylimit <= 0\n\tend", "title": "" }, { "docid": "f401b1eecd0e0259955b7c323ba3a80b", "score": "0.52245456", "text": "def initialize(min, max, value)\n @min = Osmosis.rational(min)\n @max = Osmosis.rational(max)\n @value = Osmosis.rational(value)\n end", "title": "" }, { "docid": "630c3220a8312bcf891515c21f0b0cf2", "score": "0.5216007", "text": "def set_mask(opts)\n opts = check_params(opts,[:masks])\n super(opts)\n end", "title": "" }, { "docid": "c93d4a5be989beb79d21beb01cf9b59b", "score": "0.51873755", "text": "def initialize mask:\n\t\t\t@mask = mask\n\t\t\tsuper dims: mask.dims\n\t\tend", "title": "" }, { "docid": "8a36423b2c41c67f144f58d15014b7a9", "score": "0.5185353", "text": "def set_bounds( min, max )\n set_min( min )\n set_max( max )\n end", "title": "" }, { "docid": "7e2c6fc298b9a6625eba9d73f961bc29", "score": "0.51812816", "text": "def initialize(radius)\n @radius = radius\n end", "title": "" }, { "docid": "ddf49f43ca2d55c19e41ad46f3550b18", "score": "0.51550543", "text": "def initialize(attributes)\n\t\t\tsuper\n\n\t\t\t# The wrapper to the API does not judge original values, so I initialize them here\n\t\t\t@max_weight ||= 100000000000\n\t\t\t@min_weight ||= 0\n\t\t\t@max_depth ||= 100000000000\n\t\t\t@min_depth \t||= 0\n\t\t\t@max_height ||= 100000000000\n\t\t\t@min_height ||= 0\n\t\t\t@max_width \t||= 100000000000\n\t\t\t@min_width \t||= 0\n\t\t\t@max_value \t||= 100000000000\n\t\t\t@min_value \t||= 0\n\n\t\tend", "title": "" }, { "docid": "6f3777066ca8630519022a7570e40187", "score": "0.51373917", "text": "def post_initialize(params)\n @planner_color_1 = params[:planner_color_1] || ::DotGrid::Color.new(\"CCCCCC\")\n @planner_color_2 = params[:planner_color_2] || ::DotGrid::Color.new(\"0099FF\")\n @grid_color = params[:grid_color] || ::DotGrid::Color.new(\"B3B3B3\")\n @dot_weight = params[:dot_weight] || 1.5\n @spacing = params[:spacing] ? params[:spacing].mm : 5.mm\n add_pattern(::DotGrid::Pattern::SquareGrid.new(params.merge!(:bounds => square_grid_bounds, grid_color: @planner_color_1)))\n add_pattern(::DotGrid::Pattern::DotGrid.new(params.merge!(:bounds => dot_grid_bounds)))\n end", "title": "" }, { "docid": "66cfcf921b205e4a03f36ddf0ef1ce63", "score": "0.5108869", "text": "def initialize(mill, x, y, \r\n pBeg_min_radius, pBeg_max_radius, pBeg_angle=0,\r\n pEnd_min_radius=nil, pEnd_max_radius=nil, pEnd_angle=360,\r\n pDepth=nil, pDegree_inc=nil\r\n )\r\n # - - - - - - - - - - - - - - - - - -\r\n \r\n base_init(mill,x,y,nil,pDepth)\r\n @beg_min_radius = pBeg_min_radius\r\n @beg_max_radius = pBeg_max_radius\r\n @beg_angle = pBeg_angle\r\n @end_min_radius = pEnd_min_radius\r\n @end_max_radius = pEnd_max_radius\r\n @end_angle = pEnd_angle \r\n @degree_inc = pDegree_inc\r\n @depth = pDepth\r\n @needs_check_parms = true\r\n\r\n #print \"(CNCShapeArc init pDepth=\", pDepth, \" @pDepth=\", @pDepth, \")\\n\"\r\n #check_parms\r\n return self\r\n end", "title": "" }, { "docid": "3da7624e3bdae0598170c32c5819895a", "score": "0.5096874", "text": "def initialize(**opts)\n defaults = {\n width: 1024,\n height: 768,\n method: :scale_by_bounds\n }\n super(opts, defaults)\n end", "title": "" }, { "docid": "aef453ba54ca903915bed3f84b2b5e3c", "score": "0.50704706", "text": "def initialize(x, y)\n super(x, y)\n @radius = 4\n end", "title": "" }, { "docid": "e3cf7d01f1ca95a2e6dd04c6b29e07ae", "score": "0.50629395", "text": "def initialize(radius)\n @radius = radius\n end", "title": "" }, { "docid": "eb40e8c3a20ea48490d33a407b5209b8", "score": "0.5056406", "text": "def calculate_boundaries!\n return unless @dirty\n\n # Init to vals of first point\n # We will do it this way so we only need one iteration\n point = @points.first\n @minx = point.x\n @maxx = point.x\n @miny = point.y\n @maxy = point.y\n @points.each do |point|\n @minx = [@minx, point.x].min\n @maxx = [@maxx, point.x].max\n @miny = [@miny, point.y].min\n @maxy = [@maxy, point.y].max\n end\n @grid_width = @maxx - @minx\n @grid_height = @maxy - @miny\n\n @dirty = false\n end", "title": "" }, { "docid": "bfd761b49235f3ed33cd1a9b5f344044", "score": "0.50221467", "text": "def initialize(world, parent, pin_tra, group = nil)\n super(world, parent, pin_tra, group)\n MSPhysics::Newton::CurvySlider.create(@address)\n MSPhysics::Newton::CurvySlider.set_linear_friction(@address, DEFAULT_LINEAR_FRICTION)\n MSPhysics::Newton::CurvySlider.set_angular_friction(@address, DEFAULT_ANGULAR_FRICTION)\n MSPhysics::Newton::CurvySlider.set_alignment_power(@address, DEFAULT_ALIGNMENT_POWER)\n MSPhysics::Newton::CurvySlider.set_controller(@address, DEFAULT_CONTROLLER)\n MSPhysics::Newton::CurvySlider.enable_loop(@address, DEFAULT_LOOP_ENABLED)\n MSPhysics::Newton::CurvySlider.enable_alignment(@address, DEFAULT_ALIGNMENT_ENABLED)\n MSPhysics::Newton::CurvySlider.enable_rotation(@address, DEFAULT_ROTATION_ENABLED)\n end", "title": "" }, { "docid": "bfd761b49235f3ed33cd1a9b5f344044", "score": "0.50221467", "text": "def initialize(world, parent, pin_tra, group = nil)\n super(world, parent, pin_tra, group)\n MSPhysics::Newton::CurvySlider.create(@address)\n MSPhysics::Newton::CurvySlider.set_linear_friction(@address, DEFAULT_LINEAR_FRICTION)\n MSPhysics::Newton::CurvySlider.set_angular_friction(@address, DEFAULT_ANGULAR_FRICTION)\n MSPhysics::Newton::CurvySlider.set_alignment_power(@address, DEFAULT_ALIGNMENT_POWER)\n MSPhysics::Newton::CurvySlider.set_controller(@address, DEFAULT_CONTROLLER)\n MSPhysics::Newton::CurvySlider.enable_loop(@address, DEFAULT_LOOP_ENABLED)\n MSPhysics::Newton::CurvySlider.enable_alignment(@address, DEFAULT_ALIGNMENT_ENABLED)\n MSPhysics::Newton::CurvySlider.enable_rotation(@address, DEFAULT_ROTATION_ENABLED)\n end", "title": "" }, { "docid": "91e56d2e408e030483986596eb81858e", "score": "0.49959216", "text": "def testMinMax\n assert_raise( RangeError ) {\n dm = DotManager.new( 1, 100, 90, 0, 50 )\n }\n assert_raise( RangeError ) {\n dm = DotManager.new( 1, 10, 90, 20, 19 )\n }\n end", "title": "" }, { "docid": "b8920b978598f6815e6753e10e4e45da", "score": "0.49944487", "text": "def setWaypointLoiterRadius _obj, _args\n \"_obj setWaypointLoiterRadius _args;\" \n end", "title": "" }, { "docid": "848be1825cbd8011cc7b1cf6c694cb62", "score": "0.49806684", "text": "def initialize(options = {})\n options = options.clone\n options[:center] ||= [X_COORDINATE, Y_COORDINATE]\n options[:max_iterations] ||= ITERATIONS\n options[:step] ||= STEP\n super(options)\n end", "title": "" }, { "docid": "848be1825cbd8011cc7b1cf6c694cb62", "score": "0.49806684", "text": "def initialize(options = {})\n options = options.clone\n options[:center] ||= [X_COORDINATE, Y_COORDINATE]\n options[:max_iterations] ||= ITERATIONS\n options[:step] ||= STEP\n super(options)\n end", "title": "" }, { "docid": "848be1825cbd8011cc7b1cf6c694cb62", "score": "0.49806684", "text": "def initialize(options = {})\n options = options.clone\n options[:center] ||= [X_COORDINATE, Y_COORDINATE]\n options[:max_iterations] ||= ITERATIONS\n options[:step] ||= STEP\n super(options)\n end", "title": "" }, { "docid": "848be1825cbd8011cc7b1cf6c694cb62", "score": "0.49806684", "text": "def initialize(options = {})\n options = options.clone\n options[:center] ||= [X_COORDINATE, Y_COORDINATE]\n options[:max_iterations] ||= ITERATIONS\n options[:step] ||= STEP\n super(options)\n end", "title": "" }, { "docid": "848be1825cbd8011cc7b1cf6c694cb62", "score": "0.49806684", "text": "def initialize(options = {})\n options = options.clone\n options[:center] ||= [X_COORDINATE, Y_COORDINATE]\n options[:max_iterations] ||= ITERATIONS\n options[:step] ||= STEP\n super(options)\n end", "title": "" }, { "docid": "31a5232d35be5dc6aff25cece9bcac01", "score": "0.4976451", "text": "def initialize(width, height)\n # default width and height are set to max to use the validations functions\n @width = MAX_WIDTH\n @height = MAX_HEIGHT\n validate_x_y_coords(width, height)\n @width = width\n @height = height\n clear\n end", "title": "" }, { "docid": "1457332c46f11e2aa156c06ce52fde60", "score": "0.49756783", "text": "def initialize( names, specs )\n super( names, specs )\n set_bounds( specs[ :min ], specs[ :max ] )\n set_default( specs[ :df_int ] )\n end", "title": "" }, { "docid": "8ee5f50b50d85f6d8830c4468964bed1", "score": "0.49671412", "text": "def initialize start_vector, goal_vector, options = {}\n @debug_level = options[:debug_level] || 1\n @epsilon = options[:epsilon] || 0.01\n @max_iterations = options[:max_iterations] || 1000\n @banned_points = options[:banned_points] || {}\n @start_vector = start_vector\n @goal_vector = goal_vector\n end", "title": "" }, { "docid": "53047596f0424906da4550930c1ebb79", "score": "0.49506322", "text": "def validate_radius(params, default = \"\")\n return default unless params[:radius]\n return validate_positive_integer(params[:radius])\n end", "title": "" }, { "docid": "a949a5a0e8aa5820520d9a04629bd857", "score": "0.4937927", "text": "def initialize(lower_limit, upper_limit, range_lower, range_upper)\n super(lower_limit, upper_limit)\n @range_lower = range_lower\n @range_upper = range_upper\n\n raise \"Invalid lower range value: #{@range_lower}\" unless is_value_within_limits?(@range_lower)\n raise \"Invalid upper range value: #{@range_upper}\" unless is_value_within_limits?(@range_upper)\n raise \"Lower limit must be less than or equal to the upper limit\" if @range_lower > @range_upper\n end", "title": "" }, { "docid": "afd030151e093976b76d55f17eb623f4", "score": "0.49320194", "text": "def check_parameter_constraints\n check_constraints_for_a if (@repository.parameters[:all])\n check_constraints_for_c if (@repository.parameters[:coord])\n check_constraints_for_d if (@repository.parameters[:delta])\n check_constraints_for_r if (@repository.parameters[:range])\n\n # check mandatory parameter combination\n check_parameter_occurrence\n \n # check mandatory file parameter\n check_mandatory_parameter(:file)\n end", "title": "" }, { "docid": "634f4aa541b3c3e4a9aa4e8c851c2a5a", "score": "0.49199092", "text": "def initialize(test: false)\n @test = test\n @curr_x = START_X\n @curr_y = START_Y\n @collisions = 0\n end", "title": "" }, { "docid": "8a986676407fd25d148dcbcac5a2f175", "score": "0.4918084", "text": "def setup_variables(options = {})\n @color = (preferred_color || options.delete(:color))\n @width, @height = options.delete(:size)\n @min_value, @max_value = options[:min_value], options[:max_value]\n @opacity = options[:opacity] || 1.0\n @complexity = options[:complexity]\n end", "title": "" }, { "docid": "fd0bf3fca9e7c96f9338f3031fcc51d9", "score": "0.49142486", "text": "def set_min( min )\n if IntegerOption.bounds_ok?( min, @max )\n @min = min\n else\n @min = nil\n raise \"invalid lower bound: #{ min.to_s }\"\n end\n end", "title": "" }, { "docid": "956087b9c0e3bfae75c6b0d4cd32a400", "score": "0.49111375", "text": "def update!(**args)\n @max_value = args[:max_value] if args.key?(:max_value)\n @min_value = args[:min_value] if args.key?(:min_value)\n @strict_max_enabled = args[:strict_max_enabled] if args.key?(:strict_max_enabled)\n @strict_min_enabled = args[:strict_min_enabled] if args.key?(:strict_min_enabled)\n end", "title": "" }, { "docid": "6c467c4833d3722c9e0595815a6f3431", "score": "0.49016935", "text": "def setBounds\n true\n end", "title": "" }, { "docid": "bb04a297451af744a50eddcd9af609f6", "score": "0.48500445", "text": "def initialize(x, y, xmin: 1, xmax: 250,\n ymin: 1, ymax: 250)\n @xmin, @xmax = xmin, xmax\n @ymin, @ymax = ymin, ymax\n\n self.x = x\n self.y = y\n end", "title": "" }, { "docid": "0c7b314f94c40d894b0aa7d47718ad17", "score": "0.4849032", "text": "def initialize(x, y, r)\n @center = [x, y]\n @radius = r\n end", "title": "" }, { "docid": "63011d77690746cc2b30069d75cca8c2", "score": "0.48348632", "text": "def validate params\n validate_params(params)\n validate_coordinates\n validate_color\n validate_dimension\n end", "title": "" }, { "docid": "3bb29cc1abcb6c888219dfa61c474915", "score": "0.48276263", "text": "def set_fixed_scale(vmin,vmax,divisions=5,vxmin=0,vxmax=0,xdivisions=5)\n @vmin = vmin\n @vmax = vmax\n @divisions = divisions\n #TODO check\n #if (!vxnin == 0 )\n if (vxnin != 0 )\n @vxmin = vxmin\n @vxmax = vxmax\n @xdivisions = xdivisions\n end\n end", "title": "" }, { "docid": "a1c3dbe9664dc9034fa26302c15c9e9d", "score": "0.4826457", "text": "def validate params\n validate_params(params)\n validate_dimension\n end", "title": "" }, { "docid": "fc18ed5310bfcc11571e3fc965c7f23d", "score": "0.48250222", "text": "def reinitialize(min, max, incr)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "ea56767cc0ab00b5e9cbe8ad8fdeb5e7", "score": "0.48234442", "text": "def max_radius\n 4000\n end", "title": "" }, { "docid": "e520f0035d60c51617a27d665f52d943", "score": "0.4823069", "text": "def ensure_bounds\n if self.position > min_position\n self.position = min_position\n false\n elsif self.position < max_position\n self.position = max_position\n false\n else\n true\n end\n end", "title": "" }, { "docid": "29de2bb7a656bb2177e2b2edb96633ad", "score": "0.48088682", "text": "def check_param_values\n self.class.get_parameters_info.each do |k, v|\n if is_a_checkable_class?(v) && !v[:check].call(self.send(k))\n raise ParameterizableValueIncorrect.new(v[:check], self.send(k))\n end\n end\n end", "title": "" }, { "docid": "2cab7f0a10b578b76607440f3fddb017", "score": "0.48069075", "text": "def create_default_authentication_radius_configuration(opts)\n opts = check_params(opts,[:servers])\n super(opts)\n end", "title": "" }, { "docid": "3f8405ef84655a136fc7614fe6db8291", "score": "0.48057136", "text": "def initialize_dimensions\n @width = 150\n @height = 48\n @wheels_front = 31\n @wheels_rear = 126\n end", "title": "" }, { "docid": "abe1cee26a61dd6aeca705bae8f14337", "score": "0.48027146", "text": "def set_netmask(opts)\n opts = check_params(opts,[:admin_ips,:netmasks])\n super(opts)\n end", "title": "" }, { "docid": "6ba664dc526b98e549e577fb0be38a8a", "score": "0.48003125", "text": "def validation min, max\n\n end", "title": "" }, { "docid": "55f615ced5dfc32ee34c9b5dca578e91", "score": "0.4799314", "text": "def initialize(window, x, y, radius, color1, filled=true, color2=color1, \n border=0, br_color1=color1, br_color2=br_color1,\n active=true, visible=true)\n super(window, color1, filled, color2, \n border, br_color1, br_color2, \n active, visible)\n self.x = x\n self.y = y\n self.radius = radius\n end", "title": "" }, { "docid": "8af3afc3ab8790a46f8f7f954c4879c2", "score": "0.47926903", "text": "def reset_compass_correction_parameters\n Klass.resetCompassCorrectionParameters(@handle)\n\t true\n end", "title": "" }, { "docid": "020dc8813c4a7ab377ce3bea0fdcf839", "score": "0.47903726", "text": "def initialize(max_x, max_y)\n self.width = max_x + 1\n self.height = max_y + 1\n self\n end", "title": "" }, { "docid": "21d466eada306a358a23c88fef0111db", "score": "0.4789053", "text": "def validate\n validate_params\n validate_colour\n validate_coordinates\n validate_dimension\n end", "title": "" }, { "docid": "2d147354a6167bdd880c08577039d869", "score": "0.47794756", "text": "def validate\n validate_params\n validate_coordinates\n validate_colour\n validate_dimension\n end", "title": "" }, { "docid": "9bd1f74719006b4448008c501d7bbf28", "score": "0.476942", "text": "def arguments_valid?\n valid_args = true\n valid_args = false if @options.min > @options.max\n valid_args = false if @options.user && !@options.password\n valid_args = false if @options.password && !@options.user\n valid_args\n end", "title": "" }, { "docid": "e814d87bf7c3449ad6222199dee64011", "score": "0.47675943", "text": "def validate_parameters\n check_for_valid_filepath if (@repository.parameters[:file])\n\n check_number_of_parameters(:coord, 2)\n check_number_of_parameters(:delta, 2)\n check_number_of_parameters(:time, 2)\n check_number_of_parameters(:range, 2)\n check_number_of_parameters(:section, 2)\n end", "title": "" }, { "docid": "39111357187d20b74945f8f436029ca9", "score": "0.47625756", "text": "def initialize(values: [], max_value: 0, mean_value: 0, valid: true)\n @values = values\n @max_value = max_value\n @mean_value = mean_value\n @valid = valid\n end", "title": "" }, { "docid": "06e3b8a3db764a7a5a7475fbe6cc136a", "score": "0.47615832", "text": "def limits_ok?\n status = true\n if (@min.exp.to_s.include? '/') || (@max.exp.to_s.include? '/')\n return status\n end\n\n if @min.exp.nil? ^ @max.exp.nil?\n @limit_type = :single_sided\n if @typ.exp\n # status = false\n Origen.log.debug \"Spec #{@name} has a typical limit defined with either min or max. They are mutually exclusive, use 'target' when using min or max\"\n end\n elsif @min.exp && @max.exp\n @limit_type = :double_sided\n # Both min and max must be numerical to compare them\n if @min.value.is_a?(Numeric) && @max.value.is_a?(Numeric)\n # Check that min and max make sense\n if @max.value <= @min.value || @min.value >= @max.value\n status = false\n Origen.log.debug \"Spec #{@name} has min (#{@min.value}) and max (#{@max.value}) reversed\"\n end\n # Check that target is OK\n unless @target.nil?\n if @target.value <= @min.value || @target.value >= @max.value\n status = false\n Origen.log.debug \"Spec #{@name} has a target (#{@target.value}) that is not within the min (#{@min.value}) and max #{@max.value}) values\"\n end\n end\n end\n end\n status\n end", "title": "" }, { "docid": "cb638dfa61bc746ae56e1f680db00a47", "score": "0.47445962", "text": "def initialize(id, centerMax, standardDeviations)\n g = GaussianGenerator.new\n @id = id\n @ppm = centerMax * rand\n @params = standardDeviations.map {|sd| g.next(0,sd)}\n end", "title": "" }, { "docid": "b6f33d2ed2eb4fa5c033a18f93000734", "score": "0.47361758", "text": "def update!(**args)\n @xmax = args[:xmax] if args.key?(:xmax)\n @xmin = args[:xmin] if args.key?(:xmin)\n @ymax = args[:ymax] if args.key?(:ymax)\n @ymin = args[:ymin] if args.key?(:ymin)\n end", "title": "" }, { "docid": "5110f84139d61d3a23ce6c99a7df1fae", "score": "0.47337195", "text": "def initialize(initial_state)\n\n # Validates the initial state is valid, if not an error will be raised\n validate_state(initial_state)\n\n # If we reach this point the initial state is valid, init instance variables\n @state = initial_state\n @width = initial_state.length\n @height = initial_state[0].length\n end", "title": "" }, { "docid": "d8c8a74cecd5a24e58841c71b0643a10", "score": "0.47255555", "text": "def update!(**args)\n @max_compensation = args[:max_compensation] if args.key?(:max_compensation)\n @min_compensation = args[:min_compensation] if args.key?(:min_compensation)\n end", "title": "" }, { "docid": "92068de28e92f9bb5018f11421074d4a", "score": "0.47213045", "text": "def update!(**args)\n @max = args[:max] if args.key?(:max)\n @min = args[:min] if args.key?(:min)\n end", "title": "" }, { "docid": "92068de28e92f9bb5018f11421074d4a", "score": "0.47213045", "text": "def update!(**args)\n @max = args[:max] if args.key?(:max)\n @min = args[:min] if args.key?(:min)\n end", "title": "" }, { "docid": "92068de28e92f9bb5018f11421074d4a", "score": "0.47213045", "text": "def update!(**args)\n @max = args[:max] if args.key?(:max)\n @min = args[:min] if args.key?(:min)\n end", "title": "" }, { "docid": "92068de28e92f9bb5018f11421074d4a", "score": "0.47213045", "text": "def update!(**args)\n @max = args[:max] if args.key?(:max)\n @min = args[:min] if args.key?(:min)\n end", "title": "" }, { "docid": "92068de28e92f9bb5018f11421074d4a", "score": "0.47213045", "text": "def update!(**args)\n @max = args[:max] if args.key?(:max)\n @min = args[:min] if args.key?(:min)\n end", "title": "" }, { "docid": "92068de28e92f9bb5018f11421074d4a", "score": "0.47213045", "text": "def update!(**args)\n @max = args[:max] if args.key?(:max)\n @min = args[:min] if args.key?(:min)\n end", "title": "" }, { "docid": "92068de28e92f9bb5018f11421074d4a", "score": "0.47213045", "text": "def update!(**args)\n @max = args[:max] if args.key?(:max)\n @min = args[:min] if args.key?(:min)\n end", "title": "" }, { "docid": "92068de28e92f9bb5018f11421074d4a", "score": "0.47191742", "text": "def update!(**args)\n @max = args[:max] if args.key?(:max)\n @min = args[:min] if args.key?(:min)\n end", "title": "" }, { "docid": "92068de28e92f9bb5018f11421074d4a", "score": "0.47191742", "text": "def update!(**args)\n @max = args[:max] if args.key?(:max)\n @min = args[:min] if args.key?(:min)\n end", "title": "" }, { "docid": "79fb3d9d4fbd21b7d95ad110fcc04c46", "score": "0.47136733", "text": "def check_params(mode = false)\n endpoint_info[:check_params] = mode\n end", "title": "" }, { "docid": "eeb3a67c36e62ca849610118106bfb63", "score": "0.47085607", "text": "def initialize(*args)\n @cx = 0\n @cy = 0\n @radius_x = 0\n @radius_y = 0\n @angle_offset = 0\n set(*args)\n end", "title": "" }, { "docid": "5defa655861e99a4ff9d4ba2304c4c66", "score": "0.46955675", "text": "def setBoundingBox\n return unless border_points_minus_removed.any?\n self.max_latitude = -100 #max latitude\n self.min_latitude = 100 #min latitude\n self.max_longitude = -200 #max longitude\n self.min_longitude = 200 #min longitude\n border_points_minus_removed.each do |point|\n self.max_latitude = max_latitude > point.latitude ? max_latitude : point.latitude\n self.min_latitude = min_latitude < point.latitude ? min_latitude : point.latitude\n self.max_longitude = max_longitude > point.longitude ? max_longitude : point.longitude\n self.min_longitude = min_longitude < point.longitude ? min_longitude : point.longitude\n end\n end", "title": "" }, { "docid": "ebabd9d5e4f1ff0a78440c99a51c250a", "score": "0.46912122", "text": "def check_allowed_interval(safety_parameters)\r\n allowed_interval = safety_parameters[:allowed_interval]\r\n unless allowed_interval.class.superclass == Numeric\r\n fail \"Allowed interval parameter passed is not a number. It was: #{allowed_interval}\"\r\n else \r\n @allowed_interval = allowed_interval\r\n end\t\r\n end", "title": "" }, { "docid": "a28e29a8915059e869826515a337b6c3", "score": "0.46814233", "text": "def setWaypointCompletionRadius _obj, _args\n \"_obj setWaypointCompletionRadius _args;\" \n end", "title": "" }, { "docid": "63efc57cc156a812dd6cbf05f0b8ed9d", "score": "0.4681352", "text": "def set_options\n if minimum.present? && maximum.present? && step.present? && step.to_f.nonzero?\n if default_value.present?\n decimal_minimum = BigDecimal(minimum.to_s)\n decimal_maximum = BigDecimal(maximum.to_s)\n decimal_step = BigDecimal(step.to_s)\n decimal_default = BigDecimal(default_value.to_s)\n\n # The default value is lower than the minimum value.\n if decimal_default < decimal_minimum\n errors.add(:default_value, _('must be a valid option'))\n end\n\n # The default value less than a step away from the maximum value.\n if ((decimal_maximum - decimal_default) / decimal_step).floor.zero?\n errors.add(:default_value, _('must be a step away from the maximum'))\n end\n\n # The default value less than a step away from the minimum value.\n steps = ((decimal_default - decimal_minimum) / decimal_step).floor\n if steps.zero?\n errors.add(:default_value, _('must be a step away from the minimum'))\n end\n\n self.options = ((decimal_default - decimal_step * steps)...decimal_default).step(decimal_step).map(&:to_f) + (decimal_default..decimal_maximum).step(decimal_step).map(&:to_f)\n unless options.first == minimum.to_f\n self.options.unshift(minimum.to_f)\n end\n unless options.last == maximum.to_f\n self.options << maximum.to_f\n end\n else\n errors.add(:default_value, :blank)\n end\n else\n self.options = []\n end\n end", "title": "" }, { "docid": "a89b4615a56d5242db8d01a9dde246a4", "score": "0.46798474", "text": "def initialize(radius, velocity, initial=0)\n @radius = radius\n @velocity = velocity\n @theta = initial\n end", "title": "" }, { "docid": "637ccb72acb18fd255fdfa6fd6aec156", "score": "0.46794847", "text": "def initialize(config)\n @allocated_ports = []\n if config.key?(:minimum) && config.key?(:maximum) && config[:minimum] > 0 && config[:minimum] <= (config[:maximum])\n @free_ports = Array(config[:minimum]..config[:maximum])\n elsif config.key?(:ports) && config[:ports].is_a?(Array)\n config[:ports].each do |p|\n raise ArgumentError if !p.is_a?(Integer) || p <= 0\n end\n @free_ports = config[:ports]\n else\n raise ArgumentError\n end\n end", "title": "" }, { "docid": "6119c998ab67762879336c769ae99f1d", "score": "0.4676312", "text": "def class_min_is_valid?\n if ((self.class_min == nil) or (self.class_max == nil)); return false; end\n return ((self.class_min > 0) and (self.class_max >= self.class_min))\n end", "title": "" }, { "docid": "43406b4a4932ee353530f279cf8b6b5d", "score": "0.4669444", "text": "def initialize(params = {})\n super\n self.is_valid = true\n end", "title": "" }, { "docid": "225cc0da1e08c61f7b25382bb4780aff", "score": "0.46663857", "text": "def set_compass_correction_parameters(new_mag_field, new_offset0, new_offset1, new_offset2, new_gain0, new_gain1, new_gain2, new_t0, new_t1, new_t2, new_t3, new_t4, new_t5)\n Klass.setCompassCorrectionParameters(@handle, new_mag_field, new_offset0, new_offset1, new_offset2, new_gain0, new_gain1, new_gain2, new_t0, new_t1, new_t2, new_t3, new_t4, new_t5)\n\t true\n end", "title": "" }, { "docid": "f18803fb8c8aeadb28093abd7ceef0bd", "score": "0.46626619", "text": "def update!(**args)\n @max_value = args[:max_value] if args.key?(:max_value)\n @min_value = args[:min_value] if args.key?(:min_value)\n end", "title": "" }, { "docid": "90389c37b5b1d9a365c7378a6da37434", "score": "0.46612376", "text": "def initialize\n# A normal initialization method\n@n, @totalX, @totalY = 0, 0.0, 0.0\nend", "title": "" }, { "docid": "f18803fb8c8aeadb28093abd7ceef0bd", "score": "0.46606502", "text": "def update!(**args)\n @max_value = args[:max_value] if args.key?(:max_value)\n @min_value = args[:min_value] if args.key?(:min_value)\n end", "title": "" }, { "docid": "eb8f5d82acebeb8a0c364c708655d2f4", "score": "0.46551967", "text": "def validate_parameters?(op)\n temp_params = op.temporary[:plan_params]\n errors_noted = \"The following parameters for plan #{op.plan.id} have errors: \"\n er = false\n if temp_params[:fluorescent_marker]\n errors_noted.concat(\"dark_light invalid\") && er = true if !static_params[:dark_light_options].include? temp_params[:dark_light]\n errors_noted.concat(\"marker_type not supported\") && er = true if !static_params[:marker_type_options].include? temp_params[:marker_type]\n end\n op.error :invalid_parameters, errors_noted if er\n op.temporary[:valid_params?] = !er\n end", "title": "" }, { "docid": "4f5dec211ddb3b7a04a550b8c2c93583", "score": "0.46420333", "text": "def radius=(r); @@R = r; end", "title": "" }, { "docid": "26b8347a68e5c6478661cb76dab6a92e", "score": "0.46389055", "text": "def set_limit(opts)\n opts = check_params(opts,[:limits])\n super(opts)\n end", "title": "" }, { "docid": "6c4bd9020d88e8d962b54a2f8c9e7574", "score": "0.4638806", "text": "def adjust_interval\n if @az_max - @az_min >= 2*Math::PI\n # have come full circle\n @az_min = 0\n @az_max = 2*Math::PI\n else\n @az_max %= 2*Math::PI\n @az_min %= 2*Math::PI\n end\n end", "title": "" }, { "docid": "e7f8c745acd9174bcd2fcdf8f3d94d03", "score": "0.46385586", "text": "def update!(**args)\n @max_value = args[:max_value] if args.key?(:max_value)\n @min_value = args[:min_value] if args.key?(:min_value)\n @statistic = args[:statistic] if args.key?(:statistic)\n @strict_max_enabled = args[:strict_max_enabled] if args.key?(:strict_max_enabled)\n @strict_min_enabled = args[:strict_min_enabled] if args.key?(:strict_min_enabled)\n end", "title": "" }, { "docid": "21abe341d18a73105fb914634fc11b45", "score": "0.46375108", "text": "def set_defaults\n self.width ||= 0.20\n self.height ||= 0.20\n end", "title": "" } ]
91230130e0ec39e42d18c0ded49536f9
DELETE /hq_envs/1 DELETE /hq_envs/1.xml
[ { "docid": "6403fb8e211d65f9d2ad8792b853e355", "score": "0.7659084", "text": "def destroy\n @hq_env = HqEnv.find(params[:id])\n @hq_env.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_envs_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "e3e6a5228376a77df35936103920ae31", "score": "0.71165645", "text": "def destroy\n @envspecific = Envspecific.find(params[:id])\n @envspecific.destroy\n\n respond_to do |format|\n format.html { redirect_to(envspecifics_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0dab65d7d08dc5f7a6d347dc135cbea4", "score": "0.68000585", "text": "def destroy\n @env.destroy\n respond_to do |format|\n format.html { redirect_to envs_url, notice: t('delete_success') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "88fe24c25c380e1b0c6560cb687d4942", "score": "0.6775609", "text": "def destroy\n @envfile.destroy\n respond_to do |format|\n format.html { redirect_to envfiles_url, notice: 'Envfile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4159a96e2bd7a78961da94014e296f33", "score": "0.669987", "text": "def delete_environment(name)\n env_res = @puppet_https.delete(\"#{@nc_api_url}/v1/environments/#{name}\")\n\n unless env_res.code.to_i == 204\n STDERR.puts \"An error occured saving the environment: HTTP #{env_res.code} #{env_res.message}\"\n STDERR.puts env_res.body\n end\n end", "title": "" }, { "docid": "ec0ee5f71df6f060ef2b57cc81ab83c3", "score": "0.6665657", "text": "def delete_environment(name)\r\n #Delete environment = delete all collections in it and than delete field in environments key\r\n env_id = nil\r\n begin\r\n env_id = get_environment_id(name)\r\n rescue Transformer::MappingException => ex\r\n ex.message\r\n return\r\n end\r\n RedXmlApi::Environment.new(env_id).delete_all_child_collections\r\n @db_interface.delete_from_hash @env_key, [name]\r\n info = Transformer::KeyBuilder.environment_info(env_id)\r\n @db_interface.delete_keys [info]\r\n end", "title": "" }, { "docid": "16c8886870e3af512f4a73e62f9498f5", "score": "0.66380006", "text": "def destroy\n @nvs_env = NvsEnv.find(params[:id])\n @nvs_env.destroy\n\n respond_to do |format|\n format.html { redirect_to nvs_envs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b163c4ab8743acb047bcb26cd31157bb", "score": "0.66014725", "text": "def destroy\n @vik_env.destroy\n respond_to do |format|\n format.html { redirect_to vik_envs_url, notice: 'Vik env was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "98cb2577bd2440f04683d0734470da04", "score": "0.64561504", "text": "def destroy\n @environnement = Environnement.find(params[:id])\n @environnement.destroy\n\n respond_to do |format|\n format.html { redirect_to environnements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df26116eb86dbadafed7137f9e3c2f9e", "score": "0.6421519", "text": "def delete!\r\n return nil unless exists? \r\n xml = xml_at_top\r\n par = xml.instance_variable_get(:@parent) \r\n par['delete'] = 'delete'\r\n xml_on_delete( xml )\r\n rsp = write_xml_config!( xml.doc.root )\r\n @has[:_exist] = false\r\n true # rsp ... don't return XML, but let's hear from the community...\r\n end", "title": "" }, { "docid": "958f1393654e08c05535f488670b5558", "score": "0.6403558", "text": "def destroy\n @environment = Environment.find(params[:id])\n @environment.destroy\n\n respond_to do |format|\n format.html { redirect_to(environments_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ce4399f6f7ceb29e335e3cb77d74754b", "score": "0.63302684", "text": "def destroy\n @env_monitor = EnvMonitor.find(params[:id])\n @env_monitor.destroy\n\n respond_to do |format|\n format.html { redirect_to(env_monitors_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b94b16c8b41b2034168c7b3ff3c5f47e", "score": "0.6311227", "text": "def destroy\n @prom_env.destroy\n respond_to do |format|\n format.html { redirect_to prom_envs_url, notice: 'Prom env was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a8d10ea556fc02eed0aed6ac4c05acd5", "score": "0.62724113", "text": "def destroy\n # @machine.destroy\n @machine.update_attributes(:deleted_at => Time.now)\n Machine.reset_env_lists\n respond_to do |format|\n format.html { redirect_to(machines_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "82d61902b526f1fd1735b85ba8881ec4", "score": "0.61510766", "text": "def destroy\n @env_nr4 = EnvNr4.find(params[:id])\n @env_nr4.destroy\n\n respond_to do |format|\n format.html { redirect_to env_nr4s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ff746ee38cb5bbebd76df069eedd4d4c", "score": "0.6111332", "text": "def destroy\n app_id = @app_environment.app_id\n @app_environment.destroy\n respond_to do |format|\n format.html { redirect_to app_environments_url(app_id: app_id), notice: 'App environment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6d4dde4f368a7c263246880853a3e905", "score": "0.61111605", "text": "def destroy\n @hq_app = HqApp.find(params[:id])\n @hq_app.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_apps_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9544de226882b02b0ec77d0e7e85afaf", "score": "0.61024654", "text": "def destroy\n @envy.destroy\n respond_to do |format|\n format.html { redirect_to envies_url, notice: 'Envie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "17e826cb38c0b45d649815031326a7d6", "score": "0.6062386", "text": "def destroy\n @hq_site = HqSite.find(params[:id])\n @hq_site.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f0061fe27f2ce104369b7f5457e53eef", "score": "0.605519", "text": "def destroy\n @hq_rack = HqRack.find(params[:id])\n @hq_rack.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_racks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c22b94cc5bcb75f793225f3e8daad1a4", "score": "0.60379773", "text": "def destroy\n onehost('delete', resource[:name])\n @property_hash.clear\n end", "title": "" }, { "docid": "c989614e3f268c50a85a01a5e08d751d", "score": "0.6035447", "text": "def destroy\n @hq_deployed_system = HqDeployedSystem.find(params[:id])\n @hq_deployed_system.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_deployed_systems_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "20de0b72c3c0d03e8f58055b65b09472", "score": "0.60289586", "text": "def destroy\n @hq_server = HqServer.find(params[:id])\n @hq_server.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_servers_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f23ad0adcc0e64c3eaddaf36801a58b7", "score": "0.5997978", "text": "def destroy\n @site_environment = SiteEnvironment.find(params[:id])\n @site_environment.destroy\n\n respond_to do |format|\n format.html { redirect_to site_environments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "173f0d8364d7c76c52d3a264609513d0", "score": "0.59776175", "text": "def destroy\n @envio.destroy\n respond_to do |format|\n format.html { redirect_to envios_url, notice: 'Envio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "48079a2a0e81f5b230cbcab10eeec67e", "score": "0.59756213", "text": "def del\n @status1 = Status1.find(params[:id])\n @status1.destroy\n\n respond_to do |format|\n format.html { redirect_to(status1s_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "521e5fdea3ccdbbeab78070ca6f6d1fb", "score": "0.59672695", "text": "def destroy\n data_bag.item.delete environment_name\n end", "title": "" }, { "docid": "83fada7522789ca0491ed2431ba8c9f1", "score": "0.596371", "text": "def delete_envvar(name)\n CircleCi.request(\"#{base_path}/envvar/#{name}\").delete\n end", "title": "" }, { "docid": "9b42e8ddeb0232826753040dc62a011b", "score": "0.5961276", "text": "def destroy\n @list = List.find(params[:id])\n # @list.destroy\n @list.update_attributes(:deleted_at => Time.now)\n @list.environments.clear\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "61777f0c9a0fdffe17d07a9ae6242d1f", "score": "0.5957453", "text": "def destroy\r\n @conf = Conf.find(params[:id])\r\n @conf.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(confs_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "title": "" }, { "docid": "308e1c2726349f9a175fa30fca41a2f9", "score": "0.5945815", "text": "def destroy\n @environment = Environment.find(params[:id])\n @environment.destroy\n\n respond_to do |format|\n format.html { redirect_to environments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "667aad4a41c22cd5e9a3b6e0239878f6", "score": "0.59285545", "text": "def destroy\n @config.destroy\n delete_svn_config_file @config\n @recordlog = @config\n respond_to do |format|\n format.html { redirect_to configs_url, notice: \"Config was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "daa270078ec9cb4cb6f44d5e1374e4d3", "score": "0.59206307", "text": "def destroy\n results = []\n\n node = client(resource).node(resource[:config_node_path], resource[:config_node_name])\n results.push(call_with_readiness_check(node, 'delete', [], resource))\n\n saml = client(resource).saml\n results.push(call_with_readiness_check(saml, 'delete', [], resource))\n\n handle_multi(results)\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.5911412", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "b1331a5362cf4fb56413d873b01ed0bd", "score": "0.5909007", "text": "def destroy\n @bussiness_agent = BussinessAgent.find(params[:id])\n @bussiness_agent.destroy\n\n respond_to do |format|\n format.html { redirect_to(bussiness_agents_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e953e5d0565ba720e4b8a205b64b3b0a", "score": "0.59052056", "text": "def destroy\n #cuando se borra un proyecto borrar también el archivo xml\n if @project.xml_file and File.exist?(@project.xml_file)\n File.delete(@project.xml_file)\n end\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e953e5d0565ba720e4b8a205b64b3b0a", "score": "0.59052056", "text": "def destroy\n #cuando se borra un proyecto borrar también el archivo xml\n if @project.xml_file and File.exist?(@project.xml_file)\n File.delete(@project.xml_file)\n end\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bdd127dba9051ef97bcba47160e4d957", "score": "0.58982384", "text": "def destroy\n @database_config = DatabaseConfig.find(params[:id])\n @database_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(database_configs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e5399a2cb826177e41dc3b9d16f562e1", "score": "0.5890125", "text": "def destroy\n @xpath = Xpath.find(params[:id])\n @xpath.destroy\n set_site\n respond_to do |format|\n flash[:notice]=\"Field has been removed.\"\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "630503cb294b700a1556a7c44419d256", "score": "0.5884029", "text": "def destroy\n @hq_vserver = HqVserver.find(params[:id])\n @hq_vserver.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_vservers_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.588251", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "55c1c09515643de148dfb04d30f0c2a8", "score": "0.5875155", "text": "def destroy\n @host = Host.find(params[:id])\n# myfn = \"/var/ipfiles/#{@host.name}\"\n# File.delete(myfn) if File.exists?(myfn)\n @host.destroy\n \n\n respond_to do |format|\n flash[:notice] = 'Host was successfully deleted.'\n format.html { redirect_to hosts_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "bbf4582ff963b7affb8ca288edfd4768", "score": "0.58566177", "text": "def destroy\n @sys_config = SysConfig.find(params[:id])\n @sys_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(sys_configs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "88bdb4c389e134535d7c80164be2eee0", "score": "0.584156", "text": "def production_delete(params = {})\n params = params.dup\n production_id = search_hash!(params, :production_id, :productionId, :productionid, :id)\n production_version = search_hash!(params, :production_version, :productionVersion, :productionversion, :version) || 'HEAD'\n #e_tag = search_hash!(params, :e_tag, :ETag, :eTag, :etag)\n #delete(\"content/ea/git/productions/#{production_id}/HEAD.v1.json\", { 'If-Match' => e_tag })\n http_delete(\"content/ea/git/productions/#{production_id}/#{production_version}.v1.json\")\n http.success?\n end", "title": "" }, { "docid": "7e7012007b9cace231223141af022480", "score": "0.5841047", "text": "def destroy\n @xml_builder.destroy\n respond_to do |format|\n format.html { redirect_to xml_builders_url, notice: 'Xml builder was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "153e58976fdbfa7383392757fbb2a4ab", "score": "0.58388495", "text": "def destroy\n name, type = resource[:name].split('/')\n nameserver = resource[:nameserver]\n nsupdate(\"server #{nameserver}\n update delete #{name}. #{type}\n send\")\n end", "title": "" }, { "docid": "8bd3dc4926f6bb4e122c3bb028f12936", "score": "0.58237857", "text": "def delete_guest_access_portal(args = {}) \n delete(\"/guestaccess.json/gap/#{args[:portalId]}\", args)\nend", "title": "" }, { "docid": "8bd3dc4926f6bb4e122c3bb028f12936", "score": "0.58237857", "text": "def delete_guest_access_portal(args = {}) \n delete(\"/guestaccess.json/gap/#{args[:portalId]}\", args)\nend", "title": "" }, { "docid": "fdb5222e60f67418931a74e6eb7c9a1d", "score": "0.5797299", "text": "def delete\n GoodData.delete(uri)\n end", "title": "" }, { "docid": "fbf9862ac96678d08a67c1cdde7c9d17", "score": "0.5792346", "text": "def clear(env)\n @@nodes_by_name.delete(env)\n @@nodes_by_ip.delete(env)\n end", "title": "" }, { "docid": "579d348c930523dc4a8be1db5b10a90c", "score": "0.57885915", "text": "def destroy\n @host = Host.find(params[:id])\n @host.destroy\n\n respond_to do |format|\n format.html { redirect_to(hosts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "579d348c930523dc4a8be1db5b10a90c", "score": "0.57885915", "text": "def destroy\n @host = Host.find(params[:id])\n @host.destroy\n\n respond_to do |format|\n format.html { redirect_to(hosts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "579d348c930523dc4a8be1db5b10a90c", "score": "0.57885915", "text": "def destroy\n @host = Host.find(params[:id])\n @host.destroy\n\n respond_to do |format|\n format.html { redirect_to(hosts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "579d348c930523dc4a8be1db5b10a90c", "score": "0.57885915", "text": "def destroy\n @host = Host.find(params[:id])\n @host.destroy\n\n respond_to do |format|\n format.html { redirect_to(hosts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f01dea518375b90d921dc87d0d30144f", "score": "0.57882535", "text": "def delete(header_name)\n @env.delete(env_name(header_name))\n end", "title": "" }, { "docid": "35e45d01374689763b4dd826b274c7bd", "score": "0.57879645", "text": "def destroy\n @site = Site.find(params[:site_id])\n @environment = @site.environments.find(params[:id])\n @environment.destroy\n\n respond_to do |format|\n format.html { redirect_to site_environments_path }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "bbde00cd0df0589225125874ac6d1100", "score": "0.5753349", "text": "def destroy\n @xsd.destroy\n\n respond_to do |format|\n format.html { redirect_to '/wsdl/' }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "56175e5926158653683c8672e3826634", "score": "0.5752638", "text": "def destroy\n @hq_rsrc = HqRsrc.find(params[:id])\n @hq_rsrc.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_rsrcs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0d218dc665300a5cf5deb41cd36e802f", "score": "0.5751781", "text": "def delete_agent id\n\t\t\t\t\tbegin\n\t\t\t\t\t\t( @connection.delete AGENTS, id ).code\n\t\t\t\t\trescue Freshdesk::Api::ServerError\n\t\t\t\t\t\t200\n\t\t\t\t\tend\n\t\t\t\tend", "title": "" }, { "docid": "8df5455a84c7e67de754c3f4d3fdc8b9", "score": "0.5748833", "text": "def destroy\n @hq_system = HqSystem.find(params[:id])\n @hq_system.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_systems_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.574758", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "bf68b910e3c2e55d59c2a568719ac90b", "score": "0.57469654", "text": "def test_delete_application\n vespa.stop_base # No need for running vespa services in this test\n apps = list_applications_v2(@node1.hostname, \"default\")\n assert_equal(1, apps.length)\n\n sesssion_path = \"#{Environment.instance.vespa_home}/var/db/vespa/config_server/serverdb/tenants/default/sessions/#{@session_id}\"\n # Verify that app was deployed on node1\n @node1.execute(\"ls #{sesssion_path}\")\n\n # Delete app on another node than deployment was done on\n delete_application_v2(@node2.hostname, \"default\", \"default\")\n # App should be deleted at once, both on node1 and node 2\n apps = list_applications_v2(@node2.hostname, \"default\")\n assert_equal(0, apps.length)\n apps = list_applications_v2(@node1.hostname, \"default\")\n assert_equal(0, apps.length)\n end", "title": "" }, { "docid": "66345c081a5db2c02f02fe148456b984", "score": "0.5731051", "text": "def destroy\n ApacheDBNodes.open(ApacheDBNodes::WRCREAT) { |d| d.delete_if { |k, v| k.split('/')[0] == @fqdn } }\n ApacheDBAliases.open(ApacheDBAliases::WRCREAT) { |d| d.delete_if { |k, v| v == @fqdn } }\n ApacheDBIdler.open(ApacheDBIdler::WRCREAT) { |d| d.delete(@fqdn) }\n ApacheDBSTS.open(ApacheDBSTS::WRCREAT) { |d| d.delete(@fqdn) }\n NodeJSDBRoutes.open(NodeJSDBRoutes::WRCREAT) { |d| d.delete_if { |k, v| (k == @fqdn) or (v[\"alias\"] == @fqdn) } }\n GearDB.open(GearDB::WRCREAT) { |d| d.delete(@container_uuid) }\n\n # Clean up SSL certs and legacy node configuration\n ApacheDBAliases.open(ApacheDBAliases::WRCREAT) do\n paths = Dir.glob(PathUtils.join(@basedir, \"#{container_uuid}_*\"))\n FileUtils.rm_rf(paths)\n paths.each do |p|\n if p =~ /\\.conf$/\n begin\n reload_httpd\n rescue\n end\n break\n end\n end\n end\n\n end", "title": "" }, { "docid": "8811cd1784c383a9ab8b182019512eb6", "score": "0.57281107", "text": "def destroy\n @client = Client.find(params[:id])\n define_path\n ServerFileOperation.delete(@client.home_directory,@public_path)\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to(clients_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fe5691fbe5d6a68e29fd2cb4727512fa", "score": "0.5725339", "text": "def delete!\n CouchRest.delete @root\n end", "title": "" }, { "docid": "fe5691fbe5d6a68e29fd2cb4727512fa", "score": "0.5725339", "text": "def delete!\n CouchRest.delete @root\n end", "title": "" }, { "docid": "004a241d9f7bb4d66549959a27098228", "score": "0.57208747", "text": "def destroy\n @app_version = @app.app_versions.find(params[:id])\n @app_version.destroy\n\n respond_to do |format|\n format.html { redirect_to(@app) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "353f13226212a0784afa5b724d68184c", "score": "0.5718475", "text": "def destroy\n @app_target = AppTarget.find(params[:id])\n @app_target.destroy\n\n respond_to do |format|\n format.xml { head :ok }\n format.json { head :ok } \n end\n end", "title": "" }, { "docid": "cfea572d114948e2ea084b545c3be8cd", "score": "0.5715506", "text": "def destroy\n request = RestClient.delete File.join(API_SERVER,\"rest-api/departments\",params['id'])\n redirect_to :action => :index\t\n end", "title": "" }, { "docid": "4f08f2ec294215cb59ebbf55fbb377f5", "score": "0.57151884", "text": "def destroy \n @qx.destroy\n respond_to do |format|\n format.html { redirect_to(qxes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a44bb4d594a0b61c0dc3499456a4576b", "score": "0.57135475", "text": "def destroy\n @v1_data_element = V1DataElement.find(params[:id])\n @v1_data_element.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_data_elements_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "af260557afc5f5de2d1a3eb997945342", "score": "0.5711643", "text": "def destroy\n @configattribexcl.destroy\n respond_to do |format|\n format.html { redirect_to configattribexcls_url, notice: 'Configattribexcl was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6d3d5c2903da04e5086694ef9dd1249d", "score": "0.5711604", "text": "def delete\n api_xml(category(target),:delete) if options.data or options.category\n if options.itemdef\n parse_itemdef\n uid=find_definition_uid_by_name(itemdef.name)\n response=admin_xml(\"/itemDefinitions/#{uid}\")\n verbose \"About to delete: #{REXML::XPath.first(response,'//Name/text()').value} item definition.\\n\"\n admin_xml(\"/itemDefinitions/#{uid}\",\n :delete) if itemdef.name\n end\n end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.57103264", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.57103264", "text": "def delete(path);end", "title": "" }, { "docid": "ef1cb3fe5fb58bdb5af531726fe7e069", "score": "0.5705423", "text": "def destroy\n @setup = Setup.find(params[:id])\n @setup.destroy\n\n respond_to do |format|\n format.html { redirect_to(setups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a252a3827e4f2f812b02fe6ec20c0da5", "score": "0.57042444", "text": "def destroy_request\n request(\"#{self.class.zabbix_name}.delete\", destroy_params)\n end", "title": "" }, { "docid": "a68accc279dc4ef70c06687028466e88", "score": "0.5701325", "text": "def delete(context, name)\n context.debug(\"Deleting '#{name}'\")\n invoke_set_method(context, name, name.merge({ dsc_ensure: 'Absent' }))\n end", "title": "" }, { "docid": "781553e8790e5b8881d86c5579d67c66", "score": "0.5697767", "text": "def destroy\n if exists?\n @conf[:sandboxes].each do |v|\n destroy_sandbox(v)\n end\n system(\"rm #{CONF_FILE}\")\n end\n end", "title": "" }, { "docid": "598374b938be71c17e1c3f8988a479ca", "score": "0.56938726", "text": "def destroy\r\n @environment.destroy\r\n respond_to do |format|\r\n format.html { redirect_to environments_url, notice: 'Environment was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "b965aa2e76649b84623ed925811f4794", "score": "0.56883466", "text": "def delete(_path)\n end", "title": "" }, { "docid": "bf822da2c97f1b2d235b607f1e876db1", "score": "0.5678168", "text": "def destroy\n @environment.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Environment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5e931be1b6821778ba1c0b259ed409b1", "score": "0.56773156", "text": "def destroy\n @production_dpt.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "1dee4b2a2937d73d83e1abb0a10ead15", "score": "0.5674566", "text": "def destroy\n @rig_upgrade = RigUpgrade.find(params[:id])\n @rig_upgrade.destroy\n\n respond_to do |format|\n format.html { redirect_to(rig_upgrades_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b9d1a5dc5c944dfdef016c342183e812", "score": "0.5673275", "text": "def destroy\n @scrap_xml = ScrapXml.find(params[:id])\n @scrap_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(scrap_xmls_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8e36417662c96c13a32fe55b3cd5c5f3", "score": "0.56720275", "text": "def del\n @office1 = Office1.find(params[:id])\n @office1.destroy\n\n respond_to do |format|\n format.html { redirect_to(office1s_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e9660965d4783ecdccc0ecb6baa8430e", "score": "0.56690323", "text": "def destroy\n @vsconfig = Vsconfig.find(params[:id])\n @vsconfig.destroy\n\n respond_to do |format|\n\n # ActiveRecord::Schema.drop_table @vsconfig.table_name\n\n format.html { redirect_to vsconfigs_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b9113a588e9b0d70a615fe7e58012caa", "score": "0.5667733", "text": "def delete(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end", "title": "" }, { "docid": "b9113a588e9b0d70a615fe7e58012caa", "score": "0.5667733", "text": "def delete(uri, params = T.unsafe(nil), env = T.unsafe(nil), &block); end", "title": "" }, { "docid": "5ebf61f8a510c61cc611594b87fa005a", "score": "0.56638265", "text": "def delete_workspace\n delete_response = GEOSERVER.delete(\"/geoserver/rest/workspaces/#{WORKSPACE[:name]}?recurse=true\")\n if delete_response.code == \"200\"\n puts \"Delete workspace successful.\"\n else\n puts \"Delete workspace failed.\"\n end\nend", "title": "" }, { "docid": "d9e5519afda27a167acec97baba9c6ea", "score": "0.5659793", "text": "def destroy\n @deployment = Deployment.find(params[:id])\n @deployment.destroy\n\n respond_to do |format|\n format.html { redirect_to(deployments_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "351075d752d7e0efb2061d9d76b6eb13", "score": "0.5659225", "text": "def destroy\n Admin::DbConfiguration.using(master_db).destroy(@admin_db_configuration.id)\n respond_to do |format|\n format.html { redirect_to admin_db_configurations_url, notice: 'Db configuration was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dc7978b571fa1af94fbce826dcf38dc1", "score": "0.5654129", "text": "def destroy; delete end", "title": "" }, { "docid": "8bdd30d31a9816059b58e22d06b25b6c", "score": "0.565382", "text": "def delete(conn)\n xml = conn.make_xml('EnginePoolDeleteRequest')\n xml.add_element(as_xml)\n result = conn.execute(xml, '1.2')\n result.success\n end", "title": "" }, { "docid": "00f77fb4aaa97ce1d76f4fb27383ff78", "score": "0.56525356", "text": "def destroy\n\n url = index_section_url\n\n @deployment.destroy\n\n respond_to do |format|\n flash[:notice] = 'Deployment entry deleted.'\n format.html { redirect_to url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fae02e3ad0e862b629d4fff7259090cc", "score": "0.5651361", "text": "def delete_db\n influx_config = YAML.load_file(\"#{Rails.root}/config/config.yml\") \\\n ['influxdb'][Rails.env]\n influx.delete_database influx_config['db_name']\n end", "title": "" }, { "docid": "d4e16513428f377ff6c06785a95d5469", "score": "0.5650514", "text": "def destroy\n @nodeconfiguration = Nodeconfiguration.find(params[:id])\n @nodeconfiguration.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodeconfigurations_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "756f45b0cdde8e56343848406050d163", "score": "0.56480455", "text": "def destroy\n @host_config.destroy\n respond_to do |format|\n format.html { redirect_to host_configs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6b607bba5d125076fe8a2161208fabab", "score": "0.5645999", "text": "def destroy\n @upgrade = Upgrade.find(params[:id])\n @upgrade.destroy\n\n respond_to do |format|\n format.html { redirect_to(upgrades_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9dca02cc9b0305417b85e7ed8eba48c3", "score": "0.564591", "text": "def destroy\n\t\tif params[:format] != 'xml'\n\t\t\trender_error(\"Must call this through the web service\", :forbidden)\n\t\telse\n\t\t\tfederation = Federation.find_by({ name: params[:federation] })\n\t\t\tip = request.headers['REMOTE_ADDR']\n\t\t\tif federation && ip == federation.ip\n\t\t\t\tbegin\n\t\t\t\t\tcommit = params[:commit] == 'immediate'\n\t\t\t\t\tid = params[:id]\n\t\t\t\t\turi = QueryFormat.id_to_uri(id).gsub(\"$[FEDERATION_SITE]$\", federation.site).gsub(':', '\\\\:').gsub('/', '\\\\/')\n\n\t\t\t\t\tis_test = Rails.env == 'test' ? :test : :live\n\t\t\t\t\tsolr = Solr.factory_create(is_test)\n\t\t\t\t\tsolr.remove_exhibit(uri, commit)\n\n\t\t\t\t\t#node = Archive.find_by_handle(archive)\n\t\t\t\t\t#node.destroy if !node.blank?\n\t\t\t\t\t\t\n\t\t\t\t\trespond_to do |format|\n\t\t\t\t\t\tformat.xml { render :template => '/exhibits/destroy' }\n\t\t\t\t\tend\n\t\t\t\trescue ArgumentError => e\n\t\t\t\t\trender_error(e.to_s)\n\t\t\t\trescue SolrException => e\n\t\t\t\t\trender_error(e.to_s, e.status())\n\t\t\t\trescue Exception => e\n\t\t\t\t\tExceptionNotifier.notify_exception(e, :env => request.env)\n\t\t\t\t\trender_error(\"Something unexpected went wrong.\", :internal_server_error)\n\t\t\t\tend\n\t\t\telse\n\t\t\t\trender_error(\"You do not have permission to do this.\", :unauthorized)\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "59454099f9d88c0b860a7d685f8224fb", "score": "0.5643798", "text": "def destroy\n @enclave = Enclave.find(params[:id])\n @enclave.destroy\n\n respond_to do |format|\n format.html { redirect_to(enclaves_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
12e1d77c2ede0b4bbefca14f9afa9cb3
POST /slideshows POST /slideshows.xml
[ { "docid": "1b32d7011aa9437df9951ac7e30600ae", "score": "0.70298433", "text": "def create\n @slideshow = Slideshow.new(params[:slideshow])\n\n respond_to do |format|\n if @slideshow.save\n format.html { redirect_to(slideshows_path, :notice => 'Slideshow was successfully created.') }\n format.xml { render :xml => @slideshow, :status => :created, :location => @slideshow }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @slideshow.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "f4708bdcf659cbe1fc98ce64f90da6c3", "score": "0.71784997", "text": "def upload_slideshow(options={})\n response = get(\"upload_slideshow/\", options)\n end", "title": "" }, { "docid": "ba4eb83b7acc5d1bee5a72be81b855ae", "score": "0.69476676", "text": "def create\n @slideshow = Slideshow.new(params[:slideshow])\n\n respond_to do |format|\n if @slideshow.save\n flash[:notice] = 'Slideshow was successfully created.'\n format.html { redirect_to(@slideshow) }\n format.xml { render :xml => @slideshow, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @slideshow.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13b21e836fbc43bf772fb2c711717531", "score": "0.6758365", "text": "def create\n @slideshow = Slideshow.new(params[:slideshow])\n\n respond_to do |format|\n if @slideshow.save\n\n # some free slides ... TODO: remove\n @slideshow.slides.create(:layout => Slide::TEXT_ONLY)\n @slideshow.slides.create(:layout => Slide::LEFT_IMAGE)\n @slideshow.slides.create(:layout => Slide::RIGHT_IMAGE)\n @slideshow.slides.create(:layout => Slide::FULL_IMAGE)\n\n format.html { redirect_to @slideshow, notice: 'Slideshow was successfully created.' }\n format.json { render json: @slideshow, status: :created, location: @slideshow }\n else\n format.html { render action: \"new\" }\n format.json { render json: @slideshow.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "200b24fa39333195631793a33a6d5a30", "score": "0.6694145", "text": "def create\n @slideshow = Slideshow.new(params[:slideshow])\n @slideshow.slides << Slide.find(params[:slide_pick])\n @slideshow.sequence = params[:slide_pick].to_s\n\n respond_to do |format|\n if @slideshow.save\n flash[:notice] = 'Slideshow was successfully created.'\n format.html { redirect_to(edit_slideshow_path(@slideshow)) }\n format.xml { render :xml => @slideshow, :status => :created, :location => @slideshow }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @slideshow.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "658297151c21ef4e7cf187738e3cce1f", "score": "0.6678099", "text": "def create\n @slide = Slide.new(params[:slide].merge(:slideshow_id => params[:slideshow_id]))\n\n respond_to do |format|\n if @slide.save\n flash[:notice] = 'Slide was successfully created.'\n format.html { redirect_to(slideshow_url(@slide.slideshow)) }\n format.xml { render :xml => @slide, :status => :created }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @slide.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "efdfdb32535fb422f4cd6910b211a70f", "score": "0.6663225", "text": "def create\n @slide_show = SlideShow.create(params[:slide_show])\n params[:slides].each_value do |v|\n @slide_show.slides.create(v)\n end\n\n respond_to do |format|\n if @slide_show.save\n format.html { redirect_to @slide_show, notice: 'Slide show was successfully created.' }\n format.json { render json: @slide_show.to_json(include: :slides), status: :created, location: @slide_show }\n else\n format.html { render action: \"new\" }\n format.json { render json: @slide_show.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df252ea52586fea2bca931663e795ced", "score": "0.65953314", "text": "def index\n @slideshows = Slideshow.all\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.xml { render :xml => @slideshows }\n end\n end", "title": "" }, { "docid": "5870b643824a05e963e38df66d724f8d", "score": "0.6550607", "text": "def create\n @slideshow = Slideshow.new(params[:slideshow])\n\n if @slideshow.save\n flash[:notice] = 'Slideshow was successfully created.'\n redirect_to(@slideshow)\n else\n render :action => \"new\"\n end\n end", "title": "" }, { "docid": "95cb3532307c39998c857bb1f6dfdb60", "score": "0.65473163", "text": "def index\n @slideshow_id = params[:slideshow_id]\n @slides = Slide.all(:conditions => ['slideshow_id = ?', @slideshow_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @slides }\n end\n end", "title": "" }, { "docid": "c9a63a07158691861a289a25d92336cc", "score": "0.6514733", "text": "def index\n @slideshows = Slideshow.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @slideshows }\n end\n end", "title": "" }, { "docid": "c9a63a07158691861a289a25d92336cc", "score": "0.6514733", "text": "def index\n @slideshows = Slideshow.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @slideshows }\n end\n end", "title": "" }, { "docid": "96edcfddd883e1b4b502467d8b98743c", "score": "0.64983374", "text": "def new\n @slideshow_id = params[:slideshow_id]\n @slide = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slide }\n end\n end", "title": "" }, { "docid": "369a48659a7a484c3ffdc62bb030b4de", "score": "0.647706", "text": "def new\n @slideshow = Slideshow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slideshow }\n end\n end", "title": "" }, { "docid": "369a48659a7a484c3ffdc62bb030b4de", "score": "0.647706", "text": "def new\n @slideshow = Slideshow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slideshow }\n end\n end", "title": "" }, { "docid": "369a48659a7a484c3ffdc62bb030b4de", "score": "0.647706", "text": "def new\n @slideshow = Slideshow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slideshow }\n end\n end", "title": "" }, { "docid": "f18d77b5d3e08644603a2e04990cae36", "score": "0.6381591", "text": "def create\n @slideshow = Slideshow.new(params[:slideshow])\n @user.slideshows << @slideshow\n\n respond_to do |format|\n if @slideshow.save\n format.html { redirect_to @slideshow, notice: 'Slideshow was successfully created.' }\n format.json { render json: @slideshow, status: :created, location: @slideshow }\n else\n format.html { render action: \"new\" }\n format.json { render json: @slideshow.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "821e790402f9c2694a4a10c997e1e55b", "score": "0.6372247", "text": "def slideshow_params\n params.require(:slideshow).permit(:name, :published, :theme_id, slides_attributes: [:id, :image, :_destroy])\n end", "title": "" }, { "docid": "4c022ec6ca29153b05002784776e5a14", "score": "0.6358991", "text": "def create\n @slide = @slider.slides.build(slide_params)\n\n if @slide.save\n render json: @slide, status: :created\n else\n render json: @slide.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "912d9d5f143a0caaccf65ad8cf8b20fa", "score": "0.63056964", "text": "def create\n @slideshow = Slideshow.new(params[:slideshow])\n \n @user.slideshows << @slideshow\n\n respond_to do |format|\n if @slideshow.save\n format.html { redirect_to @slideshow, notice: 'Slideshow was successfully created.' }\n format.json { render json: @slideshow, status: :created, location: @slideshow }\n else\n format.html { render action: \"new\" }\n format.json { render json: @slideshow.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d3a500e3c75611c2135de3417c94698", "score": "0.6298671", "text": "def new\n @slideshow = Slideshow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slideshow }\n end\n end", "title": "" }, { "docid": "87000860f3d0a9b6868f29fb27e3ece8", "score": "0.6134708", "text": "def show\n @slideshow = Slideshow.find(params[:id])\n @slideshow_text = serializeSlideshow(@slideshow)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @slideshow }\n end\n end", "title": "" }, { "docid": "891818ba4bb185045c9c286568b5026e", "score": "0.61268324", "text": "def create\n @slideshow_attrib = SlideshowAttrib.new(params[:slideshow_attrib])\n\n respond_to do |format|\n if @slideshow_attrib.save\n format.html { redirect_to @slideshow_attrib, notice: 'Slideshow attrib was successfully created.' }\n format.json { render json: @slideshow_attrib, status: :created, location: @slideshow_attrib }\n else\n format.html { render action: \"new\" }\n format.json { render json: @slideshow_attrib.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65b428580230a3bea3dedf9a9b8a0d90", "score": "0.6059201", "text": "def create(title, filename, username, password, options = {})\n force_boolean_params_to_letters! options\n options.merge!(:username => username, :password => password,\n :slideshow_title => title)\n params = base.send(:add_required_params, options).map do |key, value|\n Curl::PostField.content(key.to_s, value)\n end\n params << Curl::PostField.file(\"slideshow_srcfile\", File.expand_path(filename))\n\n curl = Curl::Easy.new(\"#{SlideShare::Base.base_uri}/upload_slideshow\") do |c|\n c.multipart_form_post = true\n end\n curl.http_post(*params)\n\n body = Crack::XML.parse(curl.body_str)\n\n response = base.send(:catch_errors, body)\n # I'd presume the id returned was an integer\n response[\"SlideShowUploaded\"][\"SlideShowID\"].to_i\n end", "title": "" }, { "docid": "a8e218b7acfb787a7138fe9722a18d5f", "score": "0.6055725", "text": "def create\n @cms_slideshow_image = Cms::SlideshowImage.new(cms_slideshow_image_params)\n\n respond_to do |format|\n if @cms_slideshow_image.save\n format.html { redirect_to @cms_slideshow_image, notice: 'Slideshow image was successfully created.' }\n format.json { render :show, status: :created, location: @cms_slideshow_image }\n else\n format.html { render :new }\n format.json { render json: @cms_slideshow_image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df3122b672ad5bf301805ff2bfd2ed32", "score": "0.6045679", "text": "def create\n @slide = Slide.new(slide_params)\n\n if @slide.save\n render :show, status: :created, location: @slide\n else\n render json: @slide.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ba5d4a5c64f8f040061f761e4d0d039a", "score": "0.60348344", "text": "def create\n @slide = Slide.new(params[:slide])\n\n respond_to do |format|\n if @slide.save\n format.html { redirect_to action: \"list\", notice: 'Slide was successfully created.' }\n format.json { render json: @slide, status: :created, location: @slide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44fd468e80a6ecf0e00944f07ebf872e", "score": "0.6003116", "text": "def create\n @slide_show = SlideShow.new(slide_show_params)\n\n respond_to do |format|\n if @slide_show.save\n format.html { redirect_to [:admin, @slide_show], notice: 'Tạo slideshow mới thành công.' }\n format.json { render :show, status: :created, location: @slide_show }\n else\n format.html { render :new }\n format.json { render json: @slide_show.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "436ccaa0676b8e78405b7f2755bd98bf", "score": "0.59931725", "text": "def create\n @presentation = Presentation.find_by_uid(params[:presentation_uid])\n last_slide_x = (@presentation.slides.last) ? @presentation.slides.last.position_x : 0\n @slide = @presentation.slides.create(params[:slide])\n @slide.position_x = last_slide_x + 1000\n @slide.name = \"#{@slide.name}_#{@slide.id}\"\n @slide.save!\n # redirect_to presentation_path(@presentation.uid)\n respond_to do |format|\n format.js\n format.json\n end\n end", "title": "" }, { "docid": "87efcabbfcf5f339ab562fe29fbf8769", "score": "0.59717745", "text": "def show\n @slideshow = Slideshow.find(params[:id], :include => :slides)\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @slideshow.to_xml(:include => :slides) }\n end\n end", "title": "" }, { "docid": "f5334640577913eecb933caf568fcbf6", "score": "0.5964153", "text": "def new\n @slideshow_image = SlideshowImage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slideshow_image }\n end\n end", "title": "" }, { "docid": "f748daa93124a20f06f42ab41c6ab262", "score": "0.5952913", "text": "def create\n @slide = Slide.create(slide_params)\n\n respond_to do |format|\n if @slide.save\n format.html { redirect_to '/administrator/sliders', notice: 'Информация обновлена' }\n format.json { render :show, status: :created, location: @slide }\n else\n format.html { render :new }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc856eb0fd5fcad5e61af88c9a2a4c9c", "score": "0.59487486", "text": "def new\n if params[:slideshow_name].present?\n @slideshow = Slideshow.where(:name => params[:slideshow_name]).first\n if @slideshow.nil?\n create(params[:name])\n return\n end\n elsif params[:slideshow_id].present?\n @slideshow = Slideshow.find(params[:slideshow_id])\n end\n \n if @slideshow.slide_order_hash.present?\n @first_slide = Slide.find(@slideshow.slide_order_hash[1])\n @first_slide = @first_slide.slide\n else\n @first_slide = nil\n end\n \n @slide = @slideshow.slides.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slide }\n end\n end", "title": "" }, { "docid": "2d9485e1c8f5d5308733511b11a8804a", "score": "0.59444064", "text": "def create\n @slide = Slide.new(slide_params)\n respond_to do |format|\n if @slide.save\n format.html { redirect_to slides_path, notice: t('actions.save.success') }\n format.json { render :show, status: :ok, location: @slide }\n else\n format.html do\n flash.now[:error] = t('actions.save.error')\n render :new\n end\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f45cf8d17f217feb7e1520578f86aa81", "score": "0.5913739", "text": "def show\n @slideshow = Slideshow.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slideshow }\n end\n end", "title": "" }, { "docid": "f45cf8d17f217feb7e1520578f86aa81", "score": "0.5913739", "text": "def show\n @slideshow = Slideshow.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slideshow }\n end\n end", "title": "" }, { "docid": "9ed5c58d9c6b9d84a60b19464b97a8b0", "score": "0.5908232", "text": "def create\n @slide = Slide.new(slide_params)\n\n respond_to do |format|\n if @slide.save\n format.html { redirect_to presentation_slide_path(@presentation, @slide), notice: 'Slide was successfully created.' }\n format.json { render :show, status: :created, location: @slide }\n else\n format.html { render :new }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a0414f80a10f51337461d899a524805", "score": "0.58902305", "text": "def create\n \n slideshow_id = params[:slideshow_id]\n slideshow = Slideshow.find(slideshow_id)\n \n subtype = params[:slide][:subtype]\n title = params[:slide][:title]\n duration = params[:slide][:duration]\n text = params[:text]\n \n if subtype == \"text\"\n @slide = TextSlide.new\n @slide.html = text\n elsif subtype == \"image\"\n @slide = ImageSlide.new\n @slide.image_url = text\n elsif subtype == \"video\"\n @slide = VideoSlide.new\n @slide.video_url = text\n elsif subtype == \"web\"\n @slide = WebSlide.new\n @slide.site_url = text\n elsif subtype == \"rss\"\n @slide = RssSlide.new\n @slide.rss_url = text\n elsif subtype == \"analytics\"\n @slide = AnalyticsSlide.new\n else\n flash[:notice] = \"The user was successfully created\"\n redirect_to :back, :flash => { :error => \"The user was successfully created\" }\n return\n end\n \n @slide.title = title\n @slide.duration = duration\n @slide.slideshow_id = slideshow_id\n \n respond_to do |format|\n if @slide.save\n format.html { redirect_to :back}#(@slide, :notice => 'Slide was successfully created.') }\n format.xml { render :xml => @slide, :status => :created, :location => @slide }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @slide.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f91a80e289ad9b5d59a32f31bee304e", "score": "0.5877845", "text": "def set_slideshow\n @slideshow = Slideshow.find(params[:id])\n end", "title": "" }, { "docid": "23552c0cb16cf32a8cee155878173a05", "score": "0.58487135", "text": "def create\n @slide = Slide.new(slide_params)\n @slide.presentation = @presentation\n\n respond_to do |format|\n if @slide.save\n format.html { redirect_to location: presentation_slides_url(@presentation), notice: 'Slide was successfully created.' }\n format.json { render action: 'show', status: :created, location: @slide }\n else\n format.html { render action: 'new' }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "757c602868a73b4278d793065d6b3e7a", "score": "0.584401", "text": "def create\n @slide_show = SlideShow.new(slide_show_params)\n\n respond_to do |format|\n if @slide_show.save\n format.html { redirect_to @slide_show, notice: 'Slide show was successfully created.' }\n format.json { render :show, status: :created, location: @slide_show }\n else\n format.html { render :new }\n format.json { render json: @slide_show.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "663a92f528f07ada223c6fe041b8ba81", "score": "0.583161", "text": "def new\n @slideshow_attrib = SlideshowAttrib.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slideshow_attrib }\n end\n end", "title": "" }, { "docid": "cfa40dc914b6ce7a465556e0f9f407c6", "score": "0.5829517", "text": "def index\n @slides = Slide.paginate :page => params[:page], :order => 'created_at DESC'\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @slides }\n end\n end", "title": "" }, { "docid": "fdfea9539380d3c191545dae4284e68e", "score": "0.5828366", "text": "def create\n @slide_show = SlideShow.new(params[:slide_show])\n\n respond_to do |format|\n if @slide_show.save\n flash[:notice] = 'SlideShow was successfully created.'\n format.html { redirect_to(admin_slide_shows_url) }\n format.xml { render :xml => @slide_show, :status => :created, :location => @slide_show }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @slide_show.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "68bccd7bd279031472f5244ecb124b64", "score": "0.5816707", "text": "def new\n @slideshow = Slideshow.new\n end", "title": "" }, { "docid": "858915894333c8c113542ad500b36cc5", "score": "0.58068293", "text": "def slideshow_params\n params.require(:slideshow).permit(:audio_url, :public)\n end", "title": "" }, { "docid": "8774473caff299735963b870a6a911b3", "score": "0.5799933", "text": "def create_new_slideshow(filename = \"slideshow.xml\")\n @path = Pathname.new filename\n end", "title": "" }, { "docid": "2b0d60cfc16b52efb5c0e56080f2f28d", "score": "0.5788254", "text": "def slideshows\r\n @pictures = current_user.pictures.all\r\n @slideshow = current_user.slideshows.new \r\n end", "title": "" }, { "docid": "2544358a4827f20063255d1a29a03e97", "score": "0.5764703", "text": "def create\n if params[:files]\n default_title = params[:files].first.original_filename.to_s\n default_params = { image: params[:files].first, caption: 'Enter Caption', title: default_title, expires_at: Date.today, slide_type_id: @default_slide_type.id, collection_id: @default_collection.id }\n @slide = Slide.new(default_params)\n else\n @slide = Slide.new(slide_params)\n end\n\n build_kiosks(params)\n respond_to do |format|\n if @slide.save\n format.html { redirect_to @slide, notice: 'Slide was successfully created.' }\n format.json do\n render json: { files: [@slide.to_jq_upload] }\n end.to_json\n else\n format.html { render :new }\n format.json { render json: @slide.errors, status: :unprocessable_entity }.to_json\n end\n end\n end", "title": "" }, { "docid": "0b76b01bf8d911010b3e79bae2a154ef", "score": "0.5754513", "text": "def show\n @slideshow = Slideshow.find(params[:id])\n\n respond_to do |format|\n format.html { render :layout => 'slideshow' } # show.html.erb\n format.xml { render :xml => @slideshow }\n end\n end", "title": "" }, { "docid": "45f1e244625d79ced4ecd11e8e75a924", "score": "0.5752076", "text": "def create\n @slide = Slide.new(params[:slide])\n \n respond_to do |format|\n if @slide.save\n flash[:notice] = 'Slide was successfully created.'\n format.html { redirect_to( @slide.slide_show ? admin_slide_show_slides_url(@slide.slide_show) : admin_slides_url ) }\n format.xml { render :xml => @slide, :status => :created, :location => @slide }\n else\n format.html { render :action => \"show\" }\n format.xml { render :xml => @slide.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "53185d16608be499a9568051b18e1137", "score": "0.57508856", "text": "def create\n @slideshow = Slideshow.new(user: current_user)\n @slideshow.assign_attributes(slideshow_params)\n authorize @slideshow\n\n respond_to do |format|\n if @slideshow.save\n format.html { redirect_to edit_slideshow_path(@slideshow), notice: t('controllers.slideshows.created_flash') }\n format.json { render :show, status: :created, location: @slideshow }\n else\n format.html { render @slideshow.slideshow? ? :new : :new_folder }\n format.json { render json: @slideshow.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a4af0a7bab49b0d115a3e5e96dd1972", "score": "0.5749506", "text": "def update\n @slideshow = @user.slideshows.find(params[:id])\n\n slides = params[:slides]\n slides.each do |slide|\n @slide = @slideshow.slides.find(slide[\"id\"])\n @slide.update_attributes slide.select{|k,v| k != \"id\" || k != \"data_url\"}\n data_url = slide[\"data_url\"]\n process_images @slide, data_url\n end\n\n @slideshow.slides = @slideshow.slides.sort! {|x,y| x.slide_count <=> y.slide_count}\n @slideshow.thumbnail_src = @slideshow.slides.first.img_src \n\n respond_to do |format|\n if @slideshow.update_attributes(params[:slideshow])\n format.html { redirect_to @slideshow, notice: 'Slideshow was successfully updated.' }\n format.json { render json: @slideshow }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @slideshow.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b6c9c61ad6144272196d0eba76024ef", "score": "0.5739266", "text": "def edit_slideshow(options={})\n response = get(\"edit_slideshow/\", options)\n end", "title": "" }, { "docid": "bf05e32b82f8e52fea10eb108e406776", "score": "0.57298326", "text": "def index\n @slideshow = Slideshow.new\n\n @slideshows = @user.slideshows\n \n @graph = Koala::Facebook::GraphAPI.new(current_user.token)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @slideshows }\n end\n \n end", "title": "" }, { "docid": "bf05e32b82f8e52fea10eb108e406776", "score": "0.57298326", "text": "def index\n @slideshow = Slideshow.new\n\n @slideshows = @user.slideshows\n \n @graph = Koala::Facebook::GraphAPI.new(current_user.token)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @slideshows }\n end\n \n end", "title": "" }, { "docid": "2381232d19e359c980eb401415ddb57f", "score": "0.57049465", "text": "def delete_slideshow(options={})\n response = get(\"delete_slideshow/\", options)\n end", "title": "" }, { "docid": "962dd6b24fa6bac75e14afa1a79ba762", "score": "0.5697719", "text": "def index\n @slide_show = SlideShow.find(params[:slide_show_id]) if params[:slide_show_id]\n @slides = ( @slide_show ? @slide_show.slides : Slide ).paginate :page => params[:page], :order => sort_order(:default => 'asc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @slides }\n end\n end", "title": "" }, { "docid": "24b18743d0dc2f9912cc4c69ef1cf82e", "score": "0.5695817", "text": "def destroy\n @slideshow = Slideshow.find(params[:id])\n @slideshow.destroy\n\n respond_to do |format|\n format.html { redirect_to(slideshows_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "24b18743d0dc2f9912cc4c69ef1cf82e", "score": "0.5695817", "text": "def destroy\n @slideshow = Slideshow.find(params[:id])\n @slideshow.destroy\n\n respond_to do |format|\n format.html { redirect_to(slideshows_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9496119cd6789cc4c75e74c29191b7e0", "score": "0.56713086", "text": "def show_full\n setup_slideshow\n respond_to do |format|\n format.html { render :layout => 'slideshow'} # show.html.erb\n format.xml { render :xml => @photos }\n end\n end", "title": "" }, { "docid": "ab490a3435d0bade29ad46b99d60d370", "score": "0.5669469", "text": "def create\n @anonymous_slide = AnonymousSlide.new(anonymous_slide_params)\n @presentation = Presentation.new\n @presentation.title = @anonymous_slide.content.lines.first.chomp\n @presentation.slides.build(:content => @anonymous_slide.content)\n\n respond_to do |format|\n if @presentation.save\n params[:url_token] = @presentation.url_token\n params[:url_title] = @presentation.url_title\n\n format.html { redirect_to edit_token_url_path(@presentation.url_token, @presentation.url_title), notice: 'Presentation was successfully created.' }\n format.json { render action: 'show', status: :created, location:token_url_path }\n else\n format.html { render action: 'new' }\n format.json { render json: @anonymous_slide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "93ce31b100dbb3b840a1d4218096168b", "score": "0.5655712", "text": "def create\n @analytics_slide = AnalyticsSlide.new(params[:analytics_slide])\n\n respond_to do |format|\n if @analytics_slide.save\n format.html { redirect_to(@analytics_slide, :notice => 'Analytics slide was successfully created.') }\n format.xml { render :xml => @analytics_slide, :status => :created, :location => @analytics_slide }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @analytics_slide.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a81871b69a2409e4388472fe35f1cef", "score": "0.5654309", "text": "def create\n @video_slide = VideoSlide.new(params[:video_slide])\n\n respond_to do |format|\n if @video_slide.save\n format.html { redirect_to(@video_slide, :notice => 'Video slide was successfully created.') }\n format.xml { render :xml => @video_slide, :status => :created, :location => @video_slide }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @video_slide.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eccbb519ecb6d28db28f07af868f97cd", "score": "0.56460106", "text": "def new\n @slide_show = SlideShow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide_show }\n end\n end", "title": "" }, { "docid": "1a1aede584349640852eff2cbc4c3095", "score": "0.56358784", "text": "def slide_params\n params.require(:slide).permit(:title, :page_number, :image_url, :presentation_id)\n end", "title": "" }, { "docid": "8e2b0ca0156780b99c23fe748f779391", "score": "0.56353104", "text": "def new\n @slide_new = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @slide }\n end\n end", "title": "" }, { "docid": "98dd9d1389493d582803735ecc9b6ced", "score": "0.56265557", "text": "def slideshow\n @configuration_set = ConfigurationSet.slideshow\n @metadata_set = MetadataSet.page(title: 'Slideshow Page')\n @data_definition = DataDefinitions::Slideshow.default\n\n # Define configuration set regions. This mimics the regions section of Configuation Set\n # properties view in Cascade.\n @configuration_set.regions = {\n # Empty Regions\n 'ADDITIONAL BODY AT-END' => '',\n 'ADDITIONAL HEAD' => '',\n 'CSS' => '',\n 'FORM_VALIDATION' => '',\n\n # Dynamic Regions\n 'COMMON STYLES' => cascade_block('_cascade/blocks/html/common_styles'),\n 'COMMON SCRIPTS' => cascade_block('_cascade/blocks/html/common_scripts'),\n 'CUSTOM THEME' => cascade_block('_cascade/blocks/custom_themes/law'),\n 'GLOBAL FOOTER' => cascade_block('_cascade/blocks/html/law_footer'),\n 'META VIEWPORT' => cascade_block('_cascade/blocks/html/global_meta_viewport'),\n\n # TODO: convert these as needed.\n 'BREADCRUMBS' => 'TODO: _cascade/formats/level/Breadcrumbs',\n 'GOOGLE_ANALYTICS' => '<!-- TODO: _chapman_common:_cascade/blocks/ANALYTICS-TRACKING -->',\n 'JUMP LINK' => '<!-- TODO: _cascade/templates/Jump Link -->',\n 'LEFT COLUMN CALLOUT' => 'TODO: _cascade/formats/level/LeftColumnCallout',\n 'LEFT COLUMN NEWS EVENTS' => 'TODO: _cascade/blocks/html/Left Column News Events',\n 'LEFT NAV' => 'TODO: _cascade/formats/level/LeftNav',\n 'NAME BAR' => 'TODO: _cascade/formats/school home pages/NameBar',\n 'NEWS EVENTS' => 'TODO: _cascade/formats/level/News',\n 'OG_TAGS' => '<!-- TODO: _cascade/formats/Open Graph And Canonical Tags -->',\n 'SLIDES' => 'TODO: _cascade/formats/school home pages/slideshow/slides',\n 'SOCIAL_ACCOUNTS' => 'TODO: _cascade/formats/level/social_accounts',\n\n # TODO: convert these to cascade_format action.\n \"UNINAV\" => render_static_partial(\"uninav/uninav\"),\n 'PRIMARY CONTENT' => '<h2>PRIMARY CONTENT GOES HERE!</h2>'\n }\n\n render @configuration_set.template\n end", "title": "" }, { "docid": "067c685b0ad543b6923dfc78bd6afb1d", "score": "0.5613418", "text": "def load_slideshow(filename)\n @path = Pathname.new filename\n load_slideshow_xml\n\n # Load the content from the XML doc\n load_start_time\n load_wallpapers\n end", "title": "" }, { "docid": "535ba7dbed4367bd8d9650e75e5b1afd", "score": "0.56049764", "text": "def update\n @slideshow = @user.slideshows.find(params[:id])\n @user.slideshows << @slideshow\n\n respond_to do |format|\n if @slideshow.update_attributes(params[:slideshow])\n format.html { redirect_to @slideshow, notice: 'Slideshow was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @slideshow.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d046f1004c9d624e41fd066f6f762c2b", "score": "0.5594152", "text": "def slide_params\n params.require(:slide).permit(\n :slide_html,\n :slide_weight,\n :slide_length,\n :slideshow_id,\n )\n end", "title": "" }, { "docid": "710f9f7adb9557ffc7baa37a7aadb589", "score": "0.55928123", "text": "def update\n @slideshow = Slideshow.find(params[:id])\n\n respond_to do |format|\n if @slideshow.update_attributes(params[:slideshow])\n flash[:notice] = 'Slideshow was successfully updated.'\n format.html { redirect_to(@slideshow) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @slideshow.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba8a360fc08979573777213c89917c24", "score": "0.55895776", "text": "def index\n @slides = Slide.all\n end", "title": "" }, { "docid": "c2f19acafbecd4af945e963a0428a96a", "score": "0.55785316", "text": "def index\n @slide_shows = SlideShow.paginate :page => params[:page], :order => sort_order\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @slide_shows }\n end\n end", "title": "" }, { "docid": "a48a8f5abcada6a4a53dfcb675407427", "score": "0.55690575", "text": "def new\n @slide = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide }\n end\n end", "title": "" }, { "docid": "a48a8f5abcada6a4a53dfcb675407427", "score": "0.55681306", "text": "def new\n @slide = Slide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @slide }\n end\n end", "title": "" }, { "docid": "9eda332b5e1918e975d6dd43465e542c", "score": "0.55603695", "text": "def update\n @slideshow = Slideshow.find(params[:id])\n\n respond_to do |format|\n if @slideshow.update_attributes(params[:slideshow])\n format.html { redirect_to(slideshows_path, :notice => 'Slideshow was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @slideshow.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "de9dee1577f71eb310c6d7a796436122", "score": "0.5551673", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slideshow }\n end\n end", "title": "" }, { "docid": "398e9ec4a2c194d538dc1024fc7afdfb", "score": "0.5547092", "text": "def show\n @slideshow = Slideshow.find(params[:id])\n end", "title": "" }, { "docid": "eb09f65525b9674ac409046e23514952", "score": "0.552733", "text": "def destroy\n @slideshow = Slideshow.find(params[:id])\n @slideshow.destroy\n\n respond_to do |format|\n format.html { redirect_to(slideshows_path, :notice => 'Slideshow was successfully destroyed.') }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b16a411c2ffe786db90f87b90cebeab9", "score": "0.5522061", "text": "def index\n @slide_shows = SlideShow.all\n end", "title": "" }, { "docid": "6d7ce31af5f926b4b4bb1b449997915f", "score": "0.55177766", "text": "def index\n @project = @current_user\n param = {:evms => @evms}\n @evms = @project.currentRevision\n param = {:evm => @evms}\n \n @pvevac_f = PV_EV_AC_GraphFactory.new\n @pvevac = @pvevac_f.getSlideData(param) #Viewで使用\n \n \n \n @day = Date.new(2012,2,7)\n @pre = Presentation.find_by_create_date(@day)\n\n @preslide = @pre.slides\n p @preslide\n @preslide.each do |preslide|\n p preslide\n print \"\\n\"\n end\n end", "title": "" }, { "docid": "9380a26cd1631c2a0b7b3631b0d7a2bd", "score": "0.5510734", "text": "def index\n @slides = @presentation.slides.order(sort_order: :asc)\n redirect_to new_presentation_slide_path(@presentation) unless @slides.any?\n end", "title": "" }, { "docid": "56030a6428345ba6c1d7bddcb3f0343e", "score": "0.5508388", "text": "def create\n @slide_url = SlideUrl.new(params[:slide_url])\n\n respond_to do |format|\n if @slide_url.save\n flash[:notice] = 'SlideUrl was successfully created.'\n format.html { redirect_to(@slide_url) }\n format.xml { render :xml => @slide_url, :status => :created, :location => @slide_url }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @slide_url.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2500861bb5c8e160181982336a770d69", "score": "0.5501474", "text": "def create\n @slide_item = SlideItem.new(params[:slide_item])\n\n respond_to do |format|\n if @slide_item.save\n format.html { redirect_to @slide_item, notice: 'Slide item was successfully created.' }\n format.json { render json: @slide_item, status: :created, location: @slide_item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @slide_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1d8d1a5e484e6bc44018cb5b9b346d1f", "score": "0.54947406", "text": "def create\n\n @presentation_pslide = PresentationsPslide.new(params[:presentations_pslide])\n\n respond_to do |format|\n if @presentation_pslide.save\n format.html { redirect_to view_presentation_path(@presentation_pslide.presentation.id), notice: 'PresentationPslide was successfully created.' }\n format.json { render json: @presentation_pslide, status: :created, location: @presentation_pslide }\n else\n format.html { render action: \"new\" }\n format.json { render json: @presentation_pslide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ee39534e6630c765e7438f5ab247938", "score": "0.5480625", "text": "def create\n @mainslide = Mainslide.new(mainslide_params)\n\n respond_to do |format|\n if @mainslide.save\n format.html { redirect_to @mainslide, notice: 'Mainslide was successfully created.' }\n format.json { render :show, status: :created, location: @mainslide }\n else\n format.html { render :new }\n format.json { render json: @mainslide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc35def9949d8fe887b5de3ea85879e6", "score": "0.5472727", "text": "def create\n @slide = @space.slides.build(slide_params)\n\n respond_to do |format|\n if @slide.save\n format.html { redirect_to [:admin, @space.location.org, @space.location, @space, @slide], notice: 'Slide was successfully created.' }\n format.json { render :show, status: :created, location: [:admin, @space.location.org, @space.location, @space, @slide] }\n else\n format.html { render :new }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43831de5827f3609df9afaef7da812cb", "score": "0.54580843", "text": "def new\n @slide_show = SlideShow.new\n\n respond_to do |format|\n format.html { render :action =>'show' }\n format.xml { render :xml => @slide_show }\n end\n end", "title": "" }, { "docid": "e5335a4c8eca25789f57ca879e6b89a7", "score": "0.545468", "text": "def create\n @image_slider = ImageSlider.new(params[:image_slider])\n\n respond_to do |format|\n if @image_slider.save\n format.html { redirect_to @image_slider, notice: 'Image slider was successfully created.' }\n format.json { render json: @image_slider, status: :created, location: @image_slider }\n else\n format.html { render action: \"new\" }\n format.json { render json: @image_slider.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf9a6d7a5e9222751f7a016011c159c7", "score": "0.54473805", "text": "def new\n @slide = Slide.new\n @slide.save()\n respond_to do |format|\n format.html { redirect_to :action => \"show\", :id => @slide.id }\n format.json { render json: @slide }\n end\n end", "title": "" }, { "docid": "9e76166a32ad1d5919e3105a7e8d68e3", "score": "0.5447149", "text": "def slides_xml_url\n return '/archive/detail/' + id.to_s + '/slides.xml'\n end", "title": "" }, { "docid": "ba82921a9576d09042654bc3596cc460", "score": "0.5443307", "text": "def update\n @slideshow = Slideshow.find(params[:id])\n seq = @slideshow.sequence.split(\",\")\n if params[:slide_pick]\n @slideshow.slides << Slide.find(params[:slide_pick])\n seq.push params[:slide_pick].to_s\n @slideshow.sequence = seq.join(\",\")\n end\n if params[:slide_remove]\n @slideshow.slides.delete(Slide.find(params[:slide_remove]))\n seq.delete(params[:slide_remove].to_s)\n @slideshow.sequence = seq.join(\",\")\n end\n if params[:slide_up]\n index = seq.index(params[:slide_up].to_s)\n if index > 0\n seq.delete(params[:slide_up].to_s)\n seq.insert(index - 1, params[:slide_up].to_s)\n @slideshow.sequence = seq.join(\",\")\n end\n end\n if params[:slide_down]\n index = seq.index(params[:slide_down].to_s)\n if index < seq.length - 1\n seq.delete(params[:slide_down].to_s)\n seq.insert(index + 1, params[:slide_down].to_s)\n @slideshow.sequence = seq.join(\",\")\n end\n end\n\n respond_to do |format|\n if @slideshow.update_attributes(params[:slideshow])\n flash[:notice] = 'Slideshow was successfully updated.'\n format.html { redirect_to(edit_slideshow_path(@slideshow)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @slideshow.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "859095b9e1380ad6c4d0f95a193c34b0", "score": "0.54393375", "text": "def create\n @panel_slide = Panel::Slide.new(panel_slide_params)\n\n respond_to do |format|\n if @panel_slide.save\n format.html { redirect_to panel_slides_path, notice: \"#{t('panel.alert.create')}\" }\n format.json { render :show, status: :created, location: @panel_slide }\n else\n format.html { render :new }\n format.json { render json: @panel_slide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d654f10fe8605e01236af550debf4207", "score": "0.54378986", "text": "def search_slideshows(options={})\n response = get(\"search_slideshows/\", options)\n end", "title": "" }, { "docid": "784d9be932a7791977fcaf87840f3cc5", "score": "0.5434336", "text": "def new\n @slide_url = SlideUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slide_url }\n end\n end", "title": "" }, { "docid": "4e35bdfe42f1dbb9652844349112086b", "score": "0.5431285", "text": "def show\n @slideshow_image = SlideshowImage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slideshow_image }\n end\n end", "title": "" }, { "docid": "215c729cae9adc776854e669b868c973", "score": "0.5416701", "text": "def index\n @cms_slideshow_images = Cms::SlideshowImage.all\n end", "title": "" }, { "docid": "c341c839c26c2662f36e15cd08695e9a", "score": "0.54164755", "text": "def update\n respond_to do |format|\n if @slideshow.update(slideshow_params)\n format.html { redirect_to presentations_path, notice: 'Presentation was successfully updated.' }\n format.json { render :show, status: :ok, location: @slideshow }\n else\n format.html { render :edit }\n format.json { render json: @slideshow.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46d67a659e3e97a70d53c42eed9ecf89", "score": "0.54106206", "text": "def presentation\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @slide }\n end\n\n end", "title": "" }, { "docid": "e78cef9f0d53e66a877d8c694da0fbb7", "score": "0.5401882", "text": "def create\n authorize! :create, build_resource\n build_resource.insert_at(params[:slide_after].to_i + 1)\n\n respond_to do |format|\n if resource.save\n parent.reoder_numbers\n format.html { redirect_to [parent, resource], notice: 'Slide was successfully created.' }\n format.json { render json: resource, status: :created, location: resource }\n else\n format.html { render action: \"index\" }\n format.json { render json: resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
2348c7773dd2340967d4fcd73d43cc04
Fibonacci Numbers (Recursion) F(1) = 1 F(2) = 1 F(n) = F(n1) + F(n2) where n > 2
[ { "docid": "20d23d58c884d4c512e26e74db5ba89e", "score": "0.8642773", "text": "def fibonacci_recursive(n)\n return 1 if n <= 2\n fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\nend", "title": "" } ]
[ { "docid": "05596c0b0cbbc183b81cd3f7f81d6616", "score": "0.8959176", "text": "def nthFibonacci2(n)\r\n if n == 0\r\n return 0\r\n elsif n == 1\r\n return 1\r\n elsif n == 2\r\n return 1\r\n else n > 2\r\n n = nthFibonacci2(n-1) + nthFibonacci2(n-2)\r\n end\r\nend", "title": "" }, { "docid": "adc281f3fad70fdb78134c50765022c9", "score": "0.8754246", "text": "def fibonacci(n)\n return 1 if n == 1 || n == 2\n f1 = 1\n f2 = 1\n tmp = 0\n (3..n).each do |i|\n tmp = f1\n f1 = f2\n f2 = tmp + f2\n end\n\n return f2\nend", "title": "" }, { "docid": "7beef345c995337eef229733b3356c2d", "score": "0.87394536", "text": "def n_fibonacci(n)\n return n if n < 2\n return n_fibonacci(n-1) + n_fibonacci(n-2)\nend", "title": "" }, { "docid": "434841329acd1cf843dc24f828851f0e", "score": "0.8653711", "text": "def fibs(n)\n return 0 if n == 0\n return 1 if n == 1\n fibs(n-1) + fibs(n-2)\nend", "title": "" }, { "docid": "d256f4e825f0f51d467fbdb0c71ed491", "score": "0.8652644", "text": "def fibonacci(n)\n if n <= 2\n return 1\n end\n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "670607f1bc2c3495d787aca58db669e8", "score": "0.8646346", "text": "def fib(n)\n\t# The first two numbers are always zero and 1\n\treturn n if (0..1).include? n\n\t# Recursively call this routine to find the previous two Fibonacci numbers.\n\t# Return the sum of those to values.\n\tfib(n-1) + fib(n-2) if n > 1\nend", "title": "" }, { "docid": "0fdec2083d726a9412a8f09e836f4eb5", "score": "0.8643696", "text": "def fibs(n)\n return 1 if n == 1\n return 2 if n == 2\n fibs(n - 1) + fibs(n - 2)\nend", "title": "" }, { "docid": "fbd47c100c501fcee1f59a2d96fdec7f", "score": "0.86347884", "text": "def fibonacci(n)\n if n <= 1\n 0\n elsif n == 2\n 1\n else\n fibonacci(n-1) + fibonacci(n-2)\n end\nend", "title": "" }, { "docid": "64184bf374bc1533f131ed08548c0268", "score": "0.8629156", "text": "def fib_recursive(n)\n return 0 if n == 0\n return 1 if n == 1\n\n fib_recursive(n - 1) + fib_recursive(n -2)\nend", "title": "" }, { "docid": "7fd3ea64c1c34c9eb29feb7359cce6c4", "score": "0.8624386", "text": "def fibs(n)\n if n <= 1\n return 0\n elsif n == 2\n return 1\n end\n\n return fibs(n - 2) + fibs(n - 1) + 1\nend", "title": "" }, { "docid": "9800ff528ba70fff03f64b564f2deab5", "score": "0.8620731", "text": "def fibonacci_recursive(n)\n if n ==1 || n == 2\n 1\n else\n fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n end\nend", "title": "" }, { "docid": "8d2f1629a2120e94527cf29174006841", "score": "0.8616253", "text": "def fibonacci_recursive(n)\n if n == 1 || n == 2\n 1\n else\n fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n end\nend", "title": "" }, { "docid": "85ca22aae9552475ebf6f6a44d709a38", "score": "0.86124676", "text": "def fibonacci(n)\n return 0 if n == 1\n return 1 if n == 2\n\n return fibonacci(n -1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "d5614e2713cea1972ead94578b06ec97", "score": "0.86102635", "text": "def recursive_fib(n)\r\n return 0 if n == 0\r\n return 1 if n == 1\r\n return recursive_fib(n-1) + recursive_fib(n-2)\r\nend", "title": "" }, { "docid": "bb9e5b581de5416e94c9c8e52f778f62", "score": "0.860479", "text": "def fibonacci(n)\n if n <= 2\n return 1\n else\n fibonacci(n - 1) + fibonacci(n - 2)\n end\nend", "title": "" }, { "docid": "a9b49a30083bd073586141883192d982", "score": "0.85968506", "text": "def fibonacci(n)\n # because the first 2 values in fib, are 1's\n return 1 if n == 1 || n == 2\n\n fibonacci(n-1) + fibonacci(n-2)\nend", "title": "" }, { "docid": "dd1204ae8b3aeee6c5684a6b93b05a4a", "score": "0.85944885", "text": "def fibonacci(n)\n if n == 1\n 1\n elsif n == 2\n 1\n else\n fibonacci(n - 1) + fibonacci(n - 2)\n end\nend", "title": "" }, { "docid": "0963c41925a4389c3babc6d45143ec36", "score": "0.85922337", "text": "def fibonacci_recursive(n)\n if n == 1 || n == 2\n 1\nelse\n fibonacci_recursive(n-1) + fibonacci_recursive(n-2)\n end\nend", "title": "" }, { "docid": "7322053f413872aee24181eb300e1c0d", "score": "0.8592197", "text": "def r_fibonacci(n)\n if n == 1 || n == 2\n return 1\n else\n r_fibonacci(n-1) + r_fibonacci(n-2)\n end\nend", "title": "" }, { "docid": "1927906ba628eda85aaf735a7d8b3577", "score": "0.85916257", "text": "def fib_recursive(n)\r\n if n<2\r\n 1\r\n else\r\n fib_recursive(n-2) + fib_recursive(n-1)\r\n end\r\nend", "title": "" }, { "docid": "efcf830e4388a5470b90b5ee13ec9c20", "score": "0.8586196", "text": "def r_fibonacci(n)\n return 1 if n == 1 || n == 2\n r_fibonacci(n-1) + r_fibonacci(n-2)\nend", "title": "" }, { "docid": "a98d46cee61f4affa193c2de415e089b", "score": "0.8586161", "text": "def fibonacci(n)\n return 1 if n <= 2\n fibonacci(n-1) + fibonacci(n-2)\nend", "title": "" }, { "docid": "8d8f7a389f64030ff573f6b4bc413b3b", "score": "0.85856205", "text": "def get_fibonacci_number_recursively(n)\n return 0 if n == 0\n return 1 if n == 1\n return get_fibonacci_number_recursively(n - 1) + get_fibonacci_number_recursively(n - 2)\nend", "title": "" }, { "docid": "c8a824fdf093ab0e81989e1681d410c0", "score": "0.8585523", "text": "def fibonacci(n)\n return n if n == 0\n return n if n == 1\n\n fibonacci(n - 1) + fibonacci(n - 2)\n end", "title": "" }, { "docid": "1b54cb334442380a1067dc707f559c76", "score": "0.85811687", "text": "def fibonacci(n)\n return 1 if n <= 2\n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "1b54cb334442380a1067dc707f559c76", "score": "0.85811687", "text": "def fibonacci(n)\n return 1 if n <= 2\n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "1b54cb334442380a1067dc707f559c76", "score": "0.85811687", "text": "def fibonacci(n)\n return 1 if n <= 2\n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "2962b129385aad8aecc5a5a9b131a617", "score": "0.858027", "text": "def fib(n)\n\t\t\tif n < 2\n\t\t\t\t1\n\t\t\telse\n\t\t\t\tfib(n - 1) + fib(n - 2)\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "d55b9bfdd31886e914c010ed1452680b", "score": "0.85783774", "text": "def fibs(n)\n return 1 if n == 0 or n == 1 \n fibs(n-2) + fibs(n-1)\nend", "title": "" }, { "docid": "9dc18c9934715f474ecceaf49fe76230", "score": "0.85769194", "text": "def fibonacci(n)\n if n == 1\n return 1\n elsif n == 2\n return 2\n else\n fibonacci(n-1) + fibonacci(n-2)\n end\nend", "title": "" }, { "docid": "b4ec2027a4f4904e269c823f593373b1", "score": "0.8567175", "text": "def fibonacci(n)\n return 0 if n == 0\n return 1 if n == 1\n\n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "3c003f71b3c6b50ca210c4c362799238", "score": "0.8554903", "text": "def fibonacci_r(n)\n if n <= 2\n 1\n else\n fibonacci_r(n - 1) + fibonacci_r(n - 2)\n end\nend", "title": "" }, { "docid": "86f6221a4c1b75fe5cbbc8bb771f8bc0", "score": "0.8553958", "text": "def fibonacci(n)\n return 1 if n <= 2\n\n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "c3bd695e5e3f1ca282ffca4711c5e2dd", "score": "0.85538757", "text": "def fibonacci(n)\n return 0 if n == 0 \n return 1 if n == 1\n fibonacci(n-1) + fibonacci(n-2)\nend", "title": "" }, { "docid": "8ccb5d9e44f16f0f73509396c07ffa95", "score": "0.8550317", "text": "def fibonacci(n)\n return 1 if n == 1 || n == 2\n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "6fb752c627d34fa86392a31a51da50a6", "score": "0.855003", "text": "def fibonacci(n)\n return n if ( 0..1 ).include? n\n fibonacci(n - 1) + fibonacci(n - 2)\n end", "title": "" }, { "docid": "76e8989810b5876edce519ca971f4bb0", "score": "0.8548278", "text": "def fibonacci(n)\n return 1 if n == 1 || n == 2\n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "0554443ed698fd9f055d3b5d04bea069", "score": "0.8540711", "text": "def print_fibonacci(n)\n return 1 if n <= 2\n\n print_fibonacci( n-1 ) + print_fibonacci( n-2 )\nend", "title": "" }, { "docid": "5e1372100c82d0b837906f54e75b5fe8", "score": "0.8537843", "text": "def fibonacci_recursive(n)\n\n\treturn 0 if n == 0\n \treturn 1 if n == 1\n\tfibonacci_recursive(n - 1) + fibonacci_recursive(n - 2)\n\nend", "title": "" }, { "docid": "d665fe889adf08509ecfe6d6f8f699e8", "score": "0.8525816", "text": "def fibonacci(n)\n if n < 2\n n\n else\n fibonacci(n-1) + fibonacci(n-2)\n end\nend", "title": "" }, { "docid": "d665fe889adf08509ecfe6d6f8f699e8", "score": "0.8525816", "text": "def fibonacci(n)\n if n < 2\n n\n else\n fibonacci(n-1) + fibonacci(n-2)\n end\nend", "title": "" }, { "docid": "7ccde9b67a5c7f7b06ddcee88046d8df", "score": "0.8523358", "text": "def fibonacci(n)\n if n < 2\n n\n else\n fibonacci(n-1) + fibonacci(n-2)\n end\nend", "title": "" }, { "docid": "c157534b920e2564121859d704118378", "score": "0.8519228", "text": "def fibonacci(n)\n return 1 if n == 1 || n == 2\n fibonacci(n-2) + fibonacci(n-1)\nend", "title": "" }, { "docid": "07dc10a1d67cd72fddb05e09e3d32b14", "score": "0.8515948", "text": "def fibonacci_recursive_basic(n)\n return 0 if n == 0\n return 1 if n == 1\n return fibonacci_recursive_basic(n - 1) + fibonacci_recursive_basic(n - 2)\nend", "title": "" }, { "docid": "03127e40d1915e44d507b44b0f61d60a", "score": "0.8515669", "text": "def fib(n)\n if n == 1\n return 0\n end\n if n == 2\n return 1\n else\n return fib(n-1) + fib(n-2)\n end\nend", "title": "" }, { "docid": "44f6ccf5cf8c64442ad3fc5bd63fcc5e", "score": "0.85132754", "text": "def fib(n)\n if n < 2 then\n\t 1\n else\n\t fib(n-2) + fib(n-1)\n end\nend", "title": "" }, { "docid": "44f6ccf5cf8c64442ad3fc5bd63fcc5e", "score": "0.85132754", "text": "def fib(n)\n if n < 2 then\n\t 1\n else\n\t fib(n-2) + fib(n-1)\n end\nend", "title": "" }, { "docid": "2c78128ca82a84172f0cab03bc21a605", "score": "0.8512077", "text": "def fib(n)\n return 0 if n == 0\n return 1 if n <= 2\n\n fib(n - 1) + fib(n - 2)\nend", "title": "" }, { "docid": "3a492e91de81c8d1fc5a6d724da2c94b", "score": "0.850995", "text": "def fibonacci(n)\n if n == 0 || n == 1\n return 1\n else\n return fibonacci(n - 1) + fibonacci(n - 2)\n end \nend", "title": "" }, { "docid": "f110e16e95dd694a071afa32a59020c9", "score": "0.85098165", "text": "def fib(n) (n<=2) ? 1 : (fib(n-2)+fib(n-1)) end", "title": "" }, { "docid": "421858920f70fc5dd5cbfb11a23e8307", "score": "0.85093623", "text": "def fib_recursive(n)\n if n < 2\n n\n else\n fib_recursive(n-1) + fib_recursive(n-2)\n end\nend", "title": "" }, { "docid": "654a5786a1aff7444a414c0fd3bd7835", "score": "0.85077757", "text": "def fib(n)\n if n == 1 || n == 2\n return 1\n end\n return fib(n-1) + fib(n-2)\nend", "title": "" }, { "docid": "c9e6174dd6ef2d96ff0e9974b3417a9d", "score": "0.8503363", "text": "def fibs_sum(n)\n return 1 if n == 1\n return 2 if n == 2\n fibs_sum(n-1) + fibs_sum(n-2) + 1\nend", "title": "" }, { "docid": "73e9be5e9fc1090d895c3f81471c243e", "score": "0.8501027", "text": "def fibonacci(n)\n return 1 if [1, 2].include?(n)\n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "e8ba79edef34893ea0a21d25b0a3879b", "score": "0.8500285", "text": "def fib_recursive(n)\n if n == 0\n 0\n elsif n == 1\n 1\n else\n fib_recursive(n-2) + fib_recursive(n-1)\n end\nend", "title": "" }, { "docid": "ff7b17c7981bb1a806512b11eee3b02d", "score": "0.84992176", "text": "def fibonacci(n)\n return 1 if n < 2 \n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "24a13a6f363b181c7a9a1e99271ba45b", "score": "0.84984994", "text": "def fibs_rec(n)\n return 0 if n == 0\n return 1 if n == 1\n fibs_rec(n-1) + fibs_rec(n-2)\nend", "title": "" }, { "docid": "efd6f705975bb7d9a68c0a56761141e6", "score": "0.84893715", "text": "def fibonacci_recursive_basic(n)\n return 0 if n.zero?\n return 1 if n == 1\n\n fibonacci_recursive_basic(n - 1) + fibonacci_recursive_basic(n - 2)\nend", "title": "" }, { "docid": "37493e890ddf1ae0ec0c6ba2bd1df30c", "score": "0.8489237", "text": "def fib(n)\n if n == 1 || n == 2\n return 1\n end\n fib(n-1) + fib(n-2)\nend", "title": "" }, { "docid": "34ec33aaacf21efa07bd5eb88d298d4c", "score": "0.84787685", "text": "def fibs_sum(n)\n return 0 if n == 0\n return 1 if n == 1\n fibs_sum(n-1) + fibs_sum(n-2) + 1\nend", "title": "" }, { "docid": "bf5f30d3111edd758795d9f29729c6c3", "score": "0.8476522", "text": "def fib(n)\n\treturn 0 if n == 0\n\treturn 1 if n == 1\n\n\tfib(n - 1) + fib(n - 2)\nend", "title": "" }, { "docid": "77090993d9967b3e2595692d5abbdc4c", "score": "0.84757656", "text": "def fibs_sum(n)\n return 0 if n == 0\n return 1 if n == 1\n\n fibs_sum(n-1) + fibs_sum(n-2) + 1\nend", "title": "" }, { "docid": "5ff3587cedc9580f5606f0fbfe6745bd", "score": "0.8475602", "text": "def fibonacci(n)\n\tif n == 0\n\t\treturn 0\n\telsif n == 1\n\t\treturn 1\n\telse\n\t\treturn (fibonacci(n-1)+fibonacci(n-2))\n\tend\n\nend", "title": "" }, { "docid": "f5889355967154a618779095bf8798d4", "score": "0.8475172", "text": "def fibonacci(n)\n if n < 2\n return n\n else\n return fibonacci(n-1) + fibonacci(n-2)\n end\nend", "title": "" }, { "docid": "09c661992190a97c32b1d4a915279fdf", "score": "0.847213", "text": "def fib(n)\n return n if n <= 1\n f0, f1, f2 = 0, 1, 1\n (2..n).each do |i|\n f2 = f0 + f1\n f0 = f1\n f1 = f2\n end\n f2\nend", "title": "" }, { "docid": "afe6890e07fcd54ef878231904a871e1", "score": "0.84718215", "text": "def fibonacci(n)\n if n < 2\n return n\n else\n fibonacci(n - 2) + fibonacci(n - 1)\n end\nend", "title": "" }, { "docid": "a5218618a6a86d6549b9221e0e8cd691", "score": "0.84678406", "text": "def rfibonacci(n)\n if(n < 2)\n return n\n end\n return rfibonacci(n-1) + rfibonacci(n-2)\nend", "title": "" }, { "docid": "68a9e74c90574843f5b23bc9a50a182e", "score": "0.84676605", "text": "def fib(n)\n return 1 if(n==0)\n return 2 if(n==1)\n return (fib(n-1) + fib(n-2))\nend", "title": "" }, { "docid": "f4524f8bbc76ad612155c3ab373afe70", "score": "0.8466858", "text": "def fibs_sum(n) \n return 0 if n == 0 \n return 1 if n == 1\n\n fibs_sum(n-1) + fibs_sum(n-2) + 1\nend", "title": "" }, { "docid": "428f5e7890ac3277b6419b4c44c10d9f", "score": "0.8463521", "text": "def fibs_sum(n)\n return 0 if n == 0\n return 1 if n == 1\n fibs_sum(n - 1) + fibs_sum(n - 2) + 1\nend", "title": "" }, { "docid": "428f5e7890ac3277b6419b4c44c10d9f", "score": "0.8463521", "text": "def fibs_sum(n)\n return 0 if n == 0\n return 1 if n == 1\n fibs_sum(n - 1) + fibs_sum(n - 2) + 1\nend", "title": "" }, { "docid": "adea38e812f1edb03d37675f4caf24b5", "score": "0.8461366", "text": "def fib(n)\n if n == 1 || n == 2\n return 1\n end\n return fib(n-2) + fib(n-1)\nend", "title": "" }, { "docid": "4e737ea205a0393623af6d421af30425", "score": "0.8460719", "text": "def fib(n)\n if n <= 2\n 1\n else\n fib(n-2) + fib(n-1)\n end\nend", "title": "" }, { "docid": "b9f2833c5c1b300517d7565dc4ad3fa2", "score": "0.8460299", "text": "def fibonacci(n)\n if n == 0\n return 0\n end\n if n == 1\n return 1\n end\n a = 0\n b = 1\n i = 2\n while i <= n\n x = a + b\n a = b\n b = x\n i += 1\n end\n return x\nend", "title": "" }, { "docid": "41d056d661fc3f802a9eb458da00791c", "score": "0.8453916", "text": "def fibonacci(n)\n return 0 if n == 0\n return n if n == 1\n\n return fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "8e8646273b141100e9f885680fe6ad32", "score": "0.84538376", "text": "def fib(n)\n return 0 if n <= 0\n return 1 if n == 1\n\n return fib(n - 1) + fib(n - 2)\nend", "title": "" }, { "docid": "4180a23bc6abfd402ee525fc6b1167ea", "score": "0.84520906", "text": "def fibs_sum(n)\n return 0 if n == 0\n return 1 if n == 1\n fibs_sum(n - 1) + fibs_sum(n - 2) + 1\nend", "title": "" }, { "docid": "d0bfb90484ec9ffa1468eabd132ee1d0", "score": "0.8450906", "text": "def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n return fib(n-1) + fib(n-2)\nend", "title": "" }, { "docid": "d0bfb90484ec9ffa1468eabd132ee1d0", "score": "0.8450906", "text": "def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n return fib(n-1) + fib(n-2)\nend", "title": "" }, { "docid": "9b6ddaf2e8a556faaa666ac9a9843a54", "score": "0.8448509", "text": "def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n fib(n-1) + fib(n-2)\nend", "title": "" }, { "docid": "d13aff8519ca43a4336b029e3efc1109", "score": "0.8447746", "text": "def fibonacci( n )\n # the first two terms in Fibonacci are fixes: 0 and 1\n return n if n <= 1 \n fibonacci( n - 1 ) + fibonacci( n - 2 )\nend", "title": "" }, { "docid": "64eee1e9dfa4c133ffd1892e97e2abf7", "score": "0.84467494", "text": "def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n\n fib(n - 1) + fib(n - 2)\nend", "title": "" }, { "docid": "ddb7446c2228f331e0879ce210d7f614", "score": "0.84437597", "text": "def fibonacci(n)\n\tif n == 1 || n == 0\n\t\t1\n\telse\n\t\tfibonacci(n-1)+fibonacci(n-2)\n\tend\nend", "title": "" }, { "docid": "d4d0202ce04e2c94f40aded39d1500d5", "score": "0.844153", "text": "def fib(n)\n if n <= 2\n 1\n else\n fib(n - 2) + fib(n - 1)\n end\nend", "title": "" }, { "docid": "e640b96aeaa10e25b7311d39fa12c7d0", "score": "0.84413165", "text": "def fibonacci(n)\n return n if n == 1 || n == 0\n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "18c79f0ba6618c41af878974deac54c4", "score": "0.84407026", "text": "def fib(n)\n return 1 if n <= 2\n fib(n-1) + fib( n-2)\nend", "title": "" }, { "docid": "4fc6a11d5d95f3b89f999de5ad4103b4", "score": "0.84394974", "text": "def fib(n)\n return 1 if n == 0\n return 1 if n == 1\n\n fib(n-1) + fib(n-2)\nend", "title": "" }, { "docid": "1df198378e6e3e4b7ac4ea9de5bc51c4", "score": "0.84367806", "text": "def fibonacci(n)\n return n if n < 2\n fibonacci(n - 1) + fibonacci(n - 2)\nend", "title": "" }, { "docid": "aa83a760c73eec2331551f90169b1d07", "score": "0.8436737", "text": "def fibonacci(n)\n if n <= 1\n n\n else\n fibonacci(n - 1) + fibonacci(n - 2)\n end\nend", "title": "" }, { "docid": "c2734aed7f2578808cf829e9db0a5cbc", "score": "0.8434699", "text": "def fibonacci(n)\n return n if n <= 1\n return fibonacci(n-1) + fibonacci(n-2)\nend", "title": "" }, { "docid": "52793ceb8e2d706aaad64d3a40ef2dcf", "score": "0.8433881", "text": "def fibonacci(n)\n if (n <= 1)\n return n\n end\n fibonacci(n-1) + fibonacci(n-2)\nend", "title": "" }, { "docid": "da572d12e483809019ae86c8b60104b9", "score": "0.84312725", "text": "def fibonacci(n)\n return n if n < 2\n fibonacci(n - 2) + fibonacci(n - 1)\nend", "title": "" }, { "docid": "da572d12e483809019ae86c8b60104b9", "score": "0.84312725", "text": "def fibonacci(n)\n return n if n < 2\n fibonacci(n - 2) + fibonacci(n - 1)\nend", "title": "" }, { "docid": "fbea6ac6d1beb031d5b71210925809d5", "score": "0.84297025", "text": "def fib n\n if n == 0\n return 0\n elsif n == 1\n return 1\n else\n fib(n-1) + fib(n-2)\n end\nend", "title": "" }, { "docid": "6dafa99498db2fbd71adadaaccc50bd3", "score": "0.84293514", "text": "def fib(n)\n return 1 if n == 1 || n == 2\n return fib(n-1) + fib(n-2)\nend", "title": "" }, { "docid": "6638505057b7e13cf4da57b7f50228d8", "score": "0.84290534", "text": "def fib(n)\n return 1 if n == 1 || n == 2\n fib(n - 1) + fib(n - 2)\nend", "title": "" }, { "docid": "6638505057b7e13cf4da57b7f50228d8", "score": "0.84290534", "text": "def fib(n)\n return 1 if n == 1 || n == 2\n fib(n - 1) + fib(n - 2)\nend", "title": "" }, { "docid": "b45c5a103a363d69f5959c578ed91d8c", "score": "0.8428353", "text": "def fib(n)\n return 0 if n == 0\n return 1 if n == 1\n return fib(n - 1) + fib(n - 2)\nend", "title": "" }, { "docid": "0cc06fbb67800556e5a45072fc9fa324", "score": "0.8425823", "text": "def fib(n)\n return 1 if n == 1\n return 1 if n == 2\n fib(n - 1) + fib(n - 2)\nend", "title": "" }, { "docid": "9383402998e8d5d3e05a8170f403dbb7", "score": "0.84218276", "text": "def fibonacci(n)\n raise ArgumentError.new (\"Please provide a positive integer\") if n == nil || n < 0\n return 0 if n == 0\n return 1 if n <= 2\n return fibonacci(n-1) + fibonacci(n-2)\nend", "title": "" } ]
a6c972d3b2b03d36df264af4597467cb
here for compatabilty, should not really be used
[ { "docid": "59b47dbf8eb7d67732089687bbfc12dc", "score": "0.0", "text": "def feature_value(name)\n get_feature(name).value\n end", "title": "" } ]
[ { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6658215", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6658215", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6658215", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6658215", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6658215", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.6658215", "text": "def bodystmt; end", "title": "" }, { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.66283786", "text": "def desired; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6506077", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6506077", "text": "def used; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.6375219", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.6375219", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.6375219", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.6375219", "text": "def preparable; end", "title": "" }, { "docid": "5928f8efe9c6c2d408ea21a4cdce83ad", "score": "0.635378", "text": "def preliminary?; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.628363", "text": "def in_use; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.628363", "text": "def in_use; end", "title": "" }, { "docid": "58e2e07d11b107b6864a328f2187e248", "score": "0.61929864", "text": "def apop?; end", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.618841", "text": "def internal; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.617799", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.617799", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.617799", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.617799", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.617799", "text": "def implementation; end", "title": "" }, { "docid": "950bef128403f02279cc1bb4ef43a028", "score": "0.6147872", "text": "def realized?; end", "title": "" }, { "docid": "950bef128403f02279cc1bb4ef43a028", "score": "0.6147872", "text": "def realized?; end", "title": "" }, { "docid": "6e6891d187cd127b8bc7e632ec0b2d50", "score": "0.61106116", "text": "def unitary?; end", "title": "" }, { "docid": "baabe5bb658b17a85353fb66fdbbf873", "score": "0.6070459", "text": "def extended; end", "title": "" }, { "docid": "7db0727baf89eb76beac27c515d7fe32", "score": "0.6064349", "text": "def support; end", "title": "" }, { "docid": "794a198d95cf296afde54486d8c4e262", "score": "0.60614556", "text": "def avail_out=(*) end", "title": "" }, { "docid": "3caf4c824a6d6a4a5616c13fcab418da", "score": "0.60215336", "text": "def applied; end", "title": "" }, { "docid": "8b3569b219e99d9eac85050822f6f885", "score": "0.6015681", "text": "def wrappers; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.6005312", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.6005312", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.6005312", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.6005312", "text": "def wrapped; end", "title": "" }, { "docid": "0a39799e76643367f1b6bfac65569895", "score": "0.5976573", "text": "def used?; end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.5969496", "text": "def telegraphical()\n end", "title": "" }, { "docid": "a747cf4388fb3d14718cf9dda73c555f", "score": "0.5955524", "text": "def initalize; end", "title": "" }, { "docid": "a747cf4388fb3d14718cf9dda73c555f", "score": "0.5955524", "text": "def initalize; end", "title": "" }, { "docid": "9de4306501711176ab8084b28395030d", "score": "0.5943368", "text": "def module; end", "title": "" }, { "docid": "922ad13267ad637c9292ec039c11884f", "score": "0.59406155", "text": "def obscured?; end", "title": "" }, { "docid": "3ae137b1a40ff3aae4f3cbb2b6082797", "score": "0.5938423", "text": "def reaper; end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.59273535", "text": "def anchored; end", "title": "" }, { "docid": "dff37ea0d68b9c86bab1ceb2dfb658a9", "score": "0.5925842", "text": "def rc; end", "title": "" }, { "docid": "49560b3ade41bfbe4a3b9d6b401dd517", "score": "0.59218925", "text": "def exc; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.5908276", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.5908276", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.5908276", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.5908276", "text": "def extra; end", "title": "" }, { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.5896758", "text": "def override; end", "title": "" }, { "docid": "8b608597e4f8cb342968a26900959e68", "score": "0.58877593", "text": "def extended?; end", "title": "" }, { "docid": "b1fd88118bc575d18b0b424ae711482e", "score": "0.5882446", "text": "def preinit\n end", "title": "" }, { "docid": "b7cfdec5315b5d3c26b002081b1dbae3", "score": "0.58752525", "text": "def coming_soon; end", "title": "" }, { "docid": "4ea6f5c11a3bc16e2394d273e748b292", "score": "0.5872572", "text": "def internal?; end", "title": "" }, { "docid": "14187174b07e4c51e8d38b1dd3593d4a", "score": "0.58679706", "text": "def macro; raise NotImplementedError; end", "title": "" }, { "docid": "14187174b07e4c51e8d38b1dd3593d4a", "score": "0.58679706", "text": "def macro; raise NotImplementedError; end", "title": "" }, { "docid": "14187174b07e4c51e8d38b1dd3593d4a", "score": "0.58679706", "text": "def macro; raise NotImplementedError; end", "title": "" }, { "docid": "c3285b979f713395f60cf13edce8a310", "score": "0.585876", "text": "def methodmissing; end", "title": "" }, { "docid": "a344215c3161402d928d5c07ee1e0b22", "score": "0.58503264", "text": "def core; end", "title": "" }, { "docid": "22cedc7bf6749c5a730c17ddb7c38970", "score": "0.5845967", "text": "def used_by=(_arg0); end", "title": "" }, { "docid": "1194b7abce3f20cf44ec735db13bde78", "score": "0.5835416", "text": "def used_yadis=(_arg0); end", "title": "" }, { "docid": "7ec57c3874853e50086febdbdd3221bf", "score": "0.5834316", "text": "def wedding; end", "title": "" }, { "docid": "4e3972712201f930425a392caa47fcd3", "score": "0.5828495", "text": "def composite?; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.58212525", "text": "def operations; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.58212525", "text": "def operations; end", "title": "" }, { "docid": "7ff2011fa3dc45585a9272310eafb765", "score": "0.5820096", "text": "def isolated; end", "title": "" }, { "docid": "7e082a39938aeae2f38a9ca3823e4d1b", "score": "0.58007234", "text": "def used=(_); end", "title": "" }, { "docid": "0212351345358772373f549b97821c62", "score": "0.5792392", "text": "def regular?; end", "title": "" }, { "docid": "8b79e8f7bbe83880e51794d26cd62a8f", "score": "0.57888186", "text": "def try; end", "title": "" }, { "docid": "67e9b6e8898f2936c7de8b6d0bae66de", "score": "0.57849735", "text": "def compshape?; false end", "title": "" }, { "docid": "f6d4a510b1064cdde36cfabb37bc801a", "score": "0.5769713", "text": "def threadsafe; end", "title": "" }, { "docid": "b7567a2a68cade31f2360723a4c42dc7", "score": "0.5762988", "text": "def used_by; end", "title": "" }, { "docid": "29a83735da59010f07e1633934837c20", "score": "0.5761505", "text": "def underconstruction\n end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.574983", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.574983", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.574983", "text": "def for; end", "title": "" }, { "docid": "45b9e5d1da1562a27f15ce5cb9b634ca", "score": "0.5739404", "text": "def ext; end", "title": "" }, { "docid": "0aa0db9270c5a88c81da713a1ee0e8f8", "score": "0.57354224", "text": "def rescued_exception; end", "title": "" }, { "docid": "bb2cf20999efd9fcacf7668301ebe565", "score": "0.5733485", "text": "def missing; end", "title": "" }, { "docid": "bb2cf20999efd9fcacf7668301ebe565", "score": "0.5733485", "text": "def missing; end", "title": "" }, { "docid": "061a39ede6dfe56bc21b5ffe0ec3cba6", "score": "0.5730015", "text": "def extras; end", "title": "" }, { "docid": "e44ae2cef169d29f78b2b6306add59da", "score": "0.57204336", "text": "def huddlingly()\n end", "title": "" }, { "docid": "6d967e0574a93ad1a7a438ecf62b646c", "score": "0.57198185", "text": "def ex; end", "title": "" }, { "docid": "6d967e0574a93ad1a7a438ecf62b646c", "score": "0.57198185", "text": "def ex; end", "title": "" }, { "docid": "8d0e128ad87cd20a86507c09c46a6f67", "score": "0.57083124", "text": "def termitidae()\n end", "title": "" }, { "docid": "4463b65c57e07f544d0288a8a3deba80", "score": "0.5707002", "text": "def external; end", "title": "" }, { "docid": "d95befff0537c0b7b2e53bcaf47fe645", "score": "0.57042426", "text": "def real?; end", "title": "" }, { "docid": "0c860d341b57fa9168894e792350480f", "score": "0.5702589", "text": "def missingimpl; end", "title": "" }, { "docid": "8d1d77531cce0d12539ad149eebad454", "score": "0.5690835", "text": "def sub_from; end", "title": "" }, { "docid": "549cdd4767cacb4029e22f746ccd68b5", "score": "0.5681916", "text": "def work; end", "title": "" }, { "docid": "e7dd7cf73f02c76e4424413a397a3b50", "score": "0.56795", "text": "def data_support; end", "title": "" }, { "docid": "e7dd7cf73f02c76e4424413a397a3b50", "score": "0.56795", "text": "def data_support; end", "title": "" }, { "docid": "334240d22c3d5bd0b2bbbcd882626810", "score": "0.5676", "text": "def needed?; end", "title": "" }, { "docid": "954c5828178f6e4a659c40ef92736547", "score": "0.5667235", "text": "def helpful!\n\n\t\tend", "title": "" }, { "docid": "8a91bfaa4b92b136c5d230a732b0d6e6", "score": "0.56646514", "text": "def eod?; end", "title": "" }, { "docid": "04a92e2bf2938a48f9a8a17acd3ae6a9", "score": "0.56616205", "text": "def external?; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.56573737", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.56573737", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.56573737", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.56573737", "text": "def init; end", "title": "" }, { "docid": "5cf2cba0ee7f9825b63b087af5363b37", "score": "0.56573737", "text": "def init; end", "title": "" } ]
9f97368636fefa755bcc6e845a4de6f9
Update the system level whitelist of CVE. This API overwrites the system level whitelist of CVE with the list in request body. Only system Admin has permission to call this API.
[ { "docid": "7014ef0d7ae1bf83ce6c7813f0a17ea2", "score": "0.71528375", "text": "def system_cve_whitelist_put(opts = {})\n system_cve_whitelist_put_with_http_info(opts)\n nil\n end", "title": "" } ]
[ { "docid": "47c93063fa348f3d6483f47887c78c15", "score": "0.61045426", "text": "def update_version_whitelist(component_type, version_list, opts = {})\n update_version_whitelist_with_http_info(component_type, version_list, opts)\n nil\n end", "title": "" }, { "docid": "47c93063fa348f3d6483f47887c78c15", "score": "0.61045426", "text": "def update_version_whitelist(component_type, version_list, opts = {})\n update_version_whitelist_with_http_info(component_type, version_list, opts)\n nil\n end", "title": "" }, { "docid": "a9937b1533eb1484dd7efc8834d7d7f2", "score": "0.5969906", "text": "def system_cve_whitelist_put_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProductsApi.system_cve_whitelist_put ...'\n end\n # resource path\n local_var_path = '/system/CVEWhitelist'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'whitelist'])\n auth_names = ['basicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProductsApi#system_cve_whitelist_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "691bc1e877f82825b131d2cd3449d800", "score": "0.56628466", "text": "def system_cve_whitelist_get(opts = {})\n data, _status_code, _headers = system_cve_whitelist_get_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "898b6f6b633ec771876181c8cfb058c8", "score": "0.5591182", "text": "def white_list=(value)\n raise ArgumentError, \"Must provide and array\" unless value.is_a?(Array)\n @white_list = value\n @raw_data = filter_input(self.raw_data)\n end", "title": "" }, { "docid": "65ad52f1dbb593dea934b8329e5b416b", "score": "0.54305404", "text": "def set_white_list\n @white_list = WhiteList.find(params[:id])\n end", "title": "" }, { "docid": "0407836f209c4a99f09322b9e1e94ae3", "score": "0.5423105", "text": "def update!(**args)\n @list_limits = args[:list_limits] if args.key?(:list_limits)\n end", "title": "" }, { "docid": "eb851d99196abc06e92893423c38aacf", "score": "0.5408346", "text": "def set_whitelisting_requested_flag\n\n set_props_arr = [GlobalConstant::Client.mainnet_whitelist_requested_status]\n\n Client.atomic_update_bitwise_columns(@client[:id], set_props_arr, [])\n\n success\n end", "title": "" }, { "docid": "8f74adf038da95e00af20b299f50a6e1", "score": "0.53420985", "text": "def update\n @swlist_whitelist = SwlistWhitelist.find(params[:id])\n\n respond_to do |format|\n if @swlist_whitelist.update_attributes(params[:swlist_whitelist])\n flash[:notice] = 'SwlistWhitelist was successfully updated.'\n format.html { redirect_to(@swlist_whitelist) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @swlist_whitelist.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "839591b72f27e154e4840464f1f4684d", "score": "0.5277686", "text": "def whitelist=(lst)\n uri.querystring_params[\"whitelist\"] = lst.split(\",\").map(&:strip).reject{|e|e.blank?}\n end", "title": "" }, { "docid": "19567194ca832ac72a5d0d2e2275ed63", "score": "0.51924384", "text": "def mark_client_whitelist_happening\n self.suspension_type = GlobalConstant::ClientWhitelistDetail.no_suspension_type\n self.save!\n end", "title": "" }, { "docid": "c6cecd37991abedb0c21895b2ca18953", "score": "0.5172177", "text": "def update_list_level(request)\n begin\n data, _status_code, _headers = update_list_level_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = update_list_level_with_http_info(request)\n else\n raise\n end\n end\n data\n end", "title": "" }, { "docid": "1b27e7c835e108e2a93868a501978733", "score": "0.51333356", "text": "def enforce_mfa_and_mark_client_as_whitelisted_for_mainnet\n\n set_props_arr = [\n GlobalConstant::Client.has_enforced_mfa_property,\n GlobalConstant::Client.mainnet_whitelisted_status\n ]\n\n unset_props_arr = [\n GlobalConstant::Client.mainnet_whitelist_requested_status\n ]\n\n ::Client.atomic_update_bitwise_columns(@client_id, set_props_arr, unset_props_arr)\n\n success\n end", "title": "" }, { "docid": "b21f910cd814b6b88eb63100f0978e67", "score": "0.5113017", "text": "def update_version_whitelist_with_http_info(component_type, version_list, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SystemAdministrationLifecycleManagementUpgradeNodesApi.update_version_whitelist ...'\n end\n # verify the required parameter 'component_type' is set\n if @api_client.config.client_side_validation && component_type.nil?\n fail ArgumentError, \"Missing the required parameter 'component_type' when calling SystemAdministrationLifecycleManagementUpgradeNodesApi.update_version_whitelist\"\n end\n # verify the required parameter 'version_list' is set\n if @api_client.config.client_side_validation && version_list.nil?\n fail ArgumentError, \"Missing the required parameter 'version_list' when calling SystemAdministrationLifecycleManagementUpgradeNodesApi.update_version_whitelist\"\n end\n # resource path\n local_var_path = '/upgrade/version-whitelist/{component_type}'.sub('{' + 'component_type' + '}', component_type.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 = @api_client.object_to_http_body(version_list)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SystemAdministrationLifecycleManagementUpgradeNodesApi#update_version_whitelist\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "3d718c5d2a2994cb6e9c00dc104f6d19", "score": "0.50984454", "text": "def update\n respond_to do |format|\n if @white_list.update(white_list_params)\n format.html { redirect_to @white_list, notice: 'White list was successfully updated.' }\n format.json { render :show, status: :ok, location: @white_list }\n else\n format.html { render :edit }\n format.json { render json: @white_list.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb5797e9a386906a962fe8e2cde0a36f", "score": "0.5091888", "text": "def add_whitelist(params={})\n resource = params.has_key?(:user_id) ?\n \"users/#{params[:user_id]}/partitions/production/platforms/sms/whitelist\" :\n \"users/partitions/production/platforms/sms/whitelist\"\n @tropo_client.post(resource, {:value => params[:value]})\n end", "title": "" }, { "docid": "dbc8a3da0cd7f0d6e37a1fece494f7b5", "score": "0.50892454", "text": "def whitelist\n module_file = File.dirname(File.expand_path(__FILE__)) + '/module_list.yaml'\n @modules = YAML.load_file(module_file)\n @modules['whitelist']\n end", "title": "" }, { "docid": "0f17397e59d02c8ed02e1ec15a7b9a12", "score": "0.50803864", "text": "def edit(user_id, id, options={})\n request(:put, \"/users/#{user_id}/user_white_lists/#{id}.json\", :query => {:user_white_list => options})\n end", "title": "" }, { "docid": "7c4d5fc1181e05efd9064f448483191d", "score": "0.50728476", "text": "def set_softwares_list\n list_id = ParametersList.where(\"code=?\", 'LIST_OF_MANAGED_SOFTWARES').take!\n @softwares_list = Parameter.where(\"parameters_list_id=? AND ? BETWEEN active_from AND active_to\", list_id, Time.now )\n end", "title": "" }, { "docid": "d17d3b31cf7edce7871598762fdba7fc", "score": "0.50546217", "text": "def set_whitelist_item\n @whitelist_item = WhitelistItem.find(params[:id])\n end", "title": "" }, { "docid": "cfc3c4ab50222eba912aef243996f6c8", "score": "0.50472844", "text": "def update\n @role_white_list = RoleWhiteList.find(params[:id])\n\n respond_to do |format|\n if @role_white_list.update_attributes(params[:role_white_list])\n format.html { redirect_to @role_white_list, notice: 'Role white list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role_white_list.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.49932468", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "c657b02e35c3b93ad5cc40de8eda6410", "score": "0.4982302", "text": "def modify_drds_ip_white_list(db_name, drds_instance_id, ip_white_list, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'ModifyDrdsIpWhiteList'\n\t\targs[:query]['DbName'] = db_name\n\t\targs[:query]['DrdsInstanceId'] = drds_instance_id\n\t\targs[:query]['IpWhiteList'] = ip_white_list\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? :mode\n\t\t\targs[:query]['Mode'] = optional[:mode]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "0b1fe27893b1e1dcfcb9098baa706e59", "score": "0.4973756", "text": "def update!(**args)\n @security_level = args[:security_level] if args.key?(:security_level)\n end", "title": "" }, { "docid": "73a0ce63165142fd3fbf9ab84076673d", "score": "0.49693695", "text": "def update\n @white_list = WhiteList.find(params[:id])\n\n respond_to do |format|\n if @white_list.update_attributes(params[:white_list])\n format.html { redirect_to @white_list, notice: 'White list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @white_list.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1141ed27e0e9505b5df3c7b9aea723ec", "score": "0.49630532", "text": "def update_list_level_online(request)\n begin\n data, _status_code, _headers = update_list_level_online_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = update_list_level_online_with_http_info(request)\n else\n raise\n end\n end\n data\n end", "title": "" }, { "docid": "43855688f294c34a608502a4ebc35c9a", "score": "0.49545497", "text": "def safe_list_sanitizer\n @safe_list_sanitizer ||= sanitizer_vendor.safe_list_sanitizer.new\n end", "title": "" }, { "docid": "57133a5247ec2207de104a24fd091db0", "score": "0.49204996", "text": "def whitelist\n ActiveSupport::Deprecation.warn(<<~MESSAGE.squish)\n ContentFormatter.whitelist is deprecated and will be removed in Thredded 2.0.\n Use ContentFormatter.allowlist instead\n MESSAGE\n\n allowlist\n end", "title": "" }, { "docid": "f9611e847194297d8aebc74d3dd0212e", "score": "0.49093947", "text": "def set_AllowedIPList(value)\n set_input(\"AllowedIPList\", value)\n end", "title": "" }, { "docid": "37e81a7e30a3e8c0b7a5abef6ada9ea4", "score": "0.4893909", "text": "def all_whitelist_status\n 'all'\n end", "title": "" }, { "docid": "fc3746dd32c2871548b43ca0a9517500", "score": "0.48914856", "text": "def update_vlans # rubocop:disable AbcSize\n converge_by(\"Updating #{new_resource} vlans\") do\n Chef::Log.info \"Updating #{new_resource} vlans\"\n load_balancer.client['LocalLB.VirtualServer']\n .set_vlan([new_resource.vs_name],\n [{ 'state' => new_resource.vlan_state,\n 'vlans' => new_resource.vlans }])\n current_resource.vlans(new_resource.vlans)\n current_resource.vlan_state(new_resource.vlan_state)\n\n new_resource.updated_by_last_action(true)\n end\n end", "title": "" }, { "docid": "2d5ea8bd733768428d5393e0e8f47668", "score": "0.488469", "text": "def set_security_lvl(zone, value)\n send_req({a: :sec_lvl, z: zone, v: value})\n end", "title": "" }, { "docid": "5aa0bc424b6b3f1015c12f9e4816d7e0", "score": "0.48737282", "text": "def set_whitelist\n ValidEmail2.instance_variable_set(\n :@whitelist, \n ValidEmail2.send(:load_if_exists, ValidEmail2::WHITELIST_FILE)\n )\n end", "title": "" }, { "docid": "f01d3c27a85e803d99e2043b6d3d59eb", "score": "0.4869351", "text": "def whitelist\n if @addin.respond_to? :whitelist\n @addin.whitelist || []\n else\n []\n end\n end", "title": "" }, { "docid": "60690d24d81d143176e5754a5b7d83bd", "score": "0.48674828", "text": "def update!(**args)\n @enable = args[:enable] if args.key?(:enable)\n @whitelisted_type_id = args[:whitelisted_type_id] if args.key?(:whitelisted_type_id)\n end", "title": "" }, { "docid": "87c1f0b12e8a2c45cced4c485771da5e", "score": "0.48576915", "text": "def request_whitelist\n service_response = TokenManagement::RequestWhitelist.new(params).perform\n return render_api_response(service_response)\n end", "title": "" }, { "docid": "b4d4aac7e86e7eb10c4e855fd97b58f1", "score": "0.4845045", "text": "def white_listed\n @white_listed ||= []\n end", "title": "" }, { "docid": "e4e87b14062b94abcaf37e88844f20e0", "score": "0.48328286", "text": "def before_update(args)\n if config.get(:stack_policy, :update).to_s == \"defenseless\"\n ui.warn \"Disabling all stack policies for update.\"\n stack = args[:api_stack]\n ([stack] + stack.nested_stacks).compact.each do |p_stack|\n @policies[p_stack.name] = DEFENSELESS_POLICY\n run_action \"Disabling stack policy for #{ui.color(p_stack.name, :yellow)}\" do\n save_stack_policy(p_stack)\n end\n end\n end\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.48198494", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "b3e49440054c3ad3ddb77e29e74a8e4b", "score": "0.48078334", "text": "def sanitized_allowed_attributes=(attributes)\n sanitizer_vendor.safe_list_sanitizer.allowed_attributes = attributes\n end", "title": "" }, { "docid": "c1da947af00a560ce17f9cbe6a086da5", "score": "0.4778626", "text": "def whitelist(regexp, status_code)\n regex = Array(regexp).map { |rx| Regexp === rx ? rx.source : rx.to_s }.join(',')\n @resource['whitelist'].put :regex => regex, :status => status_code\n end", "title": "" }, { "docid": "12fe44985f8473a2abc51b31c12fc8ed", "score": "0.4752596", "text": "def sanitize_whitelist(text, options = {})\r\n get_white_list_sanitizer\r\n @white_list_sanitizer.sanitize(text, options)\r\n end", "title": "" }, { "docid": "3d3c3d630c2166a54b200002bd6e4da7", "score": "0.47299445", "text": "def set_whitelist_contract_address\n if @client_whitelist_detail.blank?\n create_client_whitelist_detail\n else\n update_client_whitelist_detail\n end\n end", "title": "" }, { "docid": "3b89dc18e53c3bd1a4076cd7d8dbafc4", "score": "0.47127712", "text": "def whitelist(username)\n send_chat(\"/whitelist add #{username}\")\n\n sleep 0.5 # Give server time to add to whitelist\n\n if is_maybe_whitelisted?(username)\n result_hash(200, \"Successfully added #{username} to whitelist.\")\n else\n result_hash(404, \"May not have added #{username} to whitelist, please manually check with the whitelist_list command\")\n end\n end", "title": "" }, { "docid": "d9d7825e57806066301843b23f6a3ddb", "score": "0.47114518", "text": "def update\n respond_to do |format|\n if @allowedvalueslevel.update(allowedvalueslevel_params)\n format.html { redirect_to @allowedvalueslevel, notice: 'Allowedvalueslevel was successfully updated.' }\n format.json { render :show, status: :ok, location: @allowedvalueslevel }\n else\n format.html { render :edit }\n format.json { render json: @allowedvalueslevel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87156e86e7eef48455180805353088e8", "score": "0.46994293", "text": "def system_cve_whitelist_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProductsApi.system_cve_whitelist_get ...'\n end\n # resource path\n local_var_path = '/system/CVEWhitelist'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain'])\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 => 'CVEWhitelist')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProductsApi#system_cve_whitelist_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "0d300bd0082ffbcb00cbd41e6ec26d45", "score": "0.46993843", "text": "def updateFilters(user, filterlist)\n\t\t\tfilts = user.filters\n filts.each do |a|\n a.delete\n end\n filterlist.each do |fl|\n user.filters.create(filtertype: fl)\n end\n return user\n\t\tend", "title": "" }, { "docid": "10e9d5fedeb136c01d19d1a48089869b", "score": "0.4681424", "text": "def update_client_whitelist_detail\n return error_with_identifier('invalid_api_params',\n 'cm_uwa_ucwd_1',\n ['duplicate_whitelist_contract_address'],\n 'There were some errors in address submission. Please review and resubmit'\n ) if @client_whitelist_detail.contract_address.downcase == @whitelist_contract_address.downcase\n\n @client_whitelist_detail.status = GlobalConstant::ClientWhitelistDetail.inactive_status\n @client_whitelist_detail.save!\n\n @active_client_whitelist_detail_obj = ClientWhitelistDetail.create!(\n client_id: @client_id, contract_address: @whitelist_contract_address,\n whitelister_address: @client_whitelist_detail.whitelister_address,\n balance: @client_whitelist_detail.balance,\n suspension_type: @client_whitelist_detail.suspension_type,\n last_acted_by: @admin_id,\n status: GlobalConstant::ClientWhitelistDetail.active_status\n )\n success\n end", "title": "" }, { "docid": "ccd5daf56283674034fe60d591c7a938", "score": "0.4666308", "text": "def allow_from_ip(access_list, options = {})\n whitelist.concat(access_list)\n before_filter(:check_whitelist, options)\n end", "title": "" }, { "docid": "12008b7d3b176c1b7e9753f5a68b2bef", "score": "0.46641976", "text": "def mark_whitelisting_confirmed\n @kyc_whitelist_log.mark_confirmed\n\n r = fetch_user_kyc_detail\n return r unless r.success?\n\n user_kyc_detail = r.data[:user_kyc_detail]\n\n if @kyc_whitelist_log.phase == 0\n AdminManagement::ProcessUnwhitelist.new({\n client: @client,\n kyc_whitelist_log: @kyc_whitelist_log,\n user_kyc_detail: user_kyc_detail\n }).perform\n else\n user_kyc_detail.kyc_confirmed_at = Time.now.to_i\n user_kyc_detail.save!\n end\n\n end", "title": "" }, { "docid": "4b168591e7853b388059b2b5323d3894", "score": "0.4661413", "text": "def update\n authorize(@vmilist)\n\n respond_to do |format|\n if @vmilist.update(vmilist_params)\n format.html { redirect_to moderator_path, \n notice: I18n.t(\"activerecord.attributes.vmilist.update_success\") }\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "69e19a2c7f7e782d91c6c7d5228b7ae6", "score": "0.46588382", "text": "def update!(**args)\n @allowed_applications = args[:allowed_applications] if args.key?(:allowed_applications)\n end", "title": "" }, { "docid": "9cdceba14534887844fed6862eb7d147", "score": "0.46545762", "text": "def update\n respond_to do |format|\n if @whitelist_item.update(whitelist_item_params)\n format.html { redirect_to @whitelist_item, notice: 'Whitelist item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @whitelist_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b4a8be974d0ced7f02b2c8bd2c3a0cc", "score": "0.46183702", "text": "def update!(**args)\n @security_update_eligible = args[:security_update_eligible] if args.key?(:security_update_eligible)\n @security_update_enabled = args[:security_update_enabled] if args.key?(:security_update_enabled)\n end", "title": "" }, { "docid": "36729286630cb885c050142b102028db", "score": "0.4614399", "text": "def vulnerabilities=(value)\n @vulnerabilities = value\n end", "title": "" }, { "docid": "f799644a65f57288cae77d516f0c54a5", "score": "0.46121788", "text": "def update_vulnerability(opts = {})\n data, _status_code, _headers = update_vulnerability_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "75ad9c9aea7eae82da891d6256af8f1d", "score": "0.45976594", "text": "def update_user_kyc_detail(whitelist_status)\n # phase with 0 value can come in callback event for unwhitelisting .\n # whitelisting can't be confirmed if @phase = 0\n return if @kyc_whitelist_log.phase == 0\n\n @user_kyc_detail.whitelist_status = whitelist_status\n if @user_kyc_detail.whitelist_status_changed? &&\n @user_kyc_detail.whitelist_status == GlobalConstant::UserKycDetail.done_whitelist_status\n send_kyc_approved_mail\n end\n\n @user_kyc_detail.record_timestamps = false\n if @user_kyc_detail.changed?\n @user_kyc_detail.save!\n enqueue_job\n end\n end", "title": "" }, { "docid": "203eb42ca867b52433bfd763600a5f8e", "score": "0.45896274", "text": "def whitelist(input,list)\n rc = ''\n input.chars do |c|\n rc << c if list.include?(c)\n end\n rc\n end", "title": "" }, { "docid": "f6756d395440703627140d65f6ea3884", "score": "0.45886755", "text": "def update!(**args)\n @violating_sites = args[:violating_sites] if args.key?(:violating_sites)\n end", "title": "" }, { "docid": "f6756d395440703627140d65f6ea3884", "score": "0.45876092", "text": "def update!(**args)\n @violating_sites = args[:violating_sites] if args.key?(:violating_sites)\n end", "title": "" }, { "docid": "f6756d395440703627140d65f6ea3884", "score": "0.45876092", "text": "def update!(**args)\n @violating_sites = args[:violating_sites] if args.key?(:violating_sites)\n end", "title": "" }, { "docid": "54e10f5bf94f76aff2bf89552bf8c23c", "score": "0.45872876", "text": "def set_allowedvalueslevel\n @allowedvalueslevel = Allowedvalueslevel.find(params[:id])\n end", "title": "" }, { "docid": "0df15731d99106889ed7f1209dcd79fe", "score": "0.45863438", "text": "def update\n heat_level = system_params[:heat].to_i\n\n if heat_level >= 8\n new_heat = heat_level - 8\n @system.wanted_level += 1\n params[:system][:heat] = new_heat.to_s\n end\n respond_to do |format|\n if @system.update(system_params)\n format.html { redirect_to campaign_systems_path(@campaign), notice: \"System was successfully updated.\" }\n format.json { render :show, status: :ok, location: @system }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @system.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ef4d670a5e7b34857565e36156fe7f36", "score": "0.45750308", "text": "def update!(**args)\n @allowed_values = args[:allowed_values] if args.key?(:allowed_values)\n @denied_values = args[:denied_values] if args.key?(:denied_values)\n end", "title": "" }, { "docid": "86d27d8078b2302d6ac85c8b6c9fafa8", "score": "0.45747197", "text": "def browser_trusted_sites_security_level=(value)\n @browser_trusted_sites_security_level = value\n end", "title": "" }, { "docid": "de08829398a9c65bc740161f65be4c8f", "score": "0.45710385", "text": "def update!(**args)\n @allowed_config_values = args[:allowed_config_values] if args.key?(:allowed_config_values)\n end", "title": "" }, { "docid": "4c55ca955754c3d79b62a622ba3aa034", "score": "0.45524803", "text": "def content_type_allowlist\n if respond_to?(:content_type_whitelist)\n ActiveSupport::Deprecation.warn \"#content_type_whitelist is deprecated, use #content_type_allowlist instead.\" unless instance_variable_defined?(:@content_type_whitelist_warned)\n @content_type_whitelist_warned = true\n content_type_whitelist\n end\n end", "title": "" }, { "docid": "a91d1679babe6faae14a56d1a1502de9", "score": "0.4545444", "text": "def update_ip_access_control_list(access_control_list_id, request)\n start.uri('/api/ip-acl')\n .url_segment(access_control_list_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "a90c1387596bb66d3f33811d442a469a", "score": "0.45410398", "text": "def update\n found_person = Person.find(white_listed_user_id)\n\n if !found_person\n render json: {}, status: 404\n end\n\n found_person.update_attributes(white_listed_params)\n \n if found_person.save\n render json: {success: true}\n else\n render json: {}, status: 400\n end\n end", "title": "" }, { "docid": "bc372608822a39f5f1fbc3874d8fb6c4", "score": "0.45362997", "text": "def update!(**args)\n @allowed_ips = args[:allowed_ips] if args.key?(:allowed_ips)\n end", "title": "" }, { "docid": "c3b1d99abb82bedf6e09dd3f81a1b42c", "score": "0.45303178", "text": "def permits=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Permit.new(value)\n end\n end\n end\n @permits = list\n end", "title": "" }, { "docid": "c3b1d99abb82bedf6e09dd3f81a1b42c", "score": "0.45294583", "text": "def permits=(list)\n if list.class == Array\n list = List.new(list)\n list.each_with_index do |value, index|\n if value.is_a?(Hash)\n list[index] = Permit.new(value)\n end\n end\n end\n @permits = list\n end", "title": "" }, { "docid": "ecc78a44b2c245a6b0319389e9cabd03", "score": "0.45262998", "text": "def whitelist_files\n @whitelist_files ||= []\n end", "title": "" }, { "docid": "467c993985f111d97b7c7808ed4415d8", "score": "0.45211673", "text": "def put_exclude_list_0_with_http_info(policy_exclude_list, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityEastWestSecurityDistributedFirewallSettingsExclusionListApi.put_exclude_list_0 ...'\n end\n # verify the required parameter 'policy_exclude_list' is set\n if @api_client.config.client_side_validation && policy_exclude_list.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_exclude_list' when calling PolicySecurityEastWestSecurityDistributedFirewallSettingsExclusionListApi.put_exclude_list_0\"\n end\n # resource path\n local_var_path = '/infra/settings/firewall/security/exclude-list'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_exclude_list)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyExcludeList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityEastWestSecurityDistributedFirewallSettingsExclusionListApi#put_exclude_list_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "30f0b4fff594b49a4e00b9e09d76b40f", "score": "0.45173243", "text": "def start_processing_whitelisting\n Rails.logger.info(\"user_kyc_detail id:: #{@user_kyc_detail.id} - started processing whilelisting\")\n @user_kyc_detail.whitelist_status = GlobalConstant::UserKycDetail.started_whitelist_status\n @user_kyc_detail.kyc_confirmed_at = nil\n @user_kyc_detail.record_timestamps = false\n @user_kyc_detail.save!\n end", "title": "" }, { "docid": "2bbae0422e1db801e4cf8d6bc12f51c7", "score": "0.4516312", "text": "def index\n @whitelist_items = WhitelistItem.active\n end", "title": "" }, { "docid": "3473d27790f001adeea761aad42855f2", "score": "0.45127246", "text": "def send_whitelist_request\n\n unless @client[:mainnet_statuses].include? GlobalConstant::Client.mainnet_whitelist_requested_status\n #request whitelisting\n\n r = set_whitelisting_requested_flag\n return r unless r.success?\n\n r = create_issue_in_jira\n return r unless r.success?\n end\n\n success\n end", "title": "" }, { "docid": "e5dfc0b07c2c5142fc5814ca27bc3bbc", "score": "0.45040497", "text": "def whitelist\n @whitelist ||= File.read(hosts_whitelist_location).lines.collect(&:strip).reject { |el| /^#/ =~ el }\n end", "title": "" }, { "docid": "5e7c25485bab08bc85d6382be72e0c69", "score": "0.44882506", "text": "def update_version_whitelist_with_http_info(component_type, version_list, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiUpgradeNodesApi.update_version_whitelist ...'\n end\n # verify the required parameter 'component_type' is set\n if @api_client.config.client_side_validation && component_type.nil?\n fail ArgumentError, \"Missing the required parameter 'component_type' when calling ManagementPlaneApiUpgradeNodesApi.update_version_whitelist\"\n end\n # verify the required parameter 'version_list' is set\n if @api_client.config.client_side_validation && version_list.nil?\n fail ArgumentError, \"Missing the required parameter 'version_list' when calling ManagementPlaneApiUpgradeNodesApi.update_version_whitelist\"\n end\n # resource path\n local_var_path = '/upgrade/version-whitelist/{component_type}'.sub('{' + 'component_type' + '}', component_type.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 = @api_client.object_to_http_body(version_list)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiUpgradeNodesApi#update_version_whitelist\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.44851074", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "edc3ad89c273157e0740e60700a2fcff", "score": "0.44811887", "text": "def setWhiteListedDomains( domains )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::List( domains )\n\n # BIMserver request\n request( { domains: domains } )\n end", "title": "" }, { "docid": "21e178a2b6e749e0afe3d45951a7fed0", "score": "0.4478296", "text": "def update\n @list = current_user.lists.find(params[:id])\n authorize! :update, @list\n\n respond_to do |format|\n if @list.update_attributes(params[:list])\n format.html { redirect_to @list, notice: I18n.t('lists.update_success') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0eceba976e11b384a0e2e8cdea370aa", "score": "0.4472432", "text": "def permitted_sites\n @permitted_sites =\n if @current_user.admin\n Site.all\n else\n @current_user.owned_sites\n end\n end", "title": "" }, { "docid": "8df607c588cb0d7cbda256354cb8479f", "score": "0.44683117", "text": "def rewhitelist_users\n user_ids = ar_obj.pluck(:user_id)\n return if user_ids.blank?\n\n ar_obj.update_all(whitelist_status: GlobalConstant::UserKycDetail.unprocessed_whitelist_status)\n ar_obj.bulk_flush(user_ids)\n end", "title": "" }, { "docid": "bf0037c0fd47f888627d262636bd6277", "score": "0.4466604", "text": "def permitted_attributes\n allowed_attrs = JazzHoustonConstants::USER_WHITELIST_ATTRS\n if user.has_role? :Administrator\n allowed_attrs.push(:role_ids)\n else\n allowed_attrs\n end\n end", "title": "" }, { "docid": "ff04facc681893ef471edab05ad76471", "score": "0.44634056", "text": "def put_exclude_list_with_http_info(policy_exclude_list, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityEastWestSecurityDistributedFirewallSettingsExclusionListApi.put_exclude_list ...'\n end\n # verify the required parameter 'policy_exclude_list' is set\n if @api_client.config.client_side_validation && policy_exclude_list.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_exclude_list' when calling PolicySecurityEastWestSecurityDistributedFirewallSettingsExclusionListApi.put_exclude_list\"\n end\n # resource path\n local_var_path = '/global-infra/settings/firewall/security/exclude-list'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_exclude_list)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicyExcludeList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityEastWestSecurityDistributedFirewallSettingsExclusionListApi#put_exclude_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c461a530662c4218e3e7e35a341e4704", "score": "0.44510743", "text": "def update_capacity_thresholds(capacity_threshold_list, opts = {})\n data, _status_code, _headers = update_capacity_thresholds_with_http_info(capacity_threshold_list, opts)\n data\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.44499385", "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": "fcba655c6beb4d25811cf7c30ef64434", "score": "0.44355544", "text": "def update_listed_security(listed_security, csi_security, default_security_type)\n security = listed_security.security\n\n # update Security\n replacement_attributes = {}\n\n security_type = find_or_create_security_type(lookup_security_type(csi_security, default_security_type))\n replacement_attributes[:security_type_id] = security_type.id if security.security_type_id != security_type.id\n\n replacement_attributes[:name] = csi_security.name if security.name != csi_security.name\n replacement_attributes[:search_key] = extract_search_key_from_security_name(csi_security.name) if security.name != csi_security.name\n\n if !replacement_attributes.empty?\n log(\"Updating security:\\n#{security.to_hash}\\n=> #{replacement_attributes.inspect}\")\n security.update(replacement_attributes)\n end\n\n # potentially update security's industry and sector classifications\n #csi_industry = csi_security.industry || UNKNOWN_INDUSTRY_NAME\n #security.classify(\"Industry\", \"CSI\", csi_industry, Date.today_datestamp)\n\n #csi_sector = csi_security.sector || UNKNOWN_SECTOR_NAME\n #security.classify(\"Sector\", \"CSI\", csi_sector, Date.today_datestamp)\n\n\n # update ListedSecurity\n replacement_attributes = {}\n replacement_attributes[:symbol] = csi_security.symbol if listed_security.symbol != csi_security.symbol\n replacement_attributes[:listing_start_date] = convert_date(csi_security.start_date) if listed_security.listing_start_date != convert_date(csi_security.start_date)\n replacement_attributes[:listing_end_date] = convert_date(csi_security.end_date) if listed_security.listing_end_date != convert_date(csi_security.end_date)\n replacement_attributes[:csi_number] = csi_security.csi_number.to_i if listed_security.csi_number != csi_security.csi_number.to_i\n\n if !replacement_attributes.empty?\n log(\"Updating listed security:\\n#{listed_security.to_hash}\\n=> #{replacement_attributes.inspect}\")\n listed_security.update(replacement_attributes)\n end\n\n listed_security\n rescue Sequel::ValidationFailed, Sequel::HookFailed => e\n log \"Can't import #{csi_security.inspect}: #{e.message}\"\n nil\n rescue => e\n log \"Can't import #{csi_security.inspect}: #{e.message}\"\n log e.backtrace.join(\"\\n\")\n nil\n end", "title": "" }, { "docid": "9ea2899704f7073144157750580c4a68", "score": "0.4434115", "text": "def new_statuses_allowed_to(user)\n statuses = status.find_new_statuses_allowed_to(user.roles_for_project(project), @cm_change_tracker)\n statuses << status unless statuses.empty?\n statuses = statuses.uniq.sort\n blocked? ? statuses.reject {|s| s.is_closed?} : statuses\n end", "title": "" }, { "docid": "6c3fb161137bcae01dac4c661680510b", "score": "0.4429564", "text": "def vulnerability_states=(value)\n @vulnerability_states = value\n end", "title": "" }, { "docid": "e2469ec89e6cd7c0fd609b3ab07b1f0c", "score": "0.44267076", "text": "def mark_client_eth_balance_low\n self.suspension_type = GlobalConstant::ClientWhitelistDetail.low_balance_suspension_type\n self.save!\n\n admin_emails = GlobalConstant::Admin.get_all_admin_emails_for(\n self.client_id,\n GlobalConstant::Admin.whitelisting_balance_alert_notification_type\n )\n\n admin_emails.each do |admin_email|\n Email::HookCreator::SendTransactionalMail.new(\n client_id: Client::OST_KYC_CLIENT_IDENTIFIER,\n email: admin_email,\n template_name: GlobalConstant::PepoCampaigns.low_balance_whitelisting_suspended_template,\n template_vars: {whitelister_address: self.whitelister_address}\n ).perform\n\n end\n end", "title": "" }, { "docid": "5cd0eb95ecfab2b13b13b16ebfc9c623", "score": "0.44259843", "text": "def get_version_whitelist(opts = {})\n data, _status_code, _headers = get_version_whitelist_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "5cd0eb95ecfab2b13b13b16ebfc9c623", "score": "0.44259843", "text": "def get_version_whitelist(opts = {})\n data, _status_code, _headers = get_version_whitelist_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "762724db71bbd97967860694283e5ebe", "score": "0.44221509", "text": "def set_permitted_features\n pf = current_user.permission_to_access( feature_identifier, :to_update ) == 2 ? '' : current_user.permitted_features\n @permitted_features = Feature.permitted_features( pf ).order( label: :asc ).collect{ |f| [ f.label, f.id ]}\n end", "title": "" }, { "docid": "509ae1c6422f5161e0d5498003fedcbf", "score": "0.44186017", "text": "def build\n fail Neutrino::Gateway::Exceptions::BadRequestError if @specified_whitelists.count > 1\n whitelist = @specified_whitelists.first\n values = @whitelist_hash[whitelist]\n\n case whitelist\n\n when :type_of_service_whitelist\n Whitelist.new\n .with_template('/type_of_service_list/{value}')\n .and_values(values)\n .error_on_empty(Neutrino::Gateway::Exceptions::TypesOfServiceNotProvided)\n\n when :subject_matter_domain_whitelist\n Whitelist.new\n .with_template('/subject_matter_domain_list/{value}')\n .and_values(values)\n .error_on_empty(Neutrino::Gateway::Exceptions::SubjectMatterDomainsNotProvided)\n else\n Whitelist.new\n end\n end", "title": "" }, { "docid": "c13d1e84ef7a99b795b157b0e9201484", "score": "0.44043118", "text": "def update_si_exclude_list_0_with_http_info(policy_si_exclude_list, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicySecurityServiceInsertionSettingsExclusionListApi.update_si_exclude_list_0 ...'\n end\n # verify the required parameter 'policy_si_exclude_list' is set\n if @api_client.config.client_side_validation && policy_si_exclude_list.nil?\n fail ArgumentError, \"Missing the required parameter 'policy_si_exclude_list' when calling PolicySecurityServiceInsertionSettingsExclusionListApi.update_si_exclude_list_0\"\n end\n # resource path\n local_var_path = '/global-infra/settings/service-insertion/security/exclude-list'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(policy_si_exclude_list)\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PolicySIExcludeList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicySecurityServiceInsertionSettingsExclusionListApi#update_si_exclude_list_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "74e75001a74b04c5c16caab6c154fbf6", "score": "0.4400192", "text": "def allow_remote_listing=( enable=false )\n\t\tif enable\n\t\t\tself.touch( 'modcanlist' )\n\t\telse\n\t\t\tself.unlink( 'modcanlist' )\n\t\tend\n\tend", "title": "" }, { "docid": "aefe518b193bb155fbc73419a2884424", "score": "0.43987438", "text": "def patch_suspicious_ip_throttling(body)\n patch(suspicious_ip_throttling_settings_path, body)\n end", "title": "" }, { "docid": "155c2d9397de5573279d397338aeb5f4", "score": "0.4396654", "text": "def update_list(request)\n begin\n data, _status_code, _headers = update_list_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = update_list_with_http_info(request)\n else\n raise\n end\n end\n data\n end", "title": "" } ]
fac55be8274ae5f4f1dbadfa6cfb6e5a
Create a defined name in Excel. We handle global/workbook level names and local/worksheet names. This method is used to defined a name that can be used to represent a value, a single cell or a range of cells in a workbook. For example to set a global/workbook name: Global/workbook names. workbook.define_name('Exchange_rate', '=0.96') workbook.define_name('Sales', '=Sheet1!$G$1:$H$10') It is also possible to define a local/worksheet name by prefixing the name with the sheet name using the syntax sheetname!definedname: Local/worksheet name. workbook.define_name('Sheet2!Sales', '=Sheet2!$G$1:$G$10') If the sheet name contains spaces or special characters you must enclose it in single quotes like in Excel: workbook.define_name("'New Data'!Sales", '=Sheet2!$G$1:$G$10') See the defined_name.rb program in the examples dir of the distro.
[ { "docid": "af175bd3bc8a223c2e3e18d07230678c", "score": "0.76329714", "text": "def define_name(name, formula)\n sheet_index = nil\n sheetname = ''\n full_name = name\n\n # Remove the = sign from the formula if it exists.\n formula.sub!(/^=/, '')\n\n # Local defined names are formatted like \"Sheet1!name\".\n if name =~ /^(.*)!(.*)$/\n sheetname = $1\n name = $2\n sheet_index = get_sheet_index(sheetname)\n else\n sheet_index =-1 # Use -1 to indicate global names.\n end\n\n # Warn if the sheet index wasn't found.\n if !sheet_index\n raise \"Unknown sheet name #{sheetname} in defined_name()\\n\"\n return -1\n end\n\n # Warn if the sheet name contains invalid chars as defined by Excel help.\n if name !~ %r!^[a-zA-Z_\\\\][a-zA-Z_.]+!\n raise \"Invalid characters in name '#{name}' used in defined_name()\\n\"\n return -1\n end\n\n # Warn if the sheet name looks like a cell name.\n if name =~ %r(^[a-zA-Z][a-zA-Z]?[a-dA-D]?[0-9]+$)\n raise \"Invalid name '#{name}' looks like a cell name in defined_name()\\n\"\n return -1\n end\n\n @defined_names.push([ name, sheet_index, formula])\n end", "title": "" } ]
[ { "docid": "7aa92dcd6541dcc97c3c3e9673a91a66", "score": "0.77673", "text": "def define_name(name, formula)\n sheet_index = nil\n sheetname = ''\n\n # Local defined names are formatted like \"Sheet1!name\".\n if name =~ /^(.*)!(.*)$/\n sheetname = $1\n name = $2\n sheet_index = @worksheets.index_by_name(sheetname)\n else\n sheet_index = -1 # Use -1 to indicate global names.\n end\n\n # Raise if the sheet index wasn't found.\n if !sheet_index\n raise \"Unknown sheet name #{sheetname} in defined_name()\\n\"\n end\n\n # Raise if the name contains invalid chars as defined by Excel help.\n # Refer to the following to see Excel's syntax rules for defined names:\n # http://office.microsoft.com/en-001/excel-help/define-and-use-names-in-formulas-HA010147120.aspx#BMsyntax_rules_for_names\n #\n if name =~ /\\A[-0-9 !\"#\\$%&'\\(\\)\\*\\+,\\.:;<=>\\?@\\[\\]\\^`\\{\\}~]/ || name =~ /.+[- !\"#\\$%&'\\(\\)\\*\\+,\\\\:;<=>\\?@\\[\\]\\^`\\{\\}~]/\n raise \"Invalid characters in name '#{name}' used in defined_name()\\n\"\n end\n\n # Raise if the name looks like a cell name.\n if name =~ %r(^[a-zA-Z][a-zA-Z]?[a-dA-D]?[0-9]+$)\n raise \"Invalid name '#{name}' looks like a cell name in defined_name()\\n\"\n end\n\n # Raise if the name looks like a R1C1\n if name =~ /\\A[rcRC]\\Z/ || name =~ /\\A[rcRC]\\d+[rcRC]\\d+\\Z/\n raise \"Invalid name '#{name}' like a RC cell ref in defined_name()\\n\"\n end\n\n @defined_names.push([ name, sheet_index, formula.sub(/^=/, '') ])\n end", "title": "" }, { "docid": "7aa51a89f04f1a8b01ebf3d77e2a1b04", "score": "0.7064062", "text": "def define_name(name, formula, encoding = 0)\n sheet_index = 0\n full_name = name.downcase\n\n if name =~ /^(.*)!(.*)$/\n sheetname = $1\n name = $2\n sheet_index = 1 + @parser.get_sheet_index(sheetname)\n end\n\n # Strip the = sign at the beginning of the formula string\n formula = formula.sub(/^=/, '')\n\n # Parse the formula using the parser in Formula.pm\n parser = @parser\n\n # In order to raise formula errors from the point of view of the calling\n # program we use an eval block and re-raise the error from here.\n #\n tokens = parser.parse_formula(formula)\n\n # Force 2d ranges to be a reference class.\n tokens.collect! { |t| t.gsub(/_ref3d/, '_ref3dR') }\n tokens.collect! { |t| t.gsub(/_range3d/, '_range3dR') }\n\n # Parse the tokens into a formula string.\n formula = parser.parse_tokens(tokens)\n\n defined_names.push(\n {\n :name => name,\n :encoding => encoding,\n :sheet_index => sheet_index,\n :formula => formula\n }\n )\n\n index = defined_names.size\n\n parser.set_ext_name(name, index)\n end", "title": "" }, { "docid": "972b4c44bcbcfaf503f26cf160414b82", "score": "0.62062013", "text": "def create_def_name(token)\n case token\n when TkSPACE\n # mark first space so we can stop at next space\n if @first_space\n @first_space = false\n else\n @looking_for_name = false\n end\n when TkNL,TkLPAREN,TkfLPAREN,TkSEMICOLON\n # we can also stop at a new line or left parenthesis\n @looking_for_name = false\n when TkDOT\n @name<< \".\"\n when TkCOLON2\n @name<< \"::\"\n when TkASSIGN\n @name<< \"=\"\n when TkfLBRACK\n @name<< \"[\"\n when TkRBRACK\n @name<< \"]\"\n else\n begin\n @name<< token.name.to_s\n rescue Exception => err\n #what is this?\n STDOUT.puts @@token_counter.current_file\n STDOUT.puts @name\n STDOUT.puts token.inspect\n STDOUT.puts err.message\n exit 1\n end\n end\n end", "title": "" }, { "docid": "ff86427cfeb3e431b3d717815d21d632", "score": "0.61959326", "text": "def define_name(name)\n i = 1\n while not self.valid?\n self.name = name + \"-#{i}\"\n i += 1\n end\n end", "title": "" }, { "docid": "ff86427cfeb3e431b3d717815d21d632", "score": "0.61959326", "text": "def define_name(name)\n i = 1\n while not self.valid?\n self.name = name + \"-#{i}\"\n i += 1\n end\n end", "title": "" }, { "docid": "18066767af765e043a36c9b6caa5479f", "score": "0.618656", "text": "def create_def_name(token)\n case token\n when TkSPACE\n # mark first space so we can stop at next space\n if @first_space\n\t@first_space = false\n else\n\t@looking_for_name = false\n end\n when TkNL,TkLPAREN,TkfLPAREN,TkSEMICOLON\n # we can also stop at a new line or left parenthesis\n @looking_for_name = false\n when TkDOT\n @name<< \".\"\n when TkCOLON2\n @name<< \"::\"\n when TkASSIGN\n @name<< \"=\"\n when TkfLBRACK\n @name<< \"[\"\n when TkRBRACK\n @name<< \"]\"\n else\n begin\n\t@name<< token.name.to_s\n rescue Exception => err\n\t#what is this?\n\tSTDOUT.puts @@token_counter.current_file\n\tSTDOUT.puts @name\n\tSTDOUT.puts token.inspect\n\tSTDOUT.puts err.message\n\texit 1\n end\n end\n end", "title": "" }, { "docid": "18066767af765e043a36c9b6caa5479f", "score": "0.618656", "text": "def create_def_name(token)\n case token\n when TkSPACE\n # mark first space so we can stop at next space\n if @first_space\n\t@first_space = false\n else\n\t@looking_for_name = false\n end\n when TkNL,TkLPAREN,TkfLPAREN,TkSEMICOLON\n # we can also stop at a new line or left parenthesis\n @looking_for_name = false\n when TkDOT\n @name<< \".\"\n when TkCOLON2\n @name<< \"::\"\n when TkASSIGN\n @name<< \"=\"\n when TkfLBRACK\n @name<< \"[\"\n when TkRBRACK\n @name<< \"]\"\n else\n begin\n\t@name<< token.name.to_s\n rescue Exception => err\n\t#what is this?\n\tSTDOUT.puts @@token_counter.current_file\n\tSTDOUT.puts @name\n\tSTDOUT.puts token.inspect\n\tSTDOUT.puts err.message\n\texit 1\n end\n end\n end", "title": "" }, { "docid": "3c327256b7c98e0acad4779fbcc60ca0", "score": "0.57115835", "text": "def add_defined_name(formula, options); end", "title": "" }, { "docid": "872b41af375e9d7025073d3f6f6b63d7", "score": "0.56012577", "text": "def create_name\n return \"\" if @@names.size == 676000\n\n length = @@names.size\n\n while @@names.size == length\n @name = \"#{letter}#{letter}#{number}#{number}#{number}\"\n @@names << @name\n end\n end", "title": "" }, { "docid": "42d5fa74879858dfa1bc6fafc5c5829b", "score": "0.55939615", "text": "def name=(v)\n DataTypeValidator.validate \"Worksheet.name\", String, v\n raise ArgumentError, (ERR_SHEET_NAME_TOO_LONG % v) if v.size > 31\n sheet_names = @workbook.worksheets.map { |s| s.name }\n raise ArgumentError, (ERR_DUPLICATE_SHEET_NAME % v) if sheet_names.include?(v)\n @name=v\n end", "title": "" }, { "docid": "fbcd5283a816ab7b8a6dba0ad4ea64e8", "score": "0.54991895", "text": "def store_names # :nodoc:\n # Create the user defined names.\n defined_names.each do |defined_name|\n store_name(\n defined_name[:name],\n defined_name[:encoding],\n defined_name[:sheet_index],\n defined_name[:formula]\n )\n end\n\n # Sort the worksheets into alphabetical order by name. This is a\n # requirement for some non-English language Excel patch levels.\n sorted_worksheets = @worksheets.sort_by{ |x| x.name }\n\n # Create the autofilter NAME records\n create_autofilter_name_records(sorted_worksheets)\n\n # Create the print area NAME records\n create_print_area_name_records(sorted_worksheets)\n\n # Create the print title NAME records\n create_print_title_name_records(sorted_worksheets)\n end", "title": "" }, { "docid": "73f680f1c9f60cf6694b9cebc735fbdc", "score": "0.548233", "text": "def generate_name; end", "title": "" }, { "docid": "bd19aac1dda9d9d896797a88aae03db9", "score": "0.54594964", "text": "def generate_name(base_name, arguments)\n formatted_arguments = arguments.map do |key,value|\n value = value.inspect if value.respond_to?(:to_str)\n \"#{key} => #{value || \"(no default)\"}\"\n end\n \"#{base_name}(#{formatted_arguments.join(\", \")})\"\n end", "title": "" }, { "docid": "3ca2eea8df5f4d047bde2dc8141d9e12", "score": "0.5435977", "text": "def generate_names(name, options={})\n name = name.to_s\n effective_names = [name]\n effective_names += [\"#{name}A\", \"#{name}W\"] unless name =~ /[WA]$/\n aliases = ([options[:alias]] + [options[:aliases]]).flatten.compact\n snake_name = options[:snake_name] || name.snake_case\n camel_name = options[:camel_name] || name.camel_case\n case snake_name\n when /^is_/\n aliases << snake_name.sub(/^is_/, '') + '?'\n when /^set_/\n aliases << snake_name.sub(/^set_/, '')+ '='\n when /^get_/\n aliases << snake_name.sub(/^get_/, '')\n end\n [snake_name, camel_name, effective_names, aliases]\n end", "title": "" }, { "docid": "22826d1637781192539ca24e6f7b52e1", "score": "0.54196966", "text": "def generate_name \n \"#{prefix}#{suffix}\"\n end", "title": "" }, { "docid": "69398e0278d4e8e866a2d66574e0eb2d", "score": "0.5416918", "text": "def add_worksheet_name(name)\n worksheet_name = \"/xl/worksheets/#{name}.xml\"\n\n add_override(worksheet_name, \"#{App_document}spreadsheetml.worksheet+xml\")\n end", "title": "" }, { "docid": "a3d4125a6ef5e2437a473b77fb756b49", "score": "0.54167664", "text": "def generate_name\n unless name || manual_account?\n self.name = financial_inst.name\n self.name += \" - #{account_type.name}\" if account_type.name\n end\n end", "title": "" }, { "docid": "e2e0c91be973f63e8422284df4cb92d1", "score": "0.5381028", "text": "def name(frequency = :common, surname = true)\n generate(:frequency => frequency, :with_surname =>surname)\n end", "title": "" }, { "docid": "6973ba643abedf0aeee3116f670c6a53", "score": "0.5362366", "text": "def defined_name\n return unless range\n\n Axlsx.cell_range(range.split(':').collect { |name| worksheet.name_to_cell(name) })\n end", "title": "" }, { "docid": "7db916ac1ca4730104376a993887c349", "score": "0.535432", "text": "def definition_name\n return @definition_name if defined?(@definition_name)\n\n if name\n @definition_name = name.gsub(\"::\", \"__\").freeze\n else\n \"#{self.class.name}_#{object_id}\".gsub(\"::\", \"__\").freeze\n end\n end", "title": "" }, { "docid": "52809a35473cdb26fea473765c1a54ee", "score": "0.5322854", "text": "def name_factory\n V04::Name\n end", "title": "" }, { "docid": "dea3e577b3b9de7123babcd6248620fa", "score": "0.53036165", "text": "def set_new_name!(name_maker)\n self.new_name = name_maker.new_value_for(:name, @config[:format], self)\n end", "title": "" }, { "docid": "f44720d6039a30cdfcc966d9b6ea5230", "score": "0.52978504", "text": "def name\n @name ||= formula.name\n end", "title": "" }, { "docid": "f44720d6039a30cdfcc966d9b6ea5230", "score": "0.52978504", "text": "def name\n @name ||= formula.name\n end", "title": "" }, { "docid": "0cedbc93df8e48803a9681475f2931f4", "score": "0.5297161", "text": "def defined_name; end", "title": "" }, { "docid": "66d5f7a6199a32b822038501e397208e", "score": "0.52964985", "text": "def rename new_name\n self.class.new(@key, @hash, defs: @defs, name: new_name)\n end", "title": "" }, { "docid": "2fa545297d28b620af143d61de5e04ee", "score": "0.52828014", "text": "def gen_name\n name.to_s.downcase\n end", "title": "" }, { "docid": "2fa545297d28b620af143d61de5e04ee", "score": "0.52828014", "text": "def gen_name\n name.to_s.downcase\n end", "title": "" }, { "docid": "2fa545297d28b620af143d61de5e04ee", "score": "0.52828014", "text": "def gen_name\n name.to_s.downcase\n end", "title": "" }, { "docid": "ebefcf2511f5fc3311f4ca1b44218ec6", "score": "0.52802694", "text": "def generate_welcome_string(name)\n\tprefix = \"Hello\"\n\tpostfix = \"Have a nice day.\"\n\twelcome_string = prefix + name + postfix\n\treturn welcome_string\nend", "title": "" }, { "docid": "54223fac6e6d7b7f3db519192ebc7f1e", "score": "0.52784985", "text": "def assign_name\n\t\tletters = ('AA'..'ZZ').to_a.sample\n\t\tnumbers = Random.rand 100...1000 #Use 3 dots so we dont go over 1000\n\t\t@name = letters + numbers.to_s # We can use @name in here because we used ATTR function above.\n\tend", "title": "" }, { "docid": "98219b3e8945005e60cbf9b8dec0501e", "score": "0.52581185", "text": "def full_name\n \"#{ defined_in_name }##{ name }\"\n end", "title": "" }, { "docid": "c54d8ac5fe605f008291be766f16cfd8", "score": "0.5251567", "text": "def set_name(v)\n Saklient::Util::validate_type(v, 'String')\n @m_name = v\n @n_name = true\n return @m_name\n end", "title": "" }, { "docid": "c54d8ac5fe605f008291be766f16cfd8", "score": "0.5250359", "text": "def set_name(v)\n Saklient::Util::validate_type(v, 'String')\n @m_name = v\n @n_name = true\n return @m_name\n end", "title": "" }, { "docid": "c54d8ac5fe605f008291be766f16cfd8", "score": "0.5250359", "text": "def set_name(v)\n Saklient::Util::validate_type(v, 'String')\n @m_name = v\n @n_name = true\n return @m_name\n end", "title": "" }, { "docid": "c54d8ac5fe605f008291be766f16cfd8", "score": "0.5250359", "text": "def set_name(v)\n Saklient::Util::validate_type(v, 'String')\n @m_name = v\n @n_name = true\n return @m_name\n end", "title": "" }, { "docid": "c54d8ac5fe605f008291be766f16cfd8", "score": "0.5250359", "text": "def set_name(v)\n Saklient::Util::validate_type(v, 'String')\n @m_name = v\n @n_name = true\n return @m_name\n end", "title": "" }, { "docid": "c54d8ac5fe605f008291be766f16cfd8", "score": "0.5250359", "text": "def set_name(v)\n Saklient::Util::validate_type(v, 'String')\n @m_name = v\n @n_name = true\n return @m_name\n end", "title": "" }, { "docid": "c54d8ac5fe605f008291be766f16cfd8", "score": "0.5250359", "text": "def set_name(v)\n Saklient::Util::validate_type(v, 'String')\n @m_name = v\n @n_name = true\n return @m_name\n end", "title": "" }, { "docid": "c54d8ac5fe605f008291be766f16cfd8", "score": "0.5250359", "text": "def set_name(v)\n Saklient::Util::validate_type(v, 'String')\n @m_name = v\n @n_name = true\n return @m_name\n end", "title": "" }, { "docid": "be8cfae17bbcb22543ce1ddef1ce0b1f", "score": "0.52346784", "text": "def name\n # Initialize nil values to something meaningful\n @name ||= \"\"\n return @name\n end", "title": "" }, { "docid": "66786962133ff99aceeb366935ba1f53", "score": "0.5220661", "text": "def name\n definition[:name]\n end", "title": "" }, { "docid": "66786962133ff99aceeb366935ba1f53", "score": "0.5220661", "text": "def name\n definition[:name]\n end", "title": "" }, { "docid": "739bb6516b516eea6613daf2dcbde773", "score": "0.5212412", "text": "def generate_name\n self.name ||= name_from_serial\n end", "title": "" }, { "docid": "f9c8a1c1264a55c6a063b1740d60df44", "score": "0.52117974", "text": "def _name=(value)\n @name = value\n end", "title": "" }, { "docid": "700fdc4756e66db4bdd1b8112f16d322", "score": "0.5206813", "text": "def name=(n)\n @name = n.to_s.upcase.gsub('_', '-')\n end", "title": "" }, { "docid": "ef313735e09d3db6d3c016d466805323", "score": "0.5192448", "text": "def name=(n)\n @name = n.to_s.gsub(/(\\s+)/, '_')\n end", "title": "" }, { "docid": "8f95fa42347c92bcf130004a4effddae", "score": "0.5189378", "text": "def defined_name\n return unless range\n Axlsx.cell_range(range.split(':').collect { |name| worksheet.name_to_cell(name)})\n end", "title": "" }, { "docid": "8f95fa42347c92bcf130004a4effddae", "score": "0.5189378", "text": "def defined_name\n return unless range\n Axlsx.cell_range(range.split(':').collect { |name| worksheet.name_to_cell(name)})\n end", "title": "" }, { "docid": "d0a4a1aa94362aa1e6a8f7446a9a97db", "score": "0.51713353", "text": "def generate_wrapper_name(name)\n \"__%s_%s_%s__\" % [@net_name, @name, @index]\n end", "title": "" }, { "docid": "65d96806f170c13af4f172fb27bcb09a", "score": "0.51657134", "text": "def name=(n)\n @name = n.to_s.upcase.gsub(\"_\", \"-\")\n end", "title": "" }, { "docid": "9b3cff99e23632cca9133daf5e8eb656", "score": "0.5163556", "text": "def name\n @name ||= \"Sheet#{index + 1}\"\n end", "title": "" }, { "docid": "90f96f794ec96aebd8df60358beb5803", "score": "0.516245", "text": "def generate_default_name\n prefix = \"New Report\"\n \n # get next number\n nums = self.class.for_mission(mission).where(\"name LIKE '#{prefix}%'\").collect do |r| \n # get suffix\n if r.name.match(/^#{prefix}(\\s+\\d+$|$)/)\n [$1.to_i, 1].max # must be at least one if found\n else\n 1\n end\n end\n next_num = (nums.compact.max || 0) + 1\n suffix = next_num == 1 ? \"\" : \" #{next_num}\"\n \n # set to attrib\n self.name = \"#{prefix}#{suffix}\"\n end", "title": "" }, { "docid": "2048ef4bb735d285e3834b6c79d9398a", "score": "0.51618534", "text": "def name; @name ||= formula.name end", "title": "" }, { "docid": "84c8b59808fca025c36b8ed0ee6ce059", "score": "0.5157362", "text": "def name\n # Initialize a nil value to something meaningful\n @name ||= ''\n @name\n end", "title": "" }, { "docid": "772ef737f8ff92a236bbc7c837465376", "score": "0.51552635", "text": "def create_name\n base = @config[:instance_name]\n \"#{base}-#{SecureRandom.hex(16)}\"\n end", "title": "" }, { "docid": "772ef737f8ff92a236bbc7c837465376", "score": "0.51549083", "text": "def create_name\n base = @config[:instance_name]\n \"#{base}-#{SecureRandom.hex(16)}\"\n end", "title": "" }, { "docid": "2c6660465f71034b7fc7b96aaf4c1b4b", "score": "0.5139727", "text": "def set_WorksheetName(value)\n set_input(\"WorksheetName\", value)\n end", "title": "" }, { "docid": "2c6660465f71034b7fc7b96aaf4c1b4b", "score": "0.5139727", "text": "def set_WorksheetName(value)\n set_input(\"WorksheetName\", value)\n end", "title": "" }, { "docid": "2c6660465f71034b7fc7b96aaf4c1b4b", "score": "0.5139727", "text": "def set_WorksheetName(value)\n set_input(\"WorksheetName\", value)\n end", "title": "" }, { "docid": "2c6660465f71034b7fc7b96aaf4c1b4b", "score": "0.5139727", "text": "def set_WorksheetName(value)\n set_input(\"WorksheetName\", value)\n end", "title": "" }, { "docid": "2c6660465f71034b7fc7b96aaf4c1b4b", "score": "0.5139727", "text": "def set_WorksheetName(value)\n set_input(\"WorksheetName\", value)\n end", "title": "" }, { "docid": "bf2050a1dda5a5569cb900b260a2d42b", "score": "0.5132265", "text": "def name\n @name ||= \"Sheet #{book.index(self) + 1}\"\n end", "title": "" }, { "docid": "2d443e0e687ce928f19fc493e53a6ac0", "score": "0.512434", "text": "def name\n @name ||= begin\n prefix = \"#\"\n name = @body[1]\n\n if name.is_a?(Sexp)\n if name.first == :lvar\n prefix = name.last.to_s + \"#\"\n else\n prefix = name.last.to_s + \".\"\n end\n\n name = @body[2]\n end\n\n prefix + name.to_s\n end\n end", "title": "" }, { "docid": "e136221fb97dbcd6b9793e732c2a7e0c", "score": "0.51124233", "text": "def generate_name\n \"shard-#{min_id}-#{max_id.to_s.downcase}\"\n end", "title": "" }, { "docid": "65aad745e07f137fc4e11e4acceb2a9b", "score": "0.5111409", "text": "def generate_welcome_string(name)\n prefix = \"hello\"\n postfix = \". have a nice day.\"\n \"#{prefix}#{name} #{postfix}\"\n # prefix + name + postfix\nend", "title": "" }, { "docid": "583574ad53ac9df9632fce8821d42dc3", "score": "0.5110876", "text": "def normalise_defined_name(name) #:nodoc:\n name.sub(/^_xlnm./, '').downcase\n end", "title": "" }, { "docid": "583574ad53ac9df9632fce8821d42dc3", "score": "0.5110876", "text": "def normalise_defined_name(name) #:nodoc:\n name.sub(/^_xlnm./, '').downcase\n end", "title": "" }, { "docid": "49d4843635cc022bd15f58a219e7fdc6", "score": "0.5086997", "text": "def generate_name(prefix, adjuster)\n \"#{Date.today.strftime(\"%Y-%m-%d\")}_#{prefix}.#{adjuster}\"\nend", "title": "" }, { "docid": "90f2f2a1691cfcd1046274941b26b1bd", "score": "0.5075732", "text": "def assign_name\n if self.round && self.set_end_format\n self.name = create_name\n end\n end", "title": "" }, { "docid": "063a48876d43a93fad9d0e9c85345f57", "score": "0.50716114", "text": "def name(options = {})\n options = { apply_generator: true }.merge(options)\n if options[:apply_generator]\n config.name_generator.call(@name, self)\n else\n @name\n end\n end", "title": "" }, { "docid": "3b6f208168de4d4b598033bf8eb886c0", "score": "0.5065452", "text": "def setname(name)\n @name = mkname(name)\n end", "title": "" }, { "docid": "af5845b170c63ac72f87643f86258f90", "score": "0.50654346", "text": "def name\n @name ||= _name.symbolize\n end", "title": "" }, { "docid": "07b48f8066a281588b64349ff8e73646", "score": "0.5060588", "text": "def make_name(name, val, op)\n opt = parse_opt(op, val)\n if opt.kind_of?(Array)\n op = opt[0]\n val = opt[1]\n return Latrs::Report::AtomExpr.new(name, val, op)\n else\n return nil\n end\n end", "title": "" }, { "docid": "8c02492f3c3908e4bb898d1d4680824b", "score": "0.5048932", "text": "def name_generator(name)\n subs = name.downcase.gsub(/ /,\"_\")\n return \"Please only use alphanumerics, spaces or underscores.\" if /[^0-9a-z_]/.match(subs) != nil\n studly(subs).join.prepend(\"xX_\").concat(\"_Xx\")\nend", "title": "" }, { "docid": "67fdfc4c563c3a12fd53a3647c09e16c", "score": "0.50299454", "text": "def defvar(name, val)\n RPL.fail(\"defvar #{name}\", \"invalid type\") unless name.is_a? Name\n RPL.fail(\"defvar #{name}\", \"can't redefine words\") if @names[name.name].is_a? Word\n RPL.fail(\"defvar #{name}\", \"missing/invalid value\") unless val\n @names[name.name] = val\n end", "title": "" }, { "docid": "198ea1db037c87836b4175d89958ad71", "score": "0.50251514", "text": "def add_name\n nm = ''\n nm += prefix if prefix.present?\n nm += \" #{given_name}\" if given_name.present?\n nm += \" #{family_name}\" if family_name.present?\n nm += \" #{suffix}\" if suffix.present?\n nm = nm.sub(' ', '') if nm.starts_with? ' '\n self.name = nm if nm.present?\n end", "title": "" }, { "docid": "ce025a4ca790806435e10e59399f5de8", "score": "0.5012047", "text": "def createlabelname(name)\t\t\n\n\t\tsplitname=name.split(\"/\")\n\t\tfor i in 1..splitname.length do\n\t\t\t# If the name is within brackets, then actual name of the person is unknown\n\t\t\tif(splitname[i-1] =~ /^\\(.+\\)/) \n\t\t\t\tsplitname[i-1] = \"(....) \" \n\t\t\tend\n\t\tend\t\n\t\t\t\n\t\tname=splitname.join(\"\")\n\n\t\t# Initialize long name\n\t\tsplitname=name.split(\" \")\n\t\tfor i in 1..splitname.length do\n\t\t\t# If there are more than 2 names, and this is not 1st name or last name, and it is not already initialized, and this is not 2nd name while the first name is a title such as \"Ompu\"\n\t\t\tif(splitname.length>2 && i != 1 && i != splitname.length && !(i==2 && (splitname[0].strip==\"Ompu\" || splitname[0].strip==\"O.\" || splitname[0].strip==\"Amani\"|| splitname[0].strip==\"A.\" || splitname[0].strip==\"Aman\" || splitname[0].strip==\"Datu\" || splitname[0].strip==\"Nai\" || splitname[0].strip==\"Apa\" || splitname[0].strip==\"Pu\" || splitname[0].strip==\"Na\" || splitname[0].strip==\"Boru\" || splitname[0].strip==\"Apa\" || splitname[0].strip==\"Raja\")) )\n\t\t\t\t\tsplitname[i-1] = splitname[i-1][0,1].capitalize + \".\"\n\t\t\tend\t\n\t\tend\n\n\t\tfor i in 1..splitname.length do\n# If this name is not an initial (ended by \".\"), or if it is an initial but before a non-initial\n\t\t\tif(splitname[i-1] && splitname[i])\n\t\t\t\tif(splitname[i-1][-1,1] != \".\" || (splitname[i-1][-1,1] == \".\" && splitname[i][-1,1] != \".\"))\n\t\t\t\t\tsplitname[i-1]=splitname[i-1] + \" \"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\tname=splitname.join(\"\")\n\n\t\tlabel= name\t\n\t\treturn label\n\tend", "title": "" }, { "docid": "88aff53fcf41dc22a0b698434fbc8cbf", "score": "0.50088173", "text": "def create_name_extension\n c = (@is_classifier ? 'C' : '')\n r = (@is_regularizer ? 'R' : '')\n \"#{@dataset_name}_#{@class_name}#{c}#{r}\"\n end", "title": "" }, { "docid": "855fe4de30a7d5a51d48317cd44bbbfb", "score": "0.50070524", "text": "def name=(n)\n if n.nil?\n @namesuffix = ''\n else\n @namesuffix = \": #{n}\"\n end\n end", "title": "" }, { "docid": "9eb5ef492f0f91341c3d4d6c2730e409", "score": "0.49956772", "text": "def generate_name\n names = [\"High Card\", \"Ace King\", \"Pair\", \"Two Pair\", \"Three of a Kind\",\n \"Straight\", \"Flush\", \"Full House\", \"Four of a Kind\", \"Straight Flush\",\n \"Royal Flush\", \"Action Card\", \"All In\", \"Ante\", \"Big Bet\",\n \"Bluff\", \"Check\", \"Community Card\", \"Deal\", \"Dealer's Choice\",\n \"Flop\", \"Fold\", \"Free Card\", \"Heads Up\", \"High-low Split\",\n \"In the Money\", \"The Nuts\", \"Over the Top\", \"Play the Board\", \"Poker Face\",\n \"River\", \"Semi-bluff\", \"Splash the Pot\", \"Trips\", \"Turn\", \"Under the Gun\"]\n names.sample\n end", "title": "" }, { "docid": "179e12aa031fd02f8d8de5f2d265ed5e", "score": "0.49948916", "text": "def __name(names = [])\n #if names.empty?\n # @name ||= @origin.__name names.unshift(\"#{ @name }#{ @extname }\")\n #else\n @origin.__name names.unshift(\"#{ @name }#{ __extname }\")\n #end\n end", "title": "" }, { "docid": "cc27f664ffd61a7437601f51178def1b", "score": "0.49836406", "text": "def name=(val)\n @name = val\n end", "title": "" }, { "docid": "cc27f664ffd61a7437601f51178def1b", "score": "0.49836406", "text": "def name=(val)\n @name = val\n end", "title": "" }, { "docid": "cc27f664ffd61a7437601f51178def1b", "score": "0.49836406", "text": "def name=(val)\n @name = val\n end", "title": "" }, { "docid": "cc27f664ffd61a7437601f51178def1b", "score": "0.49836406", "text": "def name=(val)\n @name = val\n end", "title": "" }, { "docid": "cc27f664ffd61a7437601f51178def1b", "score": "0.49836406", "text": "def name=(val)\n @name = val\n end", "title": "" }, { "docid": "cc27f664ffd61a7437601f51178def1b", "score": "0.49836406", "text": "def name=(val)\n @name = val\n end", "title": "" }, { "docid": "cc27f664ffd61a7437601f51178def1b", "score": "0.49836406", "text": "def name=(val)\n @name = val\n end", "title": "" }, { "docid": "2c87f716ceb31d3227ff713d292f2ed3", "score": "0.49790388", "text": "def make_variable_name\n variable_name = \"\"\n case rand(3)\n when 0\n variable_name += \"@\"\n when 1\n variable_name += \"@@\"\n when 2\n end\n variable_name += \"_\"\n return variable_name\n end", "title": "" }, { "docid": "2b8a43e840ff160705c3f6cb59fe9962", "score": "0.49787733", "text": "def rename_name(old_name, new_name)\n item = get_name_object(old_name)\n item.Name = new_name\n rescue RobustExcelOle::NameNotFound\n raise\n rescue WIN32OLERuntimeError, Java::OrgRacobCom::ComFailException => msg\n raise UnexpectedREOError, \"name error with name #{old_name.inspect} in #{File.basename(self.stored_filename).inspect}\\n#{$!.message}\"\n end", "title": "" }, { "docid": "d56c9b12e16a056400822e5e5e2d21f4", "score": "0.49780685", "text": "def Createuniquename()\n o = [('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten;\n string = (0..12).map{ o[rand(o.length)] }.join;\n name = string\n return name\nend", "title": "" }, { "docid": "cd91ba31bf08eb7aa1e9dc95b3673aee", "score": "0.4968283", "text": "def name(val = nil)\n @name = val unless val.nil?\n @name\n end", "title": "" }, { "docid": "56760d4a836bbc00adc39ec4a4741f79", "score": "0.49654916", "text": "def generate_name_ui\n generate_name(NAMES1,NAMES2,NAMES3)\n end", "title": "" }, { "docid": "56760d4a836bbc00adc39ec4a4741f79", "score": "0.49654916", "text": "def generate_name_ui\n generate_name(NAMES1,NAMES2,NAMES3)\n end", "title": "" }, { "docid": "5aecc160a636f05967dbc34a148e3445", "score": "0.4960357", "text": "def const_name\n components = name.gsub(/\\W/,' ').split.collect {|word| word.strip.upcase }\n components.join '_'\n end", "title": "" }, { "docid": "5aecc160a636f05967dbc34a148e3445", "score": "0.4960357", "text": "def const_name\n components = name.gsub(/\\W/,' ').split.collect {|word| word.strip.upcase }\n components.join '_'\n end", "title": "" }, { "docid": "424781bb3ffec7abbd62e9e5247d8df3", "score": "0.49563655", "text": "def name(new_name = nil)\n @name = new_name.to_sym if new_name\n @name\n end", "title": "" }, { "docid": "b5b1b5d324611c7ba3119d3330c0fa69", "score": "0.4949236", "text": "def generate_unique_name(string)\n cube_name = @raw_cell_set.meta_data.cube.name\n dimension_hierarchy_regexp = /\\[([^\\]]+)\\.([^\\]]+)\\]/\n formatted_string = string.\n gsub(dimension_hierarchy_regexp, '[\\1].[\\2]').\n gsub(/\\[Measures\\]\\.\\[Measures\\]/, '[Measures]').\n gsub(/\\.\\[MeasuresLevel\\]/, '')\n\n \"[#{cube_name}].#{formatted_string}\"\n end", "title": "" }, { "docid": "9a6b6544680425dd166657b2f5004742", "score": "0.49440083", "text": "def set_name(name)\n end", "title": "" } ]
88669a2b058f289f33ec49ab43b27c73
This Object hast the following connections All of the comments on this photo. Permissions: any valid access_token or user_photos or friend_photos or user_photo_video_tags or friends_photo_video_tags Returns: array of objects containing id, from, message and created_time fields.
[ { "docid": "082b1046d5a03a9417576b5202a8f107", "score": "0.62723804", "text": "def comments( params={} )\n comments = get_connections(\"comments\", params)\n return map_connections comments, :to => Facebook::Graph::Comment\n end", "title": "" } ]
[ { "docid": "2e2328c25057b25191a786896bf8aa3d", "score": "0.6836377", "text": "def comments\n # Hashie array accessed with data attribute\n if @photo.comments\n @comments ||= @photo.comments.data.map {|c| ObjectComment.new(c) }\n end\n end", "title": "" }, { "docid": "9b11b34833df72e7969412e55a4d3cd1", "score": "0.6593991", "text": "def comments\n sql = \"SELECT * FROM comments WHERE comments.photo_id = #{id};\"\n return Comment.map_items(sql)\n end", "title": "" }, { "docid": "28aff302137efcc2e474bb77c2884a63", "score": "0.6495418", "text": "def comments\n graph = Koala::Facebook::GraphAPI.new\n\n if fb_comments = graph.get_comments_for_urls([permalink])\n return fb_comments[permalink][\"data\"].map {|c| {:message => c[\"message\"], :comment_date => c[\"created_time\"], :commenter => c[\"from\"][\"name\"]} }\n else\n return []\n end\n end", "title": "" }, { "docid": "b76f0a804160e4f4d568733673de63ba", "score": "0.63371426", "text": "def messages(options = {})\n messages = self.connection(:comments, options)\n messages.map! do |message|\n Message.new(message[:id], message.merge(\n :access_token => options[:access_token] || self.access_token\n ))\n end\n end", "title": "" }, { "docid": "2e65d4e6ff1155e4d658ced84aacf1f6", "score": "0.62825483", "text": "def comments\n @comments = Dropio::Client.instance.find_comments(self) if @comments.nil?\n @comments ||= []\n end", "title": "" }, { "docid": "81f81b2dbff1102b14688bae04620f2b", "score": "0.6251725", "text": "def comments\n @comments = Resource.client.comments(self) if @comments.nil?\n @comments ||= []\n end", "title": "" }, { "docid": "289852519901dff9d449ca164868d004", "score": "0.6098857", "text": "def contactsPhotos\n @client.photos_getContactsPublicPhotos('user_id'=>@id)['photos']['photo'].collect { |photo| Photo.new(photo['id']) }\n # or\n #@client.photos_getContactsPhotos['photos']['photo'].collect { |photo| Photo.new(photo['id']) }\n end", "title": "" }, { "docid": "d551b8c5eb9ea400305c263849735a5c", "score": "0.60398996", "text": "def list_comments\n GooglePlus::Comment.for_activity(id) \n end", "title": "" }, { "docid": "7f0752fdf210fd318dc721815d61fb6a", "score": "0.5926171", "text": "def replies\n comments.map { |comment| comment.comments }.flatten\n end", "title": "" }, { "docid": "e4d0cab6c0a3320f6f3ced86e80bb9e1", "score": "0.59103495", "text": "def comments\n render :json => Photo.find(params[:id]).comments.map(&:attributes_for_app)\n end", "title": "" }, { "docid": "2407b02c458a19015c28f8d76e2f68f2", "score": "0.5892357", "text": "def comments\n cached = Comment.list_cache\n comments = cached.select{|c|c.reply_to == id}\n comments\n end", "title": "" }, { "docid": "2246e560ff9376ec5e224c15cdc1bd05", "score": "0.58576167", "text": "def get_recent_comments_for_photo(album_id, photo_id)\n url = \"https://picasaweb.google.com/data/feed/api/user/default/albumid/#{album_id}/photoid/#{photo_id}\"\n params = 'kind=comment'\n\n response = http_request(:get, url, params, default_headers)\n\n if response.code =~ /20[01]/\n comments_list response.body\n else\n raise Picasa::PicasaAuthorisationRequiredError, \"The request for get comment of photo has failed. (#{scan_body_for_errors(response.body).to_sentence})\"\n end\n end", "title": "" }, { "docid": "8c8ae47712d291884a14129e0ec81985", "score": "0.5843734", "text": "def photos\n photo_arr = Photo.photos.select {|photo| photo.user == self}\n photo_arr\n end", "title": "" }, { "docid": "80d8f9ddfcf0455d42a116da7aa29d29", "score": "0.5826618", "text": "def photos( params={} )\n photos = get_connections(\"photos\", params)\n return map_connections photos, :to => Facebook::Graph::Photo\n end", "title": "" }, { "docid": "80d8f9ddfcf0455d42a116da7aa29d29", "score": "0.5826618", "text": "def photos( params={} )\n photos = get_connections(\"photos\", params)\n return map_connections photos, :to => Facebook::Graph::Photo\n end", "title": "" }, { "docid": "80d8f9ddfcf0455d42a116da7aa29d29", "score": "0.5826618", "text": "def photos( params={} )\n photos = get_connections(\"photos\", params)\n return map_connections photos, :to => Facebook::Graph::Photo\n end", "title": "" }, { "docid": "7be0f705974a18b6452cbef01917055c", "score": "0.5803288", "text": "def list_comments\n list_comments = Comment.where(parent_id: self.id)\n return list_comments\n end", "title": "" }, { "docid": "bbadf714fc9bf0e6e354b2ab66717703", "score": "0.57924736", "text": "def comment_ids\n self.comments.pluck(:id)\n end", "title": "" }, { "docid": "1f2d43bbfbded1071a80d3eaca35a4a5", "score": "0.57678044", "text": "def details_comments\n arr = ['comments:']\n @comments.each do |ctx, h|\n arr << \"\\tcontext: #{ctx.to_s}\"\n h.each { |auth, cmt| arr << \"\\t\\t#{cmt.to_s}\" }\n end\n arr\n end", "title": "" }, { "docid": "4bc3d355b567f4c910e33a8e5a32389d", "score": "0.5766487", "text": "def all_comments\n\n # Build an array of all object IDs related to, and including, this\n # organization.\n object_ids = ([id] + [commentable_object_ids]).flatten.compact.uniq\n\n # Return all matching comments.\n Comment.where(instance_id: instance.id).any_in(commentable_id: object_ids)\n\n end", "title": "" }, { "docid": "d27fcf1de810f01ec54dff0370cd7336", "score": "0.57638025", "text": "def comments\n find_comments.map { |c| Comment.new c.attributes }\n end", "title": "" }, { "docid": "4e6ffa6ee8c0e477f28485675c6c71e0", "score": "0.57601494", "text": "def media_comments(media_id)\n redis_key = media_comments_redis_key(media_id)\n results = @redis.get(redis_key)\n\n if !results\n results = []\n\n response = @client.media_comments(media_id)\n results = results + response\n\n while response.pagination && response.pagination.next_cursor && users.count < settings.media_likes_max\n response = @client.media_comments(media_id, {:cursor => response.pagination.next_cursor})\n results = results + response\n end\n\n results = results.to_json\n\n @redis.setex(redis_key, (60*60), results)\n end\n\n results = JSON.parse(results)\n\n results\n end", "title": "" }, { "docid": "b73ec9c1ccaf2f65e5a8858181f803f8", "score": "0.57571995", "text": "def comments( photo )\n \n open( 'http://www.flickr.com/services/rest/?method=flickr.photos.comments.getList&api_key=' + @api_key +'&photo_id=' + photo.flickr_id ) do | f |\n doc = REXML::Document.new f.read\n\n doc.elements.each( \"rsp/comments/comment\" ) do | comment_element |\n if( !Comment.exists?( :flickr_id => comment_element.attributes[ 'id' ] ) ) \n photo.comments.build(\n :flickr_id => comment_element.attributes[ 'id' ],\n :author => comment_element.attributes[ 'author' ],\n :author_name => comment_element.attributes[ 'authorname' ],\n :permalink => comment_element.attributes[ 'permalink' ],\n :text => comment_element.text) \n end\n end\n end\n \n end", "title": "" }, { "docid": "5ce8e324724b7082ad98833862dc6d78", "score": "0.5699886", "text": "def comments\n activities_as_owner.where(:trackable_type=>\"Comment\").select(\"DISTINCT ON (trackable_id) *\")\n end", "title": "" }, { "docid": "3d05467ffa69b1388df0cd894b52b51d", "score": "0.56579465", "text": "def recursive_comments\r\n child_comments = self.comments.all.map { |comment| comment.recursive_comments }\r\n [self, child_comments]\r\n end", "title": "" }, { "docid": "2f8a42c13db7dceb6bbddaf83f8f19a0", "score": "0.563198", "text": "def own_photos\n return Photo.where({:owner_id => self.id})\n end", "title": "" }, { "docid": "675aac013d3dd94d283bc36897297fc2", "score": "0.5620156", "text": "def viewComments(options = {})\n arguments = [self.fullID]\n cmdOptions = {}\n\n if @account\n cmdOptions[\"-T\"] = @account.token\n end\n\n # If the backend should return a single comment (still an array).\n if options[:only_matching]\n cmdOptions[\"--only-matching\"] = true\n end\n\n # We are pulling comments specifically in reply to the given comment\n if options[:inReplyTo]\n cmdOptions[\"--reply-to\"] = options[:inReplyTo]\n end\n\n # We are pulling comments for the given identifier\n if options[:id]\n arguments << options[:id]\n\n # Also pull parent comments\n cmdOptions[\"-c\"] = true\n end\n\n # Give all comments for this object.\n if options[:all]\n cmdOptions[\"-a\"] = true\n end\n\n # Further limit comments to those made after a certain date.\n if options[:since]\n cmdOptions[\"-s\"] = options[:since]\n end\n\n result = Occam::Worker.perform(\"social\", \"comment-list\", arguments, cmdOptions)\n comments = JSON.parse(result[:data], :symbolize_names => true)\n\n commentMap = {}\n\n ret = []\n comments.map do |item|\n # Ensure replies is at least an empty array\n item[:replies] ||= []\n\n if commentMap.has_key? item[:id]\n item[:replies] = commentMap[item[:id]][:replies]\n end\n commentMap[item[:id]] = item\n\n if (not options[:only_matching]) && item[:inReplyTo] && (options[:inReplyTo].nil? || item[:inReplyTo] != options[:inReplyTo])\n commentMap[item[:inReplyTo]] ||= {}\n commentMap[item[:inReplyTo]][:replies] ||= []\n commentMap[item[:inReplyTo]][:replies] << item\n else\n ret << item\n end\n\n if not options[:simple]\n begin\n item[:person].delete(:revision)\n item[:person][:ownerInfo] = item[:person]\n item[:person][:info] = item[:person]\n item[:person][:account] = @account\n item[:person] = Occam::Person.new(item[:person])\n rescue\n item.delete :person\n end\n end\n\n item\n end\n\n ret\n rescue\n []\n end", "title": "" }, { "docid": "fc7e7322700867e3aa282c7f238fe3df", "score": "0.56044734", "text": "def get_comments\n @client.get_photo_comments(flickr_photo_id) do |c|\n comment = comments.find_or_initialize_by_flickr_comment_id(c[:flickr_comment_id])\n comment.update_attributes(c)\n end\n end", "title": "" }, { "docid": "7f6dcb8608b79e408146e1c910b32b9e", "score": "0.5602049", "text": "def commented_on_by_ids\n object.available_comments.map(&:created_by_id)\n end", "title": "" }, { "docid": "27cde89c487500746fe07b61df27c0db", "score": "0.56009257", "text": "def comment\n photo = Photo.find(params[:id])\n photo.comments << Comment.new(:user_id => current_user_id, :body => params[:body]) \n render :json => photo.comments.map(&:attributes_for_app)\n end", "title": "" }, { "docid": "3a7626df7eb93d48ef273fbc068e992f", "score": "0.55975395", "text": "def comments\n return @comments\n end", "title": "" }, { "docid": "3a7626df7eb93d48ef273fbc068e992f", "score": "0.55975395", "text": "def comments\n return @comments\n end", "title": "" }, { "docid": "3a7626df7eb93d48ef273fbc068e992f", "score": "0.55975395", "text": "def comments\n return @comments\n end", "title": "" }, { "docid": "3a7626df7eb93d48ef273fbc068e992f", "score": "0.55975395", "text": "def comments\n return @comments\n end", "title": "" }, { "docid": "3a7626df7eb93d48ef273fbc068e992f", "score": "0.55975395", "text": "def comments\n return @comments\n end", "title": "" }, { "docid": "f06c1a2b1d5b7a6cbc4562bd7c563c3c", "score": "0.55834174", "text": "def retrieve\n messages =\n @redd.subreddit_from_name(@subreddit)\n .get_comments(limit: RETRIEVAL_COUNT)\n messages.map do |m|\n TaggedData.new(m.name, Models::Comment.from_data(m))\n end\n end", "title": "" }, { "docid": "1216282b0fa75e1635fb88b20d16efae", "score": "0.5577236", "text": "def friend_photos\n Photo.where(owner_user_id: friend_ids)\n end", "title": "" }, { "docid": "2292ddc03870600a53d37c187e6f4618", "score": "0.5574363", "text": "def contactsPhotos\n @client.photos_request('photos.getContactsPublicPhotos', 'user_id' => @id)\n end", "title": "" }, { "docid": "41c2ab17d9e86d0383e4bd66eb615802", "score": "0.55600464", "text": "def commentsIds\n self.comments.map{|comment| comment.id }\n end", "title": "" }, { "docid": "06a1847c6aa654ec5435a9d5f56256d6", "score": "0.55529654", "text": "def comments\n find_all { |child| child.kind_of? Comment }.freeze\n end", "title": "" }, { "docid": "e10b830a0e846fc770937e26c4a1dce5", "score": "0.55374634", "text": "def comments\n response[\"comments\"]\n end", "title": "" }, { "docid": "6ca00ad929e59ab0a73f0eb0798677a0", "score": "0.5523069", "text": "def comments\n @all_comments\n end", "title": "" }, { "docid": "7aa0b36ae8048e4f5e8152337f7d90e8", "score": "0.551684", "text": "def index\n @api_v1_group_message_comments = Api::V1::GroupMessageComment.all\n end", "title": "" }, { "docid": "2fb92be9364f1dcb2d08d9195391f500", "score": "0.5505886", "text": "def comments\n Comment.all\n end", "title": "" }, { "docid": "45a651e7ee03864fbf77b605700b9e54", "score": "0.54993856", "text": "def comments\n @comments ||= self.responses.collect(&:comments).compact\n end", "title": "" }, { "docid": "9193ba2432ca00103fdacae4f70791d2", "score": "0.5498335", "text": "def comments\n @data['comments']\n end", "title": "" }, { "docid": "a47a21c84273b825f6c8e4d9df5170b0", "score": "0.5488535", "text": "def all_messages\n Message.where(\"(owner_user_id = ?) OR ((from_user_id = ?) AND (copied_message_id IS NULL))\", self.id, self.id)\n end", "title": "" }, { "docid": "64a5c18dff1535562ce30f8e46734522", "score": "0.5484002", "text": "def retrieve\n messages =\n @redd.get_comments(@subreddit, limit: RETRIEVAL_COUNT)\n messages.map do |m|\n TaggedData.new(m.name, m)\n end\n end", "title": "" }, { "docid": "3d88249e2d16dd5aa1ed3fe94774fdef", "score": "0.5469805", "text": "def comments\n request_str = \"/gallery/appliances/#{id.to_i}/comments\"\n response = GenericRequest.new(self.class.studio_connection).get request_str\n tree = XmlSimple.xml_in response, \"ForceArray\" => [\"comment\"]\n tree[\"appliance\"][\"comments\"][\"comment\"].collect do |c|\n Comment.parse(self,c)\n end\n end", "title": "" }, { "docid": "b13746dc7d6c97ea5f2ec76812db66bd", "score": "0.5463636", "text": "def collect\r\n collected_comments = Array.new\r\n collected_comments.push(self)\r\n\r\n @comments.each{ |comment| comment.collect.each { |inner_comment| collected_comments.push(inner_comment) } }\r\n\r\n collected_comments\r\n end", "title": "" }, { "docid": "e10c51651701d7c0daa3be4825421aee", "score": "0.5459068", "text": "def get_user_connections\n response = request(\n :users_me_connections, nil,\n :get,\n \"users/@me/connections\"\n )\n Rapture::User::Connection.from_json_array(response.body)\n end", "title": "" }, { "docid": "9aba668832b2bd39493f7f71e53fda97", "score": "0.5456247", "text": "def get_pin_comments\n\t\t\tallC = []\n\t\t\tComment.all.each do |c|\n\t\t\t\tif c.pin_id == params[:pin_id].to_i \n\t\t\t\t\tcO = {\n\t\t\t\t\t\tuser: User.find(c.user_id).name,\n\t\t\t\t\t\tbody: c.comment\n\t\t\t\t\t}\n \tallC << cO\n\t\t\t\tend\n end\n\t\t\tallC\n\t\tend", "title": "" }, { "docid": "065e73c9697c1caea7e97f8ffe203cd5", "score": "0.5453505", "text": "def get_replies\n Comment.where(parent_id: self.to_param)\n end", "title": "" }, { "docid": "ac310d7a77e3204c45788c01f56d3cf9", "score": "0.54484373", "text": "def full_comments\n client.get(\"/checkin/#{id}/comments\")[\"comments\"]\n end", "title": "" }, { "docid": "dd4fa6d35927d9baffacdf1e057952d9", "score": "0.54367983", "text": "def comments\n @@comment_list\n end", "title": "" }, { "docid": "529600bea3184fff1a5ea79a8a4a2ed0", "score": "0.5433332", "text": "def comments\n\n @comment_list\n\n end", "title": "" }, { "docid": "242736ad61264bd6417f468078c45bbd", "score": "0.54265606", "text": "def chat_conversations; JSON[Api::get_chat_conversations(self)]; end", "title": "" }, { "docid": "7e90bbf3a0f29d8da78cf58072de64e5", "score": "0.5423122", "text": "def all_comments\n @comments = @article.comments\n end", "title": "" }, { "docid": "2c52db254b4dee3fe32fdf2c865fb10f", "score": "0.5416766", "text": "def comments\n current_user.comments\n end", "title": "" }, { "docid": "fd22813cfccfa7cd094738161ad91f6f", "score": "0.54118884", "text": "def collect\r\n collected_comments = Array.new\r\n collected_comments.push(self)\r\n\r\n @comments.each{ |comment| comment.collect.each { |inner_comment| collected_comments.push(inner_comment) } }\r\n\r\n collected_comments\r\n end", "title": "" }, { "docid": "4447c95fefbb72f8a378ce8a783a58da", "score": "0.54118836", "text": "def comments\n Sifter.\n get(api_comments_url).\n fetch(\"comments\", []).\n map { |i| Sifter::Comment.new(i) }\n end", "title": "" }, { "docid": "b218f8fbb2e6c7209bd1e97db2277b4b", "score": "0.5406778", "text": "def posts_of_all_connections(ids)\n if !@connections_posts \n @connections_posts = Post.where(user_id: ids)\n end\n @connections_posts\n end", "title": "" }, { "docid": "532f46d7fa5c4cd5615b9c1675778b9c", "score": "0.53883404", "text": "def get_all_comments()\n listing = @reddit.get_comments(subreddit: 'baseball', limit: 100, depth: 1000, sort: 'new')\n comments = Array.new()\n\n temp = listing['data']['children']\n traverse_comments temp, comments\n\n comments\n end", "title": "" }, { "docid": "016b301c185409ee38b75f2401d591f7", "score": "0.53874815", "text": "def messages\n Ahoy::Messages.by_user_id.key(self._id)\n end", "title": "" }, { "docid": "523002a59c0d2e29439855cf47ca0059", "score": "0.5378296", "text": "def conversations\n return @conversations\n end", "title": "" }, { "docid": "08034f20c2a5a14dfe4e18673a1d7947", "score": "0.53761786", "text": "def commentable_object_ids\n []\n end", "title": "" }, { "docid": "d5dfdda3d49d314a63b20197dc067bb8", "score": "0.53732735", "text": "def comments(params = {})\n if @comments.any?\n @comments\n else\n @comments = Endpoints::Comments.new(client).get(project_id, id, params)\n end\n end", "title": "" }, { "docid": "9a6a77f43804c2badc7ae8d583e4a625", "score": "0.5372324", "text": "def pictures\n fb = fbobject\n @photos = []\n @myphotos = fb.get_connections(\"me\", \"photos\")\n @fbfriends = fb.get_connections(\"me\", \"friends\", :fields => \"id,name,gender,relationship_status,first_name,last_name,picture\")\n i = 0\n @fbfriends.each do |friend|\n #friends_friends = fb.get_connections(friend['id'], \"friends\", :fields => \"id,name,gender,relationship_status,first_name,last_name,picture\")\n friendsphotos = fb.get_connections(friend['id'], \"photos\")\n @photos << friendsphotos\n i = i + 1\n if i > 10\n break\n end\n end\n\n p = @photos\n end", "title": "" }, { "docid": "3f9fc0cfc5a38476b1c34dcdefc0198b", "score": "0.537115", "text": "def conversations\n conversations = Conversation.where(\"sender_id = ? OR recipient_id = ?\", self, self)\n return conversations\n end", "title": "" }, { "docid": "4c54c5d7fc2dd8efd260e6c5f554dc5b", "score": "0.5366526", "text": "def followed_comments\n activities_as_recipient.comments.where(:primary=>false)\n end", "title": "" }, { "docid": "dd6fd70e45b8d4d60540fbb18ef5d7b2", "score": "0.5364827", "text": "def all_connections\n @connections\n end", "title": "" }, { "docid": "6ebd3c1afe3a4b285d0dbcb60d76cabc", "score": "0.53613967", "text": "def get_notifications\n Comment.where(:commentable_id => self.id, :commentable_type => \"Notification\")\n end", "title": "" }, { "docid": "3ed24ed29dd416b0d0206f64f2311e70", "score": "0.53577274", "text": "def connections\n response = Discordrb::API::User.connections(@token)\n JSON.parse(response).map { |e| Connection.new(e, self) }\n end", "title": "" }, { "docid": "a9aa9f679f8e3389d5af3134fc6792f7", "score": "0.5345255", "text": "def comments\n contents.all\n end", "title": "" }, { "docid": "96edafa948622c6dc3021838cd9c8ed4", "score": "0.53386915", "text": "def get_photos\n facebook_id = @user.uid\n photo_json_url = \"https://graph.facebook.com/v2.3/#{facebook_id}/photos\"\n photo_json = JSON.load(open(photo_json_url))\n end", "title": "" }, { "docid": "f4f3f70b465c18f47fe04fb0f9019525", "score": "0.5326763", "text": "def photos\n @delegated_to_object\n end", "title": "" }, { "docid": "3308e6f57be89dc7809dbc4df266e544", "score": "0.5318163", "text": "def comment_info\n {\n :id => self.id,\n :user => self.user.json_hash_no_token,\n :dinner_id => self.dinner_id,\n :content => self.content\n }\n end", "title": "" }, { "docid": "030ce53d37e636d1c8f7a521decbdc68", "score": "0.5314718", "text": "def all_connections_ids\n if !@all_connections_ids\n @all_connections_ids = []\n all_connections.each do |key, ids|\n @all_connections_ids += ids\n end\n end\n @all_connections_ids\n end", "title": "" }, { "docid": "282aee96dd8d01cd750fea8f72c5ede4", "score": "0.53092307", "text": "def comments\n Comment.where(user_id: self.id).order(\"created_at DESC\")\n end", "title": "" }, { "docid": "7d83652adc87c911976a8ce611efe5f6", "score": "0.53075045", "text": "def get_replies(comment)\n replies = comment.attributes[:replies]\n return [] unless replies.is_a?(Hash) && replies.key?(:kind)\n object_from_body(replies)\n end", "title": "" }, { "docid": "31f0c33a3da1003652f6bc1a17bacb9b", "score": "0.5303537", "text": "def files_and_comments\n [self.file_attachments, self.comments]\n end", "title": "" }, { "docid": "c943e99c5eb64182b6dd23eda269c009", "score": "0.53028804", "text": "def contacts\n messages = messages_in + messages_out\n messages.sort_by(&:created_at)\n\n contacts = []\n\n messages.each do |message|\n if !contacts.include?(message.sender) && message.sender != self\n contacts << message.sender\n end\n if !contacts.include?(message.receiver) && message.receiver != self\n contacts << message.receiver\n end\n end\n\n contacts\n end", "title": "" }, { "docid": "167941a52132722255c87f21b73ed5c7", "score": "0.5301542", "text": "def direct_messages\n client.ims&.keys || []\n end", "title": "" }, { "docid": "e1d2d068f2259b01c6d3cc326deffc4d", "score": "0.5300253", "text": "def comments\n @comments ||= Comment.filter(:post_id => id, :deleted => false).order(:created_at)\n end", "title": "" }, { "docid": "d7f134eb144953de7e0b87ee6e8b863e", "score": "0.52958316", "text": "def comments\n children.includes(:activity_objects).where('activity_objects.object_type' => \"Comment\")\n end", "title": "" }, { "docid": "d7f134eb144953de7e0b87ee6e8b863e", "score": "0.52958316", "text": "def comments\n children.includes(:activity_objects).where('activity_objects.object_type' => \"Comment\")\n end", "title": "" }, { "docid": "d7f134eb144953de7e0b87ee6e8b863e", "score": "0.52958316", "text": "def comments\n children.includes(:activity_objects).where('activity_objects.object_type' => \"Comment\")\n end", "title": "" }, { "docid": "c65fb7aedeaa46705c1d3f7819ebe324", "score": "0.5294232", "text": "def messages\n\t\tMessage.with(self.id)\n\tend", "title": "" }, { "docid": "964b788021870871375a55aee6cc6a4c", "score": "0.5294166", "text": "def comments\n comments = Comment.from_response client.get(\"/cards/#{id}/actions\", filter: \"commentCard\")\n end", "title": "" }, { "docid": "0b37a96db6994078bb58d8960f0116f0", "score": "0.52935123", "text": "def get_replies\n respond_to do |format|\n format.json { render json: Photo.find_all_by_recipient_id(params[:user_id]).map{|p| {id: p.id, user_id: p.user_id, updated_at: p.updated_at} } }\n end\n end", "title": "" }, { "docid": "de993c94a4667c7da274556fb98dbb18", "score": "0.52849525", "text": "def comments(media_id)\n get(\"/media/#{media_id}/comments\")\n end", "title": "" }, { "docid": "3c746f1533412f127ac32e10245b5764", "score": "0.52829295", "text": "def conversations\n # GET /messages\n # Array of MessageRef objects but due to GROUP BY they only have attributes otherparty_id, newest_message_date, cnt, unseen_cnt.\n # sent_anything is boolean and says whether any message ref exists that is sent to otherparty. This info is used when showing whether recipient has seen messages.\n @conversations = MessageRef.select(\"otherparty_id, max(created_at) newest_message_date, count(1) as cnt, sum(unseen) as unseen_cnt, bool_or(direction = 'sent') sent_anything\").\n group('otherparty_id').\n where(user: current_user).\n order('unseen_cnt desc, newest_message_date desc') # Primary sort groups with unread messages so they appear at top.\n end", "title": "" }, { "docid": "7526ba90280a2cbe634196c77f78e2ca", "score": "0.5279721", "text": "def getComments\n\t\treturn Comment.find(:all, :conditions => {:code_id => self.id})\n\tend", "title": "" }, { "docid": "1ec2b76455a32ba7781a37a96a01c76f", "score": "0.5271529", "text": "def conversation_list\n Conversation.user_conversation(self.id)\n end", "title": "" }, { "docid": "ebcefe187f07105bed2dd7647ee805d0", "score": "0.52577025", "text": "def photos\n return @photos\n end", "title": "" }, { "docid": "ebcefe187f07105bed2dd7647ee805d0", "score": "0.52577025", "text": "def photos\n return @photos\n end", "title": "" }, { "docid": "874d413a031e68e2a5018c11847229f4", "score": "0.5253956", "text": "def comments\n self.chapters.collect { |c| c.comments }.flatten\n end", "title": "" } ]
d4a212f0fcfa2aaae7f7b0759160deaf
Calculate volume for the 3D mesh using Tetrahedron volume
[ { "docid": "8fa06e3c09b5ba34f4a838d6a0ef988e", "score": "0.64826584", "text": "def signedVolumeOfTriangle(p1, p2, p3)\n v321 = p3[0]*p2[1]*p1[2]\n v231 = p2[0]*p3[1]*p1[2]\n v312 = p3[0]*p1[1]*p2[2]\n v132 = p1[0]*p3[1]*p2[2]\n v213 = p2[0]*p1[1]*p3[2]\n v123 = p1[0]*p2[1]*p3[2]\n return (1.0/6.0)*(-v321 + v231 + v312 - v132 - v213 + v123)\n end", "title": "" } ]
[ { "docid": "7d35ece8a24ade7fd3dfc9773d040fb4", "score": "0.7062643", "text": "def volume\n a, b, c, d = @points\n ((a - d) % ((b - d) * (c - d))) / 6\n end", "title": "" }, { "docid": "a3d9c355655eb449b182e3279c1e2018", "score": "0.68935907", "text": "def volume\n return (4.0/3.0) * Math::PI * self.radius**3\n end", "title": "" }, { "docid": "3487439fd4975e3dd8771a1b2488e51a", "score": "0.68512315", "text": "def hollow_cube_volume(length_inner,length_outer)\n\n volume_cube(lentgh_outer)-volume_cube(length_outer)\n \n end", "title": "" }, { "docid": "8888b833d356344b7841a3f32e9c9e5b", "score": "0.6811947", "text": "def volume\n return nil if dimension_u.nil? || dimension_v.nil? || dimension_w.nil?\n (dimension_u * dimension_v * dimension_w) / 1_000_000_000.0\n end", "title": "" }, { "docid": "ef45bb7661a4c4c5db440c92b0fe8e17", "score": "0.6716842", "text": "def volume_ft3\n self.volume\n end", "title": "" }, { "docid": "dec97fb7e82d07bcb7ee0afdf24651a4", "score": "0.67039424", "text": "def volume\n return @width * @height / @depth\n end", "title": "" }, { "docid": "f3a4ab6d8c3affe2e65aded9efa5e753", "score": "0.67008746", "text": "def volume_m3\n ft3_to_m3(self.volume)\n end", "title": "" }, { "docid": "f284f27b566b2cdb8261e4eecdbaaa92", "score": "0.6647998", "text": "def volume_of_cube(side_length)\n volume = side_length **3\n #return volume\nend", "title": "" }, { "docid": "a64452ccfcb75144dedc3af72563dc5a", "score": "0.6631968", "text": "def volumeOfSphere( r )\n return (4.0/3.0) * Math::PI * (r**3)\nend", "title": "" }, { "docid": "c4d4184fd485d9f6b12ec2b8d39e1664", "score": "0.6604217", "text": "def volume_of_cube(side_length)\n return (side_length ** 3)\nend", "title": "" }, { "docid": "b07d127091f915d09e3dc3b0005fb0e6", "score": "0.6553562", "text": "def volume_of_cube(length_of_side)\n return length_of_side ** 3\nend", "title": "" }, { "docid": "12f5f1975844aada92223ea0416d244b", "score": "0.6552376", "text": "def volume\n @length * @width * @depth\n end", "title": "" }, { "docid": "6c2ada042f91217fb47f3f3b37783750", "score": "0.65410256", "text": "def volume_of_cube(side)\n return ( side ** 3 )\nend", "title": "" }, { "docid": "dc19c89d646611e17dc544e3c2e8f72e", "score": "0.65160984", "text": "def volume_of_sphere(sphere_r)\n return (4/3) * (3.14) * (sphere_r ** 3)\n end", "title": "" }, { "docid": "4c0e9a3035e4e907fb27dd9cb0b3f80d", "score": "0.6503221", "text": "def volume_of_cube(dimension)\n return dimension**3\nend", "title": "" }, { "docid": "3984514a4b36b8df264f57bdfc1977d2", "score": "0.6500706", "text": "def get_volume\n\n # get the keyword value of \"SHAPE\"\n shape = get_keyword_value(\"SHAPE\")\n\n # if the shape value returns nil, or is defined as \"NO-SHAPE\", the volume is\n # given directly\n if ( shape == nil || shape == \"NO-SHAPE\")\n volume = get_keyword_value(\"VOLUME\")\n volume = volume.to_f\n return volume\n\n # if the shape is defined as a \"BOX\", the values for height, width, and\n # depth are given, from which you can get the volume\n elsif ( shape == \"BOX\" )\n height = get_keyword_value(\"HEIGHT\")\n width = get_keyword_value(\"WIDTH\")\n depth = get_keyword_value(\"DEPTH\")\n height = height.to_f\n width = width.to_f\n depth = depth.to_f\n return height * width * depth\n\n # if the shape is defined as a \"POLYGON\", the get_area is defined as the area\n # of the polygon, and the height is given by the value of \"HEIGHT\"\n elsif ( shape == \"POLYGON\")\n height = getKeywordvalue(\"HEIGHT\")\n temp = get_keyword_value(\"POLYGON\")\n height = height.to_f\n @polygon.utype = temp\n return @polygon.get_area * height\n else\n raise \"Error: The volume could not be evaluated. Please check inputs\\n \"\n\n end\n\n end", "title": "" }, { "docid": "6694b618151a8ff55ed4702ad4629194", "score": "0.6487178", "text": "def volume_of_cube(side_length)\n return side_length ** 3\nend", "title": "" }, { "docid": "c1d9ffde1104ee3803274eaef55ed690", "score": "0.64854926", "text": "def volume_of_cube(length_of_the_side)\nreturn length_of_the_side.to_i**3\nend", "title": "" }, { "docid": "1aa748be5f4320ac32962b2d389630ee", "score": "0.6428236", "text": "def volume_of_sphere(radius)\n return 3.14 * 4 / 3 * (radius ** 3)\n return volume\nend", "title": "" }, { "docid": "f6544675b773c403357456297f535dc7", "score": "0.6395359", "text": "def volume_of_cube(length)\n return length ** 3\nend", "title": "" }, { "docid": "20a8280f9bbbe6770e584cff6e00b06a", "score": "0.6344228", "text": "def volume_of_cube(length)\n return length **3\nend", "title": "" }, { "docid": "cb4f097a6de3bf08d1b266d13b271d2c", "score": "0.63422406", "text": "def volume_of_sphere(r)\nreturn 4/3 * 3.141592653 * ( r ** 3 )\nend", "title": "" }, { "docid": "42a407feb77e33c718146d6ec679efa0", "score": "0.63381", "text": "def volume_of_cube(length)\n return length**3\nend", "title": "" }, { "docid": "42a407feb77e33c718146d6ec679efa0", "score": "0.63381", "text": "def volume_of_cube(length)\n return length**3\nend", "title": "" }, { "docid": "32e1b42fe5ebee548911b95ae93229e3", "score": "0.6337729", "text": "def volume_of_cube(s)\n return (s ** 3)\nend", "title": "" }, { "docid": "2e690047d4bb9f075d25d275580c6a99", "score": "0.6281779", "text": "def volume_of_cube(n)\n return n * n * n\nend", "title": "" }, { "docid": "6c22230f1fd60a8d81483acc757d303f", "score": "0.6224623", "text": "def volume_of_sphere(radius_of_sphere)\nreturn (4.0/3)*Math::PI*(radius_of_sphere**3)\nend", "title": "" }, { "docid": "4af28765f4e6a0392e0900a5c36c605b", "score": "0.62207806", "text": "def volume_calculations_cube(a)\n return a ** 3\nend", "title": "" }, { "docid": "31c628652b73dd725aa687a5a8984fcd", "score": "0.61850256", "text": "def calc_sphere_volume(radius)\n answer = (4.0/3.0)*Math::PI*(radius**3)\n return answer.round(1)\nend", "title": "" }, { "docid": "de0c7288ecd720a0f4af385780be4b33", "score": "0.6131277", "text": "def volume_of_sphere(radius)\n volume = Math::PI * radius ** 3 * 4 / 3\n return volume.round(3)\nend", "title": "" }, { "docid": "14c5ebaa59781446ecb44f9c5d479035", "score": "0.6118509", "text": "def volume_of_sphere(radius)\n volume = (4.0/3.0)*3.141592654*(radius**3)\n return volume.to_i\nend", "title": "" }, { "docid": "69e681cad4f4bef8551328ef3211e055", "score": "0.61127955", "text": "def get_volume_of_cuboid(length, width, height)\n return length * width * height\nend", "title": "" }, { "docid": "977d5734981a5987163e2ac943f99202", "score": "0.61104035", "text": "def volume_of_a_cube(n)\n return n**3\nend", "title": "" }, { "docid": "b6b7b6eaa937f4fc5ad1fdc9663e34b0", "score": "0.6090317", "text": "def test_volume_of_sphere()\n first_volume = sphere_volume(1)\n second_volume = sphere_volume(3)\n third_volume = sphere_volume(5)\n assert_equal(4/3 * Math::PI * 1 ** 3, first_volume)\n assert_equal(4/3 * Math::PI * 3 ** 3, second_volume)\n assert_equal(4/3 * Math::PI * 5 ** 3, third_volume)\n end", "title": "" }, { "docid": "f46995fe5e8bf1454d79e175e1aa55f6", "score": "0.60844725", "text": "def get_volume\n return get_floor_height.to_f * get_area.to_f\n end", "title": "" }, { "docid": "a40247384b86d77c1f3a1e732d1c761d", "score": "0.6075421", "text": "def volume(x, y, z)\r\n x * y * z\r\nend", "title": "" }, { "docid": "1a26ff8ad1f201879d3aa5a9fa45c862", "score": "0.6073616", "text": "def volume_of_sphere(r)\n return (((4*(MATH::PI))/3)*r**3).round()\nend", "title": "" }, { "docid": "b5b84a7632dbf8c85f1182150e4a7833", "score": "0.60656035", "text": "def find_volume_of_cube (length, width, height, lwh)\n puts \"The volume is #{length}*#{width}*#{height}= #{lwh}\"\nend", "title": "" }, { "docid": "56901ebbe1ac758801eb68eee5d8271b", "score": "0.60122836", "text": "def volume_calc(length,width,height)\n volume = length * width * height\n end", "title": "" }, { "docid": "7c3f679ac46075b3de3fb44936821e80", "score": "0.599014", "text": "def test_volume_of_cube()\n result = volume_of_cube(5)\n assert_equal(125, result)\n end", "title": "" }, { "docid": "1cd453a2102e38a4b3a436b575a4b841", "score": "0.5958645", "text": "def volume_of_sphere(radius)\n volume = (4.0/3.0) * Math::PI * (radius ** 3)\n return volume.round(2)\nend", "title": "" }, { "docid": "b453ee5d1b1464af76a3977fce9e8356", "score": "0.5911311", "text": "def test_volume_of_sphere()\n volume = volume_of_sphere(4)\n assert_equal(267, volume) #Had to take off the decimals and then change the whole equation to \n #an integer (.to_i) to take the answers decimal places off as Ruby could not handle rounding etc.\n end", "title": "" }, { "docid": "6d4c976d1e21d8fc95937f86c657f898", "score": "0.59109294", "text": "def volume (l, w, h)\n\tl * w * h\nend", "title": "" }, { "docid": "a970dfa2c3e6bcf8f6ad91703a5f11f5", "score": "0.5910824", "text": "def cube_vol(length, dimension = 3)\n check_pre((length.nat? and dimension.int_pos?))\n length**dimension\nend", "title": "" }, { "docid": "b7647184a63838af66b114bd50526661", "score": "0.589588", "text": "def cube_vol(length)\n check_pre((length.nat?))\n length**3\nend", "title": "" }, { "docid": "3c2a6ce0f97d4a6998b78bf39f4a36c9", "score": "0.5895836", "text": "def test_volume_of_cube()\n volume = volume_of_cube(3)\n assert_equal(27, volume)\n end", "title": "" }, { "docid": "3c2a6ce0f97d4a6998b78bf39f4a36c9", "score": "0.58940256", "text": "def test_volume_of_cube()\n volume = volume_of_cube(3)\n assert_equal(27, volume)\n end", "title": "" }, { "docid": "e18183e6417f15d607d1f54eeab2d219", "score": "0.589402", "text": "def volume_of_sphere(radius)\n volume = ((Math::PI * (radius ** 3)) * 4/3).to_f\n return volume.round(2)\nend", "title": "" }, { "docid": "fcf9c25ea16acfa24d2ab5de7253ca40", "score": "0.58919847", "text": "def volume(x, y, z)\n x * y * z\nend", "title": "" }, { "docid": "c538c05bacad8483b6f08d1eaa36fbff", "score": "0.58402663", "text": "def cVolume r,l,m\n return 0 if r == 0\n z = r-m\n l*(r*r * Math.acos(z/r)-z*(2*r*m - m*m)**0.5)\nend", "title": "" }, { "docid": "f6705d1521c4cedb14dcb6d5e4b6ec46", "score": "0.58159673", "text": "def test_volume_of_cube()\n first_volume = cube_volume(1)\n second_volume = cube_volume(3)\n third_volume = cube_volume(5)\n assert_equal(1, first_volume)\n assert_equal(27, second_volume)\n assert_equal(125, third_volume)\n end", "title": "" }, { "docid": "97c9ab1d8be0cbacda4f8f22c5b0b892", "score": "0.58073413", "text": "def test_volume_of_sphere()\n volume = volume_of_sphere(3)\n assert_in_delta(113.1, volume, 0.01)\n end", "title": "" }, { "docid": "6a41e09059b7000796966b860371c8d0", "score": "0.5805779", "text": "def test_volume_of_cube()\n first_volume = volume_of_a_cube (3) \n assert_equal(27,first_volume)\n end", "title": "" }, { "docid": "a7f52b88f998f87b5176a63f75f4b0a2", "score": "0.57833904", "text": "def test_volume_of_sphere()\n sphere_volume1 = calc_sphere_volume(1)\n sphere_volume2 = calc_sphere_volume(2)\n sphere_volume3 = calc_sphere_volume(6)\n assert_equal(4.188786666666666, sphere_volume1)\n assert_equal(33.51029333333333, sphere_volume2)\n assert_equal(904.7779199999999, sphere_volume3)\n #Could also use assert_in_delta(expected,actual,delta) to allow for differences in precision so that the test doesn't have to be quite so specific with the number of dp\n end", "title": "" }, { "docid": "6c90c41811b1745166baab31054efaf2", "score": "0.57555795", "text": "def volume(options)\n options[:width] * options[:height] * options[:depth]\nend", "title": "" }, { "docid": "70266083377fde3d5396ee67d0e32361", "score": "0.5753879", "text": "def volume_of_sphere(radius)\nreturn 4 / 3 * (3.14 * radius ** 3)\n #add test code here\nend", "title": "" }, { "docid": "745b119c908af9ed59b460726d3c1aab", "score": "0.573233", "text": "def test_volume_of_sphere()\n result = volume_of_sphere(2)\n assert_equal(33,result)\n end", "title": "" }, { "docid": "2202421c1245331c244e18d9137239ff", "score": "0.57300913", "text": "def volume_of_cube(length, width, height)\nreturn length * width * height\n #add test code here\nend", "title": "" }, { "docid": "af7f706cea5252739ca2b571aad2d6ee", "score": "0.5718865", "text": "def test_volume_of_a_sphere()\n # add test code here\n result = volume_of_a_sphere(2)\n assert_equal(33.5103216, result)\n end", "title": "" }, { "docid": "27a24088a3538e1a03ed62d7b7c0b91a", "score": "0.5639646", "text": "def test_volume_of_a_cube()\n # add test code here\n result = volume_of_a_cube(2)\n assert_equal(8, result)\n end", "title": "" }, { "docid": "9924f617c998364b619bfe936664671c", "score": "0.5633945", "text": "def liquid_cube(volume_cuft, equiptype)\n return number_to_percentage(volume_cuft.to_f / Equipment.where(:equip_name => equiptype).first.cb_limit_cuft * 100, precision: 2)\n end", "title": "" }, { "docid": "599c5bf3b2fbe28d7157a3f80216ad29", "score": "0.55981714", "text": "def set_volume_cuft\n self.volume_cuft = (self.length_ins/12) * (self.width_ins/12) * (self.height_ins/12)\n end", "title": "" }, { "docid": "72caf9074dc01be46b0163637a8a7069", "score": "0.54898113", "text": "def volume \n puts \"The volume is #{@length * @width * @height}\"\n end", "title": "" }, { "docid": "21479c4abaa8387098cb501f89e95269", "score": "0.5474642", "text": "def test_volume_of_cube()\n cube_volume1 = calc_cube_volume(1,2,3)\n cube_volume2 = calc_cube_volume(2,2,2)\n cube_volume3 = calc_cube_volume(2,4,6)\n assert_equal(6, cube_volume1)\n assert_equal(8, cube_volume2)\n assert_equal(48, cube_volume3)\nend", "title": "" }, { "docid": "d9455f6ca3a60627881a87bbe257625d", "score": "0.54352415", "text": "def volume; self.class.volume; end", "title": "" }, { "docid": "b3ea90fcebc4f14b14549cf46c471827", "score": "0.5411638", "text": "def get_volume\n @volume\n end", "title": "" }, { "docid": "26fe99e5b6d5840943e1c263ee3ac15c", "score": "0.5373526", "text": "def teleported_volume_for(planet)\n where(\n :planet_id => planet.id, :state => Building::STATE_ACTIVE\n ).map(&:teleported_volume).sum\n end", "title": "" }, { "docid": "88f1697ba04adf97add94433a8bc1627", "score": "0.5285006", "text": "def volume(result)\n return result['trades']['entries'].collect do |data|\n volume = data[1].to_f\n end\n end", "title": "" }, { "docid": "26232cc0736c67c2ce3173d64cf4d355", "score": "0.5279721", "text": "def calculate_volume(units)\n units.reduce(0) do |sum, unit|\n volume = unit.volume\n raise GameLogicError.new(\"#{unit} does not have volume!\") \\\n if volume.nil?\n\n sum + volume\n end\n end", "title": "" }, { "docid": "68ec700a79c152231de32aa3fa7a223f", "score": "0.5259684", "text": "def voltdiv vin, r1, r2\n _vout = vin * (r2 / (r1 + r2))\nend", "title": "" }, { "docid": "d0c987904d0b084a68892399680408e7", "score": "0.5258221", "text": "def ensure_volume_stored_in_ft3\n if self.moving.unit == \"metric\"\n self.volume = m3_to_ft3(self.volume)\n end\n end", "title": "" }, { "docid": "207d7764c8ba6995c1a9f8344f2c0af3", "score": "0.5252944", "text": "def estimate_normal(\n p # vec3\n)\n Vec3.new(\n scene_sdf(Vec3.new(p.x + $EPSILON, p.y, p.z)) - scene_sdf(Vec3.new(p.x - $EPSILON, p.y, p.z)),\n scene_sdf(Vec3.new(p.x, p.y + $EPSILON, p.z)) - scene_sdf(Vec3.new(p.x, p.y - $EPSILON, p.z)),\n scene_sdf(Vec3.new(p.x, p.y, p.z + $EPSILON)) - scene_sdf(Vec3.new(p.x, p.y, p.z - $EPSILON))\n ).normalize\nend", "title": "" }, { "docid": "dbcfa72177050e775f88d730061716b6", "score": "0.52494293", "text": "def volume_weight(dimension: nil)\n return 0\n end", "title": "" }, { "docid": "aa7732553ed6d99c721203365100634a", "score": "0.5228437", "text": "def unit_vector\n\t\tlen = self.r\n\t\traise Vector::ZeroOperation if (len == 0)\n\t\tself * (1/len)\n\t\t# Vector3D.new(@x*(1.0/len), @y*(1.0/len), @z*(1.0/len))\n\tend", "title": "" }, { "docid": "0e0a8ded7f930a1ca4f3387d0c189a7c", "score": "0.52209073", "text": "def unit_vector\n len = self.r\n raise Vector::ZeroOperationError if (len == 0.0)\n self * (1.0/len)\n # Mageo::Vector3D.new(@x*(1.0/len), @y*(1.0/len), @z*(1.0/len))\n end", "title": "" }, { "docid": "695af29fe7e6d0889e5a93cfdb6382ab", "score": "0.52137774", "text": "def mesh_vertices\r\n # private ?\r\n d = TT::Instance.definition( @instance )\r\n transformation = @instance.model.edit_transform\r\n points = mesh_points( final_subdivs, transformation )\r\n vertices = raw_mesh_vertices()\r\n\r\n # <debug>\r\n unless points.size == vertices.size\r\n Console.log( 'mesh_vertices' )\r\n Console.log( \"> Points: #{points.size}\" )\r\n Console.log( \"> Vertices: #{vertices.size}\" )\r\n end\r\n # </debug>\r\n\r\n patch_vertices = []\r\n for point in points\r\n vertex = vertices.find { |v| v.position == point } # (!) Optimize\r\n patch_vertices << vertex\r\n vertices.delete( vertex )\r\n end\r\n patch_vertices\r\n end", "title": "" }, { "docid": "cfce2b447365333a97e721d8d7ddbc4d", "score": "0.5207088", "text": "def total_volume(order)\n volume = 0\n order.line_items.each do |line_item|\n line_item.variant.volume ? volume += (line_item.quantity * line_item.variant.volume) : 0\n end\n volume\n end", "title": "" }, { "docid": "318626cbd30da3937d81fc67e3a4587b", "score": "0.51888746", "text": "def volume; property('volume'); end", "title": "" }, { "docid": "72dd6ed1fa75f9fbe1ac8adc2a6a6b94", "score": "0.51099277", "text": "def volume\n @cr[0xe] & 0x0f\n end", "title": "" }, { "docid": "b46e9650a975f86f888797dd5a823d2d", "score": "0.5095713", "text": "def volume_calculations ops\n ops.each do |op|\n p = op.input(INPUT).item.get :passage\n op.temporary[:passage] = p + 1 if p\n op.temporary[:passage] ||= 1\n op.temporary[:req_cells] = op.required_cells\n op.temporary[:cell_vol] = (op.temporary[:req_cells] / op.input(INPUT).item.cell_density)\n op.temporary[:media_vol] = working_volume_of(op.output(OUTPUT).object_type) - op.temporary[:cell_vol] || 0.0\n op.temporary[:media_vol] = 0 if op.temporary[:media_vol] < 0\n op.temporary[:volume] = op.temporary[:cell_vol] + op.temporary[:media_vol]\n\n in_plate = op.input(INPUT).item\n from_plate_id = in_plate.get :from\n\n op.error :from_plate_id_not_defined, \":from not defined\" if from_plate_id.nil?\n from_plate = Item.find_by_id(from_plate_id)\n op.error :cannot_find_original_plate, \"Could not find original plate with id #{from_plate_id}.\" if from_plate.nil?\n op.temporary[:from_plate] = from_plate if from_plate\n end\n end", "title": "" }, { "docid": "58b35fec72ae4d123de7eb6252abebc8", "score": "0.50638145", "text": "def magnitude; Math.sqrt x*x + y*y + z*z; end", "title": "" }, { "docid": "b09272be7712e5a65e0fab4bbb3cb5bd", "score": "0.50597847", "text": "def sound_volume obj1, obj2 = @player\n ##pos = -((pos.dist(obj.pos)/3) * 0.001)+0.1\n #obj1 = -((obj1.dist(obj2.pos)/7) * 0.001)+0.1\n (obj1 = 0.1 - ((obj1.dist(obj2.pos)/7) * 0.001)) < 0 ? nil : obj1\n end", "title": "" }, { "docid": "2f78e4fcc460f17d6b45f56138cc1d9e", "score": "0.50539577", "text": "def series_volume\n end", "title": "" }, { "docid": "74153a1bd996d977a75c9c420aebee04", "score": "0.50522745", "text": "def rule3\n v = V::ZERO\n\n nearby.each do |b|\n next if self == b\n v += b.velocity\n end\n\n size = nearby.size - 1\n\n return self.velocity if size == 0\n\n v /= size unless size == 0\n\n (v - self.velocity) / 4\n end", "title": "" }, { "docid": "3616ea0e3f87826c1989a9c29bb044ab", "score": "0.5048288", "text": "def volume_weight(dimension: nil)\n factor = 5000\n volume_weight = Float((dimension.length * dimension.width * dimension.height)) / Float(factor)\n\n return volume_weight\n end", "title": "" }, { "docid": "56b7817fc0ae1447a5c4ddbb0ba96dbd", "score": "0.50423783", "text": "def volume_size\n # If not user-specified, I'm using a fudge factor of 1.5 on the volume size -- arbitrarily chosen\n @volume_size || (`du -x #{volume_to_bundle}`.split(/\\n/)[-1].split[0].to_f * 1.5 / 1024).ceil\n end", "title": "" }, { "docid": "253e9990e9b686c06c388e28c2e552bf", "score": "0.5020895", "text": "def main\n a = Triangle.new( 2, 3, 4 )\n b = Triangle.new( 4, 5, 6 )\n a.volume\n b.volume\n Triangle.total_volume\nend", "title": "" }, { "docid": "afede6eec5be065d9209b05603675545", "score": "0.50144476", "text": "def unit \n\t\t\tunitq = self.dup\n\t\t\tmagnitude = self.abs\n\t\t\tunitq[0] /= magnitude\n\t\t\tunitq[1] /= magnitude\n\t\t\tunitq[2] /= magnitude\n\t\t\tunitq[3] /= magnitude\n\t\t\treturn unitq\n\t\tend", "title": "" }, { "docid": "b15e51b1efdc10d7e0c28e17baeff4e7", "score": "0.49901283", "text": "def volume_weight(dimension: nil)\n if self.custom_volume_weight_enabled && self.volume_weight_factor\n factor = self.volume_weight_factor\n volume_weight = Float((dimension.length * dimension.width * dimension.height)) / Float(factor)\n\n return volume_weight\n else\n return 0\n end\n end", "title": "" }, { "docid": "3d11faa7e736829c70ee83921f1b72ab", "score": "0.4984378", "text": "def volume(amount: T.unsafe(nil)); end", "title": "" }, { "docid": "1fb923f6478ae6575fd235eee3807242", "score": "0.4964169", "text": "def normalize\n mag = self.magnitude\n Vector.new @x/mag, @y/mag, @z/mag\n end", "title": "" }, { "docid": "151269999414e2ac44104994cfd87202", "score": "0.4949954", "text": "def stretch(mesh, params = {})\n\traise StandardError, \":mesh is nil or not a TriMesh\" if (mesh.nil? || !(mesh.kind_of? TriMesh))\n\traise StandardError, \":axis is nil or not a Symbol\" if (params[:axis].nil? || !(params[:axis].kind_of? Symbol))\n\traise StandardError, \":axis should be :x :y or :z\" if (params[:axis] != :x) and (params[:axis] != :y) and (params[:axis] != :z)\n\traise StandardError, \":vector is not a Vector3\" if not (params[:vector].kind_of? Vector3 ) and not params[:vector].nil?\n\traise StandardError, \":factor is not a Numeric\" if not (params[:factor].is_a? Numeric ) and not params[:factor].nil?\n\traise StandardError, \":factor should not be negative\" if (params[:factor] < 0)\n\n\t#assign Values\n\taxis = params[:axis]\n\tfactor = params[:factor]\n\tvec = params[:vector].nil? ? (mesh.center) : params[:vector]\n\n\tnew_vecs = Array.new\n\tmesh = translate mesh, :vector => (vec * -1)\n\tnew_vecs = Array.new\n\tif axis == :x\n\t\tmesh.vertices.each do | v |\n\t\t\tnew_vecs << Vector3.new( (factor*v.x), v.y, v.z)\n\t\tend\n\telsif axis == :y \n\t\tmesh.vertices.each do | v |\n\t\t\tnew_vecs << Vector3.new( v.x, (factor*v.y), v.z)\n\t\tend\n\telsif axis == :z\n\t\tmesh.vertices.each do | v |\n\t\t\tnew_vecs << Vector3.new( v.x, v.y, (factor*v.z))\n\t\tend\n\tend\n\tmesh = TriMesh.new new_vecs, mesh.tri_indices\n\tmesh = translate mesh, :vector => vec\nend", "title": "" }, { "docid": "5480f3f4d5556313e5411893a3674e40", "score": "0.4942219", "text": "def test_volume_of_sphere()\n volume = volume_of_sphere(10)\n assert_equal(4188.79, volume)\nend", "title": "" }, { "docid": "1ec080097945fd5118b2ed03b7d2f48a", "score": "0.49348736", "text": "def div(rhs)\n f = 1.0 / rhs\n Normal3.new(@x * f, @y * f, @z * f)\n end", "title": "" }, { "docid": "3377032f01aeca3101930a7955e4d58e", "score": "0.4932848", "text": "def quarts\n Measurements::USVolume.new(self, :quart)\n end", "title": "" }, { "docid": "9ace7d9ddc64e783546c549f6be55ad8", "score": "0.49244645", "text": "def tetrahedron(atomids)\n if atomids.size != 4\n raise SizeError\n end\n atoms = []\n atomids.each do |atomid|\n atom = atom_by_id(atomid)\n raise AtomNotFoundError, atomid unless atom\n atoms << atom\n end\n #pp atoms\n tetra = CrystalCell::Povray::Tetrahedron.new(\n *atoms.map { |atom| atom.position.to_v3d(self.axes)},\n CrystalCell::Povray::Element.color( atoms[0].element)\n )\n tetra.to_pov\n end", "title": "" }, { "docid": "a5f03932ff09af035c0aec63c749226c", "score": "0.4918413", "text": "def magnitude\n Math.sqrt(@x ** 2 + @y ** 2 + @z ** 2)\n end", "title": "" }, { "docid": "6d53b04791f3b7c8d4b4e854b9585c3e", "score": "0.48994565", "text": "def total_volume\n quantity * Item.find(item_id).volume\n end", "title": "" }, { "docid": "8acb246959d0c3f816e929e44fa1637b", "score": "0.4887958", "text": "def volume_type\n return @volume_type\n end", "title": "" }, { "docid": "2bbce50946d0faba24ee9731fec19789", "score": "0.48656785", "text": "def pentagon_surface(in_edge_length)\n check_pre(((in_edge_length.numeric?) and (in_edge_length >= 0)))\n return ((in_edge_length ** 2) / 4.0) * CONSTANT\nend", "title": "" } ]
af630984682f1a0b5a68e6092af0d102
Update properties of this object
[ { "docid": "74696eadd54a8e02030e8c0d97842538", "score": "0.0", "text": "def update!(**args)\n @app_id = args[:app_id] if args.key?(:app_id)\n @attribution_model_settings = args[:attribution_model_settings] if args.key?(:attribution_model_settings)\n @category = args[:category] if args.key?(:category)\n @click_through_lookback_window_days = args[:click_through_lookback_window_days] if args.key?(:click_through_lookback_window_days)\n @creation_time = args[:creation_time] if args.key?(:creation_time)\n @floodlight_settings = args[:floodlight_settings] if args.key?(:floodlight_settings)\n @id = args[:id] if args.key?(:id)\n @include_in_client_account_conversions_metric = args[:include_in_client_account_conversions_metric] if args.key?(:include_in_client_account_conversions_metric)\n @include_in_conversions_metric = args[:include_in_conversions_metric] if args.key?(:include_in_conversions_metric)\n @name = args[:name] if args.key?(:name)\n @owner_customer = args[:owner_customer] if args.key?(:owner_customer)\n @primary_for_goal = args[:primary_for_goal] if args.key?(:primary_for_goal)\n @resource_name = args[:resource_name] if args.key?(:resource_name)\n @status = args[:status] if args.key?(:status)\n @type = args[:type] if args.key?(:type)\n @value_settings = args[:value_settings] if args.key?(:value_settings)\n end", "title": "" } ]
[ { "docid": "150fa2bdc1fc43d28ac45e2278a1f797", "score": "0.7012568", "text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.6918917", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.6918917", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.6918917", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.6918917", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "e72f78e0e269f94de07625d4972f0298", "score": "0.6918917", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "title": "" }, { "docid": "37ae8a386fde14c02d7021605aa72f45", "score": "0.67404634", "text": "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "title": "" }, { "docid": "10e41ec39ba2af73495ccece21c2d8a3", "score": "0.6709981", "text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "title": "" }, { "docid": "10e41ec39ba2af73495ccece21c2d8a3", "score": "0.6709981", "text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.66964126", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.66964126", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.66964126", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7", "score": "0.66964126", "text": "def update(attrs)\n super(attrs)\n end", "title": "" }, { "docid": "47bbd8b88b35da987fc3775b82211e56", "score": "0.6619218", "text": "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "title": "" }, { "docid": "769b77b7f7f9f82ae847f5968eb201dc", "score": "0.6570895", "text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "title": "" }, { "docid": "c3b6fccdeb696de5e9dbc38a9486b742", "score": "0.6539287", "text": "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "title": "" }, { "docid": "bb403006cc5423d9b1820fe684a7c5a5", "score": "0.6517026", "text": "def update\n # TODO: implement update\n end", "title": "" }, { "docid": "1ee90e4f66e82aec13076a98b288a2d1", "score": "0.63946927", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "title": "" }, { "docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5", "score": "0.63901657", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "title": "" }, { "docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5", "score": "0.63901657", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "title": "" }, { "docid": "3f85752da065340d4ca70ce879a3b23d", "score": "0.63328683", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "title": "" }, { "docid": "da63345424fc9aecef032928485bd149", "score": "0.6318612", "text": "def update\n \n end", "title": "" }, { "docid": "5a8e82caac01cee661bc875a5b0cf723", "score": "0.62846893", "text": "def refresh\n set_attributes\n end", "title": "" }, { "docid": "60d8c4f58de490a0d7cdd918c16a2cce", "score": "0.62692374", "text": "def update(attrs)\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "7a41bc9d5a07220fb8626d1fa90d2d79", "score": "0.6264273", "text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "title": "" }, { "docid": "29c22ae2290ffca9b9682a5f20f48103", "score": "0.6241163", "text": "def update_resource object, attributes\n object.update attributes\n end", "title": "" }, { "docid": "91dc386ff8fa066852510a5d62b13078", "score": "0.6216599", "text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "title": "" }, { "docid": "6249943d1eeff63f8f611fcf73254058", "score": "0.6214641", "text": "def update\n \n end", "title": "" }, { "docid": "1c12f310aca206a2cefff8c291007668", "score": "0.6210363", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "title": "" }, { "docid": "1c0316f22c6db917fa4719767b5326a9", "score": "0.6203827", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "1c0316f22c6db917fa4719767b5326a9", "score": "0.6203827", "text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "5d229ea224b1dfa7ac9ce6808ca63fc4", "score": "0.620312", "text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "title": "" }, { "docid": "85a79fb5c3cc199e689344861658b09b", "score": "0.6201905", "text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "title": "" }, { "docid": "549a7eef6c18558dea47a8e8d72df295", "score": "0.62001497", "text": "def update\n @objects.map(&:update);\n end", "title": "" }, { "docid": "e1f766468b11768b786daa133483b157", "score": "0.61728275", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "e1f766468b11768b786daa133483b157", "score": "0.61728275", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "b76d372399abbb21b748df3ae7b06470", "score": "0.6159924", "text": "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "title": "" }, { "docid": "01219537b43bd1cf8341e0f00e27d4c8", "score": "0.61569315", "text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "title": "" }, { "docid": "147d62c4df79ff1ca86cbd477112bf7f", "score": "0.61442953", "text": "def update\n end", "title": "" }, { "docid": "f3dea89f306804c3f2aa813c06584d06", "score": "0.61260897", "text": "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "title": "" }, { "docid": "44756fd86dd095556580199f7e78936f", "score": "0.6125199", "text": "def modified_properties=(value)\n @modified_properties = value\n end", "title": "" }, { "docid": "593de84fa9950baa68153e4fa9b6e17c", "score": "0.61227936", "text": "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "title": "" }, { "docid": "ea25adea5b43c27e6c84f27ad88c3d9f", "score": "0.61111224", "text": "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "title": "" }, { "docid": "147138a710a0ff53e9288ae66341894f", "score": "0.610543", "text": "def update\n\t\t\n\t\tend", "title": "" }, { "docid": "7b1d2242b1a6bd8d3cad29be97783a80", "score": "0.6102925", "text": "def set_props(props)\n @props.merge!(props)\n end", "title": "" }, { "docid": "cb2162d3a1fd3434effd12aa702f250f", "score": "0.60839343", "text": "def update() end", "title": "" }, { "docid": "231370ed2400d22825eba2b5b69e7a67", "score": "0.6083609", "text": "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "title": "" }, { "docid": "86ff97cc222b987bff78c1152a1c8ee1", "score": "0.6066973", "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": "0f6ea4c54f9bc18020c08410f67289cd", "score": "0.60602766", "text": "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "title": "" }, { "docid": "453da6bb915596261c5b82f2d17cabf8", "score": "0.6055065", "text": "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "title": "" }, { "docid": "52a81d6eb0fed16fe2a23be3d9ebc264", "score": "0.6051568", "text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "title": "" }, { "docid": "52a81d6eb0fed16fe2a23be3d9ebc264", "score": "0.6051568", "text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "title": "" }, { "docid": "874639781ed80ae451fbdd6ebbef2218", "score": "0.6042057", "text": "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "title": "" }, { "docid": "d175f5bedd91a8daf191cad42b04dc0c", "score": "0.60319084", "text": "def update_attributes(attrs)\n super({})\n end", "title": "" }, { "docid": "b8d1a7cd8f443ee5f30b5085aadff479", "score": "0.60221004", "text": "def update\n @dirty = true\n end", "title": "" }, { "docid": "d7d62f9c97f629ef8c88e56d3d1ce8ee", "score": "0.60149413", "text": "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "title": "" }, { "docid": "71750bae7e3d6bdde2b60ec30e70949a", "score": "0.5994295", "text": "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "title": "" }, { "docid": "73fe9bc31bfeeab4d84483e2fa65cbbb", "score": "0.5989816", "text": "def update\n super\n end", "title": "" }, { "docid": "a98ac99e6e5115383e9148202286ff9e", "score": "0.597674", "text": "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "title": "" }, { "docid": "fb14f35e7fab31199053a7b87ef451a4", "score": "0.5973157", "text": "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "title": "" }, { "docid": "6441b3fa93c3dfd974c66a975adb9d9c", "score": "0.5967343", "text": "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "title": "" }, { "docid": "51a59f953548d1eff10532bdffdd8df9", "score": "0.5965598", "text": "def properties=(value)\n @properties = value\n end", "title": "" }, { "docid": "e7a3d5504fcc6e382b06845ede0d5fd8", "score": "0.59629464", "text": "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "title": "" }, { "docid": "c7a2880c3da02b3708afc43c48d37f2e", "score": "0.59618354", "text": "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950329", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950329", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950329", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950329", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950329", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950329", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950329", "text": "def update; end", "title": "" }, { "docid": "c3f11e80d4ed9199aaaf751efade4812", "score": "0.5950329", "text": "def update; end", "title": "" }, { "docid": "5ca2caa1a207739e77f437de35e41cf1", "score": "0.59495455", "text": "def update ; end", "title": "" }, { "docid": "2c309c8084bf29f0b8d8674d22086956", "score": "0.59442014", "text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "title": "" }, { "docid": "2c309c8084bf29f0b8d8674d22086956", "score": "0.59442014", "text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "title": "" }, { "docid": "a20f534093aba7e3633ca0ac07a56d53", "score": "0.5944142", "text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "title": "" }, { "docid": "a20f534093aba7e3633ca0ac07a56d53", "score": "0.5944142", "text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "title": "" }, { "docid": "879f1214e030bb2d9e43a0aedb1bc3ea", "score": "0.59361076", "text": "def update_with(attributes)\n assign_attributes(attributes)\n end", "title": "" }, { "docid": "10b1cb39dbb1f67820e37bb6d2632986", "score": "0.5925741", "text": "def update\n # don't need to update; hash is shared\n end", "title": "" }, { "docid": "51982942bd4f09be3f7adc59da4cf104", "score": "0.5925574", "text": "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "title": "" }, { "docid": "f0dd489c52fa73b1c3846fa43727c29e", "score": "0.59250593", "text": "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "title": "" }, { "docid": "4229acd17d03e94871226b09dd3bd37d", "score": "0.5924476", "text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "title": "" }, { "docid": "4229acd17d03e94871226b09dd3bd37d", "score": "0.5924476", "text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "title": "" }, { "docid": "32ed734ad4f899f0ee9ec74a760ca1d0", "score": "0.5921039", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "900f4c147e0916b2e9270373fb83c7e2", "score": "0.59155524", "text": "def update_attributes attributes\n @attributes.merge! attributes\n end", "title": "" }, { "docid": "f63de190ae582620103d96f60d684114", "score": "0.59145254", "text": "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "title": "" }, { "docid": "512d9095b05a696270730ee09c640773", "score": "0.5888445", "text": "def update\r\n end", "title": "" }, { "docid": "5b1f6d40d29f0afb908434d0a6404ac8", "score": "0.58860934", "text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "efcb8c985b9e7911a606a9149b4ab171", "score": "0.5882302", "text": "def update\n raise NotImplemented\n end", "title": "" }, { "docid": "65f67197ac4544cbebca350d889922ee", "score": "0.5879913", "text": "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "title": "" }, { "docid": "c71a8be944fb89ab77a17fd4c16f7193", "score": "0.5877467", "text": "def update_values\n end", "title": "" }, { "docid": "c71a8be944fb89ab77a17fd4c16f7193", "score": "0.5877467", "text": "def update_values\n end", "title": "" }, { "docid": "10e162e857be9c47150e8eccd327cad9", "score": "0.58743787", "text": "def update\n raise NotImplementedError\n end", "title": "" }, { "docid": "389ac4585e8143f353e2535499a23085", "score": "0.585829", "text": "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "title": "" }, { "docid": "c202a823016f05ee2fc4aade77320497", "score": "0.584583", "text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "title": "" }, { "docid": "dc268f568dcb7aca1d3905736d2477af", "score": "0.58408254", "text": "def update attributes, collection #:nodoc:\n 0\n end", "title": "" }, { "docid": "9763ac25d7fdf4b4f35a971609f70b04", "score": "0.5835501", "text": "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "title": "" }, { "docid": "49a282f2ce0c099a5ced60524a492b4f", "score": "0.5829063", "text": "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "title": "" }, { "docid": "541550458a4c8f94afeb6b10c0cb2293", "score": "0.5828611", "text": "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "title": "" }, { "docid": "f6c4eafa4f48a0c81157fb03ff350901", "score": "0.58228916", "text": "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "title": "" }, { "docid": "524a6a969929f9af4bad05dbd9c8f935", "score": "0.5819882", "text": "def update\n set_deltatime\n set_last_update_at\n end", "title": "" } ]
690ba6dda69bcf23fbea47f51d64b608
Returns a Hash describing the status of the Page.
[ { "docid": "21f0f3e9a7ad41d796e7f27a0fb3740f", "score": "0.0", "text": "def status\n {\n visible: visible?,\n public: public?,\n locked: locked?,\n restricted: restricted?\n }\n end", "title": "" } ]
[ { "docid": "732abcfa91d4113d1fdd83aa0426ba8a", "score": "0.6728321", "text": "def page_status(page_number)\n page_status_array = each_page_status.to_a\n page_status_array[page_number - start_page][1]\n end", "title": "" }, { "docid": "ab5345babf1cbb18ff081620e94523f6", "score": "0.67187274", "text": "def get_page_status\n @browser.status\n end", "title": "" }, { "docid": "bad94da718329a2b820f646cc4d530f3", "score": "0.6700216", "text": "def status\n result = Faraday.new(\"https://kccljmymlslr.statuspage.io/api/v2\") do |f|\n f.adapter Faraday.default_adapter\n end.get('status.json').body\n\n json = Yajl::Parser.parse result, symbolize_keys: true\n status = json[:status][:description]\n updated_at = DateTime.parse(json[:page][:updated_at]).strftime \"%F %T %:z\"\n\n \"#{status} [#{updated_at}]\"\n end", "title": "" }, { "docid": "22c0627fc9c464086836b7ea65ee6541", "score": "0.65224475", "text": "def page_status(page_number)\n page_status_array = each_page_status.to_a\n page_status_array[page_number - xdes[:start_page]][1]\n end", "title": "" }, { "docid": "a0d34789346eac88c1c13bc7e0ebfe4b", "score": "0.6288669", "text": "def humanized_status\n case self.status\n when 0\n return I18n.t('page_status_visible_public_locked')\n when 1\n return I18n.t('page_status_visible_unpublic_locked')\n when 2\n return I18n.t('page_status_invisible_public_locked')\n when 3\n return I18n.t('page_status_invisible_unpublic_locked')\n when 4\n return I18n.t('page_status_visible_public')\n when 5\n return I18n.t('page_status_visible_unpublic')\n when 6\n return I18n.t('page_status_invisible_public')\n when 7\n return I18n.t('page_status_invisible_unpublic')\n end\n end", "title": "" }, { "docid": "e3d18069ca0cbfea48342509798a56fd", "score": "0.62768537", "text": "def hash\n [is_sync_awaiting, is_sync_completed, is_sync_failed, is_sync_in_flight, is_sync_in_progress, self_url, stage, stage_str, stage_updated_at, status, status_reason, status_str, status_updated_at, sync_finished_at, sync_progress].hash\n end", "title": "" }, { "docid": "b8780c32ea29a7e02b44ebedb7e81feb", "score": "0.62547934", "text": "def git_status_hash status_type\n state = git_status.send(status_type)\n state.inject({}) do |hash, item|\n hash[item[0]] = item[1]\n hash\n end\n end", "title": "" }, { "docid": "0cd1497190ec83ca570bb7cbced71f5b", "score": "0.6210551", "text": "def hash\n [check, check_time, check_version, probe_dc, result, result_id, status].hash\n end", "title": "" }, { "docid": "11f55af3d144b17582629196e6e6aedb", "score": "0.6207854", "text": "def page_status\n @page.not_found? ? :not_found : :ok\n end", "title": "" }, { "docid": "dab3a7b43ef3098b7da65730e5176899", "score": "0.6187105", "text": "def page(status: T.unsafe(nil), unique_name: T.unsafe(nil), date_created_after: T.unsafe(nil), date_created_before: T.unsafe(nil), page_token: T.unsafe(nil), page_number: T.unsafe(nil), page_size: T.unsafe(nil)); end", "title": "" }, { "docid": "ae4b4ca022961125e0eeafa941b9309b", "score": "0.6180239", "text": "def hash\n [status, message].hash\n end", "title": "" }, { "docid": "9ecc97c0a0dbff23bf33b586d9923330", "score": "0.6167222", "text": "def summary\n status = self.page_status\n puts \"XXXX[#{self.report_flags}] | #{self.response_code.to_s} | #{status} | #{self.url} | #{self.size}\"\n return nil\n end", "title": "" }, { "docid": "ea6d2b6af4dd29a57675589c9da77efd", "score": "0.615194", "text": "def status\n @status.state\n end", "title": "" }, { "docid": "bb46a71070ee547d287944a396ed6859", "score": "0.61377114", "text": "def status\n data.fetch('status')\n end", "title": "" }, { "docid": "bb46a71070ee547d287944a396ed6859", "score": "0.61377114", "text": "def status\n data.fetch('status')\n end", "title": "" }, { "docid": "5d8b85f0ccbb118e4115986d4449ce11", "score": "0.61252815", "text": "def status\n self['status']\n end", "title": "" }, { "docid": "413be3d6e718325a0dadb95df670e192", "score": "0.6096651", "text": "def to_hash\n {\n :name => repository.name,\n :status => status,\n :sha1 => (current_build && current_build.sha1),\n :compare => (current_build && current_build.compare)\n }\n end", "title": "" }, { "docid": "768e6e034cc96185d5bcf359388df051", "score": "0.6076258", "text": "def status\n parsed {\n @status\n }\n end", "title": "" }, { "docid": "bd34e520248cedca3ff65fa1a6e2ed52", "score": "0.6069089", "text": "def status\n @state[:status]\n end", "title": "" }, { "docid": "2e08e5e13c2266252f90a047924fcd1f", "score": "0.60374606", "text": "def status\n AutomateSoup::Rest.get(\n url: \"#{@soup.url}/api/_status\",\n username: @soup.credentials.username,\n token: @soup.credentials.token\n )\n end", "title": "" }, { "docid": "41fb7e7565658801b87704eb3de7dd83", "score": "0.6023068", "text": "def status\n data[:status]\n end", "title": "" }, { "docid": "41fb7e7565658801b87704eb3de7dd83", "score": "0.6023068", "text": "def status\n data[:status]\n end", "title": "" }, { "docid": "41fb7e7565658801b87704eb3de7dd83", "score": "0.6023068", "text": "def status\n data[:status]\n end", "title": "" }, { "docid": "41fb7e7565658801b87704eb3de7dd83", "score": "0.6023068", "text": "def status\n data[:status]\n end", "title": "" }, { "docid": "41fb7e7565658801b87704eb3de7dd83", "score": "0.6023068", "text": "def status\n data[:status]\n end", "title": "" }, { "docid": "41fb7e7565658801b87704eb3de7dd83", "score": "0.6023068", "text": "def status\n data[:status]\n end", "title": "" }, { "docid": "41fb7e7565658801b87704eb3de7dd83", "score": "0.6023068", "text": "def status\n data[:status]\n end", "title": "" }, { "docid": "3eaa0b2848722c6e1b6afd06a9b786cf", "score": "0.6002957", "text": "def hash\n [number_of_elements, total_elements, total_pages, page, page_size].hash\n end", "title": "" }, { "docid": "fbcf1b724209f70387ecb9762a7fe71c", "score": "0.599982", "text": "def status()\n @status\n end", "title": "" }, { "docid": "b2e33a6cd33b0683f3925d95e1f81564", "score": "0.5990416", "text": "def status\n data = get('http://6w4r0ttlx5ft.statuspage.io/api/v2/status.json')\n\n {\n indicator: data['status']['indicator'],\n description: data['status']['description']\n }\n end", "title": "" }, { "docid": "3fccaedfda5fcd2dcf95377830401911", "score": "0.59846985", "text": "def hash\n [signature_type, page, all_pages, pages_setup, appearance, image_file_path, left, top, width, height, location_measure_type, size_measure_type, rotation_angle, horizontal_alignment, vertical_alignment, margin, margin_measure_type, transparency, border].hash\n end", "title": "" }, { "docid": "5caefddd1af445759abd971b4442d414", "score": "0.5966665", "text": "def status_hash(state)\n message = {\n 'ip' => local_ip,\n 'pid' => Process.pid,\n 'state' => state,\n 'at' => Time.now.utc\n }\n end", "title": "" }, { "docid": "0645664237a744e07caef6f686ff78fb", "score": "0.59582895", "text": "def status\n @data[:status]\n end", "title": "" }, { "docid": "f29fa20b9d859e89e1276a7f14d79a36", "score": "0.59557146", "text": "def page_info\n {\n has_previous_page: previous_page?,\n has_next_page: next_page?,\n start_cursor: start_cursor,\n end_cursor: end_cursor\n }\n end", "title": "" }, { "docid": "daa6de59c754ae6289bda6161b569c7f", "score": "0.5949021", "text": "def status\n # Memoize it so we don't have to fetch it again\n @status ||= client.status(repository, head.sha).state\n\n case @status\n when 'failure' then 'failing'\n when 'success' then 'passing'\n else 'pending'\n end\n rescue StandardError\n nil\n end", "title": "" }, { "docid": "2a6e1fc24b02ad179f303447a231c7fb", "score": "0.594881", "text": "def state\n status[\"state\"]\n end", "title": "" }, { "docid": "011b35bd1b7d94719a405441d0109bcd", "score": "0.594651", "text": "def status\n return :code => info[:statuscode].to_i, :messages => info[:messages]\n end", "title": "" }, { "docid": "57e7ba4af2d9765b422e7ec85854b3b5", "score": "0.59390944", "text": "def status\n return @status\n end", "title": "" }, { "docid": "03694584684aa702605443bcfdd3de21", "score": "0.5938935", "text": "def status\n @response[\"status\"]\n end", "title": "" }, { "docid": "07a766e6054024d818df5e1263abf135", "score": "0.5938815", "text": "def hash\n [browser_errors, check_type, description, duration, error, playing_tab, screenshot_bucket_key, skipped, snapshot_bucket_key, step_id, sub_test_step_details, time_to_interactive, type, url, value, vitals_metrics, warnings].hash\n end", "title": "" }, { "docid": "c5db835af7127816795a0669f8840c79", "score": "0.5924987", "text": "def status\n response[\"status\"]\n end", "title": "" }, { "docid": "3e2f981b8e2c14e68175193b570bdd4a", "score": "0.59197235", "text": "def status\n @instance['status']\n end", "title": "" }, { "docid": "245e4aad95524cb21cb768dce2846dfe", "score": "0.59192824", "text": "def status\n if not @status\n stat = @head[\"Status\"]\n stat = stat.split(' ')[0] if stat\n\n @status = stat || \"200\"\n end\n\n @status\n end", "title": "" }, { "docid": "96f1319a6621212f43db30a6bc3946c4", "score": "0.5913398", "text": "def status\n if meta?\n @data[:status]\n else\n 200\n end\n end", "title": "" }, { "docid": "9e8df7a636ec20cebc765ed43169e792", "score": "0.58989424", "text": "def state\n status.status\n end", "title": "" }, { "docid": "b13d66164bb1200ba65d431fe2b0591e", "score": "0.5886227", "text": "def pages\n to_hash['pages']\n end", "title": "" }, { "docid": "008f056b32b037e82c1b9bd5442eda94", "score": "0.5878914", "text": "def status\n @response['status']\n end", "title": "" }, { "docid": "782bd1eadb48ae1fbd8f3806931f68cf", "score": "0.58768475", "text": "def status\n return :deleted if @deleted\n return :finished if @finished\n\n state = Status.to_sym(@server.read(links[:status], \"text/plain\",\n @credentials))\n\n @finished = (state == :finished)\n state\n end", "title": "" }, { "docid": "90f6c23bee6bf0010ef1ffe9daf709a7", "score": "0.5875146", "text": "def status\n response = Curl.get('https://status.mojang.com/check'.freeze).body_str\n json = Oj.load(response)\n ret = {}\n # Reformatting the returned data because it is super annoying to work with.\n json.each do |hash|\n hash.each do |site, status|\n ret[site] = status\n end\n end\n\n ret\n end", "title": "" }, { "docid": "a85eaee7a9a829250f4fd21fcaabddcb", "score": "0.58685446", "text": "def get_status\n @status\n end", "title": "" }, { "docid": "a85eaee7a9a829250f4fd21fcaabddcb", "score": "0.58685446", "text": "def get_status\n @status\n end", "title": "" }, { "docid": "42e8781e864c50e64672e27076b72684", "score": "0.586274", "text": "def status\n @data['status']\n end", "title": "" }, { "docid": "3b173f831ef8bd3ddf6a7a0156f280e6", "score": "0.58547163", "text": "def status\n @raw_status\n end", "title": "" }, { "docid": "3b173f831ef8bd3ddf6a7a0156f280e6", "score": "0.58547163", "text": "def status\n @raw_status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.5847964", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.58478963", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.58478963", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.58478963", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.58478963", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.58478963", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.58478963", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.58478963", "text": "def status\n @status\n end", "title": "" }, { "docid": "577044049aadba142da024728d77b581", "score": "0.58468443", "text": "def status\n @status\n end", "title": "" }, { "docid": "4ffad49adea0e8afb2a0ca8d18f97bd5", "score": "0.58440197", "text": "def each_page_status\n unless block_given?\n return enum_for(:each_page_status)\n end\n\n bitmap = xdes[:bitmap].enum_for(:each_byte)\n\n bitmap.each_with_index do |byte, byte_index|\n (0..3).each do |page_offset|\n page_number = xdes[:start_page] + (byte_index * 4) + page_offset\n page_bits = ((byte >> (page_offset * BITS_PER_PAGE)) & BITMAP_BV_ALL)\n page_status = {\n :free => (page_bits & BITMAP_BV_FREE != 0),\n :clean => (page_bits & BITMAP_BV_CLEAN != 0),\n }\n yield page_number, page_status\n end\n end\n\n nil\n end", "title": "" }, { "docid": "c553720a9c41e22f49b060a4163bd3f2", "score": "0.5837619", "text": "def hash\n [generate_summary_page, show_deleted_content, show_inserted_content, style_change_detection, inserted_items_style, deleted_items_style, changed_items_style, words_separator_chars, details_level, use_frames_for_del_ins_elements, calculate_component_coordinates, mark_changed_content, mark_nested_content, clone_metadata, meta_data, password_save_option, password, diagram_master_setting, original_size, header_footers_comparison, paper_size, sensitivity_of_comparison].hash\n end", "title": "" }, { "docid": "cf8e97f4f8b32dda07f3b93f6310c0d6", "score": "0.58271503", "text": "def hash\n [id, owner, region, render_id, provider_id, filename, url, status, created, updated].hash\n end", "title": "" }, { "docid": "7cf332d15430c76f764beba96767cf99", "score": "0.5819579", "text": "def each_page_status\n return enum_for(:each_page_status) unless block_given?\n\n bitmap.each_byte.each_with_index do |byte, byte_index|\n (0..3).each do |page_offset|\n page_number = start_page + (byte_index * 4) + page_offset\n page_bits = ((byte >> (page_offset * BITS_PER_PAGE)) & BITMAP_BV_ALL)\n page_status = PageStatus.new(\n free: (page_bits & BITMAP_BV_FREE != 0),\n clean: (page_bits & BITMAP_BV_CLEAN != 0)\n )\n yield page_number, page_status\n end\n end\n\n nil\n end", "title": "" }, { "docid": "0228e099c9168bf07baef1a6492e7fbe", "score": "0.5819392", "text": "def status\n return @status\n end", "title": "" }, { "docid": "c0ae5e11ede6d2a21f674f0f504702d8", "score": "0.58193344", "text": "def status\n data.status\n end", "title": "" }, { "docid": "c0ae5e11ede6d2a21f674f0f504702d8", "score": "0.58193344", "text": "def status\n data.status\n end", "title": "" }, { "docid": "c0ae5e11ede6d2a21f674f0f504702d8", "score": "0.58193344", "text": "def status\n data.status\n end", "title": "" }, { "docid": "c0ae5e11ede6d2a21f674f0f504702d8", "score": "0.58193344", "text": "def status\n data.status\n end", "title": "" }, { "docid": "7b2e7e988821693742ac64fa879ddc86", "score": "0.5812985", "text": "def hash\n super +\n @ballooning.hash +\n @guaranteed.hash +\n @max.hash +\n @over_commit.hash +\n @transparent_huge_pages.hash\n end", "title": "" }, { "docid": "1603f02b4d17ea9a5fd563753d217225", "score": "0.58120537", "text": "def get_status\n return @status\n end", "title": "" }, { "docid": "c96c2c9d8b1914034ed9191c600ebffb", "score": "0.5802394", "text": "def hash\n href.hash\n end", "title": "" }, { "docid": "fa9726d498ed6bb766be0dd6a3b4099c", "score": "0.58016086", "text": "def hash\n [any_page_url_logic, any_page_url_value, current_page_url_logic, current_page_url_value, customers_browsing_time_logic, customers_browsing_time_seconds, customers_location_country, customers_location_logic, customers_location_state, number_of_viewed_pages_logic, number_of_viewed_pages_value, referring_website_logic, referring_website_value, type].hash\n end", "title": "" }, { "docid": "287f6673cdab5f457901b5e1a519ce4c", "score": "0.57998043", "text": "def hash\n [created, created_by, documents, id, not_after, reason, status, template_name, title, urlback].hash\n end", "title": "" }, { "docid": "71d78b0522505acd80a0a21dba446dbb", "score": "0.57939756", "text": "def inspect\n sprintf \"<Hash(Inf): %s, status: %s>\", super, status\n end", "title": "" }, { "docid": "4e2f7db37d2bc7487563fe69007b2a79", "score": "0.5787646", "text": "def hash\n [active, assigned, error, last_known_good].hash\n end", "title": "" }, { "docid": "f7279932a5802f620e58291f3c70d2b3", "score": "0.577655", "text": "def resource_hash\n Digest::SHA1.hexdigest(\"#{PROTOCOL_VERSION}\\000#{@repository.checkout_hash}\\000#{@pos}\")\n end", "title": "" }, { "docid": "6b61786b0c72d82686b5354bd31cb227", "score": "0.5775251", "text": "def get_status\n status = {\n \"time\" => Time.now,\n \"current\" => @current,\n \"current_estimate\" => @current_estimate,\n \"last_changed\" => @last_change_ts,\n \"results\" => @last_results,\n }\n return status\n end", "title": "" }, { "docid": "73fcff6ba2a261ffeafcc235907ab587", "score": "0.5766275", "text": "def status\n @status ||= @raw_status.load\n end", "title": "" }, { "docid": "46b4bec3b2ea2dcf5d89c6bb3089ee73", "score": "0.5765451", "text": "def hash\n [browser_type, browser_version, device, duration, error, failure, passed, received_email_count, start_url, step_details, thumbnails_bucket_key, time_to_interactive].hash\n end", "title": "" }, { "docid": "e4f9e6046ac8f25e4037a4cca1fe63f1", "score": "0.5756581", "text": "def status\n { }\n end", "title": "" }, { "docid": "b6256824371f13eee6fc64f0c95374ad", "score": "0.5755654", "text": "def status\n @status\n end", "title": "" } ]
3b826b26e95f6641981684ee5ff65358
Provide a user friendly representation
[ { "docid": "2a5443f40e3e0226c846ccdd2851f273", "score": "0.0", "text": "def to_s\n '#<Twilio.FlexApi.V1.InsightsSettingsAnswerSetsList>'\n end", "title": "" } ]
[ { "docid": "8813d23ea53482a215f5e5b971468e2d", "score": "0.75752455", "text": "def representation; end", "title": "" }, { "docid": "dad7e7041772f906c35bc43f5390a274", "score": "0.70985687", "text": "def to_human\n super\n end", "title": "" }, { "docid": "1e72b07c609e216276b642f98114f5a1", "score": "0.7007793", "text": "def to_s\n super\n end", "title": "" }, { "docid": "1e72b07c609e216276b642f98114f5a1", "score": "0.7007793", "text": "def to_s\n super\n end", "title": "" }, { "docid": "1e72b07c609e216276b642f98114f5a1", "score": "0.7007793", "text": "def to_s\n super\n end", "title": "" }, { "docid": "4c2f1fe16c82c29c0bf338fbb8369d96", "score": "0.69398165", "text": "def to_s\n super\n end", "title": "" }, { "docid": "5675e5bb020debc712e1ac53c602e252", "score": "0.68459946", "text": "def display\n return to_s\n end", "title": "" }, { "docid": "6a4eff57672a34bde12e3d64ec2ae7c8", "score": "0.6820704", "text": "def to_human\n\t\tcount_and_display_classes = ->(array){array.map(&:class)&.group_by(&:itself)&.transform_values(&:count)} \n\n\t\tthe_ins = count_and_display_classes[ in_e] \n\t\tthe_outs = count_and_display_classes[ out]\n\n\t\tin_and_out = in_edges.empty? ? \"\" : \"in: #{the_ins}, \" \n\t\tin_and_out += out_edges.empty? ? \"\" : \"out: #{the_outs}, \" \n \n\n\t\t#Default presentation of ActiveOrient::Model-Objects\n\n\t\t\"<#{self.class.to_s.demodulize}[#{rid}]: \" + in_and_out + content_attributes.map do |attr, value|\n\t\t\tv= case value\n\t\t\t\t when ActiveOrient::Model\n\t\t\t\t\t \"< #{self.class.to_s.demodulize}: #{value.rid} >\"\n\t\t\t\t when OrientSupport::Array\n\t\t\t\t\t value.to_s\n#\t\t\t\t\t value.rrid #.to_human #.map(&:to_human).join(\"::\")\n\t\t\t\t else\n\t\t\t\t\t value.from_orient\n\t\t\t\t end\n\t\t\t\"%s : %s\" % [ attr, v] unless v.nil?\n\t\tend.compact.sort.join(', ') + \">\".gsub('\"' , ' ')\n\tend", "title": "" }, { "docid": "0ab9bf59d7f8c0c512e045be62135000", "score": "0.677", "text": "def to_s() abstract end", "title": "" }, { "docid": "0ab9bf59d7f8c0c512e045be62135000", "score": "0.677", "text": "def to_s() abstract end", "title": "" }, { "docid": "ffd3e055a7d0cc94d916cc419077baf0", "score": "0.67504126", "text": "def to_s\n render(:basic)\n end", "title": "" }, { "docid": "fd26cd82dd3556fb523e8deba23d2927", "score": "0.673185", "text": "def to_human\n\t\t\t\"<#{self.class.to_s.demodulize}: \" + content_attributes.map do |attr, value|\n\t\t\t\tv= case value\n\t\t\t\t\t when ActiveOrient::Model\n\t\t\t\t\t\t \"< #{self.class.to_.demodulize} : #{value.rrid} >\"\n\t\t\t\t\t when OrientSupport::Array\n\t\t\t\t\t\t value.rrid #.to_human #.map(&:to_human).join(\"::\")\n\t\t\t\t\t else\n\t\t\t\t\t\t value.from_orient\n\t\t\t\t\t end\n\t\t\t\t\"%s : %s\" % [ attr, v] unless v.nil?\n\t\t\tend.compact.sort.join(', ') + \">\".gsub('\"' , ' ')\n\t\tend", "title": "" }, { "docid": "e359a2c670404a9ad6b27f10bfb611b8", "score": "0.66941327", "text": "def to_s\n super\n end", "title": "" }, { "docid": "e359a2c670404a9ad6b27f10bfb611b8", "score": "0.66941327", "text": "def to_s\n super\n end", "title": "" }, { "docid": "7728ea1ab12f9652eb3e6b6ceec2c3b8", "score": "0.6682752", "text": "def to_s; @description; end", "title": "" }, { "docid": "b33fc7a48528d23b8d1e8c4513130a71", "score": "0.66748816", "text": "def render\n to_s\n end", "title": "" }, { "docid": "66a3db4c9563afd386e65eb103a57722", "score": "0.66528404", "text": "def display_type; end", "title": "" }, { "docid": "0b695f4ba8379baaf7e523180d00419b", "score": "0.6648708", "text": "def to_human\n\t\tself\n\tend", "title": "" }, { "docid": "42f39ffcab217a8a3049a40a0d3f64ba", "score": "0.6639065", "text": "def to_s\n \"#{@name} #{@type}\"\n end", "title": "" }, { "docid": "68ca2c02ffe5c54d841514ca9c3fe80e", "score": "0.66386676", "text": "def to_s\n # This should be overridden by a child class\n super\n end", "title": "" }, { "docid": "9b4b0c9854850fb75f133878d0f5412b", "score": "0.66331285", "text": "def to_s\n\n if respond_to?( :name )\n\n name\n\n elsif respond_to?( :title )\n\n title\n\n else\n\n \"#{self.model_name.human} ##{id}\"\n\n end\n\n end", "title": "" }, { "docid": "6ee9ee5be86a1f9db580f0f4ec9238cd", "score": "0.66227216", "text": "def to_s\n pieces = []\n pieces << self.class.name\n pieces << \"id:##{id.inspect}\"\n pieces << \"standardized:\" + (is_standard? ? 'standard' : (standard_id.nil? ? 'no' : \"copy-of-#{standard_id}\"))\n pieces << \"mission:#{mission_id.inspect}\"\n pieces.join(', ')\n end", "title": "" }, { "docid": "48f204ac10cb3bcb181afda7128d2836", "score": "0.6618347", "text": "def to_s\n\t\tres = \"\\nname: \" + name.to_s + \"\\nreal_name: \" + real_name.to_s + \"\\nid: \" + id.to_s + \"\\nlanguage: \" + language.to_s + \"\\nutc: \" + utc.to_s + \"\\ngeo: \" + geo.to_s + \"\\ndescription: \" + description.to_s + \"\\navatar: \" + avatar.to_s + \"\\nlocation: \" + location.to_s + \"\\nsubscribers: \" + subscribers.to_s + \"\\nsubscriptions: \" + subscriptions.to_s + \"\\npostings: \" + postings.to_s + \"\\nprofile: \" + profile.to_s + \"\\nwebsite: \" + website.to_s\n\t\tres\n\tend", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.6618043", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.6618043", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.6618043", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.6618043", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.6618043", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.6618043", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.6618043", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.6618043", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.6618043", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.6618043", "text": "def format; end", "title": "" }, { "docid": "d1dd91bb039921fda91fe5cc1760de24", "score": "0.660979", "text": "def rendered_format; end", "title": "" }, { "docid": "e78a46e0b739122a593cdac761ff9b08", "score": "0.6605447", "text": "def to_s\n\t\t\"#{represent_status} #{description}\"\n\tend", "title": "" }, { "docid": "b092bc6c4b1283f076c265b0d61b0655", "score": "0.6595864", "text": "def to_s\n return \"#{@name} - #{@description}\"\n end", "title": "" }, { "docid": "46f1e64ae70f617e9e8ef96c2c2399b0", "score": "0.65941536", "text": "def to_s\n \"#{name}: #{description}\"\n end", "title": "" }, { "docid": "22c33bcfe4716a93571d7a41c1c2ee72", "score": "0.6563772", "text": "def to_s\n \"id: #{id} | type: #{type} | #{name}\"\n end", "title": "" }, { "docid": "fe50c12fca4c340b6e4d16d9a154dc36", "score": "0.6561842", "text": "def to_human\n h = +\"#{human_type}(#{human_id}\"\n h << \",#{attributes.to_human}\" unless attributes.empty?\n\n h << ')'\n end", "title": "" }, { "docid": "b0ef1522a002ae52d75f6969031a934c", "score": "0.6545454", "text": "def to_s\r\n end", "title": "" }, { "docid": "b0ef1522a002ae52d75f6969031a934c", "score": "0.6545454", "text": "def to_s\r\n end", "title": "" }, { "docid": "624cc819ae6f67494dc1542093b72250", "score": "0.6524854", "text": "def to_s\n %(<#{@name}#{attributes}>)\n end", "title": "" }, { "docid": "acd57af4769cb5c1c23ecb3b6322056d", "score": "0.65244156", "text": "def humanize\n Inflecto.humanize(self)\n end", "title": "" }, { "docid": "6b2699c2cb8ac02a7a5dc232681f4b06", "score": "0.651875", "text": "def to_s\n\t\tdescription\n\tend", "title": "" }, { "docid": "6b2699c2cb8ac02a7a5dc232681f4b06", "score": "0.651875", "text": "def to_s\n\t\tdescription\n\tend", "title": "" }, { "docid": "09cc0ed816cec7c405796d8a1afb3e08", "score": "0.6516385", "text": "def to_s\n %(<#{ @name }#{attributes}>)\n end", "title": "" }, { "docid": "a7aefee0c54ff9aa65d7452e0712a88e", "score": "0.6514882", "text": "def to_s\r\n\t\tdescription\r\n\tend", "title": "" }, { "docid": "9e02d69972394e206b87ad7373639bad", "score": "0.65064883", "text": "def represent\n type.to_s\n end", "title": "" }, { "docid": "093ba284473792b5684f7f5408f5257a", "score": "0.6502517", "text": "def to_s\r\n description\r\n end", "title": "" }, { "docid": "4d850aa3a213bc9a8989dec696d4bebc", "score": "0.65010244", "text": "def to_s\n long_display\n end", "title": "" }, { "docid": "4d850aa3a213bc9a8989dec696d4bebc", "score": "0.65010244", "text": "def to_s\n long_display\n end", "title": "" }, { "docid": "4d850aa3a213bc9a8989dec696d4bebc", "score": "0.65010244", "text": "def to_s\n long_display\n end", "title": "" }, { "docid": "4d850aa3a213bc9a8989dec696d4bebc", "score": "0.65010244", "text": "def to_s\n long_display\n end", "title": "" }, { "docid": "364f1784dffe3f0124d6223ec0464340", "score": "0.64953834", "text": "def to_s\r\n end", "title": "" }, { "docid": "76e792bb18426b28683812c1e089c740", "score": "0.6472599", "text": "def render\n return to_s\n end", "title": "" }, { "docid": "43f0dd8ef7a8eac6d29500de95da0282", "score": "0.6466378", "text": "def formatted; end", "title": "" }, { "docid": "43f0dd8ef7a8eac6d29500de95da0282", "score": "0.6466378", "text": "def formatted; end", "title": "" }, { "docid": "4fad6c7641f5db56ae2caecb878c5087", "score": "0.6464627", "text": "def to_s\n \"#{type} #{name}, title=#{title}, id=#{id}, on_screen=#{on_screen?}\"\n end", "title": "" }, { "docid": "ae05bf6ca97651d04de93884a01a58b7", "score": "0.6458644", "text": "def to_s\n description\n end", "title": "" }, { "docid": "ae05bf6ca97651d04de93884a01a58b7", "score": "0.6458644", "text": "def to_s\n description\n end", "title": "" }, { "docid": "8fb9006a1ce57fca351dad3183553711", "score": "0.645644", "text": "def represent_text\n name\n end", "title": "" }, { "docid": "dab40ba078bfa82283437625f2fc5047", "score": "0.6456352", "text": "def to_s\n\t\t\traise \"#{self.class} has not implemented a text representation\"\n\t\tend", "title": "" }, { "docid": "be91f55c726f30c475f0cb378cff5d7d", "score": "0.6456176", "text": "def to_s\n\t\t\"#{display_name}\"\n\tend", "title": "" }, { "docid": "2ca6ca37795e9dfd952783295d5f2e14", "score": "0.64536244", "text": "def detail_formatter; end", "title": "" }, { "docid": "8110c0be6db059ee850538e00841be9e", "score": "0.6451429", "text": "def to_s\n \"Name: #{@name} #{@last_name} ID Number: #{@id} Age: #{@age}\"\n end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" }, { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.6449207", "text": "def to_s; end", "title": "" } ]
7ff37c54947cc801d38fb4d4042195e5
Get the list of known platforms Parameters:: platform_type (Symbol or nil): Filter only platforms of a given platform type, or nil for all platforms [default: nil] Result:: Array: List of platform handlers
[ { "docid": "ff7a0dc047dff433b095d92ff06bcd89", "score": "0.8716045", "text": "def known_platforms(platform_type: nil)\n (platform_type.nil? ? @platform_handlers.keys : [platform_type]).map { |search_platform_type| (@platform_handlers[search_platform_type] || []) }.flatten\n end", "title": "" } ]
[ { "docid": "f156c20d91ccd9d85f0b24fa327e4cbc", "score": "0.7074821", "text": "def platform_types\n get(\"platform-types\")[\"types\"]\n end", "title": "" }, { "docid": "27b085f580da85d5235a1f13ddf28e9d", "score": "0.6809869", "text": "def all_platforms\n Msf::Module::Platform.subclasses.collect { |c| c.realname.downcase }\n end", "title": "" }, { "docid": "7545102e47b6d833ba3f54a50bb89f27", "score": "0.68060243", "text": "def platforms\n return @platforms\n end", "title": "" }, { "docid": "f0eb1510fb5774f8af35a202cbc2569d", "score": "0.66717845", "text": "def platforms\n get(\"project/platforms\")[\"platforms\"]\n end", "title": "" }, { "docid": "bfdbc5eed553d49bf89e9235005578b8", "score": "0.66694945", "text": "def platform(platform_name)\n @platform_handlers.values.flatten.find { |known_platform| known_platform.name == platform_name }\n end", "title": "" }, { "docid": "3c177916a9ad18b55b361c0feae7a6d4", "score": "0.6636226", "text": "def platforms; platform_names; end", "title": "" }, { "docid": "de8cdf45dac820b3cd898f9fdee4e0b9", "score": "0.658807", "text": "def platform_list; ['all','xbox-360']; end", "title": "" }, { "docid": "becad1371f1954ff7f8c392795ff52bc", "score": "0.6557854", "text": "def platform_types\n @platform_types.to_hash\n end", "title": "" }, { "docid": "2207d658ae5d6da3b172f7bc24d3dcde", "score": "0.6420562", "text": "def supported_platforms\n _platforms = {\n #\n # os: 'linux'\n # platform_family: 'debian'\n 'debian' => %w(jessie/sid 7.6 7.5 7.4 7.2 7.1 7.0 6.0.5),\n 'ubuntu' => %w(14.10 14.04 13.10 13.04 12.04 10.04),\n # platform_family: 'rhel'\n 'amazon' => %w(2014.09 2014.03 2013.09 2012.09),\n 'centos' => %w(7.0.1406 6.6 6.5 6.4 6.3 6.0 5.11 5.10 5.9 5.8),\n 'oracle' => %w(6.5 5.10),\n 'redhat' => %w(7.0 6.5 6.4 6.3 6.2 6.1 6.0 5.10 5.9 5.8 5.7 5.6)\n }\nend", "title": "" }, { "docid": "524ddfde8878010921a8113c353e47c0", "score": "0.6394532", "text": "def get_platform\n platform=[]\n testos=`uname -a`\n # puts \"osname is #{testos}\"\n platform << \"raspberry\" if (/arm-linux/ =~ RUBY_PLATFORM) != nil and `uname -a`.include?('armv6')\n platform << \"raspberry\" if `uname -a`.include?('armv6')\n platform << \"raspberry 2\" if (/armv7l-linux/ =~ RUBY_PLATFORM) != nil and !`uname -a`.include?('armv6')\n platform << \"mac\" if (/darwin/ =~ RUBY_PLATFORM) != nil\n platform << \"arm\" if (/arm/ =~ RUBY_PLATFORM) != nil\n platform << \"x86\" if (/x86/ =~ RUBY_PLATFORM) != nil\n platform << \"i686\" if (/i686/ =~ RUBY_PLATFORM) != nil\n platform << \"microsoft\" if testos.include?('Microsoft')\n platform << \"debian\" if testos.include?('Debian')\n platform << \"ubuntu\" if testos.include?('Ubuntu')\n platform << \"linux\" if (/linux/ =~ RUBY_PLATFORM) != nil\n platform\n end", "title": "" }, { "docid": "bf9f50b74964b4e8d9241676aebabace", "score": "0.6387961", "text": "def platforms id\n return legal_values_for 'platform', id\n end", "title": "" }, { "docid": "bdf7ced5c28b86d2436395e464777c3a", "score": "0.63866735", "text": "def platforms=(value)\n @platforms = value\n end", "title": "" }, { "docid": "037ee1cfbeea42fd181a7c701012a01a", "score": "0.6341067", "text": "def platform(*platforms)\n @current_platforms = platforms\n\n yield\n\n ensure\n @current_platforms = nil\n end", "title": "" }, { "docid": "80296756333a45d07513046077d029d3", "score": "0.6334997", "text": "def get_platform_servers(os_platform, alt_servers = nil)\n servers = alt_servers.nil? ? get_server_list(@params) : alt_servers\n result = servers.select{|k,v| v[\"os_platform\"].downcase =~ /#{os_platform}/ }\n end", "title": "" }, { "docid": "012a51625ecb13ace3f56ea57f8f3dfa", "score": "0.6319129", "text": "def default_platform_list\n [\n metadata.platform,\n *ruby_versions,\n *platforms,\n RbConfig::CONFIG['build']\n ]\n end", "title": "" }, { "docid": "7c020388fb3eecab4fdd8e040328a467", "score": "0.63074064", "text": "def supported_platforms\n _platforms = {\n #\n # os: 'linux'\n # platform_family: 'debian'\n 'debian' => %w(jessie/sid\n 8.4 8.2 8.1 8.0\n 7.10 7.9 7.8 7.7 7.6 7.5 7.4 7.2 7.1 7.0\n 6.0.5),\n 'ubuntu' => %w(16.04\n 15.10 15.04\n 14.10 14.04\n 13.10 13.04\n 12.04 10.04),\n # platform_family: 'rhel'\n 'amazon' => %w(2016.03\n 2015.09 2015.03\n 2014.09 2014.03\n 2013.09 2012.09),\n 'centos' => %w(7.2.1511 7.1.1503 7.0.1406\n 6.8 6.7 6.6 6.5 6.4 6.3 6.2 6.1 6.0\n 5.11 5.10 5.9 5.8 5.7 5.6 5.5 5.4 5.3 5.2),\n 'oracle' => %w(7.1 7.0\n 6.6 6.5\n 5.10),\n 'redhat' => %w(7.1 7.0\n 6.6 6.5 6.4 6.3 6.2 6.1 6.0\n 5.10 5.9 5.8 5.7 5.6)\n }\nend", "title": "" }, { "docid": "99f6ed66eae3b6f2833b14555ceb5651", "score": "0.63073957", "text": "def select_local_platforms(specs) # :nodoc:\n specs.select do |spec|\n Gem::Platform.installable? spec\n end\n end", "title": "" }, { "docid": "bf48d667c3144911f748285a3dbb29df", "score": "0.63041025", "text": "def platforms\n expose Metadata.platforms(@oauth_token)\n end", "title": "" }, { "docid": "1d9dc34b273f4bd2f4c4d300b0305c45", "score": "0.6260386", "text": "def platform\n @_platform ||= begin\n os = []\n os << :windows if OS.windows?\n os << :linux if OS.linux?\n os << :osx if OS.osx?\n os << :posix if OS.posix?\n unless OS.windows? || OS.osx?\n os << :ubuntu if command_exists?(\"apt-get\")\n os << :arch if command_exists?(\"pacman\")\n os << :red_hat if command_exists?(\"yum\")\n end\n\n [\n *os,\n *os.map { |x| (x.to_s + OS.bits.to_s).to_sym }\n ]\n end\n end", "title": "" }, { "docid": "9a06308e3aa381cac94f88233d77dadc", "score": "0.6245144", "text": "def names\n platforms.map { |m| m.realname }\n end", "title": "" }, { "docid": "8ba7402cd4ca2196b36835fd10e36787", "score": "0.6190009", "text": "def platforms_to_lint(spec)\n return spec.available_platforms if @platforms.empty?\n\n # Validate that the platforms specified are actually supported by the spec\n results = @platforms.map do |platform|\n matching_platform = spec.available_platforms.find { |p| p.name == platform.name }\n unless matching_platform\n raise Informative, \"Platform `#{platform}` is not supported by specification `#{spec}`.\"\n end\n matching_platform\n end.uniq\n\n results\n end", "title": "" }, { "docid": "34953ead572a88ae3d8937951aecf4d8", "score": "0.6173306", "text": "def scan\n # start with the platform/families who have no families (the top levels)\n top = Train::Platforms.top_platforms\n top.each do |_name, plat|\n # we are doing a instance_eval here to make sure we have the proper\n # context with all the detect helper methods\n next unless instance_eval(&plat.detect)\n\n # if we have a match start looking at the children\n plat_result = scan_children(plat)\n next if plat_result.nil?\n\n # return platform to backend\n @family_hierarchy << plat.name\n return get_platform(plat_result)\n end\n\n raise Train::PlatformDetectionFailed, \"Sorry, we are unable to detect your platform\"\n end", "title": "" }, { "docid": "aca190b6768026952dfd61a26759976e", "score": "0.5966338", "text": "def platform_for(node)\n @platforms_handler.known_platforms.find { |platform| platform.known_nodes.include?(node) }\n end", "title": "" }, { "docid": "a771a30200859d35e31e044bead0b47a", "score": "0.5936391", "text": "def available_platform\n downloads.collect(&:platform).flatten.uniq\n end", "title": "" }, { "docid": "ff87beaaeb9cb5c9e7ca48f288f54ac7", "score": "0.5931962", "text": "def define_platforms\n [define_centos_5, define_centos_6, define_run_list]\n end", "title": "" }, { "docid": "cc03d6723c93b84f753bbd2b8daeed6c", "score": "0.58292925", "text": "def index\n @platforms = Platform.all\n end", "title": "" }, { "docid": "cc03d6723c93b84f753bbd2b8daeed6c", "score": "0.58292925", "text": "def index\n @platforms = Platform.all\n end", "title": "" }, { "docid": "cc03d6723c93b84f753bbd2b8daeed6c", "score": "0.58292925", "text": "def index\n @platforms = Platform.all\n end", "title": "" }, { "docid": "bf32704f46f0cb85e524e6600acbc60e", "score": "0.58123267", "text": "def check_platforms\n default_platform_attrs = ProductModel.platforms.stringify_keys\n self.design_platform = default_platform_attrs.merge(booleanize_hashs(design_platform))\n self.customize_platform = default_platform_attrs.merge(booleanize_hashs(customize_platform))\n end", "title": "" }, { "docid": "f2f41b9f2cff43f6963a5774bef1592f", "score": "0.5811768", "text": "def platform_type\n return @platform_type\n end", "title": "" }, { "docid": "f2f41b9f2cff43f6963a5774bef1592f", "score": "0.5811768", "text": "def platform_type\n return @platform_type\n end", "title": "" }, { "docid": "30dce5faa09a40cb9f402b91abb11236", "score": "0.57794344", "text": "def index\n @page_count, @platforms = Locomotive::Platform.paginated(:page => (params[:page] || 1).to_i)\n display @platforms\n end", "title": "" }, { "docid": "83948315d7ad8804f31ccb659251194d", "score": "0.57587105", "text": "def get_platform(host_os)\n return :osx if host_os =~ /darwin/\n return :linux if host_os =~ /linux/\n return :windows if host_os =~ /mingw32|mswin32/\n return :unknown\n end", "title": "" }, { "docid": "8a3f9a56c5478eede0e3340d9b9c491d", "score": "0.5718232", "text": "def platforms_for(services)\n concerned_platforms = {}\n @platforms_handler.known_platforms.each do |platform|\n deployable_nodes = {}\n platform_services = platform.deployable_services\n services.each do |node, node_services|\n node_deployable_services = platform_services & node_services\n deployable_nodes[node] = node_deployable_services unless node_deployable_services.empty?\n end\n concerned_platforms[platform] = deployable_nodes unless deployable_nodes.empty?\n end\n concerned_platforms\n end", "title": "" }, { "docid": "b850e9d92deabc3c528ae666b1b1ee68", "score": "0.5646314", "text": "def gem_platforms(name, options) # :nodoc:\n platform_names = Array(options.delete :platform)\n platform_names.concat Array(options.delete :platforms)\n platform_names.concat @current_platforms if @current_platforms\n\n return true if platform_names.empty?\n\n platform_names.any? do |platform_name|\n raise ArgumentError, \"unknown platform #{platform_name.inspect}\" unless\n platform = PLATFORM_MAP[platform_name]\n\n next false unless Gem::Platform.match_gem? platform, name\n\n if engines = ENGINE_MAP[platform_name]\n next false unless engines.include? Gem.ruby_engine\n end\n\n case WINDOWS[platform_name]\n when :only then\n next false unless Gem.win_platform?\n when :never then\n next false if Gem.win_platform?\n end\n\n VERSION_MAP[platform_name].satisfied_by? Gem.ruby_version\n end\n end", "title": "" }, { "docid": "d01cc1a328e54aff3d770731095d94b6", "score": "0.56253815", "text": "def supported_platforms\n latest_extension_version.try(:supported_platforms) || []\n end", "title": "" }, { "docid": "ba358c0f0b270abe83c237ecd364b9b0", "score": "0.5573161", "text": "def add_platform(platform)\n @platforms << platform\n end", "title": "" }, { "docid": "4e77699c6a5de0a15e8c1cd82b70021c", "score": "0.5535635", "text": "def platform\n data[:platform]\n end", "title": "" }, { "docid": "5e51ffe9ad6fa644980a8098654dd701", "score": "0.55193293", "text": "def platform_type=(value)\n @platform_type = value\n end", "title": "" }, { "docid": "5e51ffe9ad6fa644980a8098654dd701", "score": "0.55193293", "text": "def platform_type=(value)\n @platform_type = value\n end", "title": "" }, { "docid": "f776e1f6fa9bbf9a0f3f921a0958eb5e", "score": "0.5509045", "text": "def detect_platform\r\n\t\tprint_status(\"Attempting to automatically detect the platform\")\r\n\t\tres = send_serialized_request(\"osname.bin\")\r\n\r\n\t\tif (res.body =~ /(Linux|FreeBSD|Windows)/i)\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 =~ /FreeBSD/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": "308bbe449e4058103efddff0607105e0", "score": "0.55049556", "text": "def platforms\n [ RUBY_PLATFORM ].tap do |list|\n list.push \"JVM #{java_version}\" if jruby?\n end\n end", "title": "" }, { "docid": "f10768597261a19ffcb1da3b602d0e81", "score": "0.5494009", "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": "59952bb90523caf97471d88f4bada7b2", "score": "0.5493973", "text": "def choose_platform_set(config, reason, desired_platforms, library_properties)\n\n # if there are no properties or no architectures, defer entirely to desired platforms\n if library_properties.nil? || library_properties.architectures.nil? || library_properties.architectures.empty?\n # verify that all platforms exist\n desired_platforms.each { |p| assured_platform(reason, p, config) }\n return inform_multiline(\"No architectures listed in library.properties, using configured platforms\") do\n desired_platforms.each { |p| puts \" #{p}\" } # this returns desired_platforms\n end\n end\n\n if library_properties.architectures.include?(\"*\")\n return inform_multiline(\"Wildcard architecture in library.properties, using configured platforms\") do\n desired_platforms.each { |p| puts \" #{p}\" } # this returns desired_platforms\n end\n end\n\n platform_architecture = config.platform_info.transform_values { |v| v[:board].split(\":\")[1] }\n supported_platforms = platform_architecture.select { |_, a| library_properties.architectures.include?(a) }\n\n if config.is_default\n # completely ignore default config, opting for brute-force library matches\n # OTOH, we don't need to assure platforms because we defined them\n return inform_multiline(\"Default config, platforms matching architectures in library.properties\") do\n supported_platforms.keys.each do |p| # rubocop:disable Style/HashEachMethods\n puts \" #{p}\"\n end # this returns supported_platforms\n end\n end\n\n desired_supported_platforms = supported_platforms.select { |p, _| desired_platforms.include?(p) }.keys\n desired_supported_platforms.each { |p| assured_platform(reason, p, config) }\n inform_multiline(\"Configured platforms that match architectures in library.properties\") do\n desired_supported_platforms.each do |p|\n puts \" #{p}\"\n end # this returns supported_platforms\n end\nend", "title": "" }, { "docid": "1564e2e61625525968214d7ea6d83ce6", "score": "0.54887265", "text": "def for(platform)\n case platform.to_s\n when 'amazon' then for_amazon\n when 'core_api' then for_core\n end\n end", "title": "" }, { "docid": "530d932c5378dc13bf1bf42a175df6c7", "score": "0.54801637", "text": "def define_platform_classes\n platform_classes = Array.new\n\n platform_classes.push('pe_repo::platform::el_5_x86_64')\n platform_classes.push('pe_repo::platform::el_7_x86_64')\n platform_classes.push('pe_repo::platform::ubuntu_1404_amd64')\n platform_classes.push('pe_repo::platform::debian_7_amd64')\n platform_classes.push('pe_repo::platform::sles_11_x86_64')\n platform_classes.push('pe_repo::platform::solaris_10_i386')\n platform_classes.push('pe_repo::platform::solaris_11_i386')\n\n # Return the array of platform classes\n platform_classes\nend", "title": "" }, { "docid": "530d932c5378dc13bf1bf42a175df6c7", "score": "0.54801637", "text": "def define_platform_classes\n platform_classes = Array.new\n\n platform_classes.push('pe_repo::platform::el_5_x86_64')\n platform_classes.push('pe_repo::platform::el_7_x86_64')\n platform_classes.push('pe_repo::platform::ubuntu_1404_amd64')\n platform_classes.push('pe_repo::platform::debian_7_amd64')\n platform_classes.push('pe_repo::platform::sles_11_x86_64')\n platform_classes.push('pe_repo::platform::solaris_10_i386')\n platform_classes.push('pe_repo::platform::solaris_11_i386')\n\n # Return the array of platform classes\n platform_classes\nend", "title": "" }, { "docid": "cf0a879ccac7331d60aff7fe586bc497", "score": "0.54792213", "text": "def mock_platforms_for_family(platform_family)\n platforms = Set.new\n Dir.glob(File.join(Fauxhai.root, \"**/*.json\")).each do |fauxhai_json_file|\n fauxhai_json = JSON.parse(File.read(fauxhai_json_file))\n fauxhai_platform_family = fauxhai_json['platform_family']\n if fauxhai_platform_family && fauxhai_platform_family.to_sym == platform_family.to_sym\n platforms.add(fauxhai_json['platform'])\n end\n end\n platforms\nend", "title": "" }, { "docid": "364605cfe8e4c2b4a396ef3052401f65", "score": "0.5469037", "text": "def supported_platform?(platform, spec)\n available_platforms = spec.available_platforms\n\n available_platforms.any? { |p| p.name == platform.name }\n end", "title": "" }, { "docid": "d1bd2c04dd1d77cb29d78b80e58c8784", "score": "0.5448446", "text": "def list\n unless params[:platforma].nil?\n #plat = Platform.where('lower(platform) = ?', params[:platforma].downcase).first\n plat = Platform.ignoreCase(params[:platforma]).first\n end\n unless plat.nil? \n @aplikaces = plat.aplikaces.order(\"id DESC\")\n @plId = plat.id\n else \n @aplikaces = Aplikace.all.order(\"id DESC\")\n end\n @platforms = Platform.all\n end", "title": "" }, { "docid": "eb3d44d5bc12087e886345b3af05596a", "score": "0.54418707", "text": "def get_platform(platform = nil)\n platform ||= RUBY_PLATFORM\n case platform\n when /darwin/ then :MACOS\n when /cygwin|mswin|mingw|bccwin|wince|emx/ then :WINDOWS\n else :LINUX\n end\n end", "title": "" }, { "docid": "81691ec662db0a51b71c82413f2c8974", "score": "0.54227644", "text": "def test_ListPlatformTypes\n\t\tcolName = 'types'\n\t\tretClass = LeanTesting::PlatformType\n\t\tresp = rcol(colName, ['_id', 'name'])\n\t\t@client.debugReturn = {'data'=> JSON.generate(resp), 'status'=> 200}\n\n\t\tcol = @client.platform.types.all\n\n\t\tassert_equal resp[colName], col.toArray\n\t\tassert_instance_of retClass, col.collection[0]\n\t\tassert_equal resp['meta']['pagination']['total'], col.total\n\t\tassert_equal resp['meta']['pagination']['total_pages'], col.totalPages\n\t\tassert_equal resp['meta']['pagination']['count'], col.count\n\tend", "title": "" }, { "docid": "ac7c9bbe4b27a3bd310f8e0a1512c4ef", "score": "0.5418663", "text": "def platform\n @platform ||= data.platform\n end", "title": "" }, { "docid": "c0d228415c58d404b5c019086b896e8f", "score": "0.54007375", "text": "def platform\n fetch('game.platform')\n end", "title": "" }, { "docid": "8c37ede7d487f1d5d52bfd11fab94f9e", "score": "0.53897274", "text": "def index\n @platforms = Platform.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @platforms }\n end\n end", "title": "" }, { "docid": "27ff812d54a18f54a03eaba35514f991", "score": "0.5372973", "text": "def platform\n fetch('device.platform')\n end", "title": "" }, { "docid": "6b18e0c9ec1ef0cc2411992105b681f0", "score": "0.5351213", "text": "def platform\n @platform ||= NoPlatform.new\n end", "title": "" }, { "docid": "32e197e11222d5dae2518882bae1048d", "score": "0.53344136", "text": "def platform?(*args)\n has_platform = false\n\n args.flatten.each do |platform|\n has_platform = true if platform.to_s == node[:platform]\n end\n\n has_platform\n end", "title": "" }, { "docid": "4735285be5d902a996d22e9c16d5132c", "score": "0.5331238", "text": "def platform(platform = nil, options={})\n platform ? @platform = Platform.new(platform, options) : @platform\n end", "title": "" }, { "docid": "ae7ebe9d2881764ee79586fb9ce0f656", "score": "0.5312548", "text": "def platform_name; non_framework_platforms.first; end", "title": "" }, { "docid": "dd5735526cd3d6706098400d7285c97a", "score": "0.5310272", "text": "def show\n @platforms = Platform.find(params[:id])\n end", "title": "" }, { "docid": "54eee18d39213132c1af406680809b39", "score": "0.5302304", "text": "def index\n @aws_platforms = AwsPlatform.all\n end", "title": "" }, { "docid": "f5d01c10156d25e77941cc0af69102a6", "score": "0.5277513", "text": "def custom_fields_by_type(type)\n custom_fields.select { |field| field.type == \"platformCore:#{type}\" }\n end", "title": "" }, { "docid": "05bacd989241ea9b0688381a1ec5a0e8", "score": "0.5259488", "text": "def actual_platform\n platform = nil\n\n if explicit_platform.nil? == false\n platform = explicit_platform\n elsif datastore['PLATFORM']\n platform = datastore['PLATFORM']\n elsif assoc_exploit\n platform = assoc_exploit.target_platform\n end\n\n # If we still have an invalid platform, then we suck.\n if platform.nil?\n raise NoCompatiblePayloadError, \"A platform could not be determined by the generic payload\"\n elsif platform.kind_of?(String)\n platform = Msf::Module::PlatformList.transform(platform)\n end\n\n return platform\n end", "title": "" }, { "docid": "53348b30739b6ef85c650f6ec1ba00ba", "score": "0.5259463", "text": "def normalize_platform(platform, platform_version)\n if platform == \"solaris\"\n platform = \"solaris2\"\n\n # Here platform_version is set to either 10 or 11 and we would like\n # to normalize that to 5.10 and 5.11.\n platform_version = \"5.#{platform_version}\"\n end\n\n [platform, platform_version]\n end", "title": "" }, { "docid": "958038c82cb3fe1d94dc239b0b92d56a", "score": "0.5255273", "text": "def platform\n data.platform\n end", "title": "" }, { "docid": "c9651dadee61a69c3b550f3f5a15b371", "score": "0.52379155", "text": "def platform?(what)\n\t\t(platform & what).empty? == false\n\tend", "title": "" }, { "docid": "78b8f9cc17953322decf02e5bc1c6b62", "score": "0.5232616", "text": "def platform_filters_available?\n !options.platform.nil?\n end", "title": "" }, { "docid": "65ecf464566b296a185239db4fc841fb", "score": "0.5229756", "text": "def platform\n @platform ||= Train::Platforms::Detect.scan(self)\n end", "title": "" }, { "docid": "c03acd9757e64985d01998161b3a62f5", "score": "0.5225977", "text": "def get_applicable_plugins(type)\n PluginManager.get_plugins_by('items', type)\n end", "title": "" }, { "docid": "b277ff8492f099bc783bcb376ce43081", "score": "0.52153754", "text": "def on platform\n return OS.send(\"#{platform}?\").tap{ |yn| yield yn if block_given? }\n end", "title": "" }, { "docid": "4126df11106efd8a3c90a32f2cfcf59f", "score": "0.520252", "text": "def find_server_platform(server_name)\n get_platform = VALID_PLATFORMS.select { |name| server_name.downcase.include?(name) }\n get_platform.first\n end", "title": "" }, { "docid": "f82889c8a9e554a05413a19c530c7e61", "score": "0.5189392", "text": "def platform\n @_platform ||= self.context.platform\n end", "title": "" }, { "docid": "f82889c8a9e554a05413a19c530c7e61", "score": "0.5189392", "text": "def platform\n @_platform ||= self.context.platform\n end", "title": "" }, { "docid": "f82889c8a9e554a05413a19c530c7e61", "score": "0.5189392", "text": "def platform\n @_platform ||= self.context.platform\n end", "title": "" }, { "docid": "f6a5d5bb69a4ecfbf9b1380b9d93316a", "score": "0.51854175", "text": "def platform\n @attributes[:platform]\n end", "title": "" }, { "docid": "6304c43644080c38067b5bd73e6f6ea4", "score": "0.5182877", "text": "def get_platform\n rpc_get_fact_direct('kernel')\n end", "title": "" }, { "docid": "15c0b94336342001d742488fd8386623", "score": "0.5180908", "text": "def filter_instances\n suites.product(platforms).select do |suite, platform|\n if !suite.includes.empty?\n suite.includes.include?(platform.name)\n elsif !suite.excludes.empty?\n !suite.excludes.include?(platform.name)\n else\n true\n end\n end\n end", "title": "" }, { "docid": "2ac700e23bd75a2b6fe6626964514df3", "score": "0.5175", "text": "def what_platform\n if @platform == \"PC\"\n puts \"PC are Awesome!\"\n else\n puts \"This platform is inferior\"\n end\n end", "title": "" }, { "docid": "b3e3a764a7790e46009f071d3452dc17", "score": "0.5172828", "text": "def index\n @platforms = Platform.paginate(:page => params[:page], :per_page => 10).order('id DESC').accessible_by(current_ability)\n end", "title": "" }, { "docid": "4b79a56b884f5cb06e4b55a5022beab4", "score": "0.51702607", "text": "def platform(name=nil, path=nil)\n error \"Platform name is blank\" if name.blank?\n error \"Platform path is blank\" if path.blank?\n error \"Platform name is not a string\" unless name.kind_of?(String)\n debug \"Registering platform name [#{name}] by engine path [#{path}]\"\n error \"Platform [#{name}] has already been registered\" if platform_names.include?(name)\n platform_names.push(name)\n totem_settings.defaults.platform_settings(name)\n end", "title": "" }, { "docid": "ddb3b919441bb11f8b22bd32d960a34a", "score": "0.5168738", "text": "def get_platforms(tmdb_id)\n # Converts the given tmdb_id into a URI friendly parameter\n parameter = tmdb_id.downcase.tr(' ', '_')\n\n # Build the request URL using the parameter\n url =\n URI(\n \"https://rapidapi.p.rapidapi.com/idlookup?source=tmdb&country=us&source_id=movie/#{\n parameter\n }\"\n )\n\n # Use utility function to make the api call with propper headers and settings\n results = make_telly_request(url)\n\n # Return nil if the results are empty\n return nil if results['collection']['locations'] == nil\n # Store the platforms in an array\n results_array = results['collection']['locations']\n # prints a loading bar to indicate an api call (no new line)\n print '###'\n # return an array of hashes with just the platform display name\n results_array.map { |item| { platform: item['display_name'] } }\n end", "title": "" }, { "docid": "18f6b180b09681303e3500c628c231e6", "score": "0.51667535", "text": "def platform\n return @platform\n end", "title": "" }, { "docid": "bed76e5841d1c3b6d6178dbe3af85fb0", "score": "0.51630765", "text": "def builds(platform: nil)\n all = TestFlight::Build.all(app_id: self.apple_id, platform: platform || self.platform)\n return all unless block_given?\n all.each { |build| yield(build) }\n end", "title": "" }, { "docid": "4b19d9028c64b67a021fb1e9c4bc3e33", "score": "0.51481783", "text": "def platform=(value)\n @platform = value\n end", "title": "" }, { "docid": "9ed5bd5fd73d813fda5b49229df15efb", "score": "0.5137212", "text": "def supports(platform, *version_args)\n version = new_args_format(:supports, platform, version_args)\n constraint = validate_version_constraint(:supports, platform, version)\n @platforms[platform] = constraint.to_s\n @platforms[platform]\n end", "title": "" }, { "docid": "90ceb2bd83021b6e89d1357bf0b056bf", "score": "0.5136619", "text": "def platform\n case number\n when /whatsapp/\n 'whatsapp'\n when /messenger/\n 'messenger'\n else\n 'sms'\n end\n end", "title": "" }, { "docid": "1d03aa982b5193a179fc2d947b000ab7", "score": "0.5126001", "text": "def lsplat( platform_info )\n print_line\n print_line\n print_info 'Available platforms:'\n print_line\n\n platform_info.each do |type, platforms|\n print_status \"#{type}\"\n\n platforms.each do |shortname, fullname|\n print_info \"#{shortname}:\\t\\t#{fullname}\"\n end\n\n print_line\n end\n\n end", "title": "" }, { "docid": "15661ddd736934e37a74f12e3d8f30ca", "score": "0.51205695", "text": "def platform\n if self.version_sets.nil?\n raise 'The application has no version sets and Spaceship does not know what to do here.'\n end\n\n if self.version_sets.length == 1\n version_sets[0].platform\n elsif self.platforms == %w(ios appletvos)\n 'ios'\n end\n Spaceship::Tunes::AppVersionCommon.find_platform(raw_data['versionSets'])['platformString']\n end", "title": "" }, { "docid": "bbf7bf8e8b950f3ffa5f9f2195388562", "score": "0.5118956", "text": "def platform\n raise NotImplementedError\n end", "title": "" }, { "docid": "bbf7bf8e8b950f3ffa5f9f2195388562", "score": "0.5118956", "text": "def platform\n raise NotImplementedError\n end", "title": "" }, { "docid": "6fa053b6422181497171c3e299743b15", "score": "0.51183724", "text": "def platform_type=(platform_type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(platform_type)\n fail ArgumentError, \"invalid value for \\\"platform_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @platform_type = platform_type\n end", "title": "" }, { "docid": "b7291e7c9187dcf40b66c5f34b4ca3f7", "score": "0.51139045", "text": "def platform_name\n capabilities['platformName']\n end", "title": "" }, { "docid": "17e5c5c93db529f99a9c449f4064a283", "score": "0.5107701", "text": "def eval_platform\n if @platform == \"PC\"\n puts \"PC are great!\"\n else\n puts \"Your platform is probably underpowered.\"\n end\n end", "title": "" }, { "docid": "631b158fe2e945d75f591f00fae92e5d", "score": "0.50995755", "text": "def initialize(\n logger: Logger.new($stdout),\n logger_stderr: Logger.new($stderr),\n config: Config.new,\n cmd_runner: CmdRunner.new\n )\n init_loggers(logger, logger_stderr)\n @config = config\n @cmd_runner = cmd_runner\n @platform_types = Plugins.new(:platform_handler, logger: @logger, logger_stderr: @logger_stderr)\n # Keep a list of instantiated platform handlers per platform type\n # Hash<Symbol, Array<PlatformHandler> >\n @platform_handlers = {}\n # Read all platforms from the config\n @config.platform_dirs.each do |platform_type, repositories|\n repositories.each do |repository_path|\n platform_handler = @platform_types[platform_type].new(\n platform_type,\n repository_path,\n logger: @logger,\n logger_stderr: @logger_stderr,\n config: @config,\n cmd_runner: @cmd_runner\n )\n # Check that this platform has unique name\n raise \"Platform name #{platform_handler.name} is declared several times.\" if @platform_handlers.values.flatten.any? { |known_platform| known_platform.name == platform_handler.name }\n\n @platform_handlers[platform_type] = [] unless @platform_handlers.key?(platform_type)\n @platform_handlers[platform_type] << platform_handler\n end\n end\n end", "title": "" }, { "docid": "aa7d00906fd48f5dd7776e6f14dba3dd", "score": "0.5095428", "text": "def match_platform?(*platforms)\n platforms.each do |platform|\n platform.to_s =~ /^(non_)?(.*)/\n\n non = true if $1\n match_platform = !RUBY_PLATFORM.index($2).nil?\n return false unless (non && !match_platform) || (!non && match_platform)\n end\n\n true\n end", "title": "" }, { "docid": "8399de5bf22e5e2674bf32168d1e7be2", "score": "0.5082901", "text": "def platform\n backend.platform\n end", "title": "" }, { "docid": "085c7818b691156eaa66e289c5d39c0d", "score": "0.50822", "text": "def platform\n kernel.platform\n end", "title": "" }, { "docid": "10f87f60e6014874fb807b311d916808", "score": "0.50813293", "text": "def platform\n @spec.platform\n end", "title": "" }, { "docid": "f69f5d8c80cb6973e89bffd5b1d0bb95", "score": "0.5078685", "text": "def mobile_platform\n return @children['mobile-platform'][:value]\n end", "title": "" } ]
812d659affce13c5cf808b13aee25c88
returns all the schools with a calification in a given interval,
[ { "docid": "1e6ee40572ef6be4c1a1ca70826d06ab", "score": "0.5454805", "text": "def intervals\n #query = \"SELECT idschool,codesc,nomeesc,bairro,end_esc\"\n #query = query + \",num_esc,ab1em_14,ap3em_14,enem2013,longitude,latitude FROM schoolbs\"\n query = \"SELECT * FROM (SELECT row_number() OVER (ORDER BY s.enem2013 DESC nulls last) as ranking,\"\n query = query + \" idschool,codesc,nomeesc,bairro,end_esc,num_esc,ab1em_14,ap3em_14,enem2013,nomemun,telefone,cep,\"\n query = query + \" CASE WHEN biblio>0 THEN 'SIM' ELSE 'NÃO' END as id_biblio,\"\n query = query + \" CASE WHEN lab_inf>0 THEN 'SIM' ELSE 'NÃO' END as id_lab_inf,\"\n query = query + \" longitude,latitude FROM schoolbs s) t1 LEFT JOIN ( SELECT schoolb_id, NULLIF(AVG(value),0.0)\"\n query = query + \" as stars FROM qualifications GROUP BY schoolb_id) t2 ON t1.idschool = t2.schoolb_id\"\n query = query + \" WHERE t1.\" + params[:test] + \" >= \" + params[:lo] + \" AND t1.\" + params[:test] + \" <= \" + params[:hi];\n #render html: query\n @schoolbs = Schoolb.find_by_sql(query)\n end", "title": "" } ]
[ { "docid": "6f9dee276641eae193124429f5d592ee", "score": "0.64154047", "text": "def schools\n Rollcall::School.for_user(self).order(:display_name)\n end", "title": "" }, { "docid": "fbf1adbcb972328db851f9bb559bbced", "score": "0.5883386", "text": "def schools(starting_position)\n (@leaderboard.drop(starting_position-1) || []).map { |sr| sr.school }\n end", "title": "" }, { "docid": "dd7fd8ce07f0c90793ec53961c2a473f", "score": "0.58303636", "text": "def students\n Rollcall::Student.find_all_by_school_id schools\n end", "title": "" }, { "docid": "ba3867a01a737aa0734151c90d32603d", "score": "0.5828739", "text": "def acceptable_years_in_school\n Array(min_year_in_school..max_year_in_school)\n end", "title": "" }, { "docid": "a5870b7e0d488b1871538ab0471a1a4b", "score": "0.573958", "text": "def periods_in_school\n if periods.map(&:school_id).any?{|id| id != school_id }\n errors.add(:periods, 'must be in the same school as the student')\n end\n end", "title": "" }, { "docid": "6cd44b9ab7be7f365c1d41019441a0ab", "score": "0.5627834", "text": "def get_schools_per_location(location_id)\n schools_by_year = ActiveRecord::Base.connection.execute(\"SELECT yyyy, COUNT(school_id) FROM (SELECT extract(year FROM events.date) AS yyyy, students.school_id FROM events JOIN attendances ON attendances.event_id = events.id JOIN students ON attendances.student_id = students.id WHERE events.location = #{location_id} GROUP BY students.school_id, yyyy) AS years_school_attendances GROUP BY yyyy;\")\n schools_grouped = {}\n schools_by_year.each do |unique_schools|\n schools_grouped[unique_schools['yyyy']] = unique_schools['count']\n end \n return schools_grouped\n end", "title": "" }, { "docid": "6d78d4e441f2e42a70df1dc3bf833421", "score": "0.5614855", "text": "def classrooms_for_school(school)\n classrooms.order(:name).select{|c| c.school == school}\n end", "title": "" }, { "docid": "258be0652a7d92b928d6420b09f06343", "score": "0.5594192", "text": "def starting_school(schools)\n schools.find { |school| school.id == @starting_school_id }\n end", "title": "" }, { "docid": "83d25edc238307d54dd00a4c481366cd", "score": "0.55744684", "text": "def base_query(include_distance: true)\n Bookings::School\n .close_to(coordinates, radius: radius, include_distance: include_distance)\n .that_provide(subjects)\n .at_phases(phases)\n .costing_upto(max_fee)\n .enabled\n .with_availability\n .distinct\n end", "title": "" }, { "docid": "73612c2663aa9b7866950c2f3086cbaf", "score": "0.55378777", "text": "def school_list\n @schools.to_a\n end", "title": "" }, { "docid": "86be7436e4f9290360749573f3c6206e", "score": "0.55317116", "text": "def results_for_school(school, division)\n section_results(division).map { |sec|\n sec && sec.points_for_school(school) || 0\n }\n end", "title": "" }, { "docid": "8e449603b80330ff5cefd0a7b23240cd", "score": "0.5499492", "text": "def school\n @school = School.find(params[:id])\n\n\tyear = params[:date][:year]\n\tgrade = params[:grade_name]\n\t\n\tdefault_params = {\n\t\t:date_year => year,\n\t\t:grade_name => grade,\n\t\t:school_id => @school.id\n\t}\n\t\n\t@classroom = Classroom.new(default_params)\n\t@staff = Staff.new(default_params)\n\t\n\t@classrooms = @school.classrooms.find_all_by_date_year_and_grade_name(year, grade)\n\t@staff_members = @school.teachers.find_all_by_date_year_and_grade_name(year, grade)\n end", "title": "" }, { "docid": "ec9fa5c1498e3c2d51cfd031c6de865a", "score": "0.5487586", "text": "def get_courses_to_be_used_by_school(type, school)\n # get school's immediate parent\n # traverse up local education agencies until no parent can be found\n # check in state education agencies for parent that failed to be in leas\n # if found, return state education agency\n parent_id = school[\"parent\"]\n parent = @world[\"leas\"].detect {|lea| lea[\"id\"] == parent_id}\n while parent != nil\n parent_id = parent[\"parent\"]\n parent = @world[\"leas\"].detect {|lea| lea[\"id\"] == parent_id}\n end\n # parent_id should now be populated with id of the state education agency\n state_education_agency = @world[\"seas\"].detect {|sea| sea[\"id\"] == parent_id}\n\n courses = Hash.new\n if type == \"elementary\"\n grades = GradeLevelType.elementary\n elsif type == \"middle\"\n grades = GradeLevelType.middle\n elsif type == \"high\"\n grades = GradeLevelType.high\n end\n\n grades.each do |grade|\n # get the current set of courses that the state education agency has published\n # add state education agency id to courses --> makes life easier when creating course offering\n current_courses = (state_education_agency[\"courses\"] or school[\"courses\"])[grade]\n courses[grade] = current_courses\n end\n\n courses\n end", "title": "" }, { "docid": "04b68836803bc66658fbe3784a86cb33", "score": "0.5486739", "text": "def school_years\n load_school_years\n @school_years.sort { |s1, s2| s1.start_date.year <=> s2.start_date.year } \n end", "title": "" }, { "docid": "5f0ccf800ecac3678ab021f67252e284", "score": "0.54122925", "text": "def schools\n @schools ||= School.accessible_by(self)\n end", "title": "" }, { "docid": "a3b78582e79c3f4370ee89c79bcf1c08", "score": "0.5375571", "text": "def who_is_available_on(day, hour)\n @students.select {|s| s.available_on?(day, hour)}\n end", "title": "" }, { "docid": "a69349c542366bf5f1bfc9c75f394eea", "score": "0.53360015", "text": "def all_schools_by_total_desc\n leaderboard(:all).schools(1).each do |sch|\n jnr = points_for_school(sch, :junior)\n snr = points_for_school(sch, :senior)\n tot = jnr + snr\n yield sch, jnr, snr, tot\n end\n end", "title": "" }, { "docid": "ed53ef694b4a04d44239c2c72900bb5a", "score": "0.5330289", "text": "def specific_days_in_semester\n date_start = USDateParse(self.start_date)#USDateParse(self.start_date)\n date_end = USDateParse(self.end_date)#USDateParse(self.end_date)\n curr_date = date_start\n date_hash = Hash.new(0)\n while curr_date <= date_end do\n if (! self.individual_dates_with_no_classes.include?(curr_date))\n date_hash[curr_date.cwday] += 1\n end\n curr_date += 1\n end\n return date_hash\n end", "title": "" }, { "docid": "2b8a215c4212f5bc2c967ffcbc0659a8", "score": "0.52787733", "text": "def schedules\n\n\n\n main_courses = Course.where(department_id: self.department_id)\n .where(course_num: self.course_num)\n .where(term_id: self.search.term_id)\n .where(parent_course_id: nil)\n .includes(:child_courses)\n\n # Loop thru the main courses (the LEC )\n sched_list = main_courses.collect do |course|\n # This is a single section course, so just bail out\n return [course] if course.child_courses.empty?\n \n types = {}\n self.course_types.each do |type|\n types[type] = [] unless type == course.type\n end\n\n course.child_courses.each do |crs|\n types[crs.type] << crs\n end\n\n [course].product(*types.values)\n end\n \n sched_list.flatten(1)\n end", "title": "" }, { "docid": "d6d172129fd120ecf44abafcf0f4dd63", "score": "0.52536035", "text": "def each_school_bonus\n @religious_schools.each do |school_name, school|\n bonuses = {}\n school.each do |k, v|\n next if %W[\n potential_invite_scholar\n can_invite_scholar\n on_invite_scholar\n invite_scholar_modifier_display\n picture\n ].include?(k)\n bonuses[k] = v\n end\n yield school_name, bonuses\n end\n end", "title": "" }, { "docid": "c404d0f8fecdfa28ec7bdface1825072", "score": "0.52234226", "text": "def shifts(cutoff) #find shifts belonging to users with the given skill. called on a skill, looks for dates until cutoff\n skillissues = []\n self.users.each do |user| #for each user linked to the skill, find valid shifts\n usrissues = Issue.lcshift.foruser(user).until_date(cutoff) #old code below\n #usrissues = Issue.all.select {|i| (i.is_labcoach_shift? && (i.start_date <= cutoff)) && (i.assigned_to_id == user.id) }\n usrissues.collect {|ui| skillissues << ui }\n end\n return skillissues\n end", "title": "" }, { "docid": "ea38d8143eb7959317d17363925c7296", "score": "0.52109605", "text": "def list_students_by(year=Date.today.to_s[0,4])\n\t\t#pesquisar por ano e depois pedir os alunos\n\n\t\tclassroom = Classroom.find(:first, :conditions => \"year='#{year}' AND name='#{self.name}'\" )\t\t\n\t\treturn classroom.students\n\tend", "title": "" }, { "docid": "f7dde78138bd1a5453f860dc4aa93b7e", "score": "0.5195313", "text": "def school\n filters = ['Student Employment', 'Undergraduate Admission and Student Aid', 'VP For Campus Affairs']\n @school ||= @data[:edupersonschoolcollegename].reject{|c| filters.include?(c)}.last\n end", "title": "" }, { "docid": "bf0046bc77eb38928c7c6f460d8fd8e2", "score": "0.5186264", "text": "def timetable_for_class( school_class )\n Timetable.select{|t| t.school_class == school_class }.to_a\n end", "title": "" }, { "docid": "d3414f9c1f424f250603d75b322ad9a8", "score": "0.51696754", "text": "def school_students(query={})\n self.simple_client.get(\"/api/v1/schools/my/students?#{query.to_query}\")\n end", "title": "" }, { "docid": "10ac9c75c7cf9b4c5ba7c5d82a690839", "score": "0.5147163", "text": "def get_grades(student, school)\t\t\t\t\t\t\t\t\t\t\t\t\t#a. create method to return student's grade\n\tschool[:students].each do |s|\n\t\tputs s[:grade] if s[:name] == student\n\tend\nend", "title": "" }, { "docid": "2edd4b3c1d1867e8b401d38a0cc9aee3", "score": "0.514102", "text": "def index\n @periods = Period.all\n @all_scholarships = Array.new\n @periods.each do |p|\n @all_scholarships << {\"sesiune\" => p, \"burse\" => Domain.where(:period_id => p.id)}\n end\n end", "title": "" }, { "docid": "73841f6921e46ba96397334a05975bfc", "score": "0.514092", "text": "def get_work_intervals(intervals)\n intervals\n .group_by do |interval|\n interval.time_in.to_date\n end\n .values\n end", "title": "" }, { "docid": "5f8c4b7e3f6bd7b2061167ca8e5a327e", "score": "0.51363087", "text": "def opRullSch( sch_1, sch_2 , op, model, runner)\r\n\t\toneDay = OpenStudio::Time.new(1,0,0,0)\r\n\t\toneYear = OpenStudio::Time.new(364,0,0,0)\r\n\t\tfirstDay = OpenStudio::Date.new\r\n\t\tisSch_1Num = sch_1.class == Float\r\n\t\tisSch_2Num = sch_2.class == Float\r\n\t\tdayScheds_1 = dayScheds_2 = []\r\n\t\tisSch_1Num ? dayScheds_1 = Array.new(365, sch_1) : dayScheds_1 = sch_1.getDaySchedules(firstDay,firstDay+oneYear)\r\n\t\tisSch_2Num ? dayScheds_2 = Array.new(365, sch_2) : dayScheds_2 = sch_2.getDaySchedules(firstDay,firstDay+oneYear)\r\n\t\t#runner.registerInfo(\"dayScheds_1[0].name: #{dayScheds_1[0].name.to_s}\") ### Debug ###########################\r\n\t\t#runner.registerInfo(\"dayScheds_1[1].name: #{dayScheds_1[1].name.to_s}\") ### Debug ###########################\r\n\t\toutSchedules = []\r\n\t\tyearOccu = [1..365]\r\n\t\toutSchedules << opDaySch(dayScheds_1[0] , dayScheds_2[0], op, model, runner)\r\n\t\tyearOccu[0]=0\r\n\t\tfor i in 1..364\r\n\t\t\tcurrDaySch = opDaySch(dayScheds_1[i] , dayScheds_2[i], op, model, runner)\r\n\t\t\tmatchFound = false\r\n\t\t\tfor j in 0...outSchedules.length\r\n\t\t\t\tif currDaySch == outSchedules[j]\r\n\t\t\t\t\tyearOccu[i] = j\r\n\t\t\t\t\tmatchFound = true\r\n\t\t\t\t\tbreak\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\t\tunless matchFound\r\n\t\t\t\toutSchedules << currDaySch\r\n\t\t\t\tyearOccu[i] = (outSchedules.length - 1)\r\n\t\t\tend\r\n\t\tend\r\n\t\t\t\r\n\treturn outSchedules, yearOccu\r\n\t\r\n\tend", "title": "" }, { "docid": "6104b9cbf34e94092767339cb7d3f51b", "score": "0.5105936", "text": "def student_has_other_scholarship_duration\r\n return false if enrollment.nil?\r\n return false if scholarship.nil?\r\n #Se a bolsa é mais antiga que a atual scholarship.start_date < start_date\r\n # -> scholarship.cancel_date não é nulo -> scholarhsip.cancel < start_date\r\n # -> scholarship.cancel_date é nulo -> schoarslhip.end_date < start_date\r\n #Senão\r\n # -> cancel_date não é nulo -> schoarslhip.start_date > cancel_date\r\n # -> scholarship.cancel_date é nulo -> schoarslhip.start_date > end_date\r\n\r\n if self.id.nil?\r\n scholarships_with_student = ScholarshipDuration.where(enrollment_id: enrollment.id).all\r\n else\r\n scholarships_with_student = ScholarshipDuration.where(enrollment_id: enrollment.id).where.not(id: self.id).all\r\n end\r\n\r\n scholarships_with_student.each do |scholarship|\r\n if scholarship.start_date <= start_date # se a bolsa é antiga\r\n if scholarship.cancel_date.nil?\r\n return true if scholarship.end_date >= start_date\r\n else\r\n return true if scholarship.cancel_date >= start_date\r\n end\r\n else # se a bolsa é futura\r\n if cancel_date.nil?\r\n return true if scholarship.start_date <= end_date\r\n else\r\n return true if scholarship.start_date <= cancel_date\r\n end\r\n end\r\n end\r\n\r\n false\r\n end", "title": "" }, { "docid": "574d7ea56d6f5bc13715b197b29300f1", "score": "0.510404", "text": "def get_work_days\n puts \"Getting work days...\"\n work_days = []\n biweek = get_biweek\n week_1 = @schedule[biweek[0]].compact.uniq\n week_2 = @schedule[biweek[1]].compact.uniq\n\n @schedule.each_with_index do |row, i|\n DAYS.each_with_index do |day, j|\n date = ( i < biweek[1] ? week_1[j] : week_2[j] )\n day_name = day[:day]\n name = row[day[:name]]\n hours = row[day[:hours]]\n if name && hours && name.downcase.include?(@person.downcase)\n work_days.push({\n :name => @person,\n :date => get_date(date, hours)\n })\n end\n end\n end\n puts \"Work days:\\n#{work_days}\"\n return work_days\nend", "title": "" }, { "docid": "b6e6b0ae177b6579e28dc9b6a48f8fa8", "score": "0.5096419", "text": "def school; end", "title": "" }, { "docid": "827c1ff364ebfd972b062db1d0336ba4", "score": "0.5056695", "text": "def points_for_school(school)\n result_for_school(school).points\n end", "title": "" }, { "docid": "827c1ff364ebfd972b062db1d0336ba4", "score": "0.5056695", "text": "def points_for_school(school)\n result_for_school(school).points\n end", "title": "" }, { "docid": "4117fd71dfbdede6f65058998646a54f", "score": "0.503775", "text": "def saisieable_organisms_with_room\n rooms.select {|r| r.look_for {r.organism.periods.any?} }\n end", "title": "" }, { "docid": "a261095505c77b4a62970ea7f4213251", "score": "0.5036425", "text": "def build_school_hash\n school_stats = {}\n Event.locations.keys.each do |location_id| \n school_stats[location_id] = {} \n school_stats[location_id]['total_attendances'] = get_attends_for_location(Event.locations[location_id])\n school_stats[location_id]['total_students'] = location_students(Event.locations[location_id])\n school_stats[location_id]['total_schools'] = location_schools(Event.locations[location_id])\n school_stats[location_id]['students_grouped'] = location_students_grouped(Event.locations[location_id])\n school_stats[location_id]['schools_grouped'] = location_schools_grouped(Event.locations[location_id])\n end \n return school_stats\n end", "title": "" }, { "docid": "8407638bc22794f27a09ece6bf70456d", "score": "0.50350446", "text": "def points_for_school(school, division)\n results_for_school(school, division).sum\n end", "title": "" }, { "docid": "915f31a6ba6110539d2f080c99433940", "score": "0.5028727", "text": "def return_student_grade(name, school)\n school[:students].select {|student_hash| ap student_hash[:grade] if student_hash[:name] == name}\nend", "title": "" }, { "docid": "0eed93183c12c65acadb023ec9898e53", "score": "0.5020629", "text": "def stairs_in_20(stairs)\n sums = stairs.map { | day | day.sum }\n sums.sum * 20\nend", "title": "" }, { "docid": "4b3dce88fb8d8b14a2f6e3a423d86d7f", "score": "0.50174147", "text": "def schools_and_courses\n @transfer_schools = School.where.not(id: 1).order(:name)\n @ur_courses = School.first.courses.order(:course_num)\n end", "title": "" }, { "docid": "1b8e2dc316caf3ce7133f20bc9ec8f25", "score": "0.50172305", "text": "def school_districts \n Rollcall::SchoolDistrict.for_user(self).order(:name)\n end", "title": "" }, { "docid": "cc668c73628421e73f28f56612af1d1d", "score": "0.5014431", "text": "def create_schools(tag, num_schools, total_num_students)\n if tag == \"elementary\"\n avg_num_students = @scenarioYAML[\"AVERAGE_ELEMENTARY_SCHOOL_NUM_STUDENTS\"]\n index = :elementary\n elsif tag == \"middle\"\n avg_num_students = @scenarioYAML[\"AVERAGE_MIDDLE_SCHOOL_NUM_STUDENTS\"]\n index = :middle\n elsif tag == \"high\"\n avg_num_students = @scenarioYAML[\"AVERAGE_HIGH_SCHOOL_NUM_STUDENTS\"]\n index = :high\n end\n\n if num_schools.nil?\n num_schools = 0\n return num_schools\n end\n\n avg_num_students_threshold = @scenarioYAML[\"AVERAGE_NUM_STUDENTS_THRESHOLD\"]\n min = avg_num_students - (avg_num_students * avg_num_students_threshold)\n max = avg_num_students + (avg_num_students * avg_num_students_threshold)\n school_counter = num_schools\n student_counter = 0\n while student_counter < total_num_students and max > min\n current_students = random_on_interval(min, max).round\n school_counter += 1\n current_students = (total_num_students - student_counter) if current_students > (total_num_students - student_counter)\n student_counter += current_students\n school_id = school_counter\n members = []\n\n school_id, members = @pre_requisites[index].shift if @pre_requisites[index].size > 0\n # Set the parent edOrg based on catalog, or keep nil and dump school into first LEA in list\n begin_year = @scenarioYAML[\"BEGIN_YEAR\"]\n num_years = @scenarioYAML[\"NUMBER_OF_YEARS\"]\n\n parent = nil\n\n unless members.empty?\n parent = members[\"staff\"].nil? ? nil : members[\"staff\"][0][:parent]\n catalog_students = members[\"students\"]\n end\n\n # remember the school's state organization id if it's a String --> pop off later when creating education organizations\n @schools << school_id if school_id.kind_of? String\n\n staff, teachers, students = create_staff_and_teachers_for_school(members)\n\n school = {\n \"id\" => school_id,\n \"parent\" => parent,\n \"sessions\" => [],\n \"staff\" => staff,\n \"teachers\" => teachers,\n \"offerings\" => {},\n \"catalog_students\" => {begin_year => catalog_students},\n \"students\" => {begin_year => assemble_students_into_waves(tag, current_students)},\n \"programs\" => create_programs_for_education_organization(tag, :SCHOOL),\n }\n if not @scenarioYAML['COURSES_ON_SEA']\n school[\"courses\"] = create_courses(school_id)\n end\n @world[tag] << school\n end\n school_counter\n end", "title": "" }, { "docid": "a402852b2cc52454f95d4e343140a120", "score": "0.5007014", "text": "def index\n @cms_schools = Cms::School.all\n end", "title": "" }, { "docid": "4eab3f23937554ceca5ec9cd23ee21b7", "score": "0.49826515", "text": "def holidays_with_bbqs(holiday_supplies)\n bbqs_array = []\n holiday_supplies.each do |season, holiday_hash| \n holiday_hash.each do |day, supplies| \n supplies.each do |supply| \n if supply == \"BBQ\"\n bbqs_array << day \n end\n end\n end\n end\nbbqs_array\nend", "title": "" }, { "docid": "55f9dd59dd892a79e3172c5669ad46d1", "score": "0.49785188", "text": "def get_semesters_hours\n\t\t@plans_courses_hash = get_semesters_courses\n\t\t@plan_semester_hours = Hash.new\n\t\t@plans_courses_hash.each do |key, array|\n\t\t\t@plan_semester_hours[\"#{key}\"] = 0\n\t\t\tarray.each do |course|\n\t\t\t\t@plan_semester_hours[\"#{key}\"] += course.hr_low\n\t\t\tend\n\t\tend\n\t\treturn @plan_semester_hours\n\tend", "title": "" }, { "docid": "1acffb3e9db8979fe9a79d57c0fa2353", "score": "0.49676716", "text": "def supported_schools\n @supported_schools ||= School.where(school_type: ['ECS', 'ESMS', 'ES', 'MS'])\n end", "title": "" }, { "docid": "cefb9402e7f163009087872f9fa31aa6", "score": "0.49541247", "text": "def students\n filters = []\n filters.push(\"{SCHOOL_TFPID} = '#{goddamn_school}'\") if goddamn_school\n Student.some(\n shard: self.goddamn_city,\n sort: [\"Name\", :asc],\n filterByFormula: \"AND(#{filters.join(',')})\"\n )\n end", "title": "" }, { "docid": "69c155a8cf6125e48ccaecf708c44f88", "score": "0.4947457", "text": "def schools_valid?\n valid = true\n self.schools.each do |school|\n unless school.qualifications_valid?\n self.errors.add(:school, \"'#{school.name}' does not have any qualifications\")\n valid = false\n end\n end\n valid\n end", "title": "" }, { "docid": "38258f5d60708773ba53df7c29ecc842", "score": "0.4933699", "text": "def active_seps(day = Date.today)\n special_enrollment_periods.find_all { |sep| (sep.start_date..sep.end_date).include?(day) }\n end", "title": "" }, { "docid": "b8d14520a9cdbc3f348ea567161a007d", "score": "0.49041045", "text": "def update_schools_with_districts(num_schools)\n if num_schools.nil? or num_schools == 0\n return\n end\n avg_num_schools_per_district = @scenarioYAML[\"AVERAGE_NUM_SCHOOLS_PER_DISTRICT\"]\n avg_num_schools_threshold = @scenarioYAML[\"AVERAGE_SCHOOLS_THRESHOLD\"]\n min_num_schools_per_district = avg_num_schools_per_district - (avg_num_schools_per_district * avg_num_schools_threshold)\n max_num_schools_per_district = avg_num_schools_per_district + (avg_num_schools_per_district * avg_num_schools_threshold)\n all_schools = (1..num_schools).to_a\n district_counter = num_schools\n school_counter = 0\n while all_schools.size > 0\n district_counter += 1\n district_id = district_counter\n members = []\n num_schools_in_this_district = random_on_interval(min_num_schools_per_district, max_num_schools_per_district).round\n num_schools_in_this_district = (num_schools - school_counter) if num_schools_in_this_district > (num_schools - school_counter)\n\n district_id, members = @pre_requisites[:leas].shift if @pre_requisites[:leas].size > 0\n\n schools_in_this_district = []\n while @schools.size > 0 and num_schools_in_this_district > 0\n schools_in_this_district << @schools.shift\n num_schools_in_this_district -= 1\n end\n\n if num_schools_in_this_district > 0\n schools_in_this_district << all_schools.pop(num_schools_in_this_district)\n schools_in_this_district.flatten!\n end\n\n update_schools_with_district_id(district_id, schools_in_this_district)\n\n @world[\"leas\"] << {\"id\" => district_id,\n \"parent\" => nil,\n \"sessions\" => [],\n \"staff\" => create_staff_for_local_education_agency(members),\n \"programs\" => create_programs_for_education_organization(\"leas\", :LOCAL_EDUCATION_AGENCY)\n }\n school_counter += num_schools_in_this_district\n end\n district_counter\n end", "title": "" }, { "docid": "c3860310ac6707e31b024ee0d5d32f5b", "score": "0.48976967", "text": "def get_semesters_courses\n\t\t@plans_courses = PlansCourse.where(plan_id: @plan.id)\n\t\t@plans_courses_hash = Hash.new\n\t\t@semesters.each do |semester|\n\t\t\t@plans_courses_hash[\"#{semester}\"] = Array.new\n\t\tend\n\t\t@plans_courses.each do |course|\n\t\t\tif(@plans_courses_hash.has_key?(course.taken_planned))\n\t\t\t\t@plans_courses_hash[\"#{course.taken_planned}\"] << Course.find(course.course_id)\n\t\t\tend\n\t\tend\n\t\treturn @plans_courses_hash\n\tend", "title": "" }, { "docid": "8a0c954721fccd7c827d2cf92ef17f75", "score": "0.48878455", "text": "def load_filtered_ended_workshops\n # Default to the last week, by schedule\n end_date = params[:end] || Date.today\n start_date = params[:start] || end_date - 1.week\n query_by = params[:query_by] || QUERY_BY_SCHEDULE\n course = params[:course]\n\n workshops = Pd::Workshop.in_state(::Pd::Workshop::STATE_ENDED)\n unless current_user.permission?(UserPermission::WORKSHOP_ADMIN)\n workshops = workshops.organized_by current_user\n end\n\n # optional '-' (meaning not) followed by a course name\n if course && (match = /^(-)?(.+)$/.match course)\n course_name = COURSE_MAP[match[2]]\n workshops =\n if match[1]\n workshops.where.not(course: course_name)\n else\n workshops.where(course: course_name)\n end\n end\n\n workshops =\n if query_by == QUERY_BY_END\n workshops.end_on_or_after(start_date).end_on_or_before(end_date)\n else # assume by schedule\n workshops.scheduled_start_on_or_after(start_date).scheduled_start_on_or_before(end_date)\n end\n\n workshops\n end", "title": "" }, { "docid": "b7e5482040a2256850d436aa947b68e5", "score": "0.488329", "text": "def schoolteams\n self.teams.where(\"school_id = ?\",self.school).all\n end", "title": "" }, { "docid": "1ea643befab44639e000fa42e3b963f3", "score": "0.48830128", "text": "def school \n @school\n end", "title": "" }, { "docid": "5230d4486ff8d002ddf2b16190c0d05c", "score": "0.4876043", "text": "def primary_school; end", "title": "" }, { "docid": "25e6c17bfb27ab1e5f0d41df0ee6df90", "score": "0.48746005", "text": "def user_schools\n @user_schools ||= School.where(account_name: enabled_account_names)\n end", "title": "" }, { "docid": "66d2830a9733ca6ca628bd7a76d4aba0", "score": "0.4873639", "text": "def get_class_schools\n ret=[]\n self.teachings.to_a.each do |teaching|\n ret<< teaching.teaching_class_school\n end\n #puts \"========================== teacher.get_class_schools: #{ret.count}\"\n ret\n end", "title": "" }, { "docid": "f65578738b5fb2ba846c8a0a46d7c576", "score": "0.4854377", "text": "def cohort_student_assignments\n StudentAssignment.joins(:student).where(student: self.students)\n end", "title": "" }, { "docid": "5150dae85618d37ee3d3b2441018bff6", "score": "0.48533845", "text": "def sports_available(include_all)\n grades_available(include_all).collect(&:sport).uniq\n end", "title": "" }, { "docid": "06fa86df2e18bc92bfcbc8c5b47c1d74", "score": "0.48485994", "text": "def show\n\t\trecords = University.where(['name LIKE ?', \"#{params[:name]}%\"])\n\t\tschools = Array.new\n\n\t\trecords.each do |record|\n\t\t\tcents_rating = RatesSchool.find_by_sql [\n\t\t\t\t'SELECT avg(rating) AS average\n\t\t\t\tFROM rates_schools\n\t\t\t\tWHERE university_id = ?',\n\t\t\t\trecord.id\n\t\t\t]\n\t\t\trecord = record.as_json\n\t\t\trecord[:average_rating] = cents_rating[0][:average].to_f\n\t\t\tschools << record.except('id', 'created_at', 'updated_at')\n\t\tend\n\n\t\tif schools.present?\n\t\t\treturn render json: schools, status: 200\n\t\telse\n\t\t\treturn render json: [], status: 404\n\t\tend\n\tend", "title": "" }, { "docid": "c07f874957a1dd3847d7875b392481f0", "score": "0.48198497", "text": "def all_winter_holiday_supplies(holiday_hash)\n new_array = Array.new\n holiday_hash.each do |season, hash|\n if season == :winter\n hash.each do |holiday, supplies_array|\n if holiday == :christmas || :new_years\n new_array << supplies_array\n end\n end\n end\n end\n new_array.flatten\nend", "title": "" }, { "docid": "fec5f552c986f0de557a207d3ee55c4c", "score": "0.48164827", "text": "def winter_suppliers(holiday_supplies)\n winter_supplies = []\n holiday_supplies[:winter].each do |holiday, supplies|\n supplies.each do |supply|\n winter_supplies << supply\n end\n end\n winter_supplies\nend", "title": "" }, { "docid": "32411b232d7b513c28b4c0c5d67f607b", "score": "0.48125467", "text": "def organize_schools(schools)\n by_location = {}\n schools.each do |school, location_hash|\n # binding.pry\n location_hash.each do |symbol, location|\n if by_location[location] == nil\n by_location[location] = [school]\n else\n by_location[location] << school\n end\n end\n end\n by_location\n end", "title": "" }, { "docid": "fdff1af504eda9b00742ce75adf9c50e", "score": "0.4812246", "text": "def get_schedules\n ret=[]\n #puts \"==============teachings=#{self.teachings.to_a}\"\n self.teachings.to_a.each do |teaching|\n teaching.schedules.each do |schedule|\n ret << schedule\n end\n end\n ret\n end", "title": "" }, { "docid": "b2e32194d2dda849a5a0d26f09b2ac5f", "score": "0.47913408", "text": "def case_list\n\t\t# listing the all the schedule cases with surgeon with ascending schedule date\n\t\t@cases = current_user.cases.order_by(:schedule_date=> :asc).collect{|surgery_case| surgery_case if surgery_case.schedule.schedule_date.to_date.future? || surgery_case.schedule.schedule_date.to_date.today?}.compact\n\tend", "title": "" }, { "docid": "757f7cb029ce3aa4b69e9d5f47b37bce", "score": "0.47843623", "text": "def citas_agendadas(año, semana)\n init = Date.commercial(year = año, cweek = semana)\n citas = self.schedules.where(date: (init)..(init + 5.days))\n\n semanario = {}\n\n citas.each do |c|\n if semanario[c.date.strftime('%u').to_i].nil? \n semanario[c.date.strftime('%u').to_i] = []\n end\n semanario[c.date.strftime('%u').to_i].append( c.date.strftime('%H').to_i )\n end\n\n semanario\n end", "title": "" }, { "docid": "9e788127e375b0cccd105398b00ee6eb", "score": "0.47842202", "text": "def list_cohorts\n @students.each do |student_info|\n if (@cohorts.include? (student_info[:cohort])) == false\n @cohorts << student_info[:cohort]\n end\n end\nend", "title": "" }, { "docid": "ed6b47f55b30988998efe7c1e05b9097", "score": "0.47796118", "text": "def collect_winter_supplies(list)\n\n# using new array and then .each = no-no. i know...\n\n all_supplies = []\n\n list.each do |season, holidays_hash|\n if season == :winter\n holidays_hash.each do |holiday_name, supplies|\n supplies.each do |supply|\n all_supplies << supply\n end\n end\n end\n end\n all_supplies\n\nend", "title": "" }, { "docid": "6d5cb52380b5dd37605ac6fd0dd1e2ad", "score": "0.47776866", "text": "def jobs_for_educator(educator)\n jobs = []\n authorizer = Authorizer.new(educator)\n School.all.each do |school|\n # Skip if they're not authorized for the school\n next unless authorizer.is_authorized_for_school?(school)\n\n # Skip if they're not authorized for any students within that school\n authorized_students = authorizer.authorized { school.students.active.to_a }\n next unless authorized_students.size > 0\n\n # Add a job for students that we need to compute for them within that school\n jobs << { authorized_student_ids: authorized_students.map(&:id) }\n end\n jobs\n end", "title": "" }, { "docid": "a3e9bf8260b91a223ef1183b4649d713", "score": "0.4776002", "text": "def all_winter_holiday_supplies(holiday_hash)\n\twinter_day = []\n holiday_hash.collect do |season, holiday|\n if season == :winter\n holiday.collect do |name, day|\n winter_day << day\n #day\n end\n #winter_day\n end\n #winter_day\n end\n winter_day.flatten\n end", "title": "" }, { "docid": "e4e7180adcfcf3b27faa3ed0d405ac71", "score": "0.4775196", "text": "def soon range=4.days\n schedules.where(:when.lte => range.from_now)\n end", "title": "" }, { "docid": "fa5946e455d73ecbe928ea0bd92f64a6", "score": "0.4772664", "text": "def calculate_searches_for_years(from, to)\n case to - from\n when -1\n []\n when 0,1\n [[from, 0]] + calculate_searches_for_years(from + 1, to)\n when 2,3\n [[from + 1, 1]] + calculate_searches_for_years(from + 3, to)\n when 4,5,6,7,8\n [[from + 2, 2]] + calculate_searches_for_years(from + 5, to)\n else\n [[from + 5, 5]] + calculate_searches_for_years(from + 10, to)\n end\n end", "title": "" }, { "docid": "7726712bd06d5a4dce7672295855de3b", "score": "0.47623435", "text": "def organize_schools(schools)\n by_location = {}\n schools.each do |school, location_hash|\n location_hash.each do |symbol, location|\n if by_location[location] == nil\n by_location[location] = [school]\n else\n by_location[location] << school\n end\n end\n end\n by_location\nend", "title": "" }, { "docid": "f4b3d111cd5547bf489865aa7bb28107", "score": "0.47620896", "text": "def set_workshops\n if params[:year]\n @promo = params[:year]\n else\n @promo = Time.now.to_s(:school_year)\n end\n @workshops = Workshop.order(created_at: :desc).where('year = ?', @promo)\n @years = Workshop.distinct.pluck(:year)\n end", "title": "" }, { "docid": "77ec6ff2c14f66fcfc31d535c8f06715", "score": "0.4758861", "text": "def cohortfilter\n puts \"Please find students by cohort below:\"\n cohort_months = @students.map { |month| month[:cohort]}\n cohort_months.uniq!\n cohort_months.each do |month|\n puts \"Here are the #{month} students\"\n selected_students = @students.select { |student| student[:cohort] == month}\n list(selected_students)\n end\nend", "title": "" }, { "docid": "87dbe01679594235d1d7e48cf2de9107", "score": "0.4758211", "text": "def get_public_holidays( year )\n PublicHoliday.factory( @localization ).all( year ) \n end", "title": "" }, { "docid": "1a55b432273b9b23d5aef29f3173b000", "score": "0.47570154", "text": "def holidays_with_bbqs(holiday_supplies)\n bbq_holidays = []\n holiday_supplies.each do |season, hash|\n hash.each do |holiday, array|\n if array.include?(\"BBQ\")\n bbq_holidays << holiday\n end\n end\n end\n bbq_holidays\nend", "title": "" }, { "docid": "e0d93cda58b00e8b79ecc1503ecdf7e5", "score": "0.47554645", "text": "def grade(student, school)\n school[:students].each do |s|\n return s[:grade] if s[:name] == student\n end\nend", "title": "" }, { "docid": "24e292a360bd70b3c38b521bf46e8fe5", "score": "0.47492477", "text": "def all_holidays_with_bbq(holiday_hash)\n results = []\n holiday_hash.collect do |season, holidays|\n holidays.select do |holiday, supplies|\n supplies.include?(\"BBQ\")\n end.keys\n end.flatten\nend", "title": "" }, { "docid": "35a25adcfdb6e05fc75fddbe2d76c5cd", "score": "0.4744018", "text": "def get_workshop_groups_sorted(year, festival_id = nil)\n\n if year\n start_date = Date.parse('01-01-' + year.to_s)\n end_date = start_date.end_of_year\n workshops = Event.no_draft.where_festival(festival_id).joins(:type, :event_details).where('event_types.id = 2 AND event_details.start_date >= ? AND event_details.start_date <= ?', start_date, end_date).uniq\n else\n start_date = Date.parse('01-01-' + Time.now.year.to_s) # get workshops from beginning of year\n end_date = Time.now.to_s # don't show workshops that ended before today\n workshops = Event.no_draft.where_festival(festival_id).joins(:type, :event_details).where('event_types.id = 2 AND event_details.start_date >= ? AND event_details.end_date >= ?', start_date, end_date).uniq\n end\n \n events_by_dates = workshops\n .sort_by { |e| [e.firsttime, e.title] }\n .group_by { |e| [e.start_date, e.end_date] }\n \n events_by_dates.each do |dates, events|\n events_by_dates[dates] = workshops_sort events \n end \n \n return events_by_dates\n\n end", "title": "" }, { "docid": "e7161764aaec2e22d72e43f46c122d57", "score": "0.47403458", "text": "def get_contemporary_seasons_involved_into(season)\n @swimmer.seasons.is_in_range(season.begin_date, season.end_date)\n end", "title": "" }, { "docid": "099814aa03a4719ff5859c7aa36325fe", "score": "0.4739128", "text": "def lower_bounds_constraint\n self.students.each do |student|\n self.sections.each do |section|\n self.problem[ VAR_f(student.id, section.id) - self.lower_fte_bound * VAR_b(student.id, section.id, \"bool\") >= 0 ]\n self.problem[ VAR_f(student.id, section.id) - 10 * VAR_b(student.id, section.id, \"bool\") <= 0 ]\n end\n end\n end", "title": "" }, { "docid": "c429696482f89f4dda1deb26dbe0db0c", "score": "0.47383857", "text": "def organize_schools(schools)\n schools_by_location = {}\n\n schools.each do |schoolname, details_hash|\n location = details_hash[:location]\n if schools_by_location.has_key?(location)\n schools_by_location[location] << schoolname\n else\n schools_by_location[location] = [schoolname]\n end\n end\n \n schools_by_location\nend", "title": "" }, { "docid": "0ed8ef60db7cbee28e06183e501178fa", "score": "0.47378606", "text": "def staff\n group.staff + group.group_type.courses.map(&:convenor)\n end", "title": "" }, { "docid": "3855c75a2e67379958eb7a892d8497fb", "score": "0.47326443", "text": "def scheduled_lessons_for_student(student_id)\n scheduled_course.scheduled_lessons.for_student(student_id)\n end", "title": "" }, { "docid": "95c1319520291870070e9d7ba59aa211", "score": "0.47314999", "text": "def create_master_schedule()\n # creating course offerings does not require any randomization --> only logic\n # -> computes intersection of courses to be offered at school with school's sessions\n offering_id = 0\n offering_id = create_course_offerings_for_school(\"elementary\", offering_id)\n offering_id = create_course_offerings_for_school(\"middle\", offering_id)\n offering_id = create_course_offerings_for_school(\"high\", offering_id)\n end", "title": "" }, { "docid": "1c7c81f27c6c6d4d68e492e2e13b479f", "score": "0.4730524", "text": "def absolved_students_with_years\n is = Index.find_for(User.find_by_login('ticha'))\n is = is.select {|i| i.absolved?}.sort {|i, j| i.semester <=> j.semester}\n isd = is.group_by(&:faculty)\n isd.each do |faculty|\n File.open(\"absolved_%s.csv\" % faculty.first.short_name, 'wb') do |outfile|\n CSV::Writer.generate(outfile, ';') do |csv|\n csv << ['student', 'semestr', 'start', 'konec']\n faculty.last.each do |index|\n csv << [index.student.display_name, index.semester, index.enrolled_on.to_date, index.disert_theme.defense_passed_on.to_date]\n end\n end\n end\n end\n end", "title": "" }, { "docid": "c3e4f74917c72ce1ad2f30dab501e1d7", "score": "0.47300455", "text": "def all_holidays_with_bbq(holiday_supplies)\n holiday_supplies.map do |season, holidays|\n holidays.map do |holiday, supplies|\n holiday if supplies.include?(\"BBQ\")\n end\n end.flatten.compact\nend", "title": "" }, { "docid": "ca11519d9007d14f9444c3eac5ffaa5f", "score": "0.47214693", "text": "def show\n @gss = @grade_section.students_for_academic_year(params[:year])\n end", "title": "" }, { "docid": "3cb41f8a92a292e1e9c67b8ed3d8e5b8", "score": "0.47118413", "text": "def list_for_year(year)\n populate_public_holiday_collection_for_year(year)\n holiday_dates = Array.new\n @public_holiday_collection.each do |ph|\n holiday_dates << ph.to_s if ph.year == year\n end\n holiday_dates\n end", "title": "" }, { "docid": "7798f7d33aef1220245a7b1862ef8ac8", "score": "0.47107318", "text": "def extract_from(students, cohort_sym)\n\tif !cohort_sym == :Nofilter\n\t\tresults = students.select do |student|\n\t\t\tstudent[:cohort] == cohort_sym\n\t\t\tend\n\telse \n\t\tresults = students\n\tend\n\tresults\nend", "title": "" }, { "docid": "38d90a8083975735eca7c114637dbfbe", "score": "0.46877122", "text": "def sport_reg_exp (all_schedules)\n reg_exp_sports = Hash.new\n all_schedules.each do |current|\n reg_exp_sports[current.sport] = create_reg_exp current.sport\n end\n reg_exp_sports\nend", "title": "" }, { "docid": "d4b7c5b82ff6c5bb2ed61de8ff85892a", "score": "0.46865904", "text": "def schedule\n # obtain list of required courses\n course_titles = RequiredCourse.all\n\n # obtains Courses associated with each of these titles\n courses = []\n course_titles.each do |ct|\n courses.push(Course.where(subject: Subject.where(department: ct.department), courseId: ct.courseId).first)\n end\n\n return schedule_courses(courses, [[]])\n\n\n end", "title": "" }, { "docid": "2f27e34ee579839143bb3a1c5b5a4ca9", "score": "0.468317", "text": "def census\n GreatSchools::Census.for_school(state, id)\n end", "title": "" }, { "docid": "f0099176b0165976aabd667dbeaace15", "score": "0.46814078", "text": "def get_grade(school, name) \n\t\t\t grade = nil\n school[:students].each do |student|\n if student[:name] == name\n grade = student[:grade]\n end\n end\n return grade\nend", "title": "" }, { "docid": "7e1b504b777facb058c98cb52a8bb5a2", "score": "0.46775928", "text": "def all_holidays_with_bbq(holiday_hash)\n chosen = []\n holiday_hash.each do |season, holiday|\n holiday.each do |holiday, supplies|\n if supplies.include?(\"BBQ\") == true\n chosen << holiday\n end\n end\n end\n chosen\nend", "title": "" }, { "docid": "d0be97f0a2901d0944013bdb1df75518", "score": "0.4676774", "text": "def students\n self.course_person.all(:type => \"student\").persons\n end", "title": "" }, { "docid": "6bbb6036faf4ec325cebc41cd8cd40a2", "score": "0.4676493", "text": "def active_school_year\n load_school_years\n @active \n end", "title": "" }, { "docid": "cd28a9a406db788ce61d958547a3ebdc", "score": "0.46750405", "text": "def intervals\n @intervals ||= BoardInterval.find_all(interval_set.members)\n end", "title": "" }, { "docid": "d480e128522d9c4093b2a784c00c0f1e", "score": "0.46696928", "text": "def list_cohorts(students)\n students.each do |key, value|\n puts \"#{key} : #{value} students\"\n end\nend", "title": "" } ]
9e25d24ad2d22c9a41cbf04ec1ff2594
Shrink or expand the size of a file inplace
[ { "docid": "9fa2a2678d53efef809eb245f6079a2e", "score": "0.0", "text": "def truncate(offset=0)\n File.truncate(self, offset) if exists?\n end", "title": "" } ]
[ { "docid": "fb7fe783d6512421b90763291a491531", "score": "0.68733007", "text": "def update_filesize\n self.size = File.size? self.path.to_s\n end", "title": "" }, { "docid": "f4cc95a72a787c9114f2d5fc360e77bc", "score": "0.6281944", "text": "def update_size(size, io)\n resize, extent = sizes[size.to_sym]\n filename = io.respond_to?(:path) ? io.path : io.to_s\n\n if resize && File.exist?(filename)\n GM.convert filename, root(ext(size)), resize, extent\n end\n end", "title": "" }, { "docid": "3aa575cd43dca2311d584fbabd38637b", "score": "0.6242635", "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": "899ceb36f1bbe7a5dcfdeb6e6e7ed378", "score": "0.623109", "text": "def resize_file(share, directory_path, file, size, options = {})\n options = { content_length: size }.merge(options)\n set_file_properties share, directory_path, file, options\n end", "title": "" }, { "docid": "0d794eef9feb5cdc4e03a4365f37bb86", "score": "0.6214249", "text": "def resize!\n begin\n image = MiniMagick::Image.open(@file.path)\n image.resize(\"#{@width}x#{@height}\")\n rescue\n # Pass on any error\n else\n image.write(@file.path) rescue nil\n end\n end", "title": "" }, { "docid": "39b251ce80efd7f063f19540f6f36213", "score": "0.6203111", "text": "def write_fixed_size_file(name, size)\n Aruba.platform.create_fixed_size_file(expand_path(name), size, false)\n\n self\n end", "title": "" }, { "docid": "0bb64d8f6f61312f7baa238d98620abf", "score": "0.61301684", "text": "def perform(file)\n placements = file.file_placements\n\n file.update_column(:file_placements_size, placements.size)\n\n # touch placements to bust cache\n placements.find_each do |placement|\n if placement.placement\n placement.placement.touch\n end\n end\n end", "title": "" }, { "docid": "920c89e81942bf72a4f1df9160b6ecf4", "score": "0.61042917", "text": "def resize(size)\n reserve(size)\n @_size = size\n @_offset = @_size if @_offset > @_size\n end", "title": "" }, { "docid": "0f7c06f329a253db3644f84d0a2136b8", "score": "0.60774577", "text": "def resize_image(file, index)\n img = Magick::Image.read(file).first\n resized = img.resize_to_fit(@size)\n\n extention = File.basename(file).split('.').last\n resized_path = @directory.join('resized', %Q[res_#{index}.#{extention}])\n \n resized.write(resized_path) do\n self.quality = @quality.to_i\n end\n\n # free up RAM\n img.destroy!\n resized.destroy!\nend", "title": "" }, { "docid": "213fce2224516412a4fcfdd95634c62a", "score": "0.6058982", "text": "def resize(size)\n @_buffer.resize(size)\n end", "title": "" }, { "docid": "3f9e23093e7dc42070857b9ab74db333", "score": "0.60481316", "text": "def restat\r\n stat = File.stat(@filename)\r\n\r\n if !@last_stat.nil?\r\n if stat.ino != @last_stat.ino || stat.dev != @last_stat.dev\r\n # File was replaced. Reopen it.\r\n @last_stat = nil\r\n reopen\r\n elsif stat.size < @last_stat.size\r\n # File was truncated. Reopen it.\r\n @last_stat = nil\r\n reopen\r\n end\r\n else\r\n @last_stat = stat\r\n end\r\n\r\n rescue Errno::ENOENT\r\n rescue Errno::ESTALE\r\n # File was deleted. Attempt to reopen it.\r\n reopen\r\n end", "title": "" }, { "docid": "c5483edd36ebb5e9ab4f27115d4333af", "score": "0.6044364", "text": "def set_shrink(arg = 1)\n @shrink = 1\n end", "title": "" }, { "docid": "858d1c44c52f2c294d12f4373cf575a4", "score": "0.5966745", "text": "def _restat\n stat = File.stat(@filename)\n\n if !@last_stat.nil?\n if stat.ino != @last_stat.ino || stat.dev != @last_stat.dev\n # File was replaced. Reopen it.\n @last_stat = nil\n _reopen\n elsif stat.size < @last_stat.size\n # File was truncated. Reopen it.\n @last_stat = nil\n _reopen\n end\n else\n @last_stat = stat\n end\n\n rescue Errno::ENOENT\n rescue Errno::ESTALE\n # File was deleted. Attempt to reopen it.\n _reopen\n end", "title": "" }, { "docid": "01b9cd45ae561b73d232eb438fe1aeb0", "score": "0.5965589", "text": "def resize(size, upsample = false)\n self.image_file.thumb(upsample ? size : \"#{size}>\")\n end", "title": "" }, { "docid": "a26d1410ad471932ebfb4a841d378c07", "score": "0.58886456", "text": "def resize(file, width, height, quality = 90)\n if Vips.at_least_libvips?(8, 5)\n resize_ruby(file, width, height, quality)\n else\n resize_shell(file, width, height, quality)\n end\n end", "title": "" }, { "docid": "0138b84e9ac32d0f9f990fac2b7ede1c", "score": "0.58796024", "text": "def resize(path)\n img = MiniMagick::Image.open(@file)\n img.combine_options do |c|\n c.quality @options[:quality] if @options[:quality]\n c.resize \"#{@width}x#{@height}\"\n end\n\n img.write(path)\n end", "title": "" }, { "docid": "8125c17f438acefc158340d6a732c60f", "score": "0.5862335", "text": "def resize(new_size)\n if new_size < length\n (length - new_size).times { @history.shift }\n end\n @size = new_size\n @position = nil\n self\n end", "title": "" }, { "docid": "8fb47d701193921132d65ae73f974610", "score": "0.5859352", "text": "def shrink\n\t\tinvert\n\t\tgrow\n\t\tinvert\n\tend", "title": "" }, { "docid": "23ce00eef56e9db637a68ba6e31fdcd3", "score": "0.58584684", "text": "def worst_case file_name, file_size\n File.open file_name, \"w\" do |file|\n as = \"a\" * (file_size * 1024 - 1)\n file.write(as + \"b\")\n end\nend", "title": "" }, { "docid": "c8268b39074dc9430c5b71233e69d6fa", "score": "0.58257926", "text": "def image_magick_do(new_size, file_name)\n image = MiniMagick::Image.open(@record.name)\n\n a = new_size.split(/x|\\+/).map(&:to_i)\n a += [0, 0] if a.size < 4\n image_offset(image, a[2, 2]) if a[2, 2] != [0, 0]\n\n img_w, img_h = image.width, image.height\n new_w, new_h = a[0, 2]\n img_ratio = img_w.to_f / img_h\n new_ratio = new_w.to_f / new_h\n formula = if new_ratio > img_ratio\n \"#{img_w}x#{img_w/new_ratio}+0+0\"\n else\n \"#{img_h*new_ratio}x#{img_h}+0+0\"\n end\n image.crop(formula)\n\n image.resize(\"#{new_w}x#{new_h}\")\n image.write(file_name)\n image_reduce(file_name)\nend", "title": "" }, { "docid": "77f85c4501205e02e49e266fcad16e5b", "score": "0.5802737", "text": "def resize(size)\n Storm::Base::SODServer.remote_call '/Storage/Block/Volume/resize',\n :new_size => size,\n :uniq_id => @uniq_id\n end", "title": "" }, { "docid": "fcb68f37b9289fc038e666cad7869203", "score": "0.57316977", "text": "def extend_volume!\n @file.close\n @blocks_count *= 2\n create_file(@file_path, @block_size, @blocks_count)\n @file = File.open(@file_path, File::RDWR)\n end", "title": "" }, { "docid": "9d15a4d6a7be71c0589b3b10acb3f9bb", "score": "0.5716205", "text": "def remember_size!(path)\n self.counts[:new] += 1\n file_state[path.to_s] = path.size\n end", "title": "" }, { "docid": "5a124849bf2c789598a019dd7f64d004", "score": "0.5703499", "text": "def engage\n resize_command = generate_resize_command()\n f_name = File.basename(@local_file.path) \n @local_file.close\n `#{resize_command}`\n f_name\n end", "title": "" }, { "docid": "55dde49d054ef584076026dd2c3f2363", "score": "0.56859684", "text": "def resize(photo, size, path)\n data.scale!(size, Photo::THUMB[size])\n # TBD : write out the file to the right place\n file = File.new(path, \"rw\")\n data.write(file)\n file.close\n end", "title": "" }, { "docid": "7ebfe4668a1b169463bb8b4c32ff89f1", "score": "0.5679348", "text": "def atomically_replace_file(path)\n Tempfile.open(\"nalloc_tmp_#{File.basename(path)}\") do |tmpfile|\n\n # Preserve ownership (if possible) and mode\n stats = File.stat(path)\n begin\n tmpfile.chown(stats.uid, stats.gid)\n rescue Errno::EPERM\n end\n tmpfile.chmod(stats.mode)\n\n ret = yield tmpfile\n\n File.rename(tmpfile.path, path)\n\n ret\n end\n end", "title": "" }, { "docid": "541059f805dd0ad1a990043ef3a26e91", "score": "0.5677256", "text": "def defragmentize\n distance = 0\n new_file_size = 0\n deleted_blobs = 0\n corrupted_blobs = 0\n valid_blobs = 0\n\n # Iterate over all entries.\n @progressmeter.start('Defragmenting blobs file', @f.size) do |pm|\n each_blob_header do |header|\n # If we have stumbled over a corrupted blob we treat it similar to a\n # deleted blob and reuse the space.\n if header.corruption_start\n distance += header.addr - header.corruption_start\n corrupted_blobs += 1\n end\n\n # Total size of the current entry\n entry_bytes = FlatFileBlobHeader::LENGTH + header.length\n if header.is_valid?\n # We have found a valid entry.\n valid_blobs += 1\n if distance > 0\n begin\n # Read current entry into a buffer\n @f.seek(header.addr)\n buf = @f.read(entry_bytes)\n # Write the buffer right after the end of the previous entry.\n @f.seek(header.addr - distance)\n @f.write(buf)\n # Mark the space between the relocated current entry and the\n # next valid entry as deleted space.\n FlatFileBlobHeader.new(@f, @f.pos, 0,\n distance - FlatFileBlobHeader::LENGTH,\n 0, 0).write\n @f.flush\n rescue IOError => e\n PEROBS.log.fatal \"Error while moving blob for ID \" +\n \"#{header.id}: #{e.message}\"\n end\n end\n new_file_size = header.addr - distance +\n FlatFileBlobHeader::LENGTH + header.length\n else\n deleted_blobs += 1\n distance += entry_bytes\n end\n\n pm.update(header.addr)\n end\n end\n\n PEROBS.log.info \"#{distance / 1000} KiB/#{deleted_blobs} blobs of \" +\n \"#{@f.size / 1000} KiB/#{valid_blobs} blobs or \" +\n \"#{'%.1f' % (distance.to_f / @f.size * 100.0)}% reclaimed\"\n if corrupted_blobs > 0\n PEROBS.log.info \"#{corrupted_blobs} corrupted blob(s) found. Space \" +\n \"was recycled.\"\n end\n\n @f.flush\n @f.truncate(new_file_size)\n @f.flush\n\n sync\n end", "title": "" }, { "docid": "faf12d90f285bb31169aabf77af1f0b9", "score": "0.5635269", "text": "def truncate(key)\n GDBM.open(file_path, 0664, GDBM::WRCREAT) do |index|\n index.delete(key.to_s)\n end\n end", "title": "" }, { "docid": "4d64eba410fdfe89e07aed1d4f9cfbd4", "score": "0.56226474", "text": "def resize(size, upsample = false)\n image_file.thumbnail(upsample ? size : \"#{size}>\")\n end", "title": "" }, { "docid": "49afc5f3e75f589ac28174e0477347e3", "score": "0.5613687", "text": "def setTruncateAtSize(iNewSize = 1024)\n\n\t\tif (nil == iNewSize)\n\t\t\tiNewSize = 1024;\n\t\tend # if nil passed\n\n\t\tiNewSize = iNewSize.abs;\n\n\t\t@iTruncateAtSize = iNewSize;\n\n\t\tself\n\n\tend", "title": "" }, { "docid": "a47666a31aed01cdbce2cc9fb96c6864", "score": "0.5605295", "text": "def chunk_size=(size)\n unless @mode[0] == ?w && @position == 0 && @upload_date == nil\n raise \"error: can only change chunk size if open for write and no data written.\"\n end\n @chunk_size = size\n end", "title": "" }, { "docid": "a47666a31aed01cdbce2cc9fb96c6864", "score": "0.5605295", "text": "def chunk_size=(size)\n unless @mode[0] == ?w && @position == 0 && @upload_date == nil\n raise \"error: can only change chunk size if open for write and no data written.\"\n end\n @chunk_size = size\n end", "title": "" }, { "docid": "06c0f8c1a408d738374542c5af6975e8", "score": "0.55947435", "text": "def get_size(size)\n size.to_i != 0 ? file.variant(resize_to_fit: [size, size]) : file\n end", "title": "" }, { "docid": "4ff797cf23ccce3f5541567e3890893b", "score": "0.55935866", "text": "def resize_to(width, height); end", "title": "" }, { "docid": "4ff797cf23ccce3f5541567e3890893b", "score": "0.55935866", "text": "def resize_to(width, height); end", "title": "" }, { "docid": "0ea8734ab2ed7d93d3be9d014e8cdcca", "score": "0.5575212", "text": "def resize_xfs(fs)\n Command.execute_rc_log(\"#{COMMANDS[:xfs_growfs]} #{fs}\")\n end", "title": "" }, { "docid": "bc1f056b0184c740dd38b07866029438", "score": "0.5573842", "text": "def save_size\n model.meta_info[:size] = file.size\n end", "title": "" }, { "docid": "82c67a29322f37c4d492727d96a9d0e8", "score": "0.5561957", "text": "def update_size!\n return unless resource\n ds_info = Stash::Repo::DatasetInfo.new(id)\n id.update(storage_size: ds_info.dataset_size)\n update_zero_sizes!(ds_info)\n end", "title": "" }, { "docid": "91d55d3b6660bbb80f69fd4f4b8f3d80", "score": "0.5546831", "text": "def resize_image(img, size)\n size = size.first if size.is_a?(Array) && size.length == 1\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n if size.is_a?(Fixnum)\n size = [size, size]\n img.resize(size.join('x'))\n else\n img.resize(size.join('x') + '!')\n end\n else\n img.resize(size.to_s)\n end\n self.temp_path = img.path\n end", "title": "" }, { "docid": "5a287aed31143f45c20421d39801c6c8", "score": "0.5546397", "text": "def max_size=(newsz)\n @mutex.synchronize do\n if newsz < size\n (size - newsz).times do\n old = @index.delete_at(0)\n @objects.delete(old.obj)\n end\n resort\n end\n\n @max_size = newsz\n end\n end", "title": "" }, { "docid": "67064937ffa4ae129c12c55b717c22e1", "score": "0.5540322", "text": "def update_size(size, io)\n return true if self.class.mode == :fake\n\n super\n end", "title": "" }, { "docid": "d2ab425054ce906876163e613dd5971f", "score": "0.5532655", "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": "70bf02688083b42a786a1f084b4cf97c", "score": "0.552553", "text": "def test_standard_file\n File.open(@old_name, \"w\") do |f|\n ENV['TEST_NSEG_SIZE'].to_i.times do |iter|\n f.write(SecureRandom.random_bytes(2**20))\n end\n assert_equal(f.size, (2**20)*ENV['TEST_NSEG_SIZE'].to_i, \"Wrong file size\")\n end\n\n File.rename(@old_name, @new_name)\n File.delete(@new_name)\n end", "title": "" }, { "docid": "70bf02688083b42a786a1f084b4cf97c", "score": "0.552553", "text": "def test_standard_file\n File.open(@old_name, \"w\") do |f|\n ENV['TEST_NSEG_SIZE'].to_i.times do |iter|\n f.write(SecureRandom.random_bytes(2**20))\n end\n assert_equal(f.size, (2**20)*ENV['TEST_NSEG_SIZE'].to_i, \"Wrong file size\")\n end\n\n File.rename(@old_name, @new_name)\n File.delete(@new_name)\n end", "title": "" }, { "docid": "50878370b0f6e24ada22e57bbd36903e", "score": "0.55183554", "text": "def add_file_simple(name, mode, size)\n write_header name, mode, :size => size\n\n stream = GZippedTar::Tar::BoundedStream.new io, size\n\n yield stream if block_given?\n\n min_padding = size - stream.written\n io.write(\"\\0\" * min_padding)\n\n pad_rows size\n\n self\n end", "title": "" }, { "docid": "ce1509b532027f0c0f77e250333b19b5", "score": "0.55152875", "text": "def reversion_file(name)\n lines = reversion(name)\n tmp_name = name + \"_tmp\"\n mv name, tmp_name\n begin\n File.open(name, \"w\") { |f| lines.each { |line| f.write line } }\n rescue\n mv tmp_name, name\n ensure\n rm tmp_name\n end\n end", "title": "" }, { "docid": "63fd81c15d82f0996a2edb1d62abe33e", "score": "0.5511934", "text": "def precache(max = -1)\n return if max > -1 && file_size(@file) > max\n @file.seek 0\n @file = StringIO.new @file.read, \"r\"\n end", "title": "" }, { "docid": "68aebad4ec8c402c517a2ea53f1a5003", "score": "0.5495771", "text": "def _make_space_for(bytes)\n raise ArgumentError(\"cannot store files larger than the cache\") if bytes > _max_bytes\n _edit_metadata do |metadata|\n while bytes > _max_bytes - metadata[:bytes]\n key,(size,_,_) = metadata[:files].first\n Log.warn \"FILECACHE evicting #{key}\"\n _cache_file(key).delete\n metadata[:files].delete(key)\n metadata[:bytes] -= size\n end\n end\n end", "title": "" }, { "docid": "939dd6814ad39c2fc630ab76e60017d3", "score": "0.54931307", "text": "def rewrite_file\n infile = File.open(@in_filename) or raise IOError, PERMISSION_ERROR\n outfile = File.open(@out_filename, 'w') or raise IOError, PERMISSION_ERROR\n\n until infile.eof?\n 2.times do |x|\n if @n > @chank_size\n _n_gt_chunk_size_rewrite(infile, outfile, x)\n elsif @n < @chank_size\n _n_lt_chunk_size_rewrite(infile, outfile, x)\n end\n end\n until @positive.empty? || @negative.empty?\n _print_n_numbers_from_buffer(@positive, outfile, @n)\n _print_n_numbers_from_buffer(@negative, outfile, @n)\n end\n end\n\n infile.close\n outfile.close\n end", "title": "" }, { "docid": "4212cb7c5db2f7087342a0c3a66d93e8", "score": "0.54846305", "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": "2e5cd1dbb18d765be288da72e18bf845", "score": "0.548168", "text": "def repropagate(size_names)\n original = original_file_path\n\n sizes.each do |size, (resize, extent)|\n next unless [*size_names].include?(size)\n\n FileUtils.mkdir_p(root)\n GM.convert original, root(ext(size)), resize, extent\n\n store size if respond_to?(:store, true)\n end\n end", "title": "" }, { "docid": "66f0ddf10ddc622b6fb91028ef1e52cd", "score": "0.54749566", "text": "def size=(new_size)\n unless (new_size % 8).zero? && new_size.positive?\n raise ArgumentError, 'size must be >0, and multiple of 8'\n end\n\n resize_raw(new_size) if @raw\n\n @size = new_size\n end", "title": "" }, { "docid": "66f0ddf10ddc622b6fb91028ef1e52cd", "score": "0.54749566", "text": "def size=(new_size)\n unless (new_size % 8).zero? && new_size.positive?\n raise ArgumentError, 'size must be >0, and multiple of 8'\n end\n\n resize_raw(new_size) if @raw\n\n @size = new_size\n end", "title": "" }, { "docid": "5ae5bee7ea59eff2745fc39d44356f6b", "score": "0.54690343", "text": "def resize(src, dest, height: nil, width: nil)\n input = File.read(src)\n\n args = \"\"\n args += \" -h #{height}\" if height\n args += \" -w #{width}\" if width\n\n open(\"|topng#{args}\", \"w+\") do |f|\n f.print input\n\n File.open(dest, \"w\") do |out|\n out.print f.read\n end\n end\n\n dest\n end", "title": "" }, { "docid": "3b60879346f9e419439571fbd79fdd65", "score": "0.5456599", "text": "def test_io_shrinks_buffer\n iotest(ShrinkIO) do |io|\n resize(io) rescue nil\n end\n end", "title": "" }, { "docid": "7540fe8d41bf86bc7a93b64c39d9f6f3", "score": "0.54563034", "text": "def resize(w, h)\n data.resize(w, h, data.zsize)\n clear_caches\n self\n end", "title": "" }, { "docid": "2da025d20e73e4114a6c58f59ce71a17", "score": "0.545163", "text": "def resize(file, size, format=nil, quality=nil)\n image = image_from(file)\n \n image.change_geometry!(size){ |cols, rows, img|\n img.resize!(cols, rows)\n } if size and size != \"\"\n \n image.format = format.to_s if format\n \n image.to_blob { self.quality = quality if quality }\n end", "title": "" }, { "docid": "36766070f76d61ee405829e249ed8dce", "score": "0.5439504", "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.5439504", "text": "def resize_to_fit(new_width, new_height)\n dup.resize_to_fit!(new_width, new_height)\n end", "title": "" }, { "docid": "895fbccd14f197eb57580399590dc938", "score": "0.5433341", "text": "def truncate(length)\n File.truncate(@path, length)\n end", "title": "" }, { "docid": "8142ead1de465d5052967fef553665a0", "score": "0.5430413", "text": "def update_contents!(new_contents)\n if is_binary\n File.binwrite(filename, new_contents)\n else\n File.write(filename, new_contents)\n end\n end", "title": "" }, { "docid": "29431ba81883fa5a7420d1388ad1564c", "score": "0.54279834", "text": "def resize!\n end", "title": "" }, { "docid": "29431ba81883fa5a7420d1388ad1564c", "score": "0.54279834", "text": "def resize!\n end", "title": "" }, { "docid": "005e7749abbe2873c8dc7868392a8e55", "score": "0.5426587", "text": "def Toggle(files, total, desc)\n files = files.clone();\n if files.size == 0\n printf(\"%05i\", total / 1024);\n print \":\" + desc + \"\\n\";\n else\n file = files.pop;\n #size = File.stat(file).size;\n size = `du -k \"#{file}\"`;\n size = Integer(size[/\\d+/]);\n Toggle(files, total, desc);\n Toggle(files, total + size, \" \\\"\" + file + \"\\\"\" + desc);\n end\nend", "title": "" }, { "docid": "8517906a247f3ab4e6c40f82f0dbf657", "score": "0.5426523", "text": "def resize_to_fit\n image = ::MiniMagick::Image.open(path)\n image.format type\n image.resize \"#{options[:width]}x#{options[:height]}\"\n image.write(outfile)\n end", "title": "" }, { "docid": "ee595eed64993debf65409b45239cc08", "score": "0.54161984", "text": "def resize_fit_width(from_path, to_path, width)\n validate_input_output_files(from_path, to_path)\n \n @target_w, @target_h = fit_sizes get_bounds(from_path), :width => width\n resetting_state_afterwards { process_exact }\n to_path\n end", "title": "" }, { "docid": "e9934d683d0ba792e6e341cebd0766d3", "score": "0.54126287", "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": "b9b20906aae77a3030a7490d01002d34", "score": "0.54094183", "text": "def pend_scannable_content(f, from)\n f.seek( from )\n current_length = f.stat.size\n read_length = current_length - from + 1\n if read_length > 0\n open( @tmpfile, 'a' ) do |out|\n max_bytes = 4096\n (1..( read_length/max_bytes )).each do\n out.write( f.read( max_bytes ))\n end\n out.write( f.read( read_length%max_bytes ))\n end\n end\n\n return current_length\n end", "title": "" }, { "docid": "c54ac8cebb1610c0cdfe86884efcd9c8", "score": "0.53964573", "text": "def shrink(n)\n n.times do\n @h.delete(@size - 1)\n @size -= 1\n end\n end", "title": "" }, { "docid": "72a00498fc44bfa55db87ee8a8f451a1", "score": "0.539308", "text": "def wipe_file\n File.truncate(file_path, 0)\n @averaged_statistics = StatisticsHelper.add_symbols_to_hash\n end", "title": "" }, { "docid": "acffd8d73c02478385aebafbe14228f6", "score": "0.53903246", "text": "def to_file_old(filename)\n content_data_dir = File.dirname(filename)\n FileUtils.makedirs(content_data_dir) unless File.directory?(content_data_dir)\n File.open(filename, 'w') { |file|\n # Write contents\n file.write(\"#{@contents_info.length}\\n\")\n contents_enum = @contents_info.keys.each\n content_chunks = @contents_info.length / CHUNK_SIZE + 1\n chunks_counter = 0\n while chunks_counter < content_chunks\n to_old_file_contents_chunk(file,contents_enum, CHUNK_SIZE)\n GC.start\n chunks_counter += 1\n end\n\n # Write instances\n file.write(\"#{@instances_info.length}\\n\")\n contents_enum = @contents_info.keys.each\n chunks_counter = 0\n while chunks_counter < content_chunks\n to_old_file_instances_chunk(file,contents_enum, CHUNK_SIZE)\n GC.start\n chunks_counter += 1\n end\n\n # Write symlinks\n symlinks_info_enum = @symlinks_info.keys.each\n file.write(\"#{@symlinks_info.length}\\n\")\n loop {\n symlink_key = symlinks_info_enum.next rescue break\n file.write(\"#{symlink_key[0]},#{symlink_key[1]},#{@symlinks_info[symlink_key]}\\n\")\n }\n }\n end", "title": "" }, { "docid": "5133d551b7bd97396a4a5cad5fd4e717", "score": "0.53879356", "text": "def check_filesize!(file)\n if file.size > max_size\n file.delete\n megabytes = max_size.to_f / 1024 / 1024\n error! 413, \"The file is too big (maximum size is #{megabytes} MB).\"\n end\n end", "title": "" }, { "docid": "5133d551b7bd97396a4a5cad5fd4e717", "score": "0.53879356", "text": "def check_filesize!(file)\n if file.size > max_size\n file.delete\n megabytes = max_size.to_f / 1024 / 1024\n error! 413, \"The file is too big (maximum size is #{megabytes} MB).\"\n end\n end", "title": "" }, { "docid": "5133d551b7bd97396a4a5cad5fd4e717", "score": "0.53879356", "text": "def check_filesize!(file)\n if file.size > max_size\n file.delete\n megabytes = max_size.to_f / 1024 / 1024\n error! 413, \"The file is too big (maximum size is #{megabytes} MB).\"\n end\n end", "title": "" }, { "docid": "5133d551b7bd97396a4a5cad5fd4e717", "score": "0.53879356", "text": "def check_filesize!(file)\n if file.size > max_size\n file.delete\n megabytes = max_size.to_f / 1024 / 1024\n error! 413, \"The file is too big (maximum size is #{megabytes} MB).\"\n end\n end", "title": "" }, { "docid": "b00c556dd6d41960b92194a5c1387da4", "score": "0.53816617", "text": "def replace_with(new_contents)\n make_backup\n File.write(path, new_contents)\n remove_backup\n end", "title": "" }, { "docid": "d2856a790e6730c5935396fa43c7b243", "score": "0.53751415", "text": "def growing_fast(&block)\n orig_fun = @config.resize_function\n fun = proc { |size| orig_fun.call(size) * 2 }\n with_config(resize_function: fun, &block)\n end", "title": "" }, { "docid": "e5fbe73e539062d5cf1c43cb1c8b567d", "score": "0.53731203", "text": "def resize!(path, width, height)\r\n out_filename = File.expand_path(path)\r\n # Now pull the basename out and add our size string\r\n out_filename = File.join(File.dirname(out_filename), File.basename(out_filename).gsub(/(.+)\\.([A-Za-z0-9]{3,4})$/,'\\1-'+\"#{width.to_i.to_s}x#{height.to_i.to_s}\"+'.\\2'))\r\n if File.exists?(out_filename)\r\n puts \"Not resizing, #{out_filename} already exists\"\r\n else\r\n puts \"Resizing #{path} to #{width.to_i.to_s}x#{height.to_i.to_s} at #{out_filename}\"\r\n res = `convert '#{path}' -resize #{width.to_i.to_s}x#{height.to_i.to_s}^ -gravity center -extent #{width.to_i.to_s}x#{height.to_i.to_s} '#{out_filename}'`\r\n if !File.exists?(out_filename)\r\n raise Flickrcaptionr::ResizeFailedException, \"Failed to write output file, check your ImageMagick installation and output path setting\"\r\n end\r\n end\r\n return out_filename\r\n end", "title": "" }, { "docid": "ec1edea208d9580836ea9c90f298860d", "score": "0.5369185", "text": "def shrinkToFit; end", "title": "" }, { "docid": "38ce6c69a0690555f4301d9d23706c3a", "score": "0.5365619", "text": "def raw_truncate(path,off,raw=nil);end", "title": "" }, { "docid": "2d495739087d2c40f2e57cda6f0e3b7e", "score": "0.53549784", "text": "def update_file\n update_file_on_disk\n end", "title": "" }, { "docid": "2d495739087d2c40f2e57cda6f0e3b7e", "score": "0.53549784", "text": "def update_file\n update_file_on_disk\n end", "title": "" }, { "docid": "28a720f6b2b9110743e362c6a4126c55", "score": "0.5350857", "text": "def truncate(f, len)\n VirtFS.fs_lookup_call(f) { |p| file_truncate(p, len) }\n end", "title": "" }, { "docid": "323087fd2ae4e08561368331dcd2fb5b", "score": "0.53479993", "text": "def modify(file, content = nil)\n Pathname.new(file).tap do |file|\n file.open('w') { |f| f.write(content) } if content\n future = Time.now + 60\n file.utime future, future\n end\n end", "title": "" }, { "docid": "8592ec2e177a8a298779234145ca2818", "score": "0.53388953", "text": "def promote_file(no_raise: true)\n __debug_items(binding)\n promote_cached_file(no_raise: no_raise)\n end", "title": "" }, { "docid": "ab54680b566ce312bc73edd2420b821b", "score": "0.5337533", "text": "def resize_type(type, to_size)\n resize(type => to_size)\n end", "title": "" }, { "docid": "6345b65d6a1537c8b334163ec775651d", "score": "0.5336923", "text": "def size_check(input_path,output_path)\n before_size, after_size = byteweight(input_path), byteweight(output_path)\n # if the compressed file is bigger than the original one, copy the original in the target dir\n if after_size < before_size \n notify(\"compressed #{input_path} to the #{ compression_percentage(before_size,after_size)}% of its original size (from: #{before_size} to #{after_size} bytes ) \", :debug)\n @byteweight_after+=after_size\n else\n notify(\"output(#{after_size}) >= input(#{before_size}), keeping the original file #{input_path}\",:debug) \n FileUtils.cp(input_path,output_path)\n @byteweight_after+=before_size\n end\n end", "title": "" }, { "docid": "bb6ace0f6359c33861481871412b8132", "score": "0.53361154", "text": "def test_copy_vs_chunky_rewrite\n t = Tempfile.new \"large_file\"\n t.close\n puts t.path\n\n prompt_test(:path_to_large_file) do |config|\n path = config[:path_to_large_file]\n \n benchmark_test do |x|\n x.report(\"copy\") { FileUtils.cp(path, t.path) }\n assert FileUtils.cmp(path, t.path)\n \n # tenmb = 1 * 2097152\n # x.report(\"chunk 2MB\") do \n # File.open(path, \"r\") do |src|\n # File.open(t.path, \"w\") do |target|\n # str = \"\"\n # while src.read(tenmb, str)\n # target << str\n # end\n # end\n # end\n # end\n \n tenmb = 4 * 2097152\n x.report(\"chunk 8MB\") do \n File.open(path, \"r\") do |src|\n File.open(t.path, \"w\") do |target|\n str = \"\"\n while src.read(tenmb, str)\n target << str\n end\n end\n end\n end\n assert FileUtils.cmp(path, t.path)\n \n # tenmb = 4 * 2097152\n # x.report(\"chunk 8MB - no buf\") do \n # File.open(path, \"r\") do |src|\n # File.open(t.path, \"w\") do |target|\n # while str = src.read(tenmb)\n # target << str\n # end\n # end\n # end\n # end\n \n # tenmb = 10 * 2097152\n # x.report(\"chunk 20MB\") do \n # File.open(path, \"r\") do |src|\n # File.open(t.path, \"w\") do |target|\n # str = \"\"\n # while src.read(tenmb, str)\n # target << str\n # end\n # end\n # end\n # end\n\n end\n end\n end", "title": "" }, { "docid": "5fe5a54bac689cf4dd824e91bcf624ed", "score": "0.5334682", "text": "def resize(newRowNumber)\n\tend", "title": "" }, { "docid": "04c97e2d0c65abe86b9c915f49a3e8f4", "score": "0.53341484", "text": "def test_segment\n File.open(@old_name, \"w\") do |f|\n ENV['TEST_SEG_SIZE'].to_i.times do |iter|\n f.write(SecureRandom.random_bytes(2**20))\n end\n assert_equal(f.size, (2**20)*ENV['TEST_SEG_SIZE'].to_i, \"Wrong file size\")\n end\n\n sleep 5\n File.rename(@old_name, @new_name)\n File.delete(@new_name)\n end", "title": "" }, { "docid": "04c97e2d0c65abe86b9c915f49a3e8f4", "score": "0.53341484", "text": "def test_segment\n File.open(@old_name, \"w\") do |f|\n ENV['TEST_SEG_SIZE'].to_i.times do |iter|\n f.write(SecureRandom.random_bytes(2**20))\n end\n assert_equal(f.size, (2**20)*ENV['TEST_SEG_SIZE'].to_i, \"Wrong file size\")\n end\n\n sleep 5\n File.rename(@old_name, @new_name)\n File.delete(@new_name)\n end", "title": "" }, { "docid": "2a3f743fc479d96612ba548b122187b9", "score": "0.5332544", "text": "def resize(input_file, output_file)\n cmd = \"/usr/bin/convert -resize #{@config.resize_size} '#{input_file}' '#{output_file}'\"\n puts cmd\n `#{cmd}`\n end", "title": "" }, { "docid": "48af477f4875cbc0aa9be3ec2e1e2e6a", "score": "0.53325015", "text": "def test_fsize_compat\n \n len = 10\n\n Io.open_tempfile do |tmp|\n\n tmp.write( \"\\x00\" * len )\n tmp.flush\n\n File.open( tmp.path ) do |f|\n [ tmp, tmp.path, f ].each do |obj| \n assert_equal( len, Io.fsize( obj ) )\n end\n end\n end\n end", "title": "" }, { "docid": "2315bd94789d7f9cbe2752772a7c83fb", "score": "0.5327385", "text": "def inc_size\n @size += 1\n end", "title": "" }, { "docid": "279b9aad2eee5f4b57b02be08e4fdfba", "score": "0.53260916", "text": "def addDestWithSmallSize(item)\n addDest(item)\n @halfFiles.push(item)\n end", "title": "" }, { "docid": "7961d532698378d23e5a1e5c3c97b6cd", "score": "0.53232706", "text": "def incoming_chunked_file!(file_size, custom_num_of_chunks = false)\n self.incoming_chunked_file(file_size, custom_num_of_chunks)\n self.file_storage_via_assoc.save!\n self.save!\n self.file_storage_via_assoc\n end", "title": "" }, { "docid": "76fbf61d1780cbb03fcb3cb5e73ab20b", "score": "0.5315954", "text": "def resize_to_fit(width, height)\n @operations << [:resize_to_fit, width, height]\n end", "title": "" }, { "docid": "2312e401a8c94701975ebb0e5a480613", "score": "0.53140724", "text": "def original_size; end", "title": "" }, { "docid": "5603ee6df1ff771d96b75988284e02b3", "score": "0.5312396", "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": "388d5f2b5161b6d90ef0f8e48c171d6d", "score": "0.53091365", "text": "def resize_image(img, size)\n size = size.first if size.is_a?(Array) && size.length == 1 && !size.first.is_a?(Fixnum)\n if size.is_a?(Fixnum) || (size.is_a?(Array) && size.first.is_a?(Fixnum))\n size = [size, size] if size.is_a?(Fixnum)\n img.thumbnail!(*size)\n else\n img.change_geometry(size.to_s) { |cols, rows, image| image.resize!(cols, rows) }\n end\n self.temp_path = write_to_temp_file(img.to_blob)\n end", "title": "" }, { "docid": "1d60c5c1cd93753475cdb74fb9e0244d", "score": "0.53051066", "text": "def resize\n @buffer = nil #Causes buffer to reset its size next time it's accessed.\n end", "title": "" } ]
088e32e3daa246faa3de742a0f4d0942
==== Parameters &blk:: A proc that should get called outside the mutex, and which will return the value to render. ==== Returns Proc:: A block that the server can call later, allowing Merb to release the thread lock and render another request.
[ { "docid": "32ba66e2a8d2fe387e6f2609c6439196", "score": "0.6416428", "text": "def render_deferred(&blk)\n Proc.new do |response|\n response.write(blk.call)\n end\n end", "title": "" } ]
[ { "docid": "ccf694eb6289e0ee8db269d8c20c5905", "score": "0.7333663", "text": "def threaded_render (&block)\n EventMachine.defer block, proc { |result| body result }\n end", "title": "" }, { "docid": "bb29854b4035968dbb11400f38de1300", "score": "0.6048967", "text": "def mutex; end", "title": "" }, { "docid": "bb29854b4035968dbb11400f38de1300", "score": "0.6048967", "text": "def mutex; end", "title": "" }, { "docid": "bb29854b4035968dbb11400f38de1300", "score": "0.6048967", "text": "def mutex; end", "title": "" }, { "docid": "bb29854b4035968dbb11400f38de1300", "score": "0.6048967", "text": "def mutex; end", "title": "" }, { "docid": "bb29854b4035968dbb11400f38de1300", "score": "0.6048967", "text": "def mutex; end", "title": "" }, { "docid": "bb29854b4035968dbb11400f38de1300", "score": "0.6048967", "text": "def mutex; end", "title": "" }, { "docid": "bb29854b4035968dbb11400f38de1300", "score": "0.6048967", "text": "def mutex; end", "title": "" }, { "docid": "3ecb375a17a217a7e9c9cffaf9b7daee", "score": "0.5941139", "text": "def render!\n invalidate\n render\n end", "title": "" }, { "docid": "70dcc12ed7183f59b701b06fcf73e664", "score": "0.5909421", "text": "def mutex2; end", "title": "" }, { "docid": "4d8b62e75af50141cfe49f6042918ddc", "score": "0.5890211", "text": "def render\n if @block\n instance_eval(&@block)\n end\n end", "title": "" }, { "docid": "cf3d4003f89db570bc3d15995d546027", "score": "0.5869817", "text": "def threadded_content(&block)\n _httpsession.threadded_content(block)\n return nil\n end", "title": "" }, { "docid": "41a529e53995f90b781f1cf008675482", "score": "0.5842493", "text": "def render(*args, &block); end", "title": "" }, { "docid": "3e2571a61fdd83590862e540fa998ea4", "score": "0.58208144", "text": "def render!(*args, &blk)\n halt render(*args, &blk)\n end", "title": "" }, { "docid": "ec11ec69202d1d0c7f6ad5eba4879961", "score": "0.5749771", "text": "def synchronize(&block); end", "title": "" }, { "docid": "3dac08ca1dbdf172bb75fc23598f7114", "score": "0.5726819", "text": "def execute\n callback_safely if locksmith.unlock\n yield\n end", "title": "" }, { "docid": "68a75a97ba3c0dceac74f50597fe7876", "score": "0.57216126", "text": "def mutex=(_arg0); end", "title": "" }, { "docid": "f17a203c1b4e0e0a89689079319d29c4", "score": "0.57117736", "text": "def result kronk, mutex=nil\n end", "title": "" }, { "docid": "e3b81613eb2baf5a0c32bb34304dd1f8", "score": "0.5614141", "text": "def wait_for_render(&block)\n wait_for_action_cable_idle\n wait_for_expression_to_increase(JS_RENDER_COUNT, &block)\n end", "title": "" }, { "docid": "3681c1c445d69763e559226ee418f517", "score": "0.560813", "text": "def run(&_block); end", "title": "" }, { "docid": "3681c1c445d69763e559226ee418f517", "score": "0.560813", "text": "def run(&_block); end", "title": "" }, { "docid": "f6e956689676f991c20eefac972a12f9", "score": "0.560751", "text": "def global_lock; end", "title": "" }, { "docid": "f6e956689676f991c20eefac972a12f9", "score": "0.560751", "text": "def global_lock; end", "title": "" }, { "docid": "e464949b72428a0ab1ee30ed812c0ba2", "score": "0.55783105", "text": "def block\n \n end", "title": "" }, { "docid": "0dd24deb304de143a126666fa3a84cea", "score": "0.55688095", "text": "def block\n @user = current_user\n render :action => 'block', :layout => 'site'\n end", "title": "" }, { "docid": "e5e746bf861e04be88d747a356431f09", "score": "0.55629355", "text": "def do_modify_and_get_request_sent_page(batali, params)\n # create the cluster..\n name = params[:name]\n options = OpenStruct.new({\n cluster: name,\n config_servers: default_one(params[:config_servers]),\n shards: default_one(params[:shards]),\n rs_members: default_one(params[:rs_members]),\n mongos_routers: default_one(params[:mongos_routers]),\n flavor: params[:flavor] || '',\n })\n # (on a background thread)\n thr = Thread.new do\n batali.cook options\n end\n # ..then show the request sent page with the given name\n erb :request_sent, :locals => {\n name: name\n }\nend", "title": "" }, { "docid": "3235227b690110a4c88c1d05ec605e03", "score": "0.5549639", "text": "def thread_block(&block)\n @ob.db.get_and_register_thread if @ob.db.opts[:threadsafe]\n @db_handler.get_and_register_thread if @db_handler.opts[:threadsafe]\n \n thread = Thread.current\n thread[:hayabusa] = {} if !thread[:hayabusa]\n thread[:hayabusa][:hb] = self\n \n begin\n return block.call\n ensure\n @ob.db.free_thread if @ob.db.opts[:threadsafe]\n @db_handler.free_thread if @db_handler.opts[:threadsafe]\n end\n end", "title": "" }, { "docid": "49930998ac7a0eb714841c97038664a7", "score": "0.5546303", "text": "def render\n raise ArgumentError, \"block required (use #enable/#disable without blocks)\" unless block_given?\n\n enable\n begin\n result = yield self\n ensure\n disable\n end\n\n result\n end", "title": "" }, { "docid": "6b9f97ff9d835c86d77c2d6b8314c857", "score": "0.5538451", "text": "def call(&block)\n renderer.(&block)\n end", "title": "" }, { "docid": "143de2a28329f2bf6b6d256534e92a29", "score": "0.55145264", "text": "def lock() end", "title": "" }, { "docid": "7eb779b9580f22ad076fbda67592ac2b", "score": "0.55031353", "text": "def spinner_render_hash\n render_hash = renderer.spinner_render_hash\n if self.request_submission_in_progress?\n render_hash[:locals][:progress_message] = I18n.t(\"umlaut.services.borrow_direct_adaptor.bd_request_status.progress\") \n else\n render_hash[:locals][:progress_message] = I18n.t(\"umlaut.services.borrow_direct_adaptor.bd_request_prompt.progress\") \n end \n return render_hash\n end", "title": "" }, { "docid": "aaf3e43524a843023ab19db2261b9fff", "score": "0.5502316", "text": "def update_page(&block)\n rjs(&block)\n end", "title": "" }, { "docid": "fbef6b71d55f2c9c45d60aa5f7ed13b3", "score": "0.5490478", "text": "def block\n @block\n end", "title": "" }, { "docid": "6c90a05b8c0c97bc20a294f5c22801f1", "score": "0.54902995", "text": "def render\n invalidate_if_updated\n fast_render\n end", "title": "" }, { "docid": "59b541e6f57feec2b80cb1caa8b6c0de", "score": "0.54791653", "text": "def call(*, &block)\n lock(&block)\n end", "title": "" }, { "docid": "c5a568c6ba08e677efab3dd315312772", "score": "0.547881", "text": "def lock!; end", "title": "" }, { "docid": "c5a568c6ba08e677efab3dd315312772", "score": "0.547881", "text": "def lock!; end", "title": "" }, { "docid": "767623ff0f83fb42bb48f97130005a56", "score": "0.54653865", "text": "def proc_render\n streamer = Class.new do\n def each\n 10_000.times do |i|\n yield(\"This is line #{i}\\n\")\n end\n end\n end\n self.response_body = streamer.new\n end", "title": "" }, { "docid": "4cfdce513072b4d9ff324a6a18cdfaac", "score": "0.54641527", "text": "def synchronize\n yield\n end", "title": "" }, { "docid": "e3b70ce83e0029780b1e124426971f85", "score": "0.54506123", "text": "def mutex\n @mutex\n end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "3abcf397d44d426cd1a1c04f580f817c", "score": "0.5450306", "text": "def block; end", "title": "" }, { "docid": "027c2c556897c8cfbce58cc0408a4238", "score": "0.5414045", "text": "def rb_thread_blocking_region(param, unblock_function, unblock_flag)\n release_lock(GVL)\n begin\n yield(param)\n ensure\n acquire_lock(GVL)\n end\nend", "title": "" }, { "docid": "c8ea136a0c1de470e04ac1833bb61a55", "score": "0.5398451", "text": "def global_lock=(_arg0); end", "title": "" }, { "docid": "c8ea136a0c1de470e04ac1833bb61a55", "score": "0.5398451", "text": "def global_lock=(_arg0); end", "title": "" }, { "docid": "895cd0b50261a455aa1a7f595dbc4c51", "score": "0.5389971", "text": "def flock\n end", "title": "" }, { "docid": "133c6d188653212a7f5fee1e20530c02", "score": "0.5384857", "text": "def lock_wait; end", "title": "" }, { "docid": "579dc893124a878440f5114d3c0ce215", "score": "0.5381821", "text": "def render(scope = T.unsafe(nil), locals = T.unsafe(nil), &block); end", "title": "" }, { "docid": "603f943c639600eeb58d4ed46eed9965", "score": "0.5358536", "text": "def render_iframe_update(id_name, &block)\r\n yield\r\n \r\n # We're returning HTML instead of JS or XML now\r\n response.headers['Content-Type'] = 'text/html; charset=UTF-8' \r\n # Escape quotes, linebreaks and slashes, maintaining previously escaped slashes\r\n # Suggestions for improvement?\r\n html = (response.body || '').\r\n gsub('\\\\', '\\\\\\\\\\\\').\r\n gsub(/\\r\\n|\\r|\\n/, '\\\\n').\r\n gsub(/['\"]/, '\\\\\\\\\\&').\r\n gsub('</script>','</scr\"+\"ipt>')\r\n \r\n # Clear out the previous render to prevent double render\r\n erase_results\r\n \r\n render :text => \"<html><body><script type='text/javascript' charset='utf-8'>\r\n setTimeout(function() {\r\n parent.document.getElementById('#{id_name}').innerHTML = '#{html}';\r\n parent.document.getElementById('upload_indicator').style.display = 'none';\r\n document.location.replace('about:blank');\r\n }, 10); \r\n </script></body></html>\" \r\n end", "title": "" }, { "docid": "83068fe313c247942c4931486ea88213", "score": "0.53556436", "text": "def execute\n job.unlock!\n yield\n end", "title": "" }, { "docid": "5d12198a51acc9667eac4b5b70336166", "score": "0.53544253", "text": "def blocking?; end", "title": "" }, { "docid": "f45b41b824768d092c4a41dab16cb867", "score": "0.5352716", "text": "def yield\n Fiber.yield\n nil\n end", "title": "" }, { "docid": "f45b41b824768d092c4a41dab16cb867", "score": "0.5352716", "text": "def yield\n Fiber.yield\n nil\n end", "title": "" }, { "docid": "658e5a65c41e019d08f4128e627a6ea7", "score": "0.5346962", "text": "def method_wait\n Fiber.yield\n @screen_z = screen_z_formula unless @lock_z\n update_timed_hit if @timed_hit_count > 0\n end", "title": "" }, { "docid": "658e5a65c41e019d08f4128e627a6ea7", "score": "0.5346962", "text": "def method_wait\n Fiber.yield\n @screen_z = screen_z_formula unless @lock_z\n update_timed_hit if @timed_hit_count > 0\n end", "title": "" }, { "docid": "fb127afb655b22988cea794c54e71aff", "score": "0.53402656", "text": "def lock; end", "title": "" }, { "docid": "fb127afb655b22988cea794c54e71aff", "score": "0.53402656", "text": "def lock; end", "title": "" }, { "docid": "fb127afb655b22988cea794c54e71aff", "score": "0.53402656", "text": "def lock; end", "title": "" }, { "docid": "f76c518b86ccc1d3c2c45272d4a0acab", "score": "0.53370494", "text": "def mutex\n return @mutex\n end", "title": "" }, { "docid": "a0182d88f0e82933ef847f87e0aaf122", "score": "0.5323704", "text": "def return_request\n proc do |req|\n req\n end\n end", "title": "" }, { "docid": "fbf90251c6c133e39a72a5a04092d187", "score": "0.5318421", "text": "def captured_by_block; end", "title": "" }, { "docid": "1075663d2b76c4f7c0702a5f66d7df81", "score": "0.53152984", "text": "def render!\n \n @renders.each do |parameters|\n \n old_render parameters[:options], parameters[:deprecated_status] do parameters[:block].call end\n \n end\n \n end", "title": "" }, { "docid": "edbc9edd0c5dd77ac194509aadc07c55", "score": "0.53147274", "text": "def render_box(&block)\n @output_buffer\n end", "title": "" }, { "docid": "d212db660ff182c98112cde6dee35ddf", "score": "0.531404", "text": "def run_interlock(&block); end", "title": "" }, { "docid": "8c12261f6782c14c9f02b0ff96bbe846", "score": "0.5311818", "text": "def broadcast_render_later(**rendering)\n broadcast_render_later_to self, **rendering\n end", "title": "" }, { "docid": "a708f45c2565182725f3bc9cd84315ac", "score": "0.53080064", "text": "def render\n fragment = cached_fragment if caching_enabled?\n return fragment if fragment\n \n view = view_instance\n load_data_from_controller_into bucket\n load_data_from_bucket_into view\n \n content = render_content_for view\n cache content if caching_enabled?\n content\n end", "title": "" }, { "docid": "1ff5263f038d46d3dc6005ff13448227", "score": "0.5306583", "text": "def synchronize(&block) ; @server.synchronize(&block) ; end", "title": "" }, { "docid": "10ce03bb2bc151a8eaec09cff9c3f158", "score": "0.53050333", "text": "def nonblocking?; end", "title": "" }, { "docid": "b370b36a814780cc30165c0067984353", "score": "0.5302504", "text": "def render; end", "title": "" }, { "docid": "b370b36a814780cc30165c0067984353", "score": "0.5302504", "text": "def render; end", "title": "" }, { "docid": "b370b36a814780cc30165c0067984353", "score": "0.5302504", "text": "def render; end", "title": "" }, { "docid": "b370b36a814780cc30165c0067984353", "score": "0.5302504", "text": "def render; end", "title": "" }, { "docid": "b370b36a814780cc30165c0067984353", "score": "0.5302504", "text": "def render; end", "title": "" } ]
08aa51f41e6ca3f6dba9d613da5a54b4
Retrieves fog configuration if it exists
[ { "docid": "3a69ebe5e9ce9ecc0a4f0e54a0ef3246", "score": "0.6962637", "text": "def load_fog_config(path = ENV['HOME'] + '/.fog')\n creds = {}\n if File.exists?(path)\n fog = YAML.load_file(path)\n fog[:default] ||= {}\n creds = {\n :host => fog[:default][:vsphere_server],\n :user => fog[:default][:vsphere_username],\n :pass => fog[:default][:vsphere_password],\n }\n end\n\n return creds\n end", "title": "" } ]
[ { "docid": "0e4f2fadf165489f228c70f14c6393a8", "score": "0.6859115", "text": "def fog\n @fog ||= Fogger.new(config[environment])\n end", "title": "" }, { "docid": "043d65db9cf7c515b6dc8c23ba0b9ad5", "score": "0.64209855", "text": "def fog_options\n options = { \n :provider => provider, \n :aws_access_key_id => aws_access_key_id, \n :aws_secret_access_key => aws_secret_access_key, \n :region => region \n }\n end", "title": "" }, { "docid": "f97cd06a132f9534c785d3f853b3796d", "score": "0.6278032", "text": "def load_fog_options\n info = get_cloud_info\n test_chk = (@account_name.to_sym == @def_acct_name.to_sym)\n Puppet.debug \"account_name => #{@account_name} #{test_chk}\"\n acct_key = (@account_name.to_sym == @def_acct_name.to_sym) ? :default : @account_name\n Puppet.debug(\"acct_key => #{acct_key}\")\n unless info.has_key?(acct_key.to_s)\n raise \"#{get_fog_file} does not specify the account section => #{acct_key}, please be sure to configure this section first.\"\n end\n acct = {}\n info[acct_key.to_s].each_pair do | key, data |\n acct[key] = data\n acct[key.to_sym] = data\n end\n return acct\n end", "title": "" }, { "docid": "e9bb090748d592de0efa4dc0b571663e", "score": "0.62011886", "text": "def get_fog_storage\n return Fog::Storage.new( :provider => 'AWS',\n :aws_access_key_id => CONFIG[:aws_access_key_id], \n :aws_secret_access_key => CONFIG[:aws_access_key],\n :region => \"us-east-1\" )\n end", "title": "" }, { "docid": "df5634131603260596123130a8015831", "score": "0.60784614", "text": "def fog\n $fog || Fog::Storage.new(\n :provider => 'Local',\n :local_root => Pusher.server_path\n )\nend", "title": "" }, { "docid": "a555b555ec1239a87f5a579fcb296dbf", "score": "0.59975773", "text": "def get_config()\n return @api.do_request(\"GET\", get_base_api_path() + \"/config\")\n end", "title": "" }, { "docid": "b1e94b21938c5dc849510f76bd5f648a", "score": "0.5952711", "text": "def config\n ensure_service!\n config_grpc = service.get_instance_config @grpc.config\n Instance::Config.from_grpc config_grpc\n rescue Google::Cloud::NotFoundError\n @grpc.config\n end", "title": "" }, { "docid": "f9b4608209024da56c86483830fead5e", "score": "0.58892626", "text": "def configuration\n JSON.parse @gapi.configuration.to_json\n end", "title": "" }, { "docid": "a4f28e293425372492a0111a1b5c0cf8", "score": "0.58884454", "text": "def get_serv_config\n\t\taction = \"configuration\"\n\t\tresponse = call_api(action)\n\tend", "title": "" }, { "docid": "e91f4d089a446829ce021722a9db26ad", "score": "0.5860495", "text": "def cloud_config\n microbosh_config[\"cloud\"]\n end", "title": "" }, { "docid": "3b2b71790ffd66c0094d03065af72d44", "score": "0.5856749", "text": "def fog_directory\n @fog_wrapper.fog_directory\n end", "title": "" }, { "docid": "23299fa9c441214365b535ae0fb1f53a", "score": "0.5825175", "text": "def config\n path = config_path\n @config ||= path.exist? ? JSON.parse(path.read) : {}\n end", "title": "" }, { "docid": "40551c0d3bc9d0c79c1b208ae2a47aac", "score": "0.579274", "text": "def instance_config instance_config_id\n ensure_service!\n grpc = service.get_instance_config instance_config_id\n Instance::Config.from_grpc grpc\n rescue Google::Cloud::NotFoundError\n nil\n end", "title": "" }, { "docid": "55519f1ca3074f3f5c5147cb30666a1a", "score": "0.5782163", "text": "def config\n @config ||= read_config\n end", "title": "" }, { "docid": "037465f471e20c37174d54693642a3f9", "score": "0.57583636", "text": "def fog_connection\n @fog_wrapper.fog_connection\n end", "title": "" }, { "docid": "47025512f0a5478602984f2053845d85", "score": "0.57482165", "text": "def get_config\n if ! @config\n if ! File.exists? self.get_config_file\n puts self.get_config_file + ' does not exist - copy lightwaverf-configy.yml from https://github.com/pauly/lightwaverf to your home directory or type \"lightwaverf configure\"'\n self.put_config\n end\n @config = YAML.load_file self.get_config_file\n end\n @config\n end", "title": "" }, { "docid": "ae2d386716e172ba4f03ce018259155d", "score": "0.57265145", "text": "def get\n if File.exist?(@config_file)\n file = File.read(@config_file)\n @config = JSON.parse(file)\n end\n @config\n end", "title": "" }, { "docid": "f26c98794e9bf6a66ef359f534dbd379", "score": "0.56705827", "text": "def application_config\n config = YAML.load_file(Rails.root + 'config/custom_cloud.yml')\n config['application']\nrescue Errno::ENOENT\n {}\nend", "title": "" }, { "docid": "77f33362d45010aa09f0fb65cad7742e", "score": "0.5657174", "text": "def provider\n @fog_wrapper.provider\n end", "title": "" }, { "docid": "c3f8b1d7d628dde9dbfb8b5cf2c3b5f5", "score": "0.5652212", "text": "def fogParams \n \"fogParams\" \n end", "title": "" }, { "docid": "0e75bd28a2e5b026fa5a4636f3a3fc9e", "score": "0.5630383", "text": "def configuration\n Configuration::get\n end", "title": "" }, { "docid": "0e75bd28a2e5b026fa5a4636f3a3fc9e", "score": "0.5630383", "text": "def configuration\n Configuration::get\n end", "title": "" }, { "docid": "362d2967e66fa956babc1d88904cc556", "score": "0.56054986", "text": "def fog_public\n true # or false\n end", "title": "" }, { "docid": "9716b5967bf73cc351a5082207a97890", "score": "0.55846304", "text": "def config\n @config ||= load_config\n end", "title": "" }, { "docid": "9cf061afe5fb302e8eb378c54ce69c5c", "score": "0.5571745", "text": "def config_file\n path = File.join 'config/frenetic.yml'\n config = YAML.load_file( path )\n env = ENV['RAILS_ENV'] || ENV['RACK_ENV']\n\n config[env] || {}\n rescue Errno::ENOENT, NoMethodError\n {}\n end", "title": "" }, { "docid": "e571f3c018fac136e984844cb95ce9fb", "score": "0.5564546", "text": "def config_flickr\n FlickRaw.api_key = YAML.load_file(\"#{config_dir}/config.yml\")['flickr_api_key']\n end", "title": "" }, { "docid": "0a750fc6489829d9c9e4048b8e4096df", "score": "0.55619705", "text": "def config\n storage_hash = get_api_node(['storage-pools', resource[:name]])\n config_hash = storage_hash['config']\n # Remove volatile.initial_source key from config as \n config_hash.delete(\"volatile.initial_source\")\n return config_hash\n end", "title": "" }, { "docid": "4f015e5780280d8071270b313d536108", "score": "0.5519476", "text": "def config\n current_server.config\n rescue\n DRbServer.make_config\n end", "title": "" }, { "docid": "d27b88bf2e30310679e8e006b61a73f7", "score": "0.5515913", "text": "def connection\n @connection ||= ::Fog::Storage.new(self.config.fog_options)\n end", "title": "" }, { "docid": "49b0e6ee1d434f7fdec5afd912a33549", "score": "0.55024636", "text": "def get_config\n\t\tend", "title": "" }, { "docid": "537a5ef4acd2ea95157347ab8e063ba7", "score": "0.5497017", "text": "def connection\n @connection ||= begin\n if Rails.env.development?\n Fog::Storage.new({\n :provider => 'Local',\n :local_root => Rails.root.join(\"public\"),\n :endpoint => \"http://localhost:3000/photos\"\n })\n else\n Fog::Storage.new({\n :provider => \"AWS\",\n :aws_access_key_id => provider_key,\n :aws_secret_access_key => provider_secret\n })\n end\n end\n end", "title": "" }, { "docid": "acaecea902877b9d0205cf7f02c31a60", "score": "0.54957706", "text": "def storage\n @storage ||= Fog::Storage.new(storage_config)\n end", "title": "" }, { "docid": "1b25577a503fa543f5d5922abfd1af58", "score": "0.5490407", "text": "def methods_repo_configuration\n ApplicationController.firecloud_client.get_configuration(self.configuration_namespace, self.configuration_name, self.configuration_snapshot, true)\n end", "title": "" }, { "docid": "22b0d152e25669135a4dbd9e96a703c5", "score": "0.54882586", "text": "def configuration\n _get(\"/system/configuration\") { |json| json }\n end", "title": "" }, { "docid": "cf31c1296286cb17467e271a3daf06ed", "score": "0.54794526", "text": "def config\n @config_file\n end", "title": "" }, { "docid": "cafbb031937322b1c54c6b3acc013838", "score": "0.547392", "text": "def config\n @options[:config]\n end", "title": "" }, { "docid": "9243e11f7abc177a24ae4f1c610fa14b", "score": "0.54679143", "text": "def configuration(gem=nil)\n key = gem ? gem.to_s : nil #Dir.pwd\n cache[key] ||= Configuration.load(:from=>gem)\n end", "title": "" }, { "docid": "58837e8502a51fa6c97dc685be6b5002", "score": "0.54664695", "text": "def fog_public\n false\n end", "title": "" }, { "docid": "51eaf4043f611f33257f5e88bf45b70b", "score": "0.54543924", "text": "def get_config\n if @resource[:section]\n return node.get_config(params: \"section #{@resource[:section]}\", as_string: true)\n end\n node.running_config\n end", "title": "" }, { "docid": "326eab4d2e8e45a0803ebccca77e5fcd", "score": "0.5447711", "text": "def get_importers_configuration\n return @client.raw(\"get\", \"/config/importers/configuration\")\n end", "title": "" }, { "docid": "4539f8c47789415c74da368459c212a3", "score": "0.54440063", "text": "def storage_config\n YAML.load_file(Rails.root.join('config', 'storage.yml'))[Rails.env]\n end", "title": "" }, { "docid": "dfef4e4862c5a3ef3c3750bf7c5dfaf3", "score": "0.54236615", "text": "def config\n info['Config']\n end", "title": "" }, { "docid": "c0a0a5aefd261a35ad3381d57c98722a", "score": "0.5419766", "text": "def fog_directory\n \tENV['AWS_PROFILE_PIC_BUCKET']\n end", "title": "" }, { "docid": "f69ed2cf333f5407eee2803494e62387", "score": "0.5418848", "text": "def config_file\n env_config['config_file'] || raise('environment problem:environment information not loaded')\n end", "title": "" }, { "docid": "345a163ee8c6c8f0bb29f526ae5c6b42", "score": "0.54071695", "text": "def config\n @config ||= nil\n return @config unless @config.nil?\n @config = app_config.find_config config_key\n @config.freeze\n @config\n end", "title": "" }, { "docid": "c7dadd5150ce72fb3f974b1b5a47eec1", "score": "0.5383777", "text": "def configuration(name)\n Alchemy::Config.get(name)\n end", "title": "" }, { "docid": "b83311f553280bec0f9274661e81c4e9", "score": "0.53833675", "text": "def flavor\n if ENV[\"CHEF_API_FLAVOR\"]\n ENV[\"CHEF_API_FLAVOR\"].to_sym\n elsif config[\"CHEF_API_FLAVOR\"]\n config[\"CHEF_API_FLAVOR\"]\n else\n endpoint.include?(\"/organizations\") ? :enterprise : :open_source\n end\n end", "title": "" }, { "docid": "38771b8b13c0f7bf53b1679e93aa93a3", "score": "0.5377769", "text": "def setup_fog_connection\n @fog_compute = Fog::Compute.new(configuration)\n end", "title": "" }, { "docid": "999f7a0c09edfef11403559084439f7f", "score": "0.5362947", "text": "def get_config_for (type)\n\t\tcurrent_config = server_config\n\t\tconfig = server_config[\"images\"][type]\n\tend", "title": "" }, { "docid": "e46379974d54bb1f2a1e6008550c1be4", "score": "0.5361888", "text": "def get_configuration(etag = \"\", retries = 0)\n fetch_response = _fetch(etag)\n\n # If there wasn't a config change, we return the response.\n if !fetch_response.is_fetched()\n return fetch_response\n end\n\n preferences = fetch_response.entry.config.fetch(PREFERENCES, nil)\n if preferences === nil\n return fetch_response\n end\n\n base_url = preferences.fetch(BASE_URL, nil)\n\n # If the base_url is the same as the last called one, just return the response.\n if base_url.equal?(nil) || @_base_url == base_url\n return fetch_response\n end\n\n redirect = preferences.fetch(REDIRECT, nil)\n # If the base_url is overridden, and the redirect parameter is not 2 (force),\n # the SDK should not redirect the calls, and it just has to return the response.\n if @_base_url_overridden && redirect != RedirectMode::FORCE_REDIRECT\n return fetch_response\n end\n\n # The next call should use the base_url provided in the config json\n @_base_url = base_url\n\n # If the redirect property == 0 (redirect not needed), return the response\n if redirect == RedirectMode::NO_REDIRECT\n # Return the response\n return fetch_response\n end\n\n # Try to download again with the new url\n\n if redirect == RedirectMode::SHOULD_REDIRECT\n @log.warn(3002, \"The `dataGovernance` parameter specified at the client initialization is not in sync with the preferences on the ConfigCat Dashboard. \" \\\n \"Read more: https://configcat.com/docs/advanced/data-governance/\")\n end\n\n # To prevent loops we check if we retried at least 3 times with the new base_url\n if retries >= 2\n @log.error(1104, \"Redirection loop encountered while trying to fetch config JSON. Please contact us at https://configcat.com/support/\")\n return fetch_response\n end\n\n # Retry the config download with the new base_url\n return get_configuration(etag, retries + 1)\n end", "title": "" }, { "docid": "db1d5bfce22c97327d4dec02c5800a57", "score": "0.5345547", "text": "def config\n \n # loads up config instance_var once if all environment variables are available, otherwise load up from YAML file.\n @config ||= if ENV['fb_client_id'] && ENV['fb_client_secret'] && ENV['fb_scope']\n {\n :client_id => ENV['fb_client_id'],\n :client_secret => ENV['fb_client_secret'],\n :scope => ENV['fb_scope']\n }\n else\n YAML.load_file(\"#{Rails.root}/config/facebook.yml\")[Rails.env].symbolize_keys\n end\n \n rescue Errno::ENOENT => e\n raise StandardError.new(\"config/facebook.yml could not be loaded.\")\n end", "title": "" }, { "docid": "fa399a640e6885d926915b6c6f0710e5", "score": "0.5344957", "text": "def config\n @config ||= begin\n if File.exist?(@config_file)\n begin\n YAML.load_file(@config_file) || {}\n rescue Psych::SyntaxError => e\n raise PgSync::Error, e.message\n end\n else\n {}\n end\n end\n end", "title": "" }, { "docid": "093946d5fb35b560674aeabd52f44849", "score": "0.533433", "text": "def config\n\t\t\t@config ||= begin\n\t\t\t\tfile = File.join(self.location, \"config.yaml\")\n\t\t\t\tif File.exists?(file)\n\t\t\t\t\tYAML::load_file(file)\n\t\t\t\telse\n\t\t\t\t\t{}\n\t\t\t\tend\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "2b3b685aa793107fb725d43f5eba62ee", "score": "0.5319908", "text": "def config_get(id)\n Configuration.get(id)\n end", "title": "" }, { "docid": "caee525aa903cb3bba1589c37975b43c", "score": "0.5317464", "text": "def configuration\n Rally.provider_configuration[name]\n end", "title": "" }, { "docid": "72bf8d8e398179ca44b6a3dfda55f5ce", "score": "0.5316238", "text": "def configuration\n provider.configuration\n end", "title": "" }, { "docid": "5776737c5c09f5297a88eb3428da69d6", "score": "0.53088176", "text": "def exists\n begin\n get_settings\n rescue AlgoliaProtocolError => e\n if e.code === 404\n return false\n end\n\n raise e\n end\n return true\n end", "title": "" }, { "docid": "d784d0a8a895f8f41e26d679efe09079", "score": "0.53066427", "text": "def config\n requester.config \n end", "title": "" }, { "docid": "c11b6ec3b9ea99d2a7d27e8c1a82dc68", "score": "0.52984744", "text": "def config\n @config ||= {}\n end", "title": "" }, { "docid": "c11b6ec3b9ea99d2a7d27e8c1a82dc68", "score": "0.52984744", "text": "def config\n @config ||= {}\n end", "title": "" }, { "docid": "ed626d743522d679f2b2e062fa5935d9", "score": "0.52953833", "text": "def config\n @config || QuestBack.default_configuration || fail(QuestBack::Error, 'No configuration given or found on QuestBack.default_configuration.')\n end", "title": "" }, { "docid": "b5dd4854bfb3359861435d1eed593294", "score": "0.5292895", "text": "def show\n format = params[:format] || 'json'\n data = @container.config.get_properties(flavor: :public, format: format)\n\n render response_ok data\n end", "title": "" }, { "docid": "0a581b7b98bce8f7256f2d4dd9bc0873", "score": "0.5292479", "text": "def provider\n @provider ||= Bosh::Providers.for_bosh_provider_name(settings.bosh_provider, fog_compute)\n end", "title": "" }, { "docid": "66604e12abf95bac04840ca91d195907", "score": "0.5276074", "text": "def get_config(key)\n if config.key? key\n config[key]\n else\n application.default_config[key]\n end\n end", "title": "" }, { "docid": "a0b15934afcbf9b103c6dcfc579a2c60", "score": "0.527382", "text": "def config?\n options[:config]\n end", "title": "" }, { "docid": "b19e5170ee5541d3d5c1ca51f261f9af", "score": "0.5254878", "text": "def get_config\n {}.update(local_config)\nend", "title": "" }, { "docid": "87e8d3390b74264215589b829ecdfe92", "score": "0.5249029", "text": "def configuration\n self[:configuration] || {}\n end", "title": "" }, { "docid": "d702bc002be394631b0bae20ed52a597", "score": "0.5246138", "text": "def get_config(storage, path)\n file = (storage and path) ? storage + path : @defaults[:storage] + @defaults[:config]\n file = File.expand_path file\n return load file\n end", "title": "" }, { "docid": "b49bc56d55c8dec765e41c91a889a878", "score": "0.5243295", "text": "def config( untrusted: false )\n\t\toptions = { untrusted: untrusted }\n\t\tconfig = self.server.run_with_json_template( :showconfig, **options )\n\t\treturn Hglib::Config.new( config )\n\tend", "title": "" }, { "docid": "497c025984d347655ec5255684e2f43b", "score": "0.52396184", "text": "def config\n @config ||= YAML.load_file(config_file)[environment]\n end", "title": "" }, { "docid": "ab470e3ef7135e8665091b61f2ced8f8", "score": "0.52375054", "text": "def connection\n @connection ||= Fog::Storage.new(@fog_options)\n end", "title": "" }, { "docid": "299ead91e6dd5bcadea2dec82ef8ecea", "score": "0.5236713", "text": "def fog_public\n !!version_name\n end", "title": "" }, { "docid": "47deaa9d494889438a741c13e695ffc6", "score": "0.5219712", "text": "def config\n @config ||= Redlics::Config.new\n end", "title": "" }, { "docid": "e0cfce44d96bb12a8fe761e447d261dd", "score": "0.52161705", "text": "def config_for(environment=:development)\n if self.config.present?\n env_config = self.config[environment.to_s]\n else\n env_config = {\n 'host' => ENV['RIAK_HOST'],\n 'http_port' => ENV['RIAK_HTTP_PORT'],\n 'pb_port' => ENV['RIAK_PB_PORT']\n }\n end\n env_config\n end", "title": "" }, { "docid": "31ee4adc3fedb351e86772db20f8e1d4", "score": "0.5214192", "text": "def config_file\n CONFIG_FILE\n end", "title": "" }, { "docid": "477e187a77960c52ba36ce552aba2fbb", "score": "0.5203616", "text": "def config\n @config ||= YAML.load_file(BASE_PATH + '/local.config.yml')\nend", "title": "" }, { "docid": "5ca9ee74918828a53891f308419f55a4", "score": "0.52027017", "text": "def config\n configuration\n end", "title": "" }, { "docid": "b4f410b47708e2ac9e3275a4aee0e30b", "score": "0.5202588", "text": "def config_service?\n true\n end", "title": "" }, { "docid": "7e19ad348237ea1386465a2c036520bc", "score": "0.5201064", "text": "def config\n if Config.config.nil? or Config.config.empty?\n begin\n Config.config = Configuration.load_config(Config.config_file,\n Config.config_options)\n rescue Errno::ENOENT\n Config.config = {}\n end\n end\n\n return Config.config\n end", "title": "" }, { "docid": "526144ad4b1713e8f5947f5661375b7d", "score": "0.51990205", "text": "def config\n @config ||= { :force => false, :quiet => false }\n end", "title": "" }, { "docid": "041ba8f1a7b3a636760e97eeac2f2ad4", "score": "0.51854444", "text": "def conf\n begin\n @conf ||= JSON.parse(File.read(config_file))\n rescue\n @conf ||= {}\n end\n end", "title": "" }, { "docid": "041ba8f1a7b3a636760e97eeac2f2ad4", "score": "0.51854444", "text": "def conf\n begin\n @conf ||= JSON.parse(File.read(config_file))\n rescue\n @conf ||= {}\n end\n end", "title": "" }, { "docid": "ecd067d85e230246442d7085e2d2886e", "score": "0.51835567", "text": "def connection\n @connection ||= Fog::Compute.new(credentials)\nend", "title": "" }, { "docid": "c3c56883177adda37221786b470116b0", "score": "0.5179665", "text": "def fog_servers\n @fog_servers = @cloud.fog_servers\n end", "title": "" }, { "docid": "4fcb490f5b46f749e59f0cc8f06948dc", "score": "0.51796556", "text": "def configuration\n cfg = {:service => @service}\n cfg[:acl] = @acl.name if (@acl)\n cfg[:avpairs] = @avpairs if (@avpairs)\n cfg[:network_av] = @network_av.configuration if (@network_av)\n cfg[:shell_command_av] = @shell_command_av.configuration if (@shell_command_av)\n return(cfg)\n end", "title": "" }, { "docid": "c9afc922951c46ddbc3d4d7768362d6b", "score": "0.51697886", "text": "def load_config\n # Nothing in base class. This should be used to load the configuration from\n # disk if saved to a file.\n configuration || {}\n end", "title": "" }, { "docid": "96e1854ea79742471a6461d56073fc5c", "score": "0.51684225", "text": "def config\n @config ||= Smartgen::Configuration.new\n end", "title": "" }, { "docid": "85c5f11157afc38dae941154dde5df98", "score": "0.51665133", "text": "def shopify_config\n @shopify_config ||= Shopifydev::Config.config\n end", "title": "" }, { "docid": "eefc0fa4622d2d0950bf0892a8aaa2be", "score": "0.5159823", "text": "def get_http_config\n http_conf = @opts['http'] || {}\n return http_conf\n end", "title": "" }, { "docid": "4ae9cf0081f1310bb62f720c040e22dd", "score": "0.5158889", "text": "def get_actual_config\n @config\n end", "title": "" }, { "docid": "8506dfc72f65a95a187402d756a6deec", "score": "0.5158886", "text": "def get_config(name, default)\n return ENV[name].nil? ? default : ENV[name]\nend", "title": "" }, { "docid": "f6ab0e044b8c84ce92df63fc4dbc6d66", "score": "0.51567227", "text": "def scanConfig()\n configFile = @basePath + \".config.json\" ;\n open(configFile,\"r\"){|strm|\n @config = JSON.load(strm.read()) ;\n }\n return @config ;\n end", "title": "" }, { "docid": "a12c43de740d41fc92b938078fde02f4", "score": "0.5155925", "text": "def config\n Grape::OAuth2.config\n end", "title": "" }, { "docid": "75cf8af82e48f9ae62aa9ad285fc8039", "score": "0.5144141", "text": "def config\n (null_config? ? NoConfig.instance : actual_config)\n end", "title": "" }, { "docid": "e35b813f0b308fa2d75ac69c3495f7d7", "score": "0.51423466", "text": "def get_opts(opts)\n return opts[GCOVR_SETTING_PREFIX.to_sym] || {}\n end", "title": "" }, { "docid": "07323874b7e832f18c449ade51c8dc69", "score": "0.51376766", "text": "def read_config_file()\n if File.exists?(options[:config_file])\n return YAML.load_file(options[:config_file])\n else\n @logger.error \"Config file [#{options[:config_file]}] missing!\"\n end\n end", "title": "" }, { "docid": "ae0d914241f8c8d071a1a8260b18a04a", "score": "0.513665", "text": "def parse_cloud_config(env = nil)\n cloud_config = YAML.load(File.read('config/cloud.yml'))\n check_cloud_config(cloud_config)\n\n if env\n unless cloud_config[env]\n fail \"Environement `#{env}` missing in config/cloud.yml\"\n end\n return cloud_config[env]\n end\n return cloud_config\n end", "title": "" }, { "docid": "67b21ad078e10c4d256e9eefdce11c27", "score": "0.5135754", "text": "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id)\n\t\t\tclient.queue_service_action_call('configurations', 'get', 'KalturaConfigurations', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "title": "" }, { "docid": "952f0f505f891e2512eef0c27fbafb47", "score": "0.51318055", "text": "def config(environment: :development)\n @config ||=\n YAML.safe_load(File.open(File.join(db_dir, \"config.yml\")))\n .fetch(environment.to_s)\n end", "title": "" }, { "docid": "e0742e35524a70b908441de281e88ced", "score": "0.513116", "text": "def endpoint_configuration\n return @endpoint_configuration\n end", "title": "" } ]
0cd53e7c591f0996710ea232f0b15fb0
Converts a time to a bucket key
[ { "docid": "f3f94c87d8ca69fbc4c93cd1bce0a09f", "score": "0.7657409", "text": "def bucket_key(time)\n id = quantize_time_to_slize_size(time.utc).to_i\n \"online:slice:#{id}\"\n end", "title": "" } ]
[ { "docid": "339b630d004277a4516bf0cf58197abd", "score": "0.7732514", "text": "def get_key_for(time)\n \"#{time.year}/#{time.month}/#{time.day}/#{time.hour}\"\n end", "title": "" }, { "docid": "940e519b416c65811eba5e77b77b0ebe", "score": "0.6533081", "text": "def time_key(time, interval)\n interval && ( time.to_i / interval ) * interval\n end", "title": "" }, { "docid": "653e142413c91982a613c788ad7d1c12", "score": "0.61381507", "text": "def key_name(time, date_type=RailsRank::Types::Date::HOURLY)\n case date_type\n when RailsRank::Types::Date::YEARLY\n time.strftime('%Y')\n when RailsRank::Types::Date::MONTHLY\n time.strftime('%Y-%m')\n when RailsRank::Types::Date::DAILY\n time.strftime('%Y-%m-%d')\n else\n time.strftime('%Y-%m-%d-%H')\n end\n end", "title": "" }, { "docid": "49e139ee1f2cdbd9b572b8a18547f1ab", "score": "0.6002271", "text": "def key(opts = {})\n time(opts).strftime(@format)\n end", "title": "" }, { "docid": "9fd48172be1d30430384aab5dbf56d1f", "score": "0.5921551", "text": "def arrest_key(date, last, first)\n \"#{date}-#{last}-#{first}\".downcase\n end", "title": "" }, { "docid": "2735e9873d4fd406b4aad7713aabd17d", "score": "0.5836507", "text": "def next_key(keyspace, timestamp)\n keyspace.key(self.format(timestamp))\n end", "title": "" }, { "docid": "dc7de14178c1f5d752ac85f774c93fad", "score": "0.58079803", "text": "def timekey_to_timeformat(timekey)\n case timekey\n when nil then ''\n when 0...60 then '%Y%m%d%H%M%S' # 60 exclusive\n when 60...3600 then '%Y%m%d%H%M'\n when 3600...86400 then '%Y%m%d%H'\n else '%Y%m%d'\n end\n end", "title": "" }, { "docid": "ccbbf5b0b96da15008fa21a0d567a753", "score": "0.57475704", "text": "def bucket_name\n @timestamp + '.' + bucket_base_name\n end", "title": "" }, { "docid": "c0e4e4feb822e90043a9f3b73116c3fe", "score": "0.57430995", "text": "def granular_key(granularity, interval, time)\n [granularity, time_key(time, interval)].compact.join('.')\n end", "title": "" }, { "docid": "f80fe9be1e35f05ed4cd76f52e634fc5", "score": "0.5723", "text": "def make_key t\n (sig_key(t) + sum_key(t))[0..MAX_KEY_SIZE].sub(/\\0+\\z/, \"\")\n end", "title": "" }, { "docid": "6bb31765ac83680cb51a5da167df29b9", "score": "0.5719599", "text": "def make_date_key(day_or_date)\n if day_or_date.class == Symbol\n day_or_date\n else\n Time.parse(day_or_date).key_by_date\n end\n end", "title": "" }, { "docid": "b4b74d9223923fef9935bdaf39b7457e", "score": "0.56713", "text": "def to_key; end", "title": "" }, { "docid": "af3f31f5537ba1e3c5d4720071df7d3d", "score": "0.5621421", "text": "def cache_key\n \"me/#{object.id}-#{object.updated_at.utc.to_s(:number)}\"\n end", "title": "" }, { "docid": "cee894f6ac635f6b2b200d2ad5bf2fa4", "score": "0.55812216", "text": "def get_key\n return nil if @available_keys.empty?\n key = -1\n @mutex.synchronize do\n key = @available_keys.shift[0]\n @keys[key][:ct] = Time.now.to_i\n end\n key\n end", "title": "" }, { "docid": "1107ba2bb9e2483ec778c742d31e479f", "score": "0.5564196", "text": "def time_id(time)\n time.strftime(\"%Y%m%d\")\n end", "title": "" }, { "docid": "631d22ba3e7b9f263cfb01356411d5f3", "score": "0.55515105", "text": "def to_simple_key(key)\n key\n end", "title": "" }, { "docid": "3cd961ca1de9f28c3723d68ab0fcf78a", "score": "0.55507845", "text": "def convert_key(key); end", "title": "" }, { "docid": "3cd961ca1de9f28c3723d68ab0fcf78a", "score": "0.55507845", "text": "def convert_key(key); end", "title": "" }, { "docid": "3cd961ca1de9f28c3723d68ab0fcf78a", "score": "0.55507845", "text": "def convert_key(key); end", "title": "" }, { "docid": "b387be91cfd72ea96f37a46c87f31cdb", "score": "0.54660565", "text": "def format_key(key)\n key.to_s.gsub(\"-\",\"_\")\n end", "title": "" }, { "docid": "3f03e6f034f5de560cb8a0b8e6132e09", "score": "0.5435944", "text": "def key(api, opts={})\n time = Exchange::Helper.assure_time(opts[:at], :default => :now)\n [ 'exchange',\n api.to_s, \n time.year.to_s, \n time.yday.to_s, \n Exchange::Configuration.update == :hourly ? time.hour.to_s : nil,\n *(opts[:key_for] || [])\n ].compact.join('_')\n end", "title": "" }, { "docid": "2cf7682237f515f6dfe2912435c758ee", "score": "0.54286414", "text": "def get_buckets_at(time, never_expire=false)\n time_span_windows.map do |bucket|\n window_starts = Time.at(time).floor_to(bucket[:span])\n {\n window_starts: window_starts,\n window_finishes: window_starts + bucket.fetch(:span),\n span: bucket.fetch(:span),\n expire_at: never_expire ? -1 : (window_starts + bucket.fetch(:span) + bucket.fetch(:expiration))\n }\n end\n end", "title": "" }, { "docid": "bbb4f524eeec056128e19eeeba7f3b1c", "score": "0.5426666", "text": "def fix_timestamp(time, unique)\n Time.at time.to_i + (Zlib::crc32(unique.to_s) % 1000).to_f / 1000\nend", "title": "" }, { "docid": "0a5d717dd8c4efcafda055be5f5023ed", "score": "0.542203", "text": "def to_key( t )\n t.to_s.downcase\n end", "title": "" }, { "docid": "27aef0ad76197035862c1ebe05c819c3", "score": "0.5383412", "text": "def map_index(time)\r\n\treturn (time.to_i-1243785600) / 3600\r\nend", "title": "" }, { "docid": "bfdde5076fd954c0b0855fa65d7edf59", "score": "0.5366624", "text": "def time_to_google(time)\n s = time.strftime(\"%Y-%m-%dT%H:%M:%S.000%z\")\n s[0..25] + ':' + s[26..27]\n end", "title": "" }, { "docid": "a159c1cb6176240981b73080718fa952", "score": "0.53362596", "text": "def rate_key_for(currency_iso_from, currency_iso_to); end", "title": "" }, { "docid": "082e4905f32b2fb9f82555107a9ab279", "score": "0.53339344", "text": "def get_cache_key(user, key)\n return \"%06d:%s\" % [user.id, key]\n end", "title": "" }, { "docid": "47fe1a5ea6f8dc72bbe813bfbfa29447", "score": "0.5315253", "text": "def min_key\n min_k, min_time = nil, @time\n @store.each {|k, v|\n if v.time < min_time \n min_k, min_time = k, v.time\n end\n }\n return min_k\n end", "title": "" }, { "docid": "7d485268b0cd57e822f65662ec6ea240", "score": "0.5303955", "text": "def cache_key(security, major, minor, micro)\n \"#{security.id}-#{major}-#{minor}-#{micro}\"\n end", "title": "" }, { "docid": "e4f0fd67d85afa24e08b6f05d6f445cd", "score": "0.5298654", "text": "def build_key(event_name, date)\n [Minuteman::PREFIX, event_name, date.join(\"-\")].join(\"_\")\n end", "title": "" }, { "docid": "36b7b974e907af2d6d4d753a939efaea", "score": "0.5296331", "text": "def to_bson_key\n to_s.to_bson_key\n end", "title": "" }, { "docid": "8fa78f27ee6b4ce35baa000c37f0a7ae", "score": "0.52931905", "text": "def generate_cache_key(record, namespace)\n \"#{namespace}-#{record.cache_key_with_version}\"\n end", "title": "" }, { "docid": "28d287a41a772ee4f7f0fdcdb56f0caa", "score": "0.52702254", "text": "def make_key(type, name)\n \"%#{type}%#{name}\"\n end", "title": "" }, { "docid": "4e87df4f449a7cfb2f56643b10f6c584", "score": "0.525894", "text": "def build_key(event_name, date)\n [Counterman::PREFIX, event_name, date.join(\"-\")].join(\"_\")\n end", "title": "" }, { "docid": "d4d59b36e10f95ea256771cb945a0013", "score": "0.5252022", "text": "def hour(time)\n time = Fatboy::Helpers.hour_format(time.utc)\n store = Fatboy::Helpers.format_store(@model_name, time)\n @redis.zscore(store, @id)\n end", "title": "" }, { "docid": "21499a8e2a117e56d24e298db313f66d", "score": "0.5249043", "text": "def active_bucket_keys\n active_bucket_times.map &method(:bucket_key)\n end", "title": "" }, { "docid": "fa8781f5294cf66450a3ed010b9c0314", "score": "0.5243045", "text": "def key\n to_a[0..(num_key_fields-1)].join(\"-\")\n end", "title": "" }, { "docid": "679d1709428f0788ec4795188c75f48e", "score": "0.5228366", "text": "def aws_key size\n id.to_s + \"-#{size.to_s}\"\n end", "title": "" }, { "docid": "1deff83129a9659196f4973945c7dd0a", "score": "0.52109146", "text": "def key_for_series(bucketable, series_name, bucket_name)\n \"bucket_maker:#{bucketable.class.to_s.underscore}_#{bucketable.id}:#{series_name.to_s}:#{bucket_name.to_s}\" if bucketable && bucketable.id rescue nil\n end", "title": "" }, { "docid": "290198fb154486d46133de23d269d486", "score": "0.5208422", "text": "def generate_unique_key(now = Time.now)\n u1 = ((now.to_i*1000*1000+now.usec) << 12 | rand(0xfff))\n uid = [u1 >> 32, u1 & 0xffffffff, rand(0xffffffff), rand(0xffffffff)].pack('NNNN')\n uid.unpack('C*').map { |x| \"%02x\" % x }.join\n end", "title": "" }, { "docid": "221263ff9307283b8779eec3200ffcd2", "score": "0.51965106", "text": "def make_bucket(line)\n y = line[7..10]\n mo = line[3..5]\n d = line[0..1]\n h = line[12..13]\n\n \"#{y}-#{MONTHS[mo]}-#{d} #{h}:--:--\"\nend", "title": "" }, { "docid": "3115cc1de536d74c7915941185f3dcd4", "score": "0.5179836", "text": "def generate_cache_key_name\n alphabetical = [@origin_a, @origin_b].sort\n \"#{alphabetical.first}_#{alphabetical.last}_#{@destination_city}_#{@date_there}_#{@date_back}\"\n end", "title": "" }, { "docid": "1a4b06b91a1f868fd8c2616a7399cc72", "score": "0.5175556", "text": "def key api_class, cache_period=:daily\n time = Time.now\n [api_class.to_s.gsub(/::/, '_'), cache_period, time.year, time.send(cache_period == :monthly ? :month : :yday)].join('_')\n end", "title": "" }, { "docid": "6eb6456062813c1a314cc2882fc04867", "score": "0.5174276", "text": "def current_key(keyspace)\n keyspace.key(last_modified_time)\n end", "title": "" }, { "docid": "c6a2adf600482609fd5b30cc5dfed899", "score": "0.5173067", "text": "def to_key; nil end", "title": "" }, { "docid": "ac0cbff11ca9886ad51ed5d6d294c835", "score": "0.5156851", "text": "def new_key(start)\n start = start.to_i\n key = Key.new(start)\n @keys[key.keyid] = key\n key.keyid\n end", "title": "" }, { "docid": "41be71e077f0097c5a277a0c9ea2fce3", "score": "0.51477027", "text": "def mark_start_time key\n @start_time[key] = Time.now\n end", "title": "" }, { "docid": "af719dda963e5720fa64658ec0366236", "score": "0.5146512", "text": "def sensation_create_key(ts_sec, user_id = nil, payload = nil)\n key = (ts_sec / 86400) << 64\n if user_id\n key += (user_id << 32)\n end\n if payload\n key += Zlib::crc32(payload)\n end\n key.to_java.toByteArray\n end", "title": "" }, { "docid": "36f764f6bee87b1a43ea6d6d8d8b3319", "score": "0.51459", "text": "def expand_key(object)\n if object.respond_to?(:cache_key)\n object.cache_key\n else\n \"#{object.class.name}/#{object.id}/#{object.updated_at.to_i}\"\n end\n end", "title": "" }, { "docid": "fc784fd103a27164b01b87e8e4707b5a", "score": "0.5126788", "text": "def public_key\n encode_tz(:edpk, 32)\n end", "title": "" }, { "docid": "17cdef89e7a251c5fd04766b0a653c6c", "score": "0.5119511", "text": "def generate_new_key(\n name:,\n email: \"\",\n comment: \"\",\n creation_date: Time.now,\n key_validity_seconds: 1.year\n )\n generate_new_keys(\n name: name,\n email: email,\n comment: comment,\n creation_date: creation_date,\n key_validity_seconds: key_validity_seconds,\n ).first\n end", "title": "" }, { "docid": "0db47f095e281eac1e4366ddb7c6a9e5", "score": "0.51153284", "text": "def key_by_date\n self.strftime('%Y-%m-%d')\n end", "title": "" }, { "docid": "aae0dd62c8a3641ac05f651f6337a177", "score": "0.5113336", "text": "def generate_key; end", "title": "" }, { "docid": "e7b8ab2ffe94b3b1eb583b52f5cea585", "score": "0.51132005", "text": "def active_bucket_times(starting_at=Time.now)\n keys = []\n starting_at = starting_at.utc\n @active_bucket_count.times do \n keys << quantize_time_to_slize_size(starting_at)\n starting_at -= @slice_size\n end\n keys\n end", "title": "" }, { "docid": "524974104f3a89796f8c0e7b2c2a89a3", "score": "0.511044", "text": "def raw_timestamp_to_cache_version(timestamp)\n key = timestamp.delete(\"- :.\")\n if key.length < 20\n key.ljust(20, \"0\")\n else\n key\n end\n end", "title": "" }, { "docid": "d21149e97a1bfdd47ca27d2fedb3bcbb", "score": "0.5083722", "text": "def time_to_path(time)\n date = Date.new(time.year, time.month, time.day)\n date.to_s.gsub(/\\-/, '/')\n end", "title": "" }, { "docid": "9a6258228bc05fcc373078a6b0333439", "score": "0.50820494", "text": "def get(key, timestamp)\n \n end", "title": "" }, { "docid": "779ad8a62eee7f7295ab23f37fce03ae", "score": "0.50758487", "text": "def random_bucket_hash name=random_bucket_name\n {\"kind\"=>\"storage#bucket\",\n \"id\"=>name,\n \"selfLink\"=>\"https://www.googleapis.com/storage/v1/b/#{name}\",\n \"projectNumber\"=>\"1234567890\",\n \"name\"=>name,\n \"timeCreated\"=>::Time.now,\n \"metageneration\"=>\"1\",\n \"owner\"=>{\"entity\"=>\"project-owners-1234567890\"},\n \"location\"=>\"US\",\n \"storageClass\"=>\"STANDARD\",\n \"etag\"=>\"CAE=\" }\n end", "title": "" }, { "docid": "0a4b466677c8f2a94edd76af12be9911", "score": "0.506295", "text": "def get_credit_key(type, name)\n generate_store_key(\"#{type}-c:#{name}\")\n end", "title": "" }, { "docid": "c56424214e6fa53eb3e6b22c4c12e044", "score": "0.5062551", "text": "def gen_key(record)\n return Digest::SHA2.hexdigest(record.to_s)\n end", "title": "" }, { "docid": "949cad883cc83c87db2955267387767f", "score": "0.50573605", "text": "def cache_key\n case\n when new_record? then\n \"#{self.class.name.underscore}/new\"\n when ::ActiveRemote.config.default_cache_key_updated_at? && (timestamp = self[:updated_at]) then\n timestamp = timestamp.utc.to_s(self.class.cache_timestamp_format)\n \"#{self.class.name.underscore}/#{self.to_param}-#{timestamp}\"\n else\n \"#{self.class.name.underscore}/#{self.to_param}\"\n end\n end", "title": "" }, { "docid": "22be1ed01cce140a0f34fabc9243897c", "score": "0.5056082", "text": "def default_key_format(key)\n key\n end", "title": "" }, { "docid": "d74b22606d036ce370bf57678b128c81", "score": "0.50368065", "text": "def activity_bucket_uri_for(at_time)\n \"filters/#{name}/activity/#{at_time.to_gnip_bucket_id}.xml\"\n end", "title": "" }, { "docid": "cdcd6a55db2ef71ab3b70ec4d7ffa5cd", "score": "0.5031598", "text": "def lookup_by_key(cass_client, kind, start_timestamp, end_timestamp, options={})\n data = {}\n options = { :count => 10_000 }.merge(options)\n # this isn't defined in the schema (yet?) so the bucket is hard-coded to one day everywhere\n usec_aligned_chunks(start_timestamp, end_timestamp, :day).each do |ts|\n cass_client.get('lookup_by_key', \"#{kind}-#{ts}\", options).each do |key,value|\n data[key] = value\n end\n end\n data\n end", "title": "" }, { "docid": "75cefa559b067a984906604345aaac99", "score": "0.5023526", "text": "def make_key(lock, user)\n # sharer_user_id faked\n key = make_guest_key(lock, user.account.email, user)\n return key\n end", "title": "" }, { "docid": "66ffad810c12292cae560c8faa471541", "score": "0.50232345", "text": "def make_guest_key(lock, guest_email, user)\n key = Key.create_new_key(lock.id, guest_email, user)\n\n # permission error\n return key if (key.class == Hash)\n start = 60*60\n tc = TimeConstraint.create!(:key_id => key.id,\n :start_offset=> start.to_s,\n :end_offset => (start*2).to_s,\n :monday => true,\n :tuesday => true,\n :wednesday => true,\n :thursday => true,\n :friday => false,\n :saturday => true)\n # update seq_no\n key.reload\n return key\n end", "title": "" }, { "docid": "2ce1881aa4f2803a201b29086cb9c0c0", "score": "0.50195473", "text": "def cache_key\n return \"#{model_key}/new\" if new_record?\n return \"#{model_key}/#{_id}-#{updated_at.utc.to_formatted_s(cache_timestamp_format)}\" if do_or_do_not(:updated_at)\n \"#{model_key}/#{_id}\"\n end", "title": "" }, { "docid": "d266f24bf0a1a156e37285251c8e9cde", "score": "0.50126964", "text": "def cache_key(id); end", "title": "" }, { "docid": "1bbda707620871f679959c33965ab707", "score": "0.49982592", "text": "def to_key(key)\n return key if key.is_a? Symbol\n processed_key = nil\n unless key.nil?\n begin\n processed_key = key.to_s.to_sym\n rescue\n nil\n end\n end\n raise Deployment::InvalidArgument.new self, \"The value '#{key}' cannot be used as a concurrency name!\" unless processed_key\n processed_key\n end", "title": "" }, { "docid": "117257764152b949e54f41db3b374e80", "score": "0.49980333", "text": "def hash_key(name); end", "title": "" }, { "docid": "dd681f2d8a00f8e217f9896f35e8d9d4", "score": "0.49911454", "text": "def hash_in_sec(hash)\n\thash_in_sec = hash\n\thash_in_sec.each { |name, time| hash_in_sec[name] = to_sec(time) }\n\thash_in_sec\nend", "title": "" }, { "docid": "104f59cd43d7293bfdba8698911ad3e7", "score": "0.49766895", "text": "def reserve_key(key); end", "title": "" }, { "docid": "f93263db8ad37b5a8a44f15b0f95eee6", "score": "0.49756858", "text": "def cache_key(request)\n period_hash = Time.now.to_i / @limit_period\n \"#{request.ip}/#{period_hash}\"\n end", "title": "" }, { "docid": "086d1799bbbe367850ebbdd5d2a82ad0", "score": "0.4965255", "text": "def expireat(key, unix_time, nx: T.unsafe(nil), xx: T.unsafe(nil), gt: T.unsafe(nil), lt: T.unsafe(nil)); end", "title": "" }, { "docid": "2fb10d3507868477db15cb7eddd44cf9", "score": "0.49639297", "text": "def initialize(key = \"12345\", date = DateTime.now.strftime('%d%m%y').to_s)\n @key = key\n @date = date\n end", "title": "" }, { "docid": "a87ec5ad03332255f4e3a54f7f1999e0", "score": "0.49620074", "text": "def typecast_hash_to_time(value)\n Time.utc(*extract_time(value))\n end", "title": "" }, { "docid": "6b9bd93a888c077e124c7cc60d5bf038", "score": "0.49614292", "text": "def signin(valid_time)\n remove_expired_keys\n now = Time.now\n key = UserKey.new :register_time => now,\n :expired_on => now + valid_time\n key.user_key = UUID.generate\n self.add_user_key key\n self.last_signin = now\n self.save\n key\n end", "title": "" }, { "docid": "209b81112d3b18378d84b2efe25e96e0", "score": "0.4960014", "text": "def get_key(name, key_type=nil)\n name = name.to_s\n return @keys_cache[name] if @keys_cache[name]\n\n opts = { # defaults\n # don't add points with the same value as previous one if they time diff < N\n same_value_resolution: 600\n }\n\n type_opts = Hash.new({}) # type defaults TODO move somewhere else\n type_opts[:uptime] = {\n # time without update that is considered as downtime,\n # TODO naming: threshold, freqency, max_gap?\n max_time: 100\n }\n\n key = @db[:keys].first(name: name)\n\n if key\n opts.merge! type_opts[ key[:key_type].to_sym ]\n opts.merge! symbolize_keys(JSON.load(key[:key_opts_json])) if key[:key_opts_json] && !key[:key_opts_json].empty?\n @keys_cache[name] = {id: key[:id], type: key[:key_type]}.merge(opts: opts)\n else\n return nil unless key_type\n raise \"key creation failed\" unless create_key(name, key_type)\n get_key name\n end\n end", "title": "" }, { "docid": "6cf2295c2474dd3c10a144bb1f6e6ae8", "score": "0.49562636", "text": "def cache_key_for_all(value)\n count = value.to_s.classify.constantize.count\n max_updated_at = value.to_s.classify.constantize.maximum(:updated_at).try(:utc).try(:to_s, :number)\n \"#{value.to_s.tableize}/all-#{count}-#{max_updated_at}\"\n end", "title": "" }, { "docid": "f16ee1566357d226eb13b8e203827c66", "score": "0.494825", "text": "def key_for(key)\n key.is_a?(String) ? key : serialize(key)\n end", "title": "" }, { "docid": "f16ee1566357d226eb13b8e203827c66", "score": "0.494825", "text": "def key_for(key)\n key.is_a?(String) ? key : serialize(key)\n end", "title": "" }, { "docid": "8b4db55688c6f8491104f7b9d1cf26a0", "score": "0.49476027", "text": "def key\n \"#{@@PREFIX}#{@type}-#{@version.gsub(\".\",\"-\")}\"\n end", "title": "" }, { "docid": "fe15f33ff23950ce20ffb6cccd7608a7", "score": "0.49466708", "text": "def to_key\n key = id\n [key] if key\n end", "title": "" }, { "docid": "70daea4bbdcd3bd7c5c96ccd974fda3d", "score": "0.49446493", "text": "def from_simple_key(key)\n key\n end", "title": "" }, { "docid": "4a8eb6e4ae8fb57e04b0ee88cf64e38d", "score": "0.49403334", "text": "def object(key)\n bucket.object([*prefix, key].join(\"/\"))\n end", "title": "" }, { "docid": "093c11c4ac07f469c3efe92c806b8623", "score": "0.4940295", "text": "def to_bytes; @key; end", "title": "" }, { "docid": "093c11c4ac07f469c3efe92c806b8623", "score": "0.4940295", "text": "def to_bytes; @key; end", "title": "" }, { "docid": "e425ee7bc0f56f074edb1eddec5204cc", "score": "0.49398887", "text": "def version_cache_key\n parts =\n if object.class == Class\n [object]\n else\n [object.class, object.id]\n end\n \n parts << version_name\n parts * ':'\n end", "title": "" }, { "docid": "2207cf8ddaa36c39a4e2dc2bfcf7821b", "score": "0.49359763", "text": "def create_url_key(str, url_key_field, klass)\n str = UrlKey.escape(str)\n str = rand(30000).to_s(36) if str.length < 1\n key = str\n counter = 1\n until klass.find(:all, :conditions => [\"#{url_key_field} = ?\", key]).empty?\n key = \"#{str}-#{counter}\"\n counter += 1\n end\n\n key\n end", "title": "" }, { "docid": "814caf28fe08b77ad4e4e2cde3649c58", "score": "0.49358326", "text": "def to_key\n nil\n end", "title": "" }, { "docid": "814caf28fe08b77ad4e4e2cde3649c58", "score": "0.49358326", "text": "def to_key\n nil\n end", "title": "" }, { "docid": "814caf28fe08b77ad4e4e2cde3649c58", "score": "0.49358326", "text": "def to_key\n nil\n end", "title": "" }, { "docid": "651fc20423b57163414809fce7aeff66", "score": "0.49356315", "text": "def to_key\n [object_id]\n end", "title": "" }, { "docid": "36b054dfd85413b82c39fa4ae29de056", "score": "0.49252027", "text": "def expireat(key, unix_time, **kwargs); end", "title": "" }, { "docid": "d0bb62e6fac49645a16ef9fe52eb59f0", "score": "0.49247485", "text": "def object_to_cache_key(object)\n if object.is_a?(String)\n return object\n elsif object.respond_to?(:cache_key)\n return object.cache_key\n elsif object.is_a?(Array)\n return object.map{ |element| object_to_cache_key(element) }.to_param\n elsif object.respond_to?(:to_param)\n return object.to_param\n else\n return object.to_s\n end\n end", "title": "" }, { "docid": "f007099d92475a370ad52ec5dd65a08e", "score": "0.4922274", "text": "def pexpireat(key, ms_unix_time, **kwarg); end", "title": "" }, { "docid": "58bf5d3fa0809af1a32d2dbb44439140", "score": "0.49217242", "text": "def key_format(field)\n @formatted_key[field] ||= JSONAPI.configuration\n .key_formatter\n .format(resource_key_for(field))\n .to_sym\n end", "title": "" }, { "docid": "8c3e04b6845b4f34add4113c62e13676", "score": "0.4917063", "text": "def slug_for(time, original)\n [\n time.strftime(\"%Y%m%d-%H%M%S\"),\n counter.to_s,\n relative_path_of(original, settings[:input]).to_s.gsub(%r{/},'-'),\n ].join('-')\n end", "title": "" }, { "docid": "8c3e04b6845b4f34add4113c62e13676", "score": "0.4917063", "text": "def slug_for(time, original)\n [\n time.strftime(\"%Y%m%d-%H%M%S\"),\n counter.to_s,\n relative_path_of(original, settings[:input]).to_s.gsub(%r{/},'-'),\n ].join('-')\n end", "title": "" } ]
94366d8d8418307a9e0fed16694e8349
T1, T2 and T3 are subtrees of the tree rooted with y (on the left side) or x (on the right side). y Right Rotation x / \ > / \ x T3 T1 y / \ < / \ T1 T2 Left Rotation T2 T3 Source:
[ { "docid": "b1d866d924a13dfff6d6d0658888c066", "score": "0.6270242", "text": "def rotate(direction)\n puts \"Rotating node #{value} to the #{direction}...\" if DEBUG\n\n previous_parent = parent\n\n case direction\n when :left\n x = self # Current root.\n y = x.right\n x_clone = x.clone\n t2 = y.left\n x_clone.right = t2\n y.left = x_clone\n x.copy_attrs_from y # Original x get all y's data (value + left/right subtrees), in practice making y the new root.\n when :right\n raise \"Invalid condition found for right rotation. Current node (#{value}) must be necessarily greater than left node (#{left.value})\" if compare(value, left.value) != 1\n\n y = self # Current root.\n x = y.left\n y_clone = y.clone\n t2 = x.right\n y_clone.left = t2\n x.right = y_clone\n y.copy_attrs_from x # Original y get all x's data (value + left/right subtrees), in practice making x the new root.\n end\n end", "title": "" } ]
[ { "docid": "2d8237a886b35df3240b1f080d83333d", "score": "0.68639624", "text": "def rotate\n case left.height - right.height\n when 2\n if left.left.height < left.right.height # case b\n @left = left.rotate_left\n end\n root = rotate_right # case a\n when -2\n if right.right.height < right.left.height # case d\n @right = right.rotate_right\n end\n root = rotate_left # case c\n else\n root = self\n end\n\n root.update_height\n root\n end", "title": "" }, { "docid": "d59b4b808f3a7668823bb2e312e9dbd5", "score": "0.6392378", "text": "def rightRotate( x)\n y = x.left\n t = y.right\n # Rotation\n y.parent = x.parent\n y.right = x\n x.parent = y\n x.left = t\n if (t != nil)\n t.parent = x\n end\n if (y.parent != nil && y.parent.left == x)\n y.parent.left = y\n elsif (y.parent != nil && y.parent.right == x)\n y.parent.right = y\n end\n # Return new root\n return y\n end", "title": "" }, { "docid": "197fb43ed7f2477f07e466ce76385209", "score": "0.6368564", "text": "def leftRotate( x)\n y = x.right\n t = y.left\n # Rotation\n y.parent = x.parent\n y.left = x\n x.parent = y\n x.right = t\n if (t != nil)\n t.parent = x\n end\n if (y.parent != nil && y.parent.left == x)\n y.parent.left = y\n elsif (y.parent != nil && y.parent.right == x)\n y.parent.right = y\n end\n # Return new root\n return y\n end", "title": "" }, { "docid": "896815738e3e8de7cbdf958043d95e9d", "score": "0.615228", "text": "def leftRotate( x)\n y = x.right\n t = y.left\n # Rotation\n y.left = x\n x.right = t\n # Update heights\n x.height = self.max(self.height(x.left), self.height(x.right)) + 1\n y.height = self.max(self.height(y.left), self.height(y.right)) + 1\n # Return new root\n return y\n end", "title": "" }, { "docid": "1ec6bc58978a9abd4d91d1d912631562", "score": "0.611822", "text": "def tree; end", "title": "" }, { "docid": "1ec6bc58978a9abd4d91d1d912631562", "score": "0.611822", "text": "def tree; end", "title": "" }, { "docid": "e48a06f0738319420e275f04e56e73d6", "score": "0.61079764", "text": "def rightRotate( x)\n y = x.left\n t = y.right\n # Rotation\n y.right = x\n x.left = t\n # Update heights\n x.height = self.max(self.height(x.left), self.height(x.right)) + 1\n y.height = self.max(self.height(y.left), self.height(y.right)) + 1\n # Return new root\n return y\n end", "title": "" }, { "docid": "ba0b6b556f291344799ee2a1b383effc", "score": "0.6105462", "text": "def rotate_r(z)\n y = z.l\n return false if y.nil_node?\n\n puts_debug \"Rotate R: #{z.as_str}\"\n\n y_new_height = z.height\n # reduce tree_height to force recaulculation if rotation could reduce the tree_height\n if z.height == (tree_height - 2)\n puts \"Reduce height to #{z.height}\"\n @tree_height = z.height\n end\n\n # set parent of y\n y.p = z.p\n if z == root\n @root = y\n elsif z.p.l == z\n z.p.l = y\n else\n z.p.r = y\n end\n\n # set z.l to y.r\n z.l = y.r\n y.r.p = z if !y.r.nil_node?\n\n # set y.r\n y.r = z\n z.p = y\n\n update_height(y, y_new_height)\n\n z\n end", "title": "" }, { "docid": "153d206b89b00743169de2e75bc4a84b", "score": "0.5950482", "text": "def createTree\n #size = depth of tree? \n #self.parent = data[0]\n #get pairs from rest? [-1,-1] or [1,2]\n #self.right = \nend", "title": "" }, { "docid": "f4d27e996485adde6a3e65469836d5da", "score": "0.5923961", "text": "def rotate_once(x, dir)\n y = x.childs[dir^1]\n x.childs[dir^1] = y.childs[dir]\n y.childs[dir] = x\n y.color = x.color\n x.color = Node::RED\n return y\n end", "title": "" }, { "docid": "a7db71e4c1bbcdb11e9c809b941e92b2", "score": "0.5911006", "text": "def tree3\n \tg = TDB.new\n \t2.times { g.add_to_db(TDB.new) }\n \tg.for_each_db_entry { |e| 2.times { e.add_to_db(TDB.new) } }\n \tg.for_each_db_entry do |e|\n \t\te.for_each_db_entry { |f| 2.times { f.add_to_db(TDB.new) } }\n \tend\n \treturn g\n end", "title": "" }, { "docid": "f3260c438dc302c2ff42d654712bd160", "score": "0.5859533", "text": "def doubleWithLeftChild(k3)\n k3.left = rotateWithRightChild(k3.left)\n return rotateWithLeftChild(k3)\n end", "title": "" }, { "docid": "478fdfd020b3f2af0f203b78dbb68915", "score": "0.5832801", "text": "def balanceTree\n\n if @leftCount > @rightCount*2\n return rotateLeft\n elsif @rightCount > @leftCount*2\n return rotateRight\n end\n\n return self\n end", "title": "" }, { "docid": "52c542b424533a202b3203ded168d1ea", "score": "0.58179796", "text": "def rotate_l(z)\n y = z.r\n return false if y.nil_node?\n\n puts_debug \"Rotate L: #{z.as_str}\"\n\n y_new_height = z.height\n # reduce tree_height to force recaulculation if rotation could reduce the tree_height\n if z.height == (tree_height - 2)\n puts_debug \"Reduce height to #{z.height}\"\n @tree_height = z.height\n end\n\n # set parent of y\n y.p = z.p\n if z == root\n @root = y\n elsif z == z.p.l\n z.p.l = y\n else\n z.p.r = y\n end\n\n # set z.r to y.l\n z.r = y.l\n y.l.p = z if !y.l.nil_node?\n\n # set y.l\n y.l = z\n z.p = y\n\n update_height(y, y_new_height)\n\n z\n end", "title": "" }, { "docid": "7d1574e02b0bed143e76fb4e629e7d5c", "score": "0.58034843", "text": "def right_rotate(node)\n l_child = node.l\n node.l = l_child.r\n l_child.r.parent = node if l_child.r \n l_child.parent = node.parent\n if node.parent\n node == node.parent.l ? node.parent.l = l_child : node.parent.r = l_child\n else\n @root = l_child \n end\n l_child.r = node\n node.parent = l_child\n end", "title": "" }, { "docid": "4f9f2b2f14f6832b5277fd9125c1c30b", "score": "0.5768574", "text": "def rotate_left\n root = right\n @right = right.left\n root.left = self\n root.left.update_height\n root\n end", "title": "" }, { "docid": "f32cfcf049fd254df58fcdb6eb5d7611", "score": "0.5759516", "text": "def tree(t, _size)\n if _size < 10\n t.forward _size; t.back _size; return\n end\n t.color(139, 69, 19)\n t.forward _size / 3\n t.color(*[[0,128,0], [0,100,0], [85,107,47]].sample)\n t.left 30; tree t, _size * 2 / 3; t.right 30\n t.forward _size / 6\n t.right 25; tree t, _size / 2; t.left 25\n t.forward _size / 3\n t.right 25; tree t,_size / 2; t.left 25\n t.forward _size / 6\n t.back _size\nend", "title": "" }, { "docid": "9e0c177cd7cfd048cad648d9cd84268d", "score": "0.57299274", "text": "def rotateWithRightChild(k1)\n k2 = k1.right\n k1.right = k2.left\n k2.left = k1\n k1.height = max( height( k1.left ), height( k1.right ) ) + 1\n k2.height = max( height( k2.right ), k1.height ) + 1\n return k2\n end", "title": "" }, { "docid": "12697661406331d08fb47021c1b99bc7", "score": "0.5720929", "text": "def build_tree(preorder, inorder)\n\nend", "title": "" }, { "docid": "7a61ee394c02db6b6f1051003ddeca82", "score": "0.5691412", "text": "def rotate_right\n root = left\n @left = left.right\n root.right = self\n root.right.update_height\n root\n end", "title": "" }, { "docid": "2b98d7c8c7fcd9aa39a36dd0cc16bda3", "score": "0.56826663", "text": "def splay(node, root)\n if node == root \n return \n elsif node.parent == root \n if root.left == node\n right_rotate(node.parent, node.parent)\n else\n left_rotate(node.parent, node.parent)\n end\n else\n p = node.parent\n g = p.parent\n\n # 2 zig zag then 2 zig zig\n if p.left == node && g.right == p\n root = right_rotate(p, root)\n root = left_rotate(g, root)\n elsif p.right == node && g.left == p\n root = left_rotate(p, root)\n root = right_rotate(g, root)\n elsif p.right == node && g.right == p\n root = left_rotate(g, root)\n root = left_rotate(p, root)\n elsif p.left == node && g.left == p\n root = right_rotate(g, root)\n root = right_rotate(p, root)\n end\n splay(node, root)\n end\nend", "title": "" }, { "docid": "4d7203e2d9a3e000dcb66bd4f767f1dd", "score": "0.5666608", "text": "def right_rotate(parent, root)\n node = parent.left\n node_rchild = node.right\n\n\n node.parent = parent.parent\n if !parent.parent.nil?\n parent.parent.left = node if parent.parent.left == parent\n parent.parent.right = node if parent.parent.right == parent\n end\n\n node.right = parent\n parent.parent = node\n parent.left = node_rchild\n node_rchild.parent = parent if node_rchild\n\n if parent == root\n return node\n else\n return root\n end\nend", "title": "" }, { "docid": "24222b4d2c5821841680c43ced29ebd4", "score": "0.5658676", "text": "def create_children\n self.children.create({ # node 0: upper left\n level: self.level+1, path: self.path+\"0\", \n min_x: self.min_x, max_x: (self.max_x+self.min_x) / 2.0,\n min_y: self.min_y, max_y: (self.max_y+self.min_y) / 2.0\n })\n self.children.create({ # node 1: upper right\n level: self.level+1, path: self.path+\"1\", \n min_x: (self.max_x+self.min_x) / 2.0, max_x: self.max_x,\n min_y: self.min_y, max_y: (self.max_y+self.min_y) / 2.0\n })\n self.children.create({ # node 2: lower left\n level: self.level+1, path: self.path+\"2\", \n min_x: self.min_x, max_x: (self.max_x+self.min_x) / 2.0,\n min_y: (self.max_y+self.min_y) / 2.0, max_y: max_y\n })\n self.children.create({ # node 3: lower right\n level: self.level+1, path: self.path+\"3\", \n min_x: (self.max_x+self.min_x) / 2.0, max_x: self.max_x,\n min_y: (self.max_y+self.min_y) / 2.0, max_y: self.max_y\n })\n\n self.leaf = false\n self.save\n end", "title": "" }, { "docid": "284f403a84c0b257ef77ab8c18c9569d", "score": "0.56431514", "text": "def buildTree\n root = Node.new(-8)\n node2 = Node.new(4)\n node3 = Node.new(3)\n node4 = Node.new(-2)\n node5 = Node.new(5)\n node6 = Node.new(7)\n node7 = Node.new(-1)\n node8 = Node.new(10)\n\n\n root.right = node5\n root.left = node2\n node2.right = node4\n node2.left = node3\n node5.left = node6\n node5.right = node7\n node7.right = node8\n\n root\nend", "title": "" }, { "docid": "015c91aa3ca7f537b9ee6e8f5c55179e", "score": "0.56419015", "text": "def left_rotate(parent, root)\n node = parent.right\n node_lchild = node.left\n\n node.parent == parent.parent\n if !parent.parent.nil?\n parent.parent.left = node if parent.parent.left == parent \n parent.parent.right = node if parent.parent.right == parent\n end\n\n node.left = parent\n parent.parent = node\n parent.right = node_lchild\n node_lchild.parent = parent if ndoe_lchild\n\n if parent == root\n return node\n else\n return root\n end\nend", "title": "" }, { "docid": "75f88e227a1fd6df4b374269940dbf26", "score": "0.56326276", "text": "def performRotation(x, y, rotationDistance, coordinates)\n puts [x,y,rotationDistance].inspect\n # top row\n if y == coordinates[:ul][:y]\n distanceFromUpperLeft = x - coordinates[:ul][:x]\n distanceToMove = distanceFromUpperLeft >= rotationDistance ? rotationDistance : (rotationDistance - distanceFromUpperLeft)\n\n # Move to the next edge\n if distanceToMove > distanceFromUpperLeft # if its greater, rotate through\n performRotation coordinates[:ul][:x], (y+1), (distanceToMove -1), coordinates\n elsif distanceToMove < distanceFromUpperLeft\n return [x - distanceToMove, y]\n else # make it the corner\n performRotation coordinates[:ul][:x], y, distanceToMove, coordinates\n end\n # bottom\n elsif y == coordinates[:ll][:y]\n distanceFromLowerRight = coordinates[:lr][:x] - x\n distanceToMove = distanceFromLowerRight >= rotationDistance ? rotationDistance : (rotationDistance - distanceFromLowerRight)\n\n if distanceToMove > distanceFromLowerRight # if its greater, rotate through\n performRotation coordinates[:lr][:x], (y-1), (distanceToMove -1), coordinates\n elsif distanceToMove < distanceFromLowerRight # if its less, rotate less\n return [x + distanceToMove, y]\n else # otherwise, make it the corner\n performRotation coordinates[:lr][:x], y, distanceToMove, coordinates\n end\n # left side\n elsif x == coordinates[:ll][:x] && y != coordinates[:ul][:y] && y != coordinates[:ll][:y]\n distanceFromLowerLeft = coordinates[:ll][:y] - y\n distanceToMove = distanceFromLowerLeft >= rotationDistance ? rotationDistance : (rotationDistance - distanceFromLowerLeft)\n\n if distanceToMove > distanceFromLowerLeft\n performRotation (x+1), coordinates[:ll][:y], (distanceToMove -1), coordinates\n elsif distanceToMove == distanceFromLowerLeft\n performRotation x, coordinates[:ll][:y], distanceToMove, coordinates\n else\n return [x, y + distanceToMove]\n end\n # right side\n elsif x == coordinates[:ur][:x] && y != coordinates[:lr][:y] && y != coordinates[:ur][:y]\n distanceFromUpperRight = y - coordinates[:ur][:y]\n distanceToMove = distanceFromUpperRight >= rotationDistance ? rotationDistance : (rotationDistance - distanceFromUpperRight)\n\n if distanceToMove > distanceFromUpperRight\n performRotation (x-1), coordinates[:ur][:y], (distanceToMove -1), coordinates\n elsif distanceToMove < distanceFromUpperRight\n performRotation x, coordinates[:ur][:y], distanceToMove, coordinates\n else\n return [x, y - distanceToMove]\n end\n else\n puts \"Failure\"\n end\nend", "title": "" }, { "docid": "2e6fd9d40c570197a4f3376a2473f5cc", "score": "0.55974525", "text": "def rotateWithLeftChild(k2)\n k1 = k2.left\n k2.left = k1.right\n k1.right = k2\n k2.height = max( height( k2.left ), height( k2.right ) ) + 1\n k1.height = max( height( k1.left ), k2.height ) + 1\n return k1\n end", "title": "" }, { "docid": "c35b33e159b6326d8da7eff00ab5645e", "score": "0.5593924", "text": "def insert(node)\n x = insert_helper node\n return x unless x == node\n\n x.color = :red\n while x != @root && x.parent.color == :red\n if x.parent == x.parent.parent.left\n y = x.parent.parent.right\n if !y.nil? && y.color == :red\n x.parent.color = :black\n y.color = :black\n x.parent.parent.color = :red\n x = x.parent.parent\n else\n if x == x.parent.right\n x = x.parent\n left_rotate x\n end\n x.parent.color = :black\n x.parent.parent.color = :red\n right_rotate x.parent.parent\n end\n else\n y = x.parent.parent.left\n if !y.nil? && y.color == :red\n x.parent.color = :black\n y.color = :black\n x.parent.parent.color = :red\n x = x.parent.parent\n else\n if x == x.parent.left\n x = x.parent\n right_rotate x\n end\n x.parent.color = :black\n x.parent.parent.color = :red\n left_rotate x.parent.parent\n end\n end\n end\n @root.color = :black\n node\n end", "title": "" }, { "docid": "b3baf236fb73a82f189ae8fc55f2a404", "score": "0.5593253", "text": "def thor_root; end", "title": "" }, { "docid": "a5654ed3433c1b4d03bed7c4d0d46e1f", "score": "0.55784506", "text": "def subtree\n \n end", "title": "" }, { "docid": "6eff623aef6a101eb66870c45565d18a", "score": "0.5569992", "text": "def left_rotation\n # - Left Rotation:\n # Steps:\n # - Left rotation triggered on a node(now known as rotation_target)\n # - Remove rotation_target connection to right child(now known as new_parent)\n # - Remove new_parent's connection to it's left child(now known as new_child)\n # - new_parent's left child becomes rotation_target\n # - rotation_target's right child becomes new_child\n end", "title": "" }, { "docid": "17fefcf9c769a9d2f7f0a9c522d5db04", "score": "0.5568235", "text": "def left_rotate(node)\n r_child = node.r\n node.r = r_child.l\n r_child.l.parent = node if r_child.l\n r_child.parent = node.parent\n if node.parent \n node == node.parent.l ? node.parent.l = r_child : node.parent.r = r_child\n else\n @root = r_child\n end\n r_child.l = node\n node.parent = r_child\n end", "title": "" }, { "docid": "39857e6f0c49f4cd8c0abe7823e6f18e", "score": "0.556698", "text": "def t3\n n0 = TreeNode.new(1)\n n1 = TreeNode.new(2)\n n2 = TreeNode.new(3)\n n3 = TreeNode.new(4)\n n4 = TreeNode.new(5)\n n5 = TreeNode.new(6)\n n6 = TreeNode.new(7)\n n7 = TreeNode.new(8)\n n0.left = n1\n n0.right = n2\n n1.left = n3\n n1.right = n4\n n2.left = n5\n n4.left = n6\n n4.right = n7\n\n m0 = TreeNode.new(1)\n m1 = TreeNode.new(3)\n m2 = TreeNode.new(2)\n m3 = TreeNode.new(6)\n m4 = TreeNode.new(4)\n m5 = TreeNode.new(5)\n m6 = TreeNode.new(8)\n m7 = TreeNode.new(7)\n m8 = TreeNode.new(9)\n m0.left = m1\n m0.right = m2\n m1.right = m3\n m2.left = m4\n m2.right = m5\n m5.left = m6\n m5.right = m7\n m7.left = m8\n\n p flip_equiv(n0,m0) == false\nend", "title": "" }, { "docid": "238bb11cd327a0751537885d84fa7b41", "score": "0.55634093", "text": "def _zig(root, x)\n if root.lnode == x\n puts(\"\\tzig - left => r-rotate\") if $VERBOSE\n _r_rotate(x, root)\n else\n puts(\"\\tzig - right => l-rotate\") if $VERBOSE\n _l_rotate(x, root)\n end\n end", "title": "" }, { "docid": "cc6305a07fdd528d37a8230f2e4d6878", "score": "0.55550545", "text": "def test_spec\n root = branch(Tags::Or)\n assert Tags::Or===root\n assert_equal [], root.children\n assert_equal([], root.child_keys)\n \n x = leaf(Tags::Prop, \"x\")\n assert Tags::Prop===x\n assert_equal [], x.children\n assert_equal([], x.child_keys)\n \n root << [:left, x]\n assert_equal [x], root.children\n assert_equal [:left], root.child_keys\n assert_equal :left, x.key_in_parent\n assert_equal x, root.select(:left)\n assert_equal root, x.parent\n \n y = leaf(Tags::Prop, \"y\")\n assert Tags::Prop===y\n assert_equal [], y.children\n assert_equal([], y.child_keys)\n\n root << [:right, y]\n assert_equal [x,y], root.children\n assert_equal [:left,:right], root.child_keys\n assert_equal :left, x.key_in_parent\n assert_equal :right, y.key_in_parent\n assert_equal x, root.select(:left)\n assert_equal y, root.select(:right)\n assert_equal [x,y], root.select(:left, :right)\n assert_equal [x,y], root.select(Tags::Prop)\n end", "title": "" }, { "docid": "26c78335f2897e7357abe4c535899716", "score": "0.5554609", "text": "def m\n\n\troot = TreeNode.new(1)\n\troot.add_child( TreeNode.new(2) )\n\troot.add_child( TreeNode.new(3) )\n\troot.children[0].add_child( TreeNode.new(4) )\n\troot.children[0].add_child( TreeNode.new(5) )\n\troot.children[1].add_child( TreeNode.new(6) )\n\troot.children[1].add_child( TreeNode.new(7) )\n\n\troot\nend", "title": "" }, { "docid": "016f644f58e8739343a13bec4d46a775", "score": "0.5549303", "text": "def tree_right\n @_tree_right ||= [\n 0x01, 0x00, 0x02, 0x01, 0x04, 0x01, 0x06, 0x01, 0x08, 0x01, 0x0C, 0x01,\n 0x0E, 0x01, 0x10, 0x01, 0x12, 0x01, 0x14, 0x01, 0x16, 0x01, 0x18, 0x01,\n 0x1A, 0x01, 0x1C, 0x01, 0x1E, 0x01, 0x25, 0x01, 0x5C, 0x01, 0x5F, 0x01,\n 0x7F, 0x01, 0x81, 0x01, 0x83, 0x01, 0x85, 0x01, 0x87, 0x01, 0x89, 0x01,\n 0x8B, 0x01, 0x8D, 0x01, 0x8F, 0x01, 0x91, 0x01, 0x93, 0x01, 0x95, 0x01,\n 0x97, 0x01, 0x99, 0x01, 0x9B, 0x01, 0x9D, 0x01, 0x9F, 0x01, 0xA1, 0x01,\n 0xA3, 0x01, 0xA5, 0x01, 0xA7, 0x01, 0xA9, 0x01, 0xAB, 0x01, 0xAD, 0x01,\n 0xAF, 0x01, 0xB1, 0x01, 0xB3, 0x01, 0xB5, 0x01, 0xB7, 0x01, 0xB9, 0x01,\n 0xBB, 0x01, 0xBD, 0x01, 0xBF, 0x01, 0xC1, 0x01, 0xC8, 0x01, 0xCA, 0x01,\n 0xCD, 0x01, 0xCF, 0x01, 0xD1, 0x01, 0xD3, 0x01, 0xD5, 0x01, 0xD7, 0x01,\n 0xD9, 0x01, 0xDB, 0x01, 0xDD, 0x01, 0xDF, 0x01, 0xE1, 0x01, 0xEB, 0x01,\n 0xED, 0x01, 0xF1, 0x01, 0xF3, 0x01, 0xF5, 0x01, 0xF7, 0x01, 0xF9, 0x01,\n 0xFB, 0x01, 0xFD, 0x01, 0xFF, 0x01, 0x00, 0x00, 0x02, 0x00, 0x04, 0x00,\n 0x06, 0x00, 0x08, 0x00, 0x0A, 0x00, 0x0C, 0x00, 0x0E, 0x00, 0x10, 0x00,\n 0x12, 0x00, 0x14, 0x00, 0x16, 0x00, 0x18, 0x00, 0x1A, 0x00, 0x1C, 0x00,\n 0x1E, 0x00, 0x20, 0x00, 0x22, 0x00, 0x24, 0x00, 0x26, 0x00, 0x28, 0x00,\n 0x2A, 0x00, 0x2C, 0x00, 0x2E, 0x00, 0x30, 0x00, 0x32, 0x00, 0x34, 0x00,\n 0x36, 0x00, 0x38, 0x00, 0x3A, 0x00, 0x3C, 0x00, 0x3E, 0x00, 0x40, 0x00,\n 0x42, 0x00, 0x44, 0x00, 0x46, 0x00, 0x48, 0x00, 0x4A, 0x00, 0x24, 0x01,\n 0x4C, 0x00, 0x4E, 0x00, 0x50, 0x00, 0x52, 0x00, 0x54, 0x00, 0x56, 0x00,\n 0x58, 0x00, 0x5A, 0x00, 0x5C, 0x00, 0x5E, 0x00, 0x60, 0x00, 0x62, 0x00,\n 0x64, 0x00, 0x66, 0x00, 0x68, 0x00, 0x6A, 0x00, 0x6C, 0x00, 0x6E, 0x00,\n 0x70, 0x00, 0x72, 0x00, 0x74, 0x00, 0x76, 0x00, 0x78, 0x00, 0x7A, 0x00,\n 0x7C, 0x00, 0x7E, 0x00, 0x80, 0x00, 0x82, 0x00, 0x7C, 0x01, 0x84, 0x00,\n 0x86, 0x00, 0x88, 0x00, 0x8A, 0x00, 0x8C, 0x00, 0x8E, 0x00, 0x90, 0x00,\n 0x92, 0x00, 0x51, 0x01, 0x94, 0x00, 0x56, 0x01, 0x96, 0x00, 0x3E, 0x01,\n 0x5A, 0x01, 0x55, 0x01, 0x99, 0x00, 0x9A, 0x00, 0x2F, 0x01, 0xEF, 0x01,\n 0x9C, 0x00, 0x7B, 0x01, 0x59, 0x01, 0x9E, 0x00, 0xA0, 0x00, 0x3F, 0x01,\n 0xE2, 0x01, 0x4F, 0x01, 0x42, 0x01, 0xE3, 0x01, 0xA3, 0x00, 0xA4, 0x00,\n 0x50, 0x01, 0xA5, 0x00, 0x49, 0x01, 0xA7, 0x00, 0xA9, 0x00, 0xAB, 0x00,\n 0xAD, 0x00, 0xAE, 0x00, 0xB0, 0x00, 0x57, 0x01, 0xB2, 0x00, 0xB4, 0x00,\n 0x54, 0x01, 0x37, 0x01, 0x38, 0x01, 0xEE, 0x01, 0x22, 0x01, 0x35, 0x01,\n 0x34, 0x01, 0xB9, 0x00, 0x2D, 0x01, 0x3A, 0x01, 0x32, 0x01, 0xBB, 0x00,\n 0xBC, 0x00, 0x53, 0x01, 0x31, 0x01, 0x7A, 0x01, 0xC1, 0x00, 0xC2, 0x00,\n 0x46, 0x01, 0x6A, 0x01, 0xC6, 0x00, 0xE4, 0x01, 0x3B, 0x01, 0x76, 0x01,\n 0x77, 0x01, 0xC4, 0x01, 0xCA, 0x00, 0xCB, 0x00, 0xCC, 0x00, 0xCD, 0x00,\n 0x27, 0x01, 0x5D, 0x01, 0xE7, 0x01, 0xE8, 0x01, 0xD0, 0x00, 0x28, 0x01,\n 0xE6, 0x01, 0xD3, 0x00, 0xD4, 0x00, 0x75, 0x01, 0x23, 0x01, 0xD6, 0x00,\n 0x64, 0x01, 0xD8, 0x00, 0xD9, 0x00, 0x63, 0x01, 0xDA, 0x00, 0xDC, 0x00,\n 0xDD, 0x00, 0xDF, 0x00, 0xE0, 0x00, 0x72, 0x01, 0xE2, 0x00, 0x6F, 0x01,\n 0xE4, 0x00, 0x0A, 0x01, 0xE7, 0x00, 0xE8, 0x00, 0xE9, 0x00, 0xEB, 0x00,\n 0xED, 0x00, 0xEF, 0x00, 0xF1, 0x00, 0xF3, 0x00, 0xF5, 0x00, 0xF6, 0x00,\n 0xF8, 0x00, 0xFA, 0x00, 0xFC, 0x00, 0x00, 0x01\n ].pack('C*').unpack('v*')\n end", "title": "" }, { "docid": "6c4f159436940c172efafcf245033443", "score": "0.55389637", "text": "def one_layer_rotation(grid, first_row, first_col, last_row, last_col)\n # top row\n top_left = grid[first_row][first_col]\n (first_col+1..last_col).each do |i|\n grid[first_row][i-1] = grid[first_row][i]\n end\n \n # left col\n bottom_left = grid[last_row][first_col]\n (last_row-1).downto(first_row+1) do |i|\n grid[i+1][first_col] = grid[i][first_col]\n end\n grid[first_row+1][first_col] = top_left\n \n # bottom row\n bottom_right = grid[last_row][last_col]\n (last_col-1).downto(first_col+1) do |i|\n grid[last_row][i+1] = grid[last_row][i]\n end\n grid[last_row][first_col+1] = bottom_left\n \n # right col\n (first_row+1..last_row-1).each do |i|\n grid[i-1][last_col] = grid[i][last_col] \n end\n grid[last_row-1][last_col] = bottom_right\nend", "title": "" }, { "docid": "acb6fc63bb95330617e40b3fe537fda9", "score": "0.55316556", "text": "def _l_rotate(x, y)\n return if x.nil? || x.pnode.nil?\n #\n _rotate_hlp(x, y, :left)\n end", "title": "" }, { "docid": "1d18a7cdb4ea5b23d20e4dc6a649004f", "score": "0.5515135", "text": "def _r_rotate(x, y)\n return if x.nil? || y.nil? # x.pnode.nil?\n #\n _rotate_hlp(x, y, :right)\n end", "title": "" }, { "docid": "c824252519ad8c65454d625acf7e756e", "score": "0.55016917", "text": "def tree_delete(t, z)\n return if z.nil?\n if z.left.nil?\n transplant(t, z, z.right)\n elsif z.right.nil?\n transplant(t, z, z.left)\n else\n y = BinarySearchTree::tree_minimum(z.right)\n if y.p != z\n transplant(t, y, y.right)\n y.right = z.right\n y.right.p = y\n end\n transplant(t, z, y)\n y.left = z.left\n y.left.p = y\n end\n end", "title": "" }, { "docid": "c97ef684f213120e44ecd9e9247e19ea", "score": "0.5496347", "text": "def rotateRL\n newLeft = Node.new(@value, @left, @right.left.left)\n @value, @right.left, @left = @right.left.value, @right.left.right, newLeft\n @right.set_height\n end", "title": "" }, { "docid": "8f3f48e8193a78176ade6bbee370fa6d", "score": "0.54952157", "text": "def t4\n n0 = TreeNode.new(1)\n n1 = TreeNode.new(2)\n n2 = TreeNode.new(3)\n n3 = TreeNode.new(4)\n n4 = TreeNode.new(5)\n n5 = TreeNode.new(6)\n n6 = TreeNode.new(7)\n n7 = TreeNode.new(8)\n n0.left = n1\n n0.right = n2\n n1.left = n3\n n1.right = n4\n n2.left = n5\n n4.left = n6\n n4.right = n7\n\n m0 = TreeNode.new(1)\n m1 = TreeNode.new(3)\n m2 = TreeNode.new(2)\n m3 = TreeNode.new(6)\n m4 = TreeNode.new(4)\n m5 = TreeNode.new(5)\n m0.left = m1\n m0.right = m2\n m1.right = m3\n m2.left = m4\n m2.right = m5\n\n p flip_equiv(n0,m0) == false\nend", "title": "" }, { "docid": "02b4a3bd836de2f7aa056efd7c16de52", "score": "0.5491605", "text": "def rotate_left!\n=begin\n= x b\n= a b => x f\n= c d e f a e ...\n=end\n if @parent then #then our node have parent\n if @parent.left == self then @parent.left = @right\n else @parent.right = @right\n end\n end\n\n @right.parent, @parent = @parent, @right\n\n @right = @right.left\n @right.parent = self if @right\n\n @parent.left = self\n #returns node x\n end", "title": "" }, { "docid": "6d278418799259a1b16c67aacc7b3585", "score": "0.5487974", "text": "def invert_tree(root)\n \nend", "title": "" }, { "docid": "e57fd6d9f51eb7ed447da285e83f0bdb", "score": "0.5480814", "text": "def rotate_left(root)\n temp_node = root.link_right\n root.link_right = temp_node.link_left\n temp_node.link_left = root\n temp_node\n end", "title": "" }, { "docid": "0d49f43ef40d0da71f730e1b59748a90", "score": "0.54725313", "text": "def convertTraingleToTreeWithoutConnections triangle\n\t\t\t\t\t\t\t\ttree = Tree.new\n\t\t\t\t\t\t\t\ttriangle.each_with_index do |line, index|\n\t\t\t\t\t\t\t\t\t\t\t\tbranch = Branch.new index\n\n\t\t\t\t\t\t\t\t\t\t\t\tline << 0 until line.count == index+1 if line.count < index+1\n\t\t\t\t\t\t\t\t\t\t\t\tline.pop until line.count == index+1 if line.count > index+1\n\n\t\t\t\t\t\t\t\t\t\t\t\tline.each do |value|\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbranch << Leaf.new(value)\n\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\ttree << branch\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\ttree\nend", "title": "" }, { "docid": "aa0210b775396ca2154c596b4831c6b8", "score": "0.5435892", "text": "def rotate_right\n return unless left\n\n me = RedBlackTree.new(value, color, deleted, left, right)\n\n x = me.left\n me.left = x.right\n x.right = me\n\n copy x\n end", "title": "" }, { "docid": "40ce8772e2746035c1ff76e451e17f0c", "score": "0.54300153", "text": "def quad_tree (tx, ty, zoom)\n quad_key = ''\n ty = (2**zoom - 1) - ty\n i = zoom\n while i > 0 do\n digit = 0\n mask = 1 << (i-1)\n digit += 1 if (tx & mask) != 0\n digit += 2 if (ty & mask) != 0\n quad_key += digit.to_s\n i -= 1\n end\n quad_key\n end", "title": "" }, { "docid": "964a133fd5f8b2cb4f9a4ceb79a4cceb", "score": "0.54187614", "text": "def rotateRight root\n newRoot = root.left\n root.left = newRoot.right\n newRoot.right = root\n update root\n update newRoot\n return newRoot\n end", "title": "" }, { "docid": "1ba63b7ec8ee05ff4f55c7ff45b30cc7", "score": "0.5416213", "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": "97eafa048312b050c721b8318393732b", "score": "0.5407077", "text": "def t1\n n0 = TreeNode.new(1)\n n1 = TreeNode.new(2)\n n2 = TreeNode.new(3)\n n3 = TreeNode.new(4)\n n4 = TreeNode.new(5)\n n5 = TreeNode.new(6)\n n6 = TreeNode.new(7)\n n7 = TreeNode.new(8)\n n0.left = n1\n n0.right = n2\n n1.left = n3\n n1.right = n4\n n2.left = n5\n n4.left = n6\n n4.right = n7\n\n m0 = TreeNode.new(1)\n m1 = TreeNode.new(3)\n m2 = TreeNode.new(2)\n m3 = TreeNode.new(6)\n m4 = TreeNode.new(4)\n m5 = TreeNode.new(5)\n m6 = TreeNode.new(8)\n m7 = TreeNode.new(7)\n m0.left = m1\n m0.right = m2\n m1.right = m3\n m2.left = m4\n m2.right = m5\n m5.left = m6\n m5.right = m7\n\n p flip_equiv(n0,m0) == true\nend", "title": "" }, { "docid": "4d03f484f006efd5bf06aeaa1f51eaa7", "score": "0.53938556", "text": "def rotateLeft root\n newRoot = root.right\n root.right = newRoot.left\n newRoot.left = root\n update root\n update newRoot\n return newRoot\n end", "title": "" }, { "docid": "7dc2e2877f76ebcaa706eedc04e28a6c", "score": "0.5375097", "text": "def t2\n n0 = TreeNode.new(1)\n n1 = TreeNode.new(2)\n n2 = TreeNode.new(3)\n n3 = TreeNode.new(4)\n n4 = TreeNode.new(5)\n n5 = TreeNode.new(6)\n n6 = TreeNode.new(7)\n n7 = TreeNode.new(8)\n n0.left = n1\n n0.right = n2\n n1.left = n3\n n1.right = n4\n n2.left = n5\n n4.left = n6\n n4.right = n7\n\n m0 = TreeNode.new(1)\n m1 = TreeNode.new(3)\n m2 = TreeNode.new(2)\n m3 = TreeNode.new(6)\n m4 = TreeNode.new(4)\n m5 = TreeNode.new(5)\n m6 = TreeNode.new(8)\n m7 = TreeNode.new(9)\n m0.left = m1\n m0.right = m2\n m1.right = m3\n m2.left = m4\n m2.right = m5\n m5.left = m6\n m5.right = m7\n\n p flip_equiv(n0,m0) == false\nend", "title": "" }, { "docid": "facde1d7c2c5cb8ba45cf4a7640ee2ee", "score": "0.53691626", "text": "def rotate_left\n return unless right\n\n me = RedBlackTree.new(value, color, deleted, left, right)\n\n x = me.right\n me.right = x.left\n x.left = me\n\n copy x\n end", "title": "" }, { "docid": "ee3cfc16213046448050d2e95b28fac2", "score": "0.5361638", "text": "def build_tree(arr, first = 0, last = arr.length - 1)\n return nil if first > last\n \n middle = (first + last) / 2 \n root = Node.new(arr[middle])\nroot.left_child = build_tree(arr, first, middle-1)\nroot.right_child = build_tree(arr, middle+1, last)\nroot\n end", "title": "" }, { "docid": "c81b4cb7f89c3a0cfc6a76602f326ec4", "score": "0.5361201", "text": "def tree_left\n @_tree_left ||= [\n 0x01, 0x01, 0x03, 0x01, 0x05, 0x01, 0x07, 0x01, 0x0B, 0x01, 0x0D, 0x01,\n 0x0F, 0x01, 0x11, 0x01, 0x13, 0x01, 0x15, 0x01, 0x17, 0x01, 0x19, 0x01,\n 0x1B, 0x01, 0x1D, 0x01, 0x1F, 0x01, 0x40, 0x01, 0x5E, 0x01, 0x60, 0x01,\n 0x80, 0x01, 0x82, 0x01, 0x84, 0x01, 0x86, 0x01, 0x88, 0x01, 0x8A, 0x01,\n 0x8C, 0x01, 0x8E, 0x01, 0x90, 0x01, 0x92, 0x01, 0x94, 0x01, 0x96, 0x01,\n 0x98, 0x01, 0x9A, 0x01, 0x9C, 0x01, 0x9E, 0x01, 0xA0, 0x01, 0xA2, 0x01,\n 0xA4, 0x01, 0xA6, 0x01, 0xA8, 0x01, 0xAA, 0x01, 0xAC, 0x01, 0xAE, 0x01,\n 0xB0, 0x01, 0xB2, 0x01, 0xB4, 0x01, 0xB6, 0x01, 0xB8, 0x01, 0xBA, 0x01,\n 0xBC, 0x01, 0xBE, 0x01, 0xC0, 0x01, 0xC6, 0x01, 0xC9, 0x01, 0xCB, 0x01,\n 0xCE, 0x01, 0xD0, 0x01, 0xD2, 0x01, 0xD4, 0x01, 0xD6, 0x01, 0xD8, 0x01,\n 0xDA, 0x01, 0xDC, 0x01, 0xDE, 0x01, 0xE0, 0x01, 0xEA, 0x01, 0xEC, 0x01,\n 0xF0, 0x01, 0xF2, 0x01, 0xF4, 0x01, 0xF6, 0x01, 0xF8, 0x01, 0xFA, 0x01,\n 0xFC, 0x01, 0xFE, 0x01, 0x7E, 0x01, 0x01, 0x00, 0x03, 0x00, 0x05, 0x00,\n 0x07, 0x00, 0x09, 0x00, 0x0B, 0x00, 0x0D, 0x00, 0x0F, 0x00, 0x11, 0x00,\n 0x13, 0x00, 0x15, 0x00, 0x17, 0x00, 0x19, 0x00, 0x1B, 0x00, 0x1D, 0x00,\n 0x1F, 0x00, 0x21, 0x00, 0x23, 0x00, 0x25, 0x00, 0x27, 0x00, 0x29, 0x00,\n 0x2B, 0x00, 0x2D, 0x00, 0x2F, 0x00, 0x31, 0x00, 0x33, 0x00, 0x35, 0x00,\n 0x37, 0x00, 0x39, 0x00, 0x3B, 0x00, 0x3D, 0x00, 0x3F, 0x00, 0x41, 0x00,\n 0x43, 0x00, 0x45, 0x00, 0x47, 0x00, 0x49, 0x00, 0xCC, 0x01, 0x4B, 0x00,\n 0x4D, 0x00, 0x4F, 0x00, 0x51, 0x00, 0x53, 0x00, 0x55, 0x00, 0x57, 0x00,\n 0x59, 0x00, 0x5B, 0x00, 0x5D, 0x00, 0x5F, 0x00, 0x61, 0x00, 0x63, 0x00,\n 0x65, 0x00, 0x67, 0x00, 0x69, 0x00, 0x6B, 0x00, 0x6D, 0x00, 0x6F, 0x00,\n 0x71, 0x00, 0x73, 0x00, 0x75, 0x00, 0x77, 0x00, 0x79, 0x00, 0x7B, 0x00,\n 0x7D, 0x00, 0x7F, 0x00, 0x81, 0x00, 0x83, 0x00, 0xC2, 0x01, 0x85, 0x00,\n 0x87, 0x00, 0x89, 0x00, 0x8B, 0x00, 0x8D, 0x00, 0x8F, 0x00, 0x91, 0x00,\n 0x93, 0x00, 0x3C, 0x01, 0x2A, 0x01, 0x95, 0x00, 0x58, 0x01, 0x97, 0x00,\n 0x2B, 0x01, 0x98, 0x00, 0x4A, 0x01, 0x52, 0x01, 0x9B, 0x00, 0x21, 0x01,\n 0x9D, 0x00, 0x7D, 0x01, 0x26, 0x01, 0x9F, 0x00, 0xA1, 0x00, 0x47, 0x01,\n 0x45, 0x01, 0xA2, 0x00, 0x4D, 0x01, 0x44, 0x01, 0x4E, 0x01, 0x48, 0x01,\n 0x3D, 0x01, 0x4C, 0x01, 0xA6, 0x00, 0xA8, 0x00, 0xAA, 0x00, 0xAC, 0x00,\n 0x41, 0x01, 0xAF, 0x00, 0xB1, 0x00, 0x43, 0x01, 0xB3, 0x00, 0xB5, 0x00,\n 0x39, 0x01, 0x36, 0x01, 0xB6, 0x00, 0xB7, 0x00, 0xB8, 0x00, 0x4B, 0x01,\n 0x71, 0x01, 0x33, 0x01, 0xC5, 0x01, 0xBA, 0x00, 0x09, 0x01, 0x30, 0x01,\n 0xBD, 0x00, 0xBE, 0x00, 0xBF, 0x00, 0xC0, 0x00, 0x6B, 0x01, 0xC3, 0x00,\n 0xC4, 0x00, 0xC5, 0x00, 0x78, 0x01, 0xC7, 0x00, 0xC7, 0x01, 0xC8, 0x00,\n 0xC9, 0x00, 0x62, 0x01, 0x2C, 0x01, 0x79, 0x01, 0xE9, 0x01, 0x66, 0x01,\n 0x5B, 0x01, 0xCE, 0x00, 0xCF, 0x00, 0x70, 0x01, 0xD1, 0x00, 0x29, 0x01,\n 0xD2, 0x00, 0x6D, 0x01, 0x67, 0x01, 0xD5, 0x00, 0x2E, 0x01, 0xD7, 0x00,\n 0x6C, 0x01, 0xC3, 0x01, 0xE5, 0x01, 0x68, 0x01, 0xDB, 0x00, 0x73, 0x01,\n 0xDE, 0x00, 0x74, 0x01, 0xE1, 0x00, 0x69, 0x01, 0x61, 0x01, 0xE3, 0x00,\n 0xE5, 0x00, 0xE6, 0x00, 0x65, 0x01, 0x6E, 0x01, 0xEA, 0x00, 0xEC, 0x00,\n 0xEE, 0x00, 0xF0, 0x00, 0xF2, 0x00, 0xF4, 0x00, 0x20, 0x01, 0xF7, 0x00,\n 0xF9, 0x00, 0xFB, 0x00, 0xFD, 0x00, 0x00, 0x01\n ].pack('C*').unpack('v*')\n end", "title": "" }, { "docid": "549d556ec390ca2a02e98f2eca658181", "score": "0.5358895", "text": "def level_order(root)\nend", "title": "" }, { "docid": "24c6f6993b3a402ae7ad567d03b68075", "score": "0.53573304", "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": "88247bd2fa39c36859dc4910e0626975", "score": "0.53505725", "text": "def mutation\n @tree.children{\n |child|\n name = child.name \n child.children {\n |grandChild|\n parent = name + \" \" + grandChild.name\n # Decide si el nodo a mutar, sera\n # 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 a mutar.\n height = grandChild.node_height\n levelToMutate = rand(height)\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 mutationAux(0,grandChild,parent,isTerminal,levelToMutate)\n else\n nodo_escogido(0,grandChild,0,parent)\n end\n }\n }\n end", "title": "" }, { "docid": "0bc1e848fd1b7d1dcdbc097b1860cc7d", "score": "0.5344028", "text": "def transplant(u,v)\n if @root == u\n @root = v\n elsif u == u.p.l\n u.p.l = v\n elsif u == u.p.r\n u.p.r = v\n end\n\n v.p = u.p\n\n update_height(v, u.height)\n end", "title": "" }, { "docid": "d7d919ad700353cc344e3dfa98ba8ac6", "score": "0.53360635", "text": "def rotateR\n newRight = Node.new(@value, @left.right, @right);\n @value = @left.value;\n @left = @left.left;\n @right = newRight\n end", "title": "" }, { "docid": "0888a7f714335a0a5b3a589cda576643", "score": "0.5334742", "text": "def google_tree\n\t\tNode.new(\n\t\t\tvalue: 4,\n\t\t\tleft: Node.new(\n\t\t\t\tvalue: 2,\n\t\t\t\tleft: Node.new(\n\t\t\t\t\tvalue: 1\n\t\t\t\t),\n\t\t\t\tright: Node.new(\n\t\t\t\t\tvalue: 3\n\t\t\t\t)\n\t\t\t),\n\t\t\tright: Node.new(\n\t\t\t\tvalue: 7,\n\t\t\t\tleft: Node.new(\n\t\t\t\t\tvalue: 6\n\t\t\t\t),\n\t\t\t\tright: Node.new(\n\t\t\t\t\tvalue: 9\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\tend", "title": "" }, { "docid": "8066fe1b167b7238c8612f4f642d239f", "score": "0.5327757", "text": "def make_tree\n # this is where the levels of the merk tree will be stored\n layer = @raw.clone\n size = 99\n d = Digest::SHA256.new\n @tree = []\n @tree << @raw.collect do |r|\n d.reset\n d << r.to_s\n d.hexdigest\n end\n\n while size > 1\n layer2 = hash_all(layer)\n\n @tree << layer2.clone\n layer = layer2.clone\n size = layer.size\n end\n\n # but doing this gives you the raw data at the top and the single-node apex at the bottom\n # this is confusing so the tree needs to be flipped upside down.\n @tree.reverse!\n end", "title": "" }, { "docid": "edd5587966275c202cb81a678ed5e0d7", "score": "0.53268677", "text": "def rotate_left\n n = self.right\n self.right = n.left\n n.left = self\n n\n end", "title": "" }, { "docid": "e9646dceadbbed1ca96b18ef64fb3712", "score": "0.53246224", "text": "def doubleWithRightChild(k1)\n k1.right = rotateWithLeftChild(k1.right)\n return rotateWithRightChild(k1)\n end", "title": "" }, { "docid": "1e1334da25781f821e7bb888fd94f036", "score": "0.5322102", "text": "def recurse(object)\n # Step 1: Let the tree only has children nodes and not label & path.\n # `@root` has the group name, hence deleting its references like `label` and `path`\n label = object.delete('label')\n path = object.delete('path')\n\n # Step 2: Initialize to an empty hash to create a new tree picking immediate children from each level considered.\n children = {}\n\n # Step 3: Iterating over each node considering active level and add it to the database.\n object.each do |key, value|\n # 3.a. Let the current hash only has children nodes, ignore `label`, `path`, & `tk_id`.\n iteratable_hash = value.except('label', 'path', 'tk_id')\n\n # 3.b. Generate a random hex value and assume it as a parent node ID\n parent_id = SecureRandom.hex\n\n # 3.c. Assign parent node ID to the child nodes.\n # Desc:\n # Creating a whole tree from children, each children node must their parent node's reference.\n # `tk_id` is a reference to parent node and is TaxonomyKeyword#id\n iteratable_hash.values.each do |i_h|\n i_h.merge!('tk_id' => parent_id)\n end\n\n # 3.d. Save the current node to the database\n # ...\n\n # 3.e. Retain the topics but from different domains with the same name.\n # Desc:\n # Possibility that same topic may occur under different domains with same name.\n # Hence, drilling down the taxonomies using `path` since `path` shall remains unique.\n iteratable_hash.each do |i_key, i_value|\n children[i_value['path']] = i_value\n end\n\n # 3.f: Do not consider leaf nodes i.e. those have no children to process.\n\n # 3.g: Capture the parent id generated.\n # Scope: Does nothing.\n @existing_taxons << parent_id\n end\n\n return if children.empty?\n\n # Step 3: Re-initialize whole `@state` with a new tree structure (only children from current_level)\n @state = children.clone\n\n # Step 4: Perform repeatedly till we have an empty tree. Empty tree means no more leaf nodes.\n recurse(@state)\n end", "title": "" }, { "docid": "c9b2c513177b25260071b4e46efe8fbd", "score": "0.53184533", "text": "def build_move_tree\r\n self.root_node = PolyTreeNode.new(@pos)\r\n # HashMap[root_pos] = new_move_positions()\r\n nodes = [root_node]\r\n until nodes.empty?\r\n current_node = nodes.shift #Take first one, FIFO!\r\n\r\n current_pos = current_node.value\r\n current_new_move_positions = new_move_positions(current_pos)\r\n current_new_move_positions.each do |moved_to_pos|\r\n moved_to_node = PolyTreeNode.new(moved_to_pos)\r\n # is a position you can move to from the current_node so it\r\n # is a child node\r\n current_node.add_child(moved_to_node) \r\n nodes << moved_to_node #Tag it onto the end\r\n end\r\n end\r\n end", "title": "" }, { "docid": "174398de74da4fdac112998234962508", "score": "0.53182614", "text": "def build_tree(in_order_elements, post_order_elements)\nend", "title": "" }, { "docid": "9aa5c52640f97059e7849e5e6d3e13e4", "score": "0.53162426", "text": "def traverseTree(t)\n\n values = []\n nodes = []\n if t\n nodes << t\n end\n while !nodes.empty?\n node = nodes.pop\n values << node.value\n if node.left\n nodes.unshift node.left\n end\n if node.right\n nodes.unshift node.right\n end\n end\n values\nend", "title": "" }, { "docid": "ef7a9c8db0bdde813d9ad39e654f7e88", "score": "0.52973425", "text": "def get_tree\n n8 = Node.new(8)\n n9 = Node.new(9, n8, nil)\n n4 = Node.new(4)\n n7 = Node.new(7, n4, n9)\n n20 = Node.new(20)\n n11 = Node.new(11)\n n15 = Node.new(15, n11, n20)\n n10 = Node.new(10, n7, n15)\n end", "title": "" }, { "docid": "fe57390e7c8e367f2251e37839506bc5", "score": "0.5296105", "text": "def test_rot_T(args, assert)\n tet = Tetromino.new(0, 0, 'T')\n tet.rot_left\n assert.true! tet.blocks == [0,1,0,0, 1,1,0,0, 0,1,0,0, 0,0,0,0], \"FAIL: T block rot_left 1\\n -> \" + tet.blocks.to_s\n tet.rot_left\n assert.true! tet.blocks == [0,0,0,0, 1,1,1,0, 0,1,0,0, 0,0,0,0], \"FAIL: T block rot_left 2\\n -> \" + tet.blocks.to_s\n tet.rot_left\n assert.true! tet.blocks == [0,1,0,0, 0,1,1,0, 0,1,0,0, 0,0,0,0], \"FAIL: T block rot_left 3\\n -> \" + tet.blocks.to_s\n tet.rot_left\n assert.true! tet.blocks == [0,1,0,0, 1,1,1,0, 0,0,0,0, 0,0,0,0], \"FAIL: T block rot_left 4\\n -> \" + tet.blocks.to_s\n tet.rot_right\n assert.true! tet.blocks == [0,1,0,0, 0,1,1,0, 0,1,0,0, 0,0,0,0], \"FAIL: T block rot_right 1\\n -> \" + tet.blocks.to_s\n tet.rot_right\n assert.true! tet.blocks == [0,0,0,0, 1,1,1,0, 0,1,0,0, 0,0,0,0], \"FAIL: T block rot_right 2\\n -> \" + tet.blocks.to_s\n tet.rot_right\n assert.true! tet.blocks == [0,1,0,0, 1,1,0,0, 0,1,0,0, 0,0,0,0], \"FAIL: T block rot_right 3\\n -> \" + tet.blocks.to_s\n tet.rot_right\n assert.true! tet.blocks == [0,1,0,0, 1,1,1,0, 0,0,0,0, 0,0,0,0], \"FAIL: T block rot_right 4\\n -> \" + tet.blocks.to_s\n puts \"PASS: T block rotation\"\nend", "title": "" }, { "docid": "9487509acfa1af0c559f909d0b5e8bb0", "score": "0.529547", "text": "def build_directional_tree_nodes(direction = [1, 0])\n vertical_movement, horizontal_movement = direction\n closest_move = MoveTreeNode.new(direction)\n (2..7).each do |spaces|\n current_child = closest_move\n (spaces - 2).times { current_child = current_child.children[0] }\n current_child.add_child([spaces * vertical_movement, spaces * horizontal_movement])\n end\n\n closest_move\n end", "title": "" }, { "docid": "9196fc960f5842e092fe9f3ce5b1da1f", "score": "0.52797925", "text": "def calc_lft_and_rgt\nfar_left = furthrest_left\n far_right = furthrest_right\n gap = far_right - far_left\n if @children.size>0 \n self.left_col_val = far_left + gap/4 \n self.right_col_val = far_right - gap/4 \n else \n self.left_col_val = self.right_col_val = far_left+(gap/self.class.bias) \n end\nend", "title": "" }, { "docid": "0b752d02fe7fab1bfc255e0716b86672", "score": "0.52760816", "text": "def postorder(tree)\n if tree\n postorder(tree.leftChild)\n postorder(tree.rightChild)\n p tree.key\n end\nend", "title": "" }, { "docid": "940bc87c4077e6f0f67cf46b8c619484", "score": "0.5274143", "text": "def construct_quadtree(qt, centre, radius)\n def construct_quadtree_r(qt, x, y, w, centre, radius)\n # Cases: Not overlapping - do nothing\n # Fully overlapping - delete all subtrees, replace with leaf\n # Partial overlap - subdivide and recur\n # Can replace full and partial overlap cases by merging if all\n # children are leaves. Inefficient though as it subdivides to \n # 1 pixel. Don't do this in a real implementation.\n if w == 1\n if in_circle(x, y, centre, radius) and qt.value != 1\n return Quadtree.new(1, nil, nil, nil, nil)\n else\n return qt\n end\n end\n if in_circle(x, y, centre, radius) and in_circle(x, y+w, centre, radius) and in_circle(x+w, y, centre, radius) and in_circle(x+w, y+w, centre, radius)\n #full overlap\n return Quadtree.new(1, nil, nil, nil, nil)\n elsif circle_aabb_overlap?(Circle.new(Point.new(centre[0], centre[1]), radius),\n AABB.new(Point.new(x, y), w))\n #partial overlap\n #subdivide leaf nodes and recur\n if leaf_node(qt)\n oldval = qt.value\n qt = Quadtree.new(nil, Quadtree.new(oldval,nil,nil,nil,nil),\n Quadtree.new(oldval,nil,nil,nil,nil), Quadtree.new(oldval,nil,nil,nil,nil),\n Quadtree.new(oldval,nil,nil,nil,nil))\n end\n tlchild = construct_quadtree_r(qt.topleft,x,y,w/2,centre,radius)\n trchild = construct_quadtree_r(qt.topright,x+w/2,y,w/2,centre,radius)\n blchild = construct_quadtree_r(qt.bottomleft,x,y+w/2,w/2,centre,radius)\n brchild = construct_quadtree_r(qt.bottomright,x+w/2,y+w/2,w/2,centre,radius)\n if leaf_node(tlchild) and leaf_node(trchild) and leaf_node(blchild) and leaf_node(brchild)\n sum = tlchild.value+trchild.value+blchild.value+brchild.value\n if sum == 0 #all black\n return Quadtree.new(0, nil, nil, nil, nil)\n elsif sum == 4 # all white\n return Quadtree.new(1, nil, nil, nil, nil)\n end\n end\n return Quadtree.new(nil, tlchild, trchild, blchild, brchild)\n else\n #no overlap\n return qt\n end\n end\n construct_quadtree_r(qt, 0, 0, 512, centre, radius)\nend", "title": "" }, { "docid": "fdaf55f0446c75c4a6eaef873eb26a17", "score": "0.527103", "text": "def build_tac_tree(tree)\n while tree != nil\n if is_block_start?(tree.type) and tree.tac_str != nil\n if tree.type == :if_s or tree.type == :while_s\n #puts tree.children[0].tac_str put temp conditional creation ahead of the check\n @tac_tree << tree.children[0].tac_str\n end\n #puts tree.tac_str \n @tac_tree << tree.tac_str \n end\n tree.children.each do |child|\n build_tac_tree(child)\n end\n #optimization #1 (tree.type != :variable) gets rid of additional load statements, tm would load on declaration statement \n if tree.type != :variable and tree.type != :function and not tree.type == :const_exp and \n not is_block_start?(tree.type) and tree.tac_str != nil and not relop?(tree.val) and tree.type != :input_s\n #puts tree.tac_str\n @tac_tree << tree.tac_str\n end\n tree = tree.sibling\n end\n end", "title": "" }, { "docid": "fa8aa669659a6f830ffa9acb8471fb98", "score": "0.5261762", "text": "def build_sample_tree()\n head = TreeNode.new()\n head.data = 5\n\n head.left_child = TreeNode.new()\n head.left_child.parent = head\n head.left_child.data = 6\n\n head.left_child.left_child = TreeNode.new()\n head.left_child.left_child.parent = head.left_child\n head.left_child.left_child.data = 8\n\n head.right_child = TreeNode.new()\n head.right_child.parent = head\n head.right_child.data = 7\n return head\nend", "title": "" }, { "docid": "836b3ddbc7d95a71ddbbaddc313debbb", "score": "0.5261245", "text": "def display_tree\n puts \" #{@root.value}\"\n puts \" / \\\\\"\n puts \" / \\\\\"\n puts \" #{@root.left_child.value} #{@root.right_child.value}\"\n puts \" / \\\\ / \\\\ \"\n puts \" #{@root.left_child.left_child.value} #{@root.left_child.right_child.value} #{@root.right_child.left_child.value} #{@root.right_child.right_child.value}\"\n puts \" / \\\\ \\\\\"\n puts \" #{@root.right_child.left_child.left_child.value} #{@root.right_child.left_child.right_child.value} #{@root.right_child.right_child.right_child.value}\"\n puts \" /\"\n puts \" #{@root.right_child.right_child.right_child.left_child.value}\"\n puts \" / \\\\\"\n puts \" #{@root.right_child.right_child.right_child.left_child.left_child.value} #{@root.right_child.right_child.right_child.left_child.left_child.value}\"\n \n end", "title": "" }, { "docid": "a78d6177241a7ed5a3a996f59dcd1fe3", "score": "0.525354", "text": "def build_rook_move_tree\n move_tree = MoveTree.new([0, 0])\n\n # Build in each of the four directions the rook can go.\n move_tree.root.add_child(build_directional_tree_nodes([1, 0]))\n move_tree.root.add_child(build_directional_tree_nodes([-1, 0]))\n move_tree.root.add_child(build_directional_tree_nodes([0, 1]))\n move_tree.root.add_child(build_directional_tree_nodes([0, -1]))\n\n move_tree\n end", "title": "" }, { "docid": "e8ae97d98172cb257db3234358b66bcb", "score": "0.52462894", "text": "def rotate(dir)\n new_root = child(~dir)\n node = new_child(~dir, new_root.child(dir), new_root.color)\n new_root.new_children(dir, node, new_root.child(~dir), @color)\n end", "title": "" }, { "docid": "6d38477c206f84d2102aa47bd976fbce", "score": "0.52400637", "text": "def initialize( treeData )\n \n# Initialize the node variables. By default, we are going\n# to treat this node as the root node (unless the incoming\n# tree data only has one top-level key, in which case that\n# will be the root node).\n \n@name = \"root\";\n@childNodes = [];\n \n# Check to see how many top-level keys the tree data has.\n# If it only has one, we can use it to define this tree\n# node; if it has more than one, will have to treat it as\n# the child data of the \"root\" node.\n \nif (treeData.size() == 1)\n \n# We only have one top-level key. We can use that to\n# define this tree node.\n \n@name = treeData.keys()[ 0 ];\n \n# Convert the sub-level tree data into the chile nodes\n# of this tree node.\n \ntreeData[ @name ].each{ |key, value| @childNodes.push(Tree.new( { key => value } )); };\n \nelse\n \n# We have more than one top-level key. We need to\n# create a root node to house multiple nodes.\n \ntreeData.each{ |key, value| @childNodes.push(Tree.new( { key => value } )); };\n \nend\n \nend", "title": "" }, { "docid": "016073635b2e9c398eace2ad86da98ee", "score": "0.52379733", "text": "def build_tree v\n root = Node.new v\n return root if root.leaf?\n left_v = v.first\n right_v = v.last\n root.left = build_tree left_v\n root.right = build_tree right_v\n\n root\nend", "title": "" }, { "docid": "02c9638121ec53b038a1b132e9bfd06d", "score": "0.52293974", "text": "def construct_kramdown_rt_tree(data)\n parent, children = data\n parent_clone = parent.clone\n children.each do |child|\n case child\n when Array\n parent_clone.add_child(construct_kramdown_rt_tree(child))\n when Kramdown::ElementRt\n parent_clone.add_child(child.clone)\n else\n raise(ArgumentError.new(\"invalid child: #{ child.inspect }\"))\n end\n end\n parent_clone\nend", "title": "" }, { "docid": "cc4bf721b5d78980acd1188d35290501", "score": "0.52259177", "text": "def construct_tree(arr)\n root = TreeNode.new(arr.shift)\n xtd = [root]\n while !xtd.empty? && !arr.empty?\n cur_node = xtd.shift\n a, b = arr.shift(2) # doesn't matter if arr.size < 2. in this case, a, b might be nil\n cur_node.left = a.nil? ? nil : TreeNode.new(a)\n cur_node.right = b.nil? ? nil : TreeNode.new(b)\n xtd << cur_node.left unless cur_node.left.nil?\n xtd << cur_node.right unless cur_node.right.nil?\n end\n root\nend", "title": "" }, { "docid": "c6254eb581d547234080eeda13bae88b", "score": "0.5225572", "text": "def rotateLR\n newRight = Node.new(@value, @left.right.right, @right)\n @value, @left.right, @right = @left.right.value, @left.right.left, newRight\n @left.set_height\n end", "title": "" }, { "docid": "6d397e7bf80da16b8fe6004e9799b72c", "score": "0.5224671", "text": "def build_move_tree ()\n queue = [@root_node]\n\n while !queue.empty?\n first = queue.shift\n # @considered_positions += trace_path_back(first)\n new_pos = new_move_positions(first.value)\n new_pos.each { |pos| first.add_child(PolyTreeNode.new(pos)) }\n # p \"parent is #{first.value}\"\n # p first.children.map {|ele| ele.value}\n # return first if (first.value == target_value) \n first.children.each { |child| queue << child}\n end\n\n end", "title": "" }, { "docid": "05756afa7c0a359f4aa20619abadbc5e", "score": "0.5217864", "text": "def restructure(node)\n parent = node.parent\n grand_parent = parent.parent\n if left_child?(node) && left_child?(parent)\n right_up_rotation parent\n parent.set_black!\n node.set_red!\n grand_parent.set_red!\n elsif right_child?(node) && left_child?(parent)\n left_up_rotation node\n right_up_rotation node\n node.set_black!\n parent.set_red!\n grand_parent.set_red!\n elsif right_child?(node) && right_child?(parent)\n left_up_rotation parent\n parent.set_black!\n node.set_red!\n grand_parent.set_red!\n else\n right_up_rotation node\n left_up_rotation node\n node.set_black!\n parent.set_red!\n grand_parent.set_red!\n end\n end", "title": "" }, { "docid": "91e01638974baa109cd22c37c901a68f", "score": "0.5217124", "text": "def dbgtree(tree)\n label=[\"TAILS\",\"HEADS\",\"PHI\",\"ZERO\",\"ONE\"][tree[0]]\n if !tree[1]\n return label\n end\n return \"[\"+label+\",\"+dbgtree(tree[1])+\",\"+dbgtree(tree[2])+\"]\"\nend", "title": "" }, { "docid": "f0270590f1468f029fd4c2fa5c27be0b", "score": "0.5208823", "text": "def reverse_tree_e36(root)\n \t\t\ttmp = root.left\n \t\troot.left = root.right\n \t\troot.right = tmp\n\n \t\tif root.left != nil \n\t\t\t\treturn reverse_tree_e36(root.left)\n\t\t\tend\n \t\tif root.right != nil \n\t\t\t\treturn reverse_tree_e36(root.right)\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "862d6f3a8a2c6ba7defeafe2c8cb362f", "score": "0.5208245", "text": "def tree(*args)\n function(:tree, *args)\n end", "title": "" }, { "docid": "99b887ff22fa8e4c1f5189f2ea7ce814", "score": "0.5205686", "text": "def traverse_v2(root, pos, arrs)\n\tleft, right = [root.left, root.right]\n\tunless left.nil? && right.nil?\n\t\tif pos == \"left\"\n\t\t\tarrs << left.data\n\t\t\tarrs << right.data\n\t\telse\n\t\t\tarrs << right.data\n\t\t\tarrs << left.data\n\t\tend\n\telse\n\t\tarrs << left.data unless left.nil?\n\t\tarrs << right.data unless right.nil?\n\tend\n\n\treturn [left, right, arrs]\nend", "title": "" }, { "docid": "b9d19949b17f0e83f17b9c0472a661a9", "score": "0.52047974", "text": "def roots; end", "title": "" }, { "docid": "724623c69456e55f0c3418b6d83ab6d7", "score": "0.52034837", "text": "def buildTree()\n root = BabelTest::Node.new\n root.i32 = 0\n root.b = false\n \n n1_L = BabelTest::Node.new\n n1_L.i32 = 1\n n1_L.b = true\n \n n1_R = BabelTest::Node.new\n n1_R.i32 = 2\n n1_R.b = false\n\n n2_L_L = BabelTest::Node.new\n n2_L_L.i32 = 3\n n2_L_L.b = true\n \n n2_L_R = BabelTest::Node.new\n n2_L_R.i32 = 4\n n2_L_R.b = false\n\n n2_R_L = BabelTest::Node.new\n n2_R_L.i32 = 5\n n2_R_L.b = true\n\n n2_R_R = BabelTest::Node.new\n n2_R_R.i32 = 6\n n2_R_R.b = false\n\n root.next_node = [n1_L, n1_R]\n n1_L.next_node = [n2_L_L, n2_L_R]\n n1_R.next_node = [n2_R_L, n2_R_R]\n \n bt = BabelTest::BinaryTree.new\n bt.root_node = [root]\n bt\n end", "title": "" }, { "docid": "5d21e21ed853e2be357b898b6e0986ca", "score": "0.52014333", "text": "def test_insert_case_3\n # Setup\n @tree.insert [2, 3.4], @value\n @tree.insert [1, 4.4], @value\n @tree.insert [1, 3.4], @value\n # Actual test\n root = @tree.send(:root)\n assert_nil root.parent\n assert_nil root.right\n left_child = root.left\n refute_nil left_child\n assert_equal left_child.parent, root\n assert_equal left_child.coordinates, [1, 4.4]\n assert_equal left_child.value, @value\n assert_nil left_child.right\n most_left_node = left_child.left\n refute_nil most_left_node\n assert_equal most_left_node.parent, left_child\n assert_nil most_left_node.left\n assert_nil most_left_node.right\n assert_equal most_left_node.coordinates, [1, 3.4]\n assert_equal most_left_node.value, @value\n end", "title": "" }, { "docid": "3e91bd5d7085a3703df82cf04cbde069", "score": "0.51978815", "text": "def transplant(t, u, v)\n return if (u.nil? || v.nil? || t.nil?)\n if u.p.nil?\n t.root = v\n elsif u == u.p.left\n u.p.left = v\n else\n u.p.right = v\n end\n v.p = u.p unless v.nil?\n end", "title": "" }, { "docid": "2d25017ec9586ab19016a6858e93d3fd", "score": "0.5196452", "text": "def transform_data(tree)\n data = {}\n last_level = 0\n path = []\n # root -> left -> right\n tree.traverse_preorder do |level, node|\n d = node.leaf? ? leaf_info(node) : directory_info(node)\n\n if level == 0\n data = d\n path << d\n elsif level > last_level\n path[-1][:children] << d\n path << d\n elsif level == last_level\n path[-2][:children] << d\n path[-1] = d\n else\n path[level - 1][:children] << d\n path[level] = d\n path = path[0..level]\n end\n last_level = level\n end\n data\n end", "title": "" }, { "docid": "8b6ec6a8a73a25a469b5f93ce1cbe5cd", "score": "0.51916665", "text": "def tree_traversal(t, str, h)\n if(t.left.left != nil) #if the tree left left value is not null\n tree_traversal(t.left, str + '0', h) #calling the method with left child, code stirng and code hash\n else\n # puts str\n h[t.left.key] = str + '0' # code hash of the the child child +0\n end # end statment for left Part\n if(t.right.right !=nil) #if the tree right left value is not null\n tree_traversal(t.right, str +'1', h)#calling the method with left child, code stirng and code hash\n else\n # puts str\n h[t.right.key] = str +'1' #code hash of the the right child +1\n end # end statment for right Part\n h\nend", "title": "" }, { "docid": "d723d4f0c8140ad88035cb283dd70cae", "score": "0.51896226", "text": "def test_insert_case_4\n # Setup\n @tree.insert [2, 3.4], @value\n @tree.insert [3, 4.4], @value\n @tree.insert [3, 5.4], @value\n # Actual test\n root = @tree.send(:root)\n assert_nil root.parent\n assert_nil root.left\n right_child = root.right\n refute_nil right_child\n assert_equal right_child.parent, root\n assert_equal right_child.coordinates, [3, 4.4]\n assert_equal right_child.value, @value\n assert_nil right_child.left\n most_right_node = right_child.right\n refute_nil most_right_node\n assert_equal most_right_node.parent, right_child\n assert_nil most_right_node.left\n assert_nil most_right_node.right\n assert_equal most_right_node.coordinates, [3, 5.4]\n assert_equal most_right_node.value, @value\n end", "title": "" }, { "docid": "5160a8f66984bdcb4eb83fe61533c591", "score": "0.51860136", "text": "def rotate_left!\r\n root = @parent\r\n root.right_child = @left_child\r\n root.right_child.parent = root unless @left_child.nil?\r\n @left_child = root\r\n self.parent = @left_child.parent\r\n unless self.parent.nil?\r\n if self.parent.right_child == @left_child\r\n self.parent.right_child = self \r\n else\r\n self.parent.left_child = self\r\n end\r\n end\r\n @left_child.parent = self\r\n update_heights!(left_child, self)\r\n end", "title": "" } ]
773a5d349863f7ce6476e64f20cf5372
Initializes a Triangle with three points and calculates area
[ { "docid": "512d2a178dfb48716fee37cb112337a1", "score": "0.70488703", "text": "def initialize(point1, point2, point3)\n\t\t@point1 = point1\n\t\t@point2 = point2\n\t\t@point3 = point3\n\t\t@area = 0\n\t\tfind_area\n\tend", "title": "" } ]
[ { "docid": "5b1de49cba5794253f0660cde4233dce", "score": "0.69291747", "text": "def area_of_triangle(base, height)\n 0.5*base*height\nend", "title": "" }, { "docid": "6c6144d2fc7aeff62275d8e0baa3aeab", "score": "0.689221", "text": "def initialize(triangle)\n a = 2 * (triangle.p2.x - triangle.p1.x)\n b = 2 * (triangle.p2.y - triangle.p1.y)\n c = 2 * (triangle.p2.x - triangle.p3.x)\n d = 2 * (triangle.p2.y - triangle.p3.y)\n e = triangle.p2.x*triangle.p2.x + triangle.p2.y*triangle.p2.y - triangle.p1.x*triangle.p1.x - triangle.p1.y*triangle.p1.y\n f = triangle.p2.x*triangle.p2.x + triangle.p2.y*triangle.p2.y - triangle.p3.x*triangle.p3.x - triangle.p3.y*triangle.p3.y\n\n det = a*d - b*c\n\n x = (d*e - b*f)/det\n y = (a*f - c*e)/det\n r = Math.sqrt((triangle.p1.x - x)**2 + (triangle.p1.y - y)**2)\n\n @middle = Point.new(x, y, draw: false)\n @radius = r\n end", "title": "" }, { "docid": "a2fc00422356f3bfac8779e3ff6ba15c", "score": "0.6884038", "text": "def area_of_triangle(base, height)\n (base * height) / 2\nend", "title": "" }, { "docid": "22d9422781d599a5b75a6c55d37b10f0", "score": "0.6723084", "text": "def area\n (@p1.x * @p2.y + @p2.x * @p3.y + @p3.x * @p1.y - @p1.y * @p2.x - @p2.y * @p3.x - @p3.y * @p1.x).abs / 2.0\n end", "title": "" }, { "docid": "92358cc5a296aa489ec501f02c83e8ac", "score": "0.6565727", "text": "def area_of_triangle(base, height)\n #sign for multiply is *, not x. changed b to base\n base * height / 2\nend", "title": "" }, { "docid": "df944d9451578ccafc0920bf7a78e100", "score": "0.6466859", "text": "def area\r\n return (( (@p1.x*(@p2.y - @p3.y)) + (@p2.x*(@p3.y - @p1.y)) + (@p3.x*(@p1.y - @p2.y)) )/2.0).abs\r\n end", "title": "" }, { "docid": "0d620c6d6a0f26d3e6e7487c75f6c82f", "score": "0.64664865", "text": "def add_triangle(points: nil)\n fail \"Needs an array of 3 points\" if points.nil?\n fail \"Needs an array of 3 points\" unless points.length.eql? 3\n \n self.add_moveto(points[0])\n self.add_lineto(points[1])\n self.add_lineto(points[2])\n self.add_lineto(points[0])\n self.add_closesubpath()\n end", "title": "" }, { "docid": "68bb1b4583d3761c895c77f4d3954a3d", "score": "0.64656395", "text": "def getTriangleArea(x, y)\n # Write your code here\n base=x.max-x.min\n height=y.max-y.min\n\n (base*height)/2\nend", "title": "" }, { "docid": "6ca7aacc372b603a4a333c9b4e906413", "score": "0.6451088", "text": "def computeArea(h, w) # define a function with 2 parameters\n HALF * h * w # calculate area of triangle\nend", "title": "" }, { "docid": "e3af3e2be7215afbf6eaf232d3b60a6b", "score": "0.6420088", "text": "def signedAreaOfTriangle(p1, p2, p3)\n # Update the area by adding\n a = p3.zip(p1).map { |x, y| x - y }\n b = p3.zip(p2).map { |x, y| x - y }\n\n cx = a[1]*b[2] - a[2]*b[1]\n cy = a[2]*b[0] - a[0]*b[2]\n cz = a[0]*b[1] - a[1]*b[0]\n\n c = [cx, cy, cz]\n\n return Math.sqrt(c[0]*c[0] + c[1]*c[1] + c[2]*c[2]).abs/2\n end", "title": "" }, { "docid": "fb04682855316e093b6d2345a095350b", "score": "0.6335352", "text": "def calculate_area\n puts \"Area depends of figure, but we can calculate through triangles\"\n end", "title": "" }, { "docid": "0d28d2dac7b2848c029d1863e985fbe2", "score": "0.62919945", "text": "def area_of_triangle(base, height)\n# change x to *\n # puts b x height / 2\n puts base * height / 2\nend", "title": "" }, { "docid": "5eff8a2c7ec51070d8ac82b493b50596", "score": "0.6278531", "text": "def area\n return @area if defined?(@area)\n\n sum = 0.0\n (0...vertices.length).each do |i|\n prev = vertices[i - 1]\n curr = vertices[i]\n\n sum += ((prev.x * curr.y) - (prev.y * curr.x))\n end\n\n @area = sum / 2\n @area\n end", "title": "" }, { "docid": "74a4586a150cd9ae7a636050fd5968eb", "score": "0.61305696", "text": "def area\n x, y, z = sides.sort\n (\n 0.25 * Math.sqrt((x + (y + c)) * (z - (x - y)) * (z + (x - y)) * (x + (y - z)))\n ).to_f.round(precision)\n end", "title": "" }, { "docid": "ad4572a0e45a28fbde4c1c91e3f1d77e", "score": "0.60206616", "text": "def find_area\n\t\t@area = 0.5 * ((@point1.x - @point3.x)*(@point2.y - @point1.y) - (@point1.x - @point2.x)*(@point3.y - @point1.y)).abs\n\tend", "title": "" }, { "docid": "8b4a7f59aa4eccb93e75ca9b77b18d48", "score": "0.5982127", "text": "def triangle(a, b, c)\n triangle = Triangle.new(a,b,c)\n triangle.type\nend", "title": "" }, { "docid": "f2975062c6cdfd2f2b7c23ec2f218f09", "score": "0.59739584", "text": "def polygon_area(vertices)\n raise \"A polygon must have 3 or more vertices, not #{vertices.length}\" unless vertices.length >= 3\n\n area = 0\n\n # Rely on Ruby's circular array indexing for negative indices\n vertices.size.times do |idx|\n x2, y2 = vertices[idx]\n x1, y1 = vertices[idx - 1]\n area += x1 * y2 - x2 * y1\n end\n\n return area * 0.5\n end", "title": "" }, { "docid": "35340da7305f1e32c2c85490655d6c5c", "score": "0.5931771", "text": "def triangle_point(sPoint, a, b, c)\r\n pts = []\r\n pts[0] = sPoint\r\n pts[1] = Geom::Point3d.new(sPoint[0] + a, sPoint[1], sPoint[2])\r\n a = a.to_f\r\n b = b.to_f\r\n c = c.to_f\r\n dx = (b*b - c*c + a*a) / (2*a)\r\n dy = Math.sqrt(b*b - dx*dx)\r\n pts[2] = Geom::Point3d.new(sPoint[0] + dx, sPoint[1] + dy, sPoint[2])\r\n return pts\r\nend", "title": "" }, { "docid": "f15a852c1507a78802416e42cb3fa254", "score": "0.59127", "text": "def initialize(p1, p2, p3)\n @point1 = p1\n @point2 = p2\n @point3 = p3\n\n # adjust all the points so that they are relative to p1\n @rel_point1 = Vector[0, 0, 0]\n @rel_point2 = @point2 - @point1\n @rel_point3 = @point3 - @point1\n end", "title": "" }, { "docid": "c94603f26ccb334d235054e0c674c2c3", "score": "0.5893276", "text": "def triangle\n self * ( self + 1 ) / 2\n end", "title": "" }, { "docid": "19b14d341f79d9a5b878d2afcbaecf06", "score": "0.5860419", "text": "def setArea\n return unless border_points_changed?\n self.area = 0\n return unless border_points_minus_removed.length >= 3\n centerLat = centerLatitude\n centerLong = centerLongitude\n last = border_points.last\n x1 = (last.longitude > centerLong ? 1 : -1) * (last.dist last.latitude, centerLong)\ny1 = (last.latitude > centerLat ? 1 : -1) * (last.dist centerLat, last.longitude)\n sum = 0\n border_points_minus_removed.each_with_index do |point, index|\n x2 = (point.longitude > centerLong ? 1 : -1) * (point.dist point.latitude, centerLong)\ny2 = (point.latitude > centerLat ? 1 : -1) * (point.dist centerLat, point.longitude)\n sum += x1*y2 - x2*y1\n x1 = x2\n y1 = y2\n end\n self.area = (sum/2).abs\n end", "title": "" }, { "docid": "e9de5d2c639c9d37ed74304bfcba7371", "score": "0.5836774", "text": "def triangle(a, b, c)\n #sort arguments by length\n triangle_array = [a, b, c].sort\n\n #initialize variables to sorted sides\n x = triangle_array[0]\n y = triangle_array[1]\n z = triangle_array[2]\n \n # rule out invalid triangles\n if x + y <= z || (x*y*z) == 0\n return :invalid\n end\n\n if x == y && x == z\n :equilateral\n elsif x == y || x == z || y == z\n :isosceles\n else\n :scalene\n end\nend", "title": "" }, { "docid": "2ebd72aee34d14e611514b742191a770", "score": "0.5825454", "text": "def triangle(a, b, c)\n if a==0||b==0||c==0\n\traise TriangleError, \"one of the sides equals zero\"\n end\n if (a+b<=c)||(a+c<=b)||(b+c<=a)\n\traise TriangleError, \"2 any sides must be greater then 1\"\n end\n if a<0||b<0||c<0\n\traise TriangleError, \"negative sides\"\n end\n if (a==b) && (a==c) && (b==c)\n :equilateral\n\telsif (a==b)||(a==c)||(b==c)\n :isosceles\n\telse \n :scalene\nend\n\nend", "title": "" }, { "docid": "ee544d851ac94b53a27d74f335507d85", "score": "0.57977176", "text": "def initialize(polygon)\n a = 2 * (polygon.p2.x - polygon.p1.x)\n b = 2 * (polygon.p2.y - polygon.p1.y)\n c = 2 * (polygon.p2.x - polygon.p3.x)\n d = 2 * (polygon.p2.y - polygon.p3.y)\n e = polygon.p2.x*polygon.p2.x + polygon.p2.y*polygon.p2.y - polygon.p1.x*polygon.p1.x - polygon.p1.y*polygon.p1.y\n f = polygon.p2.x*polygon.p2.x + polygon.p2.y*polygon.p2.y - polygon.p3.x*polygon.p3.x - polygon.p3.y*polygon.p3.y\n \n det = a*d - b*c\n\n x = (d*e - b*f)/det\n y = (a*f - c*e)/det\n r = Math.sqrt((polygon.p1.x - x)**2 + (polygon.p1.y - y)**2)\n \n @middle = Point.new(x, y)\n @radius = r\n end", "title": "" }, { "docid": "e1592aca750ffe522f9cd3615112aeab", "score": "0.5780917", "text": "def triangle(a_side, b_side, c_side)\n # WRITE THIS CODE\n sum = a_side + b_side + c_side\n minimum = [a_side, b_side, c_side].min\n maximum = [a_side, b_side, c_side].max\n raise TriangleError unless minimum.positive? && (maximum < sum - maximum)\n\n return :equilateral if equilateral?(a_side, b_side, c_side)\n\n return :isosceles if isosceles?(a_side, b_side, c_side)\n\n :scalene\nend", "title": "" }, { "docid": "4722f7db51b2cb6ca5a5233cd4ab3fd2", "score": "0.57342577", "text": "def initialize(side_one_length, side_two_length, side_three_length)\n @side_one_length = side_one_length\n @side_two_length = side_two_length\n @side_three_length = side_three_length\n #I find working with an array of the three sides easier than working with the instance variables\n triangle_sides = []\n triangle_sides << @side_one_length\n triangle_sides << @side_two_length\n triangle_sides << @side_three_length\n #No sides of a triangle may be equal to zero\n if triangle_sides.any?{|side| side <= 0}\n raise TriangleError\n #The sum of the lengths of any two sides of a triangle always\n #exceeds the length of the third side. I have to check\n #to see if this is true, and if not I need to raise a \n #TriangleError\n elsif (triangle_sides[0] + triangle_sides[1] <= triangle_sides[2]) || (triangle_sides[1] + triangle_sides[2] <= triangle_sides[0]) || (triangle_sides[0] + triangle_sides[2] <= triangle_sides[1])\n raise TriangleError\n # An equilateral triangle has all sides equal\n elsif triangle_sides.all?{|side| side == triangle_sides[0]}\n @kind = :equilateral \n #An isosceles triangle has 2 sides that are equal, so here I'm checking to see that any two sides are equal.\n elsif triangle_sides[1] == triangle_sides[2] || triangle_sides[0] == triangle_sides[2] || triangle_sides[0] == triangle_sides[1]\n @kind = :isosceles\n #scalene triangles have no equal sides. Similar to what I just did but instead they cannot be equal\n elsif (triangle_sides[0] != triangle_sides[1] || triangle_sides[2]) && (triangle_sides[1] != triangle_sides[2])\n @kind = :scalene\n end\n end", "title": "" }, { "docid": "578bdf16bff421380d412250e771d8e5", "score": "0.5721059", "text": "def problem_102\n triangles = []\n open(\"triangles.txt\").each_line do |l|\n triangles << l.chomp.split(/,/).map(&:to_i)\n end\n puts triangles.length\n\n count = 0\n o = Point::Origin\n triangles.each do |p|\n p1 = Point.new(p[0],p[1])\n p2 = Point.new(p[2],p[3])\n p3 = Point.new(p[4],p[5])\n\n if p2.between(p1,o,p3) &&\n p1.between(p2,o,p3) &&\n p3.between(p1,o,p2)\n count += 1\n end\n end\n count\nend", "title": "" }, { "docid": "d070a36196b45a761ddd21bbb2db047b", "score": "0.5676983", "text": "def triangle(num1, num2, num3)\n if (num1 + num2 + num3) != 180\n return :invalid \n elsif num1 == 0 || num2 == 0 || num3 == 0 \n return :invalid\n elsif num1 > 90 || num2 > 90 || num3 > 90\n return :obtuse \n elsif num1 == 90 || num2 == 90 || num3 == 90\n return :right \n else \n :acute\n end\nend", "title": "" }, { "docid": "836e43df7d5907c701af5002d23dbba9", "score": "0.56762403", "text": "def initialize(x,y)\n@x,@y = x, y\n# Initialize method\n# Sets initial values for instance variables\n# Use the class variables in this instance method to collect data\n@@n += 1\n# Keep track of how many Points have been created\n@@totalX += x\n# Add these coordinates to the totals\n@@totalY += y\nend", "title": "" }, { "docid": "50198c6bea47063fe3d247928b9963a8", "score": "0.5637753", "text": "def pascals_triangle(num)\r\n triangle = [[1]]\r\n\r\n\r\n\r\nend", "title": "" }, { "docid": "c9d831403bf9dcc9677e6f87cfe18879", "score": "0.5602485", "text": "def initialize\n # create 4 faces of an octahedron that\n # lie on the near side of the x-y plane.\n\n north = Vector.new 0.0, 1.0, 0.0\n east = Vector.new 1.0, 0.0, 0.0\n south = Vector.new 0.0, -1.0, 0.0\n west = Vector.new -1.0, 0.0, 0.0\n near = Vector.new 0.0, 0.0, 1.0\n\n northeast = Triangle.new north, east, near\n southeast = Triangle.new east, south, near\n southwest = Triangle.new near, south, west\n northwest = Triangle.new north, near, west\n\n @faces = [northeast, southeast, southwest, northwest] \n end", "title": "" }, { "docid": "e1a93b9ef710523cc987aefd7a07db24", "score": "0.55950665", "text": "def draw_triangle(x1:, y1:, x2:, y2:, x3:, y3:, stroke_width: 1, color: nil, colour: nil)\n draw_polyline closed: true,\n coordinates: [x1, y1, x2, y2, x3, y3],\n color: color, colour: colour, stroke_width: stroke_width\n end", "title": "" }, { "docid": "4d57796f1c00bbec99e93b8eb07246cd", "score": "0.5577525", "text": "def create_triangle(box_y_start, value_x, up_triangle, box_mult, colorstr)\n x_points = Array.new\n x_points << value_x - @box_size*box_mult * Math.sqrt(2)*0.2\n x_points << value_x + @box_size*box_mult * Math.sqrt(2)*0.2\n # third point is midway between other 2\n x_points << (x_points[0]+x_points[1])/2\n\n y_points = Array.new\n\t y_points << box_y_start\n\t y_points << box_y_start\n\t if up_triangle\n y_points << box_y_start - @box_size*box_mult * Math.sqrt(2) *0.35\n else\n y_points << box_y_start + @box_size*box_mult * Math.sqrt(2) *0.35\n\t end\n\n\t return Triangle.new(x_points, y_points, colorstr)\n end", "title": "" }, { "docid": "3fdcc71fe796c31e2dda1137c824cad1", "score": "0.557357", "text": "def calculate_area\n\n \tarea = 3.14*@radius*@radius\n\n end", "title": "" }, { "docid": "f605c36a09c3e59dc2e588ee459a2289", "score": "0.5531307", "text": "def get_area()\n OpenStudio::getArea(self.get_3d_polygon())\n end", "title": "" }, { "docid": "65656f30fe6e6ac0e86e06b4320631ca", "score": "0.55097353", "text": "def initialize(x,y) # Initialize method\n @x,@y = x,y # Sets initial values for instance variables\n \n # Use the class variables in this instance method to collect data\n @@n += 1 # Keep track of how many Points have been created\n @@totalX += @x # Add these coordinates to the totals \n end", "title": "" }, { "docid": "ce4fdd3b731aa0b9905a7d6b61d9ae65", "score": "0.549483", "text": "def triangle(angle1, angle2, angle3)\n sides = [angle1, angle2, angle3]\n return :invalid if invalid_triangle? [angle1, angle2, angle3]\n return :acute if acute? sides\n return :obtuse if obtuse? sides\n return :right if right? sides\nend", "title": "" }, { "docid": "7f975edb98aa77ace93b124fff979d16", "score": "0.54805666", "text": "def triangle(a, b, c)\n sides = [a, b, c]\n\n # https://stackoverflow.com/a/11361502\n raise TriangleError if sides.min <= 0\n\n # my original answer\n #sides.each do |item|\n # if item <= 0\n # raise TriangleError\n # end\n #end\n\n # https://stackoverflow.com/a/11361502\n x, y, z = sides.sort\n raise TriangleError if x + y <= z\n\n # my original answer\n #if a + b <= c or b + c <= a or c + a <= b\n # raise TriangleError\n #end\n\n # https://stackoverflow.com/questions/4742692/a-more-elegant-solution-to-ruby-koans-triangle-rb\n case sides.uniq.size\n when 1 then :equilateral\n when 2 then :isosceles\n else :scalene\n end\n\n # my original answer\n #if a == b and b == c\n # :equilateral\n #elsif a == b or b == c or c == a\n # :isosceles\n #else\n # :scalene\n #end\nend", "title": "" }, { "docid": "65b7b29235946304b1c8041f50b7a5d0", "score": "0.5473122", "text": "def check_area(point1, point2, point3)\n area = (point1.x * (point2.y - point3.y) +\n point2.x * (point3.y - point1.y) +\n point3.x * (point1.y - point2.y))/2\n if (area < 0)\n area = -area\n end\n return area\nend", "title": "" }, { "docid": "5d2f193df7baecef7a4944e4c50b5e25", "score": "0.5469491", "text": "def triangle(a, b, c)\n sides = [a,b,c]\n validate_sides(sides)\n\n unique_side_lengths = sides.uniq.length\n\n case unique_side_lengths\n when 1\n :equilateral\n when 2\n :isosceles\n when 3\n :scalene\n end\nend", "title": "" }, { "docid": "827d92fb56cba73e8f4d75ea7187dab7", "score": "0.54600483", "text": "def triangle(atomids)\n if atomids.size != 3\n raise SizeError\n end\n atoms = []\n atomids.each do |atomid|\n atom = atom_by_id(atomid)\n raise AtomNotFoundError, atomid unless atom\n atoms << atom\n end\n #pp atoms\n tri = CrystalCell::Povray::Triangle.new(\n *atoms.map { |atom| atom.position.to_v3d(self.axes)},\n CrystalCell::Povray::Element.color( atoms[0].element)\n )\n tri.to_pov\n end", "title": "" }, { "docid": "253e9990e9b686c06c388e28c2e552bf", "score": "0.5440203", "text": "def main\n a = Triangle.new( 2, 3, 4 )\n b = Triangle.new( 4, 5, 6 )\n a.volume\n b.volume\n Triangle.total_volume\nend", "title": "" }, { "docid": "94ff262ce843b79934354f3737962ab6", "score": "0.5437595", "text": "def initialize(x,y) # Initialize method\n @x,@y = x, y # Sets initial values for instance variables\n\n # Use the class variables in this instance method to collect data\n @@n += 1 # Keep track of how many Points have been created\n @@totalX += x # Add these coordinates to the totals\n @@totalY += y\n end", "title": "" }, { "docid": "1bb0b98b114b65f49090e9713b402011", "score": "0.54360723", "text": "def triangle(side1, side2, side3)\n sides = [side1, side2, side3]\n return :invalid if sides.max > sides.sum / 2 || sides.min.zero?\n case sides.uniq.size\n when 1 then :equilateral\n when 2 then :isosceles\n else :scalene\n end\nend", "title": "" }, { "docid": "db50fd8540a5b9d762e670c04d5cdc33", "score": "0.5392565", "text": "def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n return :invalid if angles.sum != 180 || angles.min.zero?\n case angles.max\n when 90 then :right\n when 0...90 then :acute\n else :obtuse\n end\nend", "title": "" }, { "docid": "8703fe84320a199ee59a7ed350842c8b", "score": "0.53850406", "text": "def triangle(a, b, c)\n angles = [a, b, c]\n\n # angles.sum = angles.reduce(:+) \n return :invalid if angles.sum != 180 || angles.any?(0)\n return :right if angles.any?(90)\n return :acute if angles.all? { |angle| angle < 90 }\n :obtuse\nend", "title": "" }, { "docid": "c92e3b387f1964eb007a226e7be59bdb", "score": "0.5376668", "text": "def initialize(x,y)\n @x,@y = x, y # Sets initial values for instance variables\n \n # Use the class variables in this instance method to collect data\n @@n += 1 # Keep track of how many Points have been created\n @@totalX += x # Add these coordinates to the totals\n @@totalY += y\n end", "title": "" }, { "docid": "ce7809e5e167db57469708bb19466b36", "score": "0.53763306", "text": "def triangle(a1, a2, a3)\n angles = [a1, a2, a3]\n\n return :invalid if angles.sum != 180 || angles.include?(0)\n return :right if angles.include?(90)\n return :acute if angles.max < 90\n return :obtuse if angles.max > 90\nend", "title": "" }, { "docid": "86b8f0707bc619fdfc551d0a079a4d6f", "score": "0.5357743", "text": "def area\n\t\t@side_length * @side_length\n\tend", "title": "" }, { "docid": "15eeac6dd8f6e221b3302c3553137d5a", "score": "0.53514385", "text": "def triangle(a, b, c)\n angles = [a, b, c]\n sum = angles.reduce(:+)\n case\n when sum != 180 || angles.any? { |ang| ang <= 0 }\n :invalid\n when angles.any? { |ang| ang == 90 }\n :right\n when angles.any? { |ang| ang > 90 }\n :obtuse\n when angles.all? { |ang| ang < 90 }\n :acute\n end\nend", "title": "" }, { "docid": "9693da76150fcb22fe0fb7b3d1e0e853", "score": "0.53504986", "text": "def triangle(a, b, c)\n angles = [a, b, c]\n\n case\n when angles.sum != 180 || angles.min <= 0\n :invalid\n when angles.max == 90\n :right\n when angles.max > 90\n :obtuse\n else\n :acute\n end\nend", "title": "" }, { "docid": "9caaf672ee39f3351c31e30372af4842", "score": "0.534498", "text": "def lowestTriangle(base, area)\n # Complete this function\nend", "title": "" }, { "docid": "39b395881e6c97d59396d3ac51b329f4", "score": "0.5340441", "text": "def total_area\n\t\tarea = 0\n\t\tshapes.each do |shape|\n\t\t\tarea = area + shape.area\n\t\tend\n\t\treturn area\n\tend", "title": "" }, { "docid": "dfb67f081818fc72047ca8dc0de9a43e", "score": "0.53274506", "text": "def triangle(x,y,z)\n sides = [x, y, z].sort \n return :invalid unless sides.all?{ |e| e.is_a?(Numeric) && e > 0 }\n return :invalid if sides[0] + sides[1] <= sides[2]\n # Now, since the sides are sorted, we can do the following:\n if sides[0] == sides[2]\n :equilateral\n elsif sides[0] == sides[1] || sides[1] == sides[2]\n :isosceles\n else\n :scalene\n end\nend", "title": "" }, { "docid": "83ce9ff1ee2bd32ec2943dea3c36c9a5", "score": "0.5322442", "text": "def validate_triangle()\n if @data.class != Array || @data.empty?\n raise ERR_INVALID_ARRAY_INPUT\n end\n\n @data.reduce(0) do |t, curr|\n t + curr.reduce(0) { |total, n| total + n }\n end rescue raise msg_invalid_array\n\n total_items = @data.reduce(0) { |total, n| total + n.length }\n\n if total_items != sum_up_to_one(@data.length)\n raise ERR_INVALID_TRIANGLE\n end\n end", "title": "" }, { "docid": "3bd189c9e583cb5139620c97b687c84f", "score": "0.5293031", "text": "def area\n\t\tMath::PI * (self.radius ^ 2)\n\tend", "title": "" }, { "docid": "64cdad00ccf420736141f94271f34bb2", "score": "0.5288436", "text": "def triangle(a, b, c)\n sides = a, b, c\n case\n when sides.any? { |side| side.zero? }\n :invalid\n when sides.any? { |side| sides.reduce(:+) - side < side }\n :invalid\n when sides.all? { |side| side == sides.first }\n :equilateral\n when sides == sides.uniq\n :scalene\n else\n :isosceles\n end\nend", "title": "" }, { "docid": "899ef496a03866c9ed3719cff21e96cd", "score": "0.5279397", "text": "def area\n return @side_length * @side_length\n end", "title": "" }, { "docid": "9726845477ed76bd6aad39ae21ea7bd4", "score": "0.5275734", "text": "def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n \n case \n when angles.reduce(:+) != 180 || angles.include?(0)\n :invalid\n when angles.count(90) == 1\n :right\n when angles.count {|an| an < 90} == 3\n :acute\n when angle1 > 90 || angle2 > 90 || angle3 > 90 \n :obtuse\n end\nend", "title": "" }, { "docid": "e31040b4405e05e847231dca60b08e61", "score": "0.5275054", "text": "def initialize(state, county, polygon_points)\n @state = state\n @county = county\n @polygon_points = []\n polygon_points.each do |p|\n @polygon_points.push(Point.new(p[0],p[1]))\n end\n end", "title": "" }, { "docid": "b0bf934f26fbe4d26f5e0f8683fe3a5e", "score": "0.5265592", "text": "def get_area(type_area, array_point)\n if type_area == 'circle'\n area = { circle: { centerLatitude: array_point[0], centerLongitude: array_point[1], radius: array_point[2] } }\n else\n points = []\n array_point.each do |c|\n c = c.split(',')\n points << { latitude: c[0], longitude: c[1] }\n end\n area = { polygon: { vertices: points } }\n end\n area\n end", "title": "" }, { "docid": "5ef547e963171f1e0f2c25e990beb62a", "score": "0.52642345", "text": "def triangle(a, b, c)\n #\n # My first solution\n #\n # # Test that the triangle is valid\n # # No side can be <= 0\n # raise TriangleError if a <= 0 || b <= 0 || c <= 0\n # # Sum of any two sides must be > third side\n # raise TriangleError if a >= b+c || b >= a+c || c >= a+b\n\n # return :equilateral if a == b && b == c\n # return :isosceles if a == b || b == c || a == c\n # return :scalene\n #\n\n #\n # The Stack Overflow assisted version\n #\n\n # Sort the triangle sides in ascending order such that a is the smallest\n a, b, c = sides = [a, b, c].sort\n\n # If a <= 0\n raise TriangleError if a <= 0 || a + b <= c\n # Slightly easier to read version:\n # raise TriangleError unless a > 0 || a + b > c\n\n # Find out how many unique lengths there are. If 1, return :equilateral; if\n # 2, return :isoceles; if 3, return :scalene. Note the clever usage of the\n # negative indexing into the array to directly map the number of unique sides\n # to the type of triangle without needing to pad the array\n [:scalene, :isosceles, :equilateral][-sides.uniq.size]\nend", "title": "" }, { "docid": "efa729adc8dd87415e58d6e041d11427", "score": "0.5263784", "text": "def shapeArea(n)\n return (n*n) + ((n-1)*(n-1))\nend", "title": "" }, { "docid": "42a2e04d925d207b6943c40b80de5fe2", "score": "0.5256854", "text": "def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n\n case\n when angles.reduce(:+) != 180, angles.include?(0)\n :invalid\n when angles.include?(90)\n :right\n when angles.all? { |angle| angle < 90 }\n :acute\n else\n :obtuse\n end\nend", "title": "" }, { "docid": "e39921f36349ffc0d7f82489bb89d9cf", "score": "0.5250376", "text": "def calculate_area_of_trapezoid(h,b1,b2)\n puts \"Calculating the area of a trapezoid with height #{h}, top #{b1}, bottom #{b2}\"\n multiply(divide(h, 2), add(b1, b2))\nend", "title": "" }, { "docid": "0e041a6475afbf5d6a65bca1374bfae2", "score": "0.52492714", "text": "def triangle(num1, num2, num3)\n sides = [num1, num2, num3]\n\n sides.sort!\n\n return :invalid if sides[0..1].sum <= sides.last\n\n\n if sides.uniq.size == 1\n :equilateral\n elsif sides.uniq.size == 2\n :isosceles\n elsif sides.uniq.size == 3\n :scalene\n end\nend", "title": "" }, { "docid": "e454c020254011b084d5da65246fb87a", "score": "0.5244007", "text": "def triangle(s1, s2, s3)\n sides = [s1, s2, s3]\n return :invalid if sides.any?(0) || sides.max > sides.reduce(:+) - sides.max\n type_of_triangle(sides)\nend", "title": "" }, { "docid": "e98acc97fdc234164b4e6888a3ffcd0a", "score": "0.52359855", "text": "def triangle(first, second, third)\n angles = [first, second, third]\n return :invalid unless angles.sum == 180 && angles.none?(0)\n\n case\n when angles.any?(90) then :right\n when angles.all? { |angle| angle < 90 } then :acute\n when angles.one? { |angle| angle > 90 } then :obtuse\n else :invalid\n end\nend", "title": "" }, { "docid": "7e5bfbcf6dab452c243bf7f2bb235fc8", "score": "0.52345616", "text": "def area_of_right_angled_triangle(base,height)\n\treturn ((base.to_f * height.to_f)/2)\t\nend", "title": "" }, { "docid": "02377aaa4293c0cd02a9b1271f72f0e3", "score": "0.52302045", "text": "def triangles()\n @triangles = []\n loop_start_time = Time.now\n while @triangles.size != @count\n begin\n t = Triangle.new(*random_coordinate_triplet)\n if t.possible? && within_threshold(t) && within_threshold2(t)\n @triangles << t\n else\n if (Time.now - loop_start_time) > 10\n raise 'too much calculation'\n end\n end\n rescue Math::DomainError\n puts \"Out of domain... trying again.\"\n end\n end\n @triangles\n end", "title": "" }, { "docid": "1dbea4d2be7fa00eef4bc8c53b793be9", "score": "0.52200484", "text": "def triangle(a, b, c)\n\t\n\tcheckValidity(a,b,c)\n\t\n\tif (equilateral?(a,b,c))\n\t\treturn :equilateral\n\tend\n\tif (isosceles?(a,b,c))\n\t\treturn :isosceles\n\tend\n\t:scalene\nend", "title": "" }, { "docid": "6bfdfd18b22f1d20958a55084aa83052", "score": "0.5203197", "text": "def area(length, width)\n length * width\nend", "title": "" }, { "docid": "b68abd4c4d198544eefd59d137c01185", "score": "0.5200973", "text": "def test\n # triangle inequality theorem\n if ( ((@a+@b)>@c) && ((@a+@c)>@b) && ((@b+@c)>@a) )\n if (@a==@b && @b==@c)\n @type = \"equilateral\"\n @base = @a\n @height = sqrt((@c**2) - (@a/2.0)**2) # pythagoras\n elsif ((@a*@a + @b*@b) == @c*@c)\n @type = \"right\"\n @base = @a\n @height = @b\n elsif (@a == @b) # smaller sides are equal\n @type = \"isosceles\"\n @base = @c # base is larger side\n @height = sqrt(@b**2 - (@c/2.0)**2)\n elsif (@b == @c) # larger sides are equal\n @type = \"isosceles\"\n @base = @a # base is smaller side\n @height = sqrt(@c**2 - @a**2)\n else\n @type = \"scalene\"\n @base = @c\n \n # simplified algebra used to find height of scalene\n x = (@a**2 + @c**2 - @b**2) / (2.0*@c)\n @height = sqrt(@a**2 - x**2)\n \n end\n @valid = true\n else\n @type = \"not a triangle\"\n @valid = false\n end\n end", "title": "" }, { "docid": "811593b2ef755cecace11989e3d10496", "score": "0.5199499", "text": "def calc_area (base1,base2,height)\r\n\tarea = height * (base1 + base2) / 2.0\r\n\treturn area\r\nend", "title": "" }, { "docid": "a97f33a4ecc4f58569443a5f567fc29d", "score": "0.5199073", "text": "def centroid\n return @centroid if defined?(@centroid)\n\n cx, cy = 0, 0\n\n (0...vertices.length).each do |i|\n prev = vertices[i - 1]\n curr = vertices[i]\n\n v = prev.x * curr.y - curr.x * prev.y\n cx += v * (prev.x + curr.x)\n cy += v * (prev.y + curr.y)\n end\n\n @centroid = Point.new(Rational(cx, 6 * self.area), Rational(cy, 6 * self.area))\n @centroid\n end", "title": "" }, { "docid": "54a91fd5bd79039f36a47d9997626c3e", "score": "0.51985174", "text": "def triangle_index()\n (Math.sqrt(1 + (8 * self)) - 1) / 2\n end", "title": "" }, { "docid": "cc8110c64766c892d74646a29bb689b7", "score": "0.51962703", "text": "def triangle(a, b, c)\n angles = [a, b, c]\n case\n when angles.any? { |x| x <= 0 } || angles.sum != 180 then :invalid\n when angles.any? { |x| x == 90 } then :right\n when angles.all? { |x| x < 90 } then :acute\n when angles.any? { |x| x > 90 } then :obtuse\n end\nend", "title": "" }, { "docid": "2ee0d5abde9bc1a12fe629e8a1303802", "score": "0.5192807", "text": "def triangle_sum(n)\n (n * (n + 1))/2\nend", "title": "" }, { "docid": "e85d62cbe873736afd0d216929261fa2", "score": "0.51823926", "text": "def triangle(n)\n (n *(n + 1)) / 2\nend", "title": "" }, { "docid": "e9d0a13bb881b66b6779ae8ccceafc2d", "score": "0.51813805", "text": "def triangle(side_1, side_2, side_3)\n ordered_array = [side_1, side_2, side_3].sort\n if !ordered_array.all? { |side| side > 0 }\n return :invalid\n end\n if (ordered_array[0] + ordered_array[1]) <= ordered_array[2]\n return :invalid\n end\n if (side_1 == side_2) && (side_2 == side_3)\n :equilateral\n elsif (side_1 == side_2) || (side_1 == side_3) || (side_2 == side_3)\n :isosceles\n else\n :scalene\n end\nend", "title": "" }, { "docid": "603b7860d4e82421983aa2e9de4efbd4", "score": "0.5177772", "text": "def triangle(angle_1, angle_2, angle_3)\n angles = [angle_1, angle_2, angle_3]\n\n case \n when angles.sum != 180 || angles.include?(0)\n :invalid\n when angles.any?(90)\n :right\n when angles.all? { |angle| angle < 90 }\n :acute\n else\n :obtuse\n end\nend", "title": "" }, { "docid": "e6f8d4b9a2fb8b74fd98dd49a8e879ec", "score": "0.5176989", "text": "def triangle(a, b, c)\n sides = [a, b, c]\n \n return :invalid if sides.include?(0) || sides.max >= sides.min(2).sum\n return :equilateral if sides.max == sides.min\n return :isosceles if sides.tally.value?(2)\n :scalene\nend", "title": "" }, { "docid": "76d62f5ba874e3d7cba70b22a3597a54", "score": "0.5172779", "text": "def triangle(ang1, ang2, ang3)\n ary = [ang1, ang2, ang3].sort\n return :invalid if ary.sum != 180 || ary.include?(0)\n if ary[-1] < 90\n :acute\n elsif ary[-1] == 90\n :right\n else\n :obtuse\n end\nend", "title": "" }, { "docid": "41a2384a602a8230ce228e30bfd46cdc", "score": "0.51696295", "text": "def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n return :invalid unless is_triangle?(angles)\n\n case\n when angles.any? { |a| a == 90 }\n :right\n when angles.all? { |a| a < 90 }\n :acute\n else\n :obtuse\n end\nend", "title": "" }, { "docid": "be104f6b27935c899b9dd5b78d3c6690", "score": "0.51684713", "text": "def initialize(a,x,y)\n @a = Float(a)\n @x1 = Float(x)-(@a/2)\n @y1 = Float(y)-(@a/2)\n @x2 = x1+@a\n @y2 = y1+@a\n end", "title": "" }, { "docid": "7e8778dd7348f00279cc20a31fa7b38a", "score": "0.5164664", "text": "def fill_triangle(x1:, y1:, x2:, y2:, x3:, y3:, color: nil, colour: nil)\n fill_polygon coordinates: [x1, y1, x2, y2, x3, y3], color: color || colour\n end", "title": "" }, { "docid": "34788bf4cdf685f7ddceae1524e20e28", "score": "0.51593167", "text": "def triangle(angle1, angle2, angle3)\n angles = [angle1, angle2, angle3]\n case\n when angles.inject(:+) != 180 then :invalid\n when angles.any? { |angle| angle <= 0 } then :invalid\n when angles.any? { |angle| angle > 90 } then :obtuse\n when angles.any? { |angle| angle == 90 } then :right\n else :acute\n end\nend", "title": "" }, { "docid": "21f1f84440f07301dc563dfb720cd97a", "score": "0.5159051", "text": "def triangle(a, b, c)\n angles = [a, b, c]\n return :invalid unless angles.sum == 180 && angles.none?(&:zero?) # no 0s and sum to 180\n return :right if angles.any? { |x| x == 90 }\n return :obtuse if angles.any? { |x| x > 90 }\n :acute\nend", "title": "" }, { "docid": "db703c5af6a41073d0521bfa8b573bdf", "score": "0.5154227", "text": "def avg_3(x, y, z)\n (x + y + z) / 3.to_f\n end", "title": "" }, { "docid": "3ebf6a44cf42ba32bc4e07123a7d7cfa", "score": "0.5148817", "text": "def area\n\n return @side_len * @side_len\n\n\n end", "title": "" }, { "docid": "8b7bf4977d44d7377e26fb8f7306158e", "score": "0.51385736", "text": "def triangulate(vertices)\n\t\tedges = []\n tris = []\n # sort by X coord\n vertices = vertices.sort_by {|p|p.x}\n # center/radius cache used by circum_circle\n cc_cache = {}\n\n # Set up the supertriangle\n # This is a triangle which encompasses all the sample points.\n # The supertriangle coordinates are added to the end of the\n # vertex list. The supertriangle is the first triangle in\n # the triangle list.\n number_of_vertices = vertices.size\n\t\tbounding_p1, bounding_p2, bounding_p3 = get_bounding_vertices(vertices)\n\t\tvertices << bounding_p1 << bounding_p2 << bounding_p3\n\t\ttris << ITRIANGLE.new(number_of_vertices, number_of_vertices+1, number_of_vertices+2)\n\n # Include each point one at a time into the existing mesh\n vertices.each_with_index { |current_point, i|\n edges.clear\n # Set up the edge buffer.\n # If the point (xp,yp) lies inside the circumcircle then the\n # three edges of that triangle are added to the edge buffer\n # and that triangle is removed.\n j = 0\n\t\t\ttris_size = tris.size\n\t\t\twhile j < tris_size\n\t\t\t\tcurrent_triangle = tris[j]\n if !current_triangle.complete\n p1 = vertices[current_triangle.p1]\n p2 = vertices[current_triangle.p2]\n p3 = vertices[current_triangle.p3]\n inside,xc,yc,r = circum_circle(current_point, p1, p2, p3, cc_cache)\n if (xc + r) < current_point.x\n current_triangle.complete = true\n end\n if inside\n\t\t\t\t\t\tedges << IEDGE.new(current_triangle.p1, current_triangle.p2)\n edges << IEDGE.new(current_triangle.p2, current_triangle.p3)\n edges << IEDGE.new(current_triangle.p3, current_triangle.p1)\n tris.delete_at(j)\n\t\t\t\t\t\ttris_size -= 1\n j -= 1\n end\n end\n j += 1\n end #while j\n\t\t\t\n\t\t\twhile !edges.empty?\n\t\t\t\tedge = edges.shift\n\t\t\t\trejected = edges.reject! {|e| e == edge}\n\t\t\t\ttris << ITRIANGLE.new(edge.p1, edge.p2, i) if rejected.nil? \n\t\t \tend\n \n } #each i\n \n\t\t# Remove supertriangle vertices\n\t\t3.times do \n\t\t\tvertices.pop\n\t\tend\n\t\tnumber_of_vertices = vertices.size\n\n # Remove triangles with supertriangle vertices\n # These are triangles which have a vertex number greater than number_of_vertices\n\t\ttris.delete_if {|tri| tri.p1 >= number_of_vertices || tri.p2 >= number_of_vertices || tri.p3 >= number_of_vertices}\n\n [ vertices, tris ]\n end", "title": "" }, { "docid": "9e060c4d49d7b2ded7a37b7ea4f31ea4", "score": "0.5128175", "text": "def calculate_area(num1, num2)\n (num1 * num2) / 2\nend", "title": "" }, { "docid": "ca5bbed805aea90e1dd9f1809e639ae2", "score": "0.51241225", "text": "def area(length, width)\n a = length * width\n return a\nend", "title": "" }, { "docid": "f3d39abafedbdd97c532770545c89e6c", "score": "0.5120752", "text": "def area\n result = @length * @breadth\n puts\n puts \"area of square of length 4 should be 16 ✔\"\n puts \"area of rectangle with #{@length}, #{@breadth} should be #{result} ✔\"\n\n end", "title": "" }, { "docid": "97622b5b9002df44aa9ea0a1126263ce", "score": "0.51179236", "text": "def triangle(a,b,c)\n raise TriangleError unless is_valid_triangle?(a,b,c)\n h = [a]\n h << b unless h.include?(b)\n h << c unless h.include?(c)\n return :equilateral if h.length == 1\n return :isosceles if h.length == 2\n :scalene\nend", "title": "" }, { "docid": "a1b5f45e001b0bb01d3d50722e2189fd", "score": "0.51059365", "text": "def area(length, width)\n length * width # Implicit return\nend", "title": "" }, { "docid": "ccacf51570eb3bf6f98d0e85aa032c7d", "score": "0.51058024", "text": "def triangle(angle_1, angle_2, angle_3)\n angles = [angle_1, angle_2, angle_3]\n case\n when angles.inject(:+) != 180 || angles.include?(0)\n :invalid\n when angles.include?(90)\n :right\n when angles.any? { |angle| angle > 90}\n :obtuse\n when angles.all? { |angle| angle < 90 }\n :acute\n end\nend", "title": "" }, { "docid": "cd6ccf21eed6c633e1600ec26fb442e2", "score": "0.51024073", "text": "def area()\n segments.map { |seg| seg.area(start_point) }.reduce(:+)\n end", "title": "" }, { "docid": "9630bf3561afa9fcc79573e348cfd80f", "score": "0.5097676", "text": "def triangle_number(integer)\n\nend", "title": "" }, { "docid": "561d549ba0fd16bfb23a7a67fd11d760", "score": "0.5095767", "text": "def triangle(a, b, c)\n tri = [a, b, c].sort\n\n if tri[0..1].sum <= tri[2] then :invalid\n elsif tri.any? { |side| side <= 0 } then :invalid\n elsif tri[0] == tri[1] && tri[1] == tri[2] then :equilateral\n elsif tri[0] != tri[1] && tri[0] != tri[2] && tri[1] != tri[2] then :scalene\n else :isosceles\n end\nend", "title": "" } ]
ff50c4bddf845e337786cb65510a3ec4
strictly parse comma separated parameters
[ { "docid": "584ee89c7f63ff6034cfaf90894fd603", "score": "0.0", "text": "def split_parameters(parameters_string)\n\n depth = 0\n prev = 0\n start = false\n\n parameters = []\n\n parameters_string.length.times do |index|\n case parameters_string[index]\n when '\"'\n if start\n depth += 1\n else\n depth -= 1\n end\n start = !start\n when '{'\n depth += 1\n when '}'\n depth -= 1\n when ','\n if depth == 0\n cur = parameters_string[prev .. (index - 1)].strip\n if !(cur.empty?)\n parameters.push(cur)\n end\n prev = index + 1\n end\n end\n end\n\n cur = parameters_string[prev .. parameters_string.length - 1].strip\n if !(cur.empty?)\n parameters.push(cur)\n end\n\n return parameters\n end", "title": "" } ]
[ { "docid": "c7eedd4c973b7f93dfbb49e53b2172fb", "score": "0.7071397", "text": "def on_comma(value); end", "title": "" }, { "docid": "0f31cb871b22a12574e439d799f3cf02", "score": "0.679951", "text": "def split_arg arg\n arry = []\n if arg.is_a?(Array)\n arry += arg\n elsif arg.include?(',')\n arry += arg.split(',')\n else\n arry << arg\n end\n arry\n end", "title": "" }, { "docid": "c890aaa4ca8e1063b1f71bb5f161efb4", "score": "0.67889595", "text": "def parse_comma_seperated_string(s)\n list = s.split(',')\n end", "title": "" }, { "docid": "4b7fc9a45aaee63468d2d61dd07fc070", "score": "0.67799973", "text": "def split_arg arg\n arry = []\n if arg.is_a?(Array)\n arry += arg\n elsif arg =~ /,/\n arry += arg.split(',')\n else\n arry << arg\n end\n arry\n end", "title": "" }, { "docid": "d7d14ef1bc9891199312cb4d94973082", "score": "0.667665", "text": "def split_method_params( params )\n # If it has multiple lines, read only the first one.\n params = params.lines.first\n\n # If it has (), get rid of everything except inside the ()\n if params =~ /\\(.*\\)/\n begin\n params = params.match(/^[^(]*\\((.*)\\)\\s*$/)[1].strip\n rescue\n # Parsing failed. Oh well, we tried.\n return []\n end\n end\n\n # Split by comma, perhaps with whitespace before or after\n params.split(/\\s*,\\s*/).collect{ |param|\n # Split by =, perhaps with whitespace before or after\n parts = param.strip.split(/\\s*=\\s*/)\n if parts.size > 1\n {\"name\" => parts[0], \"default\" => parts[1]}\n else\n {\"name\" => parts[0]}\n end\n }\n end", "title": "" }, { "docid": "71b4ef7172953d39de8e93df334a4f58", "score": "0.6532795", "text": "def visit_comma(node); end", "title": "" }, { "docid": "63413e256881873c9280c1073caa8ac0", "score": "0.6498743", "text": "def comma=(_arg0); end", "title": "" }, { "docid": "63413e256881873c9280c1073caa8ac0", "score": "0.6498743", "text": "def comma=(_arg0); end", "title": "" }, { "docid": "8ab62a745c432f8082275154255e9021", "score": "0.6351108", "text": "def parse_comma_sep(args, &b)\n return [] if args.empty?\n\n b ||= method(:parse_expr)\n\n out = []\n\n loop do\n before, comma, after = lpart(args) { |a| a.atom?(:comma) }\n break if comma.nil?\n\n if before.empty?\n out << b.call([comma])\n else\n out << b.call(before)\n end\n\n args = after\n end\n\n # if there is anymore, parse it out and add it on. otherwise,\n # it's a trailing comma, so we ignore it.\n out << b.call(args) if args.any?\n\n out\n end", "title": "" }, { "docid": "9c21ab2ef1c98cb56affba5b6d6910d3", "score": "0.62584347", "text": "def given_csv *records\n self.given_delimited(\",\", *records)\n end", "title": "" }, { "docid": "98059c973a445f4cef7133deb514e0a7", "score": "0.6248262", "text": "def comma(i); rex(nil, i, /,\\s*/); end", "title": "" }, { "docid": "91ae93e4f2768d9ffcb75464bfb8e224", "score": "0.6236627", "text": "def parse_arg_names\n arg_names = []\n consume(:oparen)\n if peek(:identifier)\n arg_names << consume(:identifier).value\n while peek(:comma)\n consume(:comma)\n arg_names << consume(:identifier).value\n end\n end\n consume(:cparen)\n arg_names\n end", "title": "" }, { "docid": "fa881aebeb6f4922f742c33e717e681b", "score": "0.6159106", "text": "def parse_line( line )\n line.chomp.split(\",\")\nend", "title": "" }, { "docid": "0aa5bbb3f4cd55854411399042ee0f81", "score": "0.6155589", "text": "def parse_line( line )\n\t\n\t## FILL IN ##\n return line.split(\",\")\n\t\nend", "title": "" }, { "docid": "a54daf20444dd333dc629ddb90983f99", "score": "0.60397136", "text": "def parse_params\n params = []\n while p = parse_param\n params << p\n # some programs send us 2.1 cards with params in the 3.0-shorthand version \"TYPE=fax,work\n # I added support for that although it is not according to the specs.\n if @input.scan(COMMA)\n val = @input.scan(XWORD) || \"\"\n params << Param.new(to_ascii(p.key), val)\n end\n end\n params\n end", "title": "" }, { "docid": "a944a975f8c80c026eb0d2e7d130321c", "score": "0.603358", "text": "def on_excessed_comma(*_arg0); end", "title": "" }, { "docid": "bc642fda03c5db21d5a9c797f379b8d5", "score": "0.60313386", "text": "def comma!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 13)\n\n type = COMMA\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 354:8: ','\n match(?,)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 13)\n\n end", "title": "" }, { "docid": "a3c231798ef245fe6f5c206dcf3bd2a0", "score": "0.601762", "text": "def split_on_commas\n normalize_whitespace().split(/,\\s*(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))/)\n end", "title": "" }, { "docid": "e10e2fb94f3678d707cf4a1f8422cbd1", "score": "0.59731674", "text": "def Comma(value); end", "title": "" }, { "docid": "110d2a395f5f4426df98893eed576387", "score": "0.5971522", "text": "def sep_param\n params['sep'] || ','\n end", "title": "" }, { "docid": "ed6fa9cf397cb22746cb0a6f99902401", "score": "0.59518987", "text": "def split_multi_params(multi_params, *keys)\n return if multi_params.nil?\n keys = multi_params.keys if keys.empty?\n keys.each do |k|\n if multi_params[k] \n multi_params[k] = multi_params[k].split(/[, ]+/)\n end\n end\n end", "title": "" }, { "docid": "bca164572a7c3d921851d6a762272145", "score": "0.5942889", "text": "def handle_comma\n rpn_expr << op_stack.pop until op_stack.empty? || op_stack.last == '('\n @function_args += 1\n end", "title": "" }, { "docid": "596c19977a663d811379b1841063e692", "score": "0.5919334", "text": "def arg_array(arg)\n (arg.include?(',') ? arg.split(/,/) : arg.split).each{|_arg| _arg.strip!}\n end", "title": "" }, { "docid": "34454b446dbed154cb637864d3e9075b", "score": "0.5862001", "text": "def comma(str, *phrases)\n _concat([\", \", str])\n _inspect(phrases)\n end", "title": "" }, { "docid": "268ef7b68ddeeb34b72abc9d84d5f782", "score": "0.5853546", "text": "def parse_intput(param_string)\t\n\t\tdefault = param_string.eql? \"\\n\"\t\t\n\t\treturn \",\" if default\n\t\tparam_string.split(/\\n/)[0]\n\tend", "title": "" }, { "docid": "772f92be9269b478e606c48c19794651", "score": "0.5839599", "text": "def parse_parameters\r\n parameters = []\r\n skip_white_space\r\n return if @tk.is_a?(RDoc::RubyToken::TkRPAREN)\r\n\r\n parameters << parse_expression\r\n skip_white_space\r\n while @tk.is_a?(RDoc::RubyToken::TkCOMMA) do\r\n get_tk\r\n parameters << parse_expression\r\n skip_white_space\r\n end\r\n parameters\r\n end", "title": "" }, { "docid": "bde19c43d840e3cb02383758d7136a4a", "score": "0.582279", "text": "def scan_parameters_string(str, need_names = true)\n # @verbose = true\n\n # Add self parameter at front.\n add_self\n\n $stderr.puts \"scan_parameters_string(#{str.inspect})\" if @verbose\n\n until str.empty?\n # Scan parameter\n p = Parameter.new\n p.verbose = @verbose\n str = p.scan_string(str)\n add_parameter(p)\n $stderr.puts \" params=#{parameter_to_s}\" if @verbose \n\n # Parse , or )\n str.sub!(/\\A\\s+/, '')\n if ! str.empty? \n if md = /\\A,/s.match(str)\n str = md.post_match\n elsif md = /\\A\\)/s.match(str)\n $stderr.puts \" DONE: #{to_s}\\n Remaining: #{str.inspect}\" if @verbose\n break\n else\n raise NameError, \"Syntax error in multimethod parameters: expected ',' or ')' at #{str.inspect}\"\n end\n end\n \n end\n\n $stderr.puts \"scan_parameters_string(...): DONE: #{to_s}\\n Remaining: #{str}\" if @verbose\n\n str\n end", "title": "" }, { "docid": "6dbd8077899bc6a69672b62672cdb701", "score": "0.582095", "text": "def extract_table_parameters_from(str)\n\t\tif str.nil? || str.size < 1 then\n\t\t\treturn []\n\t\tend\n\t\t\n\t\tif !str.include? ',' then\n\t\t\treturn str\n\t\telse\n\t\t\treturn str.split ','\n\t\tend\n\t\t\n\tend", "title": "" }, { "docid": "983da1f8873ca9c0ee840a74ab115cf7", "score": "0.58156514", "text": "def comma_check(ele)\n\t\tcomma = []\n\t\t\n\t\tif ele.include?(',')\n\t\t\t# contains comma. split it and return the split array \n\t\t\tcomma = ele.split(',')\n\t\t\treturn comma\n\t\telse\n\t\t\t# no comma. don't split, but I would like to put it in an array\n\t\t\t# comma[0] = ele --- if i want everything in array format uncomment this and return comma\n\t\t\treturn ele \n\t\tend\n\tend", "title": "" }, { "docid": "80161628a2361069839216bee684f7b3", "score": "0.58145416", "text": "def parse(table)\n return table if Array === table\n\n if table.include?(',')\n table.gsub(/\\W/,',').squeeze(',').split(',').reject { |x| x.empty? }\n else\n table.gsub(/\\W/,'').scan(/./)\n end\n end", "title": "" }, { "docid": "84f58f904700bb78d99875a9ac7666a2", "score": "0.58132464", "text": "def parse_keywords(keywords)\n keywords ? keywords.split(',') : []\n end", "title": "" }, { "docid": "fb6e489615009ee91fd07444971b792a", "score": "0.5809912", "text": "def do_parse_array(method, key, args = {}, &block)\n declare_parameter(key, method, args)\n str = get_param(key, :leave_slashes)\n return args[:default] unless str\n result = []\n args[:list] = true\n while (match = str.match(/^((\\\\.|[^,]+)+),/))\n str = match.post_match\n result << send(method, match[1], args, &block)\n end\n result << send(method, str, args, &block)\n end", "title": "" }, { "docid": "b7a57b1adb05363cfb223f9fe38ec869", "score": "0.5792377", "text": "def split_by_comma_regex(values)\n values.scan(COMMA_SPLITTER_REGEX).flatten.each.\n collect { |h| h.gsub(/BEGIN|END/, \"\") }\n end", "title": "" }, { "docid": "6cc6081ee58e3befcafe621b6c3f72e9", "score": "0.57830757", "text": "def parse_arg_exprs\n arg_exprs = []\n consume(:oparen)\n if !peek(:cparen)\n arg_exprs << parse_expr\n while peek(:comma)\n consume(:comma)\n arg_exprs << parse_expr\n end\n end\n consume(:cparen)\n arg_exprs\n end", "title": "" }, { "docid": "8fe58c6e59b4878499209e7a533ac7f1", "score": "0.5782577", "text": "def destructured_method_param((a, b, c))\nend", "title": "" }, { "docid": "3143411e6155e260b762d594a64b8e57", "score": "0.57695234", "text": "def scan_comma_spaces\n @scanner.scan(/, +/)\n end", "title": "" }, { "docid": "502fad8b00b500245784fd7bc24d9051", "score": "0.5766351", "text": "def comma; end", "title": "" }, { "docid": "502fad8b00b500245784fd7bc24d9051", "score": "0.5766351", "text": "def comma; end", "title": "" }, { "docid": "47cb83af2e68a79022a0bda8bbce2649", "score": "0.57591695", "text": "def strip_and_split_comma(line)\n line.rstrip!\n line.split(/,/)\n end", "title": "" }, { "docid": "c912205ad507d77536f6c4cb75eeebac", "score": "0.5750532", "text": "def visit_excessed_comma(node); end", "title": "" }, { "docid": "3394853f6a6790a535b98c32532abcba", "score": "0.5746025", "text": "def parse_value(line)\n SimpleConfig.new(\n line,\n line_separator: ',',\n assignment_regex: /^\\s*([^\\(]*?)\\s*\\(\\s*(.*?)\\)*$/,\n group_re: nil,\n multiple_values: false,\n ).params\n end", "title": "" }, { "docid": "b5c820261870bbe21d43eb3002f37d38", "score": "0.5743842", "text": "def do_parse_array(method, key, args={}, &block)\n declare_parameter(key, method, args)\n str = get_param(key, :leave_slashes) or return args[:default]\n result = []\n args[:list] = true\n while str.match(/^((\\\\.|[^,]+)+),/)\n val, str = $1, $'\n result << send(method, val, args, &block)\n end\n result << send(method, str, args, &block)\n return result\n end", "title": "" }, { "docid": "46c9cd077c40aabbddce8cf9889fbcaf", "score": "0.5743731", "text": "def MLHS(parts, comma); end", "title": "" }, { "docid": "351f9498b335ef26bcee4de559641db1", "score": "0.5740877", "text": "def id_params\n ids = params[:id]\n ids = ids.join(',') if ids.is_a?(Array)\n ids.to_s.split(/\\s*,\\s*/)\n end", "title": "" }, { "docid": "6612602fca5b3052e470caac92cc9f14", "score": "0.5726907", "text": "def _parse_list\n _eat :space\n args = []\n return args if _peek(:punct, ')')\n\n loop do\n args << _parse_expr1\n\n _eat :space\n if _eat(:punct, \",\")\n _eat :space\n else\n break\n end\n end\n\n args\n end", "title": "" }, { "docid": "7bcc8cff7249ba76d7435bb8203ef005", "score": "0.56885123", "text": "def parse_arglist\n prefix = literal(ASTERISK) || literal(AMP)\n ws if prefix\n ## FIXME: If \"name\" is not mentioned here, it is not correctly recognised\n name = nil\n if !(name = parse_name)\n expected(\"argument name following '#{prefix}'\") if prefix\n return\n end\n\n nolfws\n default = nil\n if literal(\"=\")\n nolfws\n default = @shunting.parse([COMMA])\n end\n\n if prefix then args = [[name.to_sym, prefix == ASTERISK ? :rest : :block]]\n elsif default\n args = [[name.to_sym, :default, default]]\n else\n args = [name.to_sym]\n end\n nolfws\n literal(COMMA) or return args\n ws\n more = parse_arglist or expected(\"argument\")\n return args + more\n end", "title": "" }, { "docid": "6702c77d1bace9027df69c7650c2e603", "score": "0.56833035", "text": "def check_commas_after_args(args, arg_type)\n # For each arg except the last, check the character following the comma\n args[0..-2].each do |arg|\n # Sometimes the line we're looking at doesn't even contain a comma!\n next unless engine.lines[arg.line - 1].include?(',')\n\n comma_position = find_comma_position(arg)\n\n # Check for space or newline after comma (we allow arguments to be split\n # up over multiple lines).\n spaces = 0\n while (char = character_at(comma_position, spaces + 1)) == ' '\n spaces += 1\n end\n next if char == \"\\n\" || # Ignore trailing spaces\n valid_spaces_after_comma?(spaces)\n\n style_message = config['style'].tr('_', ' ')\n add_lint comma_position, \"Commas in #{arg_type} should be followed by #{style_message}\"\n end\n end", "title": "" }, { "docid": "306cbb9376369752a119c62d00708017", "score": "0.56745833", "text": "def multiget?(param: :id)\n params[param].present? && params[param].include?(',')\n end", "title": "" }, { "docid": "fcc96b6676197cb7a73d0926fe13b5d9", "score": "0.5649432", "text": "def parse_range_params(params)\n params.split(';').inject({}) do |m, p|\n k, v = p.split('=', 2)\n m[k] = v if v\n m\n end\n end", "title": "" }, { "docid": "18402b28f0c35539b53a64ee4b302354", "score": "0.5649416", "text": "def array_param(value)\n value = value.split(',') if value.is_a?(String)\n value.map { |s| s.to_s.strip.presence }.compact if value.is_a?(Array)\n end", "title": "" }, { "docid": "b5c134ff1a0fae43685b650679332d0b", "score": "0.56490207", "text": "def on_comma(value)\n node =\n Comma.new(\n value: value,\n location:\n Location.token(\n line: lineno,\n char: char_pos,\n column: current_column,\n size: value.size\n )\n )\n\n tokens << node\n node\n end", "title": "" }, { "docid": "083be646fc47687e4da2a7b8eb0a5702", "score": "0.5637188", "text": "def parse *params\n params.each do |parameter|\n name, value = parameter.split '='\n\n if value\n _, parser = PARSERS.find { |key, _value| key.include? name }\n\n self[name] = parser.nil? ? value : parser.call(value)\n else\n self[name] = true\n end\n end\n end", "title": "" }, { "docid": "387a2f60a448f75cc353234cb6f58419", "score": "0.5634876", "text": "def split_and_clean_values(values)\n [\"\\t\",\";\",\"\\n\"].each do |delimiter|\n values.gsub!(delimiter, ',')\n end\n values.split(',').map(&:strip).reject(&:blank?)\n end", "title": "" }, { "docid": "7b2a9089e90b5abbf43a6c9d861ac891", "score": "0.5632192", "text": "def to_params_part(params)\n param_csv = to_param_names_array(params).join(', ')\n param_csv.empty? ? \"\" : \"(#{param_csv})\"\n end", "title": "" }, { "docid": "6ab6ef8a2ce7dcea1db2ee844dc8926e", "score": "0.56318235", "text": "def param_to_options(param)\n words_to_options(param.split(/,/))\n end", "title": "" }, { "docid": "f9067eef599a05ea98c35c44618963d6", "score": "0.56313306", "text": "def parse_raw_value(raw_value)\n case raw_value\n when /\\A\\d+\\Z/ # parse numbers as numbers\n value = raw_value.to_i\n when /\\A\"([^\"]*)\"\\Z/ # parse quoted strings as strings\n value = $1\n # if it contains a comma with stuff on either side AND\n # isn't wholly enclosed in quotes, it's a list\n when /.+,.+/ \n value = raw_value.split(/,/)\n else # otherwise, it's just a raw string\n value = raw_value\n end\nend", "title": "" }, { "docid": "a3fab09bf73b584ab607454046f32ed2", "score": "0.5628146", "text": "def validate_no_commas\n fields = [\n 'first_name',\n 'last_name',\n 'address1',\n 'address2',\n 'city',\n 'zip',\n 'state',\n 'email',\n 'phone',\n ]\n fields.each do |field|\n if send(field).to_s =~ /,/\n errors[field] << \"#{field} cannot contain commas\"\n end\n end\n end", "title": "" }, { "docid": "39d10b0e2edf0406960ce133834070da", "score": "0.56099355", "text": "def parse_args op, *arg_lists\n arg_lists.each_with_index.map do |accepted, i|\n # not the first param, then match on a comma\n match(:cma) if (i != 0)\n\n # ensure accepted is an array of valid argument types\n accepted = [*accepted]\n unless accepted.all? { |a| [:reg, :imm, :lbl, :adr].freeze.include?(a) }\n error(\"ICE: invalid argument parse type in list '#{accepted}'\")\n end\n\n ft = l.front.type\n\n # starts with '['\n if (ft == :obr) && accepted.include?(:adr)\n next parse_adr\n end\n\n # starts with '%'\n if (ft == :per) && accepted.include?(:reg)\n next parse_reg\n end\n\n # starts with an arbitrary identifier\n # (which also isn't a defined constant)\n if (ft == :idt) && !@constant_decls[l.front.val] && accepted.include?(:lbl)\n next parse_label\n end\n\n # none of the above, try parsing as an immediate value\n if accepted.include?(:imm)\n next parse_imm\n end\n\n # at this point none match, meaning syntax error\n error \"expected argument #{i+1} for instruction '#{op}' to be of type #{accepted}, but started with #{ft}\"\n end\n end", "title": "" }, { "docid": "061a116487d5c311062f25f3a2941384", "score": "0.56072235", "text": "def to_params_part(params)\n param_csv = to_param_names_array(params).join(', ')\n param_csv.empty? ? '' : \"(#{param_csv})\"\n end", "title": "" }, { "docid": "79b5deb6c87271a725633f040e3ac900", "score": "0.559235", "text": "def param_list\n @params_lsit ||= rule.sep('(').maybe(params).sep(')')\n end", "title": "" }, { "docid": "395ba4323eb2d3b5d036a8e9c4691b71", "score": "0.55886877", "text": "def read_declarator_params_oldstyle(vars)\n while true\n tok = get\n if tok.kind != T::IDENT\n Util.errort!(tok, \"identifier expected, but got #{tok}\")\n end\n vars.push(Node.ast_lvar(Type::INT, tok.sval, @localenv, @localvars))\n if next_token?(')')\n return\n end\n if !next_token?(',')\n Util.errort!(tok, \"comma expected, but got #{get}\")\n end\n end\n end", "title": "" }, { "docid": "2fe04943595e43bbe9e856ffcf5764bc", "score": "0.55795306", "text": "def load(s)\n s.present? ? s.split(/,/) : @default\n end", "title": "" }, { "docid": "994dcdb532e44975559f89136f0168f2", "score": "0.55727047", "text": "def validate_param_error_multiple(method_name, param_name, value, types)\n exp_types = types.join(', ').sub(/\\,([^\\,]+)$/, ' or a\\1')\n reason = \"should be a #{exp_types}; is a #{value.class} with value of #{value.inspect}.\"\n log_error(format(validate_param_message, param_name: param_name, method_name: method_name, reason: reason))\n return true\n end", "title": "" }, { "docid": "8a2184935c329d5c293977ff9bfe5a1e", "score": "0.556277", "text": "def tags_should_be_seperated_by_comma\n return if self.tag_list == []\n self.tag_list.each do |tag|\n unless tag =~ /^[\\sa-zA-Z0-9\\-+]+$/\n errors.add(:tags,\"should only contain characters,numbers,space and seperated by comma\")\n return\n end\n end\n end", "title": "" }, { "docid": "d57f8ee8e7c2cc42499f428b7bcf5997", "score": "0.5560013", "text": "def handle_orphaned_comma(corrector, node); end", "title": "" }, { "docid": "c8461588809804b14b9524d984216e62", "score": "0.555667", "text": "def parse_args(parts)\n begin\n args = JSON.parse strip_quotes(parts.clone)\n rescue\n # Split with a RegEx, since we may have commas inside of elements as well as \n # delimitting them\n elements = parts.split(/(,|\\r\\n|\\n|\\r)(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*(?![^\\\"]*\\\"))/m)\n # Get rid of the extraneous commas\n elements.delete(\",\")\n args = []\n elements.each do |ele|\n args << strip_quotes(ele)\n end\n end\n args\n end", "title": "" }, { "docid": "44df33206647c40d396e9737f13c526d", "score": "0.5554239", "text": "def parameters(left, right, types, names)\n expect(left)\n nextToken()\n\n if accept(right)\n nextToken\n return\n end\n\n types.push(expression)\n names.push(getTokenData)\n nextToken\n while accept(Tokens::COMMA)\n nextToken\n types.push(expression)\n names.push(getTokenData)\n nextToken\n end\n expect(right)\n nextToken\n end", "title": "" }, { "docid": "d4301c9664b86f1d7dbc0e472efda7c2", "score": "0.5552661", "text": "def parse_fields(fields_string)\n required_fields + fields_string.split(',')\n end", "title": "" }, { "docid": "f2f7433972bf4ddad065927b017e78cd", "score": "0.555241", "text": "def parse_id_list(id_list, delim=/\\s*\\,\\s*/)\n [id_list].flatten.collect {|it| it ? it.to_s.split(delim) : nil }.flatten.compact\n end", "title": "" }, { "docid": "8ed7246609bcecb3d12d0ea566ce57d9", "score": "0.5549119", "text": "def reconstruct_parameters_string parameters\n parameters.map(&:input_str).join \",\"\n end", "title": "" }, { "docid": "5c69b6cbf416f14c7b3bba8e42e44321", "score": "0.5546508", "text": "def parse_returned_params_as_list(attribute)\n if returned_parameters[attribute] && !returned_parameters[attribute].empty?\n returned_parameters[attribute].to_s.split(\",\")\n end\n end", "title": "" }, { "docid": "5c69b6cbf416f14c7b3bba8e42e44321", "score": "0.5546508", "text": "def parse_returned_params_as_list(attribute)\n if returned_parameters[attribute] && !returned_parameters[attribute].empty?\n returned_parameters[attribute].to_s.split(\",\")\n end\n end", "title": "" }, { "docid": "6f8361329e53f173e940a44b0e38651e", "score": "0.55423295", "text": "def parameterize(arguments)\n arguments = arguments.join(', ') if arguments.is_a? Array\n arguments\n end", "title": "" }, { "docid": "77ca8feb75f14aa975795f06f5fdae97", "score": "0.55353403", "text": "def parse_array(comma_separated_string)\n comma_separated_string.split(',').map { |item| item.gsub(/\\\\\\\"/,\"\"); item.strip }\n end", "title": "" }, { "docid": "7bce4b9f3268b9c6df20ca2fa5306981", "score": "0.553293", "text": "def fix_comma_errors(field)\n field.is_a?(Array) ? field.map {|f| split_fields(f)} : split_fields(field)\n end", "title": "" }, { "docid": "f1147a88122e0af7ee2d98100e53ad2c", "score": "0.5531063", "text": "def recordize line\n line.chomp(',').split(',') rescue nil\n end", "title": "" }, { "docid": "238ae4cd0b471f2e26822d7c687d7ad7", "score": "0.5522809", "text": "def on_excessed_comma(*)\n comma = consume_token(Comma)\n\n ExcessedComma.new(value: comma.value, location: comma.location)\n end", "title": "" }, { "docid": "665da8ebeec772fdee382eff13c5e071", "score": "0.5522559", "text": "def parse_parameters (tokens)\n\tpositional = parse_list tokens, [ :dotdot, :rparen ]\n\n\tif tokens[0] and tokens[0][0] == :dotdot\n\t tokens.shift\t# Consume ..\n\t named = parse_list tokens, [ :rparen ]\n\telse\n\t named = nil\n\tend\n\n\ttokens.shift\t\t# Consume )\n\tfactory :parameters, positional, named\n end", "title": "" }, { "docid": "026c66faa143ee33337f7bcc4b743463", "score": "0.5522118", "text": "def get_ids_in_csv(id_str)\n return (id_str =~ /^[0-9]+(,[0-9]+)*$/) ? id_str : nil\n end", "title": "" }, { "docid": "6c149d0ab77f34a4b71ccc731f73da59", "score": "0.55190825", "text": "def comma_separated_array(*names)\n names.each do |name|\n param name do\n default []\n join do |arr|\n arr.join ','\n end\n end\n end\n end", "title": "" }, { "docid": "726312386a6ce73eae75f0efd33dbaf2", "score": "0.5515715", "text": "def pragma_params\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 17 )\n return_value = PragmaParamsReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n pragma_params_start_index = @input.index\n\n root_0 = nil\n __COMMA164__ = nil\n pragma_param163 = nil\n pragma_param165 = nil\n\n tree_for_COMMA164 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 163:4: pragma_param ( COMMA pragma_param )*\n @state.following.push( TOKENS_FOLLOWING_pragma_param_IN_pragma_params_950 )\n pragma_param163 = pragma_param\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, pragma_param163.tree )\n end\n # at line 163:17: ( COMMA pragma_param )*\n while true # decision 33\n alt_33 = 2\n look_33_0 = @input.peek( 1 )\n\n if ( look_33_0 == COMMA )\n alt_33 = 1\n\n end\n case alt_33\n when 1\n # at line 163:19: COMMA pragma_param\n __COMMA164__ = match( COMMA, TOKENS_FOLLOWING_COMMA_IN_pragma_params_954 )\n if @state.backtracking == 0\n\n tree_for_COMMA164 = @adaptor.create_with_payload( __COMMA164__ )\n @adaptor.add_child( root_0, tree_for_COMMA164 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_pragma_param_IN_pragma_params_956 )\n pragma_param165 = pragma_param\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, pragma_param165.tree )\n end\n\n else\n break # out of loop for decision 33\n end\n end # loop for decision 33\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 17 )\n memoize( __method__, pragma_params_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end", "title": "" }, { "docid": "a943a9a5fb24a476e2333d92748a755a", "score": "0.55117804", "text": "def foo a:, b:\n puts \"A: #{a}, B: #{b}\"\n end", "title": "" }, { "docid": "4c8aa56bcbb7dcf055023a2c5652559e", "score": "0.551173", "text": "def parse_vars line\n raise unless /\\((.*?)\\)/ =~ line\n vars = $1.split(',')\n vars.map!{|v|\n if /\\s*(\\S+)\\s+(\\S+)\\s*/ =~ v\n type = $1\n var = $2\n elsif /\\s*\\.\\.\\.\\s*/ =~ v\n type = var = '...'\n else\n raise\n end\n [type, var]\n }\n vars\n end", "title": "" }, { "docid": "0aabd93825f21e8bc76f44c6312d1cdb", "score": "0.550695", "text": "def set_ids\n @ids = params[:ids].split(\",\")\n end", "title": "" }, { "docid": "7bf4876971a4dde7193e9e3cede53fef", "score": "0.55012923", "text": "def place_args_deconstruct(args)\n args.delete(' ').split(\",\")\n end", "title": "" }, { "docid": "c0d9c5870998b10a7bee77654a162563", "score": "0.55011195", "text": "def tag_parameters\n index = 0\n loop do\n tok = @tokens[index -= 1]\n next if tok[0] == ','\n return if tok[0] != :IDENTIFIER\n tok[0] = :PARAM\n end\n end", "title": "" }, { "docid": "028cad06ee3428685b86487e33dc7125", "score": "0.5490478", "text": "def parse_indicies(str) # :nodoc:\n str.split(\",\").delete_if do |n|\n n.empty?\n end\n end", "title": "" }, { "docid": "4c695bf85429b0594a380a50e02f0257", "score": "0.5477209", "text": "def call_parameters\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 225 )\n return_value = CallParametersReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n call_parameters_start_index = @input.index\n\n root_0 = nil\n __COMMA1243__ = nil\n call_parameter1242 = nil\n call_parameter1244 = nil\n\n tree_for_COMMA1243 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1139:4: call_parameter ( COMMA call_parameter )*\n @state.following.push( TOKENS_FOLLOWING_call_parameter_IN_call_parameters_7383 )\n call_parameter1242 = call_parameter\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, call_parameter1242.tree )\n end\n # at line 1139:19: ( COMMA call_parameter )*\n while true # decision 322\n alt_322 = 2\n look_322_0 = @input.peek( 1 )\n\n if ( look_322_0 == COMMA )\n alt_322 = 1\n\n end\n case alt_322\n when 1\n # at line 1139:21: COMMA call_parameter\n __COMMA1243__ = match( COMMA, TOKENS_FOLLOWING_COMMA_IN_call_parameters_7387 )\n if @state.backtracking == 0\n\n tree_for_COMMA1243 = @adaptor.create_with_payload( __COMMA1243__ )\n @adaptor.add_child( root_0, tree_for_COMMA1243 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_call_parameter_IN_call_parameters_7389 )\n call_parameter1244 = call_parameter\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, call_parameter1244.tree )\n end\n\n else\n break # out of loop for decision 322\n end\n end # loop for decision 322\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 225 )\n memoize( __method__, call_parameters_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end", "title": "" }, { "docid": "4e5a021ca2e07f4d889c4c7f30d4d0ee", "score": "0.54684395", "text": "def parse_chromosomes(line)\n line.split(\", \")\n end", "title": "" }, { "docid": "c1b4928834c6481c2e109933afb9f213", "score": "0.54673344", "text": "def comma!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 46 )\n\n type = COMMA\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 423:9: ','\n match( 0x2c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 46 )\n\n end", "title": "" }, { "docid": "100128770ec8ec77a5353402e4e26f92", "score": "0.5466673", "text": "def extract_params(str)\n return {} unless str\n str.split(',').reduce({}) do |a, k|\n a[\"#{k[/^[^=]*/]}\".to_sym] = k[/[^=]*$/]\n a\n end\n end", "title": "" }, { "docid": "3a6e1b5c64cfccc16e28fe161c5462e3", "score": "0.54632366", "text": "def parse_q_values(values); end", "title": "" }, { "docid": "3a6e1b5c64cfccc16e28fe161c5462e3", "score": "0.54632366", "text": "def parse_q_values(values); end", "title": "" }, { "docid": "a546d0afd8053a9391ee954246e5948f", "score": "0.5454882", "text": "def format_categories_param\n return unless params[:categories]\n\n if params[:categories].is_a?(String)\n params[:categories] = params[:categories].split(',')\n end\n end", "title": "" }, { "docid": "07dddf922ecc7980430a533692fda639", "score": "0.5453156", "text": "def parse \nparsed = @emails.split(/,\\s|,|\\s/).uniq\nend", "title": "" }, { "docid": "76936a712a19a2ad6f767402e2dc3e01", "score": "0.5452886", "text": "def parse_returned_params_as_list(attribute)\n if returned_parameters[attribute] && !returned_parameters[attribute].empty?\n returned_parameters[attribute].to_s.split(',')\n end\n end", "title": "" }, { "docid": "18b519fdc217a7671aeab74efe5be70a", "score": "0.5449806", "text": "def get_array_tokens_for_parameter(tokens,parameter)\n get_tokens_between(tokens,:BRACK,parameter).reject do |token|\n token.type == :COMMA\n end\n end", "title": "" }, { "docid": "9e6a38e2afdc4f0411215992ab794083", "score": "0.54493195", "text": "def splitInput(user_input)\n input_string = user_input.split \",\"\n end", "title": "" }, { "docid": "cebdbf3cc40ca114925df3a1e284e874", "score": "0.5447269", "text": "def autogen_parse(parameters); end", "title": "" }, { "docid": "cb1565075da768545c64fd0a60503aa7", "score": "0.54442567", "text": "def clean_up (input)\n if input.include?(\",\")\n code_array = input.split(\", \")\n else\n code_array = input.split(\" \")\n end\n\n return code_array\nend", "title": "" }, { "docid": "d68fde88790847622460ca57a8247345", "score": "0.54349303", "text": "def parse_values; end", "title": "" } ]
bf7840e3b013ea250ae4a6bc9ca685a5
Sum all the numbers in the array an_array can contain lots of different things Be sure to only sum the numbers (Hint: the is_a? method might be useful here)
[ { "docid": "da3fd7be17e58ff8f967e35484ebdabb", "score": "0.81169784", "text": "def sum_only_numbers(an_array)\n count = 0\n an_array.map do |array|\n \tif array.is_a? Fixnum or array.is_a? Float\n \t\tcount = count + array\n \tend\n end\t\nend", "title": "" } ]
[ { "docid": "de297d0370ee4a2503be8dd65db7e517", "score": "0.82395583", "text": "def sum_only_numbers(an_array)\n\tsummation = 0\n\tfor item in an_array\n\t\tif item.is_a? Integer\n\t\t\tsummation += item\n\t\tend\n\t\tif item.is_a? Float\n\t\t\tsummation += item\n\t\tend\n\tend\n\treturn summation\nend", "title": "" }, { "docid": "1c8d3a148f59b829ca9d99fc784e3494", "score": "0.81849617", "text": "def sum_array(some_array) \n sum = 0\n\tsome_array.each do |x|\n\t if x.is_a?Integer\n\t sum = sum + x\n\t end\n\t \n\t end\n\t \n\tsum\n end", "title": "" }, { "docid": "ad0676ccff0da808a9f90a5cdb57ce5e", "score": "0.80986774", "text": "def sum_only_numbers(an_array)\n total = 0\n num = an_array.each { |a| total += a if a.is_a?(Fixnum)} \n \n return total\nend", "title": "" }, { "docid": "9072030df898684b54ed583af8a577cc", "score": "0.800796", "text": "def sum (anArray)\n\n\ttotal = 0.0\n\t# use array each method to add up the numbers\n\tanArray.each {|x| total = x + total}\n\n\treturn total\nend", "title": "" }, { "docid": "d592f341892730939c88e1537ff895b5", "score": "0.7970201", "text": "def sum(array)\n\ttotal = 0\n\tfor number in array #could do each do instead of for loop\n\t\ttotal += number\n\tend\n\treturn total\nend", "title": "" }, { "docid": "6a73bcd029b9f827a7db03b69b5ac157", "score": "0.7932283", "text": "def sum_array(any_array)\n any_array.inject(:+)\n end", "title": "" }, { "docid": "4bab05bb1580841e7543a8e5f4f416f0", "score": "0.7913237", "text": "def sum_only_numbers(array)\n ll_sum = 0.0\n if array.length > 0\n for idx in array do\n if idx.is_a?(Numeric)\n ll_sum += idx\n end\n end\n end\n return ll_sum\nend", "title": "" }, { "docid": "b781968df98302de0490d86b8b8f2e31", "score": "0.78770655", "text": "def sum_only_numbers(an_array)\n sum = 0\n an_array.each {|value| sum += value if value.is_a? Numeric}\n sum\nend", "title": "" }, { "docid": "e7dad8a5173aee2eb42b36f2ba68d128", "score": "0.7843829", "text": "def sum_array(array)\n return array.sum\n\n # sum_total_of_array = 0\n # for number in array\n # sum_total_of_array += number\n # end\n # return sum_total_of_array\nend", "title": "" }, { "docid": "f4aa20af59b060fad16cd0e8f101c8c7", "score": "0.78206307", "text": "def sum_of_array(array)\n sum = 0\n array.each do |item|\n if item.is_a?(Integer) == true\n sum = sum + item\n else\n sum = sum + num_value(item)\n end\n end\n sum\nend", "title": "" }, { "docid": "bd1899be6c91784d6fc7a1b3207874e4", "score": "0.78136665", "text": "def sum_array_of_arrays(some_array) \n big_sum = 0 \n \n some_array.each do |x|\n big_sum = big_sum + sum_array(x)\n end\n \n big_sum\n \n end", "title": "" }, { "docid": "21edc0c25116069c1d999f9a16a8aba7", "score": "0.7786444", "text": "def sum_array(numbers)\n return numbers.sum()\nend", "title": "" }, { "docid": "6efb98ca1eaf7d15db6dd85dbdd0eeb2", "score": "0.7776141", "text": "def sum_only_numbers(an_array)\n # TODO write your code here\n total = 0\n\n an_array.each do |x|\n if(x.is_a? Numeric)\n total = total + x\n end\n end\n\n total\nend", "title": "" }, { "docid": "5af80dd34be1b960394bde02e232936d", "score": "0.7761291", "text": "def sum_only_numbers(an_array)\n sum = 0\n an_array.select{|x| x.is_a?Numeric }.each{|x| sum +=x }\n sum\nend", "title": "" }, { "docid": "a36ef7d2c0177aab78617ecd02848598", "score": "0.7742893", "text": "def add_array_numbers(array)\n result = array.sum\n # .sum cannot be used on a string, only integars and floats\n return result\nend", "title": "" }, { "docid": "224a67bfdca7454b090951515459b4fa", "score": "0.7737903", "text": "def sum(array)\n\n raise 'array includes non integers' unless \n (array.empty? || array.all? { |x| x.integer?})\n \n array.reduce(0,:+)\n \nend", "title": "" }, { "docid": "d7741e6670fabe681aea7c9fdfcea58e", "score": "0.77341074", "text": "def total(my_array)\n my_array.sum\n end", "title": "" }, { "docid": "c179088ecb7fa222be2e30f199793d22", "score": "0.7729986", "text": "def sum_only_numbers(an_array)\n # TODO write your code here\n arraySum = 0\n an_array.each do |arrayElement|\n if arrayElement.is_a?(Numeric) == true\n arraySum += arrayElement\n end\n end\n puts arraySum\nend", "title": "" }, { "docid": "8066bae03d53a3fddd030bb5baf21185", "score": "0.7718048", "text": "def sum_array(array)\n sum = 0\n array.each do |number|\n sum += number\n end\n sum\nend", "title": "" }, { "docid": "9df5e891f6515d0370c87af69c9b8820", "score": "0.76860577", "text": "def sum_array(array)\n sum = 0\n\n array.each do |number|\n sum += number\n end\n\n return sum\nend", "title": "" }, { "docid": "d835a63ad2449ade86810eff2da5d433", "score": "0.767449", "text": "def sum_array(array)\n total = 0\n array.each do |num|\n total += num\n end\n total\nend", "title": "" }, { "docid": "a7bd53c5407a81bd8f12880425ef5a03", "score": "0.7665837", "text": "def sum_array(array)\n the_sum_of_array = array.sum\n the_sum_of_array\nend", "title": "" }, { "docid": "892d10023231d08c69aec15d8dc26e43", "score": "0.76557434", "text": "def sum_array(array)\n\tarray.inject { |sum, n| sum + n }\nend", "title": "" }, { "docid": "190f6c54079be305a31cedc3afbabc77", "score": "0.765514", "text": "def sum_array(array)\n sum = 0\n array.each{ |num| sum += num }\n sum\nend", "title": "" }, { "docid": "a0bbeaa4e453c7e5fdd532e1498a5601", "score": "0.7654644", "text": "def sum_array(array)\n sum = 0\n array.each do |value|\n sum += value\n end\n sum\nend", "title": "" }, { "docid": "dbbb622525063854badc8596054dbdd7", "score": "0.76533914", "text": "def sum_of_sums(array)\r\nend", "title": "" }, { "docid": "177da69ca8eaf411e18abe783db64552", "score": "0.76497215", "text": "def sum_of(array)\n array.inject(0.0) { |sum, e| sum + e }\n end", "title": "" }, { "docid": "bf73538b51d9e2f5c80f0856e91b8c88", "score": "0.76491946", "text": "def sum_array(array)\n sum = 0\n array.each do |num|\n sum += num\n end\n sum\nend", "title": "" }, { "docid": "b1df3ecc1ef5da32c022e6cf29ebea24", "score": "0.76433605", "text": "def total(array)\n\tsum = 0\n\tarray.each {|number| sum += number}\n\tsum\nend", "title": "" }, { "docid": "6c1006fc709ce0286071348b34f64912", "score": "0.7639106", "text": "def sum_array(array)\n\tarray.inject do |sum, n| sum + n\n\tend\nend", "title": "" }, { "docid": "0b6dead141883358fcaa037478e40607", "score": "0.762322", "text": "def sum_only_numbers(an_array)\n nums = an_array.select { |x| x.is_a? Numeric }\n return nums.inject { |sum,x| sum + x }\nend", "title": "" }, { "docid": "7dffe4bb081c2ff1f9c0a9010d02c87d", "score": "0.76225877", "text": "def sum array\n\tsum = 0\n\tarray.each do |number|\n\t\tsum = sum + number\n\tend\n\tsum\nend", "title": "" }, { "docid": "6e35fbe44d6aef3fae0a080dab378c6d", "score": "0.760523", "text": "def total(array)\n\t\ttotal = 0\n\t\tfor number in array\n\t\t\ttotal += number\n\t\tend\n\t\treturn total\n\tend", "title": "" }, { "docid": "56060e8f4a6977901c50feabdf73bf98", "score": "0.75974506", "text": "def sum_array(array)\n sum = 0\n array.each do |x|\n sum += x\n end\n return sum\nend", "title": "" }, { "docid": "fc71af06928516429faaec8b1792fbed", "score": "0.75966024", "text": "def sum_array(array)\n sum = 0\n array.each do |element|\n sum += element\n end\n sum\nend", "title": "" }, { "docid": "ad9227be81e653bafb8ef3f2869d7bb0", "score": "0.7588433", "text": "def sum_array(array)\n sum = 0\n array.each do |num|\n sum = sum + num\n end\n sum\nend", "title": "" }, { "docid": "d8fd3106cfc09201657fe7db1f3d0895", "score": "0.75841963", "text": "def sum_array(array_num)\n\nend", "title": "" }, { "docid": "08ee7bb773fd0ca277d1661c4d2976f5", "score": "0.75838304", "text": "def sum_only_numbers(an_array)\n sum = 0.0\n an_array = an_array.flatten\n for n in an_array\n if n.class == Float || n.class == Fixnum\n sum = sum + n\n end\n end\n sum\nend", "title": "" }, { "docid": "8eda9c92db6398c490f413c71f914a58", "score": "0.7581038", "text": "def sum(theArray)\n\ttotal = 0\n\ttheArray.each do |i|\n\t\ttotal = total + i\n\tend\n\treturn total\nend", "title": "" }, { "docid": "3230795c600a6fab342f4d6867d1810c", "score": "0.75727326", "text": "def sum_array(array)\n sum = 0\n array.each do |num|\n sum+=num\n end\n sum\nend", "title": "" }, { "docid": "406947e8fd2d6f970028319a8fa9d01c", "score": "0.7564036", "text": "def total(array)\n\tsum = 0\n\tarray.each { |a| sum += a }\n\treturn sum\nend", "title": "" }, { "docid": "14701362cc52436aa2ab60c386e4c0d6", "score": "0.75482", "text": "def total (array)\n\tsum=0\n\tarray.each do |n| sum += n\n\tend\n\treturn sum\nend", "title": "" }, { "docid": "36238374cd833a45003aa8f1591b6d83", "score": "0.75424004", "text": "def array_sum(arr)\n\tsum = 0\n\n\t# an for each loop\n\tfor i in arr\n\t\tsum += i\n\tend\n\t\n\treturn sum\n\t\nend", "title": "" }, { "docid": "4ba07e5a640ece7bfc447187b50566dc", "score": "0.75388074", "text": "def sum_using_each(array)\n end", "title": "" }, { "docid": "7f913a58b35dae0d69793644aee86c6c", "score": "0.75377256", "text": "def total(array)\n\tsum = 0\n\tarray.each do |x|\n\t\tsum = sum + x\n\tend\n\tsum\nend", "title": "" }, { "docid": "28542da104b92b24b995f48f778d05b8", "score": "0.7530828", "text": "def sum_array(array)\n array.sum\nend", "title": "" }, { "docid": "cfbdb131d0e78f08795c9ccd1315f996", "score": "0.753028", "text": "def sum_only_numbers(an_array)\n sum = 0\n an_array.each do |item|\n item.is_a?(Integer) || item.is_a?(Float) ? sum += item : sum\n end\n return sum\nend", "title": "" }, { "docid": "329ea0ad80186e33de3aceedcdb7918d", "score": "0.7527631", "text": "def sum(array_of_integers)\n # TODO\nend", "title": "" }, { "docid": "e6da6d27598904fae6b10e6d78870d36", "score": "0.75227606", "text": "def arr_sum(array)\n sum = 0 # Declares initial value for variable 'sum' as 0\n array.each do |i| # Begin iterating each item of arr\n sum += i # add each number in array to the next item, continue until items exhausted\n end\n return sum # Returns new sum value\nend", "title": "" }, { "docid": "de8e235d5d014bfba181876c769894f0", "score": "0.75223684", "text": "def it_arr_sum(array)\r\n sum = 0\r\n array.each {|ele| sum += ele}\r\n return sum\r\nend", "title": "" }, { "docid": "2e129a74329ebeafaa922dd45fd72c10", "score": "0.7509301", "text": "def total(array)\n\tsum = 0\n\tarray.each do |i|\n\t\tsum += i\n\tend\n\treturn sum\nend", "title": "" }, { "docid": "77681c9ae3a185c85154fc5535d9825d", "score": "0.75072867", "text": "def total(array)\n\tsum = 0\n\tarray.each { |x| sum += x }\t\n\tsum\nend", "title": "" }, { "docid": "483861c5bf6b7c2a531f4d284f8e1cae", "score": "0.7505038", "text": "def sum(array)\n\treturn array.reduce(:+)\nend", "title": "" }, { "docid": "bf3f055d397f6b6f862569b7ce1e3373", "score": "0.7503434", "text": "def sum_upon_sums(array)\n\nend", "title": "" }, { "docid": "24be2be9428d606de62233912ab60434", "score": "0.75010645", "text": "def sum(array)\n\tanswer = 0\n\tif array.length > 0 then\n\t\tarray.each {|x| answer += x}\n\telse\n\t\treturn 0\n\tend\n\treturn answer\nend", "title": "" }, { "docid": "f21af8508c2a6ede1b0fe9b3bbbc4714", "score": "0.7500209", "text": "def total(an_array)\n an_array.reduce(:+)\nend", "title": "" }, { "docid": "e73c7d059c2ee1e51aea06aa1ec6e0a9", "score": "0.74946284", "text": "def sum(array)\n\tarray.reduce(:+)\nend", "title": "" }, { "docid": "abbfbacca4e279bd7ecf13884a6c1549", "score": "0.7481239", "text": "def total (array)\n\tsum = 0\n\n\tarray.each {|x| sum = sum + x}\n\treturn sum\nend", "title": "" }, { "docid": "d474032651a1eda1db19761913c73643", "score": "0.74806124", "text": "def sum(array)\n array.inject(0){|sum, n| sum + n}\n end", "title": "" }, { "docid": "4222084a162912699333850ea67bf186", "score": "0.748009", "text": "def sum_array(array)\n array.sum\nend", "title": "" }, { "docid": "553254b3e0b5854debba2b66a6775714", "score": "0.74800605", "text": "def sum_array(array)\n sum = 0\n array.each do |i|\n sum+=i\n end\n sum\nend", "title": "" }, { "docid": "a71cc38ab0ec44a468a47138ddde0c42", "score": "0.7477303", "text": "def total(array) \n\tsum = 0\n\tfor i in 0.. array.length\n\tarray.each { |i| sum += i}\n\treturn sum\nend\nend", "title": "" }, { "docid": "53163431f2219a9732146a214901f347", "score": "0.74719274", "text": "def sum_of_sums(array)\n sum = 0\n sum_array = array.map { |x| sum += x }\n sum_array.inject(:+)\nend", "title": "" }, { "docid": "20b14e768e70cf84df97258f846c24d9", "score": "0.74700177", "text": "def total (array)\n\tarray.inject { |sum, n| sum + n }\nend", "title": "" }, { "docid": "b4239cfbd759bc6e227c4b3922717c03", "score": "0.74690604", "text": "def total_of_array(array)\n array.reduce(:+)\nend", "title": "" }, { "docid": "16d7f74ddf96f734d2eee1d353143979", "score": "0.7468684", "text": "def sum(array)\n sum = 0\n\n array.each { |number|\n sum += number\n }\n\n return sum\nend", "title": "" }, { "docid": "7b60898f2241ad12e74a4a3e89292b2b", "score": "0.7465868", "text": "def sum(array)\n sum = 0\n array.each do |a|\n sum += a\n end\n return sum\nend", "title": "" }, { "docid": "470ba40360ab9358b1c8968a3c69b33b", "score": "0.7462584", "text": "def total(array)\n\treturn array.inject { |sum, x| sum + x }\nend", "title": "" }, { "docid": "e882aad5b028c9376b2df67db4b8c444", "score": "0.74615353", "text": "def sum(anArray)\n total = 0\n anArray.each{ | val | total = total + val}\n return total\nend", "title": "" }, { "docid": "4cc8802cf348cf105d13cf30c45aa673", "score": "0.7460848", "text": "def total(array) \n\tsum = 0\n\ti = 0\n\tfor i in 0.. array.length\n\tarray.each { |i| sum += i}\n\treturn sum\nend\nend", "title": "" }, { "docid": "14f3877a769f28f540aed1cc134c0cd7", "score": "0.74592423", "text": "def sum_of array\n# add the numbers of the array, these are three different ways I found\n array.inject{ |sum, value| sum += value}\n # or\n # array.map(&:to_i).reduce(0, :+)\n # or\n # array.sum\nend", "title": "" }, { "docid": "aab4ddac7356cb5c9a55733534c534d0", "score": "0.745725", "text": "def total(array)\n\ttotal = 0\n\tarray.each do |n|\n\t\ttotal += n \n\tend\n\treturn total\nend", "title": "" }, { "docid": "7bf00f85fa3ec34c9b3d4c6dcc88338a", "score": "0.7456701", "text": "def sum_array(numbers)\n total = 0\n for number in numbers\n total = total + number\n end\n return total\nend", "title": "" }, { "docid": "9d678e0b4ce5de95b1efbd9faae03d99", "score": "0.74514747", "text": "def sum_only_numbers(an_array)\n if an_array.length == 0\n \treturn 0\n end\n if an_array[0].is_a?(Numeric)\n \tan_array[0] + sum_only_numbers(an_array.drop(1))\n else\n \tsum_only_numbers(an_array.drop(1))\n end\n\nend", "title": "" }, { "docid": "3850364931dcc037d0c5aa19079f98fb", "score": "0.7450279", "text": "def simpleArraySum(ar)\n return ar.map(&:to_i).sum\nend", "title": "" }, { "docid": "7518828a70c5c589a8a16e88f3b775f8", "score": "0.74474925", "text": "def sumArray(array)\n sum = 0\n array.each do\n |n|\n sum += n.to_i\n end\n puts \"Somme : #{sum}\"\nend", "title": "" }, { "docid": "7f4c72613ece52251e08146dcec4b1db", "score": "0.7447434", "text": "def total(array)\n sum = 0\n array.each do |number|\n sum = sum += number\n end\n sum\nend", "title": "" }, { "docid": "57de19bf293ac9d681198c7cc32d7b63", "score": "0.74449736", "text": "def sum_array(array)\n array.reduce(:+)\nend", "title": "" }, { "docid": "a4ad87d969ef5fdbd2123d90e593f999", "score": "0.74419194", "text": "def total(array)\n sum = 0\n array.each do |n|\n sum += n\n end\n sum\nend", "title": "" }, { "docid": "3f1df485e4344d1d48eba32e1ef24146", "score": "0.74399817", "text": "def sumCheck(array)\r\n arraySum = 0\r\n for i in array\r\n arraySum += i\r\n end\r\n return arraySum\r\nend", "title": "" }, { "docid": "89c48e634d0bc657c1898e968d80ec4e", "score": "0.74369395", "text": "def multi_dimensional_sum(array)\n while !array.all? { |el| el.is_a?(Numeric) }\n array = unpack(array)\n end\n return array.sum\nend", "title": "" }, { "docid": "bd72baf093bb57bbd554c2dc3829c903", "score": "0.7435395", "text": "def total(array)\nsum = 0 \n\tarray.each do |num|\n\tsum += num \n\tend \n\treturn sum\nend", "title": "" }, { "docid": "96b80adf51ee20df3a4c11b74c8b149b", "score": "0.7434344", "text": "def total array\n\tsum = 0\n\tarray.each do |x|\n\t\tsum = sum + x\n\tend\n\treturn sum\nend", "title": "" }, { "docid": "353de4b0e040214bd8be5cbc68a2c1a1", "score": "0.74290353", "text": "def sum_array(int_array)\n int_array.reduce(:+)\nend", "title": "" }, { "docid": "80e55cef50b17b3ea77104060a666adc", "score": "0.74265844", "text": "def total(array)\n\tarray.inject do |sum, i| sum + i\n\tend\nend", "title": "" }, { "docid": "1d57fd7ba1b810904629f245cf41b355", "score": "0.74244463", "text": "def total(array)\n\ttotal = 0\n\tarray.each do |x|\n\t\ttotal += x\n\tend\n\treturn total\nend", "title": "" }, { "docid": "07b58c05f9151a9987d2daf5b1e4c352", "score": "0.7424009", "text": "def total(array)\n\tarray.inject {|sum,n| sum + n}\n\tend", "title": "" }, { "docid": "296c6d47e63942731f004bca34b6bb22", "score": "0.7422582", "text": "def total(array)\n\tarray.inject { |sum, x| sum + x }\nend", "title": "" }, { "docid": "50bcb998c258d1705218d9cc8ced6ce7", "score": "0.7421863", "text": "def sum_array (arr)\n result = 0\n arr.each do |value|\n result +=value\n end\n result\nend", "title": "" }, { "docid": "0a8edba1cf5df74eea3addbcb56bfc68", "score": "0.7419371", "text": "def sum(array)\n array.reduce(0) {|base, ele|\n base+=ele\n }\n end", "title": "" }, { "docid": "dbfade62e96232c4544471b00043bc5d", "score": "0.74158823", "text": "def total(my_array)\n result=0\n my_array.each { |a| result= result + a }\n return result\n end", "title": "" }, { "docid": "c937f10f90a3ae2f1bbb3826856d87dd", "score": "0.74054", "text": "def total(array)\n\tsum = array.inject(0, :+)\nend", "title": "" }, { "docid": "986328a80b245289e7e0c75c10ef1203", "score": "0.74041945", "text": "def total(array)\n sum = 0\n array.each { |i| sum += i }\n return sum\nend", "title": "" }, { "docid": "6f642379ae0436e2a4edd29d3c86fed3", "score": "0.7403355", "text": "def sum_of_sums(array)\n\n sums_array = []\n\n sum = 0\n array.each do |value|\n sum += value\n sums_array << sum\n end\n \n sums_array.sum\nend", "title": "" }, { "docid": "81e5b2966261445979ee9b44c2232ced", "score": "0.7401053", "text": "def sum_only_numbers(an_array)\n\n count = 0\n an_array.map {|index| \n if index.is_a? Fixnum or index.is_a? Float\n count += index\n end\n }\n return count\n\nend", "title": "" }, { "docid": "26ad2522ea327004cfcd48f83a0cfc82", "score": "0.7379311", "text": "def simple_array_sum arr\n arr.reduce(:+)\n end", "title": "" }, { "docid": "b0c63390d1269ac139b0228a267aade5", "score": "0.7375947", "text": "def sum(array)\n sum = 0\n array.each { |n| sum += n } \n sum\nend", "title": "" }, { "docid": "5488e79db08751a4bef93ff175e632f7", "score": "0.73756516", "text": "def sum_array(arry)\n sum = 0\n arry.each do |num|\n # if num = num.to_i\n sum += num\n\n\n end\n sum\nend", "title": "" }, { "docid": "c8b3486c4f6622defedecd071678944e", "score": "0.73747015", "text": "def total(array)\n\tanswer=array.inject(0){\n\t\t|sum,i| sum+i\n\t}\n\treturn answer\nend", "title": "" }, { "docid": "df1ff11d8ef996160e5c7ca52d758b19", "score": "0.7372503", "text": "def total(array)\n \tsum = 0\n \tarray.each do |num|\n sum += num\n end\t\n return sum\n end", "title": "" } ]
af458f14b61a11e88f6d96bf186fde60
La fin est 120 => coef_time 120 = PFAWIDTH => coef_time = PFAWIDTH / 120
[ { "docid": "0b031de424cc8899c1e94dd44ef1a5e8", "score": "0.5772327", "text": "def coef_pixels\n @coef_pixels ||= (PFA::PFA_WIDTH - PFA::PFA_LEFT_MARGIN - PFA::PFA_RIGHT_MARGIN).to_f / 120\n end", "title": "" } ]
[ { "docid": "298bfc50cd1b78c74e587bcb3b9a2572", "score": "0.59912276", "text": "def coef_pixels\n @coef_pixels ||= (PFA_WIDTH - PFA_LEFT_MARGIN - PFA_RIGHT_MARGIN).to_f / 120\nend", "title": "" }, { "docid": "abf4bcb37eb66099eef467d1829f030e", "score": "0.5903533", "text": "def coef_time_to_pixels\n @coef_time_to_pixels ||= TIMELINE_WIDTH.to_f / @duree_film\n end", "title": "" }, { "docid": "7e21fc2b770c9b7607ef6deed7cfc36c", "score": "0.57059926", "text": "def coef_s2p\n coef_s2p ||= (CAL_WIDTH.to_f / periode)\n end", "title": "" }, { "docid": "c8be307df29c6fe202fac82080ee68ab", "score": "0.56079704", "text": "def regress degree\n x_data = @data_time.map { |x_i| (0..degree).map { |pow| (x_i**pow).to_f } }\n mx = Matrix[*x_data]\n my = Matrix.column_vector(@data_data_point)\n my_coefficients = ((mx.t * mx).inv * mx.t * my).transpose.to_a[0]\n return my_coefficients\n end", "title": "" }, { "docid": "5d7e0ea31ce998d612d09072bee8d346", "score": "0.5582649", "text": "def calcular_tf(ocurrencias)\n 10*ocurrencias.first +\n Math.log(1 + ocurrencias.second, 10) +\n Math.log(1 + ocurrencias.third, 2) +\n 10*ocurrencias.fourth\n end", "title": "" }, { "docid": "1fdcf16daf3bd80ccdf664dc5414df7b", "score": "0.55018085", "text": "def mat_rate; param_rate(4); end", "title": "" }, { "docid": "7d31eaa4927e236dbcd3a94ba43c50a2", "score": "0.54898226", "text": "def best_fit(time)\n\ttoday = Date.today.to_time.to_i\n\tmax_time = [today+46800, today+50400, today+54000]\n\tr2 = Array.new\n\tlinear_para = Array.new\n\tlog_para = Array.new\n\texpo_para = Array.new\n\n\t\n\tlinear_para[0],linear_para[1],r2[0] = linear\n\tpoly_para,r2[1],fit_degree = polynomial\n\tlog_para[0],log_para[1],r2[2] = logarithmic\n\tif !exponential_e.nil?\n\t\texpo_para[0],expo_para[1],r2[3] = exponential\n\tend\n\tfit_r2,fit_index = r2_fit(r2)\n\tif fit_index == 0\n\t\tmax_l = 0\n\t\tmax_time.map do |t|\n\t\t\tif linear_para[0] * t + linear_para[1]>max_l\n\t\t\t\tmax_l = linear_para[0] * t + linear_para[1]\n\t\t\tend\n\t\tend\n\t\ttime_period = linear_para[0] * time + linear_para[1]\n\t\treturn time_period/max_l, max_l\n\t\t#return max_l\n\telsif fit_index == 1\n\t\tpart_equ = Array.new\n\t\tmax_p = 0\n\t\tmax_time.map do |t|\n\t\t\tfor i in 0..fit_degree\n\t\t\t\tif poly_para[i].round(2) != 0\n\t\t\t\t\tif i == 0\n\t\t\t\t\t\tpart_equ << poly_para[i].round(2)\n\t\t\t\t\telsif i == 1\n\t\t\t\t\t\tpart_equ << poly_para[i].round(2)*t\n\t\t\t\t\telse part_equ << poly_para[i].round(2)*(t**fit_degree)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\tif part_equ.inject(:+) > max_p\n\t\t\t\tmax_p = part_equ.inject(:+)\n\t\t\tend\n\t\tend\n\t\tfor i in 0..fit_degree\n\t\t\tif poly_para[i].round(2) != 0\n\t\t\t\tif i == 0\n\t\t\t\t\tpart_equ << poly_para[i].round(2)\n\t\t\t\telsif i == 1\n\t\t\t\t\tpart_equ << poly_para[i].round(2)*time\n\t\t\t\telse part_equ << poly_para[i].round(2)*(time**fit_degree)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\ttime_period = part_equ.inject(:+)\n\t\treturn time_period/max_p, max_p\n\t\t#return max_p\n\telsif fit_index == 2\n\t\tmax_log = 0\n\t\tmax_time.map do |t|\n\t\t\tif log_para[1] + log_para[0]*Math.log(t)>max_log\n\t\t\t\tmax_log = log_para[1] + log_para[0]*Math.log(t)\n\t\t\tend\n\t\tend\n\t\ttime_period = max_log = log_para[1] + log_para[0]*Math.log(time)\n\t\treturn time_period/max_log, max_log\n\t\t#return max_l\n\telsif fit_index == 3\n\t\tmax_e = 0\n\t\tmax_time.map do |t|\n\t\t\tif expo_para[0]*Math.exp(expo_para[1]*t)>max_e\n\t\t\t\tmax_e = expo_para[0]*Math.exp(expo_para[1]*t)\n\t\t\tend\n\t\tend\n\t\ttime_period = expo_para[0]*Math.exp(expo_para[1]*time)\n\t\treturn time_period/max_e, max_e\n\t\t#return max_e\n\tend\n\t#return equation[fit_index]\nend", "title": "" }, { "docid": "32fac8db475791cbd4a5170f72322a6d", "score": "0.5404168", "text": "def calc_pfw_06\n gam_b = ( -0.052928 + \\\n ( 10.556378 + \\\n ( 0.4932044 + \\\n ( -0.00031238 + \\\n ( -0.000002788 + \\\n ( 0.0000000260) \\\n * @t) * @t) * @t) * @t) * @t) * AS2R\n phi_b = (84381.412819 + \\\n ( -46.811016 + \\\n ( 0.0511268 + \\\n ( 0.00053289 + \\\n ( -0.000000440 + \\\n ( -0.0000000176) \\\n * @t) * @t) * @t) * @t) * @t) * AS2R\n psi_b = ( -0.041775 + \\\n ( 5038.481484 + \\\n ( 1.5584175 + \\\n ( -0.00018522 + \\\n ( -0.000026452 + \\\n ( -0.0000000148) \\\n * @t) * @t) * @t) * @t) * @t) * AS2R\n return [gam_b, phi_b, psi_b]\n rescue => e\n raise\n end", "title": "" }, { "docid": "5249c225978da69bf147c34e5aa4b370", "score": "0.5275441", "text": "def t90 res\n w = res / rtpw\n Its90Function.t90r w - wdev(Its90Function.t90r w)\n end", "title": "" }, { "docid": "df50478234b2da4ec507fa98ef2dff27", "score": "0.5251947", "text": "def projected_time value\n (value - regression[:y_intercept]) / regression[:slope]\n end", "title": "" }, { "docid": "12461b28260d20f36fe69a7951f8adab", "score": "0.5240349", "text": "def time_factor\n (1.0 - Math.exp((-0.04 * send(:boil_time_minutes)))) / 4.15\n end", "title": "" }, { "docid": "f1f9133fef398bf239948531d2aa3e48", "score": "0.5233557", "text": "def con_intercept(pt, dt, pb, m, n)\n ((dt ** (m + n) * pb ** m) / pt**m) ** (1 / (n + 1))\nend", "title": "" }, { "docid": "9c98dff7dad2168819df0c8414a9d5ac", "score": "0.522393", "text": "def ctof(ctemperature)\n (ctemperature * 1.8)+32\nend", "title": "" }, { "docid": "7ee063f85dfd9d86d5a00b65c609ec53", "score": "0.52041984", "text": "def ctof(c_degree)\n\n\t(c_degree * 9.0 / 5.0) + 32.0\n\nend", "title": "" }, { "docid": "438913dd5205ceae8795d7bcd9b0fc4a", "score": "0.5182696", "text": "def ctof(ctemp)\n temp_fahrenheit = (ctemp * 1.8) + 32\nend", "title": "" }, { "docid": "0e93ec73d9345f2f2d88cc91a46f25a6", "score": "0.5172893", "text": "def coef\n self.max/Math.sqrt(self.optical_length)\n end", "title": "" }, { "docid": "800a9392a882c59aeeaa198fd5be570d", "score": "0.51680595", "text": "def ctof(temp_c)\n #formula\n (temp_c * 1.8) + 32\nend", "title": "" }, { "docid": "d367a044492401b8e9056d52240c84fa", "score": "0.51578504", "text": "def predictions location, period\n\n\n @latitude = location\n @longitude #= store longitude here\n\n @current_time.to_i.downto(@time.to_i) do |i|\n if (current_time.to_i - i) % (10*60) == 0\n @x_data << i\n @forecast = ForecastIO.forecast(@latitude,@longitude,time: i.to_i)\n @temperature << @forecast.currently.temperature\n @rainfall << @forecast.currently.precipIntensity\n @wind_speed << @forecast.currently.windSpeed\n @wind_direction << @forecast.currently.windBearing\n end\n end\n\n coeff_temp = regress(@x_data, @temperature, 1)\n coeff_rain = regress(@x_data, @rainfall, 1)\n coeff_ws = regress(@x_data, @wind_speed, 1)\n coeff_wd = regress(@x_data, @wind_direction, 1)\n\n\n (0..@period).step(10).each do |n|\n coeff_temp.each_with_index do |c,i|\n temp1 << c*((current_time.to_i + n*60)**i)\n end\n @forecast_temp << temp1.reduce(:+)\n @probability_temp << probability_of_success(temp1.reduce(:+))\n\n coeff_rain.each_with_index do |c,i|\n temp2 << c*((current_time.to_i + n*60)**i)\n end\n @forecast_rain << temp2.reduce(:+)\n @probability_rain << probability_of_success(temp2.reduce(:+))\n\n coeff_ws.each_with_index do |c,i|\n temp3 << c*((current_time.to_i + n*60)**i)\n end\n @forecast_ws << temp3.reduce(:+)\n @probability_ws << probability_of_success(temp3.reduce(:+))\n\n coefficients.each_with_index do |c,i|\n temp4 << c*((current_time.to_i + n*60)**i)\n end\n @forecast_wd << temp4.reduce(:+)\n @probability_wd << probability_of_success(temp4.reduce(:+))\n end\n\n @forecast_wd = Datum.getWindDirectionS(@forecast_wd)\n\n prediction_data = Datum.create(:temperature_predictions => @forecase_temp\n :temp_prob => @probability_temp\n :rainfall_predictions => @forecast_rain\n :rain_prob => @probability_rain\n :wind_speed_predicitons => @forecast_ws\n :winds_prob => @probability_ws\n :wind_dir_predictions => @forecast_wd\n :windd_prob => @probability_wd)\nend", "title": "" }, { "docid": "1e126d4c18400bf9980e2a23cb54e35b", "score": "0.51376367", "text": "def reaping_frequency; end", "title": "" }, { "docid": "11a87906d64fe7364724faa2242f396d", "score": "0.5126721", "text": "def ctof(temp_cel)\n\ttemp_cel*180.0/100 +32\nend", "title": "" }, { "docid": "43c0dadd6ae3ad4d070f167d52886a12", "score": "0.5121092", "text": "def ftoc(temp_in_f)\n (temp_in_f - 32) * 5.0/9.0\nend", "title": "" }, { "docid": "7401cd49e47961508efca94d3c73be80", "score": "0.5102058", "text": "def regula_falsi(a, b)\n @tolerance = 12\n @x = nil\n i = 1\n\n while @tolerance > 0.005 do\n if @x.nil?\n @x = (a*f(b) - b*f(a)) / (f(b) - f(a))\n else\n @x = (@prev_x * f(b) - b*f(@prev_x)) / (f(b) - f(@prev_x))\n end\n @eff_x = f(@x)\n puts \"X#{i} = #{@x.round(5)}\"\n puts \"f(X#{i}) = #{@eff_x}\"\n unless @prev_x.nil?\n @tolerance = (@x - @prev_x).abs.round(5)\n end\n unless @tolerance == 12\n puts \"Tolerance: #{@tolerance}\"\n end\n @prev_x = @x\n i += 1\n end\n\n @prev_x\nend", "title": "" }, { "docid": "2a19d352c33b9c575f6ee10078df96c6", "score": "0.5077042", "text": "def projected_value time\n regression[:slope] * time + regression[:y_intercept]\n end", "title": "" }, { "docid": "df1ab3c8d27358fab7053438f7b989a9", "score": "0.50727075", "text": "def ftoc(f_degree)\n\n\t(f_degree - 32.0) * 5.0 / 9.0\n\nend", "title": "" }, { "docid": "a22dbfd25237b1726e9a1d1184b2270f", "score": "0.50683856", "text": "def error_bound\n # the last known phase offset\n # the last known phase offset error\n # the last known frequency error\n # time since the last frequency measurement\n # clock variability assumption\n end", "title": "" }, { "docid": "b875a15b78334d429f4e2265d2dd65ea", "score": "0.5018622", "text": "def ftoc(temp_in_celsius)\n\t(temp_in_celsius - 32) * (5.0/9.0)\nend", "title": "" }, { "docid": "6a0110c888cc9a31e72c2b946024b68d", "score": "0.50128293", "text": "def calc_time_vars\n a_vals_arr = []\n @node_data.each_row do |node|\n a_vals_arr << node[0]\n end\n @input_list.each do |input_set|\n input_set.each_row do |node|\n a_vals_arr << node[0]\n end\n end\n\n freq_vals = a_vals_arr.to_gv.sqrt/(2*GSL::M_PI)\n ones = GSL::Vector.alloc(freq_vals.len).set_all(1)\n quotients = ones/(2*freq_vals)\n min_quotient = quotients.min\n periods = quotients*2 \n max_period = periods.max\n\n return @t_step_param*min_quotient, ((max_period*@num_evals_param).round-1)\n end", "title": "" }, { "docid": "79d6f9e2bc14260443e136c06ebcdd7c", "score": "0.5012669", "text": "def ftoc(temp)\r\n (temp.to_f - 32.0) * (5.0/9.0)\r\nend", "title": "" }, { "docid": "d2b1ab7fad478d08c45551f652e806af", "score": "0.49967086", "text": "def ftoc(temp_f)\n #formula\n (temp_f-32) * (5/9.0)\nend", "title": "" }, { "docid": "18ce04a87e17b55b38480565222bb176", "score": "0.49889156", "text": "def ftoc (tf)\n\t((tf - 32)/1.8).round(2)\n\tend", "title": "" }, { "docid": "49c8ec994905d31b4fb196af51fd0b1e", "score": "0.49850804", "text": "def ctof(temp_in_farenheit)\n\t(temp_in_farenheit * (9.0/5.0)) + 32\nend", "title": "" }, { "docid": "fd208640d6b987bee29cb38b27388185", "score": "0.4956476", "text": "def ftoc(temp_f)\n\t (temp_f - 32)*(5/9.0)\n\t\t\n\tend", "title": "" }, { "docid": "6ef2c2604ed7b50f13fbe128d4ea9335", "score": "0.49541682", "text": "def ftoc( temp )\n ( temp * 9.0 / 5.0 ) + 32.0\n end", "title": "" }, { "docid": "f0af787ea3a4abb6bc26007b64e3d25f", "score": "0.49478236", "text": "def NPV \n npv = 0;\n rate = @i / 100.0;\n j = 0\n while j < @periodCounter\n val = @cfi[j] / (1+rate)**j\n npv = npv + val\n j = j+1\n end\n return npv\n end", "title": "" }, { "docid": "24331d1998127a87133dad7701282569", "score": "0.49413136", "text": "def ftoc temp\n\t(temp - 32.0) * (5.0 / 9.0) \nend", "title": "" }, { "docid": "97e40074471ff81bbfbe695c904a6711", "score": "0.49314535", "text": "def ctof\n ( @celsius * ( 9.0 / 5.0 )) + 32\n end", "title": "" }, { "docid": "658d3eef93272196757679ca67876519", "score": "0.49161023", "text": "def ctof (temp)\n temp * 9.0/5.0 + 32.0\nend", "title": "" }, { "docid": "464617ceb1e307c2eb99cb967efe91b5", "score": "0.4911192", "text": "def poly_reg degree\n x_data = @x_array.map { |x_i| (0..degree).map { |pow| (x_i**pow).to_f } }\n mx = Matrix[*x_data]\n my = Matrix.column_vector(@y_array)\n @coefficients = ((mx.t * mx).inv * mx.t * my).transpose.to_a[0]\n end", "title": "" }, { "docid": "3a7618bbbab6b8c114f422cacaec19db", "score": "0.49092022", "text": "def bugfix_coeficient(unestimated, estimated)\n unestimated / estimated\nend", "title": "" }, { "docid": "3f7792f9ee6fdeaddaf06a6c38fc9cbf", "score": "0.48997957", "text": "def ctof(temp)\n\ttemp * 9.0 / 5.0 + 32\nend", "title": "" }, { "docid": "70efa8ab78148626232df6d4e0f6f73b", "score": "0.48919758", "text": "def pro_forma_cap_rate\n\t\t(noi / arv * 100).round(2)\n\tend", "title": "" }, { "docid": "dc06e354d62ba10a798e2a97a40d4909", "score": "0.4887486", "text": "def vampire_rate; features_sum(:vampire_rate)/100.0; end", "title": "" }, { "docid": "92ee483a607dc208b6f43870c96b607b", "score": "0.488446", "text": "def futurevalue (pv, r, i)\n fv = pv.to_f * (1+(r.to_f / 100)) ** i.to_f\n puts fv.to_f\nend", "title": "" }, { "docid": "e1df5fd29ced6098a28999746cea2586", "score": "0.48584002", "text": "def ctof( temp )\n ( temp - 32.0 ) * 5.0 / 9.0\n end", "title": "" }, { "docid": "2d253fe9db27cbf9ad9ecd690522ff17", "score": "0.48569244", "text": "def mdf_rate; param_rate(5); end", "title": "" }, { "docid": "fb20766cc3d35a7f1a10350b7100d957", "score": "0.48545504", "text": "def ftoc(ftemp)\n\treturn (ftemp-32) * 5.0/9.0 \nend", "title": "" }, { "docid": "b78af33c84f2f4da7abf1aa0167518c7", "score": "0.4846039", "text": "def mmp_rate; param_rate(1); end", "title": "" }, { "docid": "86397756a63a5aba75af000ebee46722", "score": "0.48435867", "text": "def step_divisor; 10 + features_sum(:anger_mantain); end", "title": "" }, { "docid": "7d65541c761bb5a89b54f29a0c5e455d", "score": "0.48380128", "text": "def ctof(temp)\n\t((temp * 9.0)/5.0) + 32\n\tend", "title": "" }, { "docid": "76f96a46aa41da9f5f3fbaa870bcecb2", "score": "0.48331836", "text": "def ctof (temp)\n (temp * 9.0 / 5.0) + 32.0\nend", "title": "" }, { "docid": "c7000f3233d521c94a9e0c5b2daa932b", "score": "0.48222166", "text": "def ftoc(f)\n((f.to_f - 32)/ 1.8).round(1)\nend", "title": "" }, { "docid": "ffcf47b2b7e9e6427686863f275946c0", "score": "0.48116642", "text": "def p(t)\n p0 = 5.0\n k = 7.0 * (10 ** 3)\n r = 0.05\n (k * p0 * Math.exp(r*t)) / (k + p0 * (Math.exp(r*t) - 1.0))\nend", "title": "" }, { "docid": "2f163ce7a20701fe56420510d5583b68", "score": "0.48073223", "text": "def speed_of_spread #in months\r\n # We are still perfecting our formula here. The speed is also affected\r\n # by additional factors we haven't added into this functionality.\r\n timescale = 0.0\r\n\r\n if @population_density >= 200\r\n timescale += 0.5\r\n elsif @population_density >= 150\r\n timescale += 1\r\n elsif @population_density >= 100\r\n timescale += 1.5\r\n elsif @population_density >= 50\r\n timescale += 2\r\n else\r\n timescale += 2.5\r\n end\r\n\r\n end", "title": "" }, { "docid": "0ae7ba7935d58cdd8e44f02448883fe0", "score": "0.47962305", "text": "def corrected_mom_flux_stav\n\tpar_mom_flux_stav - perp_mom_flux_stav\nend", "title": "" }, { "docid": "8c35b2f44bf7fbdf954515a26528baf6", "score": "0.47924152", "text": "def ftoc temp \n (temp - 32) * (5/9r)\nend", "title": "" }, { "docid": "f3631df25c60136686da71612ddf769c", "score": "0.47918725", "text": "def ctof(temp)\r\n ((temp.to_f * 9.0)/5.0) + 32.0\r\nend", "title": "" }, { "docid": "350faefcf0c64f22a775e120fa96bac2", "score": "0.47895247", "text": "def ctof(temp)\n\ttemp = ((temp * 1.8)+32)\n\tend", "title": "" }, { "docid": "f6ce025bb6a7f18da7506b0fe4291ad5", "score": "0.47766185", "text": "def ftoc(temp) \n (temp - 32.0) * 5.0 / 9.0\nend", "title": "" }, { "docid": "4ae720444b79b1151d1206a7606421de", "score": "0.47752503", "text": "def ctof(temp)\n temp*1.8 + 32\nend", "title": "" }, { "docid": "13ed303b85df1d4b69407d775da2e189", "score": "0.47737736", "text": "def time_period_v3(pendulum_length)\n return 2 * Math::PI * ((pendulum_length / FREE_FALL_ACCELERATION) ** 0.5)\n end", "title": "" }, { "docid": "21f32b24b56028a987c95bd373ef8a11", "score": "0.4770688", "text": "def mhp_rate; param_rate(0); end", "title": "" }, { "docid": "6c2b2661c96e06a3808b7c401918dbb5", "score": "0.4767355", "text": "def hflux_tot_vs_time_graphkit\nend", "title": "" }, { "docid": "0f4352c5973944f77a5e80d9f378c8b5", "score": "0.47664633", "text": "def ftoc(temp)\n (temp - 32) * 5.0/9.0\nend", "title": "" }, { "docid": "378e797d087801bf2395a4d180feb7e5", "score": "0.4760957", "text": "def SPL_Thresh(freq)\n a = 3.6 * (freq ** -0.8)\n b = 6.5 * (Math::E ** (-0.6 * ((freq - 3.3) ** 2) ))\n c = 0.001 * (freq ** 4)\n\n a - b + c\n end", "title": "" }, { "docid": "4562d71e21ff8a964bca4ec6e23493f5", "score": "0.47569507", "text": "def ctof (celcius)\n return (celcius.to_f*9/5) + 32\nend", "title": "" }, { "docid": "d4a2e3a7c6a5b32222d6a9ee069360c1", "score": "0.47498402", "text": "def ctof(temp)\n temp * 1.8 + 32\nend", "title": "" }, { "docid": "19a8a77bafd2168ac796a18838dbf38e", "score": "0.47474062", "text": "def impulse_v1(force, time)\n return force * time.to_f\n end", "title": "" }, { "docid": "f9450c614ad327ad2bb87b39a1f9d1d8", "score": "0.47377118", "text": "def sec_fraction; end", "title": "" }, { "docid": "f9450c614ad327ad2bb87b39a1f9d1d8", "score": "0.47377118", "text": "def sec_fraction; end", "title": "" }, { "docid": "6d1c7e70cf20eb10328cf2d577f7389c", "score": "0.47367546", "text": "def ftoc(temp)\n\t( temp - 32 ) * ( 5.0 / 9.0 )\nend", "title": "" }, { "docid": "66f6f7ec31a05af37ec8ebaa04c49f00", "score": "0.47291312", "text": "def update_pis\n new_pis = []\n 20.times {|i|\n res = 0\n @ys.each_with_index {|yt, t|\n res += (yt * @xs[t][i] * @pis[i]) / compute_noisy_or(t)\n }\n new_pis << res / @tis[i].to_f\n }\n\n return new_pis\nend", "title": "" }, { "docid": "7e73932b5a4e5d388fb811a84af25f1c", "score": "0.47280565", "text": "def ftoc(temp)\n\t(temp - 32) * 5.0 / 9.0\nend", "title": "" }, { "docid": "5ccdd3392a1f508cbce354814ed27f5f", "score": "0.47278577", "text": "def ftoc(temp)\n (temp-32) / 9 * 5.0\n end", "title": "" }, { "docid": "900bcc490c21698e2b0b8662ecfa93f4", "score": "0.4727328", "text": "def mhistslope(options={})\n options.reverse_merge!(:signal_period => 9, :time_period => 5)\n idx_range = calc_indexes(:ta_macdfix_lookback, options[:signal_period])\n result = Talib.ta_macdfix(idx_range.begin, idx_range.end, price, options[:signal_period])\n tp = options[:time_period]\n hist_vec = result.last\n len = hist_vec.len\n roc = hist_vec[tp..len-1] / hist_vec[0..len-tp-1]\n ones = GSL::Vector.indgen(roc.len, 1, 0)\n flags = roc.gt(ones).where { |e| e == 1 }\n flags && flags[0]\n end", "title": "" }, { "docid": "dbb0a31e012e35c486b365d9eb8da530", "score": "0.47195753", "text": "def ctof(temp)\n (temp * 1.8) + 32\nend", "title": "" }, { "docid": "bbde56897a8d2b45a1a5fc335496dab1", "score": "0.4715525", "text": "def ftoc(f_temperature)\n (f_temperature - 32) * (5.0/9.0)\nend", "title": "" }, { "docid": "d85bc456aae60b22b621fb0545a5a6ab", "score": "0.47142616", "text": "def mtf_freq; end", "title": "" }, { "docid": "5780039af86896af30fb167562078a2c", "score": "0.47101924", "text": "def validation_waveform\n\t\tfrequency = 0.1\n\t\tpoints = []\n\t\t1000.times do |index|\n\t\t\tvalue = Math.sin( 2 * Math::PI * frequency * index )\n\t\t\tpoints.push value \n\t\tend\n\t\treturn points\n\tend", "title": "" }, { "docid": "39e411a05bc556d876c77aadf5f1180c", "score": "0.47086087", "text": "def ftoc(tempInF)\n tempInC = (tempInF - 32) / 1.8\n return tempInC.round\nend", "title": "" }, { "docid": "7824993c2172cde76bd2035d4a0fcde7", "score": "0.47058907", "text": "def speed_of_spread #in months\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n @time_to_spread = 0.0\n\n if @population_density >= 200\n @time_to_spread += 0.5\n elsif @population_density >= 150\n @time_to_spread += 1\n elsif @population_density >= 100\n @time_to_spread += 1.5\n elsif @population_density >= 50\n @time_to_spread += 2\n else\n @time_to_spread += 2.5\n end\n end", "title": "" }, { "docid": "a2431d535b64bf9d5fdd37b6b07bf6b9", "score": "0.46918014", "text": "def coefficient\n percent / 100.0\n end", "title": "" }, { "docid": "1e76ace9e99e6090bc55fd12089843c9", "score": "0.46912822", "text": "def frequency\n regs=@spi.xfer(txdata: [Registers::FRF_MSB, 0,0,0])\n @frequency=(regs[1]<<16 | regs[2]<<8 | regs[3]) * FSTEP\n end", "title": "" }, { "docid": "6320f857638d5e674f83e079f0084dda", "score": "0.46886358", "text": "def speed_in_percent\n (@actual_framerate / @clip.rec_start_tc.fps) * 100\n end", "title": "" }, { "docid": "8563e749a1c5504d30abfe9ff7661585", "score": "0.46877795", "text": "def ctof(celsius); ((celsius.to_f * 1.8) + 32) end", "title": "" }, { "docid": "cef618212eef0a4cbe27c7d09d7a7fdb", "score": "0.46874648", "text": "def sec_fraction() time[3] end", "title": "" }, { "docid": "85ff0e50a024535a2337f75181118035", "score": "0.46850753", "text": "def ftoc(temp)\n c = (temp.to_f - 32) * 5/9\nend", "title": "" }, { "docid": "8beee3e17875dd8e222019f95ec6e32e", "score": "0.46809143", "text": "def opt_intercept(pt, dt, pb, m, n)\n et = pt * dt\n ((et**m * dt**n) / pb) ** (1 / (m * (n + 1)))\nend", "title": "" }, { "docid": "15f720c056793a82ffa9026235e55c1b", "score": "0.4675061", "text": "def reaping_time; end", "title": "" }, { "docid": "799880012175831b502c2dbfecf4ccd1", "score": "0.46715486", "text": "def ctof(temp)\n temp / (5.0/9.0) + 32\nend", "title": "" }, { "docid": "e93037c01257514a55fa5c3696d57869", "score": "0.4670307", "text": "def amp_reduce val\n toneparts.each { |tp| tp.amp_mult(1.0/val) }\n end", "title": "" }, { "docid": "ca4182329be15cea03ddfb3d8b83367a", "score": "0.46666163", "text": "def ftoc(farengate_temperature)\n #Using integer math\n (farengate_temperature - CELSIUS_AND_FARENGATE_NULL_KOEF) * FARENGATE_TO_CELSIUS_KOEF\nend", "title": "" }, { "docid": "f51be9dc11e33049ded13537dce7050a", "score": "0.46632805", "text": "def ctof (temp)\n\n (temp*1.8)+32\n\nend", "title": "" }, { "docid": "ae7bacbe3572ff1b5c8822e13a41803a", "score": "0.46588424", "text": "def imc\n (@peso / (@talla * @talla)).round(1)\n end", "title": "" }, { "docid": "7294ec56e097e9c0c793a35a78b83ce9", "score": "0.46583816", "text": "def proba_oo(user=nil) nb_presentation == 0.0 ? 0.0 : (nb_oo / nb_presentation) end", "title": "" }, { "docid": "cab76568fedeb0007bfc25e663770aa6", "score": "0.4657397", "text": "def coefficient_params\n params[:coefficient]\n end", "title": "" }, { "docid": "345f9af108c3ead057781bfb2ec3c78e", "score": "0.46572012", "text": "def ctof(temp)\n return ((temp * 1.8) + 32 )\nend", "title": "" }, { "docid": "9fda87207d62e0d50fc8fd0513e75998", "score": "0.465539", "text": "def ctof(temp)\n (temp * 9.0 / 5.0) + 32.0\nend", "title": "" }, { "docid": "1b63e62bf5e50069c82e9cf45050aed0", "score": "0.46495697", "text": "def out\n # puts \"out amp: #{amp.start}\"\n buffer_len = frames\n inc_x = 0.0\n data = WaveData.new\n lfreq = freq.start\n log \"tone starting with freq #{lfreq}\", 4\n lamp = amp.start\n wave_exp = wave.detail.exp\n freq_exp = freq.exp\n amp_exp = amp.exp\n wave_into=0\n while data.dps.count < buffer_len do\n wave_data = wave.out(lfreq, lamp, wave_into)\n data + wave_data\n inc_x += wave_data.count\n x = (inc_x.to_f / buffer_len)\n\n #freq\n freq_multiplier = x # when exp is off\n #fade exponentially if on.\n freq_multiplier = x ** (1.0 /((1.0/freq_exp)*x)) if freq_exp\n lfreq = freq.start + freq_multiplier*freq.final\n\n #amp\n amp_multiplier = x # when exp is off\n #fade exponentially if on.\n amp_multiplier = x ** (1.0 /((1.0/amp_exp)*x)) if amp_exp\n lamp = amp.start + amp_multiplier*amp.final\n\n #wave\n wave_into = x # when exp is off\n #fade exponentially if on.\n wave_into = x ** (1.0 /((1.0/wave_exp)*x)) if wave_exp\n\n end\n data.fit_to buffer_len\n data\nend", "title": "" }, { "docid": "d1f2f03c05694e378315f0ea3df89302", "score": "0.46456864", "text": "def reaping_time=(_arg0); end", "title": "" }, { "docid": "262b74957222be0c654b10224800706b", "score": "0.46327332", "text": "def getCoeff(i); end", "title": "" } ]
84fd84fb0553a77f0979a224fc4e7f37
Tricks `kerl` to looking for a `.kerlrc` file in Chef's cache
[ { "docid": "3da73a84cce45698a037f7fe9cdee183", "score": "0.5465498", "text": "def kerl_environment\n { 'HOME' => kerl_path }\n end", "title": "" } ]
[ { "docid": "cb3f2d3fac429823e7738d49e6a91208", "score": "0.6939817", "text": "def file_cache_path\n Chef::Config[:file_cache_path]\n end", "title": "" }, { "docid": "a395b7647f67d1847c3c40b460c8a2f9", "score": "0.61331254", "text": "def chef_config_path\n Berkshelf.root.join(\"spec/config/knife.rb\").to_s\n end", "title": "" }, { "docid": "cf29cacede61959c2bf72ab50c637c2d", "score": "0.5959081", "text": "def cached_installer_path\n \"./file_cache/installers/puppet-enterprise-#{pe_version}-el-7-x86_64.tar.gz\"\nend", "title": "" }, { "docid": "e30afa502e51d24a92dc5e26dea94e2a", "score": "0.59346575", "text": "def load_cloudflare_cookbook_gems\n return if defined? @@cloudflare_cookbook_gems_loaded\n chef_gem 'cloudflare' do\n action :install\n version '2.0.1'\n end\n require 'resolv'\n require 'cloudflare'\n @@cloudflare_cookbook_gems_loaded = true\nend", "title": "" }, { "docid": "5f4f5ea12a4b562ed24f77d045a748d6", "score": "0.5895312", "text": "def cache_file\n File.join(Rscons.application.build_dir, \".rsconscache\")\n end", "title": "" }, { "docid": "b24b82c079ac0c312cdd9f0058569807", "score": "0.5892631", "text": "def cache_path\n Pathname.new(File.expand_path(File.join(ChefCLI::Helpers.package_home, \"cache\")))\n .join(\".cache\", \"git\", Digest::SHA1.hexdigest(uri))\n end", "title": "" }, { "docid": "9b086ceb0050dd868790b35fee169d69", "score": "0.5852667", "text": "def system_cache_file\n @sysetm_cache ||= File.join(Gem.dir, \"source_cache\")\n end", "title": "" }, { "docid": "ed0719f88d485e23a8557a1f7a9cec0d", "score": "0.58493197", "text": "def cache_found\n found = true\n\n Open3.popen3('klist') do |stdin, stdout, stderr|\n found = false unless stderr.gets.nil?\n end\n\n found\n end", "title": "" }, { "docid": "03e32912c0d32b746df2706d0b035787", "score": "0.57697564", "text": "def activate_path\n ::File.join(kerl_erlang_path, 'activate')\nend", "title": "" }, { "docid": "c6c982ab3f5bb65f436ceda6bb7fc41a", "score": "0.57626534", "text": "def cache_path\n @cache_path ||= File.join(\"\", \"gko\", \"cache\", \"#{self.host}\")\n end", "title": "" }, { "docid": "79979ef06bab356aa25ac340845e9139", "score": "0.56769454", "text": "def cache\n @cache ||= Chef::Cache.new()\n end", "title": "" }, { "docid": "a6df7e355135915805491567d3c67245", "score": "0.5656251", "text": "def apply_config_settings\n cachedir = setting(:cachedir)\n if cachedir\n R10K::Git::Cache.settings[:cache_root] = cachedir\n end\n end", "title": "" }, { "docid": "fac6adf543cf39840b712a622c581953", "score": "0.5644541", "text": "def read_disk_cache\n\t\t\t\tif File.exists?(\"#{$cache_path}/#{@host}_disks.yaml\")\n\t\t\t\t\t\t@disks = YAML::load(File.read(\"#{$cache_path}/#{@host}_disks.yaml\"))\n\t\t\t\t\t\t$log.info \"Loaded cachefile for #{@host}.\"\n\t\t\t\telse\n\t\t\t\t\t\t$log.warn \"No cachefile found. Need to get a new one.\"\n\t\t\t\t\t\treturn false\n\t\t\t\tend\n\t\tend", "title": "" }, { "docid": "b5a5fcc087ff7ae0532c4063c960ef77", "score": "0.5644011", "text": "def client_cache_path\n File.expand_path '~/.zhangmen_cache'\n end", "title": "" }, { "docid": "027711338ed8591a7a51799949e1c552", "score": "0.5592896", "text": "def conf\n @c ||= JSON.load(File.read('/etc/knife-kvm/config.json'))\nend", "title": "" }, { "docid": "bc7256d9a5a7497a645cc39b4ac992d8", "score": "0.557366", "text": "def remote_cache_path\n File.join(shared_path, 'bundle', 'cache')\n end", "title": "" }, { "docid": "0c71f51fc62fb4859689a1f434307d93", "score": "0.5541111", "text": "def build_path\n \"#{Chef::Config['file_cache_path']}/nginx-#{new_resource.version}\"\n end", "title": "" }, { "docid": "b5e47efae2967a0e1998e63449856af4", "score": "0.55216265", "text": "def local_cookbook(name, path=nil)\n if path\n cookbook name, path: \"#{path}/#{name}\"\n else\n cookbook name, path: \"#{ENV['CHEF_REPO']}/cookbooks/#{name}\"\n end\nend", "title": "" }, { "docid": "3b8c1a47af8f821c9879edc6f3de152d", "score": "0.5518496", "text": "def cache config, name, path\n require 'fileutils'\n require 'pathname'\n name = name.to_s\n local = File.join(File.expand_path('~/.vagrant.d/cache'), config.vm.box, name)\n FileUtils.mkdir_p local\n config.vm.synced_folder local, path\nend", "title": "" }, { "docid": "3b8c1a47af8f821c9879edc6f3de152d", "score": "0.5518496", "text": "def cache config, name, path\n require 'fileutils'\n require 'pathname'\n name = name.to_s\n local = File.join(File.expand_path('~/.vagrant.d/cache'), config.vm.box, name)\n FileUtils.mkdir_p local\n config.vm.synced_folder local, path\nend", "title": "" }, { "docid": "1546146e977afc3e809df76aee9ad8cb", "score": "0.5516947", "text": "def cache_path\n Pathname.new(Berkshelf.berkshelf_path)\n .join('.cache', 'hg', Digest::SHA1.hexdigest(uri))\n end", "title": "" }, { "docid": "0876ca9340910762f6313b758e8c150b", "score": "0.54948944", "text": "def cache_path\n File.join @path, 'cache.ri'\n end", "title": "" }, { "docid": "1afbd06964fdde6e8fc0ce1b27ad2570", "score": "0.5481567", "text": "def cache_path\n return @cache_resources unless @cache_resources.nil?\n\n @cache_resources = Chef::Resource::Directory.new(::File.join(new_resource.cache_path), run_context)\n @cache_resources.recursive(true)\n\n return @cache_resources\n end", "title": "" }, { "docid": "e4b9c194db948ee1e73d2ed835864952", "score": "0.5477404", "text": "def berkshelf_path\n @berkshelf_path ||= File.expand_path(ENV[\"BERKSHELF_PATH\"] || \"~/.berkshelf\")\n end", "title": "" }, { "docid": "001296bb3088844f29d0327f764bc2ad", "score": "0.54742235", "text": "def cookbook\n @cookbook ||= CachedCookbook.from_path(path, name: name)\n end", "title": "" }, { "docid": "5ba5b3afc89ad38b6282d79fa280c8ed", "score": "0.54732454", "text": "def kak_spec_dir\n $kak_spec_dir ||= ENV[\"KAK_SPEC_DIR\"]\nend", "title": "" }, { "docid": "e7e6907b70e171b8c69b8119560cddd7", "score": "0.5466634", "text": "def already_cached?\n File.exist?(cached_installer_path) and File.zero?(cached_installer_path) == false\nend", "title": "" }, { "docid": "6d3a6c3979079d6535c49d75ee73ba4d", "score": "0.54628277", "text": "def cache_dir; end", "title": "" }, { "docid": "6d3a6c3979079d6535c49d75ee73ba4d", "score": "0.54628277", "text": "def cache_dir; end", "title": "" }, { "docid": "22850fa3b6df42f9ea35bb3b590fea65", "score": "0.54583544", "text": "def cache_path\n @cache_path ||= Pathname.new(Berkshelf.berkshelf_path).join('.cache', 'halite', dependency.name)\n end", "title": "" }, { "docid": "2b757f23289e61995b2f0c882e67b882", "score": "0.5441831", "text": "def client_cache\n if File.exist? client_cache_path\n YAML.load(File.read(client_cache_path)) || {} rescue {}\n else\n {}\n end\n end", "title": "" }, { "docid": "0f96ce64d29fb2c416dac4e77883d84e", "score": "0.54301363", "text": "def local_cache_path\n File.join(tmp_path, 'bundle_cache')\n end", "title": "" }, { "docid": "b8e0d26decc5441017ce667e16fd3c0e", "score": "0.5422707", "text": "def trust_cache?\n !node['cloudflare']['threat_control']['disable_cache'] \\\n && !Chef::Config[:solo]\nend", "title": "" }, { "docid": "729e116344ab8941c1ed458120530c1e", "score": "0.5418408", "text": "def user_cache_file\n @user_cache ||=\n\tENV['GEMCACHE'] || File.join(Gem.user_home, \".gem/source_cache\")\n end", "title": "" }, { "docid": "98fecbeb7ac84ebeeae9af8571fc9bec", "score": "0.54132545", "text": "def chef_config\n ci = @json.split('/').last.gsub('.json', '')\n \"#{prefix_root}/home/oneops/#{@circuit}/components/cookbooks/\" \\\n \"chef-#{ci}.rb\"\n end", "title": "" }, { "docid": "b1b87c87ca0d828eb56d5ce16a6e902e", "score": "0.5407063", "text": "def cache_file\n @cache_file ||= File.join cache_dir, \"#{full_name}.gem\"\n end", "title": "" }, { "docid": "1191ddf87948f475bbf6688a3cb81328", "score": "0.5399164", "text": "def chef_repo_path\n File.join(ENV['HOME'], '.kitchen', \"pantry_#{config[:port]}\")\n end", "title": "" }, { "docid": "c126b62ad52d3c35570f2cdbe0375139", "score": "0.5395565", "text": "def cache_path\n home = ENV['HOME']!=nil ? ENV['HOME'] : ''\n return \"#{home}/.jx/repository/#{to_s}/\"\n end", "title": "" }, { "docid": "0bb1f042a1aacb9c759e643aef36d9d4", "score": "0.5392226", "text": "def install_lazyk(prefix)\n cookbook_file \"#{Chef::Config[:file_cache_path]}/lazy.cpp\" do\n user 'root'\n group 'root'\n mode '0644'\n not_if \"test -e #{prefix}/bin/lazyk\"\n end\n\n bash \"install-lazyk\" do\n user 'root'\n cwd Chef::Config[:file_cache_path]\n code <<-EOH\n set -ex\n mkdir -p #{prefix}/bin\n g++ lazy.cpp -o #{prefix}/bin/lazyk\n EOH\n not_if \"test -e #{prefix}/bin/lazyk\"\n end\nend", "title": "" }, { "docid": "872c0743fa6ece10caa08c27b9a79569", "score": "0.5375368", "text": "def cache_dir\n '/var/cache'\n end", "title": "" }, { "docid": "872c0743fa6ece10caa08c27b9a79569", "score": "0.5375368", "text": "def cache_dir\n '/var/cache'\n end", "title": "" }, { "docid": "6c9f0b4aad310f4ffcbdd5f366a80d7f", "score": "0.5370838", "text": "def cb_local_lookup(cb_name)\n full_path = File.expand_path(\"#{$opts[:repo]}/#{cb_name}\")\n if File.exists?(\"#{full_path}/metadata.rb\")\n version = (`grep '^version' #{full_path}/metadata.rb`)\n else\n return -1\n end\n version.split(' ').last.gsub('\"','').gsub('\\'','').chomp\nend", "title": "" }, { "docid": "9299e60c18bb36b372627fe0523766ac", "score": "0.53454244", "text": "def reload_configs\n Berkshelf.chef_config = chef_config\n\n # This fucking sucks...\n # load 'berkshelf/chef/config.rb'\n load \"berkshelf/config.rb\"\n\n Berkshelf.config = Berkshelf::Config.new\n nil\n end", "title": "" }, { "docid": "ae99ca2a158001c060922a23246a8074", "score": "0.53443605", "text": "def load_irbrc(path)\n return if (path == ENV['HOME']) || (path == '/')\n\n load_irbrc(File.dirname path)\n irbrc = File.join(path, '.irbrc')\n load irbrc if File.exists?(irbrc)\nend", "title": "" }, { "docid": "105b16cc56b7b6a21cb7248fe34f5a91", "score": "0.53418946", "text": "def local_cache(box_name, cache_name)\r\n cache_dir = File.join(File.expand_path(\"~/.vagrant.d\"), \"cache\", cache_name, box_name)\r\n if cache_name == \"apt\"\r\n partial_dir = File.join(cache_dir, \"partial\")\r\n FileUtils.mkdir_p(partial_dir) unless File.exists? partial_dir\r\n end\r\n cache_dir\r\nend", "title": "" }, { "docid": "8079bbe81398e060370bcb0af3073fdf", "score": "0.5334524", "text": "def chef_config_path\n if Chef::Config['config_file']\n ::File.dirname(Chef::Config['config_file'])\n else\n raise(\"No chef config file defined. Are you running \\\nchef-solo? If so you will need to define a path for the ohai_plugin as the \\\npath cannot be determined\")\n end\n end", "title": "" }, { "docid": "be47033e76727c550bc05439f8181874", "score": "0.53189594", "text": "def resolve_with_berkshelf\n Kitchen.mutex.synchronize do\n Chef::Berkshelf.new(berksfile, tmpbooks_dir,\n logger: logger,\n always_update: config[:always_update_cookbooks]).resolve\n end\n end", "title": "" }, { "docid": "01f3cf03e847398cf561f48f9d9827fb", "score": "0.5315032", "text": "def default_ktlint_path\n File.expand_path(File.join(File.dirname(__FILE__), 'bin', 'ktlint'))\n end", "title": "" }, { "docid": "889e88c127556bca5d472d74756c722d", "score": "0.52985287", "text": "def chef_config\n @chef_config ||= Berkshelf::ChefConfigCompat.new(ENV[\"BERKSHELF_CHEF_CONFIG\"])\n end", "title": "" }, { "docid": "91d484284842f8636c79715e48d06a63", "score": "0.5293556", "text": "def local_cache(box_name, hostname)\n cache_dir = File.join( File.expand_path(\"./vagrant_apt\"),\n 'cache',\n 'apt',\n box_name,\n hostname\n )\n\n partial_dir = File.join(cache_dir, 'partial')\n FileUtils.mkdir_p(partial_dir) unless File.exists? partial_dir\n cache_dir\nend", "title": "" }, { "docid": "c388592e5b8016749ebc8f5ef7da925a", "score": "0.5285708", "text": "def rc_dirs; end", "title": "" }, { "docid": "1e8a701127017258b9a74483136addec", "score": "0.5284235", "text": "def initialize(cache_path = Chef::Config[:syntax_check_cache_path])\n @cache_path = cache_path\n @cache_path_created = false\n end", "title": "" }, { "docid": "48e40e1d1b22478563682631ae0f90df", "score": "0.52692616", "text": "def chef_api_config_path\n ENV[\"CHEF_API_CONFIG\"] || if ENV.key?(\"HOME\")\n \"~/.chef-api\"\n else\n nil\n end\n end", "title": "" }, { "docid": "b3a94e9c930a14c307f73e3a20101aa2", "score": "0.5269097", "text": "def [](key)\n File.read(cache_path(key))\n rescue Errno::ENOENT\n nil\n end", "title": "" }, { "docid": "ad3778805462c65df91feff7d99e9ffe", "score": "0.5268314", "text": "def known_cookbook_paths\n # Keep a cache of it for performance.\n unless defined?(@cookbook_paths)\n config_file = \"#{@repository_path}/config.rb\"\n @cookbook_paths = (\n ['cookbooks'] +\n if File.exist?(config_file)\n # Read the knife configuration to get cookbook paths\n dsl_parser = DslParser.new\n dsl_parser.parse(config_file)\n cookbook_path_call = dsl_parser.calls.find { |call_info| call_info[:method] == :cookbook_path }\n cookbook_path_call.nil? ? [] : cookbook_path_call[:args].first\n else\n []\n end\n ).\n map do |dir|\n # Only keep dirs that actually exist and are part of our repository\n full_path = dir.start_with?('/') ? dir : File.expand_path(\"#{@repository_path}/#{dir}\")\n full_path.start_with?(@repository_path) && File.exist?(full_path) ? full_path.gsub(\"#{@repository_path}/\", '') : nil\n end.\n compact.\n sort.\n uniq\n end\n @cookbook_paths\n end", "title": "" }, { "docid": "1d215fb540e6e4b74096fabab08195c5", "score": "0.5267162", "text": "def acl_cache_path\n @acl_cache_path ||= if Smith.config.agency._has_key?(:acl_cache_path)\n Pathname.new(Smith.config.agency.acl_cache_path).tap { |path| check_path(path) }\n else\n cache_dir = Pathname.new(ENV['HOME']).join('.smith').join('acl')\n if cache_dir.exist?\n cache_dir\n else\n FileUtils.mkdir_p(cache_dir)\n cache_dir\n end\n end\n end", "title": "" }, { "docid": "e91f27ce9439d5eaa261c71f2986e26c", "score": "0.5261383", "text": "def expect_creates_cache_dir # rubocop:disable MethodLength\n describe '/var/cache/glance' do\n before do\n @dir = @chef_run.directory '/var/cache/glance'\n end\n\n it 'has proper owner' do\n expect(@dir.owner).to eq('glance')\n expect(@dir.group).to eq('glance')\n end\n\n it 'has proper modes' do\n expect(sprintf('%o', @dir.mode)).to eq '700'\n end\n end\nend", "title": "" }, { "docid": "b2c143ebcfb408b230a95dfb20f56dcb", "score": "0.52429324", "text": "def cache_file_path\n File.join @homepath, 'cache'\n end", "title": "" }, { "docid": "6c9cdd0db58a739b6849ab4426ffa760", "score": "0.52309185", "text": "def local_cache(box_name)\n cache_dir = File.join(File.expand_path(\"~/.vagrant.d\"),\n 'cache',\n 'apt',\n box_name)\n partial_dir = File.join(cache_dir, 'partial')\n FileUtils.mkdir_p(partial_dir) unless File.exists? partial_dir\n cache_dir\nend", "title": "" }, { "docid": "6c2e60560ca8ce0707b7c044d6d6d429", "score": "0.5230474", "text": "def gemspec_cached_path(spec_file_name)\n paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) }\n paths.find {|path| File.file? path }\n end", "title": "" }, { "docid": "8fb35755f0b93994f772dba51bfbc521", "score": "0.5228998", "text": "def patch_bashrc\n bashrc = File.readlines(BASHRC_PATH)\n require_line = 'source ~/.goodies-sources'\n if bashrc.any? { |l| l =~ /#{require_line}/ }\n puts 'goodies-sources already in your bash config'\n else\n puts 'Install goodies-sources in your bash config'\n open(BASHRC_PATH, 'a') { |f| f.puts require_line }\n end\nend", "title": "" }, { "docid": "8959ef0334351119d17860df2c59b63c", "score": "0.52279174", "text": "def local_cache(basebox_name)\n cache_dir = Vagrant::Environment.new.home_path.join('cache', 'apt', basebox_name)\n # Vagrant::Environment.new.home_path\n print cache_dir\n cache_dir.mkpath unless cache_dir.exist?\n partial_dir = cache_dir.join('partial')\n partial_dir.mkdir unless partial_dir.exist?\n cache_dir\nend", "title": "" }, { "docid": "83c979ebf4827443043abce4aafdac4a", "score": "0.5226029", "text": "def get_chef_validation_key settings\n chef_settings = settings[:user_data] or return\n validation_key_file = File.expand_path(chef_settings[:validation_key_file])\n return unless File.exists?(validation_key_file)\n chef_settings[:validation_key] ||= File.read(validation_key_file)\nend", "title": "" }, { "docid": "51fa8ca0ebd18e8891e5de97702cfcf5", "score": "0.5217291", "text": "def cachedir\n if Gem.win_platform?\n File.join(PDK::Util::Env['LOCALAPPDATA'], 'PDK', 'cache')\n else\n File.join(Dir.home, '.pdk', 'cache')\n end\n end", "title": "" }, { "docid": "97773dff78e70d380331fc309d409782", "score": "0.5203677", "text": "def read(key)\n File.read(cache_path(key))\n rescue Errno::ENOENT\n nil\n end", "title": "" }, { "docid": "e1f08acfe3ec113b2e2daf62a689e37f", "score": "0.5202535", "text": "def gcal_keys_path\n path1 = File.expand_path(\"./.gcal_keys\")\n path2 = File.expand_path(\"~/.gcal_keys\")\n File.exist?(path1) ? path1 : path2\nend", "title": "" }, { "docid": "7c45c37f4bcf1da4d83199b44039df2f", "score": "0.5201282", "text": "def cachedir\n if Gem.win_platform?\n File.join(ENV['LOCALAPPDATA'], 'PDK', 'cache')\n else\n File.join(Dir.home, '.pdk', 'cache')\n end\n end", "title": "" }, { "docid": "16379656d0da7a1a81aa74c5c614c75c", "score": "0.5196513", "text": "def chef_credentials\n creds = Hash.new\n File.open(ENV['HOME'] + '/.chef/knife.rb').each do |line|\n creds['c_uri'] = line.scan(/'([^']*)'/).join(' ') if line.match('chef_server_url')\n creds['c_key'] = line.scan(/'([^']*)'/).join(' ') if line.match('client_key')\n creds['c_node'] = line.scan(/'([^']*)'/).join(' ') if line.match('node_name')\n end\n return creds\nrescue => e\n puts '(chef=>tenant_prov): Unable to access Chef credentials. Check the knife.rb file for the user environment.'\n puts \"(chef=>tenant_prov): Error: #{e}\"\n exit\nend", "title": "" }, { "docid": "d53640fe684fd1751f6dd25844ab018a", "score": "0.5173896", "text": "def installed?\n File.exist?(ktlint_path)\n end", "title": "" }, { "docid": "14251b08a65cbe6b9a022257f2aa9681", "score": "0.5167239", "text": "def chef_config\n Berkshelf::ChefConfigCompat.from_file(chef_config_path)\n end", "title": "" }, { "docid": "67024aa8bbebe966c8ad1850dcb16c52", "score": "0.51648873", "text": "def read_rc_file\n \n file = File.join( ENV['HOME'], '.app47rc') \n if File.exists? file \n config_options = YAML.load_file( file) \n @options.merge!( config_options)\n end\n\n end", "title": "" }, { "docid": "9243e11f7abc177a24ae4f1c610fa14b", "score": "0.51644784", "text": "def configuration(gem=nil)\n key = gem ? gem.to_s : nil #Dir.pwd\n cache[key] ||= Configuration.load(:from=>gem)\n end", "title": "" }, { "docid": "dca49f9690873c594d81f7bee04266c8", "score": "0.5157525", "text": "def load_chef_fetcher\n Chef::Log.debug \"Load Chef Server fetcher from: #{cookbook_vendor_path}\"\n $LOAD_PATH.unshift(cookbook_vendor_path)\n require 'chef-server/fetcher'\n end", "title": "" }, { "docid": "3b7cc0c36792d444a816f38458c55d4d", "score": "0.5157027", "text": "def local_cache(box_name)\n cache_dir = File.join(File.expand_path(Vagrant::Environment::DEFAULT_HOME),\n 'cache',\n 'apt',\n box_name)\n partial_dir = File.join(cache_dir, 'partial')\n FileUtils.mkdir_p(partial_dir) unless File.exists? partial_dir\n cache_dir\nend", "title": "" }, { "docid": "b948f908d8a9b8eb7a062ccfcaf663cb", "score": "0.5151609", "text": "def check_flrtvc\n raise FlrtvcNotFound unless ::File.exist?('/usr/bin/flrtvc.ksh')\n end", "title": "" }, { "docid": "e526748620079d6c6030c85b4527d309", "score": "0.51480275", "text": "def file_path\n Dir.glob(config.cache).first || File.join(File.dirname(config.cache),\n File.basename(config.cache).gsub(/_.+\\.txt/, '_0.txt'))\n end", "title": "" }, { "docid": "209380a0ab29d156cf7de63ddac66945", "score": "0.51404107", "text": "def cookbook?\n File.exist? \"#{@config.workspace}/metadata.rb\"\n end", "title": "" }, { "docid": "95931c990f8361a7e7a1b1b11e0eda0b", "score": "0.5134975", "text": "def config_read\n #f = File.expand_path(\"~/.zfminfo\")\n f = File.expand_path(CONFIG_FILE)\n if File.readable? f\n load f\n # maybe we should check for these existing else crash will happen.\n $used_dirs.push(*(DIRS.split \":\"))\n $used_dirs.concat get_env_paths\n $visited_files.push(*(FILES.split \":\"))\n #$bookmarks.push(*bookmarks) if bookmarks\n chars = ('A'..'Z').to_a\n chars.concat( ('0'..'9').to_a )\n chars.each do |ch|\n if Kernel.const_defined? \"BM_#{ch}\"\n $bookmarks[ch] = Kernel.const_get \"BM_#{ch}\"\n end\n end\n end\nend", "title": "" }, { "docid": "4f547d6a9605ffffb4296d447d9c693c", "score": "0.5126413", "text": "def cache_directory\n @options[:cache_directory]\n end", "title": "" }, { "docid": "2be797e5874e76a648a3eefc83fe5173", "score": "0.5125581", "text": "def config_directory\n \"C:\\\\chef\"\n end", "title": "" }, { "docid": "b5b66a1e754817d4e76c9769fc5d5cba", "score": "0.5124112", "text": "def cache_root\n \n unless @cache_root \n \n tmp_dir = sensible_os? ? '/tmp' : ENV['TEMP']\n @cache_root = File.join(tmp_dir, 'skmm-cache')\n\n end\n\n return @cache_root\n\n end", "title": "" }, { "docid": "85cd19fd24ab7858416df84dcafe5688", "score": "0.51228184", "text": "def find_local_config\n dir = Dir.pwd\n\n local_config_files = []\n\n while dir != '/' && (dir =~ %r{[A-Z]:/}).nil?\n local_config_files.push(File.join(dir, '.doingrc')) if File.exist? File.join(dir, '.doingrc')\n\n dir = File.dirname(dir)\n end\n\n local_config_files.delete(config_file)\n\n local_config_files\n end", "title": "" }, { "docid": "0f40f302885de67f4851940db37b7bbb", "score": "0.5122783", "text": "def find_config_path\n path = Pathname(Pathname.pwd).ascend{|d| h=d+config_filename; break h if h.file?}\n end", "title": "" }, { "docid": "f796a8a1e8f28ca213bf071a7cb0fa77", "score": "0.51227236", "text": "def rl_read_init_file(filename)\r\n # Default the filename.\r\n filename ||= @last_readline_init_file\r\n filename ||= ENV[\"INPUTRC\"]\r\n if (filename.nil? || filename == '')\r\n filename = DEFAULT_INPUTRC\r\n # Try to read DEFAULT_INPUTRC; fall back to SYS_INPUTRC on failure\r\n if (_rl_read_init_file(filename, 0) == 0)\r\n return 0\r\n end\r\n filename = SYS_INPUTRC\r\n end\r\n\r\n if RUBY_PLATFORM =~ /mswin|mingw/\r\n return 0 if (_rl_read_init_file(filename, 0) == 0)\r\n filename = \"~/_inputrc\"\r\n end\r\n return (_rl_read_init_file(filename, 0))\r\n end", "title": "" }, { "docid": "8bf2d26f9f6a16d633a8144764a189a8", "score": "0.5120224", "text": "def path\n @@path ||= File.join(RAILS_ROOT, 'tmp', 'cache', 'vm')\n end", "title": "" }, { "docid": "39fd80ff4450191be78e7afcadbfbbeb", "score": "0.5115841", "text": "def read_cache_file()\n #\n # Update to Google Domains may be forced by forgetting cached\n # values. This is controlled by the [-u|--force_update] option\n #\n if options[:force_update]\n if File.exists?(options[:cache_file])\n File.delete(options[:cache_file])\n end\n end\n\n #\n # Load the cache file\n #\n return File.exists?(options[:cache_file]) ? YAML.load_file(options[:cache_file]) : {}\n end", "title": "" }, { "docid": "7644d1cdada144a784a502acfdca4cfc", "score": "0.5114136", "text": "def load_local_cache\n return nil unless File.exists?(LOCAL_CACHE_PATH)\n yaml = File.read(LOCAL_CACHE_PATH)\n YAML.load(yaml)\n end", "title": "" }, { "docid": "173b0467943001fd0d9ae6235ea15ce8", "score": "0.50980383", "text": "def file_exists?(name)\n\n #if file exists return true\n Chef::Log.debug \"DEBUG: Checking to see if the curent file: '#{ name }.conf' exists in pool directory #{ node[\"php_fpm\"][\"pools_path\"] }\"\n ::File.file?(\"#{ node[\"php_fpm\"][\"pools_path\"] }/#{ name }.conf\")\n\nend", "title": "" }, { "docid": "c10da094b62272a4cae2d6eb3265d1d5", "score": "0.5080268", "text": "def config_cached?(key)\n lock(:c) do\n @cache[:c].has_key?(key)\n end\n end", "title": "" }, { "docid": "1983e9b93e9eba5b37c97d6521b76084", "score": "0.5079017", "text": "def terraform_bin\n OS.locate('terraform')\n end", "title": "" }, { "docid": "715da98216f2f70384c125a2ebcbf119", "score": "0.5068685", "text": "def cache_file_list_path\n File.join config.config_dir, 'file_cache'\n end", "title": "" }, { "docid": "9972e68dd44370d1c01b01e12ac44df7", "score": "0.5068475", "text": "def kitchen_driver_file\n { virtualbox: File.join(@opts[:path], '.kitchen.yml'),\n docker: File.join(@opts[:path], '.kitchen.local.yml'),\n solusvm: File.join(@opts[:path], '.kitchen.local.yml')\n }\n end", "title": "" }, { "docid": "fd388a9f733d3f6c5e3de008ee59fc79", "score": "0.50600564", "text": "def kubernetes_compressed_file\n \"#{file_cache_path}/kubernetes-#{version}.tar.gz\"\n end", "title": "" }, { "docid": "89d8d35a257ade5f9374a7a25fc3d048", "score": "0.5056621", "text": "def first_run?\n not File.exists? '/boot/config/.boxcar'\n end", "title": "" }, { "docid": "768326e118841948670b2a423f17c6d9", "score": "0.5053188", "text": "def disk_cache_enabled; end", "title": "" }, { "docid": "45a62f5474fb5987b60491e47cee4e28", "score": "0.5052854", "text": "def read_cluster_config\n if ENV['VAGRANT_CWD'] then\n folder = ENV['VAGRANT_CWD'] + \"/cluster_defs.json\"\n defs_file = open(folder)\n else\n defs_file = open(\"cluster_defs.json\")\n end\n defs_json = defs_file.read\n clust_cfg = JSON.parse(defs_json)\n defs_file.close\n return clust_cfg\nend", "title": "" }, { "docid": "4aac06419673ed552119024e62919931", "score": "0.505165", "text": "def chef_secure_path\n return @secure_resources unless @secure_resources.nil?\n\n @secure_resources = Chef::Resource::Directory.new(::File.join(new_resource.chef_secure_path), run_context)\n @secure_resources.recursive(true)\n\n return @secure_resources\n end", "title": "" }, { "docid": "025358f3f20a4149cbf058bc895bbfb4", "score": "0.5049719", "text": "def cookbook_version_loaders\n @cookbook_version_loaders ||=\n begin\n mash = Mash.new\n all_directories_in_repo_paths.each do |cookbook_path|\n loader = Cookbook::CookbookVersionLoader.new(cookbook_path, chefignore(cookbook_path))\n cookbook_name = loader.cookbook_name\n if mash.key?(cookbook_name)\n raise Chef::Exceptions::CookbookMergingError, \"Cookbook merging is no longer supported, the cookbook named #{cookbook_name} can only appear once in the cookbook_path\"\n end\n\n mash[cookbook_name] = loader\n end\n mash\n end\n end", "title": "" }, { "docid": "b0e75e0cc3ce061c9675d76afb42f6e3", "score": "0.5045568", "text": "def load_local_env\n load_env(KVMRC_LOCAL)\n end", "title": "" }, { "docid": "c53e9c38cae4ec900815961650fe585a", "score": "0.503724", "text": "def cache_dir\n find /^Writeable cache dir: (.*)$/\n end", "title": "" } ]
d70e95f55bea2c9234599ead45f2319b
Indicates whether its possible to capture the payment
[ { "docid": "93b3fbad3a3f58dc38c0b85ac77c2645", "score": "0.8574391", "text": "def can_capture?(payment)\n payment.pending? || payment.checkout?\n end", "title": "" } ]
[ { "docid": "4fb9ff43ec51120c3b53c900cf688c91", "score": "0.8421634", "text": "def can_capture?(payment)\n payment.state == 'pending' || payment.state == 'checkout'\n end", "title": "" }, { "docid": "1ca995deac6b4de643135bf2e8128f1e", "score": "0.840692", "text": "def can_capture?(payment)\n ['pending'].include?(payment.state)\n end", "title": "" }, { "docid": "321445fb2254b3bf1ac60aaaa242492d", "score": "0.83986884", "text": "def can_capture?(payment)\n ['pending'].include?(payment.state)\n end", "title": "" }, { "docid": "f4e2c4851f68e9aae27636e74146f25f", "score": "0.8374448", "text": "def can_capture?(payment)\n payment.checkout?\n end", "title": "" }, { "docid": "f317b6c68484548d0185765c2eca8035", "score": "0.83426374", "text": "def can_capture?(payment)\n (payment.pending? || payment.checkout?) && !payment.response_code.blank?\n end", "title": "" }, { "docid": "f317b6c68484548d0185765c2eca8035", "score": "0.83426374", "text": "def can_capture?(payment)\n (payment.pending? || payment.checkout?) && !payment.response_code.blank?\n end", "title": "" }, { "docid": "25d42d3f32165a885b382abe358002d7", "score": "0.83002377", "text": "def can_capture?(payment)\n ['checkout', 'pending'].include?(payment.state)\n end", "title": "" }, { "docid": "25d42d3f32165a885b382abe358002d7", "score": "0.83002377", "text": "def can_capture?(payment)\n ['checkout', 'pending'].include?(payment.state)\n end", "title": "" }, { "docid": "8f339d56c7184b5c27a853578188176b", "score": "0.8285566", "text": "def can_capture?(payment)\n logger.debug \"\\n----------- #{self.invoice_number} -----------\\n\"\n ['checkout', 'pending', 'processing'].include?(payment.state) && !self.invoice_number.blank?\n end", "title": "" }, { "docid": "0406a1df335df786008a22f763c676ce", "score": "0.82840663", "text": "def can_capture?(payment)\n ['checkout', 'pending'].include?(payment.state)\n end", "title": "" }, { "docid": "a369144b3318e90773ff803da036805f", "score": "0.8245142", "text": "def can_capture?(payment)\n ['checkout', 'pending', 'processing'].include?(payment.state)\n end", "title": "" }, { "docid": "047bb37376995a279a5c44eadf0572d5", "score": "0.76958513", "text": "def collect_payment?\n true\n end", "title": "" }, { "docid": "f1d61ccdd0235b066453dc16b15ac737", "score": "0.72335327", "text": "def can_supply?\n payment_received? || payment_on_account?\n end", "title": "" }, { "docid": "977dfc7f571cfd66578e049e28dca3be", "score": "0.71325046", "text": "def can_credit?(payment)\n payment.completed? && payment.credit_allowed > 0\n end", "title": "" }, { "docid": "977dfc7f571cfd66578e049e28dca3be", "score": "0.71325046", "text": "def can_credit?(payment)\n payment.completed? && payment.credit_allowed > 0\n end", "title": "" }, { "docid": "87d17cc8edbb11764955c3e1ff6b3a58", "score": "0.71179265", "text": "def can_activate?\n self.authorize_payment\n end", "title": "" }, { "docid": "cd0164346ee6e10dd1404273091d006f", "score": "0.7106526", "text": "def can_void?(payment)\n !payment.failed? && !payment.void?\n end", "title": "" }, { "docid": "cd0164346ee6e10dd1404273091d006f", "score": "0.7106526", "text": "def can_void?(payment)\n !payment.failed? && !payment.void?\n end", "title": "" }, { "docid": "79615de54416d88ff0469611d18f3418", "score": "0.7004219", "text": "def can_void?(payment)\n !payment.void?\n end", "title": "" }, { "docid": "79615de54416d88ff0469611d18f3418", "score": "0.7004219", "text": "def can_void?(payment)\n !payment.void?\n end", "title": "" }, { "docid": "d0b8ce83bffed589dd273690729eddd8", "score": "0.69761574", "text": "def can_finish?\n self.payment_status == PTE::PaymentStatus.processing\n end", "title": "" }, { "docid": "c2343a425fb974d8bb6257a09599c788", "score": "0.69729304", "text": "def payment_success?\n @fields['decision'] == 'ACCEPT'\n end", "title": "" }, { "docid": "983bc1ad3817961ed39085272fdb2221", "score": "0.6920117", "text": "def in_payment?\n @in_payment\n end", "title": "" }, { "docid": "51546bda95a62bc2ddd2eddc6c6097ea", "score": "0.6905132", "text": "def is_manual?\n payment_kind == 'manual'\n end", "title": "" }, { "docid": "6ac5635c6a937bec5a53f596cfe004fa", "score": "0.68792975", "text": "def can_credit?(payment)\n return false unless payment.state == 'completed'\n return false unless payment.order.payment_state == 'credit_owed'\n payment.credit_allowed > 0\n end", "title": "" }, { "docid": "bfe08b6b9cfa74b78a85b9547d5ae2ce", "score": "0.6878423", "text": "def capture_pending_payments\n success = true\n order.payments.pending.each do |payment|\n unless payment.capture!\n copy_errors(payment)\n success = false\n end\n end\n success\n end", "title": "" }, { "docid": "adb02a6d82d6548411c76e2bda3316a1", "score": "0.6878125", "text": "def guard_process_payment_from_created; true; end", "title": "" }, { "docid": "adb02a6d82d6548411c76e2bda3316a1", "score": "0.6878125", "text": "def guard_process_payment_from_created; true; end", "title": "" }, { "docid": "54c059f7f5ac4948997b679aed955856", "score": "0.68705887", "text": "def can_void?(payment)\n payment.state != 'void'\n end", "title": "" }, { "docid": "54c059f7f5ac4948997b679aed955856", "score": "0.68705887", "text": "def can_void?(payment)\n payment.state != 'void'\n end", "title": "" }, { "docid": "c944f4a93adaae71a29eaff727505f7b", "score": "0.6854525", "text": "def can_credit?(payment)\n return false unless payment.completed?\n return false unless payment.order.payment_state == 'credit_owed'\n payment.credit_allowed > 0\n end", "title": "" }, { "docid": "c944f4a93adaae71a29eaff727505f7b", "score": "0.6854525", "text": "def can_credit?(payment)\n return false unless payment.completed?\n return false unless payment.order.payment_state == 'credit_owed'\n payment.credit_allowed > 0\n end", "title": "" }, { "docid": "1c44609c59ce3c0c6053853244061118", "score": "0.6840233", "text": "def can_void?(payment)\n !%w(void failure invalid).include?(payment.state)\n end", "title": "" }, { "docid": "5f645189b34ae1eb28b7491f2cddff01", "score": "0.68260354", "text": "def can_void?(payment)\n payment.state != 'void'\n end", "title": "" }, { "docid": "5f645189b34ae1eb28b7491f2cddff01", "score": "0.68260354", "text": "def can_void?(payment)\n payment.state != 'void'\n end", "title": "" }, { "docid": "5f645189b34ae1eb28b7491f2cddff01", "score": "0.68260354", "text": "def can_void?(payment)\n payment.state != 'void'\n end", "title": "" }, { "docid": "5f645189b34ae1eb28b7491f2cddff01", "score": "0.68260354", "text": "def can_void?(payment)\n payment.state != 'void'\n end", "title": "" }, { "docid": "5f645189b34ae1eb28b7491f2cddff01", "score": "0.68260354", "text": "def can_void?(payment)\n payment.state != 'void'\n end", "title": "" }, { "docid": "5f645189b34ae1eb28b7491f2cddff01", "score": "0.68260354", "text": "def can_void?(payment)\n payment.state != 'void'\n end", "title": "" }, { "docid": "5f645189b34ae1eb28b7491f2cddff01", "score": "0.68260354", "text": "def can_void?(payment)\n payment.state != 'void'\n end", "title": "" }, { "docid": "8e2ac3884caa6c130e13986cd0f37268", "score": "0.6804581", "text": "def can_void?(payment)\n !payment.state.in?(['void', 'invalid', 'failed'])\n end", "title": "" }, { "docid": "a6b88dd789d3bcd7ca5de43502e3c8c9", "score": "0.67943954", "text": "def can_void?(payment)\n !payment.void? && payment.pending? && !payment.response_code.blank?\n end", "title": "" }, { "docid": "a6b88dd789d3bcd7ca5de43502e3c8c9", "score": "0.67943954", "text": "def can_void?(payment)\n !payment.void? && payment.pending? && !payment.response_code.blank?\n end", "title": "" }, { "docid": "78d7be36a4a4f49f4e9d19ad0554987e", "score": "0.6789482", "text": "def can_cash?\n self.capture_and_cash\n end", "title": "" }, { "docid": "4a408289dcfa7d8c587c324740e51ad5", "score": "0.6763707", "text": "def payment_cadence_allowed?\n begin\n config_payment_cadence = SystemConfiguration::Variable.get_value('booking.payment_cadence').to_i\n _date_from_str = \"#{self.date_from.strftime('%Y-%m-%d')}T#{self.time_from}:00#{self.date_from.strftime(\"%:z\")}\"\n _date_from = DateTime.strptime(_date_from_str,'%Y-%m-%dT%H:%M:%S%:z')\n diff_in_hours = ((_date_from.to_time - self.creation_date.to_time).to_f * 24).to_i\n allowed = diff_in_hours > 0 && (diff_in_hours >= config_payment_cadence)\n allowed || force_allow_payment\n rescue => error\n p \"Error #{id} #{date_from} #{time_from} #{date_to} #{time_to} #{driver_date_of_birth} #{driver_driving_license_date}\"\n return false\n end\n end", "title": "" }, { "docid": "432ef672ea39d2426b71b33ee58946b0", "score": "0.6741932", "text": "def should_request_capture?(response, requires_approval)\n !capture_requested?(response) && requires_approval != false\n end", "title": "" }, { "docid": "3879f760547e741e92f552493ff5f161", "score": "0.6704732", "text": "def store_credit_card?\n paid?\n end", "title": "" }, { "docid": "d423b85a35249a8354c9a224e026d896", "score": "0.66913325", "text": "def payment_api_return?\n\t\ttrue\n\tend", "title": "" }, { "docid": "86bf4eac1cf0e18479a67968fef91490", "score": "0.66803646", "text": "def payment_received?\n payment_state == PAYMENT_RECEIVED\n end", "title": "" }, { "docid": "b5fd84941c3a4f4ad89a87dc34083a3a", "score": "0.6655936", "text": "def payed?\n !payment_entry.nil?\n end", "title": "" }, { "docid": "27f07e7b3d7a698f38e4b5cd29f91a19", "score": "0.66481507", "text": "def credit_card_needed?\n credit_card_required?\n end", "title": "" }, { "docid": "bf3c1687bd98330f149f0cbaafd63b84", "score": "0.66368896", "text": "def paid_with_card?\n payment_type == \"card\"\n end", "title": "" }, { "docid": "e7924e51d3bfb088d411aa0967271141", "score": "0.659922", "text": "def authorize_payment\n if !self.pending_purchase_order && self.payment_object\n order, payment = self.purchase_and_authorize\n if payment && payment.success?\n# self.payment_object = nil # remove payment object so we can re-validate\n self.purchase_orders.reload\n return payment.success?\n end\n end\n false\n end", "title": "" }, { "docid": "0d0fa04b161ece360c812a47f58943c2", "score": "0.659313", "text": "def credit?\n (payment_method == CREDIT)\n end", "title": "" }, { "docid": "78cb9d42f4052c3e8c2ce15c9f827b7d", "score": "0.6559455", "text": "def capture_payment(options = {})\n # transaction do\n capture = OrderTransaction.capture(amount, authorization_reference, options)\n self.save!\n self.order_transactions << capture\n\n if capture.success?\n self.payment_captured!\n else\n self.transaction_declined!\n end\n\n capture\n # end\n end", "title": "" }, { "docid": "8e1b14601c02796fbaf941625e669d6e", "score": "0.6553428", "text": "def succeeded?\n authorized? || paid?\n end", "title": "" }, { "docid": "c9b00232dfa6ba727f2acd903fa2d58a", "score": "0.6528682", "text": "def authorize_and_capture\n \n resp = StdClass.new \n if self.financial_status == Invoice::FINANCIAL_STATUS_CAPTURED\n resp.error = \"Funds for this invoice have already been captured.\"\n else\n \n sc = self.site.store_config \n case sc.pp_name \n when StoreConfig::PAYMENT_PROCESSOR_STRIPE\n \n Stripe.api_key = sc.stripe_secret_key.strip\n bt = nil\n begin\n c = Stripe::Charge.create(\n :amount => (self.total * 100).to_i,\n :currency => 'usd',\n :customer => self.customer.stripe_customer_id,\n :capture => true,\n :metadata => { :invoice_id => self.id },\n :statement_descriptor => \"#{self.site.description.truncate(22)}\"\n ) \n rescue Exception => ex\n resp.error = \"Error during capture process\\n#{ex.message}\" \n end \n if resp.error.nil?\n InvoiceTransaction.create(\n :invoice_id => self.id,\n :transaction_id => c.id,\n :transaction_type => InvoiceTransaction::TYPE_AUTHCAP,\n :payment_processor => sc.pp_name,\n :amount => c.amount / 100.0,\n :captured => true,\n :date_processed => DateTime.now.utc,\n :success => c.status == 'succeeded'\n )\n if c.status == 'succeeded'\n self.financial_status = Invoice::FINANCIAL_STATUS_CAPTURED\n self.save\n resp.success = true\n else\n resp.error = \"Error capturing funds.\"\n end\n end\n \n end \n end \n return resp\n end", "title": "" }, { "docid": "152aba48403f89fe2f746ba73334175a", "score": "0.6496032", "text": "def authorizable_cc_payment?\n adyen_cc_payment? && amount != 0\n end", "title": "" }, { "docid": "c6c61cf762c597764726bbfacbae41b0", "score": "0.64757854", "text": "def payment_pending?\n payment_state == PAYMENT_PENDING\n end", "title": "" }, { "docid": "172e6c38db4b77f86cdda14987cbe9d2", "score": "0.646828", "text": "def payment_in_progress?\n\t\t\t\t\treturn !self.payment_id.nil?\n\t\t\t\tend", "title": "" }, { "docid": "575b83cc30b476ba86b47f3a6cfa8442", "score": "0.64674497", "text": "def paid_with_card?\n order.payment_method == 'credit_card'\n end", "title": "" }, { "docid": "ce6528277110f270c210a02beab0b6c0", "score": "0.6459903", "text": "def capture!\n if hpp_payment? || adyen_cc_payment?\n amount = money.money.cents\n process do\n payment_method.send(\n :capture, amount, response_code, gateway_options)\n end\n else\n super\n end\n end", "title": "" }, { "docid": "217990ed0e85613bcb0e11c9efec915b", "score": "0.64376986", "text": "def payment_confirmation_required?\n true\n end", "title": "" }, { "docid": "450718690354ddab68f8a7c6737a0bab", "score": "0.6432658", "text": "def payment_authorized?(payment_id)\n check_payment = get_payment_intent_info(payment_id)\n status = check_payment['status']\n puts \"Current Payment Status: #{status}\"\n case status\n when 'Authorized', 'Card Verified'\n puts 'Payment has been authorized'\n return true\n # when 'Declined'\n # puts \"Reason for Decline: #{check_payment['response_summary']}\"\n # abort 'Payment has been declined so exiting this program'\n end\n puts \"3DS Flow hasn't been completed\"\n false\n end", "title": "" }, { "docid": "c24cc142e85529485ce235bc4a76cde9", "score": "0.6422796", "text": "def payment_profiles_supported?\n false\n end", "title": "" }, { "docid": "b868bbdaea3fa210e9298975c93000de", "score": "0.64100313", "text": "def payments_in_use?\n payment_gateway.present? && payment_gateway.configured?\n end", "title": "" }, { "docid": "44596a54dabb7acf2c8fa4bbc4f1af07", "score": "0.6405559", "text": "def purchase!\n if ratepay?\n capture!\n elsif adyen_cc_payment?\n authorize!\n capture!\n else\n super\n end\n end", "title": "" }, { "docid": "e1ce5bcaa44a2522b3c05271cb9844fc", "score": "0.63914835", "text": "def requires_manual_payment?\n Paykido::Application.config.always_pay_manually or\n !self.payer.registered?\n end", "title": "" }, { "docid": "7f4746a4d144318839903bfb70fa3efd", "score": "0.6388284", "text": "def charge_is_allowed?\n\t\tif not customer_has_authorized_payment?\n\t\t\terrors.add :base, I18n.t('views.customer_file.new_charge.you_are_not_authorized')\n\t\t\tfalse\n\t\telsif valid? and charge_amount.present? and authorized_amount and charge_amount.to_i <= authorized_amount\n\t\t\ttrue\n\t\telse\n\t\t\terrors.add :charge_amount, I18n.t('views.customer_file.new_charge.invalid', amount: charge_amount_usd) if errors.empty?\n\t\t\tfalse\n\t\tend\n\tend", "title": "" }, { "docid": "893bda624438482d1fbe31d7b5e8dad0", "score": "0.6388221", "text": "def check(payment)\n retval\n end", "title": "" }, { "docid": "3fbb2501d013d2b3f2dfe08646170563", "score": "0.6387437", "text": "def payment_received?\n status == Enums::PaymentStatus::PAYMENT_RECEIVED\n end", "title": "" }, { "docid": "f13460699a8ad130a96d376022c13888", "score": "0.63678837", "text": "def claim_amount_required?\n @full_repayment_of_ads != 'Y'\n end", "title": "" }, { "docid": "d3cb77177e7afd892bc87c313b70dbf0", "score": "0.636496", "text": "def capture!(capture_amount = nil)\n if hpp_payment? || adyen_cc_payment? || ratepay?\n amount = money.money.cents\n process do\n payment_method.send(\n :capture, amount, response_code, gateway_options)\n end\n else\n super\n end\n end", "title": "" }, { "docid": "c3e2220374251e41bf53e6429a0f491d", "score": "0.6363913", "text": "def payment_failed?\n cancel_reason == PAYMENT_FAILED\n end", "title": "" }, { "docid": "71049f6dcd56ca508458c34c1beb050e", "score": "0.6352809", "text": "def require_one_click_payment?(source, shopper)\n false\n end", "title": "" }, { "docid": "036be561894edbddef66b43347000dd4", "score": "0.63392484", "text": "def settled_payment?\n SUCCESSFUL_PAYMENT.include?(response['payment_state'])\n end", "title": "" }, { "docid": "16a75d1fda38c88f63639537258c26ed", "score": "0.63217205", "text": "def credit_card?\n (payment_method == CREDIT_CARD)\n end", "title": "" }, { "docid": "8d3c9dad2dd28653af0c6699690d39d0", "score": "0.6303929", "text": "def cc_pay?\n plan&.direct_pay && id != 3744\n end", "title": "" }, { "docid": "3ae8d9db5b377cb0c24601deac94a811", "score": "0.62953824", "text": "def capture\n begin \n Order.transaction do\n # lock order\n Order.find_by_id(self.id, :lock => true)\n # go through all order_payments\n order_payments = self.order_payments\n if order_payments.size == 0\n p \"No order_payments to process.\"\n raise PaymentError, \"No order_payments to process.\"\n end\n for order_payment in order_payments\n order_payment.capture!\n end\n self.upgrade_coupons!\n # update order\n self.update_attributes!(:state => Order::PAID, :paid_at => Time.zone.now)\n end\n # send confirmation email\n user = User.find_by_id(self.user_id)\n if user and user.send_confirmation(self.deal_id)\n return true\n else\n logger.error \"Order.capture: Confirmation email failed to send: #{self.inspect}\"\n return false\n end\n rescue PaymentError => pe\n p \"Order.capture: Failed for Order #{self.inspect} #{pe}\"\n logger.error \"Order.capture: Failed for Order #{self.inspect} #{pe}\"\n rescue ActiveRecord::RecordInvalid => invalid\n p \"Order.capture: Failed for Order #{self.inspect} #{invalid}\"\n logger.error \"Order.capture: Failed for Order #{self.inspect} #{invalid}\"\n end\n return false\n end", "title": "" }, { "docid": "b1ce81523be5cc0044b085950a986f08", "score": "0.62766343", "text": "def payment_possible_for?(listing)\n listing.price && listing.price > 0 && stripe_in_use?\n end", "title": "" }, { "docid": "b75444417117742158de5246f7c32387", "score": "0.6271231", "text": "def success?\n @result[:payment] === true\n end", "title": "" }, { "docid": "42ca712c8b14abeb3bf993684c9447f8", "score": "0.6267796", "text": "def verify!\n raise \"Payment details not active anymore\" if active == false\n end", "title": "" }, { "docid": "61ff11357890394e8784758f367334f8", "score": "0.62561107", "text": "def payments_in_use?\n active_payment_types.present?\n end", "title": "" }, { "docid": "3fa12979acba629f0b78b714232d09b5", "score": "0.62546706", "text": "def valid?\n p = build_payment\n p.valid?\n end", "title": "" }, { "docid": "33d7127a2d942668a4d575c452c6c157", "score": "0.62528485", "text": "def process_with_active_merchant\n options = populate_options\n auth = authorize_payment(options)\n save!\n if APP_CONFIG['pre_and_post_authorization'] == true\n if auth.success == true\n capture_payment(options)\n save!\n end\n end\n end", "title": "" }, { "docid": "164cd7c4315afceb7af6bbbef066666f", "score": "0.62410927", "text": "def customer_has_authorized_payment?\n\t\tauthorized and authorized_amount.try(:>, 0) and has_customer_account?\n\tend", "title": "" }, { "docid": "5ffe41fa606b094cc68f82ed454eb7d2", "score": "0.6227802", "text": "def charge?\n false\n end", "title": "" }, { "docid": "23a7bc04710f8c971b6a25574bf0125d", "score": "0.6182079", "text": "def recording_consent_required?\n @settings.get_value(\"Require Recording Consent\") == \"true\"\n end", "title": "" }, { "docid": "217fc3c3db8a1ce8bef7f235ac7a1a03", "score": "0.6174833", "text": "def can_request_purchase?\n true # TODO: Should this be !virginia_borrower? ?\n end", "title": "" }, { "docid": "cc914f8dbefa6ad4ebc40a1134707077", "score": "0.61711377", "text": "def trial?\n price_is_zero = price_amount_micros == 0\n price_is_zero && payment_received?\n end", "title": "" }, { "docid": "c06309985efe7dccae70e257d0dd8492", "score": "0.6171051", "text": "def payment_possible_for?(listing)\n listing.price && listing.price > 0 && payments_in_use?\n end", "title": "" }, { "docid": "a88e525fcf7868244175e42215a61758", "score": "0.6159654", "text": "def pending?\n payment_status == 'Pending'\n end", "title": "" }, { "docid": "3654c530e3cf76965406850e7e15f804", "score": "0.61500674", "text": "def paid_in_full?\n !payment_outstanding?\n end", "title": "" }, { "docid": "e06ed8db6918732457352c9e71cc51c2", "score": "0.61407906", "text": "def allow_paypal_payments?\n paypal_credentials.present? || paypal_email.present?\n end", "title": "" }, { "docid": "37f25135039235d916232bb5e034264c", "score": "0.61360097", "text": "def can_pay?\n\n can_pay_deposit? or can_pay_pending? or can_pay_total?\n\n end", "title": "" }, { "docid": "b38cfdb6fbff1ae08db00d4e11edfefa", "score": "0.61227816", "text": "def accounts_receivable?\n type == 'ACCRECCREDIT'\n end", "title": "" } ]
59344cc9299ea0e303a769de047be845
listRegisteredNameServers returns XML containing all name servers xpath: /namesilo/reply/hosts
[ { "docid": "7945aefe3760f099f52c86f24404a0b0", "score": "0.7118314", "text": "def list_name_servers(domain)\n get_request('listRegisteredNameServers?'+get_url_parameters({'domain':domain})).body\n end", "title": "" } ]
[ { "docid": "8c5900c1338208acd230549320c4e4d4", "score": "0.7163343", "text": "def name_servers\n response = @client.rest_get(@data['uri'] + '/nameServers')\n response.body\n end", "title": "" }, { "docid": "cd0d413cf1ccdb4cae151320019a1944", "score": "0.6596209", "text": "def name_servers\n Array(@gapi[\"nameServers\"])\n end", "title": "" }, { "docid": "ccb6f484fa3de152599cfdd0f73b3aac", "score": "0.64954215", "text": "def nameservers(*args)\n filename = args.any? ? args.first.to_s : '/etc/resolv.conf'\n filename = '/etc/resolv.conf' if !File.file?(filename)\n\n result = []\n if File.file?(filename)\n File.readlines(filename).each{|line|\n if line[/nameserver/]\n result << line[/nameserver\\s+(.*)/, 1]\n end\n }\n end\n return result\n end", "title": "" }, { "docid": "b4f247a719b8426a36cd4115ac9dba37", "score": "0.64723116", "text": "def name_servers\n response = DNSimple::Client.get(\"/v1/domains/#{name}/name_servers\")\n case response.code\n when 200\n response.parsed_response\n else\n raise RequestError.new(\"Error getting nameservers for #{name}\", response)\n end\n end", "title": "" }, { "docid": "c382f09e9f211d5bf3ac81eff73b25a1", "score": "0.64161354", "text": "def nameservers\n listed_nameservers self.domain_name\n end", "title": "" }, { "docid": "ac537d17509b3b7ba629dba759e74545", "score": "0.6392047", "text": "def get_name_servers(domain_name)\n\n\twhois_ns_list = []\n\twhois_query = Whois.whois(domain_name.to_s)\n\twhois_query.nameservers.each { |ns| whois_ns_list.push(ns.name) }\n\n\treturn whois_ns_list\n\nend", "title": "" }, { "docid": "aed64b88747243fad256448b60bcc0d3", "score": "0.6360981", "text": "def nameservers\n [\n \"ns1.dreamhost.com\",\n \"ns2.dreamhost.com\",\n \"ns3.dreamhost.com\",\n ]\n end", "title": "" }, { "docid": "7bce505f09838bcfdb16fc12c880ba87", "score": "0.633965", "text": "def get_nameservers\n @account = Account.find(params[:id])\n begin\n @nameservers = @account.nameservers\n # If there are no nameservers/WHOIS details, this will be blank\n if @nameservers.blank?\n render :inline => \"<em>No nameservers listed, or no WHOIS data<br />available for #{@account.domain_name}</em>\"\n else\n render :inline => @nameservers.join(' ')\n end\n rescue \n # Render an error message\n render :inline => \"<em>#{$!}</em>\"\n end\n end", "title": "" }, { "docid": "b660a74b620edfefb988b45cd8e6333f", "score": "0.6249154", "text": "def get_whois_nameservers(domain_name)\n\n\twhois_ns_list = []\n\twhois_query = Whois.whois(domain_name.to_s)\n\twhois_query.nameservers.each { |ns| whois_ns_list.push(ns.name) }\n\n\treturn whois_ns_list\n\nend", "title": "" }, { "docid": "4d2e0bd8939c79becffac26f506e9ae8", "score": "0.6211551", "text": "def list_servers\n connection.get do |req|\n req.url \"agent/servers\"\n end\n end", "title": "" }, { "docid": "0aaa7efb52db88abf3e5ce8298500b59", "score": "0.6057829", "text": "def list_known_servers\n connect.servers.each do |sr|\n logger.debug sr.inspect\n end\n end", "title": "" }, { "docid": "a65177723e27c77478526ca90a8d1949", "score": "0.6054152", "text": "def list_servers\n servers.sort_by(&:to_s).map(&:shortname).join(', ')\n end", "title": "" }, { "docid": "dea5d247074ba4eb0b2acc1a55086891", "score": "0.6031943", "text": "def list_known_servers\n connect.servers.all\n end", "title": "" }, { "docid": "dea5d247074ba4eb0b2acc1a55086891", "score": "0.6031943", "text": "def list_known_servers\n connect.servers.all\n end", "title": "" }, { "docid": "dea5d247074ba4eb0b2acc1a55086891", "score": "0.6031943", "text": "def list_known_servers\n connect.servers.all\n end", "title": "" }, { "docid": "9cb4b0ad8961a1c29ba3393b0c3ad498", "score": "0.59432095", "text": "def getViewNameservers(nodename, view)\n keys = getExportedKeys(nodename, view)\n if keys.length < 1\n return [getServerInternalIP(nodename)]\n end\n \n retval = keys.map{|k| getSlaveNameFromKeyName(k) }\n return retval.sort\nend", "title": "" }, { "docid": "261f064a62d585d0be8cad866fcae2ff", "score": "0.5926388", "text": "def get_servers\n puts \"Getting server list\"\n servers = @conn.list_servers\n\n for server in servers.body['servers']\n puts server\n end\n\n return servers.body['servers']\n end", "title": "" }, { "docid": "2560c9132e25570bc4aa94ac96badf1d", "score": "0.59257764", "text": "def nameservers\n @nameservers ||= ReDNS::Support.default_nameservers\n end", "title": "" }, { "docid": "2466cf8714387aad86095111eb0e473b", "score": "0.59251994", "text": "def name_servers=(list)\n @name_servers = list\n end", "title": "" }, { "docid": "b2be8b418c33fc18103a1a4535ee504e", "score": "0.5888142", "text": "def netbios_name_servers\n get_attribute_values(\"netbios-name-servers\")\n end", "title": "" }, { "docid": "37dc9f27ca789f4333c0b7f3ef861487", "score": "0.5868018", "text": "def list_servers\n Util.cachier('list_servers') do\n Client.servers.sort_by { |hsh| hsh['last_reported_at'] }.collect do |server|\n {\n name: server['name'],\n last_reported_at: server['last_reported_at'],\n id: server['id'],\n reporting: server['reporting']\n }\n end\n end\n end", "title": "" }, { "docid": "e9fe39c510f5cf3c0c5253cab5c3a3c4", "score": "0.58622056", "text": "def names\n @virtual_servers.map(&:name)\n end", "title": "" }, { "docid": "9f74565cc18a71fc3b972514ed8f46b6", "score": "0.58361214", "text": "def get_hostnames\n\tnodeshost = @parsed[\"nodes\"]\n\treturn nodeshost\nend", "title": "" }, { "docid": "0f64c32cb246994c800dc10880d767a5", "score": "0.58217645", "text": "def list_servers\n params = {\n 'command' => 'listVirtualMachines'\n }\n json = send_request(params)\n json['virtualmachine'] || []\n end", "title": "" }, { "docid": "28efa379e7bdf5d983e9cf3457315cd0", "score": "0.5818954", "text": "def get_dns_nameservers(domain_name)\n\n\tdns_ns_list = []\n\tdns_query = Resolver(domain_name.to_s, Net::DNS::NS)\n\tdns_query.each_nameserver do |ns|\n\t\tns.chomp!('.')\n\t\tdns_ns_list.push(ns) \n\tend\n\n\treturn dns_ns_list\n\nend", "title": "" }, { "docid": "0c4e86d6e7fb8d73c5d5cd92f4728f94", "score": "0.58184826", "text": "def server_info(serv_name)\n cmd = \" -c \\\"AdminServerManagement.showServerInfo('#{new_resource.node_name}', '#{serv_name}')\\\"\"\n mycmd = wsadmin_returns(cmd)\n return [] if mycmd.error?\n str = result.stdout.match(/\\['(.*?)'\\]/).captures.first # match everything between ['']\n str.chomp.split(\"', '\")\n end", "title": "" }, { "docid": "7b5eb7dd94e00ffc9346304909606997", "score": "0.5808909", "text": "def get_servers(host=nil, port=nil)\n host ||= '63.146.124.21'\n port ||= 20810\n # TODO 6 ?\n cmd = \"getservers 6 full empty\"\n servers = []\n #TODO need to read all the responses, not just the first\n request_many(cmd, host, port) do |resp, _|\n break if resp.nil?\n servers += parse_serversResponse(resp)\n end\n\n servers\n end", "title": "" }, { "docid": "85a9feda83365b658dfe649ebfec9c53", "score": "0.57887983", "text": "def serverlist\n execute([executable, \"--serverlist\"]).split(\"\\n\")\n end", "title": "" }, { "docid": "85a9feda83365b658dfe649ebfec9c53", "score": "0.57887983", "text": "def serverlist\n execute([executable, \"--serverlist\"]).split(\"\\n\")\n end", "title": "" }, { "docid": "241da30b7d6f168a44bd9ffbe75bdda4", "score": "0.5788587", "text": "def getServers(admin)\n serverInfos = admin.getClusterMetrics.getLiveServerMetrics.keySet\n servers = []\n serverInfos.each do |server|\n servers << server.getServerName\n end\n servers\nend", "title": "" }, { "docid": "9a786298972638f682b3cb04a690bc49", "score": "0.57391226", "text": "def list_servers\n request_path = '/servers'\n request = BaseManagement::SqlManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.databases_from_xml(response)\n end", "title": "" }, { "docid": "1042b8d29bfb761a54353ba7bee9ddc1", "score": "0.57309407", "text": "def index\n @title = \"All Servers\"\n @servers = Server.fields(\"fqdn\", \"lastseen\").sort(:fqdn).all\n respond_with(@servers)\n end", "title": "" }, { "docid": "f56286ef256ae11ae488ec1677bc6733", "score": "0.572741", "text": "def servers\n endpoint.config.nodes.map{ |h| \"#{h[:host]}:#{h[:port]}\" }\n end", "title": "" }, { "docid": "ee9c9c2c2e0a9ecda26e8a5a395013d6", "score": "0.57214653", "text": "def host_names; end", "title": "" }, { "docid": "4df6d37d6f05dee5f972f97ef1a26582", "score": "0.57177347", "text": "def responders_names\n responders.map(&:name)\n end", "title": "" }, { "docid": "0fd0a9f8cdc7e6867161ccbf49f804c9", "score": "0.57010525", "text": "def get_all_hosts\n @raw[\"servers\"].keys\n end", "title": "" }, { "docid": "b32e3e6a4bc5bdb40db95bc1ae1a82d7", "score": "0.56983083", "text": "def get_servers(bot)\n bot.servers.map {|key, server| server.name}.join(', ')\n end", "title": "" }, { "docid": "02916a60a331fabcdcf89c39e3ad94a1", "score": "0.5694182", "text": "def names\n return [name] if Puppet.settings[:strict_hostname_checking]\n\n names = []\n\n names += split_name(name) if name.include?(\".\")\n\n # First, get the fqdn\n unless fqdn = parameters[\"fqdn\"]\n if parameters[\"hostname\"] and parameters[\"domain\"]\n fqdn = parameters[\"hostname\"] + \".\" + parameters[\"domain\"]\n else\n Puppet.warning \"Host is missing hostname and/or domain: #{name}\"\n end\n end\n\n # Now that we (might) have the fqdn, add each piece to the name\n # list to search, in order of longest to shortest.\n names += split_name(fqdn) if fqdn\n\n # And make sure the node name is first, since that's the most\n # likely usage.\n # The name is usually the Certificate CN, but it can be\n # set to the 'facter' hostname instead.\n if Puppet[:node_name] == 'cert'\n names.unshift name\n else\n names.unshift parameters[\"hostname\"]\n end\n names.uniq\n end", "title": "" }, { "docid": "b26a8be3a81d6c246a3cdcf184329e8d", "score": "0.56916", "text": "def hostnames\n NSHost.currentHost.names\n end", "title": "" }, { "docid": "deab1de228ad4754878d6a668e1d29bd", "score": "0.5645774", "text": "def list_known_servers(resource_group)\n connect.servers(resource_group: resource_group).each do |sr|\n logger.debug sr.inspect\n end\n end", "title": "" }, { "docid": "de1723157e0b1d8c7c58d07d0ff6074a", "score": "0.56454605", "text": "def nameservers\n get_extended_domain_attributes unless @nameservers\n return @nameservers\n end", "title": "" }, { "docid": "be4cb9447f694e2048d02fa69e14a932", "score": "0.56189984", "text": "def list\n unless @servers.empty?\n # displays a menu of available servers\n @servers.each_with_index do |server,i|\n puts \"#{(i+1).to_s.rjust(4)}. #{server['name']}\"\n end\n else\n puts \" There are no servers yet! Try `rush add`\\n\\n\"\n exit 0\n end\n end", "title": "" }, { "docid": "e43f4dc72a21f79847415e78f9edb28a", "score": "0.55966264", "text": "def read_node_name_servers(opts = {})\n data, _status_code, _headers = read_node_name_servers_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "01ff89a51282b7d07f022327fa03016c", "score": "0.5587282", "text": "def servers()\n servers = []\n servers.concat(@servers)\n\n @groups.each do |g|\n servers.concat(g.servers)\n end\n\n return servers\n end", "title": "" }, { "docid": "85f02d63d78b715050a9c81c3b1991c5", "score": "0.5584962", "text": "def servers\n nr_api.get(url('servers')).body['servers']\n rescue NoMethodError\n []\n end", "title": "" }, { "docid": "45ec0edcd9c3d444f390650c6573e5bd", "score": "0.5522143", "text": "def print_servers\n Notify.info('Sites')\n\n @config.get(:servers).each do |server|\n Notify.spit(\" - Name: #{server[:name]}, Address: #{server[:address]}, HTTPS: #{server[:https]}\")\n end\n end", "title": "" }, { "docid": "c8608a9b8cdc9bf02890145ec6723217", "score": "0.54997873", "text": "def get_servers_by_deployment(names)\n servers = []\n\n if names.size > 0\n names.each do |deployment|\n d = ::Deployment.find_by_nickname(deployment).first\n\n if d == nil\n if @ignore_errors\n Log.warn \"cannot find deployment #{deployment}\"\n else\n raise \"cannot find deployment #{deployment}\"\n end\n else\n d.servers_no_reload.each do |s|\n servers << s\n end\n end\n end\n end\n\n return(servers)\n end", "title": "" }, { "docid": "ae9d9b8a503430528283ec97029bbdb6", "score": "0.5498173", "text": "def servers(servers, name = nil)\n servers\n end", "title": "" }, { "docid": "e2ac6f62ff15111886d22c7fe8641ffc", "score": "0.5496473", "text": "def add_registered_name_server(params)\n get_request('addRegisteredNameServer?'+get_url_parameters(params)).body\n end", "title": "" }, { "docid": "79906326b6b0e45c4cd131cb5cb70062", "score": "0.54765254", "text": "def check_nameservers(name)\n provider.check_nameservers(name)\n end", "title": "" }, { "docid": "940403a471af0dfe4429e61260550afb", "score": "0.5434131", "text": "def list_domains_array()\n domains = []\n doc = Nokogiri::XML(list_domains())\n doc.xpath('/namesilo/reply/domains/domain').each do |domain|\n domains << domain\n end\n domains\n end", "title": "" }, { "docid": "3d9807fe99cae5012849ed5064bbb58f", "score": "0.54337984", "text": "def hosts\n @hosts ||= request(\"hosts\").exec_sync(:get).parse\n end", "title": "" }, { "docid": "f77222f5b35b2ea4df7aa6b32d3961ee", "score": "0.54252946", "text": "def addresses\n servers_list.map(&:address)\n end", "title": "" }, { "docid": "b7ff0daaf3809161d691a124a93f4a42", "score": "0.5423532", "text": "def lookup_addresses(data)\n return @servers\n end", "title": "" }, { "docid": "6f0a43af900d9ddcbdb88e579c776e8e", "score": "0.54205674", "text": "def modify_registered_name_server(params)\n get_request('modifyRegisteredNameServer?'+get_url_parameters(params)).body\n end", "title": "" }, { "docid": "a35c9eb46c2a37716a68d7e5fd83f7ff", "score": "0.5419782", "text": "def change_name_servers(params)\n get_request('changeNameServers?'+get_url_parameters(params)).body\n end", "title": "" }, { "docid": "a0f69035781b446cd157fe139ea3f5ed", "score": "0.54129964", "text": "def fetch_names(hosts)\n\tputs \"Fetching names...\"\n\thosts.each do |h|\n\t\tSNMP::Manager.open(:Host => h, :Version => :SNMPv1) do |manager|\n\t\t\tresponse = manager.get([\"sysDescr.0\", \"sysName.0\"])\n \n\t\t\tname = response.varbind_list[1].value.to_s + ' (' + response.varbind_list[0].value.to_s + ')'\n \n\t\t\t$names[h] = name\n\t\tend\n\tend\n\tputs \"Done.\"\nend", "title": "" }, { "docid": "be605bc501b20acffd542c2c5461829a", "score": "0.53873044", "text": "def named_remotes\n remotes\n end", "title": "" }, { "docid": "76c2c556c14499d232182eea11f7c577", "score": "0.53745186", "text": "def all_hostnames\n\t\t@hostnames.each { |hostname| yield hostname } if block_given?\n\n\t\t@hostnames\n\tend", "title": "" }, { "docid": "ccf810d2bbcb3ea4d70f0271b1fc982c", "score": "0.5361608", "text": "def get_servers_by_array(names)\n array_servers = []\n if names.size > 0\n names.each do |array_name|\n all_arrays = ::Ec2ServerArray.find_by(:nickname) { |n| n =~ /^#{array_name}/i }\n\n if all_arrays != nil and all_arrays.first != nil\n all_arrays.first.instances.each do |s|\n array_servers << s\n end\n end\n end\n end\n\n return(array_servers)\n end", "title": "" }, { "docid": "720485ea2ce1ee2f369702099c3d3bad", "score": "0.53453827", "text": "def list(fqdn, opts = {})\n call('domain.host.list', fqdn, opts).map do |host|\n self.new(host['name'], host)\n end\n end", "title": "" }, { "docid": "60f5ad9162149b59a8d402272f525d0a", "score": "0.5341327", "text": "def servers\n print_servers\n end", "title": "" }, { "docid": "ddfd825e9978c30669eec7816efb3eb4", "score": "0.53362817", "text": "def find_mgmt_nodes\n # assert self.serviceRegistration is not None\n list = List.new(client, \"com.vmware.cis\", \"vcenterserver\",\n \"vmomi\", \"com.vmware.vim\")\n\n list.invoke\n list.get_instance_names\n end", "title": "" }, { "docid": "b53dde47282ea1147344d7da868b86a6", "score": "0.53243023", "text": "def servers\n topology.servers(servers_list)\n end", "title": "" }, { "docid": "e1081b6b5433196683afc3e346a3a152", "score": "0.53170544", "text": "def hosts\n @results.map(&:host)\n end", "title": "" }, { "docid": "5470e53212426fc808d7cf3d24680747", "score": "0.5316411", "text": "def servers\n response = get \"server\"\n data = JSON.parse response.body\n data[\"servers\"][\"server\"]\n end", "title": "" }, { "docid": "36d2a4edc63387faeadc36018803abf8", "score": "0.53156954", "text": "def monitoring_registrations_list\n @proxy.monitoring_registrations_list\n end", "title": "" }, { "docid": "35a55b1afe6392a5873866b31d04a1e7", "score": "0.53142047", "text": "def servers\n @servers.keys\n end", "title": "" }, { "docid": "5763a8690a65a0d4c9021ea8b49fbe9f", "score": "0.53127694", "text": "def nameserver=(ns)\n @configured = true\n check_ns(ns)\n # @nameserver = ['0.0.0.0'] if (@nameserver.class != Array || @nameserver.empty?)\n # Now go through and ensure that all ns point to IP addresses, not domain names\n @nameserver=ns\n Dnsruby.log.debug{\"Nameservers = #{@nameserver.join(\", \")}\"}\n end", "title": "" }, { "docid": "56e19622e51ffb596761710dd7fa2da2", "score": "0.5309306", "text": "def listServers(_options)\n config = HBaseConfiguration.create\n\n zkw = org.apache.hadoop.hbase.zookeeper.ZKWatcher.new(config, 'draining_servers', nil)\n\n begin\n parentZnode = zkw.getZNodePaths.drainingZNode\n servers = ZKUtil.listChildrenNoWatch(zkw, parentZnode)\n servers.each { |server| puts server }\n ensure\n zkw.close\n end\nend", "title": "" }, { "docid": "6b27d436411563fd09947f095c8d77f6", "score": "0.53033566", "text": "def process_nameservers\n if datastore['NS'].blank?\n nameservers = datastore['DnsClientDefaultNS'].split(/\\s|,/)\n else\n nameservers = datastore['NS'].split(/\\s|,/)\n end\n\n invalid = nameservers.select { |ns| !Rex::Socket.dotted_ip?(ns) }\n if !invalid.empty?\n raise \"Nameservers must be IP addresses. The following were invalid: #{invalid.join(\", \")}\"\n end\n\n nameservers\n end", "title": "" }, { "docid": "1b9b9de0063cb2b574921f2a414b4f6c", "score": "0.529742", "text": "def get_host_list(name)\n #first get topology id by name\n id = get_topo_id(name)\n if id == nil\n puts \"incorrect name, id is null \"\n return nil\n end\n #second get TopologyInfo by calling client.getTopologyInfo\n topologyInfo = @@client.getTopologyInfo(id)\n executors = Hash.new\n topologyInfo.executors.each do |ea|\n key = ea.host\n if executors.has_key?(key) \n value = executors[key]\n else \n value = Array.new\n end\n value.push(ea.port)\n executors[key] = value\n end\n return executors \n end", "title": "" }, { "docid": "0219da1db8c49b9758fb86b8fe10b818", "score": "0.5283624", "text": "def servers\n local_server_address = cluster_manager.local_server_address\n servers={local_server_address => {:server_address => local_server_address}}\n cluster_manager.servers.each do |k,v|\n servers[k] = v.to_hash\n end\n content={:servers => servers}\n respond 200, content\n end", "title": "" }, { "docid": "b0b5dd4e7c5ea7a31a3c397811ea3dca", "score": "0.5280832", "text": "def servers\n @servers\n end", "title": "" }, { "docid": "874eb7306de145f5d1145d0697fe6608", "score": "0.52740467", "text": "def servers\n @servers ||= []\n end", "title": "" }, { "docid": "b3a28b3f8e96f2b8db6ced6da7273f9d", "score": "0.52739966", "text": "def add_nameserver(ns)\n @configured = true\n if (ns.kind_of?String)\n ns=[ns]\n end\n check_ns(ns)\n ns.reverse_each do |n|\n if (!@nameserver.include?(n))\n self.nameserver=[n]+@nameserver\n end\n end\n end", "title": "" }, { "docid": "05e78025880e82e09649dec058f61472", "score": "0.5267267", "text": "def servers\n return @servers.values\n end", "title": "" }, { "docid": "3b3003433e9055f30110414b85811694", "score": "0.5259148", "text": "def servers\n topology.servers(servers_list.compact).compact\n end", "title": "" }, { "docid": "4ef3dfa08c96ab3d0948f39660c1abe5", "score": "0.52567476", "text": "def addr_list(dom = nil)\r\n rslt = Array.new()\r\n domlist = Array.new()\r\n\r\n if dom\r\n domlist << dom\r\n else\r\n domlist = dominfo()\r\n end\r\n\r\n lastname = Hash.new()\r\n domlist.each do |d|\r\n begin\r\n Open3.popen3( @dir + \"bin/vuserinfo -D #{d[:domain]}\" ) do |i, o, e, t|\r\n while line = o.readline\r\n line.chomp\r\n if md = /^name:\\s(.+)/.match(line)\r\n if lastname.has_key?(:name)\r\n rslt << lastname\r\n lastname = Hash.new()\r\n end\r\n lastname[:name] = md[1]\r\n end\r\n\r\n # only parse output for information under some domain\r\n if lastname.has_key?(:name)\r\n if md = /^([\\w\\s]+):\\s*(.+)/.match(line)\r\n lastname[md[1]] = md[2]\r\n end\r\n end\r\n end\r\n end\r\n\r\n rslt << lastname if lastname.has_key?(:name)\r\n rescue EOFError\r\n # do nothing for eof error (because this is always happen as a pipe)\r\n end\r\n end\r\n\r\n rslt\r\n end", "title": "" }, { "docid": "333b359a9208045f71bc399c70906e2c", "score": "0.52486145", "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": "3e1a000c519f7cc339d4b75f67cae89b", "score": "0.52366644", "text": "def list_employees(api_object)\n puts \"Current Employees:\"\n doc = Nokogiri::XML.parse api_object.read\n names = doc.xpath('employees/employee/name').collect {|e| e.text }\n puts names.join(\", \")\n puts \"\"\nend", "title": "" }, { "docid": "d8fd8a076fd25d6e6659f9b831cdf0c6", "score": "0.5236538", "text": "def get_nameserver(domain)\n run_command :get, :nameserver, {\n :name => 'all',\n :domain => domain,\n :key => 'attributes'\n }\n end", "title": "" }, { "docid": "6630b487e418efe88bb66edc784aa32a", "score": "0.5236033", "text": "def hosts()\n host = []\n sites = YAML.load_file('sites.yml')\n\n if sites && sites['nginx_vhosts']\n sites['nginx_vhosts'].each do |site|\n host.push(site['server_name'])\n end\n end\n\n return host\nend", "title": "" }, { "docid": "b3a8cd52ea3b4cbc31295838da9a37b4", "score": "0.52041316", "text": "def servers(token)\n Discordrb::API.request(\n :users_me_guilds,\n nil,\n :get,\n \"#{Discordrb::API.api_base}/users/@me/guilds\",\n Authorization: token\n )\n end", "title": "" }, { "docid": "bcfffeefc46d0159f195982b71915db2", "score": "0.5195757", "text": "def list(filter = nil, ignorecase = true)\n node_names = []\n response_json = @client.api_get_request(\"/computer\")\n response_json[\"computer\"].each { |computer|\n node_names << computer[\"displayName\"] if computer[\"displayName\"] =~ /#{filter}/i\n }\n node_names\n end", "title": "" }, { "docid": "3c6aa0c5cbf4334cfbd66b5710726553", "score": "0.51899225", "text": "def virtual_server_names\n get_virtual_server_configs.keys.sort\n end", "title": "" }, { "docid": "ae8c3162cb353a7161ff06730da530ed", "score": "0.5181623", "text": "def\tcompare_nameservers(domain_name)\n\n\twhois_list = get_whois_nameservers(domain_name)\t\n\tputs \"whois:\" + whois_list.to_s\n\tdns_list = get_dns_nameservers(domain_name)\n\tputs \"dns: \" + dns_list.to_s\n\nend", "title": "" }, { "docid": "9bf45d81288224435d5e14d5fdbd7aa9", "score": "0.5174303", "text": "def index\n @fake_dns_servers = FakeDnsServer.order('name')\n end", "title": "" }, { "docid": "4680e19968ac1ecf2008f87116c5e323", "score": "0.517398", "text": "def nameservers=(*list)\n @nameservers = list.flatten.compact\n @nameservers = nil if (list.empty?)\n end", "title": "" }, { "docid": "bd74a1893c72cc8d41cd4969306385d6", "score": "0.51737285", "text": "def get_servers_labeled(labels)\n label_query = Array(labels).reject { |x| !x.include?(':') }.join(';')\n return [] unless label_query\n nr_api.get(url('servers'), 'filter[labels]' => label_query).body\n end", "title": "" }, { "docid": "995287c17028888773dcbed166c5e5f2", "score": "0.5173491", "text": "def names()\n names = []\n names.push \"nsfw\"\n return names\n end", "title": "" }, { "docid": "0fe5a9f2da96633262bdcf66154bf93b", "score": "0.51593935", "text": "def register_users\n data = \"registered_users #{@host}\"\n response(data)\n end", "title": "" }, { "docid": "b5fda93acd995a31e1fb516f0c9e108c", "score": "0.5154996", "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": "b5fda93acd995a31e1fb516f0c9e108c", "score": "0.5154996", "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": "99500bd801d3e3a214f9d2e138fc208f", "score": "0.5152972", "text": "def get_hosts_for_app(appname)\n app_data = get_app_data(appname)\n hosts = app_data.scan(/\\nhosts:([\\d\\.|:]+)\\n/).flatten.to_s.split(\":\")\n ports = app_data.scan(/\\nports: ([\\d|:]+)\\n/).flatten.to_s.split(\":\")\n\n host_list = []\n\n hosts.each_index { |i|\n host_list << \"#{hosts[i]}:#{ports[i]}\"\n }\n\n return host_list\n end", "title": "" }, { "docid": "43237f330f7a78823ea8c13ff04589ce", "score": "0.51463914", "text": "def servers\n @servers ||= []\n end", "title": "" }, { "docid": "4c4a4365c0474b2f5bbfe42caa4446cb", "score": "0.5139981", "text": "def list\n server = Chaos::Server.new \"ssh://#{options[:server]}\"\n name = options[:name] || File.basename(Dir.pwd)\n app = Chaos::App.new name, server\n\n display_ \"Domains configured for '#{app.name}' on '#{app.server}':\", :topic\n app.domains\n end", "title": "" }, { "docid": "d6dc2de0cd64906955efc4f7bbe1c49a", "score": "0.5133975", "text": "def host_name_list\n @hosts.values.map(&:to_s).sort.join(',')\n end", "title": "" }, { "docid": "53514f204a89b1611d8d7408d76754a7", "score": "0.51327765", "text": "def names\n named_remotes.keys\n end", "title": "" }, { "docid": "5888afd30c0b8004b068943352ca4e9e", "score": "0.51315624", "text": "def name_servers=(servers)\n servers = servers.inject({}) { |hash, server| hash.merge(\"ns#{hash.length + 1}\" => server) }\n body = { :name_servers => servers }\n response = DNSimple::Client.post(\"/v1/domains/#{name}/name_servers\", :body => body)\n case response.code\n when 200\n response.parsed_response\n else\n raise RequestError.new(\"Error setting nameservers for #{name}\", response)\n end\n end", "title": "" } ]
4c88234d7a125e54ee4c69785691b15d
GET /governance_score_yahoos GET /governance_score_yahoos.json
[ { "docid": "4373b1c5621304582ac9caca199a8921", "score": "0.7117656", "text": "def index\n @governance_score_yahoos = GovernanceScoreYahoo.all\n end", "title": "" } ]
[ { "docid": "a31f4db4a7029b1d32384da31014c622", "score": "0.61347705", "text": "def governance_score_yahoo_params\n params[:governance_score_yahoo]\n end", "title": "" }, { "docid": "ac9ba9c42bead6fb94c037723f8b5cfb", "score": "0.6099912", "text": "def set_governance_score_yahoo\n @governance_score_yahoo = GovernanceScoreYahoo.find(params[:id])\n end", "title": "" }, { "docid": "87a3817df084fb3a171a8c6e6383614a", "score": "0.57407975", "text": "def float_score\n base_uri = ENV['BASE_URI']\n response = HTTParty.get \"#{base_uri}/score/accounts_safe_to_loan\",\n :cookies =>\n {:laravel_session => cookies[:laravel_session]}\n @json_response = JSON.parse(response.body)\n\n if response.code == 200\n @float_score = @json_response[\"data\"][\"safe_to_loan\"]\n else\n redirect_to institutions_path\n end\n\n end", "title": "" }, { "docid": "8839ae561ce15b97d8858a7864282eb0", "score": "0.5730425", "text": "def destroy\n @governance_score_yahoo.destroy\n respond_to do |format|\n format.html { redirect_to governance_score_yahoos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9c5cedd8805e50041189e227eff168cd", "score": "0.569932", "text": "def index\n @scores = @user.water_scores.all \n render json: @scores\n end", "title": "" }, { "docid": "c8516839fe39b90f032b98e12fef7fad", "score": "0.5696046", "text": "def index\n @oenologist_scores = OenologistScore.all\n end", "title": "" }, { "docid": "05c947bb4938a56bc87ddd70b1d12051", "score": "0.56539786", "text": "def get_high_scores\n RESTful.get(\"#{URL_MICROSERVICE_PLAYER}/players\")\n end", "title": "" }, { "docid": "05d31c73af8bfdd3560ecf0b3a93e534", "score": "0.5583244", "text": "def index\n @yugiohs = Yugioh.all\n end", "title": "" }, { "docid": "f99ba7cf5dd0cf5213a7a0144d7ab3e6", "score": "0.55733633", "text": "def index\n @gyulas = Gyula.all\n end", "title": "" }, { "docid": "04a8deab6fd26a30ac16512722115959", "score": "0.5553398", "text": "def show\n @high_score = HighScore.find(params[:id])\n\n render json: @high_score\n end", "title": "" }, { "docid": "81af093edfa26195cfa9782a65b1e6f6", "score": "0.5550134", "text": "def highest_scoring_visitor\n best_offense(\"away\")\n end", "title": "" }, { "docid": "a0a07af89cc6653ed726bc8733be0c50", "score": "0.5544629", "text": "def show\n @admin_high_scores = Admin::HighScore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_high_score }\n end\n end", "title": "" }, { "docid": "7b7e2feacb0c5509d6492809c9e6c4b0", "score": "0.5523356", "text": "def index\n @syaryos = Syaryo.all\n end", "title": "" }, { "docid": "00e8ed41a641584a8fed477746e3556c", "score": "0.5509936", "text": "def update_score\n\tscraper = Scraper.new(\"http://scores.espn.go.com/ncb/boxscore?gameId=\" + @game.unique_identifier) if @game.unique_identifier\n\t\n\t@scores = {home: scraper.get_home_score, away: scraper.get_visitor_score}\n\t\n\trender json: @scores\n end", "title": "" }, { "docid": "4c5defe9f6efef1baf60824ce3093989", "score": "0.5442989", "text": "def index\n @yogas = Yoga.all\n end", "title": "" }, { "docid": "2b4ebd9d8a2c42c8c136ef1a1e440468", "score": "0.543941", "text": "def get_costs\n @result = { :bunker => GameRules::COST_BUNKER, :artillery => GameRules::COST_ARTILLERY, :jamming => GameRules::COST_JAMMING_TOWER }\n\n respond_to do |format|\n format.xml { render :layout => false }\n end\n end", "title": "" }, { "docid": "e6686129fad9d8769261e6435d5f0a14", "score": "0.5436679", "text": "def update\n respond_to do |format|\n if @governance_score_yahoo.update(governance_score_yahoo_params)\n format.html { redirect_to @governance_score_yahoo, notice: 'Governance score yahoo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @governance_score_yahoo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a885e9924a02a9de1665ebf6108d98c2", "score": "0.54332167", "text": "def get_score(klout_id)\n response = do_get(\"/user.json/#{klout_id}/score?key=#{url_encode(@api_key)}\")\n if response.status == 200\n JSON.parse(response.body)[\"score\"]\n end\n end", "title": "" }, { "docid": "711e4ff913f546604d833cc20e01101b", "score": "0.5421886", "text": "def index\n @hmm_score_criteria = HmmScoreCriterion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hmm_score_criteria }\n end\n end", "title": "" }, { "docid": "7f0c17068abf5e6370a4a694a8b71160", "score": "0.5406604", "text": "def get_recommended_valence\n begin\n res = get_recommended_valence_helper(reco_engine_uri)\n if(res.code.include? \"200\")\n render :json => res.body, :status => 200\n else\n render :json => res.body, :status => 500\n end\n rescue => e\n render :json => {:error=>'Something went wrong'}, :status => 500\n end\n end", "title": "" }, { "docid": "db86747c98beb393813fa7162df74955", "score": "0.540298", "text": "def index\n @highscores = Highscore.all\n end", "title": "" }, { "docid": "c409d6c8f03ad16e1d5e60dd3ea5fcb9", "score": "0.538594", "text": "def index\n @official_scores = OfficialScore.all\n end", "title": "" }, { "docid": "50d3296118c62a30740b154e02e8b7ba", "score": "0.53829587", "text": "def popular_guesses\n about_user = User.find_by(id: params[:about_user_id].to_i)\n return render json: { error: 'User cannot be found.' }, status: 403 if about_user.nil?\n\n popular_guesses = get_popular_guesses_about(about_user)\n\n respond_to do |format|\n response.status = 200\n format.json { render json: {\n popular_guesses: popular_guesses\n }}\n end\n end", "title": "" }, { "docid": "120897727bfa0f6677a78d4f2f7a9bb4", "score": "0.5376944", "text": "def index\n @scores = @user.scores.all\n\n render json: @scores\n end", "title": "" }, { "docid": "db0d56f6ac810a3958a84c4b596622b2", "score": "0.5360603", "text": "def show\n @high_score = HighScore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @high_score }\n end\n end", "title": "" }, { "docid": "4627d1636814b9b8ba32a33091084f9f", "score": "0.5357667", "text": "def index\n @games_leaderboards_scores = Games::Leaderboards::Score.all\n\n render json: @games_leaderboards_scores\n end", "title": "" }, { "docid": "0a954239a078929df7526c5a459c8a58", "score": "0.53402305", "text": "def get_scoreboard_data\n unless @guidance_quiz.feedback_show_scoreboard\n respond_to do |format|\n format.json { render json: { access_denied: \"Scoreboard not enabled!\" } }\n end\n end\n\n score_data = @guidance_quiz.submissions\n .attempting_format\n .joins(:std_course)\n .where(\"assessment_submissions.std_course_id = user_courses.id\")\n .joins(\"INNER JOIN users ON users.id = user_courses.user_id\")\n .joins(:concept_stages)\n .select(\"users.profile_photo_url as img, user_courses.name, SUM(assessment_guidance_concept_stages.rating_right) as rating\")\n .where(\"assessment_submissions.id = assessment_guidance_concept_stages.assessment_submission_id and assessment_guidance_concept_stages.failed = 0\")\n .group(\"assessment_guidance_concept_stages.assessment_submission_id\")\n .order(\"rating DESC\")\n .limit(10)\n\n\n respond_to do |format|\n format.json { render json: score_data}\n end\n end", "title": "" }, { "docid": "850c900409be4e0d0f340a97762af62f", "score": "0.5324777", "text": "def index\n @away_scores = AwayScore.all\n end", "title": "" }, { "docid": "50f14454eaddf8aee2b61808fde825a3", "score": "0.52902544", "text": "def index\n @ethnoidioglosses = Ethnoidiogloss.all\n end", "title": "" }, { "docid": "ab1eb778d2c934fd32f6980d09b88d9f", "score": "0.5284242", "text": "def get_trophies\n @level = params[:level].to_i\n @score = params[:score].to_i\n @won_trophies = Trophy.get_new_trophies_for_gamer(current_gamer.id,\n @score, @level)\n @won_prizes = Prize.get_new_prizes_for_gamer(current_gamer.id,\n @score, @level)\n\n if @score > current_gamer.highest_score.to_i\n current_gamer.update_attributes!(highest_score: @score)\n end\n respond_to do |format|\n format.js\n end\n end", "title": "" }, { "docid": "d7c5348e9bd2b6c1ab18438073d8b528", "score": "0.52821547", "text": "def create\n @governance_score_yahoo = GovernanceScoreYahoo.new(governance_score_yahoo_params)\n\n respond_to do |format|\n if @governance_score_yahoo.save\n format.html { redirect_to @governance_score_yahoo, notice: 'Governance score yahoo was successfully created.' }\n format.json { render action: 'show', status: :created, location: @governance_score_yahoo }\n else\n format.html { render action: 'new' }\n format.json { render json: @governance_score_yahoo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d69098e1b8ccda9e6d749e9c211f7f87", "score": "0.5275233", "text": "def index\n\n @response = HTTParty.get(\"http://www.sfu.ca/bin/wcm/course-outlines?2016/spring/cmpt/307/d100\")\n @http_party_json = JSON.parse(@response.body)\n @result = @response.body\n pp @http_party_json_year\n respond_to do |format|\n format.json {render :json => JSON.parse(@result)}\n format.html # index.html.erb\n end\nend", "title": "" }, { "docid": "f4e5648c24e1c2a400c0a6711f295975", "score": "0.52738553", "text": "def highscore\n\n count = 20\n if !params[:count].nil?\n count = params[:count]\n end\n\n players = Player.order(score: :desc).first(count)\n render :json => players, :except => [:password_digest]\n\n end", "title": "" }, { "docid": "a63ad924bae2a950d44dfa27cbfe3795", "score": "0.52677923", "text": "def highest_scoring_home_team\n best_offense(\"home\")\n end", "title": "" }, { "docid": "14bd70c18cd4b0b0d99de7cc903cdce5", "score": "0.52591497", "text": "def index\n @yeahs = Yeah.all\n end", "title": "" }, { "docid": "4f9a5968c367dfb972c1887b90173a52", "score": "0.5252984", "text": "def index\n @olympics = policy_scope(Olympic)\n end", "title": "" }, { "docid": "ac9d8fe3f91667163d89c4bc39b34163", "score": "0.5243816", "text": "def show\n @school = School.find(params[:id])\n lat = @school.latitude\n long = @school.longitude\n @crimes = @@client.get(\"sspu-uyfa\", {\"$where\" => \"within_circle(shape, #{lat}, #{long}, 300) AND ucr_general in ('100', '200', '400', '1400', '1600', '1700', '1800', '1900', '2000', '2400', '2500') AND dispatch_date_time between '#{Time.now.year-3}-#{Time.now.month}-#{Time.now.day}T00:00:00' and '#{Time.now.year}-#{Time.now.month}-#{Time.now.day}T00:00:00'\"})\n \n @score = @crimes.inject(0) { |sum, c|\n if [\"100\", \"200\"].include? c[\"ucr_general\"] then\n sum + 5 \n elsif [\"1700\", \"2000\"].include? c[\"ucr_general\"] then\n sum + 4\n elsif [\"400\", \"1600\", \"1800\"].include? c[\"ucr_general\"] then\n sum + 3\n elsif [\"1400\", \"1900\"].include? c[\"ucr_general\"] then\n sum + 2\n elsif [\"2400\", \"2500\"].include? c[\"ucr_general\"] then\n sum + 1\n end\n }\n \n @score = @score.to_f / @crimes.length\n @score = 5 - @score\n @score = @score.to_i\n \n respond_to do |format|\n format.js\n format.html do\n redirect_to '/'\n end\n end\n end", "title": "" }, { "docid": "5fcc5ecab51966ec0f4345e179e51111", "score": "0.52190304", "text": "def show\n render json: @score, status: :ok\n end", "title": "" }, { "docid": "4a96bad2424136bffb535a5ee4349b7f", "score": "0.52163285", "text": "def index\n @osoby = Osoba.all\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @osoby }\n end\n end", "title": "" }, { "docid": "137d8c74d38dd7d8cf2ec077eb591456", "score": "0.52062154", "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": "8d809cc4d566d35f94e2db3b55f36417", "score": "0.5188051", "text": "def get_scores\n items_db = DYNAMODB.scan(table_name: TABLE_NAME).items\n items_hash = make_result_list(items_db)\n items = items_hash.sort_by { |hash| hash['score'] }\n make_response(HttpStatus::OK, items.reverse().first(10))\nend", "title": "" }, { "docid": "36c26ac5af02666210a8210d9c6fa4a8", "score": "0.51833177", "text": "def index\n @osies = Osy.all.paginate(page: params[:page], per_page: 7 )\n end", "title": "" }, { "docid": "6add403963bed4591875dd1f22e9524a", "score": "0.5177856", "text": "def my_loyalty_programs\n if @user\n @user_programs = @user.loyalty_programs\n if params[:q]\n @user_programs = @user.loyalty_programs.order(\"#{params[:q]} desc\")\n end\n render json: {\n success: true,\n programs: @user_programs.as_json({\n only: [:id, :name, :color_palette, :used_counter],\n methods: [:image_url, :icon_url],\n })\n }\n else\n render json: {\n success: false,\n message: \"Ooops! invalid access token\"\n }\n end\n end", "title": "" }, { "docid": "7b13f289d22c2af9ae8f2105e154b8a7", "score": "0.5177419", "text": "def index\n @loco_evaluations = LocoEvaluation.all\n end", "title": "" }, { "docid": "3e3ce54351134321987c8e15eb94ffcc", "score": "0.5167371", "text": "def index_statistics\n @vehicle_statistics = VehicleMake.averages_by_year([\n :city_mpg,\n :hwy_mpg,\n :combined_mpg,\n :air_pollution_score,\n :greenhouse_gas_score\n ])\n respond_to do |format|\n format.json { render json: @vehicle_statistics }\n format.any\n end\n end", "title": "" }, { "docid": "ee0906bf44f1d6f0bd5e2a1a9f71f2ab", "score": "0.516075", "text": "def index\n @yyys = Yyy.all\n end", "title": "" }, { "docid": "c719feefd7580aa4e50437078deb8cce", "score": "0.5160608", "text": "def show\n render json: @games_leaderboards_score\n end", "title": "" }, { "docid": "3b7b1d98e58f5b2e9a201260b376554b", "score": "0.51517767", "text": "def score\n response[\"score\"]\n end", "title": "" }, { "docid": "90ea58c4cef4fcdd6986cb648a9206df", "score": "0.5149896", "text": "def set_oenologist_score\n @oenologist_score = OenologistScore.find(params[:id])\n end", "title": "" }, { "docid": "cd6350644b60cb809fcee898941f13d7", "score": "0.5143344", "text": "def index\n @yasais = Yasai.all\n end", "title": "" }, { "docid": "1856aad11efaabcc77d12a1167553ec4", "score": "0.51388043", "text": "def calculate_score\n @data = JSON.parse(open(github_url).read)\n @score = @data.inject(0) do |result, data|\n type = data[\"type\"].to_sym\n\n if @event_slab.has_key? type\n result += @event_slab[type]\n else\n result += @event_slab[:\"Any other event\"]\n end\n \n result\n end\n end", "title": "" }, { "docid": "dfd4162763194df12776f12f24de5ddc", "score": "0.51360184", "text": "def get_max_score()\n max_score = 0\n ALLERGY_DATA.each do |key, value|\n max_score += value\n end\n return max_score\nend", "title": "" }, { "docid": "3c9cf4caae26f57900df159081ad46f0", "score": "0.51342", "text": "def index\n @other_graduates = OtherGraduate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @other_graduates }\n end\n end", "title": "" }, { "docid": "877fe638ea47753a498a6ecc09b63a6b", "score": "0.5130856", "text": "def index\n @workshop_scores = WorkshopScore.all\n end", "title": "" }, { "docid": "b4085e9525c7dcecb94fc90f32759e41", "score": "0.51237553", "text": "def show\n @hca_score = HcaScore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hca_score }\n end\n end", "title": "" }, { "docid": "b0167c90136de2dce762502ac15a5a74", "score": "0.512348", "text": "def score\n playerValue = ZScore.player_value_by_game(82, params[:player_id])\n render json: {\n playerValue: playerValue\n }\n end", "title": "" }, { "docid": "b5e2e47302c25875c591bda4b057511c", "score": "0.51129156", "text": "def index\n @oscare_male_winners = OscareMaleWinner.all\n end", "title": "" }, { "docid": "ef64c864c7c191d3b65b9115fbf1d615", "score": "0.5109985", "text": "def gettrophies\n @level = params[:level].to_i\n @score = params[:score].to_i\n @won_trophies = Trophy.get_new_trophies_for_gamer(current_gamer.id, \n @score, @level)\n @won_prizes = current_gamer.won_prizes?(@score, @level)\n @won_trophies.map { |nt| current_gamer.trophies << nt }\n if @score > current_gamer.highest_score.to_i\n current_gamer.update_attributes!(:highest_score => @score)\n end\n respond_to do |format|\n format.js\n end\n end", "title": "" }, { "docid": "867f8f29ca6638d96bf832c42af94722", "score": "0.5101583", "text": "def index\n @oscare_female_winners = OscareFemaleWinner.all\n end", "title": "" }, { "docid": "ca82afddf1ca984750a9a4eb97e5fa1c", "score": "0.50922674", "text": "def index\n @gyms = Gym.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gyms }\n end\n end", "title": "" }, { "docid": "d13359a6abf2ee12dd7d0abcc3213b02", "score": "0.50921464", "text": "def sympols_index_action\n response = Unirest.get(\"http://localhost:3000/sympols\")\n sympols = response.body\n puts JSON.pretty_generate(sympols)\n end", "title": "" }, { "docid": "5549eee82d223f48e77fad422d7fb25b", "score": "0.5087318", "text": "def highScoreDemographic\n\n count = 20\n if !params[:count].nil?\n count = params[:count]\n end\n\n demographic = 'UK'\n if !params[:demographic].nil?\n demographic = params[:demographic]\n end\n\n index = 1\n players = Player.where('demographic = ?', demographic).order(score: :desc).first(count)\n players.each do |playersHistory|\n playersHistory.rank = index\n index = index + 1\n end\n\n render :json => players, :except => [:password_digest]\n\n end", "title": "" }, { "docid": "ab12ad48a977aea242ba3558baf922d2", "score": "0.50851554", "text": "def index\n @gazooies = Gazooy.all\n end", "title": "" }, { "docid": "6e0df6f1b24718069e9053abc41f934f", "score": "0.50809646", "text": "def scores_desc\n @scores = Score.order(\"score DESC\") ##descendent\n render json: @scores\n end", "title": "" }, { "docid": "202cb485c24b247b5248221c470d4f83", "score": "0.5066672", "text": "def index\n @hollywoodesque_neuroses = HollywoodesqueNeurose.all\n end", "title": "" }, { "docid": "601fbe0a7befc8e1da1e35f8b58c0f67", "score": "0.50644654", "text": "def preferred_score\n :highscore\n end", "title": "" }, { "docid": "8032edb09a59c3053fc135a70f6fa462", "score": "0.5061976", "text": "def rate_analysts_opinion(analysts_opinion)\n all = analysts_opinion.buy + analysts_opinion.hold + analysts_opinion.sell\n Rails.logger.debug(\"#{self.class}: Total opinions: #{all}\")\n buy = analysts_opinion.buy.to_f / all\n Rails.logger.debug(\"#{self.class}: buy in percent: #{buy}\")\n hold = analysts_opinion.hold.to_f / all\n Rails.logger.debug(\"#{self.class}: hold in percent: #{hold}\")\n sell = analysts_opinion.sell.to_f / all\n Rails.logger.debug(\"#{self.class}: sell in percent: #{sell}\")\n case\n when buy > hold && buy > sell\n if all > 5\n score = -1\n else\n Rails.logger.debug(\"#{self.class}: switching rule because less than five analysts are watching\")\n score = 1\n end\n when hold > buy && hold > sell\n score = 0\n when sell > buy && sell > hold\n if all > 5\n score = 1\n else\n Rails.logger.debug(\"#{self.class}: switching rule because less than five analysts are watching\")\n score = -1\n end\n else\n score = -1\n end\n analysts_opinion.score = score\n return score\n end", "title": "" }, { "docid": "f532edb6bf051050b70e7f2d195f87a6", "score": "0.506106", "text": "def lowest_scoring_visitor\n worst_offense(\"away\")\n end", "title": "" }, { "docid": "9ea63e189c8e669f22836c385e97515e", "score": "0.5060464", "text": "def index\n @housing_qualities = HousingQuality.all\n end", "title": "" }, { "docid": "be3b70198336a02c9daa09cf8f38d73f", "score": "0.5059393", "text": "def index\n @eigyosyos = Eigyosyo.all\n end", "title": "" }, { "docid": "c1fbd4a02bd7f16ea7eff774279c5ce1", "score": "0.5058578", "text": "def rate_analysts_opinion(analysts_opinion)\n all = analysts_opinion.buy + analysts_opinion.hold + analysts_opinion.sell\n Rails.logger.debug(\"#{self.class}: Total opinions: #{all}\")\n buy = analysts_opinion.buy.to_f / all\n Rails.logger.debug(\"#{self.class}: buy in percent: #{buy}\")\n hold = analysts_opinion.hold.to_f / all\n Rails.logger.debug(\"#{self.class}: hold in percent: #{hold}\")\n sell = analysts_opinion.sell.to_f / all\n Rails.logger.debug(\"#{self.class}: sell in percent: #{sell}\")\n case\n when buy > hold && buy > sell\n score = -1\n when hold > buy && hold > sell\n score = 0\n when sell > buy && sell > hold\n score = 1\n else\n score = -1\n end\n analysts_opinion.score = score\n return score\n end", "title": "" }, { "docid": "6dc06c99c09c48108051b9a28ad1a8d9", "score": "0.50487727", "text": "def index\n @itheros = Ithero.all\n @salaries = ['Java', 'PHP', 'Ruby/Rails'].map { |spec| Ithero.average_for(spec).to_i}\n puts '#{@salaries} ++++++++++++++'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @itheros }\n end\n end", "title": "" }, { "docid": "3b4c4eabe0f28bbccfd168e544c4b696", "score": "0.50481796", "text": "def available_achievements\n render json: achievements\n end", "title": "" }, { "docid": "585b3a3152b025df704b7797ea3d08cc", "score": "0.5047017", "text": "def set_osy\n @osy = Osy.find(params[:id])\n end", "title": "" }, { "docid": "faf076954a8e771272351312eb33bca5", "score": "0.50462544", "text": "def index\n render json: User.order(total_score: :desc)\n end", "title": "" }, { "docid": "0611b877bc093cf4fcf0d5ae1aaf35de", "score": "0.504411", "text": "def get_tournament_scores(tournament)\n\tmatches = []\n\ttournament.matches.each do |result|\n\t\tmatch = { :match => result, :scores => result.scores }\n\t\tmatches << match\n\tend\n\n\tresource = { :tournament => tournament, :matches => matches }\nend", "title": "" }, { "docid": "8847cf3c01237b88ee511b0808034e77", "score": "0.5042067", "text": "def loyalty\n @loyalty ||= LoyaltyApi.new config\n end", "title": "" }, { "docid": "1ee5d9a1421392b9986ac26d55c48403", "score": "0.50379616", "text": "def getGoalieStats(numYears,yearCombo,year1,year2)\n @year1 = year1\n @year2 = year2\n for i in 0..(numYears-1)\n @goaliesIds.push([])\n @goalies.push([])\n aggregate = \"true\"\n if (yearCombo == 0)\n aggregate = \"false\"\n end\n basic = JSON.parse(RestClient.get \"http://www.nhl.com/stats/rest/goalies?isAggregate=#{aggregate}&reportType=season&isGame=false&reportName=goaliesummary&sort=playerId&cayenneExp=gameTypeId=2%20and%20seasonId<=#{@year1+i+yearCombo}#{@year2+i+yearCombo}%20and%20seasonId>=#{@year1+i}#{@year2+i}%20and%20gamesPlayed>=3\")['data']\n byStrength = JSON.parse(RestClient.get \"http://www.nhl.com/stats/rest/goalies?isAggregate=#{aggregate}&reportType=season&isGame=false&reportName=goaliebystrength&sort=playerId&cayenneExp=gameTypeId=2%20and%20seasonId<=#{@year1+i+yearCombo}#{@year2+i+yearCombo}%20and%20seasonId>=#{@year1+i}#{@year2+i}%20and%20gamesPlayed>=3\")['data']\n puts (year1 + i)\n for j in 0..basic.length-1\n player = basic[j]\n @goaliesIds[@goaliesIds.length-1].push(player[\"playerId\"])\n playerInfo = {\"First Name\" => player[\"playerFirstName\"], \"Last Name\" => player[\"playerLastName\"], \"Team\" => player[\"playerTeamsPlayedFor\"], \"Age\" => (@year2+i+yearCombo-(player[\"playerBirthDate\"][0..4]).to_i), \n \"position\" => player[\"playerPositionCode\"],\"ID\" => player[\"playerId\"]}\n baseStats = {\"GP\" => player[\"gamesPlayed\"], \"GS\" => player[\"gamesStarted\"], \"W\" => player[\"wins\"], \"L\" => player[\"losses\"], \"OTL\" => player[\"otLosses\"], \"SO\" => player[\"shutouts\"], \n \"GAA\" => player[\"goalsAgainstAverage\"], \"GA\" => player[\"goalsAgainst\"], \"SA\" => player[\"shotsAgainst\"], \"SV\" => player[\"saves\"], \"SV%\" => player[\"savePctg\"]}\n player = byStrength[j] \n byStrengthStats = {\"ESGA\" => player[\"evGoalsAgainst\"], \"ESSV%\" => player[\"evSavePctg\"], \"ESSV\" => player[\"evSaves\"], \"EVSA\" => player[\"evShotsAgainst\"], \n \"PPGA\" => player[\"ppGoalsAgainst\"], \"PPSV%\" => player[\"ppSavePctg\"], \"PPSV\" => player[\"ppSaves\"], \"PPSA\" => player[\"ppShotsAgainst\"], \n \"SHGA\" => player[\"shGoalsAgainst\"], \"SHSV%\" => player[\"shSavePctg\"], \"SHSV\" => player[\"shSaves\"], \"SHSA\" => player[\"shShotsAgainst\"]}\n @goalies[@goalies.length-1].push({\"Info\" => playerInfo, \"Base Stats\" => baseStats, \"Saves By Strength Stats\" => byStrengthStats})\n end\n end\nend", "title": "" }, { "docid": "2d1cf38f9f301fbe755486944f19c563", "score": "0.5027349", "text": "def getscore\n begin\n scores = JSON.parse(URI.open('https://stats.foldingathome.org/api/donors?name=John_Messenger&search_type=exact').read())\n results = scores['results'][0]\n $foldscore.value = results['credit']\n $rank.value = results['rank']\n rescue => e\n puts e.message\n $foldscore.value = ''\n $rank.value = ''\n end\n begin\n statii = JSON.parse(URI.open('http://127.0.0.1:7396/ping').read().gsub(/'/, '\"'))\n puts \"statii is #{statii.inspect}\"\n $fstatus.value = statii['version']\n rescue => ee\n puts ee.message\n $fstatus.value = 'Not folding'\n end\nend", "title": "" }, { "docid": "75d6f5c9c29305986d23fe96004b0962", "score": "0.5027088", "text": "def index\n @how_majestics = HowMajestic.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @how_majestics }\n end\n end", "title": "" }, { "docid": "f209d44b113b47822c58b6714c78e99b", "score": "0.502465", "text": "def get_score\n RESTful.put(\"#{URL_MICROSERVICE_PLAYER}/score\", {'id' => @idPlayer}.to_json, 'application/json')\n score = RESTful.get(\"#{URL_MICROSERVICE_PLAYER}/player/#{@idPlayer}/score\")\n score[0]['score']\n end", "title": "" }, { "docid": "a10956e8e7be2936cf26a77bcb6b2905", "score": "0.5021573", "text": "def score(social_network, username)\n begin\n @data = self.class.get(\"?term=#{username}&source=#{social_network}&app_id=#{@app_id}&app_key=#{@app_key}\", verify: false)\n result = @data ? JSON.parse(@data.body) : nil\n result['data'][0]['influence'] if result && result['data']\n rescue Timeout::Error\n nil\n end\n end", "title": "" }, { "docid": "ac9ea230f0745ba744dc4cc008f25121", "score": "0.5020452", "text": "def loyalty\n @loyalty ||= LoyaltyApi.new @global_configuration\n end", "title": "" }, { "docid": "658397374bae965ba7fcfece64864136", "score": "0.50201243", "text": "def index\n @scoring_statistics = ScoringStatistic.all\n end", "title": "" }, { "docid": "cefce46c4e28a4fb123313c9293b7abf", "score": "0.50193447", "text": "def show\n # byebug\n user = User.find(params[:id])\n # byebug\n render json: user.scores\n end", "title": "" }, { "docid": "c16f40ae4a37cc7c9033e1d56941f243", "score": "0.50170034", "text": "def index\n @scope = params[:scope].symbolize if params[:scope].present?\n @scope ||= :approve_to_make\n\n @hover_crafts = HoverCraft.try(@scope).desc(:fit_score)\n @hover_crafts ||= HoverCraft.approve_to_make\n @hover_crafts.desc(:fit_score)\n # @hover_crafts = HoverCraft.ready_to_make.desc(:fit_score)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: nil }\n end\n end", "title": "" }, { "docid": "10aa2c4e5aab933240d391901473a333", "score": "0.50148237", "text": "def index\n @core_competencies = CoreCompetency.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @core_competencies }\n end\n end", "title": "" }, { "docid": "993c86dcb249cd392584b33de315f2bf", "score": "0.50104415", "text": "def index\n @garelleys = Garelley.all\n end", "title": "" }, { "docid": "babf4cfa06fe5c99663fc1db99668f60", "score": "0.50101393", "text": "def show\n @loyalty = Loyalty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @loyalty }\n end\n end", "title": "" }, { "docid": "dfa8ea636aebb1b392f2a07176bf66d6", "score": "0.50014794", "text": "def new\n @admin_high_score = Admin::HighScore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_high_score }\n end\n end", "title": "" }, { "docid": "d3392fd09148a0cc439d59468fbdadd1", "score": "0.49987778", "text": "def index\n\n\n\n\n\n @legislations = Legislation.all(:order => 'votes_count DESC')\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @legislations }\n end\n end", "title": "" }, { "docid": "40835efce5a41b13a0670287f0d1e4ab", "score": "0.49952942", "text": "def high_risks\n\t\t\t\t\twhere(:risk_factor => \"High\")\n\t\t\t\tend", "title": "" }, { "docid": "40835efce5a41b13a0670287f0d1e4ab", "score": "0.49952942", "text": "def high_risks\n\t\t\t\t\twhere(:risk_factor => \"High\")\n\t\t\t\tend", "title": "" }, { "docid": "479cb7b046bbba3ce304b7eca9f9ed29", "score": "0.49939007", "text": "def index\n @metrics = @idea.metrics.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @metrics }\n end\n end", "title": "" }, { "docid": "604cbf85f7c961681345f39ae44e2af8", "score": "0.49921113", "text": "def index\n @search = Goalie.search(params[:q])\n @goalies = @search.result\n end", "title": "" }, { "docid": "45c9be39311b418f05e93354320e99b6", "score": "0.49905324", "text": "def getcompanygrowth\n #@company = CompanyGrowth.where(\"year LIKE :year AND company_id = :compId\",{:year => \"#{params[:year]}%\",:compId => \"#{params[:compId]}\"}) \n result = Hash.new\n result[:revenues] = BaseValue.where(\"year = ? AND company_id = ?\",params[:year],params[:compId]) \n result[:baseValue] = BaseValue.where(\"company_id = ? AND is_base =1 \",params[:compId]) \n \n render :json => result\n #render :json => company\n end", "title": "" }, { "docid": "38e1ae8234a9ba682b73676c25ab79f9", "score": "0.4988727", "text": "def index\n @scoring_systems = ScoringSystem.all\n end", "title": "" }, { "docid": "f83322bd4d8c7f531d065151da8b653f", "score": "0.49883842", "text": "def honeypot_score(ip)\n get(\"labs/honeyscore/#{ip}\")\n end", "title": "" }, { "docid": "0a6718e01613ee83bffde720fe0dd69b", "score": "0.49862927", "text": "def show\n @yslygi = Yslygi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @yslygi }\n end\n end", "title": "" }, { "docid": "e7cdce9ada757675a3239e9c2a95ceac", "score": "0.49862224", "text": "def index\n @precedence_schools = PrecedenceSchool.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @precedence_schools }\n end\n end", "title": "" } ]
13a9e3776582edafe0a6e9026056b394
Building Metasploit/Armitage info GUI/CLI
[ { "docid": "c7eec987bfd306f09638f77b4da15a73", "score": "0.5810614", "text": "def initialize(info={})\n super(update_info(info,\n 'Name' => 'Abusing the App Path key for control.exe [sdclt.exe]',\n 'Description' => %q{\n Implementation of App Path UAC bypass by enigma0x3 and mattifestation. This module will upload your payload.exe, create the required registry entry in the current user’s hive and runs sdclt.exe (hijacking the process being started to gain code execution). NOTE: this technique does not allow for parameters (e.g, C:\\Windows\\System32\\cmd.exe /c calc.exe). \n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'Module Author : pedr0 Ubuntu [r00t-3xp10it]', # post-module author\n 'Vuln discover : enigma0x3 | mattifestation', # POC/vuln credits\n 'Special thanks: 0xyg3n [SSA Red Team]', # help debugging\n ],\n \n 'Version' => '$Revision: 1.5',\n 'DisclosureDate' => 'abr 26 2017',\n 'Platform' => 'windows',\n 'Arch' => 'x86_x64',\n 'Privileged' => 'false', # thats no need for privilege escalation..\n 'Targets' =>\n [\n [ 'Windows 10' ] # Only works againts Windows 10\n ],\n 'References' =>\n [\n [ 'URL', 'https://github.com/r00t-3xp10it' ],\n [ 'URL', 'https://github.com/r00t-3xp10it/msf-auxiliarys' ],\n [ 'URL', 'https://enigma0x3.net/2017/03/14/bypassing-uac-using-app-paths' ]\n\n\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n 'SESSION' => '1', # Default its to run againts session 1\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n OptString.new('SESSION', [ true, 'The session number to run this module on']),\n OptString.new('PAYLOAD_NAME', [ false, 'The payload NAME to be uploaded (eg shell.exe)']),\n OptString.new('DEPLOY_PATH', [ false, 'The destination were to deploy (eg %temp%)']),\n OptString.new('LOCAL_PATH', [ false, 'The full path of payload.exe to upload (eg /root/shell.exe)'])\n ], self.class)\n\n register_advanced_options(\n [\n OptBool.new('CHECK_VULN', [ false, 'Check target vulnerability status?' , false]),\n OptBool.new('DEL_REGKEY', [ false, 'Delete the malicious registry key hive?' , false])\n ], self.class)\n\n end", "title": "" } ]
[ { "docid": "bd662d500a4648a04e4a24824a95f479", "score": "0.64808035", "text": "def show\r\n puts \"Showing the setup for #{parent.name}'s iarbuild utility:\"\r\n puts \" Executable: \"\r\n puts \" Installation Offset: \"\r\n puts \" Installation Dir: \"\r\n puts \" (Path) => \"\r\n puts \" Configs: NOT SET!\"\r\n puts \" Project: NOT SET!\"\r\n puts \" => Build Command: ?\"\r\n end", "title": "" }, { "docid": "edfbf0d72e6ebea134c2a275d3a8feee", "score": "0.63312924", "text": "def make_app_info(app)\n\tsystem(\"/usr/local/munki/makepkginfo -f '#{app}' >> '#{ARGV[1]}'\")\nend", "title": "" }, { "docid": "dba6250e7397b57aa75cc5df470ab396", "score": "0.6149862", "text": "def initialize(info={})\n super(update_info(info,\n 'Name' => 'enigma fileless uac bypass [registry hijacking]',\n 'Description' => %q{\n Implementation of fileless uac bypass by enigma and mattifestation using cmd.exe OR powershell.exe to execute our command. This module will create the required registry entry in the current user’s hive, set the default value to whatever you pass via the EXEC_COMMAND parameter, and runs eventvwr.exe OR CompMgmtLauncher.exe (hijacking the process being started to gain code execution).\n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'Module Author: pedr0 Ubuntu [r00t-3xp10it]', # post-module author\n 'Vuln discover: enigma0x3 | mattifestation', # vulnerability credits\n ],\n \n 'Version' => '$Revision: 2.1',\n 'DisclosureDate' => 'mar 16 2017',\n 'Platform' => 'windows',\n 'Arch' => 'x86_x64',\n 'Privileged' => 'false', # thats no need for privilege escalation..\n 'Targets' =>\n [\n # Tested againts windows 7 | Windows 10\n [ 'Windows VISTA', 'Windows 7', 'Windows 8', 'Windows 9', 'Windows 10' ]\n ],\n 'DefaultTarget' => '5', # default its to run againts windows 10\n 'References' =>\n [\n [ 'URL', 'POC: goo.gl/XHQ6aF' ],\n [ 'URL', 'https://github.com/r00t-3xp10it' ],\n [ 'URL', 'http://x42.obscurechannel.com/?p=368' ],\n [ 'URL', 'https://github.com/r00t-3xp10it/msf-auxiliarys' ]\n\n\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n 'SESSION' => '1', # Default its to run againts session 1\n 'VULN_SOFT' => 'eventvwr.exe', # Default its to run againts eventvwr.exe\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n OptString.new('SESSION', [ true, 'The session number to run this module on']),\n OptString.new('EXEC_COMMAND', [ false, 'The command to be executed (eg start notepad.exe)']),\n OptBool.new('CHECK_VULN', [ false, 'Check target vulnerability status/details?' , false])\n ], self.class)\n\n register_advanced_options(\n [\n OptString.new('VULN_SOFT', [ false, 'The binary/service vulnerable (eg CompMgmtLauncher.exe)']),\n OptBool.new('USE_POWERSHELL', [ false, 'Use powershell.exe -Command to execute our command?' , false]),\n OptBool.new('DEL_REGKEY', [ false, 'Delete malicious registry hive/keys?' , false])\n ], self.class) \n\n end", "title": "" }, { "docid": "d5104bae7dcb26f12741b46306f7feed", "score": "0.6062597", "text": "def info; cli 'info'; end", "title": "" }, { "docid": "243bd743257d4f168ea51b7cf4be021b", "score": "0.604808", "text": "def wrapper_mini_usage\n puts \"List of available commands and general description:\".underline.white\n puts \"back \".light_yellow + \" => \".white + \"Return to Main Menu\".light_red\n puts \"data \".light_yellow + \" => \".white + \"data://\".light_red\n puts \"expect \".light_yellow + \" => \".white + \"expect://\".light_red\n puts \"filters \".light_yellow + \" => \".white + \"php://filters\".light_red\n puts \"input \".light_yellow + \" => \".white + \"php://input\".light_red\n puts \"rfi \".light_yellow + \" => \".white + \"Remote File Include\".light_red\n print_line(\"\")\nend", "title": "" }, { "docid": "d47d020626f6ee41f0d0d1a6e0171868", "score": "0.5948066", "text": "def cli; end", "title": "" }, { "docid": "d47d020626f6ee41f0d0d1a6e0171868", "score": "0.5948066", "text": "def cli; end", "title": "" }, { "docid": "e3ff307f69ce66ddd768e91fd69415da", "score": "0.5939289", "text": "def cmd_generate(args)\n state = JSON.load(open(args[\"statefile\"]))\n\n updated = DateTime.strptime(state[\"updated\"], \"%Y-%m-%d\")\n vimpatches = vimpatch_all()\n vimscripts = vimscript_all()\n ranking = scriptranking(state[\"script\"][\"state\"], vimscripts)\n vimjpissues = githubissue_all(\"vim-jp\", \"issues\")\n opencount = count_if(vimjpissues) {|x| x[\"state\"] == \"open\"}\n opendiff = opencount - state[\"vim-jp/issues\"][\"opencount\"]\n closedcount = count_if(vimjpissues) {|x| x[\"state\"] == \"closed\"}\n closeddiff = closedcount - state[\"vim-jp/issues\"][\"closedcount\"]\n\n puts \"## リリース情報\"\n puts \"\"\n for e in vimpatches\n if cmp_version(e[\"version\"], state[\"vim\"][\"version\"]) <= 0\n next\n end\n summary = \"#{e[\"version\"]} : #{e[\"summary\"]}\"\n puts \"- [#{mdescape(summary)}](#{e[\"url\"]})\"\n end\n puts \"\"\n\n puts \"## 新着スクリプト\"\n puts \"\"\n for e in vimscripts\n if e[\"script_id\"].to_i <= state[\"script\"][\"script_id\"].to_i\n next\n end\n summary = \"#{e[\"name\"]} : #{e[\"summary\"]}\"\n puts \"- [#{mdescape(summary)}](#{e[\"url\"]})\"\n end\n puts \"\"\n\n puts \"## 月間ダウンロードランキング\"\n puts \"\"\n for e in ranking[0...10]\n puts e\n end\n puts \"\"\n\n puts \"## vim-jp issues\"\n puts \"\"\n puts sprintf(\"Open : %d (%+d) | Closed : %d (%+d)\", opencount, opendiff, closedcount, closeddiff)\n puts \"\"\n for e in vimjpissues\n if e[\"number\"] <= state[\"vim-jp/issues\"][\"number\"]\n next\n end\n summary = \"Issue ##{e[\"number\"]} : #{e[\"title\"]}\"\n puts \"- [#{mdescape(summary)}](#{e[\"html_url\"]})\"\n end\n puts \"\"\n\n newstate = {\n \"updated\" => DateTime.now().strftime(\"%Y-%m-%d\"),\n \"vim\" => {\n \"version\" => vimpatches[-1][\"version\"],\n },\n \"script\" => {\n \"script_id\" => vimscripts[-1][\"script_id\"],\n \"state\" => filter_vimscripts(vimscripts),\n },\n \"vim-jp/issues\" => {\n \"opencount\" => opencount,\n \"closedcount\" => closedcount,\n \"number\" => vimjpissues.dup().map{|x| x[\"number\"]}.max(),\n },\n }\n\n if args[\"update\"]\n open(args[\"statefile\"], \"wb\") do |f|\n f.write JSON.pretty_generate(newstate)\n end\n end\nend", "title": "" }, { "docid": "74df14997488a6ffad5a6228e5835f2b", "score": "0.59346193", "text": "def init_html(bin,cmd)\n \n require ENV['TM_SUPPORT_PATH'] + '/lib/web_preview'\n\n puts html_head( :window_title => \"ActionScript 3 Build Command\",\n :page_title => \"Build (#{bin})\",\n :sub_title => cmd.file_specs_name )\n\n puts \"<h2>Building...</h2>\"\n puts \"<p><pre>-file-specs=#{cmd.file_specs}\"\n puts \"-o=#{cmd.o}</pre></p>\" \n \n end", "title": "" }, { "docid": "79c46d42a81298cb82fd0c77ea8685ab", "score": "0.59327435", "text": "def usage\n puts \"This script creates a Tomahawk resolver bundle.\"\n puts \"\\nMake sure you have the zipruby gem.\"\n puts \"\\nUsage: ruby makeaxe.rb path_to_resolver_directory [options]\"\n puts \" --release\\tskip trying to add the git revision hash to the bundle\"\n puts \" --help\\t\\tthis help message\"\nend", "title": "" }, { "docid": "4892cd7f898849aa4137824dc173d0b9", "score": "0.59306586", "text": "def run\n program :name, 'vmpooler-bitbar'\n program :version, '1.0.0'\n program :description, 'VMPooler BitBar plugin based on vmfloaty.'\n\n # Check vmfloaty library version\n min_vmfloaty_version = '0.7.0'\n if Gem::Version.new(Vmfloaty::VERSION) < Gem::Version.new(min_vmfloaty_version)\n puts '🔥 Update vmfloaty',\n '---',\n \"Please update vmfloaty to a version > #{min_vmfloaty_version}\",\n \"Current version is #{Vmfloaty::VERSION}\",\n '---',\n 'Refresh... | refresh=true'\n exit 1\n end\n\n config = Conf.read_config\n vmpooler_url = config['url']\n token = config['token']\n\n this_script = File.expand_path $PROGRAM_NAME\n warning_timeleft_threshhold = 1\n extend_lifetime_hours = 2\n\n def system_notification(message, title = 'vmpooler bitbar')\n `osascript -e 'display notification \"#{message}\" with title \"#{title}\"' &> /dev/null`\n end\n\n def generate_tag_hash\n { created_by: 'vmpooler_bitbar' }\n end\n\n def copy_menu_text_params(menu_text)\n \"bash=/bin/bash param1=-c param2='echo -n #{menu_text} | pbcopy' terminal=false\"\n end\n\n def get_display_name(vm)\n # list of roles which override the vm[:name] displayed\n flagged_roles = ['vanagon_target']\n if vm[:tags] && vm[:tags].key?('roles')\n flagged_roles.each do | flagged_role |\n if vm[:tags]['roles'].include?(flagged_role)\n return flagged_role\n end\n end\n end\n vm[:name]\n end\n\n def ssh_user(vm)\n vm[:template].start_with?('win') ? 'Administrator' : 'root'\n end\n\n command :menu do |c|\n c.syntax = 'vmpooler-bitbar menu'\n c.description = 'Prints bitbar menu string'\n c.action do |args, options|\n logo_base64 = 'R0lGODlhIAAgAPQAAP+uGv+uG/+vG/+uHP+vHP+vHf+vHv+vH/+wHv+wH/+wIP+xIf+xIv+xI/+xJf+yJP+zJ/6yKf60LAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABMALAAAAAAgACAAAAWW4CSOZGmeaKqubIsSQSwTrhoAA0EAQFCngUFEZOj9UAGaKGE8mpIjps9ZuhUOiZuBWuV5AUquqDAoCxIFsDhVDK9LaQKjQWdA3pP0F4DAN/YACX6Agm9/e4Vrh1+JYnpffWsHOAqVlQ6SOIoLnAsPRQNvN3sCeDcEBQVWpmGTU2tQS02wAxJEs2KnBnqvuYC9eMHCwyshADs='\n progress_bar_map = ['███▏', '██▊▏', '██▋▏', '██▌▏', '██▍▏', '██▎▏', '██▏▏', '██ ▏', '█▉ ▏', '█▊ ▏', '█▋ ▏', '█▌ ▏', '█▍ ▏', '█▎ ▏', '█▏ ▏', '█ ▏', '▉ ▏', '▊ ▏', '▋ ▏', '▌ ▏', '▍ ▏', '▎ ▏', '▏ ▏']\n\n # Menu Item Formatting Parameters - see https://github.com/matryer/bitbar#plugin-api\n header_params = \"size=22 font='Arial Bold' templateImage=#{logo_base64}\"\n submenu_item_font_size = 'size=12'\n submenu_header_font_size = 'size=14'\n submenu_header_params = \"font='Arial Bold' #{submenu_header_font_size}\"\n fixed_font_header_params = \"font=Menlo-Regular #{submenu_header_font_size}\"\n fixed_font_params = \"font=Menlo-Regular #{submenu_item_font_size}\"\n terminal_action_params = \"terminal=true #{submenu_item_font_size}\"\n refresh_action_params = \"terminal=false refresh=true #{submenu_item_font_size}\"\n disabled_action_params = submenu_item_font_size\n\n menu_template = <<-EOS\nVMs: <%= vms.length %> | color=<%= expiring_soon ? 'red' : 'green' %>\n---\nvmpooler | <%= header_params %>\n---\n<% extend_all_cmd = \"\" %>\n<% if !vms.nil? -%>\n<% vms.each do |vm| -%>\n<% remaining_time_colour = vm[:remaining] <= warning_timeleft_threshhold ? 'red' : 'green' -%>\n<%= vm[:timebar] %><%= vm[:hostname] %> (<%= get_display_name(vm) %>) | <%= fixed_font_header_params %> color=<%= remaining_time_colour %> <%= copy_menu_text_params(vm[:fqdn]) %>\n-- Action | <%= submenu_header_params %>\n-- SSH to VM | href='ssh://<%= ssh_user(vm) %>@<%= vm[:fqdn] %>' <%= terminal_action_params %>\n-- Delete VM | bash=<%= this_script %> param1=delete param2=<%= vm[:hostname] %> <%= refresh_action_params %>\n<% if vm.key?(:pe_console) -%>\n-- Open PE Console | href='<%= vm[:pe_console] %>' <%= submenu_item_font_size %>\n<% end -%>\n-----\n-- Extend Lifetime (<%= extend_lifetime_hours %>h) | bash=<%= this_script %> param1=extend param2=<%= vm[:hostname] %> <%= refresh_action_params %>\n-----\n-- Status | <%= submenu_header_params %>\n-- <%= vm[:running] %>/<%= vm[:lifetime] %> hours | <%= fixed_font_params %> color=<%= remaining_time_colour %> <%= copy_menu_text_params(vm[:running].to_s + '/' + vm[:lifetime].to_s + 'hours') %>\n-- <%= vm[:template] %> | <%= fixed_font_params %> <%= copy_menu_text_params(vm[:template]) %>\n-- <%= vm[:ip] %> | <%= fixed_font_params %> <%= copy_menu_text_params(vm[:ip]) %>\n<% next unless vm.key?(:tags) -%>\n-----\n-- Tags | <%= submenu_header_params %>\n<% vm[:tags].each do |key, value| -%>\n-- <%= key %> = <%= value %> | <%= fixed_font_params %> <%= copy_menu_text_params(value) %>\n<% end -%>\n<% end -%>\n<% else -%>\nYou have no running vms\n<% end -%>\n---\nBulk Actions\n-- Action | <%= submenu_header_params %>\n-- Delete | bash=<%= this_script %> param1=delete param2=--all <%= refresh_action_params %>\n-- Extend Lifetime (<%= extend_lifetime_hours %>h) | bash=<%= this_script %> param1=extend param2=--all <%= refresh_action_params %>\n---\nNew VM\n-- OS Variant | <%= submenu_header_params %>\n<% menu_templates.each do |submenu, templates| -%>\n-- <%= submenu %>\n---- Template | <%= submenu_header_params %>\n<% templates.each do |template| -%>\n---- <%= template %> | bash=<%= this_script %> param1=get param2=<%= template %> <%= refresh_action_params %>\n<% end -%>\n<% end -%>\nRefresh... | refresh=true\nEOS\n\n # Check connectivity and get running vms\n begin\n status = Auth.token_status(false, vmpooler_url, token)\n rescue TokenError => msg\n puts '🔥 Token Error',\n '---',\n msg.to_s,\n 'Check your ~/.vmfloaty.yml|href=https://github.com/briancain/vmfloaty#vmfloaty-dotfile',\n 'Click for info|href=https://github.com/briancain/vmfloaty#vmfloaty-dotfile',\n '---',\n 'Refresh... | refresh=true'\n exit 1\n rescue Faraday::ConnectionFailed => msg\n puts '⚡️ Connection Error',\n '---',\n 'Unable to estalish connection to VMPooler.',\n msg.to_s,\n '---',\n 'Refresh... | refresh=true'\n exit 1\n end\n\n vms = {}\n\n if status[token].key?('vms')\n floathosts = status[token]['vms']['running']\n\n vms = floathosts.map { |x| { hostname: x } }\n\n expiring_soon = false\n\n unless vms.nil?\n # Build hash of vms and details\n vms.each do |vm|\n details = Pooler.query(false, vmpooler_url, vm[:hostname])[vm[:hostname]]\n vm[:timebar] = progress_bar_map[(details['running'] * (progress_bar_map.length - 1)/details['lifetime']).floor]\n vm[:template] = details['template']\n vm[:ip] = details['ip']\n vm[:domain] = details['domain']\n vm[:fqdn] = vm[:hostname] + '.' + vm[:domain]\n vm[:lifetime] = details['lifetime']\n vm[:running] = details['running']\n vm[:remaining] = vm[:lifetime] - vm[:running]\n vm[:name] = vm[:template]\n\n expiring_soon = expiring_soon || vm[:remaining] <= warning_timeleft_threshhold ? true : false\n\n next unless details.key?('tags')\n vm[:tags] = details['tags']\n vm[:name] = vm[:tags]['name'] if vm[:tags].key?('name')\n if vm[:tags].key?('roles') && vm[:tags]['roles'].include?('dashboard')\n vm[:pe_console] = \"https://#{vm[:fqdn]}\"\n end\n end\n end\n # Sort, newer vms first\n vms.sort! { |a, b| a[:running] <=> b[:running] }\n end\n\n # New VM templates\n vm_templates = Pooler.list(false, vmpooler_url)\n menu_templates = {}\n vm_templates.reject { |template| menu_templates[template.split('-')[0]] = (menu_templates[template.split('-')[0]] ||= []) << template; }\n\n # Render menu from template\n renderer = ERB.new(menu_template, nil, '-')\n puts(renderer.result(binding))\n end\n end\n\n command :delete do |c|\n c.syntax = 'vmpooler-bitbar delete [hostname,...]'\n c.description = 'Schedules the deletion of a vm or vms'\n c.option '--all', 'Deletes all vms acquired by a token'\n c.action do |args, options|\n hostnames = args[0]\n delete_all = options.all\n\n if delete_all\n status = Auth.token_status(false, vmpooler_url, token)\n vms = status[token]['vms']\n unless vms.nil?\n running_vms = vms['running']\n unless running_vms.nil?\n deleted_hosts = []\n errored_hosts = []\n Pooler.delete(false, vmpooler_url, running_vms, token).each do |host, vals|\n if vals['ok'] == true\n deleted_hosts << host\n else\n errored_hosts << host\n end\n end\n\n unless errored_hosts.empty?\n system_notification(\"Error deleting vm(s): \\n#{errored_hosts * ', '}\")\n end\n unless deleted_hosts.empty?\n system_notification(\"Deleting vm(s): \\n#{deleted_hosts * ', '}\")\n end\n\n end\n end\n exit 0\n end\n\n if hostnames.nil?\n abort('You did not provide any hosts to delete')\n else\n hosts = hostnames.split(',')\n response = Pooler.delete(false, vmpooler_url, hosts, token)\n response.each do |host, vals|\n if vals['ok'] == false\n system_notification(\"Error deleting vm: #{host}\")\n else\n system_notification(\"Deleted vm: #{host}\")\n end\n end\n end\n exit 0\n end\n end\n\n command :extend do |c|\n c.syntax = 'vmpooler-bitbar extend [hostname]'\n c.description = 'Extends the lifetime of a vm by 2 hours'\n c.option '--all', 'Extends the lifetime of all vms acquired by a token by 2 hours'\n c.action do |args, options|\n hostname = args[0]\n extend_all = options.all\n\n if extend_all\n status = Auth.token_status(false, vmpooler_url, token)\n vms = status[token]['vms']\n unless vms.nil?\n running_vms = vms['running']\n unless running_vms.nil?\n extended_hosts = []\n errored_hosts = []\n\n running_vms.each do |host|\n current_status = Pooler.query(false, vmpooler_url, host)\n current_lifetime = current_status[host]['lifetime']\n extended_lifetime = current_lifetime + extend_lifetime_hours\n response = Pooler.modify(false, vmpooler_url, host, token, extended_lifetime, {})\n\n if response['ok'] == true\n extended_hosts << host\n else\n errored_hosts << host\n end\n end\n\n unless errored_hosts.empty?\n system_notification(\"Error extending vm(s): \\n#{errored_hosts * ', '}\")\n end\n unless extended_hosts.empty?\n system_notification(\"Extending vm(s) by 2 hours: \\n#{extended_hosts * ', '}\")\n end\n\n end\n end\n exit 0\n end\n\n if hostname.nil?\n abort('You did not provide a host to extend')\n else\n current_status = Pooler.query(false, vmpooler_url, hostname)\n current_lifetime = current_status[hostname]['lifetime']\n extended_lifetime = current_lifetime + extend_lifetime_hours\n response = Pooler.modify(false, vmpooler_url, hostname, token, extended_lifetime, {})\n\n if response['ok'] == true\n system_notification(\"Extended vm: #{hostname}\")\n else\n system_notification(\"Error extending vm: #{hostname}\")\n end\n\n end\n exit 0\n end\n end\n\n command :get do |c|\n c.syntax = 'vmpooler-bitbar get [template]'\n c.description = 'Gets a vm based on the os template'\n c.action do |args, _options|\n template = args[0]\n\n if args.nil?\n abort('You did not provide a template to create')\n else\n os_types = Utils.generate_os_hash(args)\n get_response = Pooler.retrieve(false, os_types, token, vmpooler_url)\n\n if get_response['ok'] == true\n hostname = get_response[template]['hostname']\n system_notification(\"Created #{template} vm: \\n\\t#{hostname}\")\n\n tag_hash = generate_tag_hash\n mod_response = Pooler.modify(false, vmpooler_url, hostname, token, nil, tag_hash)\n\n if mod_response['ok'] == false\n system_notification(\"Error tagging #{template} vm: \\n\\t#{hostname}\")\n end\n\n else\n system_notification('Error creating #{template} vm')\n end\n\n end\n exit 0\n end\n end\n\n default_command :menu\n run!\n end", "title": "" }, { "docid": "0e168858d6afdfd3899f37005583f05b", "score": "0.5924336", "text": "def run\r\n option_parser @options\r\n \r\n # Check on include version request.\r\n if @options[:version].value then\r\n\tputs \"#{@name}, version #{@version}\"\r\n\texit\r\n end\r\n\r\n # Check on include help request.\r\n if ARGV[0] == 'help' or ARGV[0] == '--help' or ARGV[0] == '-h' then\r\n\t# Help arguments apsent, well then display information about application.\r\n\tif ARGV.size == 1 then\r\n\t puts\r\n\t puts \"*** #{@name} ***\".center(80)\r\n\t # Display about info.\r\n\t if @about.size > 0 then\r\n\t puts '** ABOUT:'\r\n\t @about.each do |line|\r\n\t puts \" #{line}\"\r\n\t end\r\n\t end\r\n\t # Display usage info.\r\n\t if @usage.size > 0 then\r\n\t puts\r\n\t puts '** USAGE:'\r\n\t @usage.each do |line|\r\n\t puts \" #{line}\"\r\n\t end\r\n\t end\r\n\t # Display options info.\r\n\t puts\r\n\t puts '** OPTIONS:'\r\n\t display_options @options\r\n\t # Display commands info\r\n\t if @commands.size > 0 then\r\n\t @commands.each do |c| c.init end\r\n\t puts\r\n\t puts '** COMMANDS:'\r\n\t display_commands @commands\r\n\t puts\r\n\t puts \"For details, type: help [COMMAND]\"\r\n\t end\r\n\t puts\r\n\t# Help arguments exist, find command in application command list.\r\n\telse\r\n\t ARGV.delete_at( 0 )\r\n\t cmd = command_select\r\n\t if ARGV.size != 0 then\r\n\t puts \"fatal error: unknown command '#{ARGV[0]}'\"\r\n\t exit\r\n\t end\r\n\t # Display describe information on command.\r\n\t puts\r\n\t puts Cmdlib::Describe.outtitle( cmd.name )\r\n\t puts \" #{cmd.brief}\"\r\n\t if cmd.details.size > 0 then\r\n\t puts\r\n\t puts '** DETAILS:'\r\n\t cmd.details.each do |e|\r\n\t puts \" #{e}\"\r\n\t end\r\n\t end\r\n\t if cmd.example.size > 0 then\r\n\t puts\r\n\t puts '** EXAMPLE:'\r\n\t cmd.example.each do |e|\r\n\t puts \" #{e}\"\r\n\t end\r\n\t end\r\n\t # Display options info.\r\n\t if cmd.options.size > 0 then\r\n\t puts\r\n\t puts '** OPTIONS:'\t \r\n\t display_options cmd.options\r\n\t end\r\n\t # Display commands info.\r\n\t if cmd.subcmd.size > 0 then\r\n\t cmd.subcmd.each do |c| c.init end\r\n\t puts\r\n\t puts '** SUBCOMMANDS:'\r\n\t display_commands cmd.subcmd\r\n\t puts\r\n\t puts \"For details, type: help #{cmd.name} [SUBCOMMAND]\"\r\n\t end\r\n\t puts\r\n\tend\r\n\texit\r\n end\r\n \r\n # Handling default command (if exist her).\r\n if @default != nil then\r\n\toption_excess\r\n\tif ARGV.size < @default.argnum then\r\n\t puts \"fatal error: to few arguments for programm, use <help>.\"\r\n\telse\r\n\t @default.handler( @options, ARGV )\r\n\tend\r\n\texit\r\n end\r\n \r\n # Handling commands.\r\n cmd = command_select\r\n if cmd == nil then\r\n\tputs \"fatal error: unknown command or command miss, use <help>.\"\r\n\texit\r\n end\r\n if ARGV.size < cmd.argnum then\r\n\tputs \"fatal error: to few arguments for command, use: <help> <command name>.\"\r\n\texit\r\n end\r\n # Scaning options fir this command\r\n option_parser cmd.options\r\n option_excess\r\n #cmd.init\r\n cmd.handler( @options, ARGV )\r\n exit\r\n end", "title": "" }, { "docid": "753bf051b898363e40a9d7956898b2a5", "score": "0.58712435", "text": "def cmd_info(*args)\n return unless msf_loaded?\n\n if args.length != 1 or args.include?('-h')\n cmd_info_help\n return\n end\n\n module_name = args.shift\n mod = client.framework.modules.create(module_name);\n\n if mod.nil?\n print_error(\"Invalid module: #{module_name}\")\n end\n\n if (mod)\n print_line(::Msf::Serializer::ReadableText.dump_module(mod))\n mod_opt = ::Msf::Serializer::ReadableText.dump_options(mod, ' ')\n print_line(\"\\nModule options (#{mod.fullname}):\\n\\n#{mod_opt}\") if (mod_opt and mod_opt.length > 0)\n end\n end", "title": "" }, { "docid": "5fc2488f8ca8fc8bcb00b8718faace91", "score": "0.5863841", "text": "def build\n\n s = FlexMate::Settings.new\n\n cmd = build_tool(s)\n\n TextMate.require_cmd(cmd.name)\n\n init_html(cmd)\n\n exhaust = get_exhaust\n\n # This works... when, occasionally, using TextMate::Process fails. Memory allocation maybe?\n #{}`#{cmd.line}`.each { |str| STDOUT << exhaust.line(str) }\n\n TextMate::Process.run(cmd.line) do |str|\n STDOUT << exhaust.line(str)\n end\n\n STDOUT << exhaust.complete\n\n STDOUT << '<br/><br/><div class=\"raw_out\"><span class=\"showhide\">'\n STDOUT << \"<a href=\\\"javascript:hideElement('raw_out')\\\" id='raw_out_h' style='display: none;'>&#x25BC; Hide Raw Output</a>\"\n STDOUT << \"<a href=\\\"javascript:showElement('raw_out')\\\" id='raw_out_s' style=''>&#x25B6; Show Raw Output</a>\"\n STDOUT << '</span></div>'\n STDOUT << '<div class=\"inner\" id=\"raw_out_b\" style=\"display: none;\"><br/>'\n STDOUT << \"<code>#{exhaust.input.to_s}</code><br/>\"\n\n html_footer\n\n end", "title": "" }, { "docid": "bda1b8ec2cfd1f52eb58881b7209aa17", "score": "0.5833869", "text": "def initInfo \n\t send(\"Type /help for a list of commands\")\n\t send(\"Use the /add [file name] to fix queue problems\")\n\tend", "title": "" }, { "docid": "c725e82b4981e89afc2288b2af3788d1", "score": "0.5833123", "text": "def initialize(info={})\n super(update_info(info,\n 'Name' => 'enigma fileless uac bypass [fodhelper.exe]',\n 'Description' => %q{\n Implementation of fileless uac bypass by enigma and mattifestation (winscriptingblog research) using cmd.exe or powershell.exe This module will create the required registry entry in the current user’s hive, set the reg_sz value to whatever you pass via the EXEC_COMMAND parameter, and runs fodhelper.exe (hijacking the process being started to gain code execution).\n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'Module Author: pedr0 Ubuntu [r00t-3xp10it]', # post-module author\n 'Vuln discover: enigma0x3 | mattifestation | winscripting', # vulnerability credits\n ],\n \n 'Version' => '$Revision: 1.1',\n 'DisclosureDate' => 'jun 9 2017',\n 'Platform' => 'windows',\n 'Arch' => 'x86_x64',\n 'Privileged' => 'false', # thats no need for privilege escalation..\n 'Targets' =>\n [\n [ 'Windows 10' ] # Only works againts Windows 10\n ],\n 'References' =>\n [\n [ 'URL', 'https://github.com/r00t-3xp10it' ],\n [ 'URL', 'https://github.com/r00t-3xp10it/msf-auxiliarys' ],\n [ 'URL', 'https://winscripting.blog/2017/05/12/first-entry-welcome-and-uac-bypass/' ]\n\n\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n 'SESSION' => '1', # Default its to run againts session 1\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n OptString.new('SESSION', [ true, 'The session number to run this module on']),\n OptString.new('EXEC_COMMAND', [ false, 'The command to be executed (eg start notepad.exe)']),\n OptBool.new('CHECK_VULN', [ false, 'Check target vulnerability details/status?' , false])\n ], self.class)\n\n register_advanced_options(\n [\n OptBool.new('DEL_REGKEY', [ false, 'Delete the malicious registry hive/keys?' , false])\n ], self.class) \n\n end", "title": "" }, { "docid": "2603e0c2d157fcef24719b466c88c297", "score": "0.58038485", "text": "def cmd_info(*args)\n\t\treturn unless msf_loaded?\n\n\t\tif args.length != 1 or args.include?(\"-h\")\n\t\t\tcmd_info_help\n\t\t\treturn\n\t\tend\n\n\t\tmodule_name = args.shift\n\t\tmod = client.framework.modules.create(module_name);\n\n\t\tif mod.nil?\n\t\t\tprint_error 'Invalid module: ' << module_name\n\t\tend\n\n\t\tif (mod)\n\t\t\tprint_line(::Msf::Serializer::ReadableText.dump_module(mod))\n\t\t\tmod_opt = ::Msf::Serializer::ReadableText.dump_options(mod, ' ')\n\t\t\tprint_line(\"\\nModule options (#{mod.fullname}):\\n\\n#{mod_opt}\") if (mod_opt and mod_opt.length > 0)\n\t\tend\n\tend", "title": "" }, { "docid": "2e179c8af4a1869f9373b30e418655bf", "score": "0.57813054", "text": "def install\n bin.install \"tencent-mars-xlog-util\"\n puts <<~EOS\n\n \\033[32mtencent-mars-xlog-util #{TencentMarsXlogUtil.version}\\033[0m\n 0x1306a94 <0x1306a94@gmail.com>\n tencent-mars-xlog-util\n\n \\033[33mUSAGE:\\033[0m\n tencent-mars-xlog-util <SUBCOMMAND>\n\n \\033[33mOPTIONS:\\033[0m\n \\033[32m-h, --help\\033[0m Print help information\n \\033[32m-V, --version\\033[0m Print version information\n\n \\033[33mSUBCOMMANDS:\\033[0m\n \\033[32mdecode\\033[0m Decode Xlog\n \\033[32mgen-key\\033[0m Generate the key\n \\033[32mhelp\\033[0m Print this message or the help of the given subcommand(s)\n\n EOS\n end", "title": "" }, { "docid": "69bbad64f41627c120325052e25c174e", "score": "0.5776909", "text": "def general\n puts \"Key gem system information.\", \"\",\n info.format_output_bullets, \"\",\n path.format_output_bullets, \"\"\n end", "title": "" }, { "docid": "14903eb305f2e2723e932c6cd5b0816a", "score": "0.57608914", "text": "def initialize(info={})\n super(update_info(info,\n 'Name' => 'Vault7_cia_debugger_hijack (reg hijack execution)',\n 'Description' => %q{\n\n This registry key can be used to redirect the execution of any application to a different executable. The specified “debugger” application will be called with a path to the original program as the first argument.\n\n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'peterubuntu10[at]sourceforge[dot]net', # post-module author\n 'Inspiration: Chaitanya [ SSA RedTeam ]', # module inspiration\n 'Special thanks: Vault7 CIA Hacking Tools' # CIA wikileaks public leak\n ],\n \n 'Version' => '$Revision: 1.0',\n 'DisclosureDate' => 'mar 8 2017',\n 'Platform' => 'windows',\n 'Arch' => 'x86_x64',\n 'Privileged' => 'true', # we need a priviliged session to hijack keys :(\n 'Targets' =>\n [\n # Tested againts Windows 10 | windows 7 (SP1) | windows XP (SP3)\n [ 'Windows XP', 'Windows VISTA', 'Windows 7', 'Windows 8', 'Windows 9', 'Windows 10' ]\n ],\n 'DefaultTarget' => '6', # default its to run againts Windows 10\n 'References' =>\n [\n [ 'URL', 'https://github.com/r00t-3xp10it' ],\n [ 'URL', 'https://github.com/r00t-3xp10it/msf-auxiliarys' ],\n [ 'URL', 'https://wikileaks.org/ciav7p1/cms/page_2621770.html' ]\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n\t\t\t\t\t'SESSION' => '1', # Default its to run againts session 1 \n 'HIJACK' => 'notepad.exe', # default vulnerable appl to be hijack\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n OptString.new('SESSION', [ true, 'The session number to run this module on']),\n OptString.new('HIJACK', [ false, 'Application to be hijacked (eg. notepad.exe)']),\n OptString.new('EXEC', [ false, 'Binary to be executed (eg. %windir%\\\\system32\\\\calc.exe)'])\n ], self.class)\n\n register_advanced_options(\n [\n OptBool.new('UPLOAD_AGENT', [ false, 'Upload your agent to be executed?' , false]),\n OptString.new('LOCAL_PATH', [ false, 'Full path of agent to deploy (eg. /root/agent.exe)']),\n OptString.new('REMOTE_PATH', [ false, 'Full path in remote machine (eg. %temp%\\\\agent.exe)']),\n OptBool.new('REVERT_HIJACK', [ false, 'Delete registry hijack keys (delete EXEC regkey)' , false])\n ], self.class)\n \n end", "title": "" }, { "docid": "c46b6829faa3903b9eba6436ae10298a", "score": "0.5751901", "text": "def initialize(info={})\n super(update_info(info,\n 'Name' => 'linux hostrecon post-module (fingerprints)',\n 'Description' => %q{\n This module gathers target system information (linux distros) dump remote credentials, display outputs and stores it into a logfile in msf4/loot folder. this module also allows users to execute a single_command in bash + read/store outputs (advanced options).\n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'Module Author: pedr0 Ubuntu [r00t-3xp10it]', # post-module author :D\n ],\n \n 'Version' => '$Revision: 1.3',\n 'DisclosureDate' => 'set 27 2017',\n 'Platform' => 'linux',\n 'Arch' => 'x86_x64',\n 'Privileged' => 'true', # root privileges required?\n 'Targets' =>\n [\n [ 'Linux' ]\n ],\n 'DefaultTarget' => '1', # default its to run againts linux targets\n 'References' =>\n [\n [ 'URL', 'http://goo.gl/RzP3DM' ],\n [ 'URL', 'https://github.com/r00t-3xp10it' ],\n [ 'URL', 'https://github.com/r00t-3xp10it/msf-auxiliarys' ],\n [ 'URL', 'http://rapid7.github.io/metasploit-framework/api/' ]\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n\t\t\t\t\t'SESSION' => '1', # Default its to run againts session 1\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n OptString.new('SESSION', [ true, 'The session number to run this module on'])\n ], self.class)\n\n register_advanced_options(\n [\n OptBool.new('STORE_LOOT', [false, 'Store dumped data to msf4/loot folder?', false]),\n OptBool.new('AGRESSIVE_DUMP', [false, 'Agressive system fingerprints scan?', false]),\n OptBool.new('CREDENTIALS_DUMP', [false, 'Dump remote credentials from target?', false]),\n OptBool.new('DEL_SHELL_HISTORY', [false, 'Delete remote shell history commands?', false]),\n OptString.new('SINGLE_COMMAND', [false, 'The bash command to execute remotelly'])\n ], self.class)\n \n end", "title": "" }, { "docid": "675ae3085f9a634e46f897278696af1a", "score": "0.57463133", "text": "def showBuildInfo(flavor)\n UI.header \"Next Built: \\n VersionCode: #{ENV['VERSION_CODE']} | VersionName: #{ENV['VERSION_NAME']}\" + \" | Flavor: #{flavor}\" \nend", "title": "" }, { "docid": "33c6f6ed813c174f1757b91d2139133d", "score": "0.57157624", "text": "def includer_vuln_menu_usage\n puts \"Available Includer Commands and Description:\".underline.white\n puts \"back \".light_yellow + \" => \".white + \"Return to Main Menu\".light_red\n puts \"data \".light_yellow + \" => \".white + \"data://\".light_red # RCE via data:// wrapper (PHP 5.2+)\n puts \"environ \".light_yellow + \" => \".white + \"/proc/self/environ\".light_red #/proc/self/environ method\n puts \"expect \".light_yellow + \" => \".white + \"expect://\".light_red # PHP 4.3.0+ (PECL) Note: This wrapper is not enabled by default, execs via PTY\n puts \"fd \".light_yellow + \" => \".white + \"/proc/self/fd/\".light_red # /proc/self/fd/ Log Poisoning Method\n puts \"filters \".light_yellow + \" => \".white + \"php://filters\".light_red # Source Disclosure via PHP Filters Method\n puts \"input \".light_yellow + \" => \".white + \"php://input\".light_red # This wrapper accepts RAW POST data as argument for easy RCE\n puts \"logs \".light_yellow + \" => \".white + \"Log Files\".light_red # Common Log Poisoning Attack\n puts \"rfi \".light_yellow + \" => \".white + \"Remote File Include\".light_red # RFI RCE\n print_line(\"\")\nend", "title": "" }, { "docid": "a55a859ebe6bf046d957d5bf985de8f3", "score": "0.5696108", "text": "def init_html(cmd)\n\n require ENV['TM_SUPPORT_PATH'] + '/lib/web_preview'\n\n puts html_head( :window_title => \"ActionScript 3 Build Command\",\n :page_title => \"Build (#{cmd.name})\",\n :sub_title => cmd.file_specs_name )\n\n puts \"<h2>Building...</h2>\"\n puts \"<p><pre>#{cmd.to_s}</pre></p>\"\n\n end", "title": "" }, { "docid": "b6b4ea988b63113f30ffd7d9b0b8a508", "score": "0.5681042", "text": "def usage\n puts %{\n Usage: tmuxinator ACTION [Arg]\n\n ACTIONS:\n open [project_name]\n create a new project file and open it in your editor\n copy [source_project] [new_project]\n copy source_project project file to a new project called new_project\n delete [project_name]\n deletes the project called project_name\n implode\n deletes all existing projects!\n list [-v]\n list all existing projects\n help\n shows this help document\n version\n\n}\n end", "title": "" }, { "docid": "80f7112f36b7a3787b3e48f8a044a174", "score": "0.56771934", "text": "def cheat\n logger.info \"Usage: jim [options] [command] [args]\\n\"\n logger.info \"Commands:\"\n logger.info [*template('commands')].grep(/^\\w/).join\n logger.info \"run commands for details\"\n end", "title": "" }, { "docid": "f60d48b51733e5e0f7942823e265cba7", "score": "0.5671136", "text": "def help\n cc 0x75\n puts \"\\r#{'PSDK Help'.center(80)}\"\n cc 0x07\n print <<~EODESCRIPTION\n Here's the list of the command you can enter in this terminal.\n Remember that you're executing actual Ruby code.\n When an ID is 005 or 023 you have to write 5 or 23, the 0-prefix should never appear in the command you enter.\n EODESCRIPTION\n cc 0x06\n print <<~EOLIST\n Warp the player to another map :\\e[37m\n - Debugger.warp(map_id, x, y)\\e[36m\n Test a trainer battle :\\e[37m\n - Debugger.battle_trainer(trainer_id)\\e[36m\n List the switches that match a specific name (with their value) :\\e[37m\n - Debugger.find_switch(/name/i)\\e[36m\n Change a switch value :\\e[37m\n - $game_switches[id] = value\\e[36m\n List the variables that match a specific name (with their value) :\\e[37m\n - Debugger.find_var(/name/i)\\e[36m\n Change a variable value :\\e[37m\n - $game_variables[id] = value\\e[36m\n List all the Pokemon ID that match a specific name :\\e[37m\n - Debugger.find_pokemon(/name/i)\\e[36m\n List all the Nature ID that match a specific name :\\e[37m\n - Debugger.find_nature(/name/i)\\e[36m\n List all the Ability ID that match a specific name :\\e[37m\n - Debugger.find_ability(/name/i)\\e[36m\n List all the Move ID that match a specific name :\\e[37m\n - Debugger.find_skill(/name/i)\\e[36m\n List all the Item ID that match a specific name :\\e[37m\n - Debugger.find_item(/name/i)\\e[36m\n Add a Pokemon to the party :\\e[37m\n - S.MI.add_pokemon(id, level)\\e[36m\n Add a Pokemon defined by a Hash to the party :\\e[37m\n - S.MI.add_specific_pokemon(hash)\\e[36m\n Remove a Pokemon from the Party :\\e[37m\n - S.MI.withdraw_pokemon_at(index)\\e[36m\n Learn a skill to a Pokemon :\\e[37m\n - S.MI.skill_learn(pokemon, skill_id)\n - S.MI.skill_learn($actors[index_in_the_party], skill_id)\\e[36m\n Add an egg to the party :\\e[37m\n - S.MI.add_egg(id)\\e[36m\n Start a wild battle :\\e[37m\n - S.MI.call_battle_wild(id, level)\n - S.MI.call_battle_wild(id1, level1, id2, level2) \\e[32m# 2v2\\e[37m\n - S.MI.call_battle_wild(pokemon, nil)\n - S.MI.call_battle_wild(pokemon1, nil, pokemon2)\\e[36m\n Save the game :\\e[37m\n - S.MI.force_save\n EOLIST\n end", "title": "" }, { "docid": "e2fffc2b55c447149846638c332b6203", "score": "0.5640491", "text": "def install\n system \"python3\", \"-m\", \"venv\", libexec\n system libexec/\"bin/pip\", \"install\", \"-U\", \"wheel\", \"setuptools\", \"pip\"\n system libexec/\"bin/pip\", \"install\", \".\"\n\n open(\"pymontecarlo-gui-debug\", \"w\") do |file|\n file.write \"#!/usr/bin/env bash\\n\"\n file.write libexec/\"bin/pymontecarlo-gui-debug\"\n end\n\n bin.install \"pymontecarlo-gui-debug\"\n end", "title": "" }, { "docid": "d22fdb795bb0d6daa6a8b0399e54c74f", "score": "0.56347924", "text": "def initialize(info={})\n super(update_info(info,\n 'Name' => 'Linux persistence [post-exploit]',\n 'Description' => %q{\n Builds 'persistance' init.d startup script that allow users to persiste your agent (executable) on Linux distros at every startup. This post-module requires the agent allready deployed on target system and accepts any chmoded agents (elf|sh|py|rb|pl) to be auto-executed. It also allow is users to use 'systemd' or 'crontab' as an alternative way to persiste our payload in target system after exploitation.\n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'Module Author: pedr0 Ubuntu [r00t-3xp10it]', # post-module author\n ],\n \n 'Version' => '$Revision: 2.0',\n 'DisclosureDate' => 'jun 2 2017',\n 'Platform' => 'linux',\n 'Arch' => 'x86_x64',\n 'Privileged' => 'false', # thats no need for privilege escalation (in-kali) ..\n 'Targets' =>\n [\n [ 'Linux' ]\n ],\n 'DefaultTarget' => '1', # default its to run againts linux\n 'References' =>\n [\n [ 'URL', 'http://goo.gl/ny69NS' ],\n [ 'URL', 'http://goo.gl/LZG1LQ' ],\n [ 'URL', 'http://goo.gl/281pVK' ],\n [ 'URL', 'https://github.com/r00t-3xp10it' ],\n [ 'URL', 'https://github.com/r00t-3xp10it/msf-auxiliarys' ]\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n 'LOOT_FOLDER' => '~/.msf4/loot', # Default loot folder absoluct path\n 'INIT_PATH' => '/etc/init.d', # Default init.d directory full path\n 'CRON_PATH' => '/etc/crontab', # Default crontab directory full path\n 'RPATH_SYSTEMD' => '/etc/systemd/system', # Default systemd directory full path\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n OptBool.new('INITD', [ false, 'Use init.d to persiste our payload?', false]),\n OptBool.new('SYSTEMD', [ false, 'Use systemd to persiste our payload?', false]),\n OptBool.new('CRONTAB', [ false, 'Use crontab to persiste our payload?', false]),\n OptString.new('SESSION', [ true, 'The session number to run this module on', 1]),\n OptString.new('REMOTE_PATH', [ false, 'The remote absoluct path of binary to execute'])\n ], self.class)\n\n register_advanced_options(\n [\n OptString.new('CRON_PATH', [ false, 'The absoluct path of crontab file']),\n OptString.new('INIT_PATH', [ false, 'The absoluct path of init.d directory']),\n OptString.new('RPATH_SYSTEMD', [ false, 'The absoluct path of systemd directory']),\n OptString.new('LOOT_FOLDER', [ false, 'Set the absoluct path where to store logs']),\n OptBool.new('SHEBANG', [ false, 'Use agents with [shebang]? (eg #!/bin/sh)', false]),\n OptString.new('SINGLE_COM', [ false, 'Execute one simple bash command (eg uname -a)']),\n OptString.new('START_TIME', [ false, 'Time to wait for the agent to start (in seconds)', 8]),\n OptBool.new('DEL_PERSISTENCE', [ false, 'Delete persistence scripts/configurations?', false]),\n OptBool.new('CRON_MASQUERADE', [ false, 'Masquerade payload.sh as cron daemon? (T1036)', false])\n ], self.class) \n\n end", "title": "" }, { "docid": "dfc8641657c758d6447a62033555c749", "score": "0.56339693", "text": "def usage\n puts <<USAGE\n== Synopsis\n\nopm app-browser: Browses through a given application's architecture\n\n== Usage\n\nopm app-browser <app-path> [--resolve]\n\nOptions:\n-h|--help:\n Prints this message\n--resolve:\n Resolve the references in app descriptor (cartridges/connections etc)\n\napp-path: The path to the application to browse\nUSAGE\nend", "title": "" }, { "docid": "828565527f48b4fc666601d43bceac72", "score": "0.56280196", "text": "def showHelp; scrName = File::basename($0.gsub(/\\\\/, '/'));\r\nputs <<\"================================================\"\r\n概要: COBUILD の EBStudio 用入力ファイルを作成する\r\n構文: ruby -Ks #{scrName} [<options>] <inDir> [<outDir>]\r\n <options>\r\n -standard Wordbank 以外を変換する (既定値)\r\n -wordbank Wordbank のみを変換する\r\n <inDir> .trd ファイルのあるディレクトリ\r\n <outDir> 出力ディレクトリ (指定なしならカレントディレクトリ)\r\n例:\r\n* COBUILD CD-ROM v1.0 (X:) から作成する\r\n ruby -Ks #{scrName} X:\\\\ D:\\\\EPWING\\\\Cobuild\r\n* COBUILD CD-ROM v2.0/3.0 (X:) から Wordbank を作成する\r\n ruby -Ks #{scrName} -wordbank X:\\\\DATA D:\\\\EPWING\\\\Cobuild\r\n================================================\r\nend", "title": "" }, { "docid": "1fd1e117ce4a5d504a03d0f75486a905", "score": "0.562158", "text": "def initialize(info={})\n super(update_info(info,\n 'Name' => 'execute commands in android',\n 'Description' => %q{\n Android/meterpreter payloads does not allow users to manipulate target file system. This msf post-exploitation module will allow users to input/execute remotely commands in target system, display on screen the command output and store outputs (set STORE_LOOT true) into sellected loot folder (set LOOT_FOLDER /root)\n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'Module Author: r00t-3xp10it', # post-module author :D\n ],\n \n 'Version' => '$Revision: 1.4',\n 'DisclosureDate' => '26 jun 2018',\n 'Platform' => 'android',\n 'Arch' => ARCH_DALVIK,\n 'Privileged' => 'false', # root privileges required?\n 'Targets' =>\n [\n [ 'android' ]\n ],\n 'DefaultTarget' => '1', # default its to run againts android targets\n 'References' =>\n [\n [ 'URL', 'https://github.com/r00t-3xp10it/msf-auxiliarys' ],\n [ 'URL', 'http://rapid7.github.io/metasploit-framework/api/' ],\n [ 'URL', 'https://resources.infosecinstitute.com/lab-android-exploitation-with-kali/' ]\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n\t\t\t\t\t'SESSION' => '1', # Default its to run againts session 1\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n OptString.new('SESSION', [ true, 'The session number to run this module on', '1']),\n OptBool.new('STORE_LOOT', [false, 'Store session outputs to loot folder?', false]),\n OptString.new('LOOT_FOLDER', [ false, 'The full path [local] where to store logs', '/root']),\n OptString.new('EXEC_COMMAND', [true, 'The bash command to be executed remotely', 'ls -A'])\n ], self.class)\n\n end", "title": "" }, { "docid": "9bd11d3969ca378119a763e8db899a17", "score": "0.5615825", "text": "def initialize(info={})\r\n super(update_info(info,\r\n 'Name' => 'FILELESS UAC BYPASS USING COMPMGMTLAUNCHER.EXE',\r\n 'Description' => %q{\r\n\r\n This registry key can be used to redirect the execution of any application to a different executable. The specified “debugger” application will be called with a path to the original program as the first argument.\r\n\r\n },\r\n 'License' => UNKNOWN_LICENSE,\r\n 'Author' =>\r\n [\r\n 'Chaitanya Haritash', #Module Author \r\n\t\t\t\t\t'Discovered by Enigma', #Discoverer\r\n ],\r\n \r\n #'Version' => '$Revision: 1.0',\r\n #'DisclosureDate' => 'mar 8 2017',\r\n 'Platform' => 'windows',\r\n 'Arch' => 'x86_x64',\r\n 'Privileged' => 'false', # we need a priviliged session to hijack keys :(\r\n 'Targets' =>\r\n [\r\n # Tested againts Windows 10 | windows 7 (SP1) | windows XP (SP3)\r\n [ 'Windows XP', 'Windows VISTA', 'Windows 7', 'Windows 8', 'Windows 10' ]\r\n ],\r\n 'DefaultTarget' => '1', # default its to run againts Windows 10\r\n 'References' =>\r\n [\r\n ['https://github.com/ChaitanyaHaritash/My-Exploits/tree/master/COMPMGMTLAUNCHER_UAC_BYPASS'],\r\n ],\r\n 'DefaultOptions' =>\r\n {\r\n 'SESSION' => '1', # Default its to run againts session 1\r\n 'EXEC_COMMAND' => 'start C:\\\\windows\\\\system32\\\\notepad.exe',\r\n },\r\n 'SessionTypes' => [ 'meterpreter' ]\r\n \r\n ))\r\n \r\n register_options(\r\n [\r\n OptString.new('SESSION', [ true, 'The session number to run this module on']),\r\n OptString.new('EXEC_COMMAND', [ false, 'The cmd command to be executed (eg start notepad.exe)']),\r\n\r\n ], self.class)\r\n \r\n end", "title": "" }, { "docid": "c2e69cab2064c03f5f00d126e3be5303", "score": "0.55918217", "text": "def package_info_command(id)\n fields = %w(name version synopsis homepage haddock-html data-dir)\n ghc_pkg_field_command(id, fields, \"--ipid\")\n end", "title": "" }, { "docid": "c2e69cab2064c03f5f00d126e3be5303", "score": "0.55918217", "text": "def package_info_command(id)\n fields = %w(name version synopsis homepage haddock-html data-dir)\n ghc_pkg_field_command(id, fields, \"--ipid\")\n end", "title": "" }, { "docid": "9997b1b764585ab6d9d15c50ce5c34c0", "score": "0.5591566", "text": "def show_pkg_info(package)\n\tdependencies = []\n \topt = []\n\taur_deps = []\n\tname, version, release, description = \"\"\n\tputs\n\tputs \"Package that will be installed\".yellow\n\tputs \"==============================\".yellow\n\n\t# Get basic information about the package from the PKGBUILD file\n\tFile.readlines(\"/tmp/umbra/#{package}/.SRCINFO\").each {\n\t\t|line| case line.split(\"=\")[0].delete_prefix(\"\\t\").strip\n\t\twhen \"pkgbase\"\n\t\t\tname = line.split(\"=\")[1].strip\n\t\twhen \"pkgver\"\n\t\t\tversion = line.split(\"=\")[1].strip\n\t\twhen \"pkgrel\"\n\t\t\trelease = line.split(\"=\")[1].strip\n\t\twhen \"pkgdesc\"\n\t\t\tdescription = line.split(\"=\")[1]\n\t\twhen \"depends\"\n\t\t\tdependencies << line.split(\"=\")[1].strip.split(\" \")[0].split(\"<\")[0].split(\">\")[0].split(\">\")[0]\n\t\twhen \"optdepends\"\n\t\t\topt << line.split(\"=\")[1].strip\n\t\tend\n\t}\n\n\t# Show dependencies\n\tputs \"Name: #{name}\"\n\tputs \"Version: #{version}\"\n\tputs \"Release: #{release}\"\n\tputs \"Description: #{description}\"\n\tif dependencies.length > 1\n\t\tputs\n\t\tputs \"Dependencies\".yellow\n\t\tputs \"============\".yellow\n\t\ti = 0\n\t\twhile i < dependencies.length\n\t\t\tprint \"#{dependencies[i]} \"\n\t\t\t# Check what packages are available in the AUR\n\t\t\tcode=%x(curl -Is #{AUR_url}packages/#{dependencies[i].split(\" \")[0].split(\"<\")[0].split(\">\")[0].split(\">\")[0]} | head -1 | cut -d\" \" -f2).chomp\n\t\t\tif code != \"404\"\n\t\t\t\tputs \"(Will be installed from the AUR)\"\n\t\t\t\taur_deps << dependencies[i].split(\" \")[0]\n\t\t\telse\n\t\t\t\tputs\n\t\t\tend\n\t\t\ti += 1\n\t\tend\n\tend\n\n\t# Show optional dependencies\n\tif opt.length > 1\n\t\tputs\n\t\tputs \"Optional dependencies\".yellow\n\t\tputs \"=====================\".yellow\n\t\ti = 0\n\t\twhile i < opt.length\n\t\t\tputs \"#{opt[i]}\"\n\t\t\ti += 1\n\t\tend\n\tend\n\tputs\n\n\t# Start installing the dependencies that are from the AUR\n\twhile aur_deps.length > 0\n\t\tprint \">> \".magenta\n\t\tputs \"Installing dependencies that are only available in the AUR\"\n\t\tpkg_install(aur_deps[0])\n\t\taur_deps.delete_at(0)\n\tend\nend", "title": "" }, { "docid": "01ac73127f24e15734a26510017cee4a", "score": "0.5578569", "text": "def ShowInstallInfo\n env_txt = ''\n if @env == nil\n return 0\n end\n @env.each do |k, flag|\n env_txt += \"#{k}: #{flag}\\n\"\n end\n \n info_txt = %Q{\n>> Installation Destination:\n#{@prefix}\n\n>> Config options\n--prefix=#{@prefix}\n#{@conf_options.join(\"\\n\")}\n\n>> Compiler options (env)\n#{env_txt}\n\n }\n puts info_txt\n sleep(2.5)\n end", "title": "" }, { "docid": "7b5d235f19359b907aadcf5566e0603c", "score": "0.5577004", "text": "def help(argv)\n puts \"Smeagol #{VERSION}\"\n puts \"\"\n puts \"Commands:\"\n puts \" init - initialize Gollum wiki for use with smeagol\"\n puts \" preview - preview a single site\"\n puts \" serve - serve all configured smeagol sites\"\n #puts \" deploy - deploy site to server (COMING SOON)\"\n puts \" help - show this help message\"\n puts\n end", "title": "" }, { "docid": "e20cc6ed6e534e7057dbc88ede946d6c", "score": "0.5575467", "text": "def usage_page\n FORMAT.info(\"ruby #{File.basename(__FILE__)} -[SHORT-OPTS] [ARGS] --[LONG-OPTS] [ARGS]\")\n FORMAT.info(\"Check the README.md file for a list of flags and further information\\n\")\n system('ruby whitewidow.rb --help')\n exit\nend", "title": "" }, { "docid": "68a03d78bb8dbbaa2cbcc01cbf823e8d", "score": "0.5571236", "text": "def build\n make 'TARGET' => 'linux2628', 'CPU' => 'native', 'USE_PCRE' => '1', 'USE_PCRE_JIT' => '1', 'USE_OPENSSL' => '1', 'USE_ZLIB' => '1', 'USE_LIBCRYPT' => '1', 'USE_LUA' => '1'\n\n # halog\n make '-C', 'contrib/halog'\n end", "title": "" }, { "docid": "afb02b00b98ff6c19f12caf4fea0c9f2", "score": "0.5559358", "text": "def cmd_show(*args)\n if args.empty?\n print_error(\"Argument required\\n\")\n cmd_show_help\n return\n end\n\n mod = self.active_module\n\n args.each { |type|\n case type\n when '-h'\n cmd_show_help\n when 'all'\n show_encoders\n show_nops\n show_exploits\n show_payloads\n show_auxiliary\n show_post\n show_plugins\n when 'encoders'\n show_encoders\n when 'nops'\n show_nops\n when 'exploits'\n show_exploits\n when 'payloads'\n show_payloads\n when 'auxiliary'\n show_auxiliary\n when 'post'\n show_post\n when 'info'\n cmd_info(*args[1, args.length])\n when 'options'\n if (mod)\n show_options(mod)\n else\n show_global_options\n end\n when 'missing'\n if (mod)\n show_missing(mod)\n else\n print_error(\"No module selected.\")\n end\n when 'advanced'\n if (mod)\n show_advanced_options(mod)\n else\n print_error(\"No module selected.\")\n end\n when 'evasion'\n if (mod)\n show_evasion_options(mod)\n else\n show_evasion\n end\n when 'sessions'\n if (active_module and active_module.respond_to?(:compatible_sessions))\n sessions = active_module.compatible_sessions\n else\n sessions = framework.sessions.keys.sort\n end\n print_line\n print(Serializer::ReadableText.dump_sessions(framework, :session_ids => sessions))\n print_line\n when \"plugins\"\n show_plugins\n when \"targets\"\n if (mod and (mod.exploit? or mod.evasion?))\n show_targets(mod)\n else\n print_error(\"No exploit module selected.\")\n end\n when \"actions\"\n if mod && mod.kind_of?(Msf::Module::HasActions)\n show_actions(mod)\n else\n print_error(\"No module with actions selected.\")\n end\n\n else\n print_error(\"Invalid parameter \\\"#{type}\\\", use \\\"show -h\\\" for more information\")\n end\n }\n end", "title": "" }, { "docid": "e2354a09a46f24e375a30c7a9d2a7a9a", "score": "0.55583394", "text": "def show_usage\n\t\tputs \"List of commands and description of usage\".light_yellow + \": \".white\n\t\tputs \"\\tclear\".light_yellow + \" => \".white + \"Clear Screen\".light_yellow\n\t\tputs \"\\texit\".light_yellow + \" => \".white + \"Exit Completely\".light_yellow\n\t\tputs \"\\thelp \".light_yellow + \" => \".white + \"Display this Help Menu\".light_yellow\n\t\tprint_line(\"\")\n\t\tputs \"\\trecon\".light_yellow + \" => \".white + \"Recon & Discovery Shell\".light_yellow\n\t\tputs \"\\tlogin\".light_yellow + \" => \".white + \"Logins & Bruteforcers Shell\".light_yellow\n\t\tputs \"\\tpayload\".light_yellow + \" => \".white + \"Payloads Builder Shell\".light_yellow\n\t\tputs \"\\tlistener\".light_yellow + \" => \".white + \"Listener & Connection Handler Setup\".light_yellow\n\t\tputs \"\\tsnmp\".light_yellow + \" => \".white + \"Windows SNMP Enumation Tools\".light_yellow\n\t\tputs \"\\tsmb\".light_yellow + \" => \".white + \"SMB Tools\".light_yellow\n\t\tputs \"\\texploit\".light_yellow + \" => \".white + \"Exploits Shell\".light_yellow\n\t\tputs \"\\twifi\".light_yellow + \" => \".white + \"WiFi Shell\".light_yellow\n\t\tputs \"\\tmitm\".light_yellow + \" => \".white + \"MiTM Shell\".light_yellow\n\t\tputs \"\\tupdate \".light_yellow + \" => \".white + \"Updater\".light_yellow\n\t\tprint_line(\"\")\n\t\tputs \"\\tlocal\".light_yellow + \" => \".white + \"Local OS Shell\".light_yellow\n\t\tputs \"\\trb <code>\".light_yellow + \" => \".white + \"Evaluates Ruby Code\".light_yellow\n\t\tprint_line(\"\")\n\tend", "title": "" }, { "docid": "6c46e18008db9abcc96ca6ecafea9469", "score": "0.55414397", "text": "def importer_help\n\ttogprint('p', \"Somewhat experimental as I have no idea if this works outside of Ubuntu Linux. If you look at the settings you'll see file system locations that Ubuntu mounts cameras and cards. Modifying these to match your OS should make things 'just work' but tread carefully.\")\nend", "title": "" }, { "docid": "9f86c516029434ff744c6ecab7aa83ee", "score": "0.5540718", "text": "def gemspec_info_io\n puts \"Some info is needed for the gemspec:\".red\n @summary = _prompt \"add a one-line summary.\"\n @author = _prompt \"enter the author's name\"\n @email = _prompt \"enter the author's email\"\n @url = _prompt \"enter the homepage url\"\n @rubygems_version = `gem -v`.chomp\n self\n end", "title": "" }, { "docid": "2e5c2e980f4579a13f4538ea06d2cdca", "score": "0.55386305", "text": "def prep(makao_path)\n cmd = \"\n cd #{@path_in}\n export LIBFFI_CFLAGS=-I/usr/include/ffi\n export LIBFFI_LIBS=-lffi\n export MAKAO=#{makao_path} \n ./autogen.sh\n $MAKAO/parsing/bin/makewrapper.sh all 2&> trace.txt \n $MAKAO/parsing/bin/generate_makao_graph.pl -in trace.txt -out trace.gdf -format gdf\n \"\n bash(cmd)\n end", "title": "" }, { "docid": "fc9ce37b33b0cfc2a0b4e61532780c31", "score": "0.5536896", "text": "def _help\n # make necessary configurations from app options\n parse\n end", "title": "" }, { "docid": "8dea2ca74229aca5888c75d927bad713", "score": "0.5522556", "text": "def help\n puts\n print \"Dev\".green\n print \" - available commands:\\n\"\n puts\n \n print \"\\tversion\\t\\t\".limegreen \n print \"Prints current version.\\n\"\n puts\n\n print \"\\tfeature\\t\\t\".limegreen\n print \"Opens or closes a feature for the current app.\\n\"\n print \"\\t\\t\\tWarning: the app is determined from the current working directory!\\n\"\n print \"\\t\\t\\tExample: \"\n print \"dev feature open my-new-feature\".springgreen\n print \" (opens a new feature for the current app)\"\n print \".\\n\"\n print \"\\t\\t\\tExample: \"\n print \"dev feature close my-new-feature\".springgreen\n print \" (closes a developed new feature for the current app)\"\n print \".\\n\"\n puts\n\n print \"\\thotfix\\t\\t\".limegreen\n print \"Opens or closes a hotfix for the current app.\\n\"\n print \"\\t\\t\\tWarning: the app is determined from the current working directory!\\n\"\n print \"\\t\\t\\tExample: \"\n print \"dev hotfix open 0.2.1\".springgreen\n print \" (opens a new hotfix for the current app)\"\n print \".\\n\"\n print \"\\t\\t\\tExample: \"\n print \"dev hotfix close 0.2.1\".springgreen\n print \" (closes a developed new hotfix for the current app)\"\n print \".\\n\"\n puts\n\n print \"\\trelease\\t\\t\".limegreen\n print \"Opens or closes a release for the current app.\\n\"\n print \"\\t\\t\\tWarning: the app is determined from the current working directory!\\n\"\n print \"\\t\\t\\tExample: \"\n print \"dev release open 0.2.0\".springgreen\n print \" (opens a new release for the current app)\"\n print \".\\n\"\n print \"\\t\\t\\tExample: \"\n print \"dev release close 0.2.0\".springgreen\n print \" (closes a developed new release for the current app)\"\n print \".\\n\"\n puts\n\n print \"\\tpull\\t\\t\".limegreen\n print \"Pulls specified app's git repository, or pulls all apps if none are specified.\\n\"\n print \"\\t\\t\\tWarning: the pulled branch is the one the app is currently on!\\n\"\n print \"\\t\\t\\tExample: \"\n print \"dev pull [myapp]\".springgreen\n print \".\\n\"\n puts\n\n print \"\\tpush\\t\\t\".limegreen\n print \"Commits and pushes the specified app.\\n\"\n print \"\\t\\t\\tWarning: the pushed branch is the one the app is currently on!\\n\"\n print \"\\t\\t\\tExample: \"\n print \"dev push myapp \\\"commit message\\\"\".springgreen\n print \".\\n\"\n puts\n\n print \"\\ttest\\t\\t\".limegreen\n print \"Runs the app's test suite. Tests must be written with rspec.\\n\"\n print \"\\t\\t\\tIt is possibile to specify which app's test suite to run.\\n\"\n print \"\\t\\t\\tIf nothing is specified, all main app's test suites are run.\\n\"\n print \"\\t\\t\\tExample: \"\n print \"dev test mymainapp myengine\".springgreen\n print \" (runs tests for 'mymainapp' and 'myengine')\"\n print \".\\n\"\n print \"\\t\\t\\tExample: \"\n print \"dev test\".springgreen\n print \" (runs tests for all main apps and engines within this project)\"\n print \".\\n\"\n puts\n end", "title": "" }, { "docid": "98782444443426f8c1687d025d5263b6", "score": "0.55189645", "text": "def help\n puts \"OPTIONS:\\n\\n\"\n puts \" add-all - add all directories in the current directory to config.yml\"\n puts \" add-repository <name> <dir> - add repo and dir to config.yml. (add, add-repo)\"\n puts \" config - show current config settings\"\n puts \" clean-config - remove any missing direcotries from config.yml\"\n puts \" clean-history - clear entries from history.log file\"\n puts \" convert-config - convert conf from sym to string\"\n puts \" destroy - delete current grit setup including config and .grit directory\"\n puts \" help - display list of commands\"\n puts \" history - display history of grit requiests in this directory\"\n puts \" init <dir> (optional) - create grit config.yml file in .grit dir\"\n puts \" remove-repository <name> - remove specified repo from config.yml, (rm-repo, rm-repository, remove-repo)\"\n puts \" reset - reset current grit setup to the initial config\"\n puts \" on <repo> <action> - execute git action on specific repo\"\n puts \" version - get current grit version\\n\\n\"\n end", "title": "" }, { "docid": "87262d06c0bcdbb462ec942e1ed63dc6", "score": "0.55088305", "text": "def info_command\n plugin = prepare_plugin\n packager = PluginPackager[\"#{configuration[:format].capitalize}Packager\"]\n packager.new(plugin).package_information\n end", "title": "" }, { "docid": "87262d06c0bcdbb462ec942e1ed63dc6", "score": "0.55088305", "text": "def info_command\n plugin = prepare_plugin\n packager = PluginPackager[\"#{configuration[:format].capitalize}Packager\"]\n packager.new(plugin).package_information\n end", "title": "" }, { "docid": "7341cbe468cbfe8fd04b0387b216b059", "score": "0.5502453", "text": "def initialize(info={})\n super(update_info(info,\n 'Name' => 'dll hijacking in spotify 1.0.43.123 software',\n 'Description' => %q{\n This post-exploitation module requires a meterpreter session to be able to upload/inject our libEGL.dll malicious agent into the path of the service (dll hijacking) \"WARNING: payload to send must be named as: libEGL.dll\"\n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'Module Author And Bug Discovered by : Chaitanya Haritash', \n 'Special Thanks To : r00t-3xp10it', #For teaching :) \n ],\n \n 'Version' => '$Revision: 1.1',\n 'DisclosureDate' => 'dez 1 2016',\n 'Platform' => 'windows',\n 'Arch' => 'x86_x64',\n 'Privileged' => 'false', # thats no need for privilege escalation..\n 'Targets' =>\n [\n # tested on: windows 7 ultimate (32 bits)\n [ 'Windows XP', 'Windows VISTA', 'Windows 7', 'Windows 8', 'Windows 9', 'Windows 10' ]\n ],\n 'DefaultTarget' => '3', # default its to run againts windows 7 ultimate (32 bits)\n 'References' =>\n [\n [ 'URL', 'http://www.spotify.com' ],\n [ 'URL', 'https://blog.fortinet.com/2015/12/10/a-crash-course-in-dll-hijacking' ]\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n\t\t\t\t\t'SESSION' => '1', # Default its to run againts session 1\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n OptString.new('SESSION', [ true, 'The session number to run this module on']),\n OptString.new('LOCAL_PATH', [ false, 'The full path of libEGL.dll to upload (eg /root/libEGL.dll)'])\n ], self.class)\n\n register_advanced_options(\n [\n OptBool.new('REVERT_HIJACK', [ false, 'Revert lbEGL.dll to default stage?' , false])\n ], self.class)\n \n end", "title": "" }, { "docid": "60fef694d0ba7d812c6f2f3f88293f38", "score": "0.54921716", "text": "def build_command\n _dump_cmd = [DEFAULT_DUMP] + %w{ -n -q -w - } + [ \"-i\", @interface, \"-f\", @capture_filter ]\n _shark_cmd = [DEFAULT_SHARK] + %w{ -r - -l }\n\n @options.each do |opt|\n _shark_cmd += [ \"-o\", opt ]\n end\n\n _shark_cmd += [ \"-Y\", @display_filter.map { |df| \"( \" + df + \" )\" }.join(\" || \") ] unless @display_filter.empty?\n _shark_cmd += %w{ -Tfields }\n COMMON_FIELDS.each do |k|\n _shark_cmd += [ \"-e\", k ]\n end\n @fields.each do |k,_|\n _shark_cmd += [ \"-e\", k ]\n end\n [_dump_cmd, _shark_cmd]\n end", "title": "" }, { "docid": "a69e28f834002ca825026a003e7f73c7", "score": "0.5491813", "text": "def generate\n config = Config.new\n config.slug = @slug\n config.name = @name\n config.version = @version\n config.author = @author\n config.description = @description\n config.depends.mikutter = @mikutter\n\n puts \"Configuring #{@slug}\"\n\n config.ask\n\n puts ''\n puts config.to_h_k_s.to_yaml\n puts ''\n\n dir = MikutterCLI::Template.generate_plugin 'plugin.erb', config\n git_init dir\n end", "title": "" }, { "docid": "5cd54a0afd3f89f309d55fe427835ed5", "score": "0.54855543", "text": "def initialize(args)\n\t\t@opts = OpenStruct.new\n\t\t# setup the defaults\n\t\t@opts.path = Pathname.new(\".\").realpath.to_s\n\t\t@opts.brand = \"simo\"\n\t\t@opts.mode = \"debug\"\n\t\t@opts.ignore = \"\"\n\t\t@opts.os = PLATFORM\n\n\t\ttarget = short_platform\n\n\t\t@opts.flags = YAML.load_file( \"config/#{target}.yml\" )\n\n\t\toverridedefault=false\n\t\tmozdist = ''\n\t\tfiredist =''\n\t\topts = OptionParser.new { |opts|\n\t\t\topts.banner = \"Usage: #{$0} [options]\"\n\t\t\topts.separator \"\"\n\t\t\topts.separator \"Specific options:\"\n\n\t\t\topts.on( \"-b S\", \"--brand\", \"Brand to Build\" ){|brand| @opts.brand = BuildConfig.clean_str( brand ) }\n\t\t\topts.on( \"-m S\", \"--mode\", \"Mode to Build (release|debug)\" ) { |mode| @opts.mode = BuildConfig.clean_str( mode ) }\n\t\t\topts.on( \"-x S\", \"--xul\", \"Path to your Mozilla Dist Folder\" ){ |xul| \n\t\t\t\tmozdist = \"'#{BuildConfig.clean_str( xul )}'\"\n\t\t\t\toverridedefault=true\n\t\t\t}\n\t\t\topts.on( \"-d S\", \"--database\", \"Firebird Database Binaries\" ) { |fdb|\n\t\t\t\tfiredist = \"'#{BuildConfig.clean_str( fdb )}'\"\n\t\t\t\toverridedefault=true\n\t\t\t}\n\n\t\t\topts.separator \"\"\n\t\t\topts.separator \"Common options:\"\n\n\t\t\t# No argument, shows at tail. This will print an options summary.\n\t\t\t# Try it and see!\n\t\t\topts.on_tail(\"-h\", \"--help\", \"Show this message\") {\n\t\t\t\tputs opts\n\t\t\t\texit\n\t\t\t}\n\n\t\t\topts.on_tail(\"--version\", \"Show version\") {\n\t\t\t\tputs \"0.1\"\n\t\t\t\texit\n\t\t\t}\n\t\t\topts.on_tail(\"--info\", \"Detail about your host build environment\") {\n\t\t\t\tprint_config\n\t\t\t\texit\n\t\t\t}\n\t\t}.parse!\n\n\t\tif overridedefault == true\n\n\t\t\tif mozdist != ''\n\t\t\t\tif !@user_opts\n\t\t\t\t\t@user_opts = Hash.new\n\t\t\t\tend\n\t\t\t\tif !@user_opts[@opts.mode]\n\t\t\t\t\t@user_opts[@opts.mode] = Hash.new\n\t\t\t\tend\n\t\t\t\t@user_opts[@opts.mode]['MOZDIST'] = mozdist\n\t\t\tend\n\n\t\t\tif firedist != ''\n\t\t\t\tif !@user_opts\n\t\t\t\t\t@user_opts = Hash.new\n\t\t\t\tend\n\t\t\t\tif !@user_opts[@opts.mode]\n\t\t\t\t\t@user_opts[@opts.mode] = Hash.new\n\t\t\t\tend\n\t\t\t\t@user_opts[@opts.mode]['FIREBIRDDIST'] = firedist\n\t\t\tend\n\n\t\t\tputs \"Creating user config YAML File\"\n\t\t\tFile.open( \"config/user_#{target}.yml\", \"w\" ){ |out| YAML.dump( @user_opts, out ) }\n\t\t\t@user_opts = YAML.load_file( \"config/user_#{target}.yml\" )\n\t\tend\n\t\t\n\t\t@user_opts = YAML.load_file( \"config/user_#{target}.yml\" )\n\n\t\t# XXX: gotta love rubys win32 support\n\t\tmozdist = @user_opts[@opts.mode]['MOZDIST'].gsub(\"'\",\"\").strip.gsub('\\\\','/').gsub('C:/','c:/')\n\t\tfiredist = @user_opts[@opts.mode]['FIREBIRDDIST'].gsub(\"'\",\"\").strip.gsub('\\\\','/').gsub('C:/','c:/')\n\t\tputs \"#{mozdist}\"\n\n\t\t# need to make this path relative to the source dir\n\t\tmozdist = Pathname.new( mozdist )\n\t\tif( mozdist.absolute? )\n\t\t\tmozdist = mozdist.relative_path_from( Pathname.new(@opts.path) )\n\t\t\tif( target == \"win32\" )\n\t\t\t\tmozdist = Pathname.new( mozdist.to_s.gsub('c:/','') )\n\t\t\tend\n\t\tend\n\t\tfiredist = Pathname.new( firedist )\n\t\tif( firedist.absolute? )\n\t\t\tfiredist = firedist.relative_path_from( Pathname.new(@opts.path) )\n\t\t\tif( target == \"win32\" )\n\t\t\t\tfiredist = Pathname.new( firedist.to_s.gsub('c:/','') )\n\t\t\tend\n\t\tend\n\t\tputs \"mozdist: #{mozdist}\"\n\t\tputs \"firedist: #{firedist}\"\n\t\t@user_opts[@opts.mode]['MOZDIST'] = mozdist\n\t\t@user_opts[@opts.mode]['FIREBIRDDIST'] = firedist\n\t\t#File.open( \"config/user_#{target}.yml\", \"w\" ){ |out| YAML.dump( @user_opts, out ) }\n\n\tend", "title": "" }, { "docid": "fe445e61fa665f59e2f6cbbd835ec307", "score": "0.5485447", "text": "def help() end", "title": "" }, { "docid": "b3e9d7ca96cad0d2abf66927812b690c", "score": "0.54852146", "text": "def do_usage()\n puts \"Usage: alto_page [flags] server /path/to/xml_file.xml\"\n puts \"Import ALTO ocr for a page into specified TypeWright server.\"\n puts \"If the book does not exist, issue error.\"\n puts \" -v Verbose output\"\n puts \" -t Test only -- don't actually upload files\"\n puts \" -c Output the curl commands that would have been executed.\"\nend", "title": "" }, { "docid": "3da677ca1954c958049641dd69381cfc", "score": "0.5481612", "text": "def main\n\t\t\topts = OptionParser.new do |opt|\n\t\t\t\topt.banner =\t\"#{APP_NAME} v#{VERSION}\\nJacob Hammack\\nhttp://www.hammackj.com\\n\\n\"\n\t\t\t\topt.banner << \"Usage: #{APP_NAME} [options] \"\n\t\t\t\topt.separator('')\n\n\t\t\t\topt.on('-a', '--attach PID', \"Attaches the debugger to the specified PID\") do |option|\n\t\t\t\t\tdbg = RbDbg::Debugger::OSX::OSXDebugger.new option\n\t\t\t\t\tdbg.print_registers\n\t\t\t\t\t\n\t\t\t\t\tdbg.attach\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\topt.on('--enumerate-processes', \"Enumerates all of the processes that can be debugged\") do |option|\n\t\t\t\t\tputs \"Not Implemented yet\"\n\t\t\t\tend\n\n\t\t\t\topt.separator('')\n\t\t\t\topt.separator('Other Options')\n\t\t\t\t\n\t\t\t\topt.on_tail('-v', '--version', \"Shows application version information\") do\n\t\t\t\t\tputs \"#{APP_NAME} - #{VERSION}\"\n\t\t\t\t\texit\n\t\t\t\tend\n\n\t\t\t\topt.on_tail(\"-?\", \"--help\", \"Show this message\") do\n\t\t\t\t\tputs opt.to_s + \"\\n\"\n\t\t\t\t\texit\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\tif ARGV.length != 0\n\t\t\t\topts.parse!\n\t\t\telse\n\t\t\t\tputs opts.to_s + \"\\n\"\n\t\t\t\texit\n\t\t\tend\n\t\t\t\n\t\tend", "title": "" }, { "docid": "f1a8e52e3420b2b015dc620da772ca8c", "score": "0.5475148", "text": "def generate\n puts header, \"\\n\", common_options, \"\\n\", subcommands\n end", "title": "" }, { "docid": "d6f983e6b3b6a2afbc85149240bd3113", "score": "0.54744476", "text": "def usage\n print_line <<USAGE\n Usage: arachni_rpc --server https://host:port \\[options\\] url\n\n Supported options:\n\n\n SSL --------------------------\n (Do *not* use encrypted keys!)\n\n --ssl-pkey <file> location of the SSL private key (.pem)\n (Used to verify the the client to the servers.)\n\n --ssl-cert <file> location of the SSL certificate (.pem)\n (Used to verify the the client to the servers.)\n\n --ssl-ca <file> location of the CA certificate (.pem)\n (Used to verify the servers to the client.)\n\n\n General ----------------------\n\n -h\n --help output this\n\n -v be verbose\n\n --debug show what is happening internally\n (You should give it a shot sometime ;) )\n\n --only-positives echo positive results *only*\n\n --http-req-limit concurent HTTP requests limit\n (Be carefull not to kill your server.)\n (Default: 60)\n (*NOTE*: If your scan seems unresponsive try lowering the limit.)\n\n --cookie-jar=<cookiejar> netscape HTTP cookie file, use curl to create it\n\n\n --user-agent=<user agent> specify user agent\n\n --authed-by=<who> who authorized the scan, include name and e-mail address\n (It'll make it easier on the sys-admins during log reviews.)\n (Will be appended to the user-agent string.)\n\n\n Profiles -----------------------\n\n --save-profile=<file> save the current run profile/options to <file>\n\n --load-profile=<file> load a run profile from <file>\n (Can be used multiple times.)\n (You can complement it with more options, except for:\n * --mods\n * --redundant)\n\n --show-profile will output the running profile as CLI arguments\n\n\n Crawler -----------------------\n\n -e <regex>\n --exclude=<regex> exclude urls matching regex\n (Can be used multiple times.)\n\n -i <regex>\n --include=<regex> include urls matching this regex only\n (Can be used multiple times.)\n\n --redundant=<regex>:<count> limit crawl on redundant pages like galleries or catalogs\n (URLs matching <regex> will be crawled <count> links deep.)\n (Can be used multiple times.)\n\n -f\n --follow-subdomains follow links to subdomains (default: off)\n\n --obey-robots-txt obey robots.txt file (default: off)\n\n --depth=<number> depth limit (default: inf)\n (How deep Arachni should go into the site structure.)\n\n --link-count=<number> how many links to follow (default: inf)\n\n --redirect-limit=<number> how many redirects to follow (default: inf)\n\n --spider-first spider first, audit later\n\n\n Auditor ------------------------\n\n -g\n --audit-links audit link variables (GET)\n\n -p\n --audit-forms audit form variables\n (usually POST, can also be GET)\n\n -c\n --audit-cookies audit cookies (COOKIE)\n\n --exclude-cookie=<name> cookies not to audit\n (You should exclude session cookies.)\n (Can be used multiple times.)\n\n --audit-headers audit HTTP headers\n (*NOTE*: Header audits use brute force.\n Almost all valid HTTP request headers will be audited\n even if there's no indication that the web app uses them.)\n (*WARNING*: Enabling this option will result in increased requests,\n maybe by an order of magnitude.)\n\n\n Modules ------------------------\n\n --lsmod=<regexp> list available modules based on the provided regular expression\n (If no regexp is provided all modules will be listed.)\n (Can be used multiple times.)\n\n\n -m <modname,modname..>\n --mods=<modname,modname..> comma separated list of modules to deploy\n (Modules are referenced by their filename without the '.rb' extension, use '--lsmod' to see all.\n Use '*' as a module name to deploy all modules or inside module names like so:\n xss_* to load all xss modules\n sqli_* to load all sql injection modules\n etc.\n\n You can exclude modules by prefixing their name with a dash:\n --mods=*,-backup_files,-xss\n The above will load all modules except for the 'backup_files' and 'xss' modules.\n\n Or mix and match:\n -xss_* to unload all xss modules. )\n\n\n Reports ------------------------\n\n --lsrep list available reports\n\n --repload=<file> load audit results from an .afr file\n (Allows you to create new reports from finished scans.)\n\n --report='<report>:<optname>=<val>,<optname2>=<val2>,...'\n\n <report>: the name of the report as displayed by '--lsrep'\n (Reports are referenced by their filename without the '.rb' extension, use '--lsrep' to see all.)\n (Default: stdout)\n (Can be used multiple times.)\n\n\n Plugins ------------------------\n\n --lsplug list available plugins\n\n --plugin='<plugin>:<optname>=<val>,<optname2>=<val2>,...'\n\n <plugin>: the name of the plugin as displayed by '--lsplug'\n (Plugins are referenced by their filename without the '.rb' extension, use '--lsplug' to see all.)\n (Can be used multiple times.)\n\nUSAGE\n end", "title": "" }, { "docid": "222e5553f0184fde1d6b7e070746b3cb", "score": "0.5473398", "text": "def show_help\n puts HELP_TEXT\n show_version\nend", "title": "" }, { "docid": "4baf840e11779fee2f0e0c885101c393", "score": "0.5467645", "text": "def main\n program_desc 'Read values from the Grin PhaseRunner Controller primarily for logging'\n\n version Phaserunner::VERSION\n\n subcommand_option_handling :normal\n arguments :strict\n sort_help :manually\n\n desc 'Serial (USB) device'\n default_value '/dev/ttyUSB0'\n arg 'tty'\n flag [:t, :tty]\n\n desc 'Serial port baudrate'\n default_value 115200\n arg 'baudrate'\n flag [:b, :baudrate]\n\n desc 'Modbus slave ID'\n default_value 1\n arg 'slave_id'\n flag [:s, :slave_id]\n\n desc 'Path to json file that contains Grin Modbus Dictionary'\n default_value Modbus.default_file_path\n arg 'dictionary_file'\n flag [:d, :dictionary_file]\n\n desc 'Loop the command n times'\n default_value :forever\n arg 'loop_count', :optional\n flag [:l, :loop_count]\n\n desc 'Do not output to stdout'\n switch [:q, :quiet]\n\n desc 'Read a single or multiple adjacent registers from and address'\n arg_name 'register_address'\n command :read_register do |read_register|\n read_register.desc 'Number of registers to read starting at the Arg Address'\n read_register.default_value 1\n read_register.flag [:c, :count]\n\n read_register.arg 'address'\n read_register.action do |global_options, options, args|\n address = args[0].to_i\n count = args[1].to_i\n node = dict[address]\n puts modbus.range_address_header(address, count).join(\",\") unless quiet\n (0..loop_count).each do |i|\n puts modbus.read_raw_range(address, count).join(\",\") unless quiet\n end\n end\n end\n\n desc 'Logs interesting Phaserunner registers to stdout and file'\n long_desc %q(Logs interesting Phaserunner registers to stdout and a CSV file. File name in the form: phaserunner.#{Time.now.strftime('%Y-%m-%d_%H-%M-%S')}.csv)\n command :log do |log|\n log.action do |global_options, options, args|\n filename = \"phaserunner.#{Time.now.strftime('%Y-%m-%d_%H-%M-%S')}.csv\"\n output_fd = File.open(filename, 'w')\n header = modbus.bulk_log_header\n\n # Generate and output header line\n hdr = %Q(Timestamp,#{header.join(\",\")})\n puts hdr unless quiet\n output_fd.puts hdr\n\n (0..loop_count).each do |i| \n data = modbus.bulk_log_data\n str = %Q(#{Time.now.utc.round(10).iso8601(6)},#{data.join(\",\")})\n puts str unless quiet\n output_fd.puts str\n sleep 0.2\n end\n end\n end\n\n pre do |global, command, options, args|\n # Pre logic here\n # Return true to proceed; false to abort and not call the\n # chosen command\n # Use skips_pre before a command to skip this block\n # on that command only\n @quiet = global[:quiet]\n # Handle that loop_count can be :forever or an Integer\n @loop_count = if global[:loop_count] == :forever\n Float::INFINITY\n else\n global[:loop_count].to_i\n end\n @modbus = Modbus.new(global)\n @dict = @modbus.dict\n end\n\n post do |global,command,options,args|\n # Post logic here\n # Use skips_post before a command to skip this\n # block on that command only\n end\n\n on_error do |exception|\n # Error logic here\n # return false to skip default error handling\n true\n end\n\n exit run(ARGV)\n end", "title": "" }, { "docid": "931b2159ec12b591fab71bb91c4c9dbb", "score": "0.54673916", "text": "def fixMateInfoCmd()\n cmd = \"java \" + @heapSize + \" -jar \" + @picardPath + \"/FixMateInformation.jar I=\" +\n @samFileName.to_s + \" O=\" + @sortedBam + \" SO=coordinate \" + @picardTempDir + \" \" + \n @maxRecordsInRam.to_s + \" \" + @picardValStr + \" 1>fixMateInfo.o 2>fixMateInfo.e\"\n return cmd\n end", "title": "" }, { "docid": "63e757e74a38e07696855d441bf6fc41", "score": "0.54607046", "text": "def pdf_manager_help\n \n printf(\"\\n\\n ============pdf manager help begin========================= \\n\\n\")\n\n printf(\"\\n -v check version\\n\");\n printf(\"\\n -h help \\n\");\n printf(\"\\n -c start to change the pdf name\\n\")\n\n printf(\"\\n\\n ============pdf manager help end ========================= \\n\\n\")\nend", "title": "" }, { "docid": "a3ef0abcb5d91fd250d7313a8e6c1978", "score": "0.5449271", "text": "def print_usage_general\n puts \"VuzitCL - Vuzit Command Line\"\n puts \"Usage: vuzitcl COMMAND -k PUBLIC_KEY,PRIVATE_KEY [OPTIONS]\"\n puts \"\"\n puts \"Type 'vuzitcl help <command>' for help on a specific command.\"\n puts \"\"\n puts \"Available commands:\"\n puts \"\"\n puts \" delete\"\n puts \" event\"\n puts \" load\"\n puts \" page\"\n puts \" upload\"\n puts \" search\"\n puts \" help\"\nend", "title": "" }, { "docid": "394a5d61a08203db56b4e31a1b83a2e7", "score": "0.5447053", "text": "def commands\n\t\t\t{\n\t\t\t\t\"arachni_load\" => \"Loads an ArachniMetareport file (.afr.msf).\",\n\t\t\t\t\"arachni_autopwn\" => \"Tries to exploit all vulnerabilities.\",\n\t\t\t\t\"arachni_list_exploits\" => \"Lists all matching exploit modules.\",\n\t\t\t\t\"arachni_list_vulns\" => \"Lists all vulnerabilities.\",\n\t\t\t\t\"arachni_list_all\" => \"Same as running 'arachni_list_exploits' & 'arachni_list_vulns'.\",\n\t\t\t\t\"arachni_killall\" => \"Kills all running/pending pwn-jobs.\",\n\t\t\t\t\"arachni_manual\" => \"Prepares a vulnerability for manual exploitation.\",\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "2ed9a1285bde3b762c4092fc5574083b", "score": "0.5446049", "text": "def usage_help()\n\tputs\n\tputs \"Umbra help page\".yellow\n\tputs \"===============\".yellow\n\tputs \"Usage: umbra <operation> [package_name]\"\n\tputs\n\tputs \"Operations:\"\n\tputs \"-S: install a package\"\n\tputs \"-Syu: upgrade repositories and packages, including the ones from the AUR\"\n\tputs \"-R: remove a package\"\n\tputs \"-Rs: remove a package and its dependencies\"\n\tputs \"-Q: show all installed packages (Official + AUR)\"\n\tputs \"-Qa: show packages that were installed from the AUR\"\n\tputs \"-U: installs a local package, given the directory where the PKGBUILD file is located\"\n\tputs \"-h, --help: show this help page\"\n\tputs \"-v: print version of the program\"\n\tputs\n\tputs \"Options:\"\n\tputs \"--noconfirm: install the package without asking any questions to the user\" \nend", "title": "" }, { "docid": "91287016a8655913cc9b5e3bfc5acaf6", "score": "0.54359186", "text": "def cmd_info params = nil\n @show_info = @show_info^true\n end", "title": "" }, { "docid": "4548c640112c315ae4081807513d36c4", "score": "0.5430896", "text": "def run()\n $stderr.puts \"INFO\\t#{VERSION_STRING} #{COPYRIGHT}\"\n if File.basename($PROGRAM_NAME) == 'oml2_scaffold'\n old = File.basename($PROGRAM_NAME)\n new = old.gsub('_', '-')\n $stderr.puts \"WARN\\t'#{old}' is a deprecated name for this script; use '#{new}' instead.\"\n end\n\n opts = OptionParser.new\n opts.banner = %Q|\nGenerate C code for an OML application from an application definition file\n\n Usage: #{$0} [OPTIONS] [app_file]\n\n|\n\n output = []\n app_name = 'unknown'\n create_app = false\n force = false\n\n opts.on('-a', \"--app PROG_NAME\",\n \"Create a skeleton OMF application definition file \") do |name|\n create_app = true\n app_name = name\n end\n opts.on('-f', \"--force\",\n \"Do not check if a file would be overwritten\") do\n force = true\n end\n opts.on('-l', \"--long\",\n \"Alias :int and :integer to underlying :long\") do\n $integer_alias = :long\n end\n opts.on('-i', \"--int32\",\n \"Alias :int and :integer and :long to underyling :int32 (default)\") do\n $integer_alias = :int32\n end\n opts.on(nil, \"--oml\",\n \"Create the oml header file defining all measurement points\") do\n output << :oml\n end\n opts.on(nil, \"--opts\",\n \"Create the popt header file for all application properties\") do\n output << :popt\n end\n opts.on(\"--make\",\n \"Create a skeleton Makefile for this application\") do\n output << :make\n end\n opts.on(\"--main\",\n \"Create a skeleton main file for this application\") do\n output << :main\n end\n\n opts.on_tail(\"-h\", \"--help\", \"Show this message\") do $stderr.write(opts); exit end\n opts.on_tail(\"-v\", \"--version\", \"Show the version\\n\") do\n $stderr.puts VERSION_STRING\n exit\n end\n\n begin\n rest = opts.parse(ARGV)\n rescue OptionParser::InvalidOption => ex\n $stderr.puts ex\n exit -1\n rescue OptionParser::MissingArgument => ex\n $stderr.puts ex\n exit -1\n end\n\n if rest.size > 1\n $stderr.puts \"ERROR\\tToo many arguments\"\n $stderr.write(opts.banner)\n exit -1\n end\n app_file = rest[0]\n\n # Backward-compatible mappings for deprecated integer types, others are set above\n $types[:integer] = $types[$integer_alias]\n $types[:int] = $types[$integer_alias]\n\n if create_app\n if app_file\n $stderr.puts \"ERROR\\tDon't specify app_file when asking to create one\"\n exit -1\n end\n uri = \"#{ENV['USER']}:app:#{app_name}\"\n ad = AppDefinition.new uri, app_name\n app_file = \"#{app_name}.rb\"\n if File.exists?(app_file) && !force\n $stderr.puts \"ERROR\\tFile #{app_file} already exists. Use --force to overwrite\"\n exit -1\n else\n File.open(app_file, 'w') do |f|\n\tad.write_app_def(f, app_file)\n end\n end\n $stderr.puts \"INFO\\tCreated #{app_file}\"\n $stderr.puts \"INFO\\tYou can now generate a skeleton main file with '#{$PROGRAM_NAME} --main #{app_file}' and its associated Makefile with '#{$PROGRAM_NAME} --make #{app_file}'\"\n AppDefinition.remove ad\n exit\n end\n\n unless app_file\n $stderr.puts \"ERROR\\tMissing app_file\"\n exit -1\n end\n\n app_file = File.expand_path(app_file)\n unless File.readable?(app_file)\n $stderr.puts \"ERROR\\tCan't find or open application description file #{app_file}\"\n exit -1\n end\n load(app_file)\n AppDefinition.each do |app|\n output.each do |type|\n case type\n when :oml\n fname = \"#{app.name}_oml.h\"\n File.open(fname, 'w') do |f|\n app.write_oml_h(f)\n end\n $stderr.puts \"INFO\\tCreated #{fname}\"\n when :popt\n fname = \"#{app.name}_popt.h\"\n File.open(fname, 'w') do |f|\n app.write_opts_h(f)\n end\n $stderr.puts \"INFO\\tCreated #{fname}\"\n when :make\n fname = \"Makefile\"\n if File.exists?(fname) && !force\n $stderr.puts \"ERROR\\tFile #{fname} already exists. Use --force to overwrite\"\n exit -1\n else\n File.open(fname, 'w') do |f|\n app.write_makefile(f)\n end\n $stderr.puts \"INFO\\tCreated #{fname}\"\n end\n when :main\n\tfname = \"#{app.name}.c\"\n\tif (File.exists?(fname) || File.exists?(\"config.h\")) && !force\n\t $stderr.puts \"ERROR\\t#{fname} or config.h already exist. Use --force to overwrite\"\n\t exit -1\n\telse\n\t File.open(fname, 'w') do |f|\n\t app.write_main(f)\n\t end\n\t File.open('config.h', 'w') do |f|\n\t app.write_config(f)\n\t end\n\t $stderr.puts \"INFO\\tCreated #{fname} and config.h\"\n\tend\n else\n\t$stderr.puts \"ERROR\\tUnsupported output format #{type}\"\n\texit -1\n end\n end\n end\nend", "title": "" }, { "docid": "32837257fa56d80b647985cda4cbc38d", "score": "0.54286957", "text": "def build_main_form\n add_form_line_text('Hostname: ', :@hostname)\n add_form_line_text('Username: ', :@username)\n add_form_pass_text('Password: ', :@password)\n add_form_pass_text('Root Password: ', :@root_password)\n add_form_line_text('Port: ', :@port)\n\n add_form_line_toggle('Use Sudo', :@sudo)\n add_submit_button('Run Profile') { run_profile }\n end", "title": "" }, { "docid": "5747a0e14e88e0febedbd37974adbc0c", "score": "0.54268754", "text": "def initialize(info={})\n super(update_info(info,\n 'Name' => 'CleanTracks Anti-forensic auxiliary',\n 'Description' => %q{\n This module needs a meterpreter session open to cover,\n footprints left in target system after a sucessfully exploitation,\n it rellys on registry keys and cmd commands to achieve that goal.\n \"Also we can set more than one option to run simultaneously\"\n \n GET_SYS: getprivs msf API call to elevate current session to\n nt authority/system, its advice to run it before runnig\n any of the stages (PREVENT, CLEANER, DEL_LOGS, REVERT)\n PREVENT: the creation of data in target system (footprints) by\n adding registry policie keys into target regedit, this\n module should be run just after a sucessfully exploitation.\n CLEANER: clear temp, prefetch, recent, flushdns, restore points\n reg last key accessed, cookies, tmp, pf, shellbags.\n This module should be run before leaving session.\n DEL_LOGS: delete all Event Viewer logfiles in target system\n REVERT: regedit policies in target system to default values\n LOGOFF: logoff target machine (optional, more effective)\n \n },\n 'License' => UNKNOWN_LICENSE,\n 'Author' =>\n [\n 'peterubuntu10[at]sourceforge[dot]net', # post-exploitation auxiliary module author\n 'Bug Hunters: Betto,crypt0,chaitanya,spirit', # testing/debug module\n\n ],\n \n 'Version' => '$Revision: 1.9',\n 'DisclosureDate' => 'jul 13 2016',\n 'Platform' => 'windows',\n 'Arch' => 'x86_x64',\n 'Privileged' => 'false',\n 'Targets' =>\n [\n # Tested againts windows 7 (32 bits)\n [ 'Windows XP', 'Windows VISTA', 'Windows 7', 'Windows 8', 'Windows 9', 'Windows 10' ]\n ],\n 'DefaultTarget' => '3', # default its to run againts windows 7 (32 bits)\n 'References' =>\n [\n [ 'URL', 'http://sourceforge.net/users/peterubuntu10' ],\n [ 'URL', 'http://sourceforge.net/projects/msf-auxiliarys/repository' ],\n [ 'URL', 'http://www.fireeye.com/blog/threat-research/2013/08/execute.html' ],\n [ 'URL', 'http://www.forensicfocus.com/a-forensic-analysis-of-the-windows-registry' ],\n [ 'URL', 'http://pt.slideshare.net/bsmuir/windows-10-forensics-os-evidentiary-artefacts' ],\n [ 'URL', 'http://windowsir.blogspot.pt/2013/07/howto-determine-user-access-to-files.html' ],\n [ 'URL', 'http://www.magnetforensics.com/computer-forensics/forensic-analysis-of-lnk-files' ]\n ],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n\t\t\t\t\t'SESSION' => '1', # Default its to run againts session 1\n\t\t\t\t},\n 'SessionTypes' => [ 'meterpreter' ]\n \n ))\n \n register_options(\n [\n # Opt::RPORT(666), # Example how to register a default setting...\n OptString.new('SESSION', [ true, 'The session number to run this module on']),\n OptBool.new('GET_SYS', [ false, 'Elevate current session to nt authority/system' , false]),\n OptBool.new('PREVENT', [ false, 'The creation of data in target system (footprints)' , false]),\n OptBool.new('CLEANER', [ false, 'Cleans temp/prefetch/recent/flushdns/logs/restorepoints' , false]),\n OptBool.new('DEL_LOGS', [ false, 'Cleans EventViewer logfiles in target system' , false]),\n OptBool.new('LOGOFF', [ false, 'Logoff target system (no prompt)' , false])\n ], self.class)\n\n register_advanced_options(\n [\n OptBool.new('REVERT', [ false, 'Revert regedit policies in target to default values' , false]),\n OptBool.new('PANIC', [ false, 'Use this option as last resource (format NTFS systemdrive)' , false]),\n OptString.new('DIR_MACE', [ false, 'Blank MACE of any directory inputed (eg: %windir%\\\\\\\\system32)']),\n ], self.class)\n \n end", "title": "" }, { "docid": "e1c9491d8f8a876bfd3b444849ad1c71", "score": "0.54208183", "text": "def help()\r\n print \"hotlist Shows the hotlist\"\r\n print \"folders Shows all folders\"\r\n print \"goals Shows all goals\"\r\n print \"contexts Shows all contexts\"\r\n print \"tasks Shows tasks ('tasks *Action @Home')\"\r\n print \r\n print \"add Adds task ('add *Action @Home Eat breakfast')\"\r\n print \" folder Adds a folder ('add folder MyFolder')\"\r\n print \" context Adds a context ('add context MyContext')\"\r\n print \" goal Adds a goal ('add goal MyGoal')\"\r\n print \"edit Edits a task ('edit *Action 1134')\"\r\n print \"complete Completes a task ('complete 1234')\"\r\n print \"delete Deletes a task ('delete 1134')\"\r\n print \" folder Deletes a folder ('delete folder 1')\"\r\n print \" context Deletes a context ('delete context 2')\"\r\n print \" goal Deletes a goal ('delete goal 3')\"\r\n print \r\n print \"archive Archives a folder ('archive 1234')\"\r\n print \"filter Defines filters ('filter *Action @Someday')\"\r\n print \"unfilter Removes all filters\"\r\n print \"filters Displays the list of filters\"\r\n print\r\n print \"help or ? Displays this help message\"\r\n print \"quit or exit Leaves the application\"\r\n end", "title": "" }, { "docid": "50b71f1c6ae49ed176b4ef2aee66cc33", "score": "0.5414783", "text": "def interactive_generator\n \n web_ui = ToolWebUI.new()\n web_ui.show\n \nend", "title": "" }, { "docid": "cf20ed022df7f738a497474acc8cf509", "score": "0.5370487", "text": "def print_help\n puts <<-HELP_TEXT\n\nBasic Ruby Bitmap Manipulator\n-----------------------------\nCommands:\n I [width] [height] # Create an image that is [width] wide and [height] high. NOTE [height] cannot exceed 250.\n C # Clear the image contents.\n L [x] [y] [colour] # Colour the pixel at [x] [y] the colour [colour].\n V [x] [y1] [y2] [colour] # Draw a vertical line starting at co-ordinates [x], [y1] and ending at [x], [y2] (inclusive).\n H [x1] [x2] [y] [colour] # Draw a horizontal line starting at co-ordinates [x1], [y] and ending at [x2], [y] (inclusive).\n F [x] [y] [colour] # Fill all pixels that are the same colour as image[x, y] and touching with the colour [colour].\n R [direction \"H\" || \"V\"] # Reflect (flip) the image either vertically or horizontally.\n S # Show the image as it currently is.\n X # Exit - close out of the application. \n\n HELP_TEXT\n get_input\n end", "title": "" }, { "docid": "4c4ebe58390ccb1fd65f6712514c1f92", "score": "0.53694195", "text": "def info()\n puts \">> dm-tools combat tracker 0.1\\n\" + \n \">> created by Mohsin Rizvi\\n\" +\n \">> enter \\\"q\\\" to exit at any time\\n\" + \n \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n end", "title": "" }, { "docid": "41fcb04640ee335a1a4515d6c3f4a3b5", "score": "0.5368939", "text": "def main\n program_desc 'Manipulate and view the ASIObjectDictionary.xml and BOD.json files'\n\n version AsiBod::VERSION\n\n subcommand_option_handling :normal\n arguments :strict\n sort_help :manually\n\n desc 'Path to the ASIObjectDictionary XML file'\n default_value Asi.default_file_path\n flag [:a, :asi_file]\n\n desc 'Path to the BOD JSON file'\n default_value Bod.default_file_path\n flag [:b, :bod_file]\n\n desc 'View Address'\n switch :address_view, default_value: true\n\n desc 'View Name'\n switch :name_view, default_value: true\n\n desc 'View Description'\n switch :description_view, default_value: true\n\n desc 'View Scale'\n switch [:s, :scale_view]\n\n desc 'View Units'\n switch [:u, :units_view]\n\n desc 'View the data'\n command :view do |view|\n view.desc 'Pretty Print output of the simplified ASI ObjectDictionary as a hash'\n view.command :asi do |view_asi| \n view.desc 'Output as Json instead of CSV'\n view.switch [:j, :json]\n\n view_asi.action do |global_options, options, args|\n if options[GPARENT][:json]\n puts JSON.pretty_generate asi.hash_data\n else\n Dict.specific_keys_per_node(\n asi.hash_data,\n which_keys(global_options)) do |address, node|\n puts node\n end\n end\n end\n end\n\n view.desc 'Pretty Print output of the simplified BOD as a hash'\n view.command :bod do |view_bod|\n view_bod.action do |global_options,options,args|\n if options[GPARENT][:json]\n puts JSON.pretty_generate bod.hash_data\n else\n Dict.specific_keys_per_node(\n bod.hash_data,\n which_keys(global_options)).each_pair do |address, node|\n puts node\n end\n end\n end\n end\n view.default_command :bod\n end\n\n desc 'Find a node in one or both of the dictionaries'\n command :find do |find|\n find.desc 'Search the asi dictionary'\n find.switch [:a, :asi]\n\n find.desc 'Search the bod dictionary'\n find.switch [:b, :bod]\n\n find.desc 'Find by register address'\n find.long_desc 'Find by register address. ' +\n 'Must select at least one of ' +\n 'asi or bod and specify search_term'\n find.arg 'address'\n find.command :by_address do |find_by_address| \n find_by_address.action do |global_options, options, args|\n address = args.first\n # puts \"find_by_address global_options #{global_options.inspect} options: #{options.inspect} args: #{args.inspect}\"\n puts \"asi: => \" +\n \"#{Dict.node_line(asi.hash_data[address.to_i],\n which_keys(global_options))}\" if options[GPARENT][:asi]\n puts \"bod: => \" +\n \"#{Dict.node_line(bod.hash_data[address.to_i],\n which_keys(global_options))}\" if options[GPARENT][:bod]\n end\n end\n\n find.desc 'Find by the substring of a key'\n find.long_desc 'Find by the substring of ' +\n 'a Must select at least one of ' +\n 'asi or bod and specify search_term'\n find.arg 'node_key'\n find.arg 'substring'\n find.command :by_key_substring do |find_by_key_substring| \n find_by_key_substring.action do |global_options, options, args|\n key = args[0].to_sym\n substring = args[1]\n if options[GPARENT][:asi]\n puts \"asi: key: #{key} substring: #{substring} => \"\n Dict.find_by_key_substring(asi.hash_data, key, substring,\n which_keys(global_options)\n ).each_pair do |address, node|\n puts node\n end\n end\n if options[GPARENT][:bod]\n puts \"bod: key: #{key} substring: #{substring} => \"\n Dict.find_by_key_substring(bod.hash_data, key, substring,\n which_keys(global_options)\n ).each_pair do |address, node|\n puts node\n end\n end\n end\n end\n end\n\n desc 'Merge the Description from asi to bod'\n long_desc 'Merge the Description from asi to bod ' +\n 'Do not merge if Description has \"Reserved\" in it ' +\n 'Or if the Bod doesnt have the key'\n command :merge do |merge|\n merge.desc 'Output Json'\n merge.switch [:j, :json]\n merge.action do |global_options,options,args|\n raw_result = Dict.merge(asi.hash_data, bod.hash_data)\n result = if options[:json]\n JSON.pretty_generate raw_result\n else\n raw_result.pretty_inspect\n end\n puts result\n end\n end\n\n pre do |global_options, command, options, args|\n # Pre logic here\n # Return true to proceed; false to abort and not call the\n # chosen command\n # Use skips_pre before a command to skip this block\n # on that command only\n @asi = AsiBod::Asi.new(global_options)\n @bod = AsiBod::Bod.new(global_options)\n end\n\n post do |global_options, command, options, args|\n # Post logic here\n # Use skips_post before a command to skip this\n # block on that command only\n end\n\n on_error do |exception|\n # Error logic here\n # return false to skip default error handling\n true\n end\n\n exit run(ARGV)\n end", "title": "" }, { "docid": "830b1360a097b719a7a83cef5a1bf8d8", "score": "0.5367672", "text": "def usage_io\n if @name.blank?\n puts \"\\nUsage: make_gem <name>\"\n exit\n end\n self\n end", "title": "" }, { "docid": "7fc9edf963b631bfe6413ab3b1ee1311", "score": "0.5366948", "text": "def show_header\n unless @cmd[:brief]\n # print an informative header before starting\n print_log \"\\nGit Repo update utility (v\", VERSION, ')',\n \" \\u00A9 Grant Ramsay <seapagan@gmail.com>\\n\"\n print_log \"Using Configuration from '#{@cmd.getconfig.config_path}'\\n\"\n # show the logfile location, but only if it is enabled\n show_logfile\n # list out the locations that will be searched\n list_locations\n # list any exceptions that we have from the config file\n list_exceptions\n # save the start time for later display in the footer...\n @metrics[:start_time] = Time.now\n end\n print_log \"\\n\" # blank line before processing starts\n end", "title": "" }, { "docid": "6f2321653c1cc1f3e252a89f853214fd", "score": "0.5364683", "text": "def fixMateInfoCustomCommand(input, output)\n jarName = @javaDir + \"/MateInfoFixer.jar\"\n cmd = \"java \" + @heapSize + \" -jar \" + jarName + \" I=\" + input +\n \" O=\" + output + \" FUR=true \" + @picardTempDir + \" \" +\n @maxRecordsInRam.to_s + \" \" + @picardValStr + \" 1>mateInfoFixer.o \" +\n \"2>mateInfoFixer.e\"\n return cmd\n end", "title": "" }, { "docid": "0a103be024a021cd81da1ce6673b850d", "score": "0.5364416", "text": "def set_opts(opts)\n super\n\n opts.banner = <<END\nUsage: ggen [options] [INPUT] [OUTPUT]\n\nDescription:\n Converts Ggen files to HTML.\n\nOptions:\nEND\n opts.on('-n', '--new-game', \"Generate a new game based on reference game id and new game id\") do\n @options[:new_game] = true\n end\n\n opts.on('--game-id ID', \"Generated Game ID\") do |id|\n @options[:for_engine][:game_id] = id\n end\n\n opts.on('--reference-game-id ID', \"Game Id for the reference game\") do |id|\n @options[:for_engine][:reference_game_id] = id\n end\n\n opts.on('--output DIR', \"Output Root directory, default is './Generate'\") do |dir|\n @options[:for_engine][:output_root] = dir\n end\n\n opts.on('-m', '--merge-resource', \"Merge resources\") do\n @options[:merge_resource] = true\n end\n\n opts.on('--resource-paths LIST', \"Comma separated paths in which all resouce files are stored\") do |paths|\n @options[:for_engine][:resource_paths] = paths.split(/,/)\n end\n\n opts.on('-s', '--symbol-scripts', \"Generate Symbol related lua scripts\") do\n @options[:symbol_scripts] = true\n end\n\n opts.on('--base-symbols LIST', \"Comma separated symbol list of base game\") do |symbols|\n @options[:for_engine][:base_symbols] = symbols.split(/,/)\n end\n\n opts.on('--bonus-symbols LIST', \"Comma separated symbol list of base game\") do |symbols|\n @options[:for_engine][:bonus_symbols] = symbols.split(/,/)\n end\n\n opts.on('--bonus-symbol SYMBOL', \"Bonus symbol which can trigger into bonus stage\") do |symbol|\n @options[:for_engine][:bonus_symbol] = symbol\n end\n\n opts.on('--wild-symbol SYMBOL', \"Wild symbol\") do |symbol|\n @options[:for_engine][:wild] = symbol\n end\n\n opts.on('--scatter-symbol SYMBOL', \"scatter symbol\") do |symbol|\n @options[:for_engine][:scatter] = symbol\n end\n\n opts.on('-c', '--configuation-scripts', \"Generate Configuration Files based on Stage Information\") do\n @options[:configuration_files] = true\n end\n\n opts.on('--rmlp', \"Add rmlp feature to the game\") do\n @options[:for_engine][:rmlp] = true\n end\n\n opts.on('-A', '--All', \"Perform all generation tasks sequentially\") do\n @options[:new_game] = true\n @options[:merge_resource] = true\n @options[:symbol_scripts] = true\n @options[:configuration_files] = true\n end\n end", "title": "" }, { "docid": "9e0625deb3264df5d875c4ef5dd1ad58", "score": "0.53638166", "text": "def inspect(options:)\n pkg = File.join(@config.in[:folder], @config.in[:file])\n pkg = pkg+\".pkg\" unless pkg.end_with?(\".pkg\")\n # upload new key with password\n path = \"/plugin_inspect\"\n response = nil\n multipart_connection do |conn|\n payload = {\n mysubmit: \"Inspect\",\n passwd: options[:password],\n archive: Faraday::UploadIO.new(pkg, 'application/octet-stream')\n }\n response = conn.post path, payload\n end\n\n app_name = /App Name:\\s*<\\/td>\\s*<td>\\s*<font[^>]*>([^<]*)<\\/font>\\s*<\\/td>/.match(response.body)\n dev_id = nil\n creation_date = nil\n dev_zip = nil\n if app_name\n app_name = app_name[1]\n dev_id = /Dev ID:\\s*<\\/td>\\s*<td>\\s*<font[^>]*>([^<]*)<\\/font>\\s*<\\/td>/.match(response.body)[1]\n creation_date = /new Date\\(([^)]*)\\)/.match(response.body.delete(\"\\n\"))[1]\n dev_zip = /dev.zip:\\s*<\\/td>\\s*<td>\\s*<font[^>]*>([^<]*)<\\/font>\\s*<\\/td>/.match(response.body)[1]\n else\n app_name = /App Name:[^<]*<div[^>]*>([^<]*)<\\/div>/.match(response.body)[1]\n dev_id = /Dev ID:[^<]*<div[^>]*><font[^>]*>([^<]*)<\\/font><\\/div>/.match(response.body)[1]\n creation_date = /new Date\\(([^\\/]*)\\)/.match(response.body.delete(\"\\n\"))[1]\n dev_zip = /dev.zip:[^<]*<div[^>]*><font[^>]*>([^<]*)<\\/font><\\/div>/.match(response.body)[1]\n end\n\n info = {app_name: app_name, dev_id: dev_id, creation_date: Time.at(creation_date.to_i).to_s, dev_zip: dev_zip}\n\n inspect_logger = ::Logger.new(STDOUT)\n inspect_logger.formatter = proc {|_severity, _datetime, _progname, msg|\n \"%s\\n\\r\" % [msg]\n }\n inspect_logger.unknown \"==============================================================\"\n inspect_logger.unknown \"App Name: #{info[:app_name]}\"\n inspect_logger.unknown \"Dev ID: #{info[:dev_id]}\"\n inspect_logger.unknown \"Creation Date: #{info[:creation_date]}\"\n inspect_logger.unknown \"dev.zip: #{info[:dev_zip]}\"\n inspect_logger.unknown \"==============================================================\"\n\n end", "title": "" }, { "docid": "e1585706026434d822a33c23f6e1f981", "score": "0.53599644", "text": "def run_wizard\n # TODO create self.log() with padding to even output\n # Info\n @author = self.ask('What is your name?:')\n @link = self.ask('What is the URI to your companies website?:')\n @email = self.ask('What is your email?:')\n @module_name = self.ask('Enter a human readable name for your module:')\n @module_description = self.ask('Enter a short description of your module:')\n @module_dependencies = self.ask('Enter a list of dependencies for your module:', true)\n # Hooks\n puts self.list_templates('Hooks:', 'hooks')\n @hooks = self.ask('Which hooks would you like to implement?:', true)\n # Files\n puts self.list_templates('Files:', 'txt')\n @files = self.ask('Which additional files would you like to include?:', true)\n # Dirs\n puts \"\\nCommon directories:\"\n puts ['js', 'images', 'css'].collect{ |d| \" - \" << d }\n @dirs = self.ask('Which directories would you like to create?:', true)\n # Finish\n self.create_tokens\n self.create_hook_weights\n self.create_module\n end", "title": "" }, { "docid": "0a03b69caf96d45d034f938c40ddf53d", "score": "0.5356532", "text": "def show_cmd_line\n\tputs \"\"\"\n\t\t\tCOMMAND LINE\n\t\t\t1: cp\n\t\t\t2: mv\n\t\t\t3: cd\n\t\t\t4: ls\n\t\t\t5: mkdir\n\t\t\t6: rm\n\t\t\t7: Main Menu\"\"\"\nend", "title": "" }, { "docid": "e41141643d13e50e72a564f582a9770b", "score": "0.53561413", "text": "def usage()\n puts \"Usage: tama.rb [--noget] [--local] [--version] [--help] [--check]\"\n puts \" [--config-file-name FILE]\"\n puts \" [--output-directory-name DIRECTORY]\"\n puts \" [--force] [--verbose] [--debug]\"\n puts \"詳しい使い方は 'tama.rb --help'を実行して下さい。\"\nend", "title": "" }, { "docid": "431884950cd68fc5eb4aef15768cf4a2", "score": "0.5353302", "text": "def program_information\n program :name, \"Brandish\"\n program :version, Brandish::VERSION\n program :help_formatter, :compact\n program :help_paging, false\n program :description, \"A multi-format document generator.\"\n program :help, \"Author\", \"Jeremy Rodi <jeremy.rodi@medcat.me>\"\n program :help, \"License\", \"MIT License Copyright (c) 2017 Jeremy Rodi\"\n end", "title": "" }, { "docid": "d2311899308c84bc68d27ec645955686", "score": "0.53529304", "text": "def usage\n puts 'Drossellog - logfile analyzer |'\n puts '------------------------------|'\n puts ''\n puts GetText::_('Parses a logfile step-by-step')\n puts '--help, -h ' + GetText::_('Display this help')\n puts '--input, -i <file> ' + GetText::_('The logfile we want to analyze')\n exit\nend", "title": "" }, { "docid": "46b2479db6443e64b42dbdb71d229a35", "score": "0.53514814", "text": "def initialize(args)\n super()\n\n # Options hash\n options = {\n\t:cmd => :info\n }\n\n # Create a new options parser.\n opts = OptionParser.new\n\n\n # Section separator\n opts.separator \" \"\n opts.separator \"Transcoding Options\"\n\n # Input file option.\n opts.on('-i FILEPATH', '--infile FILEPATH', String, 'The source media file.') do |infile|\n raise(Transcoder::MissingFile, \"The input file is missing or not a regular file.\") if !File.file?(infile)\n options[:cmd] = :transcode\n\toptions[:infile] = infile\n end\n\n # Output file option.\n # TODO: Check for collisions with existing files, with a separate case for collisions with the source file.\n opts.on('-o FILEPATH', '--out FILEPATH', String, 'The destination media file.') do |outfile|\n raise(FileExists, \"The output file already exists!\") if !File.file?(outfile)\n options[:outfile] = outfile\n end\n\n # Device option\n # TODO: Rename this (or add a target option)? we may have targets other than devices, after all.\n opts.on('-d DEVICE', '--device DEVICE', String, 'The target device.') do |device|\n # TODO: Check to see if the device exists.\n options[:device] = device\n end\n\n # Section separator\n opts.separator \" \"\n opts.separator \"Configuration Options\"\n\n opts.on('-D', '--defaults', 'Use the default settings for the target.', 'No attempts to adjust for the', 'source type will be made.') do\n options[:defaults] = true\n end\n\n # TODO: Metadata analysis options.\n\n # Section separator\n opts.separator \" \"\n opts.separator \"Info Options\"\n\n # TODO: Load profiles from...\n\n opts.on('-l [DEVICE]', '--list [DEVICE]', String, 'List supported devices.', 'If a DEVICE is specified, ', 'print brief info about its supported modes.') do |device|\n\n\toptions[:cmd] = :list\n \toptions[:device] = device unless device.nil?\n\n end\n\n opts.on_tail('-h', '--help') do |category|\n # TODO: Help categories.\n puts opts\n exit\n end\n\n # Process the options\n opts.parse!(args)\n\n # Merge the set options into this object.\n merge!(options);\n\n end", "title": "" }, { "docid": "87f11b29641b29f5997ddf4e824e1b9d", "score": "0.5340336", "text": "def start\n String.disable_colorization = !@cmd[:color]\n # check for existence of 'Git' and exit otherwise...\n checkgit\n # print out our header unless we are dumping / importing ...\n @cons.show_header unless dumping?\n if @cmd[:show_errors]\n @cons.show_last_errors\n else\n config['location'].each do |loc|\n @cmd[:dump_tree] ? dump_tree(File.join(loc)) : recurse_dir(loc)\n end\n # print out an informative footer unless dump / import ...\n @cons.show_footer unless dumping?\n end\n end", "title": "" }, { "docid": "c2acb0c45a7d1d7b4cebac2327b0a8e7", "score": "0.5340222", "text": "def setup\n\n @registryParser = PiiRegistryParser.new\n @piiAppLinkParser = PiiAppLinkParser.new\n L.info %<DataMeta PII Registry parser: #{@registryParser.inspect}\nDataMeta PII App Link parser: #{@piiAppLinkParser.inspect}\n>\n end", "title": "" }, { "docid": "f3492f2f45d12ebabc119bfdbe362d35", "score": "0.5338665", "text": "def cmd_help\n @io_out.puts \"Available commands:\"\n @io_out.puts \" exit - Ends the application.\"\n @io_out.puts \" help - Shows this message.\"\n @io_out.puts \" search [text] - Executes a Google search and shots the results.\"\n @io_out.puts \"\"\n end", "title": "" }, { "docid": "b277c025033e531c07f3294e3cc33a05", "score": "0.533715", "text": "def usage\n puts <<USAGE\n== Synopsis\n\nss-cartridge-list: Lists all cartridges installed on the node\n\n== Usage\n\nss-cartridge-list --with-descriptors [--porcelain]\n\nOptions:\n-h|--help:\n Prints this message\n\nUSAGE\nend", "title": "" }, { "docid": "d689c71ecbf1961c5f0fce1e17d0faf4", "score": "0.5334239", "text": "def help\n text = %{\n - looper: help ---------------------------------------------------\n\n looper ;display high-level overview\n looper all ;show all items in all lists\n looper edit ;edit the looper JSON file in $EDITOR\n looper help ;this help text\n looper version ;show looper's current version.\n looper storage ;shows which storage backend you're using\n\n looper <project> ;create a new project\n looper <project> ;show items for a project\n looper <project> delete ;deletes a project\n looper <project> src <value> ;assigns a new source for a project\n looper <project> peek ;take a peek at project\n\n looper <project> <name> open ;open all item's content in in $EDITOR for a project\n looper <project> <name> delete ;deletes an item in a project\n looper <project> <name> ;copy item's value to clipboard\n\n all other documentation is located at:\n https://github.com/hsanchez/looper\n }.gsub(/^ {8}/, '') # strip the first eight spaces of every line\n\n output text\n\n end", "title": "" }, { "docid": "22c3838ccda20090cf70d9875ca4449b", "score": "0.53309584", "text": "def help(message)\n puts message\n puts \"\"\n puts \"Usage: opcode.rb --tla <TLA file> --type [erlang]\"\n puts \"\"\n exit\nend", "title": "" }, { "docid": "be10d83c427182122f49ae952d213f26", "score": "0.5328526", "text": "def usage\r\n puts(\"==================================================\")\r\n puts(\"== Commands: ==\")\r\n puts(\"==================================================\")\r\n puts(\"== checkin checkout lend limit quit help cancel ==\")\r\n puts(\"==================================================\")\r\nend", "title": "" }, { "docid": "0113b31d2f0a4c4f9b85ec997351ebd4", "score": "0.5324084", "text": "def info_command(line)\n line.gsub! /^.*?\\[INFO\\]\\s+/, ''\n return if meta_check(line)\n match_data = line.match /^\\<(.*?)\\>\\s+!(.*?)$/\n return if match_data.nil?\n\n user = match_data[1]\n args = match_data[2].split(\" \")\n call_command(user, args.slice!(0).to_sym, *args)\n end", "title": "" }, { "docid": "c805dc39a985b93fac6e99f593a2930d", "score": "0.5320567", "text": "def makefile_am_contents(dir)\n\n # Makefile.am header.\n contents = \"\\\n#------------------------------------------------------------------------------\n# Syneight - A soft-realtime transaction monitor\n# Copyright (C) 2003-2004 The Syneight Group\n#\n# TODO: License.\n#------------------------------------------------------------------------------\n\n# Generated by autoautoconf #{$version}.\"\n \n contents += \"\\n\\n\"\n\n # Get variables.\n subdirs = get_subdirs(dir)\n cpps = get_files(dir, \"^[-a-zA-Z0-9_]+\\\\.cpp$\")\n headers = get_headers(dir)\n sources = get_files(dir, \"^[-a-zA-Z0-9_]+\\\\.[ch]pp$\")\n tests = get_files(dir, \"^[-a-zA-Z0-9_]+\\\\.t\\\\.cpp$\")\n testsupport = get_files(dir, \"^[-a-zA-Z0-9_]+\\\\.ts\\\\.[ch]pp$\")\n binary = get_files(dir, \"^[-a-zA-Z0-9_]+\\\\.b\\\\.cpp$\").strip\n dirname = File.basename(dir)\n \n # Subdirs.\n if (subdirs != \"\")\n contents += \"## Subdirectories to process.\\n\"\n contents += \"SUBDIRS = #{beautify(subdirs)}\\n\"\n contents += \"\\n\"\n end\n\n # Headers.\n if (headers != \"\")\n contents += \"## Header files.\\n\"\n contents += \"noinst_HEADERS = #{beautify(headers)}\\n\"\n contents += \"\\n\"\n end\n\n # Library.\n if (cpps != \"\" or testsupport != \"\")\n ltlibs = \"\"\n ltlibs += \"lib#{dirname}.la \" if (sources != \"\")\n ltlibs += \"libts#{dirname}.la \" if (testsupport != \"\")\n\n contents += \"## Not to be installed helper-libraries.\\n\"\n contents += \"noinst_LTLIBRARIES = #{ltlibs}\\n\"\n #contents += \"lib_LTLIBRARIES = #{ltlibs}\\n\"\n contents += \"\\n\"\n\n contents += \"## Helper-library sources.\\n\"\n contents += \"lib#{dirname}_la_SOURCES = #{beautify(sources)}\\n\"\n contents += \"\\n\"\n\n subdirlibs = \"\"\n if (subdirs != \"\")\n subdirs.split.each do |subdir|\n\tif (get_files(\"#{dir}/#{subdir}\", \"^[-a-zA-Z0-9_]+\\\\.cpp$\") != \"\")\n \tsubdirlibs += \"#{subdir}/lib#{subdir}.la \"\n\tend\n end\n subdirlibs.strip! if (subdirlibs != \"\")\n end\n\n # Libraries (not in subdirectories) we need to link against.\n otherlibs = get_dependencies(dir)\n\n libs = \"#{subdirlibs} #{otherlibs}\".strip\n\n if (libs != \"\")\n contents += \"## Libraries we link against.\\n\"\n contents += \"lib#{dirname}_la_LIBADD = #{beautify(libs)}\\n\"\n contents += \"\\n\"\n end\n\n # Test support library.\n if (testsupport != \"\")\n contents += \"## Testsupport library sources.\\n\"\n contents += \"libts#{dirname}_la_SOURCES = #{beautify(testsupport)}\\n\"\n contents += \"\\n\"\n end\n end\n\n # Programs.\n if (binary != \"\" or tests != \"\")\n bins = \"\"\n bins += \"#{binary[0..-5]} \" if (binary != \"\")\n tests.split.each do |test|\n bins += \"#{test[0..-5]} \"\n end\n bins.strip!\n\n contents += \"## The executable programs to be built.\\n\"\n contents += \"bin_PROGRAMS = #{beautify(bins)}\\n\"\n contents += \"\\n\"\n end\n\n if (binary != \"\")\n contents += \"## Binary '#{binary[0..-7]}'.\\n\"\n binary2 = binary[0..-5].gsub(/\\./, \"_\")\n contents += \"#{binary2}_SOURCES = #{binary}\\n\"\n contents += \"#{binary2}_LDADD = lib#{dirname}.la\\n\"\n contents += \"\\n\"\n end\n\n if (tests != \"\")\n tests.split.each do |test|\n contents += \"## Test for '#{test[0..-7]}'.\\n\"\n test2 = test[0..-5].gsub(/\\./, \"_\")\n contents += \"#{test2}_SOURCES = #{test}\\n\"\n if (testsupport != \"\")\n contents += \"#{test2}_LDADD = lib#{dirname}.la libts#{dirname}.la\\n\"\n else\n contents += \"#{test2}_LDADD = lib#{dirname}.la\\n\"\n end\n contents += \"\\n\"\n end\n end\n\n # Recursive targets.\n contents += get_recursive_targets(dir)\n\n # Makefile.common include.\n contents += \"# Include some common Makefile fragments.\\n\"\n contents += \"include $(top_srcdir)/Makefile.common\\n\"\n contents += \"\\n\"\n\n return contents\nend", "title": "" }, { "docid": "f9daae1a24c5864a8302a44cbd8aa4f2", "score": "0.5319958", "text": "def Init(cmdlineinfo, args)\n cmdlineinfo = deep_copy(cmdlineinfo)\n args = deep_copy(args)\n # remember the command line specification\n # required later by xmlhelp command\n @cmdlinespec = deep_copy(cmdlineinfo)\n\n cmdline_supported = true\n\n # check whether the command line mode is really supported by the module\n if !Builtins.haskey(cmdlineinfo, \"actions\") ||\n Builtins.size(Ops.get_map(cmdlineinfo, \"actions\", {})) == 0\n cmdline_supported = false\n end\n\n # initialize verbose flag\n @verbose = Builtins.contains(WFM.Args, \"verbose\")\n\n id_string = Ops.get_string(cmdlineinfo, \"id\", \"\")\n # sanity checks on cmdlineinfo\n # check for id string , it must exist, and non-empty\n if cmdline_supported && (id_string == \"\" || !Ops.is_string?(id_string))\n Builtins.y2error(\"Command line specification does not define module id\")\n\n # use 'unknown' as id\n if Builtins.haskey(cmdlineinfo, \"id\")\n cmdlineinfo = Builtins.remove(cmdlineinfo, \"id\")\n end\n\n # translators: fallback name for a module at command line\n cmdlineinfo = Builtins.add(cmdlineinfo, \"id\", _(\"unknown\"))\n\n # it's better to abort now\n @done = true\n @aborted = true\n end\n\n # check for helps, they are required everywhere\n # global help text\n if cmdline_supported && !Builtins.haskey(cmdlineinfo, \"help\")\n Builtins.y2error(\n \"Command line specification does not define global help for the module\"\n )\n\n # it's better to abort now\n @done = true\n @aborted = true\n end\n\n # help texts for actions\n if Builtins.haskey(cmdlineinfo, \"actions\")\n Builtins.foreach(Ops.get_map(cmdlineinfo, \"actions\", {})) do |action, _def|\n if !Builtins.haskey(_def, \"help\")\n Builtins.y2error(\n \"Command line specification does not define help for action '%1'\",\n action\n )\n\n # it's better to abort now\n @done = true\n @aborted = true\n end\n end\n end\n\n # help for options\n if Builtins.haskey(cmdlineinfo, \"options\")\n Builtins.foreach(Ops.get_map(cmdlineinfo, \"options\", {})) do |option, _def|\n if !Builtins.haskey(_def, \"help\")\n Builtins.y2error(\n \"Command line specification does not define help for option '%1'\",\n option\n )\n\n # it's better to abort now\n @done = true\n @aborted = true\n end\n # check that regex and enum have defined typespec\n if (Ops.get_string(_def, \"type\", \"\") == \"regex\" ||\n Ops.get_string(_def, \"type\", \"\") == \"enum\") &&\n !Builtins.haskey(_def, \"typespec\")\n Builtins.y2error(\n \"Command line specification does not define typespec for option '%1'\",\n option\n )\n\n # it's better to abort now\n @done = true\n @aborted = true\n end\n end\n end\n\n # mappings - check for existing actions and options\n if Builtins.haskey(cmdlineinfo, \"mappings\")\n Builtins.foreach(Ops.get_map(cmdlineinfo, \"mappings\", {})) do |mapaction, _def|\n # is this action defined?\n if !Builtins.haskey(\n Ops.get_map(cmdlineinfo, \"actions\", {}),\n mapaction\n )\n Builtins.y2error(\n \"Command line specification maps undefined action '%1'\",\n mapaction\n )\n\n # it's better to abort now\n @done = true\n @aborted = true\n end\n Builtins.foreach(_def) do |mapopt|\n next if !Ops.is_string?(mapopt)\n # is this option defined?\n if !Builtins.haskey(\n Ops.get_map(cmdlineinfo, \"options\", {}),\n Convert.to_string(mapopt)\n )\n Builtins.y2error(\n \"Command line specification maps undefined option '%1' for action '%2'\",\n mapopt,\n mapaction\n )\n\n # it's better to abort now\n @done = true\n @aborted = true\n end\n end\n end\n end\n\n return false if @done\n\n @modulecommands = deep_copy(cmdlineinfo)\n\n # build allcommands - help and verbose options are added specially\n @allcommands = {\n \"actions\" => Builtins.union(\n Ops.get_map(@modulecommands, \"actions\", {}),\n Ops.get(@systemcommands, \"actions\", {})\n ),\n \"options\" => Builtins.union(\n Ops.get_map(@modulecommands, \"options\", {}),\n Ops.get(@systemcommands, \"options\", {})\n ),\n \"mappings\" => Builtins.union(\n Builtins.mapmap(Ops.get_map(@modulecommands, \"mappings\", {})) do |act, opts|\n { act => Builtins.union(opts, [\"help\", \"verbose\"]) }\n end,\n Ops.get(@systemcommands, \"mappings\", {})\n )\n }\n\n if Ops.less_than(Builtins.size(args), 1) || Stage.stage != \"normal\" ||\n Stage.firstboot\n Mode.SetUI(\"dialog\")\n # start GUI, module has some work to do :-)\n return true\n else\n Mode.SetUI(\"commandline\")\n end\n\n if !cmdline_supported\n # command line is not supported\n Print(\n String.UnderlinedHeader(\n Ops.add(\"YaST2 \", Ops.get_string(cmdlineinfo, \"id\", \"\")),\n 0\n )\n )\n Print(\"\")\n\n help = Ops.get_string(cmdlineinfo, \"help\", \"\")\n if help != nil && help != \"\"\n Print(Ops.get_string(cmdlineinfo, \"help\", \"\"))\n Print(\"\")\n end\n\n Print(@nosupport)\n Print(\"\")\n return false\n end\n\n # setup prompt\n @cmdlineprompt = Ops.add(\n Ops.add(\"YaST2 \", Ops.get_string(cmdlineinfo, \"id\", \"\")),\n \"> \"\n )\n SCR.Write(path(\".dev.tty.prompt\"), @cmdlineprompt)\n\n # parse args\n @commandcache = Parse(args)\n\n # return true, if there is some work to do:\n # first, try to interpret system commands\n if ProcessSystemCommands(@commandcache)\n # it was system command, there is work only in interactive mode\n @commandcache = {}\n @done = !@interactive\n @aborted = false\n return @interactive\n else\n # we cannot handle this on our own, return true if there is some command to be processed\n # i.e, there is no parsing error\n @done = Builtins.size(@commandcache) == 0\n @aborted = @done\n return !@done\n end\n end", "title": "" }, { "docid": "fe7310c9d722e07d1f42542e3222418f", "score": "0.53194946", "text": "def cmd_info(*args)\n\t\tif (args.length == 0)\n\t\t\tif (active_module)\n\t\t\t\tprint(Serializer::ReadableText.dump_module(active_module))\n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\tprint(\n\t\t\t\t\t\"Usage: info mod1 mod2 mod3 ...\\n\\n\" +\n\t\t\t\t\t\"Queries the supplied module or modules for information.\\n\")\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\n\t\targs.each { |name|\n\t\t\tmod = framework.modules.create(name)\n\n\t\t\tif (mod == nil)\n\t\t\t\tprint_error(\"Invalid module: #{name}\")\n\t\t\telse\n\t\t\t\tprint(Serializer::ReadableText.dump_module(mod))\n\t\t\tend\n\t\t}\n\tend", "title": "" }, { "docid": "ab4665396c127518e75074710ca6e6a4", "score": "0.5316492", "text": "def parse\n output = `aapt.exe dump badging \"#{@apk_file_path}\"`\n apk_out = output.split(\"\\n\")\n apk_info = ApkInfo.new\n set_package_data(apk_info, apk_out[0])\n set_sdk_data(apk_info, apk_out[1], apk_out[2])\n set_permissions_and_label(apk_info, apk_out)\n set_icons(apk_info, apk_out)\n apk_info\n end", "title": "" }, { "docid": "5f78b8b68e6fa47e43db0d7799e678a5", "score": "0.5312964", "text": "def showUsage\n puts \"RMake v#{RMAKE_VERSION} - CMake project file generator\"\n puts \"Created by Rajinder Yadav <info@devmentor.org>\"\n puts \"Copyright (c) DevMentor.org May 21, 2012\\n\\n\"\n puts \"Use: rmake <project_name> <source_header_files>\\n\\n\"\n puts \"To re-generate a CMake project file, cd into the project folder and type:\\n\\n\"\n puts \"rmake g:eclipse - Eclipse CDT project\"\n puts \"rmake g:make - Linux GNU GCC makefile (Plus MinGW and Mac)\"\n puts \"rmake g:nmake - VC++ NMake makefile\\n\\n\"\n puts \"Optional build type flags are:\"\n puts \"\\n g:debug for Debug build (default)\"\n puts \" g:release for Release build\"\n exit( false )\nend", "title": "" }, { "docid": "15a6fee0734309b28e3039dd3f7c4079", "score": "0.53127456", "text": "def banner\n 3.times { puts }\n puts \" >> Tomato Interactive Console <<\"\n puts\n help\n end", "title": "" } ]
b60e44df59abcd8a9477f606e3a0227f
Pseudocode Input: An array of strings containing names of people in my Course. Output: Display the groups along with their members. Steps needed: 1. Define a method which takes an array as its argument 2. Using the length of the array, define several statements which will output the elements of the array accordingly.
[ { "docid": "e3d06c66f0a6f30fca0533fbfe8861ed", "score": "0.5917581", "text": "def create_acct_groups(people)\n\tpeople.shuffle!\n\n\tour_mod = people.length%4\n\t(people.length%4).times do |i|\n\t\tputs \"Group \" + i + \": \" + people[5*i] + \", \" + people[5*i+1] + \", \" + people[5*i+2] + \", \" + people[5*i+3] + \", \" + people[5*i+4]\n\tend\n\t(people.length/4).times do |i=our_mod|\n\t\tputs \"Group \" + i.to_s + \": \" + people[5*(our_mod-1)+4*i+1] + \", \" + people[5*(our_mod-1)+4*i+2] + \", \" + people[5*(our_mod-1)+4*i+3] + \", \" + people[5*(our_mod-1)+4*i+4]\n\tend\nend", "title": "" } ]
[ { "docid": "2d6383bcd131c793bc0f93645fcbdd39", "score": "0.74134326", "text": "def list_groups(groups)\n i = 1\n groups.each do |array|\n puts \"Group #{i}:\"\n array.each do |student|\n print \"\\t#{student.fname} #{student.lname} - Email: #{student.email}, Section #{student.section}, Major(s): #{student.major1} #{student.major2}\"\n if student.minor1.nil?\n puts \"\"\n else\n puts \", Minor(s): #{student.minor1} #{student.minor2}\"\n end\n end\n i += 1\n end\n return groups\nend", "title": "" }, { "docid": "e00a416df96514050acf9d8bff848307", "score": "0.7256738", "text": "def formGroups(array) \n\n\t unit_number = 1\n\t \n\t while unit_number <= 3\n\t puts \"\" #spacing arrangement\n\t randomArray = array.shuffle\n\t randomArray = randomArray.each_slice(4).to_a\n\t puts \"Unit \" + unit_number.to_s\n\t unit_number += 1\n\t \n\t group_counter = -1 #set to -1 due to higher position in the nest \n\t person_counter = 0\n\t group_number = 1\n\t person_number = 1\n\t \n\n\t while group_counter < randomArray.length - 1 #to adjust for off by 1 error\n\t puts \"\"\n\t puts \"Group \" + group_number.to_s + \": \"\n\t group_counter += 1 if randomArray[group_counter].length > 0\n\t group_number += 1\n\t person_counter = 0 #resetting value for array\n\t person_number = 1 #resetting value for output numbering\n\t puts \"\"\n\t \n\t while person_counter < randomArray[group_counter].length\n\t puts \"Person \" + person_number.to_s + \": \" + randomArray[group_counter][person_counter]\n\t person_counter += 1\n\t person_number += 1\n\t end\n\t end\n\tend\n\t \n\t\tputs \" \"\n\t\tputs \"DRIVER TESTS\"\n\t\tputs \" \"\n\t puts \"1. Are there 3 units overall? \" + \"There are \" + (unit_number-1).to_s + \" units.\"\n\t puts \"2. Are there 6 groups per unit for the NY cohort?\" \" There are \" + randomArray.length.to_s + \" groups per unit for the NY cohort.\"\n\t puts \"3. Is the largest number of people in any one group 4?\" \" The largest number of people in any one group is \" + randomArray[0].length.to_s + \".\"\n\t \n \n\t end", "title": "" }, { "docid": "77cf212811448d4ccf59c731b78f5836", "score": "0.6975735", "text": "def print_group(groups)\n groups.each do |name, group|\n puts name + \" => \" + group\n end\nend", "title": "" }, { "docid": "92e3fd209f1ebd7ef05922dcf4685f43", "score": "0.6933874", "text": "def acct_groups(names)\n if names.length > 5\n group = []\n group = names.each_slice(5).to_a\n p group\n end\nend", "title": "" }, { "docid": "c395d99e2616fe24b390e69775d21973", "score": "0.69120723", "text": "def create_group(names_array)\n\tgroupSize = names_array.length\n\tremainder = groupSize % 4\n\t\n\tfor i in 1..3\tdo #repeat shuffle and grouping for three units\n\t\tj = 1 #group number counter\n\t\ttempArray = names_array.shuffle #assign names_array to temp so the original array is not altered\n\t\tputs \"<<<Unit \" + i.to_s + \" Groups>>>\" \n\t\t\twhile tempArray.length > 0 \n\t\t\t\tputs \"Group \" + j.to_s + \": \" + \"\\n\"\n\t\t\t\tj = j + 1\n\t\t\t \tputs tempArray.pop(4)\n\t\t\t\t\t\n\t\t\t\t\tif tempArray.length == remainder #if the remaining length in temp is the same as the remainder length, then put the remaining members into the last group in the unit.\n\t\t\t\t\t\tputs tempArray.pop(remainder)\n\t\t\t\t\tend #end if\n\t\t\t\tputs \"----------------\" #adds more visual separation between groups and units\n \t\tend\t# end while\n\t\ttempArray = names_array.shuffle #reassign temp to names_array so that next unit groups can be output\n end #end for\n return names_array #returns original array to see if it has been altered\nend", "title": "" }, { "docid": "5379f7f735c9e5b16771b82ecdd6a6f4", "score": "0.6858954", "text": "def group_maker(name_array)\n\tnames = name_array \n\tnames.sort_by {rand} \n\tgroup_size = names.count \n\tif group_size % 5 == 0 || group_size % 5 >= 3 \n\t\tnames.each_slice(5) {|slice| p slice} \n\telsif group_size % 4 == 0 || group_size % 4 >= 3 \n\t\tnames.each_slice(4) {|slice| p slice} \n\telse group_size % 4 == 0 || group_size % 4 >= 3\t\n\t\tnames.each_slice(4) {|slice| p slice}\n\t\t p \"split up this last group and assign them to others\" \n\t\t \n\tend\nend", "title": "" }, { "docid": "ba041e822c57610c24ce7578ff1c2ec2", "score": "0.684536", "text": "def group_maker(students)\n p \"More people, please!\" if students.length < 3\n if students.length % 4 == 0\n groups = students.each_slice(4).to_a\n elsif students.length % 5 == 0\n groups = students.each_slice(5).to_a\n elsif students.length % 3 == 0\n groups = students.each_slice(3).to_a\n else groups = students.each_slice(3).to_a\n end\n leftover = groups.last.length\n if leftover == 1\n popped = groups.pop[0]\n groups.last << popped\n elsif leftover == 2\n remainder = groups.pop(2)\n groups.last << remainder.flatten!\n end\n groups\nend", "title": "" }, { "docid": "3b39fc90d51566fff38f5e453364ecf3", "score": "0.6803007", "text": "def make_groups(name_array)\n if name_array.length % 5 != 0\n num_of_groups = (name_array.length / 5) + 1\n else\n num_of_groups = name_array.length / 5\n end\n accountability_groups = Hash.new\n num_of_groups.times do |x|\n accountability_groups [\"Accountability_Group_#{x + 1}\".to_sym] = []\n end\n while name_array.length > 0\n accountability_groups.keys.each do |x|\n accountability_groups[x] << name_array.pop\n if name_array.length == 0\n break\n end\n end\n end\n accountability_groups.keys.each do |x|\n puts \"START\"\n puts x\n puts accountability_groups[x]\n puts \"END\"\n puts \" \"\n end\nend", "title": "" }, { "docid": "4560f95a0f8b8412026fceb66aff584b", "score": "0.67883825", "text": "def accountability_groups(names) \n\tnames_of_cohort_mates = names.shuffle\n\tprint names_of_cohort_mates.each_slice( 4 ) {|group| p group}\nend", "title": "" }, { "docid": "0473212d2e8a68366c87ca2eb135d60e", "score": "0.6766668", "text": "def group_students(array_of_names)\n grouped_array = array_of_names.each_slice(5).to_a\n return grouped_array\nend", "title": "" }, { "docid": "0c16b1cc3d4e93b0af92c53a0f01b6da", "score": "0.6756347", "text": "def display_cohort(array)\n array.each do |cohort, students|\n puts \"#{cohort}: #{students}\"\n end\nend", "title": "" }, { "docid": "d8ecda40d39552c1a742a42749f953e9", "score": "0.6729636", "text": "def accountability_groups(string)\n names_array = string.split(\",\").shuffle\n group_members = 0\n last_member = []\n\n if names_array.length % 5 == 0\n group_members = 5\n elsif names_array.length % 4 == 0\n group_members = 4\n elsif names_array.length % 3 == 0\n group_members = 3\n else\n group_members = 3\n last_member << names_array[-1]\n names_array.delete_at(-1)\n end\n\n num_of_groups = names_array.length / group_members\n\n groups = []\n counter = 0\n while counter < num_of_groups\n groups << names_array[0, group_members]\n names_array = names_array.drop(group_members)\n counter += 1\n end\n if last_member.empty?\n else\n groups[0].concat(last_member)\n end\n\n group_counter = 1\n\n groups.each do |group|\n puts \" #{group.join(\",\")} is in group #{group_counter}.\"\n group_counter += 1\n end\n\n\nend", "title": "" }, { "docid": "2d81dc67282e489875fcad29aee346a4", "score": "0.6722065", "text": "def print_students_list(names)\n names_group = names.group_by { |x| x[:cohort] }\n names_group.each do |cohort, names|\n puts \"\"\n puts \"#{cohort.capitalize}:\".center(10)\n names.each_with_index{ |x, index| puts \"#{index + 1}: #{x[:name].capitalize} \".center(100) }\n end\nend", "title": "" }, { "docid": "94b036cc5e02c21c2aebe43c9f8d5c24", "score": "0.6708788", "text": "def arr_to_groups(num)\n arr=%(\"Kim Allen\"\n\"Jenna Andersen\"\n\"Pamela Antonow\"\n\"Jupiter Baudot\"\n\"Ovi Calvo\"\n\"Awilda Cantres\"\n\"Celeste Carter\"\n\"Mike Cerrone\"\n\"Eunice Choi\"\n\"Un Choi\"\n\"Kristie Chow\"\n\"Regina Compton\"\n\"Marcus Davis\"\n\"Paul Etscheit\"\n\"Solomon Fernandez\"\n\"Marcel Galang\"\n\"Aurelio Garcia\"\n\"Hector Jair Moreno Gomez\"\n\"Ricky Binhai Hu\"\n\"Kai Huang\"\n\"Alex Jamar\"\n\"Harmin Jeong\"\n\"Lauren Jin\"\n\"CJ Joulain\"\n\"Michael Landon\"\n\"Richard Leo\"\n\"Julian Lesse\"\n\"Ryan Lesson\"\n\"Ian Lockwood\"\n\"Alison Lyons\"\n\"Christopher Mark\"\n\"Lauren Markzon\"\n\"Miguel Angel Melendez\"\n\"David O'Keefe\"\n\"Nathan Park\"\n\"Landey Patton\"\n\"Farman Pirzada\"\n\"Samuel Frederick Purcell\"\n\"Salim Rahimi\"\n\"Colin Razevich\"\n\"Irina Renteria\"\n\"Jamie Runyan\"\n\"Eric Shou\"\n\"Michael Silberstein\"\n\"Rosslyn Sinclair-Chin\"\n\"Aji Slater\"\n\"Marvy Tagala\"\n\"George Warnbold\"\n\"Shawn Watson\"\n\"Hana Worku\"\n\"Nicholas Yee\").split(/\"\\n\"/)\n\n arr.each_slice(num) { |a| p a}\nend", "title": "" }, { "docid": "76f42099dd21a4c07883d34abbd983cf", "score": "0.6690593", "text": "def print_groups(groups)\n counter = 1\n groups.each do |group|\n p \"Group#{counter.to_s}: #{group.join(\", \")}\"\n counter = counter.to_i + 1\n end\nend", "title": "" }, { "docid": "11922386dcaa422d7aa0a33abed57a64", "score": "0.6683746", "text": "def acct_groups(people_array)\n\n mixed_list = people_array.shuffle\n\n if mixed_list < 3\n p \"You need more people.\"\n elsif mixed_list == 3\n p mixed_list\n elsif mixed_list.count == 6\n 2.times {p mixed_list.slice!(0,3).to_a}\n elsif mixed_list == 7\n p mixed_list.slice!(0,3).to_a\n p mixed_list\n else\n\n num_of_groups = mixed_list.count / 4\n\n num_of_groups_of_5 = mixed_list.count % 4\n\n num_of_groups_of_4 = num_of_groups - num_of_groups_of_5\n\n p \"You need #{num_of_groups} groups.\"\n p \"You need #{num_of_groups_of_5} groups of 5, and #{num_of_groups_of_4} groups of 4.\"\n\n num_of_groups_of_5.times {p mixed_list.slice!(0,5).to_a}\n\n num_of_groups_of_4.times {p mixed_list.slice!(0,4).to_a}\n\n end\nend", "title": "" }, { "docid": "61c7cc22a6cc1cbc91c64d6cf29c08c5", "score": "0.6658232", "text": "def groups(array)\n if (array.length%5) > 3\n array.each_slice(5) {|slice| p \"Groups #{slice}\"}\n else\n i = 5\n array.each_slice(4) {|slice| p slice}\n end\nend", "title": "" }, { "docid": "685f520a4caebdd2ea51c55999adafa7", "score": "0.6649744", "text": "def pretty_print(groups)\n i = 0 \n # O(n)\n until i >= groups.length\n puts \" \"\n puts \"Group #{i+1}:\"\n # O(n)\n groups[i].each do |student|\n puts \"#{student}\"\n end\n i += 1\n end\nend", "title": "" }, { "docid": "e4a20522b51072b7ee0073c0147b6b36", "score": "0.662503", "text": "def assign_groups(list)\n final_list = []\n list = list.sample(list.length)\n leftover = 5 - list.length % 5\n # Makes the number of 4 person groups based on divisibility by 5\n if leftover != 5\n for num in 0...leftover\n final_list << list.shift(4)\n end\n end\n # Makes 5 person groups until collection is empty\n while list.length > 0\n final_list << list.shift(5)\n end\n # Display finalized groups\n return_string =\"Chorus Frogs 2016 Accountability Groups\\n\\n\"\n for num in 0...final_list.length\n return_string += \"Group #{num + 1} is #{final_list[num][0]}, #{final_list[num][1]}, #{final_list[num][2]}\"\n if final_list[0][4] != nil\n return_string += \", #{final_list[num][3]}, and #{final_list[num][4]}.\\n\"\n else\n return_string += \", and #{final_list[num][3]}.\\n\"\n end\n end\n puts return_string\nend", "title": "" }, { "docid": "55bc574cbb3a15fec495d9940038607f", "score": "0.65882367", "text": "def accountability_groups(seaLions)\n new_groups = seaLions.each_slice(5).to_a\n new_groups.each_with_index do |name,index|\n puts \"#{name.join(\",\")} => are group: #{index}\"\n end\nend", "title": "" }, { "docid": "a9de1fb7f0acb5212dfd299a5c5162ba", "score": "0.6585465", "text": "def grouperDraft1(arrayOfNames, minPerGroup, desiredPerGroup)\n numOfPeople = arrayOfNames.length\n indexNumsOfUnselectedNames = [*0..(numOfPeople - 1)]\n arrayShuffle = arrayOfNames.shuffle\n # Lets do some math to figure out how many groups we will want\n minNumOfGroups = numOfPeople/desiredPerGroup\n leftOver = numOfPeople%desiredPerGroup\n if leftOver == 0\n totalGroups = minNumOfGroups\n # left over is less than min group which means we will have to cut into the full groups\n # elsif\n # howManyToCover = minPerGroup - leftOver\n elsif leftOver > minPerGroup\n totalGroups = minNumOfGroups + 1\n else\n totalGroups = minNumOfGroups + 1\n end\n # groupArray = [[nil]*desiredPerGroup]*totalGroups\n groupHash = Hash.new {|h,k| h[k]=[]}\n currentIndex = 0\n localIndex = 0\n groupNums = 1\n for x in 0..(indexNumsOfUnselectedNames.length - 1)\n if x%desiredPerGroup != 0\n# puts ' if ' + localIndex.to_s + ' group: ' + groupNums.to_s\n groupHash[groupNums] << arrayShuffle[currentIndex]\n # p groupArray[groupNums]\n currentIndex = currentIndex + 1\n localIndex = localIndex + 1\n if localIndex == desiredPerGroup\n localIndex = 0\n groupNums = groupNums + 1\n end\n else\n# puts ' else ' + localIndex.to_s + ' group: ' + groupNums.to_s\n groupHash[groupNums] << arrayShuffle[currentIndex]\n # p groupArray[groupNums]\n currentIndex = currentIndex + 1\n localIndex = localIndex + 1\n end\n # p groupHash\n end\n# for xx in 0..(groupArray.length - 1)\n# puts 'group ' + (xx + 1).to_s + ': ' + groupArray[xx].to_s\n# end\np groupHash\nend", "title": "" }, { "docid": "3243584173cbcdd9e3e60c3e82737b04", "score": "0.65744954", "text": "def build_groups(num_of_groups, student_roster, divisor)\n group_array = []\n for i in 0..num_of_groups - 1\n \tindex = i\n \tgroup_max = 1\n \tname_array = []\n \twhile index < student_roster.length\n name_array.push(student_roster[index])\n index += divisor\n group_max += 1\n if group_max > divisor\n \tbreak\n end\n end\n group_array[i] = name_array\n end\n group_array\nend", "title": "" }, { "docid": "9f091ec8231327df7d4efad7a152c35f", "score": "0.65698314", "text": "def acct_groups(names)\n\tnew_groups = []\n\n\tif names.length % 3 == 0\n\t\tnew_groups = names.shuffle.each_slice(3) do|array|\n\t\tp array\n\tend\n\telsif names.length % 4 == 0\n\t\tnew_groups = names.shuffle.each_slice(4) do|array| \t\n\t\tp array\n\tend\n\telse names.length % 5 == 0\n\t\tnew_groups = names.shuffle.each_slice(5) do|array| \t\n\t\tp array\n\tend\n end\nend", "title": "" }, { "docid": "890c5e979e9b4c72c5932371fee6e9af", "score": "0.6551822", "text": "def grouper(names_list)\n\tgrp = Random.new\n\toutput_array = []\n\t\n\t iterate = Proc.new do |max|\n\t\twhile output_array.length < max do\n\t\t\ti = grp.rand(0...names_list.length)\n\t\t\toutput_array << names_list[i]\n\t\t\tnames_list.delete_at(i)\n\t\tend\n\t\tp output_array\n\t\toutput_array = []\n\tend\n\n\tif names_list.length % 5 == 0\n\t\t#groups of 5\n\t\twhile names_list.length > 0 do\n\t\t\titerate.call 5\n\t\tend\n\telsif names_list.length % 5 == 1\n\t\t# groups of 5 and two groups of 3\n\t\tuntil names_list.length <= 6 do\n\t\t\titerate.call 5\n\t\tend\n\t\twhile names_list.length > 0 && names_list.length <=6\n\t\t\titerate.call 3\n\t\tend\n\telsif names_list.length % 5 == 2\n\t\t# grouops of 5 and one of 4, one of 3\n\t\tuntil names_list.length <= 7 do\n\t\t\titerate.call 5\n\t\tend\n\t\twhile names_list.length > 3 && names_list.length <=7\n\t\t\titerate.call 4\n\t\tend\n\t\tp names_list\n\telsif names_list.length % 5 == 3\n\t\t# groups of 5 and one group of 3\n\t\tuntil names_list.length <= 3 do\n\t\t\titerate.call 5\n\t\tend\n\t\twhile names_list.length > 0 && names_list.length <=3\n\t\t\titerate.call 3\n\t\tend\n\telsif names_list.length % 5 == 4\n\t\t# groups of 5 and one group of 4\n\t\tuntil names_list.length <= 4 do\n\t\t\titerate.call 5\n\t\tend\n\t\twhile names_list.length > 0 && names_list.length <=4\n\t\t\titerate.call 4\n\t\tend\n\tend\nend", "title": "" }, { "docid": "76e5f104bfadf38c11c3b586c13cf5e6", "score": "0.6530108", "text": "def print_groups_to_file(names, len, output)\n file = File.open(output,\"w\") # This will save the file that we will write to\n string = \"\" # This var will hold all names and then it will be written to var file\n arr = names # Still prefer arr before names\n i = 0 # index var\n size = arr.length - 1 # Maximum length of arr\n count = len # count will be the addition to len # len is the groups size\n string += \"Group 1\\n\\n\"\n group_counter = 2\n\n while i < size +1 # will loop the whole arr\n\n string += arr[i] # adds a name to string\n string += \"\\n\" # makes room for next name\n system(\"cls\")\n if i == len -1 # checks if have added the right amount of names in a row to string, if so. make room for the next group\n string += \"\\nGroup #{group_counter}\"\n string += \"\\n\\n\" # Makes room\n len += count # add len + count\n group_counter += 1\n end\n\n i += 1 #looooop\n end\n\n file.write(string) # overwrite string to output file\n file.close # CLOSING THE FILE!!! bye bye\n\nend", "title": "" }, { "docid": "cf535b10cde76cda2c69d0dcbf9c0dee", "score": "0.65130836", "text": "def make_groups(name_array)\n groups = Hash.new\n total = name_array.length\n total_counter = 0\n group_num = 1\n group_counter = 0\n group_size = 0\n name = \"\"\n\n if total % 5 == 0\n group_size = 5\n elsif total % 4 == 0\n group_size = 4\n elsif total % 3 == 0\n group_size = 3\n else\n group_size = 3\n end\n\n until total_counter == total\n if group_counter < group_size\n name = name_array.sample(1)\n if groups.key?(name) == false\n groups[name] = group_num\n total_counter += 1\n group_counter += 1\n end\n else\n group_num += 1\n group_counter = 0\n end\n end\n\n sorted = groups.sort_by { |k, v| v }\n sorted.each { |name, group| puts \"Group #{group}: #{name}\" }\nend", "title": "" }, { "docid": "ad43586732fccc6e12e1f9d7527717a3", "score": "0.65105253", "text": "def acct_groups(list_of_names)\n if list_of_names.length <= 5\n return list_of_names\n end\n\n groups = Hash.new\n if list_of_names.length % 5 == 0\n num_of_groups = list_of_names.length/5\n else num_of_groups = (list_of_names.length/5) + 1\n end\n\n group_counter = 1\n until group_counter > num_of_groups\n member_counter = 0\n group_list = Array.new\n until member_counter == 5\n if list_of_names[0] != nil\n group_list[member_counter] = list_of_names[0]\n list_of_names.delete_at(0)\n end\n member_counter += 1\n end\n groups[group_counter] = group_list\n group_counter += 1\n end\n\n if groups[num_of_groups].length < 3\n losing_members = groups[num_of_groups - 1]\n gaining_members = groups[num_of_groups]\n gaining_members.push(losing_members[0])\n gaining_members.push(losing_members[1])\n losing_members.delete_at(0)\n losing_members.delete_at(0)\n end\n\n p groups\nend", "title": "" }, { "docid": "f79e9a66f22c7118c87a93fc8bccce43", "score": "0.6479339", "text": "def group (students)\n \n if (students.length)%5 >= 1\n groups = students.length / 5 + 1\n else \n groups = students.length / 5 \n end\n \n students.shuffle!\n \n puts \" There are #{groups} groups\"\n \n acc_groups = Array.new(groups) {|e| e = []}\n \n \n while !students.empty?\n \n for i in 0...groups\n \n student = students.pop\n \n if student != nil\n \n acc_groups[i].push(student)\n \n end\n \n end\n \n end\n\n \n return acc_groups\nend", "title": "" }, { "docid": "3cdc3a7406086787055203779a60ecce", "score": "0.63999534", "text": "def student_grouping(array)\n grouped_by_cohort = {}\n array.each do |student|\n cohort = student[:cohort]\n if grouped_by_cohort[cohort] == nil\n grouped_by_cohort[cohort] = []\n end\n grouped_by_cohort[cohort].push(student[:name])\n end\n grouped_by_cohort.each do |key, value|\n s_key = key.to_s\n s_key.capitalize!\n puts \"----------------------\"\n puts \"#{s_key} cohort\".center(20)\n puts \"----------------------\"\n value.each do |name|\n puts name.center(20)\n end\n end\nend", "title": "" }, { "docid": "cb698220abb42f39b5667adf355a0af5", "score": "0.6394352", "text": "def get_group_names(num_of_groups)\n g_names = []\n for i in 1..num_of_groups\n g_names.push(\"Group #{i}\")\n end\n g_names\nend", "title": "" }, { "docid": "ea937abd9db35eb83479a61109b1096f", "score": "0.63843405", "text": "def get_conhort_groups(names_array)\n\t#Creates groups, this could be another funtion itself.\n\tnumber_of_groups = names_array.size/4\n\tgroups_hash = Hash.new\n\ti = 1\n\twhile(i <= number_of_groups)\n\t\tgroups_hash[\"group #{i}\"] = []\n\t\ti += 1\n\tend\n\t#Assigns members to created groups, could be stand alone function.\n\tj = 1\n\tnames_array.each do |cohort_member|\n\t\tj = 1 if j > number_of_groups\n\t\tgroups_hash[\"group #{j}\"] << cohort_member\n\t\tj += 1\n\tend\n\tgroups_hash\nend", "title": "" }, { "docid": "feabc82d16fb7b63873f7f3f83c47b63", "score": "0.6379492", "text": "def acct_groups(*names)\n\n big_list = names.each {|x| x.split(',') }\n groups = []\n remainder = []\n\n big_list.shuffle.each_slice(5) {|slice|\n if slice.length >= 3\n groups << slice\n else\n remainder << slice\n if remainder.length == 1\n remainder.push(groups[0][0]).push(groups[0][1])\n groups[0].shift(2)\n groups << remainder.flatten\n else\n remainder.push(groups[0][0])\n groups[0].shift(1)\n groups << remainder.flatten\n end\n end}\n\n i = 1\n while i <= groups.length\n puts \"Group #{i}: #{groups[i-1]}\"\n i+=1\n end\nend", "title": "" }, { "docid": "64268e2ed63e78ed7518eddcfb67d7b5", "score": "0.6376584", "text": "def acct_groups(list_of_names)\n list_of_names.each_slice(5) do |slice| \n p slice\n end\nend", "title": "" }, { "docid": "50bcf8e1673e21dcb930c6c0fdbda7db", "score": "0.63668287", "text": "def a_g_c(array)\n l = array.length - 1\n\n group_1 = []\n group_2 = []\n group_3 = []\n group_4 = []\n group_5 = []\n group_6 = []\n\n for num in 0..l\n if num >=0 && num <=3\n group_1.push(array[num])\n elsif num > 3 && num <= 7\n group_2.push(array[num])\n elsif num > 7 && num <= 11\n group_3.push(array[num])\n elsif num > 11 && num <= 15\n group_4.push(array[num])\n elsif num > 15 && num <= 19\n group_5.push(array[num])\n elsif num > 19 && num <= 23\n group_6.push(array[num])\n end\n end \n puts\n puts\n puts \"Group 1\"\n print group_1\n puts\n puts\n puts \"Group 2\"\n print group_2\n puts\n puts\n puts \"Group 3\"\n print group_3\n puts\n puts\n puts \"Group 4\"\n print group_4\n puts\n puts \n puts \"Group 5\"\n print group_5\n puts\n puts\n puts \"Group 6\"\n print group_6\n puts\n puts\nend", "title": "" }, { "docid": "25e585a78ce91905f1156f82a6453f4b", "score": "0.63553286", "text": "def make_groups\n\tnumber_of_groups = ($cohort.size-1) / $ag_cap + 1\n\t$roster = Array.new(number_of_groups) {Array.new()} \n\twhile $cohort.size > 0\n\t\t$roster.map! {|team| team << $cohort.pop}\n\tend\nend", "title": "" }, { "docid": "ba886dad8689c949db65ef2fe110772a", "score": "0.63434637", "text": "def acct_groups(array)\n array.shuffle!\n group1 = array[0..3].join(', ')\n puts \"Group 1: #{group1}\"\n\n group2 = array[4..7].join(', ')\n puts \"Group 2: #{group2}\"\n\n group3 = array[8..11].join(', ')\n puts \"Group 3: #{group3}\"\n\n group4 = array[12..15].join(', ')\n puts \"Group 4: #{group4}\"\n\n group5 = array[16..19].join(', ')\n puts \"Group 5: #{group5}\"\n\n group6 = array[20..23].join(', ')\n puts \"Group 6: #{group6}\"\n\n group7 = array[24..27].join(', ')\n puts \"Group 7: #{group7}\"\n\n group8 = array[28..31].join(', ')\n puts \"Group 8: #{group8}\"\n\n group9 = array[32..35].join(', ')\n puts \"Group 9: #{group9}\"\n\n group10 = array[36..39].join(', ')\n puts \"Group 10: #{group10}\"\n\n group11 = array[40..43].join(', ')\n puts \"Group 11: #{group11}\"\n\n group12 = array[44..47].join(', ')\n puts \"Group 12: #{group12}\"\n\n group13 = array[50..53].join(', ')\n puts \"Group 13: #{group13}\"\n\n group14 = array[54..57].join(', ')\n puts \"Group 14: #{group14}\"\nend", "title": "" }, { "docid": "69538d9fc62af919d95380f9ee1fdd3e", "score": "0.6289802", "text": "def acct_groups(array)\n array.each_slice(4) do |a, b, c, d|\n p [a, b, c, d]\n end\nend", "title": "" }, { "docid": "7cea06acf5ccf284cb6b9b3a7c3fea67", "score": "0.62653035", "text": "def acct_group (roster_array)\n\n ran_arr = roster_array.shuffle\n for i in 3..5\n if ran_arr.size % i == 0\n ran_arr.each_slice(i) {|x| p x}\n end\n end\nend", "title": "" }, { "docid": "1c27141fb5eb1471168f5a45cc339b7e", "score": "0.62635446", "text": "def make_groups(people)\n\n if people.length > 5\n new_lists = []\n new_lists = people.shuffle # using << wouldn't work here; it didn't slice/split up people at all\n p new_lists.each_slice(5).to_a\n else\n p people\n end\n\nend", "title": "" }, { "docid": "fa1b9770c0c56291e5fa1cb8c8a99794", "score": "0.6258621", "text": "def create_groups(arr)\n\tgroup = []\n\tunit_1 = arr.each_slice(4).to_a { |x| group.push(x) }\n\tunit_2 = arr.shuffle.each_slice(4).to_a { |x| group.push(x) }\n\tunit_3 = arr.shuffle.each_slice(4).to_a { |x| group.push(x) }\n\t\n\tresult = []\n\tresult = result.push(unit_1) \n\tresult = result.push(unit_2)\n\tresult = result.push(unit_3)\n\n\tputs \"Accountability groups - unit_1: #{unit_1.inspect}\"\n\tputs \"\"\n\tputs \"Accountability groups - unit_2: #{unit_2.inspect}\"\n\tputs \"\"\n\tputs \"Accountability groups - unit_3: #{unit_3.inspect}\"\n\n\treturn result\nend", "title": "" }, { "docid": "80d598e397731096618022815f2b9d9b", "score": "0.6250959", "text": "def create_groups(people)\r\n\tlist = people.shuffle\r\n\tlist = list.each_slice(5).to_a\r\n\r\n\tfor i in 0..1\r\n\t\tif(list[-1].length < 3)\r\n\t\t\tlist[-1].push(list[0].pop)\r\n\t\tend\r\n\tend\r\n\r\n\tlist.each {|i| puts \"Group #{list.index(i)+1}: #{i}\"}\r\nend", "title": "" }, { "docid": "9a0d4eac7085536cddcfb3441f1f2a97", "score": "0.6238337", "text": "def acct_group(name_list)\n # declare variables\n group_num = 1\n counter = 0\n people = name_list.length\n group = {}\n\n # find how many people can be split up min 3/group try for 4 or 5\n if(people % 4 == 0)\n group_of = 4\n elsif(people % 4 >= 3)\n group_of = 4\n elsif(people % 5 == 0)\n group_of = 5\n elsif(people % 5 >= 3)\n group_of = 5\n else\n group_of = 3\n end\n\n # loop through array and add names to hash. If counter = group number change group and reset counter\n name_list.shuffle.each do |element|\n if(counter == group_of)\n counter = 0\n group_num += 1\n end\n\n group[\"Group #{group_num}\"] == nil ? group.store(\"Group #{group_num}\", \"#{group[\"Group #{group_num}\"]}#{element}\") :\n group.store(\"Group #{group_num}\", \"#{group[\"Group #{group_num}\"]}, #{element}\")\n\n counter += 1\n end\n\n acct_group_print(group)\nend", "title": "" }, { "docid": "b1da8eb33a786ff908a4773b818953e0", "score": "0.6237705", "text": "def organize_schools(array)\n\nend", "title": "" }, { "docid": "b878c6bb34d974e20e541a6fec56f10b", "score": "0.623512", "text": "def acct_group(name_list)\n # declare variables\n group_num = 1\n counter = 0\n people = name_list.length\n group = {}\n\n # find how many people can be split up min 3/group try for 4 or 5\n if(people % 4 == 0)\n group_of = 4\n elsif((people % 4 != 0) && (people % 4 >= 3))\n group_of = 4\n elsif(people % 5 == 0)\n group_of = 5\n elsif((people % 5 != 0) && (people % 5 >= 3))\n group_of = 5\n else\n group_of = 3\n end\n\n # loop through array and add names to hash. If counter = group number change group and reset counter\n name_list.shuffle.each do |element|\n if(counter == group_of)\n counter = 0\n group_num += 1\n end\n group[\"Group #{group_num}\"] = group[\"Group #{group_num}\"] == nil ? \"#{group[\"Group #{group_num}\"]}#{element}\" :\n \"#{group[\"Group #{group_num}\"]}, #{element}\"\n counter += 1\n end\n\n acct_group_print(group)\nend", "title": "" }, { "docid": "c94ec445f55325299e10f6713ad0e0c4", "score": "0.62349796", "text": "def formGroups(array) \n randomArrayU1 = array.shuffle\n randomArrayU1 = randomArrayU1.each_slice(4).to_a\n\tunit1Data = Hash.new(0)\n\tunit1Data = randomArrayU1.each {|x| unit1Data[x] = 1}\n\ti = 1\n\tputs \"UNIT 1\"\n\twhile i < unit1Data.length\n\tputs \"Group \" + i.to_s + \" \" + unit1Data[i].to_s\n\ti += 1\n\tend\n randomArrayU2 = array.shuffle\n randomArrayU2 = randomArrayU2.each_slice(4).to_a\n\tunit2Data = Hash.new(0)\n\tunit2Data = randomArrayU2.each {|x| unit2Data[x] = 2}\n\tj = 1\n\tputs \"\"\n\tputs \"UNIT 2\"\n\twhile j < unit2Data.length\n\tputs \"Group \" + j.to_s + \" \" + unit2Data[j].to_s\n\tj += 1\n\tend\n\t\n\trandomArrayU3 = array.shuffle\n randomArrayU3 = randomArrayU3.each_slice(4).to_a\n\tunit3Data = Hash.new(0)\n\tunit3Data = randomArrayU3.each {|x| unit3Data[x] = 3}\n\tk = 1\n\tputs \"\"\n\tputs \"UNIT 3\"\n\twhile k < unit3Data.length\n\tputs \"Group \" + k.to_s + \" \" + unit3Data[k].to_s\n\tk += 1\n\tend\n \nend", "title": "" }, { "docid": "654ca0aeaba4e61d7301ea2fc49685e9", "score": "0.6224401", "text": "def a_g_c(array)\n l = array.length - 1\n\n group_1 = []\n group_2 = []\n group_3 = []\n group_4 = []\n group_5 = []\n group_6 = []\n group_7 = [] # Groups 2 & 3 both needed 7 groups\n\n for num in 0..l\n if num >=0 && num <=3\n group_1.push(array[num])\n elsif num > 3 && num <= 7\n group_2.push(array[num])\n elsif num > 7 && num <= 11\n group_3.push(array[num])\n elsif num > 11 && num <= 15\n group_4.push(array[num])\n elsif num > 15 && num <= 19\n group_5.push(array[num])\n elsif num > 19 && num <= 23\n group_6.push(array[num])\n elsif num > 23 && num <= l # Groups 2 & 3 both needed 7 groups\n group_7.push(array[num])\n end\n end \n puts\n puts\n puts \"Group 1\"\n print group_1\n puts\n puts\n puts \"Group 2\"\n print group_2\n puts\n puts\n puts \"Group 3\"\n print group_3\n puts\n puts\n puts \"Group 4\"\n print group_4\n puts\n puts \n puts \"Group 5\"\n print group_5\n puts\n puts\n puts \"Group 6\"\n print group_6\n puts\n puts\n puts \"Group 7\"\n print group_7\n puts\n puts\n \nend", "title": "" }, { "docid": "5028a0cbcf7cecc21ce4d21f7ea72d53", "score": "0.6216978", "text": "def acct_groups(arr)\n\tarr.shuffle!\n\ta = 5\n\tb = arr.length/a\n\tif (arr.length % 5) < 3 && (arr.length % 5) > 0\n\t\ta = 4\n\tend\n\tacct_groups = Array.new((b) + 1) {Array.new(0)}\n\ti = 0 \n\t#index of people to assign\n\tn = 0\n\t#index of group\n\twhile i < arr.length\n\t\tacct_groups[n] << arr[i]\n\t\ti += 1\n\t\tif acct_groups[n].length == a\n\t\t\tn += 1\n\t\tend\n\tend\n\tj = 1\n\tk = 0\n\twhile j < acct_groups.length + 1\n\tputs \"Accountability Group #{j}:\" \n\tputs acct_groups[k]\n\tj += 1\n\tk += 1\n\tend\nend", "title": "" }, { "docid": "c2d266f3ef2330023f366fbeaf53e65c", "score": "0.6204328", "text": "def print(students)\n the_string = \"\"\n theArray = []\n # if students.length > 0\n # students.each do |student|\n # theArray.push(\"#{student[:name]} (#{student[:cohort]} cohort) #{student[:hobbies]} #{student[:country_of_birth]}\")\n # # .center(25)\n # end\n # end\n counter = 0\n while counter < students.length\n the_string += \"#{students[counter][:name]} (#{students[counter][:cohort]} cohort) #{students[counter][:hobbies]} #{students[counter][:country_of_birth]} \\n\"\n # theArray.each do |student|\n # puts \"#{student[counter][:name]} (#{student[counter][:cohort]} cohort) #{student[counter][:hobbies]} #{student[counter][:country_of_birth]}\"\n # end\n # students.each do |student|\n # theArray.push(\"#{student[:name]} (#{student[:cohort]} cohort) #{student[:hobbies]} #{student[:country_of_birth]}\")\n # end\n counter += 1\n end\n the_string\n # theArray.sort!\n # end\nend", "title": "" }, { "docid": "d76bb9cc8426ee8fc6a444c1a044de4d", "score": "0.6203258", "text": "def acct_groups (array)\n array.shuffle!\n group_size = array.length\n if group_size <= 5\n p array\n elsif group_size % 5 == 0 || group_size % 5 >= 3\n p array.each_slice(5).to_a\n elsif group_size % 4 == 0 || group_size % 4 == 3\n p array.each_slice(4).to_a\n else\n p array.shift(3)\n p array.each_slice(5).to_a\n end\nend", "title": "" }, { "docid": "617f6b8b4506d99094bec60ce2bbd565", "score": "0.61825705", "text": "def acct_groups\n last_names = [\"Forger\", \"Nelson\", \"Ball\", \"Bovio\", \"Capio\", \"Chin\", \"Samuels\", \"Curran\", \"Louie\", \"Spivey\", \"Davis\", \"Mandelbaum\", \"Downey\", \"Fox\", \"Gahart\", \"Wong\", \"Glenn\", \"Golden\", \"Graf\", \"Hanson\", \"Hawley\", \"Helal\", \"Huang\", \"Schneider\", \"Dunleavy\", \"Phimmachack\", \"Khoo\", \"Kim\", \"Kim\", \"Klimek\", \"Knockeart\", \"Kozena\", \"Lang\", \"Larson\", \"Mackey\", \"Lonn\", \"Manett\", \"McKenzie\", \"Meyer\", \"Munch\", \"Nagle\", \"Nash\", \"Nikolovski\", \"Park\", \"Oliphant\", \"Lowe\", \"Reid\", \"Janken\", \"Rothschild\", \"Savariar\", \"Schlueter\", \"Claitor\", \"Sosland\", \"Stallings\", \"King\", \"Tenza\", \"Catakli\", \"Seller\", \"Turcza\", \"Ullman\", \"Vashist\", \"Dang\", \"Wong\", \"Yoder\", \"Zulli\"]\n\n \n puts last_names[0..3].to_s\n puts last_names[4..7].to_s\n puts last_names[8..11].to_s\n puts last_names[12..15].to_s\n puts last_names[16..19].to_s\n puts last_names[20..23].to_s\n puts last_names[24..27].to_s\n puts last_names[28..31].to_s\n puts last_names[32..35].to_s\n puts last_names[36..39].to_s\n puts last_names[40..43].to_s\n puts last_names[44..47].to_s\n puts last_names[48..51].to_s\n puts last_names[52..55].to_s\n puts last_names[56..60].to_s\n puts last_names[61..65].to_s\nend", "title": "" }, { "docid": "6f59052a79bcfae5db58ca86f091ec22", "score": "0.6177337", "text": "def make_groups(list_of_names)\n result = []\n num_people = list_of_names.length\n cur_group = []\n list_of_names.each do |name|\n cur_group.push(name)\n if cur_group.length == 4 || (cur_group.length == 3 && num_people == 3)\n result.push(cur_group)\n cur_group=[]\n end\n end\n # Right now the solution doesn't gracefully handle 6 people.\n # I should write a find_available function to find an open group to stick someone\n # in.\n if cur_group.length == 2\n name = cur_group.pop\n result[1].push(name)\n end\n if cur_group.length == 1\n name = cur_group.pop\n result[0].push(name)\n end\n return result\nend", "title": "" }, { "docid": "aea66513a3c10ae76f696a691961e6b2", "score": "0.61392903", "text": "def group(arr)\n\t\t1.upto(arr.length) { |grouplength|\n\t\t\tcombine(arr, grouplength) { |group|\n\t\t\t\tyield(group.join(''))\n\t\t\t}\n\t\t}\n\tend", "title": "" }, { "docid": "a1d3fd2d232e89983368a324ed03cecf", "score": "0.6128631", "text": "def print_students_list(*)\n count = 0\n while @students.length > count\n center_puts \"#{count+1}. #{@students[count][:name]} (#{@students[count][:cohort]} cohort)\"\n count += 1\n end\nend", "title": "" }, { "docid": "17237f3cd92bf8e936d62c0a2863482c", "score": "0.6112521", "text": "def printer(name_array)\n batch_badge_creator(name_array).each do |name|\n puts name\n end\n assign_rooms(name_array).each do |name|\n puts name\n end\nend", "title": "" }, { "docid": "77973049909eec742a829055e498945f", "score": "0.6110334", "text": "def print(names)\n i = 0\n if names == nil\n puts 'No students enrolled yet.'\n return\n end\n while i < names.length\n puts \"#{i+1}. #{names[i][:name]} (#{names[i][:cohort]} cohort)\".center(30)\n i += 1\n end \nend", "title": "" }, { "docid": "28b047fddf411cac24f7aee6daf0646d", "score": "0.6096916", "text": "def main # Arguments is first 3 ARGV inputs\n input = ARGV[0] # Names from a file\n group_size = ARGV[1].to_i # Size of the groups\n output = ARGV[2] # The file that the groups will be written to\n\n if ARGV[3]\n print \"\\nToo many argv input\\ncode will run anyway\\n\\n\"\n end # checks if your inputs to argv is more than 3\n\n begin\n begin\n begin\n students = read_students_from_file(input) # This will take all the data (names) from file input\n\n if group_size < 2 || group_size > students.length - 1\n group_size = 2\n end # Controls the ammount of groups\n\n random_students = randomize_student_order(students) # This will shuffel the list WITHOUT SHUFFEL WOW!!!\n print_groups_to_file(random_students, group_size, output) # overwrites a file with the groups\n\n rescue NoMethodError\n print \"\\nNoMethodError\\n\"\n exit\n end # Finds the nomethoderrors\n rescue TypeError\n print \"\\nType Error\\n\"\n exit\n end # finds the type errors\n rescue Errno::ENOENT\n print \"\\n Errno::ENOENT \\n\"\n exit\n end # finds all Errno::ENOENT errors\n\n\n return true # Returns true if code was completed\nend", "title": "" }, { "docid": "268346f986e720c2a6758241c0c05dd1", "score": "0.6095949", "text": "def acct_groups(people)\n\tif people.length <= 5\n\t\treturn people\n\telse people = people.shuffle.each_slice(4).to_a\n\t \tif people.last.length <= 2\n\t \t\tpeople[0]=people[0] << people.last[-1]\n\t \t\tpeople.last.pop[-1]\n\t \t\tif people.last.length == 1\n\t \t\t\tpeople[1]=people[1] << people.last[-1]\n\t \t\t\tpeople.pop\n\t \t\tend\n\t\tend\n\tend\n\tp people\nend", "title": "" }, { "docid": "8f05b4da339fa7632d5287083dfab56f", "score": "0.60946554", "text": "def account_groups\n bobolinks = \"Nathan (Shunqian), Caroline, Kim, Jenna, Pamela, Jupiter, Laura, Ovi, Awilda, Celeste, Mike, Eunice, Un, Kristie, Regina, John, Katy, Marcus, Paul, Solomon, Marcel, Aurelio, Hector, Adell, James, Matt, Michael, Peter, Ricky, Kai, Alex, Harmin, Lauren (Jin), CJ, Michawl, Richard, Julian, Ryan, Ian, Alison, Christopher, Lauren (Markzon), Miguel, Lorena, Morgan, Neal, David, Nathan (Park), Landey, Farman, Sam, Armando, Celeen, Salim, Colin, Irina, Jamie, Gary, Lulia, Eric, Micahel, Rosslyn, Aji, Marvy, George, Shawn, Hana, Caitlyn, Nicholas\"\n full_array = bobolinks.split(\", \")\n sub_arrays = full_array.each_slice(5).to_a\n\n hash = {}\n\n hash[sub_arrays[0]] = 1\n hash[sub_arrays[1]] = 2\n hash[sub_arrays[2]] = 3\n hash[sub_arrays[3]] = 4\n hash[sub_arrays[4]] = 5\n hash[sub_arrays[5]] = 6\n hash[sub_arrays[6]] = 7\n hash[sub_arrays[7]] = 8\n hash[sub_arrays[8]] = 9\n hash[sub_arrays[9]] = 10\n hash[sub_arrays[10]] = 11\n hash[sub_arrays[11]] = 12\n hash[sub_arrays[12]] = 13\n hash[sub_arrays[13]] = 14\n\n p hash\n\n\nend", "title": "" }, { "docid": "4fa83f50efecf8e6b965b1cf423d0a19", "score": "0.6092169", "text": "def print_names_cohort(students)\n students.each do |student|\n \t# Showing only the student names starting with A\n \tif student[:name].length <= 12\n \tputs \"#{student[:name]}, #{student[:cohort]}\" \n end\n end\nend", "title": "" }, { "docid": "5df2a13bae92985e5d9da4b9e5e33533", "score": "0.60889655", "text": "def print_students (array) # prints and formats students data so it is readable\n\tprintf(\"%-15s%-15s%-30s%-8s%-30s%-30s%-30s%-30s\\n\", \"First Name\",\"Last Name\", \"Email\", \"Section\", \"Major\",\"Major (2nd)\", \"Minor\",\"Minor (2nd)\")\n\tarray.each do |student| # only select students by month\n\t\t# puts \"#{student[:first]} #{student[:last]} #{student[:email]} #{student[:section]} #{student[:major1]} #{student[:major2]} #{student[:minor2]} #{student[:minor2]} \"\n\t\tprintf(\"%-15s%-15s%-30s%-8s%-30s%-30s%-30s%-30s\\n\", \"#{student[:first]}\",\" #{student[:last]}\", \"#{student[:email]}\", \"#{student[:section]}\", \"#{student[:major1]}\",\"#{student[:major2]}\", \"#{student[:minor1]}\",\"#{student[:minor2]}\")\n\tend\nend", "title": "" }, { "docid": "e13e072cf395ad59370f4687aa86c54d", "score": "0.6085155", "text": "def print(students)\n i = 0\n while i < students.length do\n student = students[i]\n puts \"#{1}. #{student[:name]} (#{student[:cohort]} cohort, who's favourite hobby is #{student[:hobby]})\".center(50)\n i += 1\n end\nend", "title": "" }, { "docid": "9b36425e51339be74fb5094e48ffe1d5", "score": "0.6082486", "text": "def get_groups(array)\n\tmaster_array = []\n\t3.times do \n\t\tsplit_array = array.shuffle.each_slice(4).to_a\n\t\tif array.length % 4 != 0\n\t\tleftovers = split_array.pop\n\t\tend\n\t\tsplit_array[0].push(leftovers[0])\n\t\tsplit_array[1].push(leftovers[0]) unless leftovers.empty? == true\n\t\tsplit_array[2].push(leftovers[0]) unless leftovers.empty? == true\n\t\tmaster_array.push(split_array)\n\tend\n\tprint \"Unit 1 groups are \" + master_array[0].to_s\n\tputs \" \"\n\tprint \"Unit 2 groups are \" + master_array[1].to_s\n\tputs \" \"\n\tprint \"Unit 3 groups are \" + master_array[2].to_s\n\n\tmaster_array\nend", "title": "" }, { "docid": "07df2ff91841700e2fd60f8d7f334120", "score": "0.6059669", "text": "def group_greeting(*names)\n names.each { |name| puts \"Hello #{name}\" }\nend", "title": "" }, { "docid": "aec78778c768f0496ec2f51253a6a1ea", "score": "0.6053525", "text": "def display_cohort(group)\n\tgroup.each do |cohort, quan| \n\t\tputs \"#{cohort}: #{quan}\"\n\tend\nend", "title": "" }, { "docid": "f15c358da39679d023844d25d0277896", "score": "0.6049036", "text": "def display_cohorts(students)\n\tstudents.each {|x,y| puts \"#{x}: #{y} students\"}\n\nend", "title": "" }, { "docid": "ca034cea187f1875441c5485a1ff6ce3", "score": "0.60418165", "text": "def groups(*groups); end", "title": "" }, { "docid": "d13e0e27976f936d10f13b032eb6bb61", "score": "0.60403544", "text": "def create_group (population)\n\tpopulation.shuffle!\n\tgroups = population.each_slice(4).to_a\n\t#print groups\n\treturn groups\nend", "title": "" }, { "docid": "42171d49a46dfd130e89384751a312e2", "score": "0.60382766", "text": "def accountability_groups(list_of_names)\n num_names = list_of_names.length\n list_of_names.shuffle! if num_names > 1\n rmdr_by_4 = num_names % 4\n rmdr_by_5 = num_names % 5\n div_by_5 = num_names / 5\n\n if rmdr_by_5 == 0 || num_names < 5 || num_names == 9\n group_array = list_of_names.each_slice(5).to_a\n elsif rmdr_by_4 == 0 || num_names == 7 || num_names == 11\n group_array = list_of_names.each_slice(4).to_a\n elsif num_names == 6\n group_array = list_of_names.each_slice(3).to_a\n elsif num_names > 12\n group_array = list_of_names[0.. (4 * (5 - rmdr_by_5)-1)].each_slice(4).to_a + list_of_names[(4 * (5 - rmdr_by_5))..num_names-1].each_slice(5).to_a\n end\n return group_array.map.with_index {|x, i| ['Group ' + (i+1).to_s, x] }.to_h\nend", "title": "" }, { "docid": "3e49d037c95c71af45ef7ec2bfd9617b", "score": "0.60373676", "text": "def create_groups(names)\n \tgroups = [\"Accountability Group 1\",\"Accountability Group 2\",\"Accountability Group 3\",\"Accountability Group 4\",\n \t\t\"Accountability Group 5\",\"Accountability Group 6\",\"Accountability Group 7\",\"Accountability Group 8\",\"Accountability Group 9\",\n \t\"Accountability Group 10\",\"Accountability Group 11\",\"Accountability Group 12\", \"Accountability Group 13\"]\n \tlist_names = names.shuffle\n \tnames_and_group = Hash.new{|hash, group| hash[group] = []}\n \tgroups.each do |group| \n \t\tnames_and_group[group] = list_names.shift(5)\n \tend\n names_and_group\n \tnames_and_group.each do |group, names| \n \t\tputs \"#{group}:\"\n \t\tputs\n \t\tputs names\n \t\tputs\n \tend\n end", "title": "" }, { "docid": "9a34a98160924d8b641c9ec1c4865dca", "score": "0.6013839", "text": "def my_collect(array)\n empty =[]\nempty1 = []\n if block_given?\n i = 0\n while i < array.length\n yield (students[i])\n empty.push(students[i].split(\" \").first)\n i +=1\n end\n while i < array.length\n yield(langauges[i])\n empty.push(languages[i].upcase)\n i +=1\n end\n empty\n\n\n else\n puts \"Hey! No block was given!\"\n\n end\n end", "title": "" }, { "docid": "3bc207047bac5abe5a83ad6bdbdc97d8", "score": "0.5999003", "text": "def show_groups\n tmp=[]\n groups.each {|one_group| tmp << one_group.name}\n tmp\n end", "title": "" }, { "docid": "e43eadcd17a250f0eff52b840c77b40b", "score": "0.5989067", "text": "def acct_groups(names)\n small_groups = []\n big_groups = []\n\n names.each_slice(5) do |a|\n if a.length > 2\n big_groups << a\n else\n small_groups << a\n end\n end\n \n big_groups[big_groups.length-1].push(small_groups).flatten!\n p big_groups\nend", "title": "" }, { "docid": "df7cbfb06a0c9fdbc94fad9e0244c994", "score": "0.5986781", "text": "def group_by_cohort\n puts \"Enter a cohort\"\n cohort = gets.chomp\n group = @students.select{|name| name[:cohort].downcase == cohort.downcase.to_sym }\n count = 0\n group.each do |name|\n puts \"#{count+1} #{name[:name]} (#{name[:cohort]} cohort)\"\n count+=1\n end\n puts \"We found #{count} #{student_form(count)} from \\\"#{cohort}\\\" cohort\"\nend", "title": "" }, { "docid": "87a729f03bad90c24395682acf8c84f5", "score": "0.59709555", "text": "def accountability_group(cohort_array)\n output_array = cohort_array.shuffle.each_slice(4).to_a\n if output_array.last.length % 4 == 0 \n return output_array \n else \n extra_people = output_array.pop \n for i in 0...output_array.length \n output_array[i].push(extra_people[i])\n end\n return output_array\n end \nend", "title": "" }, { "docid": "26389bc9593be5ab3528115fbd64d87b", "score": "0.59660625", "text": "def names_assignment (names_array)\n puts \"You have %d names in the 'names' array\" % [names_array.length]\n names_array.each { |n| puts \"The name is \\'%s %s\\'\" % [n[:first_name], n[:last_name]]}\nend", "title": "" }, { "docid": "52228b2427a480dd643bb99b9ce1af54", "score": "0.59595466", "text": "def print(students)\n if students.count != 0 \n puts \"The students of Villains Academy\"\n puts \"-------------\"\n cohort_group = students.map{|student| student[:cohort]}.uniq\n cohort_group.each do |group|\n puts \"[The #{group} cohort]:\"\n puts students.map{|student| student[:name] if student[:cohort] == group }.compact\n puts \"\"\n end\n# finally print the student(s) count \n students.count > 1 ? s_or_p = \"students\" : s_or_p = \"student\"\n puts \"Overall, we have #{students.count} great #{s_or_p}\"\n else \n puts \"You haven't entered any student information!\"\n end\n end", "title": "" }, { "docid": "1693e196c6dc1cd2ed6ebe4774858908", "score": "0.59594935", "text": "def print_by_cohort(students)\n puts \"There is no student!\" if students.count == 0\n return\n print_header()\n students.group_by { |student| student[:cohort] }.each do |_, group|\n group.each { |student_in_grp| puts \"#{student_in_grp[:name].center(10)} (#{student_in_grp[:cohort].to_s.center(10)} cohort)\"}\n end\nend", "title": "" }, { "docid": "711c04ecfc1c22c3793c11e2831e4ff6", "score": "0.59338886", "text": "def group(peeps)\n groups = []\n peeps.each_slice(5) {|a| groups << a}\n groups[-2].pop\n until groups[-1].length >= 4\n volunteer = groups[-2].pop\n groups[-1] << volunteer\n end\n p groups\nend", "title": "" }, { "docid": "7969d8f386fcdd4f9e9855cab977b3a7", "score": "0.5932145", "text": "def print_name_begins_with(a_letter)\n puts \"Students whose names begin with #{a_letter}\".center(50)\n #if array is empty, print this sentence and return\n if @students.length == 0\n puts \"There's no student in the array.\".center(50)\n return\n end\n #array index starts from 0\n j = 0\n #iterator starts from 1\n i = 1\n begin\n if @students[j][:name].chars.first.downcase == a_letter.downcase\n puts \"#{i}.#{@students[j][:name]} (#{@students[j][:cohort]} cohort)\".center(50)\n i +=1\n end\n j += 1\n end while j< @students.length #while loops as long as the condition is true\n #if no name matched the condition\n if i < 2\n puts \"There's no student whose name beings with #{a_letter}\".center(50)\n end\nend", "title": "" }, { "docid": "d14049f74fbb7b445a9f564d0ca801e3", "score": "0.5931324", "text": "def group_greeting(*names)\n\tnames.each { |name| puts \"Hello #{name}\"}\nend", "title": "" }, { "docid": "1461df36755affd9cf01c2f361c89e3d", "score": "0.5922438", "text": "def group_names; end", "title": "" }, { "docid": "1461df36755affd9cf01c2f361c89e3d", "score": "0.5922438", "text": "def group_names; end", "title": "" }, { "docid": "cdf037d3110d126b92f4115a90a77ea4", "score": "0.5922175", "text": "def student_list(students)\n students.each do |cohort, student_number|\n puts \"#{cohort}: #{student_number} students\"\n end\nend", "title": "" }, { "docid": "dfdd9ac4a6ad037f2a219e5b5801b77f", "score": "0.59167767", "text": "def display_classmates_strings(array_of_strings)\n\t\n\tarray_of_strings.each do |x|\n\t\ttemp_array = Array.new\n\t\ttemp_array = x.split(\",\")\t\t\n\t\tname = temp_array[0]\n\t\tfood = temp_array[1]\n\t\tgithub = temp_array[2]\n\n\t\tputs \"#{name}'s favorite food is #{food}\"\n\tend\n\nend", "title": "" }, { "docid": "17f82a0fa3f383bd6bf80e16a52ccc07", "score": "0.5907121", "text": "def print_students_list\n return if @students.count == 0\n i = 0\n align_size = 20\n while i < @students.length\n stud = (@students[i][:name]).center(align_size)\n puts \"#{i + 1}. #{stud} (#{@students[i][:cohort]} cohort), from #{@students[i][:country]} \"\n i += 1\n end\nend", "title": "" }, { "docid": "8d03d67afd37a333929d1dc65e5579e1", "score": "0.5903942", "text": "def acct_groups(cohort)\n\tpeople = cohort.size\n\tcohort.shuffle\n\tif people % 5 == 0\n\t\tarray_num = (people / 5)\n\telse\n\t\tarray_num = (people / 5) + 1\n\tend\n\tnew_groups = Array.new(array_num) {Array.new}\n\tx = 0\n\ty = 0\n\twhile x < people\n\t\twhile y < array_num\n\t\t\tnew_groups[y] << cohort[x]\n\t\t\tx += 1\n\t\t\ty += 1\n\t\tend\n\t\ty = 0\n\tend\n\tp new_groups\nend", "title": "" }, { "docid": "4698242b7d8452e59c373dd66a8fb14c", "score": "0.58890945", "text": "def build_list\n students = input_students\n print_header\n # print(students)\n print_footer(students)\n print_student_by_cohort(students)\nend", "title": "" }, { "docid": "c3c1b26613d39366c56d2b6f7048e89d", "score": "0.5888547", "text": "def print_groups(cohort_hash)\n\tcohort_hash.each do |group, members|\n\t\tputs \"#{group.capitalize} : #{members}\"\n\tend\nend", "title": "" }, { "docid": "a9995b9bdd43aeb0e14b22bdda98976c", "score": "0.5883584", "text": "def print_student_list\n length = @students.length\n count = 0\n # While loop to loop through each student\n while count != length\n name = @students[count]\n # Call the print_student method\n print_student(count, name)\n count += 1\n end\nend", "title": "" }, { "docid": "94309164e2b1242f616c9fbdd81ce325", "score": "0.5872311", "text": "def acct_groups(people)\n length = people.length\n group_number = length/5\n extra = length%5\n randomized_list = people\n if extra > 0\n randomized_list.fill(\"\",length..(length+5-extra))\n group_number += 1\n end\n\n groups = Hash.new {|h,k| h[k]=[]}\n 5.times do |filler|\n group_number.times do |iterate|\n accountability_group =\"group \" + (iterate + 1).to_s\n if randomized_list[0] != \"\"\n groups[accountability_group] <<randomized_list[0]\n end\n randomized_list.shift\n end\n end\n p groups\nend", "title": "" }, { "docid": "9618931e05f03d60e510b8e2c0418b07", "score": "0.58702207", "text": "def groups\n groups = []\n groups.join(\",\")\n end", "title": "" }, { "docid": "973f22ccbdefb1707ae526f942247de8", "score": "0.58695155", "text": "def list_students\n\tputs \"\\nHere are the Students from my Cohort at Makers Academy\"\n\tputs \"========================================================\\n\"\n\t@students.each_with_index { |name,i| puts \"#{i+1} : #{name[:name]} (#{name[:cohort]} cohort)\"}\n\tputs \"\\n========================================\\n\"\n\tif @students.length <2\n\t\tputs \"we have #{@students.length} student in the cohort\"\n\telse\n\t\tputs \"we have #{@students.length} students in the cohort\"\n\tend\n\tputs \"\\n========================================\\n\"\nend", "title": "" }, { "docid": "2ad13f00c6b6f1de82a12d9d360ca7b9", "score": "0.58560437", "text": "def group\nstudents = (1..57).to_a\n students.each_slice(3).to_a\nend", "title": "" }, { "docid": "7cede28c32858dc19bedb1152814f0a4", "score": "0.5855529", "text": "def loop_body\n i = 0\n while i < @students.length\n #use your count function to count though the index numbers from 0\n #use index to pull name and cohort out of array\n array = @students[i] #gives {:name=>\"Olwen\", :cohort=>\"January\"}\n puts array\n i +=1\n end\nend", "title": "" }, { "docid": "7b0b8e04a4656a734493ca9c9f2db01c", "score": "0.58551735", "text": "def acct_groups\n\n hash = {}\n puts \"Who is in the class? Separate each person with a comma, but do not hit enter between people (eg. Aarthi Gurusami, Abid Ramay, Adam Zmudzinski)\"\n everyone = gets.chomp\n people = everyone.split(', ')\n puts \"There are a total of #{people.length} people in the class. About how many people do you want in each group?\"\n group_max = gets.chomp.to_i\n puts \"What is the minimum amount of people you want in each group?\"\n group_min = gets.chomp.to_i\n\n if (people.length % group_max) < group_min\n x = (people.length/group_max)\n else\n x = ((people.length)/(group_max))+ 1\n end\n\n loop do\n people.each do |y|\n hash[y] = rand(1..x)\n end\n ary = []\n (1..x).each do |i|\n ary << hash.values.count(i)\n end\n $new_ary = ary.sort\n break if $new_ary[0] > group_min && $new_ary[-1] < (group_max + 2)\n end\n puts \"There are #{$new_ary.length} groups and no more than #{$new_ary[-1]} people per group, and no less than #{$new_ary[0]} people per group.\"\n\n group_hash = {}\n\n (1..x).each do |i|\n group_ary = []\n hash.each do |k,v|\n if v == i\n group_ary << k\n end\n end\n group_hash[i] = group_ary\n group_string = group_ary.join(', ')\n p \"Group #{i} : #{group_string}\"\n end\nend", "title": "" }, { "docid": "783c601caf37b85e7029b2982145a0a9", "score": "0.58546853", "text": "def print_student_list\n i=0\n #we are now using a loop to print the name of each student\n while i<@students.count\n puts \"#{i+1}. #{@students[i][:name]} (#{@students[i][:cohort]} cohort). #{@students[i][:name]}\\'s main hobby is #{@students[i][:hobbies]}.\".center(100)\n i+=1\n end\n puts\nend", "title": "" }, { "docid": "a0241ad9375f619a900b3b3be23168a5", "score": "0.58545303", "text": "def print_student_list\n i=0\n while i < @students.length\n puts \"#{i+1}. #{@students[i][:name]} (#{@students[i][:cohort]} cohort)\".center(50)\n i+=1\n end\nend", "title": "" }, { "docid": "4410f7830d191a7ea016a5f472e0638c", "score": "0.58522904", "text": "def print(students)\n if !students.empty?\n students.each do |student|\n puts \"#{student[:name]}, (#{student[:cohort]} cohort)\".center(80)\n end\n end\nend", "title": "" }, { "docid": "e94a0a41b39bc422193304efb346b7b8", "score": "0.5851241", "text": "def print_name_shorter_than(num)\n puts \"Students whose names are shorter than #{num} characters\".center(50)\n #if array is empty, print this sentence and return\n if @students.length == 0\n puts \"There's no student in the array.\".center(50)\n return\n end\n #array index starts from 0\n j = 0\n #iterator starts from 1\n i = 1\n begin\n if @students[j][:name].length < num\n puts \"#{i}.#{@students[j][:name]}, #{@students[j][:name].length} (#{@students[j][:cohort]} cohort)\".center(50)\n i += 1\n end\n j +=1\n end until j > @students.length - 1 #until loops as long as the condition is false\n #if no name matched the condition\n if i < 2\n puts \"There's no student whose name is shorter than #{num}\".center(50)\n end\nend", "title": "" }, { "docid": "4d4b159d1a809cb48d884a53baecc7aa", "score": "0.5839049", "text": "def loop_for_print(arr, control)\n # empty bin with results form this definition to print at the end\n bin = []\n if control == nil\n bin << \"The students of Villains Academy\".center(40)\n bin << \"-------------\".center(40)\n i = 0\n while i != arr.size\n bin << \" #{i + 1}. #{arr[i][:name]}; #{arr[i][:cohort]} cohort\"\n i += 1\n end\n else\n bin << \"The students of Villains Academy with names starting with letter `#{control}`\".center(40)\n bin << \"-------------\".center(40)\n for i in 1..arr.size\n bin << \" #{i}. #{arr[i - 1][:name]}; #{arr[i - 1][:cohort]} cohort\" if arr[i - 1][:name][0] == control\n end\n end\n bin\nend", "title": "" } ]
da9cc7a00703e33172c579941aaeff52
PATCH/PUT /event_typologies/1 PATCH/PUT /event_typologies/1.json
[ { "docid": "ead2051867250caf9944711c5e0de8d4", "score": "0.69909203", "text": "def update\n respond_to do |format|\n if @event_typology.update(event_typology_params)\n format.html { redirect_to event_typologies_path, notice: 'La tipologia è stata modificata correttamente.' }\n format.json { render :show, status: :ok, location: @event_typology }\n else\n format.html { render :edit }\n format.json { render json: @event_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "6a3460143b9f0a7dab6772b390343355", "score": "0.60849434", "text": "def pupdate\n @event = Event.find(params[:id])\n respond_to do |format|\n if @event.update_attributes(JSON.parse(params[:event]))\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "53a691c801b0bb980c1594670775127e", "score": "0.60763305", "text": "def update\n respond_to do |format|\n if @ecosystem_typology.update(ecosystem_typology_params)\n format.html { redirect_to @ecosystem_typology, notice: 'Ecosystem typology was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ecosystem_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2060702447c70ec9d92766755bb3d1d", "score": "0.5987226", "text": "def update\n respond_to do |format|\n if @axis_event.update(axis_event_params)\n format.html { redirect_to @axis_event, notice: 'Axis event was successfully updated.' }\n format.json { render :show, status: :ok, location: @axis_event }\n else\n format.html { render :edit }\n format.json { render json: @axis_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98d47b6db474730d2d259931843541c5", "score": "0.59747124", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { head :no_content }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa5c4c35e9c98d780d54a0de68a032a7", "score": "0.59316033", "text": "def update\n @chronicle = Chronicle.find(params[:chronicle_id])\n @events = @chronicle.events.order(sort_column2 + \" \" + sort_direction2).paginate(:per_page =>10, :page => params[:page])\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @chronicle, notice: 'Event was successfully updated.' }\n format.js { render :show, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d14d1ca049055fddba49cf350c569704", "score": "0.5931261", "text": "def update\n @event = Event.find(params[:id])\n @event.tags.clear()\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c42284fffce44a7af5c91515b9f7b17a", "score": "0.5895018", "text": "def set_event_typology\n @event_typology = EventTypology.find(params[:id])\n end", "title": "" }, { "docid": "74f7f7d1f33860170fe9ebfacd2440e8", "score": "0.58614016", "text": "def update\n @event = Event.from_param(params[:event_id])\n @time_table = @event.time_tables.where(:permalink => params[:id]).first\n success = params[:time_table] && params[:time_table][:times] && \n @time_table.update_attributes(:times => JSON.parse(params[:time_table][:times]))\n success ? update_success : update_failure\n rescue JSON::ParserError\n update_failure\n end", "title": "" }, { "docid": "b0ec003285ff172e64cb1c800b421aab", "score": "0.58544695", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n @event.update(status: \"Pending\")\n else\n @reopen = true\n format.json { render json: @event.errors, status: :unprocessable_entity }\n format.html { render :show }\n end\n end\n end", "title": "" }, { "docid": "aab7da59746af5fb4c7bb4fa5684095a", "score": "0.5830665", "text": "def update\n\tif @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a1f0ea73da47ad2503783b1fd21d4575", "score": "0.5804059", "text": "def update\n respond_to do |format|\n if @event.update Fenix::Store::Converter::Flattener.event params[:event]\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\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": "e84aaf80f66a13f66e1b2ef338ec5b9e", "score": "0.58017087", "text": "def update\n @ticket = @event.tickets.find(params[:id])\n respond_to do |format|\n if @ticket.update(ticket_params)\n format.html { redirect_to event_ticket_path(@event.ticket), notice: 'Ticket was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ticket.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "12a790e896e52e26a1f39c1c97ebf16b", "score": "0.57849586", "text": "def update\n @event = Event.using(:shard_one).find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n\n\n\n end", "title": "" }, { "docid": "dea372a9817c2cf3e2280946619a4362", "score": "0.5770787", "text": "def update\n @event = Event.find(params[:id])\n \n if @event.eventable_type == \"Activity\" or @event.eventable_type == \"Hotel\" or @event.eventable_type == \"Foodanddrink\"\n \n @idea = Idea.find(@event.eventable_id)\n \n respond_to do |format|\n if @event.update_attributes(params[:event]) and @idea.update_attributes(params[:idea])\n format.html { redirect_to show_new_visitor_trip_path(:id => @trip, :view => params[:view]) } if new_visitor_created_trip? \n format.html { redirect_to trip_path(:id => @trip, :view => params[:view]) }\n format.js\n else\n flash[:error] = \"There seems to be an error updating the note.\"\n format.html { redirect_to trip_path(:id => @trip, :view => params[:view]) }\n end\n end\n elsif @event.eventable_type == \"Transportation\"\n @transportation = Transportation.find(@event.eventable_id)\n @event.title = CGI::escapeHTML(params[:transportation][:from]) + \" &rarr; \" + CGI::escapeHTML(params[:transportation][:to])\n \n respond_to do |format|\n if @transportation.update_attributes(params[:transportation]) and @event.update_attributes(params[:event])\n format.html { redirect_to show_new_visitor_trip_path(:id => @trip, :view => params[:view]) } if new_visitor_created_trip? \n format.html { redirect_to trip_path(:id => @trip, :view => params[:view]) }\n format.js\n else\n flash[:error] = \"There seems to be an error updating the transportation.\"\n format.html { redirect_to trip_path(:id => @trip, :view => params[:view]) }\n end\n end\n elsif @event.eventable_type == \"Notes\"\n @notes = Notes.find(@event.eventable_id)\n tmp_notes = Notes.new(params[:notes])\n @event = tmp_notes.create_notes(@event, @trip)\n \n respond_to do |format|\n if @event.update_attributes(params[:event]) and @notes.update_attributes(params[:notes])\n format.html { redirect_to show_new_visitor_trip_path(:id => @trip, :view => params[:view]) } if new_visitor_created_trip? \n format.html { redirect_to trip_path(:id => @trip, :view => params[:view]) }\n format.js\n else\n flash[:error] = \"There seems to be an error updating your note.\"\n format.html { redirect_to trip_path(:id => @trip, :view => params[:view]) }\n end\n end\n end\n end", "title": "" }, { "docid": "9f2eb6a5c26de856eade64094febcc06", "score": "0.57699275", "text": "def update\n respond_to do |format|\n if @ticket_event.update(ticket_event_params)\n format.html { redirect_to @ticket_event, notice: 'Ticket event was successfully updated.' }\n format.json { render :show, status: :ok, location: @ticket_event }\n else\n format.html { render :edit }\n format.json { render json: @ticket_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d95ee381a8e8f76f8d3ea23da4b3773", "score": "0.5769705", "text": "def patch_event\n user_id = params[\"user_id\"]\n group_id = params[\"group_id\"]\n event_id = params[\"event_id\"]\n\n #TODO Handle 404 if event not found\n event = Event.find(event_id)\n\n json_body = JSON.parse(request.body.read)\n\n @@event_service.patch_event(json_body, user_id, group_id, event_id)\n\n render status: :ok, text: \"\"\n end", "title": "" }, { "docid": "fe5155bd83aa1f79d972cc2455e31553", "score": "0.5767242", "text": "def update\n @myevent = Myevent.find(params[:id])\n\n respond_to do |format|\n if @myevent.update_attributes(params[:myevent])\n format.html { redirect_to @myevent, notice: 'Myevent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @myevent.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b090b539b9747e626e8f5f05f83d7d48", "score": "0.5762547", "text": "def update\n respond_to do |format|\n if @servico_evento.update(servico_evento_params)\n format.html { redirect_to @servico_evento, notice: 'Evento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_evento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3cdd6461850d72cefc11e234ddb476d8", "score": "0.57608354", "text": "def update\n # @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "573e8d55a40c8d3c0618a321a6d576c8", "score": "0.5760345", "text": "def update\n \n \n @event = Event.find(params[:id])\n\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: t(:event_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n \n end\n end", "title": "" }, { "docid": "e30ad7bf35bc5a7d0a53fab8dfa4d39f", "score": "0.57580537", "text": "def update\n respond_to do |format|\n begin\n if @event.update(update_event_params)\n format.html { redirect_to @event, notice: 'データが更新されました。' }\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 rescue ActiveRecord::RecordNotUnique => exception\n end\n end\n end", "title": "" }, { "docid": "7482725ebe7ff21fb319c7ec84bc7138", "score": "0.57278425", "text": "def update\n @event_requirement = EventRequirement.find(params[:id])\n\n if @event_requirement.update(event_requirement_params)\n head :no_content\n else\n render json: @event_requirement.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f4c68434cf3f69d4da6f5d4cd2242a77", "score": "0.57269394", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to animal_events_path, notice: 'Event was successfully updated.' }\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": "fdce09cb3eb4b4082e8b6ff2d27f4ada", "score": "0.57225716", "text": "def update\n respond_to do |format|\n if @base_event.update(base_event_params)\n format.json { head :no_content }\n else\n format.json { render json: @base_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23d5c0d02d4119433b2f5a435392bbbd", "score": "0.57215244", "text": "def update\n respond_to do |format|\n if @typo.update(typo_params)\n format.html { redirect_to @typo, notice: 'Typo was successfully updated.' }\n format.json { render :show, status: :ok, location: @typo }\n else\n format.html { render :edit }\n format.json { render json: @typo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c725695acd9575fdef974dd561794730", "score": "0.57196325", "text": "def update\n @event = Event.find(params[:id])\n\n if @event.update(params[:event])\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "051b3216bf50aba68619fac0a9355a4b", "score": "0.57106155", "text": "def update\n # @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49a77bec84338ed65381d9633e3f0a74", "score": "0.5709236", "text": "def update\n respond_to do |format|\n if @folevent.update(folevent_params)\n format.html { redirect_to @folevent, notice: 'Folevent was successfully updated.' }\n format.json { render :show, status: :ok, location: @folevent }\n else\n format.html { render :edit }\n format.json { render json: @folevent.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a10e2dc5121093907be93b7db4f7de3e", "score": "0.568699", "text": "def update\n @techaxis = Techaxis.find(params[:id])\n\n respond_to do |format|\n if @techaxis.update_attributes(params[:techaxis])\n format.html { redirect_to techaxis_type_techaxis_path, :notice => t('controllermessage.update') }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @techaxis.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b93a5cc7454bf4fad9362c7705d0d0b", "score": "0.5675787", "text": "def update\n respond_to do |format|\n if @microfinance_service_provider_typology.update(microfinance_service_provider_typology_params)\n format.html { redirect_to @microfinance_service_provider_typology, notice: 'Microfinance service provider typology was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @microfinance_service_provider_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56c2da8179f7e0fd503acb99febcf129", "score": "0.56686157", "text": "def update\n respond_to do |format|\n if @recreation_service_typology.update(recreation_service_typology_params)\n format.html { redirect_to @recreation_service_typology, notice: 'Recreation service typology was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recreation_service_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ee8fcfa321abca1c8a254f293929bba", "score": "0.5666979", "text": "def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0ee8fcfa321abca1c8a254f293929bba", "score": "0.5666979", "text": "def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c48dd5de3d640b106604be10a59b4863", "score": "0.5666075", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c48dd5de3d640b106604be10a59b4863", "score": "0.5666075", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c48dd5de3d640b106604be10a59b4863", "score": "0.5666075", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c48dd5de3d640b106604be10a59b4863", "score": "0.5666075", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c48dd5de3d640b106604be10a59b4863", "score": "0.5666075", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c48dd5de3d640b106604be10a59b4863", "score": "0.5666075", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c48dd5de3d640b106604be10a59b4863", "score": "0.5666075", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c48dd5de3d640b106604be10a59b4863", "score": "0.5666075", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c48dd5de3d640b106604be10a59b4863", "score": "0.5666075", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "659116f1117f23d9708222f2bdfaaaf6", "score": "0.56623995", "text": "def update\n @idea_event = IdeaEvent.find(params[:id])\n\n respond_to do |format|\n if @idea_event.update_attributes(params[:idea_event])\n format.html { redirect_to @idea_event, notice: 'Idea event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @idea_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "68dfb0dd3b5aff4cd02fc72026ba2c96", "score": "0.56612974", "text": "def update\n @event = Event.find(params[:id])\n @event.professional = @salon.professionals.find(params[:professionals])\n @event.service = @event.professional.services.find(params[:service])\n @event.client = @salon.clients.find(params[:client])\n @event.end_at = params[:end_at]\n @event.start_at = params[:start_at]\n @event.reschedule = false\n respond_to do |format|\n if @event.save \n flash[:notice] = \"Evento alterado com sucesso\"\n format.html { redirect_to([:admin,@event])}\n format.xml { head :ok }\n format.js {render \"update\"}\n else\n flash[:alert] = \"Houve um erro ao tentar alterar seu evento\"\n format.js {render :js => \"window.location.reload()\"}\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "88edeffc81dd460e58909f51d3b76558", "score": "0.5657328", "text": "def update\n @event = Event.find(params[:id])\n\n @client = Client.find(params[:event][:client_id])\n @event.event_type_id = nil\n @event_type = EventType.find(params[:selected])\n if @event_type.node == false\n @event.event_type_id = params[:selected]\n end\n\n respond_to do |format|\n if params[:event][:event_type_id] != \"\" && @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Ereignis wurde erfolgreich bearbeitet' }\n format.json { head :no_content }\n else\n self.reload_params\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6257be929e8929f86c9ed035f6575a80", "score": "0.5656436", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n @event.save!\n end\n end", "title": "" }, { "docid": "ce7f55fc9b33820fb73ee7cddbcd4cf7", "score": "0.5651855", "text": "def update\n @event = Event.find(params[:id])\n\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cac45f25c548035be0d50be582f74a0c", "score": "0.56512296", "text": "def update\n #@event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "054f73ab490c667c7471107048e70ed8", "score": "0.5646459", "text": "def update\n @evento = Evento.find(params[:id])\n\n respond_to do |format|\n if @evento.update_attributes(params[:evento])\n format.html { redirect_to @evento, notice: 'Evento fue modificado con exito.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90c7564d60f745c471f8d375796c1972", "score": "0.5645474", "text": "def update\n respond_to do |format|\n if @education_service_provided_typology.update(education_service_provided_typology_params)\n format.html { redirect_to @education_service_provided_typology, notice: 'Education service provided typology was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @education_service_provided_typology.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5023aa38c5e3f2daaddb4d7a8bc6ee9a", "score": "0.56388843", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to controller: 'admin/events', action: 'index', conf_id: @event.conference_id }\n format.json { render :show, status: :ok, location: @event }\n else\n @event_type = @event.event_type\n @speaker_event = @event_type.speaker_event\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9245f4e4ff57baf72c20adb7a0834810", "score": "0.5627468", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html {redirect_to @event, notice: 'Event was successfully updated.'}\n format.json {head :no_content}\n else\n format.html {render action: 'edit'}\n format.json {render json: @event.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "6057d92b0704aa37b9cfaa5dd5be8f36", "score": "0.562699", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6057d92b0704aa37b9cfaa5dd5be8f36", "score": "0.562699", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16ea68943e0d5ba1f7015d61cf89c79c", "score": "0.5619085", "text": "def update\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to organization_event_url(@event.organization, @event), notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5667e5ddafc93238112d1e5e3fe2c420", "score": "0.56166816", "text": "def update\n @tso = Tso.find(params[:id])\n\n respond_to do |format|\n if @tso.update_attributes(params[:tso])\n flash[:notice] = 'Tso was successfully updated.'\n format.html { redirect_to(@tso) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tso.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfc0d59fdeb6a433afeb730207e6ad49", "score": "0.56142354", "text": "def update\n respond_to do |format|\n if @sick_hours_event.update(sick_hours_event_params)\n format.html { redirect_to sick_hours_events_path, notice: 'Sick hours event was successfully updated.' }\n format.json { render :show, status: :ok, location: @sick_hours_event }\n else\n format.html { render :edit }\n format.json { render json: @sick_hours_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0cde82415b9697a006da0031f015513e", "score": "0.5613615", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n # イベントのステータスで落選に変更されたら、企業のステータスを選考済みに変更\n if @event.is_passed == 'droped'\n company = Company.find(@event.company_id)\n company.is_active = false\n company.save\n end\n format.html { redirect_to @event, notice: \"イベントの更新に成功しました。\" }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c721ab69619b0f18526653eb2eaa3ac7", "score": "0.56133956", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render json: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe7aba075ded9f34b1d6a4afc180cc2a", "score": "0.5611638", "text": "def update\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html do\n gflash :notice\n redirect_to @event\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "633ffd18cd7f08e948581582f7c1092e", "score": "0.56115586", "text": "def update\n #require \"pry\"; binding.pry\n\n update_users\n\n respond_to do |format|\n if @event.update(event_params)\n sync_update @event\n format.html { redirect_to @event, notice: t(\"successfully_updated\", :model => t(\"models.event\")) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a99a0c3b9cf2b4e5d844ce06bab0693d", "score": "0.56088537", "text": "def update\n respond_to do |format|\n if @food_event.update(food_event_params)\n format.html { redirect_to @food_event, notice: 'Food event was successfully updated.' }\n format.json { render :show, status: :ok, location: @food_event }\n else\n format.html { render :edit }\n format.json { render json: @food_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fba95fc08a2546db4f080e916b5f580f", "score": "0.56026936", "text": "def update\n @event_request = EventRequest.find(params[:id])\n\n respond_to do |format|\n if @event_request.update_attributes(params[:event_request])\n format.html { redirect_to @event_request, notice: 'Event request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62d7667ca01a21a5eaf8989d6a632899", "score": "0.56021017", "text": "def update\n @event = Event.find(params[:id])\n debugger\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7c2e29776df1693caa75882c41aabab7", "score": "0.5593581", "text": "def update\n @event_event = Event::Event.find(params[:id])\n\n respond_to do |format|\n if @event_event.update_attributes(params[:event_event])\n format.html { redirect_to @event_event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2694d6ee2abb275ab79862fe3e784d5a", "score": "0.55907005", "text": "def update\n @hive_event = HiveEvent.find(params[:id])\n\n respond_to do |format|\n if @hive_event.update_attributes(params[:hive_event])\n format.html { redirect_to @hive_event, notice: 'Hive event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hive_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "428e381b21f6220f69ae922b96469d81", "score": "0.5590269", "text": "def update\r\n respond_to do |format|\r\n if @event.update(event_params)\r\n format.html { redirect_to @event, notice: 'Event 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: @event.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "bb80c789d0f17f4216c4f64fed7ccc6a", "score": "0.558989", "text": "def update\n respond_to do |format|\n if @evento.update(evento_params)\n format.html { redirect_to @evento, notice: 'Evento atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @evento }\n else\n format.html { render :edit }\n format.json { render json: @evento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a9ec0d3651c86aa059583f4dda9f4ac", "score": "0.5585963", "text": "def update\n if @event.update(event_params)\n render json: @event, status: 201\n else\n render json: { message: \"Error. Error. Please try again.\"}, status: 400\n end\n end", "title": "" }, { "docid": "73abdfb7bbbcd30f9884f3a779c041d4", "score": "0.5581644", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Evento atualizado com sucesso.' }\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": "f40d0bf35fdb265e46a7bebea4bc19b1", "score": "0.55812347", "text": "def update\n # respond_to do |format|\n if @eventslot.update(eventslot_params)\n # format.html { redirect_to @eventslot, notice: 'Eventslot was successfully updated.' }\n # format.json { render :show, status: :ok, location: @eventslot }\n redirect_to vieweventschedule_path, notice: 'Event Slot was successfully Updated.'\n else\n # format.html { render :edit }\n # format.json { render json: @eventslot.errors, status: :unprocessable_entity }\n redirect_to edit_eventslot_path, notice: 'Error Encountered'\n end\n # end\n end", "title": "" }, { "docid": "8dda3d5a1f4d5d085bd4549a9da59617", "score": "0.5579765", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n set_event_unique_active @event if @event.active\n format.html { redirect_to team_events_url, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: team_events_url }\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": "da52dd0880c1e68d6023341970add1cc", "score": "0.5578171", "text": "def event_and_specs_edit\n #Updates to Event Section\n @event = Event.where(id: params[\"event_id\"]).first\n @event.name = params[\"event_name\"]\n @event.date_of_event = params[\"event_date\"]\n @event.time = params[\"event_time\"]\n @event.delivery_setup_time = params[\"setup_time\"]\n @event.feel_of_day = params[\"feel_of_day\"]\n @event.color_palette = params[\"color_palette\"]\n @event.flower_types = params[\"flower_types\"]\n @event.attire = params[\"attire\"]\n @event.photographer = params[\"photographer\"]\n @event.coordinator = params[\"coordinator\"]\n @event.locations = params[\"locations\"]\n @event.employee_id = Employee.where(name: params[\"lead_designer\"]).where(florist_id: session[\"found_florist_id\"]).first.id \n @event.notes = params[\"notes\"]\n @event.other_notes = params[\"other_notes\"]\n @event.budget = params[\"budget\"]\n @event.quote_message = params[\"quote_message\"]\n @event.customer_id = params[\"customer_id\"]\n @event.show_display_name = params[\"display_name\"]\n @event.show_product_image = params[\"show_product_image\"] \n if @event.save == false\n @employee_list = Employee.where(florist_id: session[\"found_florist_id\"]).where(status: \"Active\").uniq.pluck(:name)\n @specifications = @event.specifications.where(\"item_name not like 'X1Z2-PlaCeHoldEr'\").order(\"id\")\n render(:event_edit) and return\n else # do nothing\n end\n #Updates to Event Specifications Section\n for each in Specification.where(event_id: params[\"event_id\"]).where(\"item_name not like 'X1Z2-PlaCeHoldEr'\") \n each.item_name = params[\"spec_item-#{each.id}\"]\n each.item_quantity = params[\"spec_qty-#{each.id}\"].to_i * 100.0\n each.item_specs = params[\"spec_notes-#{each.id}\"]\n each.exclude_from_quote = params[\"exclude-#{each.id}\"]\n each.updated_by = Employee.where(florist_id: session[\"found_florist_id\"]).where(id: session[\"found_user_id\"]).first.username\n each.save \n end\n if params[\"vs\"]\n redirect_to \"/virtual_studio/#{params[\"vs\"]}\" and return\n \n elsif params[\"delete\"]\n spec_id = params[\"delete\"]\n spec = Specification.where(id: spec_id).first\n spec.destroy\n designed_products = DesignedProduct.where(specification_id: spec_id)\n for each in designed_products\n each.destroy\n end \n for image in spec.images\n image.destroy\n end \n elsif params[\"add\"]\n # Create a \"spec\" placeholder for the list of products if one hasn't already been created.\n if Specification.where(event_id: params[\"event_id\"]).where(item_name: \"X1Z2-PlaCeHoldEr\").first == nil\n new_spec = Specification.new\n new_spec.event_id = params[\"event_id\"]\n new_spec.item_quantity = 100000\n new_spec.item_name = \"X1Z2-PlaCeHoldEr\"\n new_spec.florist_id = session[\"found_florist_id\"]\n new_spec.exclude_from_quote = 1 \n new_spec.save!\n end\n new_spec = Specification.new\n new_spec.event_id = params[\"ev_id\"]\n new_spec.item_quantity = 1 * 100.0\n new_spec.item_name = \"\"\n new_spec.updated_by = Employee.where(florist_id: session[\"found_florist_id\"]).where(id: session[\"found_user_id\"]).first.username\n new_spec.florist_id = session[\"found_florist_id\"] \n new_spec.save!\n elsif params[\"add_image\"]\n redirect_to \"/images/#{params[\"add_image\"]}\" and return\n else #do nothing\n end\n redirect_to \"/event_edit/#{params[\"event_id\"]}\" and return\n end", "title": "" }, { "docid": "631de272fd06ef5f342757641ffe92a2", "score": "0.55746555", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Zaktualizowano termin realizacji usługi.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a54ced7b324c076823fa6b8e01ac25ed", "score": "0.55704683", "text": "def update\n respond_to do |format|\n if @hack.update_attributes(params[:hack])\n format.html { redirect_to @event, :notices => ['Hack was successfully updated.'] }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @hack.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b1f9a6c9a73cac9823e9f0c0ad4194c3", "score": "0.5568583", "text": "def update\n if @event.update(event_params)\n render json: { location: format_event(@event) }\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66ceb4adf993224337e7f0250c392766", "score": "0.5566383", "text": "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d4772cb72b884dd3172013837823f40f", "score": "0.55632997", "text": "def update\n respond_to do |format|\n if @event_event.update(event_event_params)\n format.html { redirect_to [:admin, @event_event], notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "894590312fe832eebad82d71a3b7e985", "score": "0.55591637", "text": "def update\n\n\n\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to '/', notice: 'Event was successfully updated.' }\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": "b2fa37290a30905d8352fcc4aca63743", "score": "0.555753", "text": "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to admin_events_path, notice: 'El evento fue modificado' }\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": "7ffce80d6cc1fecfd96ed4016f04d7ad", "score": "0.555366", "text": "def update\n @event = Event.find(params[:id])\n \n respond_to do |format|\n if @event.update_attributes(params[:event])\n @content = \"4\"\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
0413524b6529b8d82dfdb3da8547e0b1
POST /client_certifications POST /client_certifications.json
[ { "docid": "d3ce877081b5f9066a08e0885af6c304", "score": "0.7081932", "text": "def create\n @client_certification = ClientCertification.new(client_certification_params)\n\n respond_to do |format|\n if @client_certification.save\n format.html { redirect_to @client_certification.contract, notice: 'La Certificación se creó correctamente' }\n format.json { render :show, status: :created, location: @client_certification }\n else\n format.html { render :new }\n format.json { render json: @client_certification.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "c696a98169e01873bf18916f489bd70c", "score": "0.6664644", "text": "def create\n @certificacion = Certificacion.new(certificacion_params)\n\n respond_to do |format|\n if @certificacion.save\n format.html { redirect_to @certificacion, notice: 'Certificacion was successfully created.' }\n format.json { render :show, status: :created, location: @certificacion }\n else\n format.html { render :new }\n format.json { render json: @certificacion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62ae0c9579a761167331f45f3943ee1b", "score": "0.6657181", "text": "def create\n @current_user = current_user\n @user_certification = @current_user.user_certifications.new(user_certification_params)\n\n respond_to do |format|\n if @user_certification.save\n format.html { redirect_to action: \"index\", notice: 'User certification was successfully created.' }\n format.json { render :show, status: :created, location: @user_certification }\n else\n format.html { render :new }\n format.json { render json: @user_certification.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f6ea19ee0d7a82541049045c0ee410b", "score": "0.6648985", "text": "def create\n @certificado = Certificado.new(certificado_params)\n\n respond_to do |format|\n if @certificado.save\n format.html { redirect_to \"/certificados\", notice: 'Certificado was successfully created.' }\n format.json { render :show, status: :created, location: @certificado }\n else\n format.html { render :new }\n format.json { render json: @certificado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6477cac21ebd59fb594c0fd582cef34d", "score": "0.6561465", "text": "def create\n @certificado = Certificado.new(certificado_params)\n\n respond_to do |format|\n if @certificado.save\n format.html { redirect_to @certificado, notice: 'Certificado was successfully created.' }\n format.json { render action: 'show', status: :created, location: @certificado }\n else\n format.html { render action: 'new' }\n format.json { render json: @certificado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9bd303efe653270e089d58da466cc693", "score": "0.65262073", "text": "def make_certificados; end", "title": "" }, { "docid": "37aabe7555e1e8a41dabed4b03931260", "score": "0.6481409", "text": "def set_client_certification\n @client_certification = ClientCertification.find(params[:id])\n end", "title": "" }, { "docid": "c29f272d3ccd9fd38f23210e92e7c5d7", "score": "0.64207566", "text": "def create\n @candidates_certification = CandidatesCertification.new(params[:candidates_certification])\n\n respond_to do |format|\n if @candidates_certification.save\n format.html { redirect_to @candidates_certification, notice: 'Candidates certification was successfully created.' }\n format.json { render json: @candidates_certification, status: :created, location: @candidates_certification }\n else\n format.html { render action: \"new\" }\n format.json { render json: @candidates_certification.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c70722c8b496deca7f48fb44800b2a77", "score": "0.6398773", "text": "def certificate_params\n params.require(:certificate).permit(:client_id, :project_id,\n :client, :project)\n end", "title": "" }, { "docid": "f85cb7a3cc6543eac7cae2d9f0fa9260", "score": "0.63248837", "text": "def create\n @concert = Concert.new(concert_params)\n\n if @concert.save\n render :show, status: :created, location: @concert\n else\n render json: @concert.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5d00940cbb5e28d628609932db28a675", "score": "0.63209486", "text": "def create\n @admin_certificate = City.find(session[:current_city_id]).commonplace.certificates.new(admin_certificate_params)\n\n respond_to do |format|\n if @admin_certificate.save\n format.html { redirect_to session['previous_url'] || admin_certificates_url, notice: 'Certificate è stato creato con successo.' }\n format.json { render :show, status: :created, location: @admin_certificate }\n else\n format.html { render :new }\n format.json { render json: @admin_certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "673a937979e3330010f9d363372f0335", "score": "0.6311312", "text": "def create\n @concert = Concert.new(params[:concert])\n\n respond_to do |format|\n if @concert.save\n format.html { redirect_to @concert, :notice => 'Concert was successfully created.' }\n format.json { render :json => @concert, :status =>:created, :location => @concert }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @concert.errors, :status =>:unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "402e94b78bfe20b8bd199af4ed617390", "score": "0.6291932", "text": "def certificado_params\n params.require(:certificado).permit(:nro_certificado, :fecha_aplicacion, :fecha_vencimiento, :hora_aplicacion, :tratamiento, :vector, :superficie, :droga, :codigo, :turno, :observaciones_certificado, :estado, :cliente_id, cliente_attributes: [:cliente_id, :apellido, :cliente_tipo, :nombre, :domicilio, :telefono, :celular, :barrio, :estado, :rubro, :cuit, :correo])\n end", "title": "" }, { "docid": "9461bfc5741208daec369256bcbec6e3", "score": "0.62660074", "text": "def create\n @concert = Concert.new(concert_params)\n\n respond_to do |format|\n if @concert.save\n format.html { redirect_to @concert, notice: 'Concert was successfully created.' }\n format.json { render :show, status: :created, location: @concert }\n else\n format.html { render :new }\n format.json { render json: @concert.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "21fb63972c4b4c6aa409c16d36252d7b", "score": "0.62591326", "text": "def create\n \n @concert = Concert.new(params[:concert])\n\n respond_to do |format|\n if @concert.save\n format.html { redirect_to @concert, notice: 'Concert was successfully created.' }\n format.json { render json: @concert, status: :created, location: @concert }\n else\n format.html { render action: \"new\" }\n format.json { render json: @concert.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6d487ba49c40e7c1b5bb731fc38a28e4", "score": "0.6232793", "text": "def create\n @certificate = Certificate.new(certificate_params)\n @certificate.cert ||= Cert.new\n @certificate.user = current_user\n\n @certs = Cert.all\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to @certificate, notice: 'Certificate was successfully created.' }\n format.json { render action: 'show', status: :created, location: @certificate }\n else\n format.html { render action: 'new' }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n format.js\n end\n end", "title": "" }, { "docid": "8dbbffdf9839313916aa28bc7135d41c", "score": "0.6225774", "text": "def create\n @certificate = @ca.certificates.build(certificate_params)\n\n @certificate.generate_key_pair\n csr = @certificate.generate_csr\n @certificate.create_certificate(csr)\n\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to [@ca, @certificate], notice: 'Certificate was successfully created.' }\n format.json { render :show, status: :created, location: @certificate }\n else\n format.html { render :new }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0389bd153eb16c2a5e2c2d17414e076c", "score": "0.6225621", "text": "def create\n @concert = Concert.new(params[:concert])\n\n respond_to do |format|\n if @concert.save\n format.html { redirect_to @concert, notice: 'Concert was successfully created.' }\n format.json { render json: @concert, status: :created, location: @concert }\n else\n format.html { render action: \"new\" }\n format.json { render json: @concert.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "173a41d12f9d48e035c199dd4f6757a8", "score": "0.62195015", "text": "def update\n respond_to do |format|\n if @client_certification.update(client_certification_params)\n format.html { redirect_to client_certifications_path, notice: 'La Certificación se actualizó correctamente.' }\n format.json { render :show, status: :ok, location: @client_certification }\n else\n format.html { render :edit }\n format.json { render json: @client_certification.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bbe9ddae6fd4a63c566b5abf0402f117", "score": "0.6207143", "text": "def create\n @concert = Concert.new(params[:concert])\n\t@concert.save\n respond_with @concert\n end", "title": "" }, { "docid": "ee72c109e3aaaf9ce98756689cdc978c", "score": "0.6178655", "text": "def certificate_create(global_options, options)\n result = Excon.post(\n \"#{global_options[:fenton_server_url]}/certificates.json\",\n body: certificate_json(options),\n headers: { 'Content-Type' => 'application/json' }\n )\n\n write_client_certificate(\n public_key_cert_location(options[:public_key]),\n JSON.parse(result.body)['data']['attributes']['certificate']\n )\n\n [result.status, JSON.parse(result.body)]\n end", "title": "" }, { "docid": "e68d12ed58b2f45f2b9f546acbbd1924", "score": "0.60733664", "text": "def create\n csr = OpenSSL::X509::Request.new params[:csr]\n\n @certificate = ca.sign_csr(csr, @apiuser)\n\n if @certificate.save\n render :show, status: :created, location: @certificate\n else\n render json: @certificate.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "95b3c3a797a169e2304cfc1fb42b52d3", "score": "0.6015891", "text": "def create_cert_signing_req(request_count)\n scaffold = 'certificate_signing_requests'\n certificate_array = get_table('ssl_key_chains').last(request_count)\n payload = []\n\n certificate_array.each do |certificate_object|\n certificate_name = certificate_object['name']\n payload.push(\n name: certificate_name,\n sign_mode: 'ca',\n ssl_key_chain: certificate_object,\n country: 'US',\n state: 'Nevada',\n locale: 'Reno',\n organization_name: 'RG Nets, Inc.',\n organizational_unit_name: 'Professional Services',\n common_name: \"#{certificate_name}.rgnets.com\",\n email_address: 'info@rgnets.com'\n )\n end\n\n create_entry(payload, scaffold)\n end", "title": "" }, { "docid": "87b46d3faf75a0ad415e6a4b586178fa", "score": "0.5995417", "text": "def create\n @certification = Certification.new(certification_params)\n\n respond_to do |format|\n if @certification.save\n format.html { redirect_to @certification, notice: \"Certification was successfully created.\" }\n format.json { render :show, status: :created, location: @certification }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @certification.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1fd52551ad0a872cb3b79a3815c9cfb5", "score": "0.59915394", "text": "def create\n @user = current_user\n if @user.certificates.count == 0\n @user.user_profile_progress += 10\n end\n @certificate = current_user.certificates.new(certificate_params)\n\n respond_to do |format|\n if @certificate.save!\n @user.save!\n format.html { redirect_to '/profile#addMoreCertificates', notice: t('certificates_controller.certificates_create_success') }\n format.json { render :show, status: :created, location: @certificate }\n format.js\n else\n format.html { render :new }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1b247319825c1858c9f7f94e6b68ceda", "score": "0.5989115", "text": "def create\n @certification = Certification.new(certification_params)\nlogger.debug \"certification: \"+@certification.inspect\n \n if @certification.save\n #respond_with @certification\n render json: @certification\n #format.html { redirect_to @certification, notice: 'Certification was successfully created.' }\n #format.json { render action: 'show', status: :created, location: @certification }\n else\n respond_with @certification.errors, status: :unprocessable_entity\n #format.html { render action: 'new' }\n #format.json { render json: @certification.errors, status: :unprocessable_entity }\n end\n end", "title": "" }, { "docid": "259c98284b0a68a83b9bdfcf7c49606f", "score": "0.5969722", "text": "def certificate_params\n params.require(:certificate).permit(:method, :csr)\n end", "title": "" }, { "docid": "e9451566eb4fa76c5524af454738af9e", "score": "0.59324", "text": "def client_certification_params\n params.require(:client_certification).permit(:contract_id, :date, :state, :observation, :received, :contract, :number,\n :client_certification_details_attributes => [:id, :budget_detail_id, :quantity, :total_quantity, :price, :total, :_destroy])\n end", "title": "" }, { "docid": "5ca2fc6cb56b946335649579659432d8", "score": "0.59096044", "text": "def create\n @certification = Certification.new(certification_params)\n @certification.user_id = current_user.id\n\n respond_to do |format|\n if @certification.save\n format.html { redirect_to @certification, notice: 'Certification was successfully created.' }\n format.json { render action: 'show', status: :created, location: @certification }\n else\n format.html { render action: 'new' }\n format.json { render json: @certification.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89d05245bd236c78c3243687847defdd", "score": "0.5862201", "text": "def destroy\n @client_certification.destroy\n respond_to do |format|\n format.html { redirect_to client_certifications_url, notice: 'La Certificación se eliminó correctamente' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83c815fd674018b71e128bfd595f0ede", "score": "0.58604217", "text": "def digidoc_cert\n res = HTTParty.post(\n \"#{@base_url}/certificatechoice/pno/#{@country_code}/#{@identity_code}\",\n body: relying_party.to_json,\n headers: { 'Content-Type' => 'application/json' }\n )\n\n check_for_error(res)\n\n res = res.parsed_response\n res = get_status(res['sessionID'], 'authentication')\n\n @document_number = res['result']['documentNumber']\n @cert = res['cert']['value']\n return res\n end", "title": "" }, { "docid": "100fb58ec212bc1e1655a460be3f07c8", "score": "0.5860414", "text": "def certificate_params\n params.require(:certificate).permit(:cert_id, :country_id, :is_flag, :issuer, :from_date, :to_date, :is_unlimited, :licence_number)\n end", "title": "" }, { "docid": "58f739796db76266f4cf5c7a45699c55", "score": "0.5855543", "text": "def create\n\t\tparams[:certificate].delete :issuer_certificate if params[:certificate][:issuer_certificate] == \"\"\n\t\tparams[:certificate][:issuer_certificate] = Certificate.find(params[:certificate][:issuer_certificate]) if params[:certificate].has_key? :issuer_certificate\n\t\t@certificate = Certificate.new(params[:certificate])\n\n\t\texpires_timewithzone = @certificate.expires\n\n\t\tvalid_for_time = expires_timewithzone - Time.zone.now\n\n\t\tssl_hash = { :common_name => @certificate.common_name, :email => @certificate.email, :valid_for_days => valid_for_time / (60*60), :is_ca => @certificate.is_ca, :key_size => 4096 }\n\n\t\tif @certificate.issuer_certificate == nil\n\t\t\tserial = 1\n\t\t\t@certificate.serial = serial\n\t\telse\n\t\t\t@certificate.issuer_certificate.child_last_serial += 1\n\t\t\tserial = @certificate.issuer_certificate.child_last_serial\n\t\t\t@certificate.issuer_certificate.save\n\t\t\t@certificate.serial = serial\n\t\t\tissuer_cert = SslHelper.load_certificate @certificate.issuer_certificate.pem_certificate\n\t\t\tissuer_key = SslHelper.load_key @certificate.issuer_certificate.pem_private_key\n\t\t\tssl_hash[:issuer] = issuer_cert\n\t\t\tssl_hash[:issuer_key] = issuer_key\n\t\t\tssl_hash[:crl_uri] = \"http://test.dk\"\n\t\tend\n\n\t\tif @certificate.is_ca\n\t\t\t@certificate.child_last_serial = 1\n\t\tend\n\t\tssl_hash[:serial] = serial\n\n\t\tcert = SslHelper.generate_certificate ssl_hash\n\n\t\t@certificate.pem_private_key = cert[:key].to_pem\n\t\t@certificate.pem_certificate = cert[:certificate].to_pem\n\n\t\trespond_to do |format|\n\t\t\tif @certificate.save\n\t\t\t\tformat.html { redirect_to @certificate, notice: 'Certificate was successfully created.' }\n\t\t\t\tformat.json { render json: @certificate, status: :created, location: @certificate }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @certificate.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "f368f396729319f803021a2c9db86ba8", "score": "0.5845055", "text": "def certificacion_params\n params.require(:certificacion).permit(:titulo_certificacion, :descripcion_certificacion, :foto)\n end", "title": "" }, { "docid": "10365fafd6520efea2b1ae5b61866804", "score": "0.5843883", "text": "def certification_params\n params.require(:certification).permit(:name, :description, :user_id, :begin_date, :goal_date, :expire_date, :notes)\n end", "title": "" }, { "docid": "40dc153f4e0d9776332eb03a9dec10bb", "score": "0.5818129", "text": "def create \n if session_user.concerts.create(concert_params)\n concert = session_user.concerts.last \n render json: {concert: concert, success: \"Concert successfully added to your calendar!\"}\n else\n render json: {failure: concert.errors.full_messages}\n end\n end", "title": "" }, { "docid": "e81cb2947f7b256fcf83ff3d1bae77e1", "score": "0.5815298", "text": "def create\n @certification_provider = CertificationProvider.new(certification_provider_params)\n\n respond_to do |format|\n if @certification_provider.save\n format.html { redirect_to @certification_provider, notice: 'Certification provider was successfully created.' }\n format.json { render :show, status: :created, location: @certification_provider }\n else\n format.html { render :new }\n format.json { render json: @certification_provider.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95fd6b674c27b54d3229725cb13f754b", "score": "0.5798809", "text": "def create\n @ca = Ca.new(ca_params)\n\n @ca.generate_key_pair\n @ca.generate_certificate\n\n respond_to do |format|\n if @ca.save\n format.html { redirect_to @ca, notice: 'Ca was successfully created.' }\n format.json { render :show, status: :created, location: @ca }\n else\n format.html { render :new }\n format.json { render json: @ca.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e6793c0378a76a25f9dd0cd900e51326", "score": "0.578989", "text": "def create\n @certagency = Certagency.new(certagency_params)\n\n respond_to do |format|\n if @certagency.save\n format.html { redirect_to certagency_url(@certagency), notice: \"Certagency was successfully created.\" }\n format.json { render :show, status: :created, location: @certagency }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @certagency.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd8685306e37ad22d476c7dae51ea02e", "score": "0.57784784", "text": "def create\n @certification = Certification.new(params[:certification])\n\n respond_to do |format|\n if @certification.save\n format.html { redirect_to(certification_sections_url(@certification), :notice => 'Certification was successfully created.') }\n format.xml { render :xml => @certification, :status => :created, :location => @certification }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @certification.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "495ed84e36ad4ceb8e1b9910f1c0a682", "score": "0.5760253", "text": "def create\n @certificate = Certificate.new(certificate_params)\n @certificate.category = (params[:category_service]).upcase\n @certificate.user = current_user\n @certificate.number = Certificate.next_certificate_number(params[:category_service], @certificate.division) if @certificate.number.empty?\n\n certificate_authorize(@certificate, \"create\", params[:category_service])\n\n respond_to do |format|\n if @certificate.save\n @certificate.works.create!(trackable_url: \"#{certificate_path(@certificate, category_service: params[:category_service])}\", action: :create, user: current_user, \n parameters: @certificate.to_json(except: [:exam_id, :division_id, :customer_id, :user_id], \n include: {\n exam: {only: [:id, :number, :date_exam]},\n division: {only: [:id, :name]},\n customer: {only: [:id, :name, :given_names, :birth_date]},\n user: {only: [:id, :name, :email]}\n }\n ) )\n\n flash_message :success, t('activerecord.messages.successfull.created', data: @certificate.number)\n format.html { redirect_to certificate_path(@certificate, category_service: params[:category_service], back_url: params[:back_url]) }\n format.json { render :show, status: :created, location: @certificate }\n else\n format.html { render :new, locals: { back_url: params[:back_url] } }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b66929d7626814b1188a5e86be0b5e97", "score": "0.57547265", "text": "def certificate_json(options)\n {\n certificate: {\n client: options[:client],\n project: options[:project]\n }\n }.to_json\n end", "title": "" }, { "docid": "e20481952bff27d06acec219fbc22f3d", "score": "0.57414365", "text": "def create\n @profile_certification = ProfileCertification.new(profile_certification_params)\n\n respond_to do |format|\n if @profile_certification.save\n format.html { redirect_to @profile_certification, notice: 'Profile certification was successfully created.' }\n format.json { render :show, status: :created, location: @profile_certification }\n else\n format.html { render :new }\n format.json { render json: @profile_certification.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb1ecf8503bfd4400c5113db26037a21", "score": "0.57377356", "text": "def certificate_params\n params.require(:certificate).permit(:esod_category, :number, :date_of_issue, :valid_thru, :canceled, :division_id, :exam_id, :customer_id, :category, :note, :user_id)\n end", "title": "" }, { "docid": "18a7bfe42853f2ee292398aa06b8e60c", "score": "0.5733592", "text": "def create\n # byebug\n @certificate = Certificate.new(certificate_params)\n\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to @certificate, notice: 'Certificate was successfully created.' }\n format.json { render :show, status: :created, location: @certificate }\n else\n format.html { render :new }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a7d27872fb83eb551b8a1184f2935c99", "score": "0.57293916", "text": "def certification_params\n params.require(:certification).permit(:name, :surname, :date_of_birth, :category, :qr_code, :disease_target, :vaccine_or_prophylaxis, :medicinal_product, :marketing_authorization_holder,\n :vaccination_country, :vaccination_date, :dose_number, :series_of_doses, :issuer_id, :uvci)\n end", "title": "" }, { "docid": "2053f0efe2eae9bcec9ae026250ea755", "score": "0.57206047", "text": "def certified_params\n params.require(:certified).permit( :background_url, :event_id)\n end", "title": "" }, { "docid": "be4019cfe7c57771be6bb65657a30b57", "score": "0.5718101", "text": "def certificate_params\n params.require(:certificate).permit(:certificate)\n end", "title": "" }, { "docid": "69f65ae3d83cf778ec97969035f5418c", "score": "0.5714809", "text": "def certificate_params\n params.require(:certificate).permit(:name, :description, :user_id)\n end", "title": "" }, { "docid": "1ee7bbe0f29ab7c48fe1fe74f8ba06cf", "score": "0.5711779", "text": "def create\n @certificate = Certificate.new(certificate_params)\n\n if @certificate.save\n render :show, status: :created, location: @certificate\n else\n render json: @certificate.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4c604129aeab8788ee50609f85d886c4", "score": "0.5711161", "text": "def certificado_params\n params.require(:certificado).permit(:imagen, :nombre, :texto, :grupoid, :serie, :estado, :descargas,:template)\n end", "title": "" }, { "docid": "a1cfbf5f1b1477c4fcd92794190c2048", "score": "0.5710046", "text": "def create\n @concertsuser = ConcertsUser.new(params[:concertsuser])\n\n respond_to do |format|\n if @concertsuser.save\n format.json { render :json => @concertsuser, :status => :created}\n else\n format.json { render :json => @concertsuser.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58069f341783c62914cf2434d1d37764", "score": "0.57004243", "text": "def create_certificate(data)\n create(\"certificates\", data).first\n end", "title": "" }, { "docid": "73508651008f49ddc11f964675877af1", "score": "0.5690285", "text": "def certificate_params\r\n params.require(:certificate).permit(:description, :expiration, :form_id)\r\n end", "title": "" }, { "docid": "79eb718cedd385d6b6b8200c32cbf1f7", "score": "0.5688898", "text": "def create\n @certificate = Certificate.new(certificate_params) #merge parmas with token, remote_ip\n if @certificate.valid?\n @certificate_resp = @certificate.request_certificate\n respond_to do |format|\n format.html { render :new }\n end\n else\n respond_to do |format|\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "6c513133e73a146538455561fef3b0c7", "score": "0.5686422", "text": "def create\n @cert = Cert.new(cert_params)\n authorize! :create, @cert\n\n respond_to do |format|\n if @cert.save\n format.html { redirect_to @cert, notice: 'Cert was successfully created.' }\n format.json { render :show, status: :created, location: @cert }\n else\n format.html { render :new }\n format.json { render json: @cert.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ad7dd947b3b9a246512724bdf464c58", "score": "0.56691766", "text": "def create\n @goconcert = Goconcert.new(params[:goconcert])\n\n respond_to do |format|\n if @goconcert.save\n format.html { redirect_to @goconcert, notice: 'Goconcert was successfully created.' }\n format.json { render json: @goconcert, status: :created, location: @goconcert }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goconcert.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6fa248091666cda841d4ddb82ea18273", "score": "0.56687224", "text": "def new\n @candidates_certification = CandidatesCertification.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @candidates_certification }\n end\n end", "title": "" }, { "docid": "817cdb417c187ee978430780c0fb15f1", "score": "0.5661132", "text": "def certificate_params\n params.require(:certificate).permit(:number_prefix, :number, :date_of_issue, :valid_thru, :name, :given_names, :birth_date).merge(token: user_netpar_token, remote_ip: request.remote_ip)\n end", "title": "" }, { "docid": "4a3d88dc41700a2184f05428624c37fd", "score": "0.5661076", "text": "def cert_params\n params.require(:cert).permit(:user_id, :amount, :giver_id, :note, :giver_identifier)\n end", "title": "" }, { "docid": "baebfeec0cef8dad6c54fb82c401f7cf", "score": "0.56467175", "text": "def create\n @certificate = Certificate.new(certificate_params)\n\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to @certificate, notice: 'Certificado fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @certificate }\n else\n format.html { render :new }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb9d77fb0e40fd02438a07037ab9e594", "score": "0.5646669", "text": "def client_cert_cb(*) end", "title": "" }, { "docid": "078124ba55b10b6d6f552f4fc1ee2314", "score": "0.5639533", "text": "def getcertificate(client, args)\n\n request_data = {\n 'applicationId' => Base64.encode64(args[\"applicationId\"]),\n 'userId' => args[\"user\"]\n }\n\n return client.call(:get_certificate, message: request_data)\nend", "title": "" }, { "docid": "730f11791d3d4144824d9cd9acb02e80", "score": "0.5631709", "text": "def index\n @certifications = Certification.all\n end", "title": "" }, { "docid": "730f11791d3d4144824d9cd9acb02e80", "score": "0.5631709", "text": "def index\n @certifications = Certification.all\n end", "title": "" }, { "docid": "493d22db00c4f44a98d2122d63006749", "score": "0.5631374", "text": "def create\r\n @certificate = Certificate.new(certificate_params)\r\n\r\n respond_to do |format|\r\n if @certificate.save\r\n format.html { redirect_to new_certificate_path, notice: 'Certificate was successfully saved.' }\r\n format.json { render :show, status: :created, location: @certificate }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "29954bfd138e949331be4afb7b24b207", "score": "0.5615173", "text": "def certificate_params\n pp = params.require(:certificate).permit(:number, :value, :object, :responsible_enginner, :work_site, :year, :deadline, :start_date, :end_date, :book, :item, :description, :unit, :quantity, :kind_of_service_id, :path_file, :company_name, :verified)\n pp[:verified] = params[:certificate][:verified].to_i\n\n return pp\n end", "title": "" }, { "docid": "7ea1503b984e5414fee9d6c2aeea5162", "score": "0.5612675", "text": "def certagency_params\n params.require(:certagency).permit(:cert_agency)\n end", "title": "" }, { "docid": "2d61ae615aa3ef77a097cfd46e0310bb", "score": "0.5607834", "text": "def set_certificacion\n @certificacion = Certificacion.find(params[:id])\n end", "title": "" }, { "docid": "7c4ff1c7135233ef4e22f8c20016008f", "score": "0.56070423", "text": "def create\n @certificate = Certificate.new(params[:certificate])\n\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to @certificate, notice: 'Certificate was successfully created.' }\n format.json { render json: @certificate, status: :created, location: @certificate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7c4ff1c7135233ef4e22f8c20016008f", "score": "0.56070423", "text": "def create\n @certificate = Certificate.new(params[:certificate])\n\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to @certificate, notice: 'Certificate was successfully created.' }\n format.json { render json: @certificate, status: :created, location: @certificate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b40abc2b59d96e2b14b942abfffb868", "score": "0.5606612", "text": "def certificate_params\n params.require(:certificate).permit(:personal_id, :rut_personal, :motivo)\n end", "title": "" }, { "docid": "157c96532a11c0ef1e688851202878b1", "score": "0.56013584", "text": "def request_certificate_setup(companyId) path = \"/api/v2/companies/#{companyId}/certificates/setup\"\n post(path, {}, {}, AvaTax::VERSION) end", "title": "" }, { "docid": "c8670cd48144c3ee4154c3e553e647b5", "score": "0.5585857", "text": "def create\n if current_user.certificates.count < current_user.cert_limit\n name = current_user.username + Time.now.to_i.to_s\n # @certificate = Certificate.new()\n @certificate = current_user.certificates.build(:title => name)\n number=File.open(\"/etc/openvpn/easy-rsa/keys/serial\", \"r\").readline.chomp\n ENV['KEY_CN']=name\n Dir.chdir \"/etc/openvpn/easy-rsa/\"\n system \"sh /etc/openvpn/easy-rsa/build-key \" + name\n @certificate.number=number\n @certificate.link_key=\"/etc/openvpn/easy-rsa/keys/\" + name + \".key\"\n @certificate.link_crt=\"/etc/openvpn/easy-rsa/keys/\" + name + \".crt\"\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to(@certificate, :notice => t('.cert_was_created') ) }\n format.xml { render :xml => @certificate, :status => :created, :location => @certificate }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @certificate.errors, :status => :unprocessable_entity }\n end\n end\n else\n redirect_to(certificates_url, :notice => t('.cert_was_not_created') )\n end\n end", "title": "" }, { "docid": "5e5b79dc314ea83318449be1e311c18e", "score": "0.5582651", "text": "def cert_params\n params.require(:cert).permit(:description, :document)\n end", "title": "" }, { "docid": "e3d113b5a3661f0ad2326bfbc36884b6", "score": "0.5582554", "text": "def new\n\t\t@certificate = Certificate.new\n\t\t@issuer_certificates = Certificate.where(\"is_ca\")\n\t\t@issuer_certificates.prepend(Certificate.new(:id => 0, :name => \"None\"))\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @certificate }\n\t\tend\n\tend", "title": "" }, { "docid": "86f69692016cf9c56af9ec0aa72b94d0", "score": "0.55794436", "text": "def create\n @type_certificate = TypeCertificate.new(type_certificate_params)\n\n respond_to do |format|\n if @type_certificate.save\n format.html { redirect_to @type_certificate, notice: 'Type certificate was successfully created.' }\n format.json { render :show, status: :created, location: @type_certificate }\n else\n format.html { render :new }\n format.json { render json: @type_certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d46fa4cf37afb4f0722c92f86df2160", "score": "0.5578034", "text": "def create\n @gift_certificate = GiftCertificate.new(gift_certificate_params)\n\n respond_to do |format|\n if @gift_certificate.save\n format.html { redirect_to gift_certificates_path, notice: 'Gift certificate was successfully created.' }\n format.json { render :index, status: :created, location: @gift_certificate }\n else\n format.html { render :new }\n format.json { render json: @gift_certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "725fe253322f6f73b5936e31414ba59d", "score": "0.55753815", "text": "def root_certificate_params\n params.fetch(:root_certificate, {}).permit(:ca, :key)\n end", "title": "" }, { "docid": "2acc5b17cd09f2ba058e6535c9d6c908", "score": "0.5569433", "text": "def certificate_params\n params.require(:certificate).permit(:certificate_name, :certificate_publisher, :certificate_publish_date, :certificate_description, :user_id)\n end", "title": "" }, { "docid": "8376869915ef668ff851c874e5215e72", "score": "0.5567829", "text": "def params_certificados\n params.requiere( :certificado ).permit( :ruta, :tipo, :dog_id, :user_id )\n #params.permit( :ruta, :tipo, :dog_id, :user_id )\n end", "title": "" }, { "docid": "98d716126f8f766764265d6a753bdfe4", "score": "0.5567176", "text": "def create\n @cert_profile = CertProfile.new(cert_profile_params)\n\n respond_to do |format|\n if @cert_profile.save\n format.html { redirect_to @cert_profile, notice: 'Cert profile was successfully created.' }\n format.json { render :show, status: :created, location: @cert_profile }\n else\n format.html { render :new }\n format.json { render json: @cert_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aace33de48ad3be49c3eee752fbe71f4", "score": "0.55591697", "text": "def create\r\n @username = session[:username]\r\n @certifier = Certifier.new(certifier_params)\r\n\r\n respond_to do |format|\r\n if @certifier.save\r\n format.html { redirect_to @certifier, notice: 'Certifier was successfully created.' }\r\n format.json { render :show, status: :created, location: @certifier }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @certifier.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "0b8dc80e8e5db26a82d31903ba14fcd5", "score": "0.55543387", "text": "def create_certificate(cert, options={})\n options = options.slice(:name, :password)\n options = options.merge(type: \"client\", certificate: Base64.strict_encode64(OpenSSL::X509::Certificate.new(cert).to_der))\n post(certificates_path, options).metadata\n end", "title": "" }, { "docid": "5171e4b3196d20ab790bdb278baf315b", "score": "0.5552342", "text": "def certificate_params\n params.require(:certificate).permit(:country, :organization, :organization_unit, :common_name, :state, :locality, :not_before, :not_after)\n end", "title": "" }, { "docid": "2127d541d59d2b30632a612d89ea35d2", "score": "0.55486786", "text": "def cert_params\n params.require(:cert).permit(:name, :description, :cert_type_id, :vendor_id, :expiry, :application_id)\n end", "title": "" }, { "docid": "48dac7db1eb334408c32ddc140884fb0", "score": "0.55310166", "text": "def create\n @undertaking_certificate = UndertakingCertificate.new(undertaking_certificate_params)\n\n respond_to do |format|\n if @undertaking_certificate.save\n format.html { redirect_to @undertaking_certificate, notice: 'Undertaking certificate was successfully created.' }\n format.json { render :show, status: :created, location: @undertaking_certificate }\n else\n format.html { render :new }\n format.json { render json: @undertaking_certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad79c7ce78c24bf59b47d8f0c1d9a82e", "score": "0.5527991", "text": "def create\n @client_enrollment = ClientEnrollment.new(params[:client_enrollment])\n\n respond_to do |format|\n if @client_enrollment.save\n format.html { redirect_to(@client_enrollment, :notice => 'Client enrollment was successfully created.') }\n format.xml { render :xml => @client_enrollment, :status => :created, :location => @client_enrollment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @client_enrollment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38fad8a1d8859aded0bdd8b32b064ff8", "score": "0.5526149", "text": "def add_certification\n @user = User.find(params[:id])\n cert = Certification.find_by_id(params[:user][:cert_id])\n\n respond_to do |format|\n if cert.nil?\n format.html { redirect_to @user, error: 'Invalid certification ID.' }\n format.json { render json: @user, status: :unprocessable_entity }\n elsif !@user.certifications.include?(cert)\n @user.certifications << cert\n PlivoMessenger.send_msg(@user.phone, \"You signed up for #{cert.name}!\")\n format.html { redirect_to @user, notice: \"User was assigned certification #{cert.name}.\" }\n format.json { head :no_content }\n else\n format.html { redirect_to @user, notice: \"User already has certification #{cert.name}.\" }\n format.json { head :no_content }\n end\n end\n end", "title": "" }, { "docid": "f99afa14936d9b364f9d296d9cb0cfbf", "score": "0.55235505", "text": "def certification_params\n params.require(:certification).permit(:name)\n end", "title": "" }, { "docid": "05887a4b2ae1b710dc31e4d74098f721", "score": "0.5512922", "text": "def certificates(*) end", "title": "" }, { "docid": "5cb21041e85dff8799d7b82d63810626", "score": "0.551064", "text": "def create\n @certificate = Certificate.new(certificate_params)\n\n respond_to do |format|\n if @certificate.save\n format.html { redirect_to certificates_path, notice: '证书创建成功' }\n format.json { render action: 'index', status: :created, location: @certificate }\n else\n format.html { render action: 'new' }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0219c8e0c7f4ff388c45a19cca307bcf", "score": "0.55069655", "text": "def update\n certification_params.each_pair do |property,value|\n @certification.send(property+'=',value)if @certification.respond_to?(property+'=')\n end\n @certification.updater_id = current_user\n if @certification.save\n set_certification\n #respond_with @certification\n render json: @certification, status: :ok\n else\n ##render json: @certification.errors, status: :unprocessable_entity\n respond_with @certification.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "aacb02a0264de75d4d60bd4506955996", "score": "0.55055207", "text": "def create\n @client_has_conjoint = ClientHasConjoint.new(client_has_conjoint_params)\n\n respond_to do |format|\n if @client_has_conjoint.save\n format.html { redirect_to @client_has_conjoint, notice: 'Client has conjoint was successfully created.' }\n format.json { render :show, status: :created, location: @client_has_conjoint }\n else\n format.html { render :new }\n format.json { render json: @client_has_conjoint.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0453b0550e9bba2f111c2d01e03f2fd1", "score": "0.55052423", "text": "def new\n @concert = Concert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @concert }\n end\n end", "title": "" }, { "docid": "0453b0550e9bba2f111c2d01e03f2fd1", "score": "0.55052423", "text": "def new\n @concert = Concert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @concert }\n end\n end", "title": "" }, { "docid": "81cb71b04f82750efecc781ef461c435", "score": "0.5501125", "text": "def get_certs_from_server\n begin\n serial = $config['connect']['serial_number']\n uri = URI($config['connect']['full_url'])\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Post.new(uri.path, {'Content-Type' =>'application/json'})\n req.body = { serial_number: serial }.to_json\n res = http.request(req)\n data = JSON.parse(res.body)\n IO.write(\"#{serial}-cert.pem\", data[\"certificate\"])\n IO.write(\"#{serial}-private.key\", data[\"private_key\"])\n IO.write(\"#{serial}-public.key\", data[\"public_key\"])\n pp data\n rescue => e\n puts \"failed #{e}\"\n end\nend", "title": "" }, { "docid": "dda3dac5e7698a31b0d29031d4e50d77", "score": "0.5496241", "text": "def certs; end", "title": "" }, { "docid": "13e5e522861e992474981e6292177533", "score": "0.549256", "text": "def create\n unless current_user.admin?\n render status: 403, nothing: true and return\n end\n\n if certificate_params[:exam_id].nil? || certificate_params[:tag_id].nil?\n render status: 400, nothing: true and return\n end\n\n @exam = @member.exam_requests.find(certificate_params[:exam_id])\n @tag = Tag.find(certificate_params[:tag_id])\n\n if @exam.nil? || @tag.nil?\n render status: 400, nothing: true and return\n end\n\n @certificate = @member.certificates.build(certificate_params)\n\n if @certificate.save\n render nothing: true, status: :created, location: member_certificate_url(@member, @certificate)\n else\n render status: 400, nothing: true\n end\n end", "title": "" }, { "docid": "5a1b3a5c77571680eb23beeb2479f36f", "score": "0.5492361", "text": "def certificado_params\n params.require(:certificado).permit(:nombre)\n end", "title": "" }, { "docid": "edcc7d1e657f00bde445806cf266b2d9", "score": "0.54882586", "text": "def create\n load_filter_params\n\t\n @certificate = Certificate.new(certificate_params)\n\n respond_to do |format|\n if @certificate.save\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 cadastrada com sucesso!' }\n\t\t\n format.json { render :show, status: :created, location: @certificate }\n else\n format.html { render :new }\n format.json { render json: @certificate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
9ce75e1e7b04d24d249f853f8e4e1f7f
Find the pair of numbers that are perfectly divisible, sum their difference
[ { "docid": "577540eaa6f1513f373ec6c2d90005a3", "score": "0.6126067", "text": "def find_checksum_pt2(spreadsheet_rows)\n spreadsheet_rows.reduce(0) do |sum, row|\n (divisor, dividend) = row.\n combination(2).\n find do |(val, c_val)|\n case\n when divides_nicely?(val, c_val) then [val, c_val]\n when divides_nicely?(c_val, val) then [c_val, val]\n end\n end\n\n q = (dividend / divisor)\n\n sum + q\n end\nend", "title": "" } ]
[ { "docid": "fb6af3238f062ae1a2ea7e63d90e7151", "score": "0.70175296", "text": "def find_amicables(n)\n pairs = []\n sum = 0\n for i in 0..n do \n next if pairs.include? i\n d = sum_proper_divisors(i)\n next if d == i\n p = sum_proper_divisors(d)\n if p == i \n pairs << d\n pairs << i\n sum += d + i\n end\n end\n return sum\nend", "title": "" }, { "docid": "a3f8bec89107f351847a5a06a3276fa7", "score": "0.6993835", "text": "def opposite_count(nums)\n pairs = 0\n nums.each do |num1|\n nums.each do |num2|\n if num1 + num2 == 0\n pairs += 1\n end\n end\n end\n return pairs / 2\nend", "title": "" }, { "docid": "ca4f096112573561eccd05074fd13a42", "score": "0.68425375", "text": "def solution2(a)\n\n counts = Hash.new(0)\n\n a.each do |int|\n counts[int] += 1\n end\n\n non_divisors = []\n\n a.each do |int|\n div_count = 0\n for i in 1..int do\n div_count += counts[i] if int % i == 0\n end\n non_divisors << a.length - div_count\n end\n\n non_divisors\n\nend", "title": "" }, { "docid": "128edb323e2d20ae0daf8bd32f41f63d", "score": "0.6842215", "text": "def divisible_sum_pairs(n,k,a)\n count = 0\n i = 0\n\n while (i < n)\n j = i + 1\n\n while (j < n)\n if ((a[i] + a[j]) % k == 0)\n count += 1\n end\n j+=1\n end\n\n i += 1\n end\n count\nend", "title": "" }, { "docid": "7e22d06f2e1cd3bf62dcf283ae32009b", "score": "0.68402815", "text": "def perfects (n)\n return (1..n).select { |x| x==(1...x).select { |i| x%i==0 }.inject(:+) }\nend", "title": "" }, { "docid": "a1190e931fc57a4b15017b71caab5b7c", "score": "0.67912114", "text": "def sum_divisors(n)\r\n (1...n).select { |x| (n % x).zero? }.sum - 1\r\nend", "title": "" }, { "docid": "789e4420340a93a4998bfca7306c3bd2", "score": "0.67862016", "text": "def divisible_sum_pairs n, k, ar\n pairs = 0\n n.times do |i|\n ((i + 1)...n).each do |j|\n pairs += 1 if ((ar[i] + ar[j]) % k).zero?\n end\n end\n pairs\nend", "title": "" }, { "docid": "7e9bb8bb79fd2eb7d0d204543590b2cf", "score": "0.6731021", "text": "def solution(a, b)\n count = 0\n a.zip(b).each do |ai, bi|\n count += 1 if has_prime_divisors?(ai, bi)\n end\n count\nend", "title": "" }, { "docid": "5cda82043ba732f2fb4751107fa277c3", "score": "0.67022926", "text": "def sum_of_proper_divisors(n)\n\n sum_factor1 = factors_numbers(n).reduce(:+)\n number2 = sum_factor1\n sum_factor2 = factors_numbers(number2).reduce(:+)\n if (n == sum_factor2) && (number2 == sum_factor1) && (n != number2)\n return \"Yes, amicable with #{number2}\" \n else\n \"No\"\n end \n\nend", "title": "" }, { "docid": "f24617cba4f7aea607ba92713b9b1ecf", "score": "0.665979", "text": "def find_proper_divisors_sum(num)\n\tsum = 0\n\tsqrt = Math.sqrt(num)\n\n\t# add all divisors into sum\n\t(1..sqrt).each do |n|\n\t\t# if num is a proper divisor\n\t\tif num % n == 0\n\t\t\t# add it--and its pair (other than 1 and sqrt)--into sum\n\t\t\tif [1,sqrt].include?(n)\n\t\t\t\tsum += n\n\t\t\telse\n\t\t\t\tsum += (n + (num / n))\n\t\t\tend\n\t\tend\n\tend\n\n\tsum\nend", "title": "" }, { "docid": "ac2ba3f78d2c036642c7c1890c8c5a2f", "score": "0.6659194", "text": "def multiples(number1, number2, range1, range2)\n (range1...range2).select { |value| value % number1 == 0 || value % number2 == 0 }.reduce(:+)\nend", "title": "" }, { "docid": "e40feddd67fbd05005c69d5e444ba621", "score": "0.66388196", "text": "def sum_multiples2(numbers, mutiple)\n sum = 0\n for num in numbers\n if num % mutiple == 0\n sum += num\n end\n end\n sum\nend", "title": "" }, { "docid": "79ff787120a75eca3b65a7b360d63ef5", "score": "0.6636901", "text": "def is_perfect?(num)\n divisors = []\n (1..(num/2)).each do |div|\n if num % div == 0\n divisors.push(div)\n end\n end\n divisor_total = divisors.reduce(:+)\n if divisor_total == num\n 0\n elsif divisor_total < num\n -1\n elsif divisor_total > num\n 1\n end\nend", "title": "" }, { "docid": "a3c082bfe93f52a10d549c207654ca11", "score": "0.6635497", "text": "def p5\n\tdivisors = (1..20).to_a\n\tnum = divisors[-1]\n\tloop do\n\t\tbreak if divisible?(num, divisors)\n\t\tnum += divisors[-1]\n\tend\n\treturn num\nend", "title": "" }, { "docid": "f767dedc6d72c31384d16def15fb6a4e", "score": "0.66345704", "text": "def opposite_count(nums)\n pair=0\n nums.each do |num1|\n \tnums.each do |num2|\n \tif nums.index(num2)>nums.index(num1) && num2+num1==0\n pair+=1\n end\n end\n end\n return pair\n \n \n\nend", "title": "" }, { "docid": "951076cc288c90c30e44e4f4864f82be", "score": "0.66330177", "text": "def check_perfect(num)\n multiples_sum = 0\n\n (1..num / 2).each do |i|\n multiples_sum += i if (num % i).zero?\n break false if multiples_sum > num # for performance issues\n end\n\n multiples_sum == num\nend", "title": "" }, { "docid": "2b258f35c9ecb3f426d5c1b65ba1eb99", "score": "0.66095525", "text": "def sum_differences_between_products_and_LCMs(pairs)\n result = 0\n pairs.each do |pair|\n product = pair.inject(:*)\n lcm = product/gcd(pair.first, pair.last)\n result += product - lcm\n end\n result\nend", "title": "" }, { "docid": "cb2832376d22fb2efba5dd99401f8045", "score": "0.66072124", "text": "def divisibleSumPairs(n, k, ar)\n ar.combination(2).count { |a, b| (a + b) % k == 0 }\nend", "title": "" }, { "docid": "905f38d694ff1fe2fd98f6d3f05c2b42", "score": "0.6604686", "text": "def divisible_by(numbers, divisor)\n numbers.find_all { |i| (i % divisor).zero? }\nend", "title": "" }, { "docid": "ca2634c8373669e0d2de7e2205749253", "score": "0.6585587", "text": "def divisors(num)\n (1...num).select{|n| num % n ==0}.reduce(:+)\nend", "title": "" }, { "docid": "3855552709ab8c3b4c594497a3de356f", "score": "0.6585471", "text": "def getDivSums(n)\n #initialize total\n total = 0\n #for every number less than n\n for i in 1..n-1\n #if i is a divisor\n if n%i == 0\n #add divisor to total\n total += i\n end\n end\n #return total\n return total\nend", "title": "" }, { "docid": "3294ca8a95c9091b45ceff41d43e6464", "score": "0.6575488", "text": "def calculated(number)\n (2..(number/2)).each { |i| return i if number%i == 0 }\n number\nend", "title": "" }, { "docid": "f1652c2a285b0b8dc970f2bebda27b66", "score": "0.65753347", "text": "def perfects (n)\n return (1..n).select {| x | factors(x).uniq.sum / 2 == x}\nend", "title": "" }, { "docid": "5feccc6896db4a606a1bd31d7e28a3a4", "score": "0.6553984", "text": "def getTotalX(a, b)\n a.each_with_object([]) do |a0, res|\n b.each do |b0|\n res << b0 unless a0 == b0 || b0 % a0 != 0 \n end\n end.uniq.count\nend", "title": "" }, { "docid": "3aa9be6ee507ed5e07580c30b7cf6f34", "score": "0.6543033", "text": "def number_of_divisors\n (1..Math.sqrt(self)).inject(0) {|sum, i| modulo(i) == 0 ? sum + 2 : sum}\n end", "title": "" }, { "docid": "5f455367c4f7981fd3351a90dae8e622", "score": "0.65217495", "text": "def getTotalX(a,b)\n least_common_multiple = a.reduce(:lcm)\n greatest_common_factor = b.reduce(:gcd)\n counter = 0\n\n (least_common_multiple..greatest_common_factor).each do |num|\n if num % least_common_multiple == 0 && greatest_common_factor % num == 0\n counter += 1\n end\n end\n\n return counter\nend", "title": "" }, { "docid": "f22c7c54fec48cdd3e698df8308d12be", "score": "0.6521552", "text": "def divisibleSumPairs(n, k, ar)\n count = 0\n ar.each_with_index do |outer, i|\n ar.each_with_index do |inner, j|\n if i != j\n count += 1 if ((outer + inner) % k == 0 and i > j)\n end\n end\n end\n count\nend", "title": "" }, { "docid": "be798d5dfe425fb9660c99ddd3ad769f", "score": "0.65191025", "text": "def d(n)\r\n proper_divisors(n).reduce(:+)\r\nend", "title": "" }, { "docid": "7a8c6601835665e06da72e20a6f3ea3a", "score": "0.65165114", "text": "def pairs(array)\n result = 0\n \n array.uniq.each do |num|\n appearences = array.count(num)\n result += (appearences / 2) \n end\n result\nend", "title": "" }, { "docid": "3e877de83855edf8a9e3b88080efe967", "score": "0.6512579", "text": "def sumOfDivisors(number)\n\tsum=0\n\tlimit=number/2\n\ti=1\n\twhile i<=limit\n\t\tif number%i==0\n\t\t\tsum+=i\n\t\tend\n\t\ti+=1\n\tend\n\treturn sum\nend", "title": "" }, { "docid": "df8453d1fbc0cc29f832c4c005fb79bb", "score": "0.6505665", "text": "def divisors(num)\n\tcount = 0\n\tfor i in 1..Math.sqrt(num)\n\t\tif num % i == 0\n\t\t\tcount += 2\n\t\tend\n\tend\n\treturn count\nend", "title": "" }, { "docid": "1133588cd93d3db2cbbd2c8dcdba35a8", "score": "0.65055084", "text": "def divisors(n)\n (1.upto(n ** 0.5).select { |d| (n % d).zero? }.size * 2) - 1\nend", "title": "" }, { "docid": "dd5515b2aed064303bf7d6b50393e034", "score": "0.6473734", "text": "def perfects(n)\n return (6..n).select {|x| factors(x).reduce(:+) == 2*x}\nend", "title": "" }, { "docid": "cf3e9700a47730db4c8e6ff244084900", "score": "0.64714146", "text": "def d(n)\n divisors = (1...n).select{ |i| n % i == 0 }\n divisors.reduce(&:+)\nend", "title": "" }, { "docid": "f290e1fcd2b5181e8214278c0dc3f091", "score": "0.6470448", "text": "def sum_multiples1(numbers, mutiple)\n numbers\n .reject{ |n| n % mutiple > 0}\n .reduce(:+)\nend", "title": "" }, { "docid": "e3ee7d884da023a1667ad3c7ca5583c6", "score": "0.64632183", "text": "def getTotalX(a, b)\n (a[-1]..b[0]).to_a.reject do |cand|\n first_issue = a.detect { |elem| !(cand % elem).zero? }\n second_issue = first_issue ? false : b.detect { |elem| !(elem % cand).zero? }\n\n second_issue.nil? ? false : true\n end.count\nend", "title": "" }, { "docid": "8e8bf15b54f6a27dd9c307a052daa898", "score": "0.64446086", "text": "def divisible_numbers(arr)\n n = arr.size\n (0...n).each do |x|\n a = arr[x]\n ((x+1)...n).each do |y|\n b = arr[y]\n z = [a,b].sort\n return z if z[1] % z[0] == 0\n end\n end\nend", "title": "" }, { "docid": "f5ba0c14b310cfaa0835bbd81bb5daac", "score": "0.64293367", "text": "def howDivisible(val)\n\t#halfPower = val ** 0.5\n\t#halfPower.round()\n\t2.upto(21) do |x|\n\t\treturn x - 1 if(val % x != 0)\n\tend\n\t \n\treturn 21\nend", "title": "" }, { "docid": "91924fcd64ed6c5c96704ae409b374bf", "score": "0.64198273", "text": "def divisors(number)\n (1..number).select do |candidate|\n number % candidate == 0\n end\nend", "title": "" }, { "docid": "40ec0a2ab7448cbb61f33ad4a38d57cf", "score": "0.640024", "text": "def sum_of_divisors2(num)\n\n if num == 1\n return 0\n end\n\n sum = 1\n p = 2\n while p*p <= num && num > 1\n if (num%p).zero?\n j = p*p\n num = (num / p)\n while (num%p).zero?\n j = j*p\n num = (num / p)\n end\n sum = sum*(j-1)\n sum = sum / (p-1)\n else\n end\n if p == 2\n p = 3\n else\n p = p+2\n end\n end\n\n if num > 1\n sum = sum * (num+1)\n end\n\n sum\nend", "title": "" }, { "docid": "f8c5e8cbb906c4e6962ded9324fc5e0a", "score": "0.63986397", "text": "def divisible_by_remaining_odd_numbers?(n)\n potential_divisors = (3..Math.sqrt(n)).step(2).to_a\n divisible = false\n potential_divisors.each do |x|\n if n % x != 0\n potential_divisors.delete_if { |y| y % x == 0 }\n else\n divisible = true\n potential_divisors = []\n end\n end\n\n divisible\n\nend", "title": "" }, { "docid": "2a3ba9737409202ba4192127c3b6ed88", "score": "0.6376119", "text": "def divisible_by(a, b, k)\n a = k if a < k\n\n x = ((b-a)/k)\n x += 1 if a % k == 0\n\n #n = 0\n #(a..b).each do |i|\n # n += 1 if i % k == 0\n #end\n return x\nend", "title": "" }, { "docid": "a9392dee0faf707e292542e90b88d4c2", "score": "0.6352557", "text": "def solution(a)\r\n a.each do |num|\r\n if (a.count(num) % 2) != 0\r\n return num\r\n end\r\n end\r\nend", "title": "" }, { "docid": "d3a15fe7c9d9dfce50659c2dd7a24410", "score": "0.6348449", "text": "def sample\n\n\tfor num in 1..100\n\t\tsum = 0\n\n\t\tfor j in 1..num-1\n\n\t\t\tif( num % j == 0 ) \n\t\t\t\tsum = sum + j\n\t\t\tend\n\n\t\tend\n\t\t\n\t\tif( sum == num ) \n\t\t\tputs \"perfect number : #{num}\"\n\t\tend\n\n\tend\n\nend", "title": "" }, { "docid": "7cc493b4dab79de893db0294ee61b298", "score": "0.63362634", "text": "def count_evenly_devide_numbers(\n number:\n)\n result = 0\n # Split the number into an array of its digits\n num_array = number.to_s.split('').map(&:to_i)\n # Iterate the array and inc the result if number modulo its digit in zero\n num_array.each { |num| result += 1 if !num.zero? && number.modulo(num).zero? }\n # Return the result\n result\nend", "title": "" }, { "docid": "618e6db3036635bb02f326a36899aa52", "score": "0.63355047", "text": "def common_dividor(num1, num2)\n limit = [num1, num2].min\n limit.downto(1) do |int|\n return int if num1 % int == 0 && num2 % int == 0\n end\nend", "title": "" }, { "docid": "b88b4805ac58ff3593a8575a4026a62a", "score": "0.63352585", "text": "def divisible_by(numbers, divisor)\n numbers.select { |num| num % divisor == 0 }\nend", "title": "" }, { "docid": "10a932802b22932242694442e56a9eb3", "score": "0.63269806", "text": "def find_pairs_and_multiples\n set.each do |number|\n corresponding_number = TOTAL - number\n next unless set.include?(corresponding_number)\n\n puts corresponding_number * number\n break # as we only need the first pair\n end\n end", "title": "" }, { "docid": "ecc189e55611f0a521075b3943d9b8e3", "score": "0.63118726", "text": "def divisibleSumPairs(n, k, ar)\n # Complete this function\n count = 0;\n (0...n-1).each do |i|\n (i+1...n).each do |j|\n count += 1 if (ar[i] + ar[j]) % k == 0\n end\n end\n\n count;\nend", "title": "" }, { "docid": "ff202e72a479480ce5a56d09a603c885", "score": "0.63007915", "text": "def solution(n)\n number = 1\n stop = false\n while !stop\n results = []\n (1..n).each do |divider| \n if number % divider != 0\n results << false\n else\n results << true\n end\n end\n if results.count {|x| x == false } > 0\n stop = false\n number += 1\n else \n stop = true\n end \n end\n number\nend", "title": "" }, { "docid": "f8ec80127069ddd52b8bcb7db56f712a", "score": "0.62886196", "text": "def perfect?\n divisors.reduce(:+) == self\n end", "title": "" }, { "docid": "9815cd7ac512c23f981dcc89b189ba1e", "score": "0.62847304", "text": "def perfect_num?(n)\n if n == 1\n return \"deficient\"\n end\n div_array = []\n (1...n).each do |x|\n if n % x == 0\n div_array << x\n end\n end\n sum = div_array.inject(:+)\n if sum < n\n return \"deficient\"\n elsif sum == n\n return \"perfect\"\n else\n return \"abundant\"\n end\nend", "title": "" }, { "docid": "205583587d9a0b0e3026e9a27b1e624d", "score": "0.6279751", "text": "def multiples num1, num2, divisor\n x = []\n (num1...num2).each do |i|\n if is_divisible i, divisor\n x << i\n end\n end\n x\n end", "title": "" }, { "docid": "80df5c82a7c6d9a32164f9765d18a489", "score": "0.6264586", "text": "def amicable_numbers(n1,n2)\n divisors_sum(n1) == n2 && divisors_sum(n2) == n1\nend", "title": "" }, { "docid": "df067e1f9fcc3136ecc3f145431427b6", "score": "0.62438333", "text": "def evenly_divisible_values(array)\n array.permutation(2)\n .select { |a, b| (a % b).zero? }\n .map { |a, b| a / b }\nend", "title": "" }, { "docid": "dcf9f5f3f02a778750aa33f40759206f", "score": "0.62429065", "text": "def summer(upper_bound, first_mult, second_mult)\n sum = []\n (1...upper_bound).each do |num|\n if (num % first_mult == 0 || num % second_mult == 0)\n sum.push(num)\n end\n end\n puts sum.inject(:+)\nend", "title": "" }, { "docid": "73d1aa4ccc53e037d7f9b2c46c5ca501", "score": "0.6242879", "text": "def solution(number)\n sum = 0\n Array(1..number-1).each do |i|\n if i % 3 == 0 || i % 5 == 0\n sum += i\n end\n end\n sum\nend", "title": "" }, { "docid": "5d9669f7befe3e9f058316b3432bea2c", "score": "0.6242416", "text": "def divisorSum2(num)\n\ttotal = 1\n\tif(num > 1) then\n\t\t(2..num ** 0.5).each { |n| if (num % n == 0) then total = total + n + num/n end}\n\telse\n\t\treturn 0\n\tend\n\t\ttotal\nend", "title": "" }, { "docid": "b5653df4f83d5a2cf413d20a5afa9dff", "score": "0.6241732", "text": "def findDiffSquares(n)\n sum = 0\n (1..n).each { |i|\n (1..n).each { |j|\n sum += i*j unless i == j\n }\n }\n sum\nend", "title": "" }, { "docid": "102235234126cc01a92cb7992fd939e0", "score": "0.62367886", "text": "def evaluate_divisors(triangle_number)\n i = 1 \n divisors = [] \n # Make use of the pairs that multiplied together equal the triangle number. \n # Take 100. 1x100, 2x50, 4X25, 5x20, 10x10\n # This way, only have to iterate up to the square root of triangle number. \n until i > Math.sqrt(triangle_number)\n if triangle_number % i == 0 \n divisors << i\n temp = triangle_number / i \n # Prevent dups. Example 10x10 = 100.\n unless temp == i \n divisors << temp\n end \n end\n i += 1\n end \n \n if divisors.count > 500\n puts \"#{triangle_number} is the first triangle number with more than 500 divisors.\"\n puts \"Divisors count: #{divisors.count}\"\n @solved = true \n end \n \nend", "title": "" }, { "docid": "a0cfb1f35d2365c0391fc5d6c65394a2", "score": "0.62319285", "text": "def sumDiv(num)\n\t#initialize total\n\ttotal = 0\n\t#for every number less than num\n\tfor i in 1..num-1\n\t\t#if i is a proper divisor\n\t\tif isPropDiv(num, i)\n\t\t\t#add i to total\n\t\t\ttotal += i\n\t\tend\n\tend\n\t# return total\n\treturn total\nend", "title": "" }, { "docid": "1b39b87fabbddb22f4dd06ef264737da", "score": "0.61972815", "text": "def divisors(num)\n arr = [1, num]\n (2..Integer.sqrt(num)).each do |n|\n quot, rem = num.divmod(n)\n arr << [n, quot] if rem.zero?\n end\n arr.uniq.flatten.sort\nend", "title": "" }, { "docid": "986cc9713ba77d7110f54a0024cb6e1c", "score": "0.61956877", "text": "def divisible_by(numbers, divisible)\n divisible_number = numbers.select{ |x| x % divisible == 0 }\n divisible_number == 0 ? 0 : divisible_number \nend", "title": "" }, { "docid": "63460da85c52fd8fb3ca7d75eeea6682", "score": "0.61945695", "text": "def sumOfDivided(in_arr)\n p_arr = in_arr.each_with_object([]) do |num, arr| # get an array of all primes\n arr << num.abs.prime_division.transpose[0]\n end.flatten.uniq.sort # flat array, unique primes, sort in increasing order\n out_arr = p_arr.each_with_object([]) do |p_num, arr|\n p_sum = in_arr.select { |num| num % p_num == 0 }.reduce(0, :+)\n arr << [p_num, p_sum]\n end\nend", "title": "" }, { "docid": "7782c885613ee7f60f2e38d84d004be9", "score": "0.6184867", "text": "def sum_square_difference(num)\n (1..num).sum ** 2 - (1..num).map {|num| num ** 2 }.sum\nend", "title": "" }, { "docid": "83a3b9a22ddf9a97ac857110c8b5f822", "score": "0.6183408", "text": "def divisibleSumPairs(n, k, ar)\n combinations = ar.combination(2).to_a.count{ |pair| pair.reduce(:+) % k == 0 }\nend", "title": "" }, { "docid": "a093a995ea93396d173af3235354b331", "score": "0.6182256", "text": "def least_common_multiple(num_1, num_2)\n number = 1\n while ((number % num_1 != 0) || (number % num_2 != 0))\n number +=1\n end\n number\nend", "title": "" }, { "docid": "dad2322649e7914cbfa4ccc011c6e328", "score": "0.61702204", "text": "def divisors(number)\n (1..number).select { |n| number % n == 0 }\nend", "title": "" }, { "docid": "abcdd8f74a28a6546c627fa147cee77e", "score": "0.6162749", "text": "def count_divisors(num)\n count = 0\n top = Math.sqrt(num)\n (1..top).each { |n| count += 2 if num % n == 0 }\n count -= 1 if is_square?(num)\n count\n end", "title": "" }, { "docid": "d6fbc949828210dfbffe4463e6bedb98", "score": "0.6162072", "text": "def pairs_to_zero(nums)\n # Write your code here\n c = []\n a = nums.select { |n| c.push(n) if n < 0 }\n nums.delete_if { |n| c.push(n) if n < 0 }\n i = 0 \n pairs = 0\n a = a.map { |n| n*-1 }\n loop do \n if nums.count(a[i]) > 0\n pairs += 1\n end\n i += 1\n break if i == a.length\n end\n return pairs\nend", "title": "" }, { "docid": "57495bb942c4f1f1d2e037bc4836ec1d", "score": "0.61511844", "text": "def sum_pairs(numbers, sum)\n # Numbers witch we select as checked that we have in array.\n # Selected number is the index of array. So if we want to select\n # number 4 as chekced we do it so with putting checked[4] = 1 and so on.\n checked = []\n # Iterate over each number\n numbers.each do |n|\n # check what is the difference between searching sum and current number\n temp = sum - n\n # ... and if we already checked such number (checked[temp] == 1)\n # and it is grater or equal 0 (because we are looking for sum )\n # then there is our pair of numbers ([temp, n])\n return [temp, n] if (temp >= 0) && (checked[temp] == 1)\n checked[n] = 1\n end\n nil\nend", "title": "" }, { "docid": "41785b535108a22cc6b08bf08cd5af00", "score": "0.6149267", "text": "def solution(n)\n sum = 0\n (1...n).each do |elem|\n sum += elem if elem % 3 == 0 or elem % 5 == 0\n end\n sum\nend", "title": "" }, { "docid": "2699069f0b0d53148146d1d61e57bc56", "score": "0.6139994", "text": "def solve\n sum = 0\n (1..999).each do |n|\n if n % 3 == 0 or n % 5 == 0\n sum += n\n end\n end\n sum\nend", "title": "" }, { "docid": "84c4429fd0eea2648963ffa0cb7b5737", "score": "0.6135313", "text": "def divisibleSumPairs(n, k, ar) \n count = 0\n \n for a in 0..(n-2) do\n for j in (a+1)..(n-1) do\n count += 1 if ((ar[a] + ar[j]) % k == 0)\n end\n end\n count\nend", "title": "" }, { "docid": "599f47664fa36f67a98883c32f85c849", "score": "0.61260724", "text": "def divisors(n)\n results = []\n max = Math.sqrt(n).floor\n (1..(max)).each do |div|\n # next if results.include?(div)\n x, y = n.divmod(div)\n results << x << div if y == 0\n end\n results.uniq.sort\nend", "title": "" }, { "docid": "f7df517a0d477335aeede297b7820f69", "score": "0.61240524", "text": "def sum_square_difference(num)\n 1.upto(num).sum**2 - 1.upto(num).reduce(0) { |total, n| total + n**2 }\nend", "title": "" }, { "docid": "01cab9f74ae700ee6e07bde90b40df6a", "score": "0.6122494", "text": "def sum num1, num2, *divisor\n multiplesList = []\n n = divisor.length\n (divisor.length).times do |i|\n multiplesList += multiples num1, num2, divisor[i]\n end\n multiplesList.uniq.sum\n end", "title": "" }, { "docid": "25b184ca103af9c858ceabc6327dc570", "score": "0.6113705", "text": "def cantor_pairing(n, m)\n (n + m) * (n + m + 1) / 2 + m\nend", "title": "" }, { "docid": "b88dc7758a751ee1baf4e7c45c0f1ee1", "score": "0.611067", "text": "def ideal_numbers(n)\n # perfects = []\n # factors = proper_factors(n)\n\n # while perfects.length <= n \n # factors.each do |factor|\n # sum = aliquot_sum(n)\n \n # if factor == perfect_number?(factor)\n # perfects << factor\n # end \n # end \n # end\n\n perfect_nums = []\n\n i = 1\n while perfect_nums.length < n \n perfect_nums << i if perfect_number?(i)\n i += 1\n end \n\n perfect_nums\nend", "title": "" }, { "docid": "11c980feb39e39dbc6334f6479297265", "score": "0.6110214", "text": "def perfects (n)\r\n perfects = Array.new\r\n i = 1\r\n while i <= n\r\n temp = factors(i)\r\n sum = 0\r\n temp.each do |x|\r\n sum += x\r\n end\r\n if sum == i*2\r\n perfects.push(i)\r\n end\r\n i+=1\r\n end\r\n return perfects\r\nend", "title": "" }, { "docid": "9f7b7ebd9c5a9ddab5051e67cb120f58", "score": "0.6109249", "text": "def solution(a)\n first_sum = a[0]\n second_sum = a.inject(&:+) - a.first\n result = (first_sum - second_sum).abs\n\n a[1..-2].each do |elem|\n first_sum = first_sum + elem\n second_sum = second_sum - elem\n tmp_result = (first_sum - second_sum).abs\n result = tmp_result if tmp_result < result\n end\n\n result\nend", "title": "" }, { "docid": "4e84ba7d36ae5feb0146603b06cf838e", "score": "0.61058694", "text": "def sum_of_halfway_matches(nums)\n rotated = nums.rotate(nums.length / 2)\n matches = nums.zip(rotated)\n matches.reduce(0) do |total, pair|\n if pair.first == pair.last\n total + pair.first.to_i\n else\n total\n end\n end\nend", "title": "" }, { "docid": "f78ac201793fc4295dee6068aaa3ee9a", "score": "0.610536", "text": "def solve( n = 1_000, a = 3, b = 5 )\n # Important that multiples of BOTH a and b not be double-counted.\n (0...n).select {|x| 0 == x % a || 0 == x % b}.inject( :+ )\n end", "title": "" }, { "docid": "5049385783cd4865028bd57a28dd3184", "score": "0.61043817", "text": "def part2(line)\n numbers_str = line.chomp.split()\n numbers = numbers_str.map(&:to_i).sort\n\n # Start from the end\n i = numbers.size - 1\n\n while i > 0\n j = 0\n while j < i\n return numbers[i] / numbers[j] if numbers[i] % numbers[j] == 0\n j = j + 1\n end\n i = i - 1\n end\n return 0\nend", "title": "" }, { "docid": "e3e173c09b0a868c5322feb8dcf76abf", "score": "0.61011213", "text": "def divisors(n)\n return (1..n/2).select { |i| (n % i) == 0 }\nend", "title": "" }, { "docid": "07862afe72a8a9b28245b89945058ca3", "score": "0.6097664", "text": "def oddball(arr)\n a, b, c = arr\n if a %2 == b %2\n expected = a %2\n arr.drop(2).each{|n| return n if n != a}\n elsif a%2 == c %2\n return b\n else\n return a\n end\nend", "title": "" }, { "docid": "d8b7eba52c412b71e4941378e8f7834c", "score": "0.6093732", "text": "def better_solution_to_multiples\n set.to_a.combination(2) do |number, number1|\n remainder = TOTAL - number - number1\n\n if set.include?(remainder)\n puts remainder * number * number1\n break\n end\n end\n end", "title": "" }, { "docid": "ebe49fc05f513b72724c945827b5b7cf", "score": "0.60934615", "text": "def least_common_multiple(num_1, num_2)\n value = [num_1, num_2].max\n while (value % num_1 != 0) || (value % num_2 != 0)\n value += 1\n end\n return value\nend", "title": "" }, { "docid": "7c5aed246abb4cba68c1013d1e8cd7bf", "score": "0.608639", "text": "def proper_divisors n\n if (n < 2)\n return []\n end\n\n r = Math.sqrt(n)\n p = (r - 1).ceil\n d = (2..p).collect { |x| [x, n/x] if n % x == 0 }.compact.flatten\n if (r == r.floor)\n d.concat([r.floor])\n end\n return d.concat([1])\nend", "title": "" }, { "docid": "6ab446629a4bb7c7890621d62e47ace8", "score": "0.6083952", "text": "def Division(num1,num2)\n\n arr_1 = []\n arr_2 = []\n \n (1..num1).each do |val_1|\n if num1 % val_1 == 0 \n arr_1 << val_1\n end\n end\n \n (1..num2).each do |val_2|\n if num2 % val_2 == 0 \n arr_2 << val_2\n end\n end\n \n \n \n # code goes here\n return (arr_2 & arr_1).last \n \nend", "title": "" }, { "docid": "38a5cbeb6ad905fb9ba278dcf025097c", "score": "0.6080429", "text": "def problem_60a\n num_cut = 5\n# simple\n pairs = {}\n seen_primes = []\n num_primes = 0\n last = start = Time.now\n Primes.each do |p|\n next if p == 2\n b = p.to_s\n seen_primes.each_index do |sp_i|\n sp = seen_primes[sp_i]\n a = sp.to_s\n ai,bi = a.to_i,b.to_i\n ab = (a + b).to_i\n ba = (b + a).to_i\n\n if ba.prime? && ab.prime?\n # We have a pair that works both ways so add the peer to each prime\n pairs[ai] = aa = ((pairs[ai] || []) << bi).uniq\n pairs[bi] = bb = ((pairs[bi] || []) << ai).uniq\n next unless pairs[bi].length >= num_cut - 1 # bi is biggest of pair\n\n check = ([ai] + aa) & ([bi] + bb)\n if check.length >= num_cut\n puts \"Try #{check.inspect}\"\n perm = check.permutation(2).to_a\n new = perm.select do |x,y|\n (x.to_s + y.to_s).to_i.prime? && (x.to_s + y.to_s).to_i.prime?\n end\n if new.length == perm.length\n n = new.flatten.uniq\n sum = n.reduce(&:+)\n puts \"#{n.inspect} *** #{sum}\"\n return sum\n end\n end\n end\n end\n seen_primes << p\n end\n nil\nend", "title": "" }, { "docid": "de4be126a5f69eb41d84198a7d6e1123", "score": "0.6072362", "text": "def divisors(number)\n sqrt = Math.sqrt(number).floor\n (1..sqrt).each_with_object([]) do |n, div|\n if number % n == 0\n div << n\n div << number / n\n end\n end.uniq.sort\nend", "title": "" }, { "docid": "5d682e9ba67b56d6146a4ae3528381f5", "score": "0.6070966", "text": "def divisors(n)\n count = 0\n (1..n).each { |div| count += 1 if n % div == 0 }\n return count\nend", "title": "" }, { "docid": "b891c94d604baa4c642466fd65b5fe24", "score": "0.60631555", "text": "def squares(a, b)\n diff = (Math.sqrt(b).ceil - Math.sqrt(a).ceil)\n diff = diff + 1 if Math.sqrt(b) % 1 == 0\n # diff = diff + 1 if Math.sqrt(a) % 1 == 0\n return diff\nend", "title": "" }, { "docid": "1b496f160980eb3eea3a1f7366903275", "score": "0.6058966", "text": "def least_common_multiple(num_1, num_2)\n multiple = 1\n multiple += 1 until multiple % num_1 == 0 && multiple % num_2 == 0\n multiple\nend", "title": "" }, { "docid": "2d3cc54c4c803ef624836bebc16b3194", "score": "0.60544807", "text": "def sqrt_convergents()\r\n\tthe_div = [1, 2]\t\t# Numerator and Denominator\r\n\titerations = 1000\r\n\treturner = 0\r\n\r\n\twhile iterations > 0\r\n\t\t# Every next fraction has previouse one in the denominator.\r\n\t\tthe_div = [the_div[1], 2*the_div[1] + the_div[0]]\t\t# Simplify the fraction.\r\n\t\tto_test = the_div[0] + the_div[1]\t\t\t\t\t\t# 1 + fraction\r\n\t\treturner += 1 if to_test.to_s.size > the_div[1].to_s.size\r\n\t\titerations -= 1\r\n\tend\r\n\treturn returner\r\nend", "title": "" }, { "docid": "2aac0e7aca54b76e8202d2a4850383fa", "score": "0.60532415", "text": "def solution(number)\n sum = 0\n for i in 1..number - 1\n if (i % 3 == 0 or i % 5 == 0)\n sum += i\n end\n i += i\n end\n return sum\nend", "title": "" }, { "docid": "bc3163465b8216d1dc82ba83963a55fe", "score": "0.6052319", "text": "def odd_not_prime(x)\n full_arr = (1..x).to_a\n odd_arr = full_arr.select { |x| x.odd? }\n odd_and_prime = odd_arr.select { |x| !prime?(x) }\n odd_and_prime.size\nend", "title": "" }, { "docid": "18875971aa587f21fbfbd28c4522f835", "score": "0.6039786", "text": "def all_squared_pairs(num)\n 0.upto(num).take_while { |n| n * n <= num / 2 }.\n map { |n| [n, Math.sqrt(num - n * n)] }.\n select { |n, m| m == m.to_i }\nend", "title": "" }, { "docid": "bdba6a330cc5b3c54a60784bd163adfb", "score": "0.6036102", "text": "def totient4 n\n Prime.prime_division(n).each do |factor, _|\n n = n * (factor - 1) / factor\n end\n return n\nend", "title": "" } ]
6111c1d72f057c214a31ce8a2c097d86
TODO think about supporting CPKs
[ { "docid": "b7630eb60894db8d497b1f42a305e6e9", "score": "0.0", "text": "def remix_intermediate_model(cardinality, target_relationship_name, target_model_name, options)\n\n source_model = self\n\n default_intermediate_source_key = Extlib::Inflection.foreign_key(source_model.name)\n default_intermediate_target_key = Extlib::Inflection.foreign_key(target_model_name)\n default_intermediate_name = \"#{self.name.snake_case}_#{target_relationship_name}\".to_sym\n default_intermediate_model_name = \"#{default_intermediate_name.to_s.singular.camel_case}\"\n\n case through = options.delete(:through)\n when Symbol, String, Module\n intermediate_name = default_intermediate_name\n intermediate_model_name = default_intermediate_model_name\n intermediate_source_key = default_intermediate_source_key\n intermediate_target_key = default_intermediate_target_key\n remixable = through\n when Array\n intermediate_name = through.first\n through = through.last\n intermediate_model_name = through[:model] || default_intermediate_model_name\n intermediate_source_key = through[:source_key].first.to_s || default_intermediate_source_key\n intermediate_target_key = through[:target_key].first.to_s || default_intermediate_target_key\n remixable = through[:remixable]\n else\n msg = \"+options[:through]+ must be Symbol, String, Module or Array but was #{through.class}\"\n raise InvalidOptions, msg\n end\n\n intermediate_model = remixable_model(intermediate_model_name, remixable)\n intermediate_source = intermediate_source_key.gsub('_id', '').to_sym\n intermediate_target = intermediate_target_key.gsub('_id', '').to_sym\n\n # add properties and associations to the intermediate model\n\n intermediate_fk_options = if intermediate_model.key.empty?\n { :nullable => false, :key => true }\n elsif options[:unique]\n { :nullable => false, :unique => true, :unique_index => true }\n else\n { :nullable => false }\n end\n\n intermediate_model.property intermediate_source_key.to_sym, Integer, intermediate_fk_options\n intermediate_model.property intermediate_target_key.to_sym, Integer, intermediate_fk_options\n\n intermediate_model.belongs_to intermediate_source, source_model\n intermediate_model.belongs_to intermediate_target, target_model_name\n\n # establish relationships to intermediate and target model\n\n self.has cardinality, intermediate_name, intermediate_model, options\n self.has cardinality, target_relationship_name, target_model_name, :through => intermediate_name\n\n # TODO think about establishing the inverse m:m too\n\n end", "title": "" } ]
[ { "docid": "b12b2859d712055e744b2f8ba047f0e1", "score": "0.66410726", "text": "def generate_key3; end", "title": "" }, { "docid": "000611d81365d36a60b2f1117e89afc7", "score": "0.6505336", "text": "def key_coercions; end", "title": "" }, { "docid": "cb0b728b0f0e1b5fb4c0cd4b09694829", "score": "0.64764464", "text": "def key3; end", "title": "" }, { "docid": "34abe8b3545f3d0abf07a7f92eed8807", "score": "0.6416759", "text": "def deterministic_key; end", "title": "" }, { "docid": "d823a54c6c6cf13431d81eae9bc42954", "score": "0.6139307", "text": "def deterministic_key=(_arg0); end", "title": "" }, { "docid": "ba677c80d280d99e3c00dbe4a37f5ed0", "score": "0.6118658", "text": "def key_coercions=(_arg0); end", "title": "" }, { "docid": "41aa9ee22094525b40bf16661278347e", "score": "0.6110816", "text": "def public_key(*) end", "title": "" }, { "docid": "41aa9ee22094525b40bf16661278347e", "score": "0.6110816", "text": "def public_key(*) end", "title": "" }, { "docid": "41aa9ee22094525b40bf16661278347e", "score": "0.6110816", "text": "def public_key(*) end", "title": "" }, { "docid": "41aa9ee22094525b40bf16661278347e", "score": "0.6110816", "text": "def public_key(*) end", "title": "" }, { "docid": "41aa9ee22094525b40bf16661278347e", "score": "0.6110816", "text": "def public_key(*) end", "title": "" }, { "docid": "41aa9ee22094525b40bf16661278347e", "score": "0.6110816", "text": "def public_key(*) end", "title": "" }, { "docid": "64514bc61c2b4770ea2a4c0846152132", "score": "0.60950345", "text": "def key_c3\n Kernel.raise NotImplementedError\n end", "title": "" }, { "docid": "5568bea6df96d14573d8d55869b66a78", "score": "0.60720986", "text": "def cKey\n \"Jv7O3XZpNoJu72Rql7gE1A\"\nend", "title": "" }, { "docid": "a39ab456144279571a5939837b0f977a", "score": "0.6068825", "text": "def key_c1\n Kernel.raise NotImplementedError\n end", "title": "" }, { "docid": "35955dc43fa7aa94df67fe6565557d5c", "score": "0.60460263", "text": "def test_to_key; end", "title": "" }, { "docid": "35955dc43fa7aa94df67fe6565557d5c", "score": "0.60460263", "text": "def test_to_key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6017366", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "43ae9327eec2352614a32e1bde5b743a", "score": "0.6016857", "text": "def key; end", "title": "" }, { "docid": "9bd303efe653270e089d58da466cc693", "score": "0.6001175", "text": "def make_certificados; end", "title": "" }, { "docid": "04c8328e1651fe416f66ec82bffa8d47", "score": "0.59875125", "text": "def key_types; end", "title": "" }, { "docid": "de779a5cb6ecc02c189757bdb40d3299", "score": "0.597003", "text": "def zcard(key); end", "title": "" }, { "docid": "de779a5cb6ecc02c189757bdb40d3299", "score": "0.597003", "text": "def zcard(key); end", "title": "" }, { "docid": "6a2ae078209840b2037d8dd9a7f26ac8", "score": "0.5948595", "text": "def pub_key(*) end", "title": "" }, { "docid": "6a2ae078209840b2037d8dd9a7f26ac8", "score": "0.5948595", "text": "def pub_key(*) end", "title": "" }, { "docid": "df17998877d004de499ebb703f3a99c8", "score": "0.59356266", "text": "def key_fields; end", "title": "" }, { "docid": "df17998877d004de499ebb703f3a99c8", "score": "0.59356266", "text": "def key_fields; end", "title": "" }, { "docid": "a7c00ac7fca359a91a4e5643fb8fe9d0", "score": "0.5895388", "text": "def dig_keys; end", "title": "" }, { "docid": "869d762e55c684e94f56fcb807c6745b", "score": "0.5877649", "text": "def key_types=(_arg0); end", "title": "" }, { "docid": "45ba68391a1ddbbf6954ccbec554c78d", "score": "0.58601296", "text": "def validate_key(id,magickey)\nend", "title": "" }, { "docid": "a5d8517e2d6355c334e3b530e399bb89", "score": "0.5854651", "text": "def candidate_key2primary_key_args(ckey)\n columns = ckey.key_attributes.collect{|c| c.name} \n options = {:name => ckey.name}\n [ columns, options ]\n end", "title": "" }, { "docid": "7774e3fa3c114c57ada12563eb4e97d7", "score": "0.58385575", "text": "def get_min_key()\r\n \r\n end", "title": "" }, { "docid": "7eb504a9ffb355f357938cbf66f5962e", "score": "0.5833126", "text": "def key_coercions\n @key_coercions ||= {}\n end", "title": "" }, { "docid": "519c0f8a8baf7f29bdb424437283b82b", "score": "0.5829818", "text": "def public_key=(_arg0); end", "title": "" }, { "docid": "abb8b9c1a202b2455ebdc67a1bd7758c", "score": "0.5818746", "text": "def instant_key; end", "title": "" }, { "docid": "abb8b9c1a202b2455ebdc67a1bd7758c", "score": "0.5818746", "text": "def instant_key; end", "title": "" }, { "docid": "094f277d4b722d2604e3875471b62d4c", "score": "0.5815328", "text": "def candidate_key(ckey)\n supports_sub_operation!(:candidate_key)\n operations << [:candidate_key, ckey]\n end", "title": "" }, { "docid": "52224792efc52e4012b878470cbb8af1", "score": "0.57771045", "text": "def encryption_key; end", "title": "" }, { "docid": "d6115bb33c08177ab67d8f88f9176646", "score": "0.57755995", "text": "def public_key; end", "title": "" }, { "docid": "99fc12999b0cae97d5b86341e3a71d9e", "score": "0.5768024", "text": "def generate_key!(*) end", "title": "" }, { "docid": "384ece9d455eb5802bfad3b37a3be9d4", "score": "0.5767928", "text": "def key_generator; end", "title": "" }, { "docid": "2ca87cf274a7d760ef5b2c5a2f0156ad", "score": "0.5741202", "text": "def get_key(id)\nend", "title": "" }, { "docid": "08dd18aaeb026659578cafa1a2a5f02a", "score": "0.5721751", "text": "def pkey_key\n Kernel.raise NotImplementedError\n end", "title": "" }, { "docid": "931ded65abc292ccfaaf7650858de8a7", "score": "0.5717018", "text": "def gen_key\n raise NotImplementedError # TODO\n end", "title": "" }, { "docid": "cf69418d3cf97ee513327c01c9e41a7c", "score": "0.5710082", "text": "def kcode\n end", "title": "" }, { "docid": "407b429fb75d411857d956eab987e021", "score": "0.5705081", "text": "def key(*) end", "title": "" }, { "docid": "407b429fb75d411857d956eab987e021", "score": "0.5705081", "text": "def key(*) end", "title": "" }, { "docid": "6ae1450fc590df43bfa68f3f618b7bd9", "score": "0.570229", "text": "def consumer_pubkey; end", "title": "" }, { "docid": "470c91aaf57a589d47044c312f6bfaf1", "score": "0.56975216", "text": "def pkey_local\n Kernel.raise NotImplementedError\n end", "title": "" }, { "docid": "f2990d6564f2c3708ce68d933fcba532", "score": "0.568222", "text": "def private_key; end", "title": "" }, { "docid": "f2990d6564f2c3708ce68d933fcba532", "score": "0.568222", "text": "def private_key; end", "title": "" }, { "docid": "f2990d6564f2c3708ce68d933fcba532", "score": "0.568222", "text": "def private_key; end", "title": "" }, { "docid": "ba080664cd92540f6238dfeff2c1cfb3", "score": "0.56680954", "text": "def generate_key(key); end", "title": "" }, { "docid": "1cab7cebc0f25cbc131058ce38deec0f", "score": "0.56441534", "text": "def get_public_key(private_key)\n\n key = BTCKey.alloc.initWithPrivateKey(private_key)\n key_from_wif = BTCKey.alloc.initWithWIF(@private_key_2_base58_string)\n\n puts \"Key from WIF public address then private hex\"\n puts key_from_wif.class\n\n puts BTCHexFromData(key_from_wif.compressedPublicKeyAddress.data)\n puts BTCHexFromData(key_from_wif.privateKey)\n puts \"end key form WIF\"\n\n hexPublicKey = BTCHexFromData(key.compressedPublicKey)\n puts \"Derived Public Key hex\"\n puts hexPublicKey\n puts \"end derived Public Key hex--\"\n key\n\n # @publicKeyCompressed = @publicKey.compressedPublicKey\n # @publicKeyUncompressed = @publicKey.uncompressedPublicKey\n #\n #\n #\n # @uncompressed_public_key_result.stringValue = BTCHexFromData(@publicKeyUncompressed)\n # @compressed_public_key_result.stringValue = BTCHexFromData(@publicKeyCompressed)\n #\n # p BTCHexFromData(@publicKeyCompressed)\n # p BTCHexFromData(@publicKeyUncompressed)\n #\n # p @publicKey.uncompressedPublicKeyAddress\n\n end", "title": "" }, { "docid": "698f3faef48a7a5793aad2a571e3a7e8", "score": "0.5639417", "text": "def key_path; end", "title": "" }, { "docid": "06b6edb14a34ee17759d9ccce56c685f", "score": "0.5634288", "text": "def get_key(key)\nend", "title": "" }, { "docid": "06b6edb14a34ee17759d9ccce56c685f", "score": "0.5634288", "text": "def get_key(key)\nend", "title": "" }, { "docid": "46d411597cb9f516f1898b4b4962652d", "score": "0.5624636", "text": "def key=(p0) end", "title": "" }, { "docid": "46d411597cb9f516f1898b4b4962652d", "score": "0.5624636", "text": "def key=(p0) end", "title": "" }, { "docid": "3510a554974a158433a304c45247524a", "score": "0.56193286", "text": "def pkey_plab\n Kernel.raise NotImplementedError\n end", "title": "" }, { "docid": "18c457ab70764b8e70935ca80d2555c3", "score": "0.561757", "text": "def check_key_algo(leaf_text)\n print \"Checking Key and Algorithm... \" if $verbose\n\n key_algo = leaf_text.match(/Public Key Algorithm: (.*?)$/m)[1]\n\n case key_algo\n when \"rsaEncryption\"\n rsa_keybits=number_or_nil(leaf_text.match(/RSA Public Key: \\((\\d+) bit\\)/m)[1])\n if rsa_keybits < 2048\n puts \"RSA Public Key size #{rsa_keybits} < required minimum (2048)\" if not $quiet\n return false\n else\n puts \"RSA Public Key with #{rsa_keybits} bits OK!\" if not $quiet\n end\n \n when /id-ecPublicKey/\n asn1oid=leaf_text.match(/ASN1 OID: (.+?)$/m)[1]\n if not $acceptable_ecc_curves.include?(asn1oid)\n puts \"ECC Curve Bits #{asn1oid} not considered strong enough.\" if not $quiet\n return false\n end\n puts \"ECC Key algorithm #{key_algo} with curve #{asn1oid} OK!\" if not $quiet\n\n when /\\w+/\n puts \"Unknown key algorithm #{key_algo}\" if not $quiet\n return false\n\n else\n puts \"Error: Could not determine key algorithm\" if not $quiet\n puts \"Certificate info: >>>>>>>\\n#{leaf_text}\\n<<<<<<<<\" if $verbose\n return false\n end\n \n return true\nend", "title": "" }, { "docid": "3d4d43015ad8efe1fc2ef9111baba743", "score": "0.56113917", "text": "def generate_key(*args); end", "title": "" }, { "docid": "c2b93f727d897d580c24393ccc912e32", "score": "0.5607386", "text": "def check_key_valid; end", "title": "" }, { "docid": "51b3cee0cf379e864a0b5f98faa386f4", "score": "0.5605987", "text": "def consumer_pubkey=(_arg0); end", "title": "" }, { "docid": "ed7b45d4b20a569ed42322b485bff7e7", "score": "0.5604238", "text": "def coders_by_oid; end", "title": "" }, { "docid": "ed7b45d4b20a569ed42322b485bff7e7", "score": "0.5604238", "text": "def coders_by_oid; end", "title": "" }, { "docid": "f423316e31d7ec22c337150eab172056", "score": "0.5603332", "text": "def primary_key=(_arg0); end", "title": "" }, { "docid": "f423316e31d7ec22c337150eab172056", "score": "0.5603332", "text": "def primary_key=(_arg0); end", "title": "" }, { "docid": "485e3919880df22abda421ebae60fd9a", "score": "0.56024253", "text": "def check_private_key(p0) end", "title": "" } ]
e019e881800069b94a3d847dbc954721
Gets the NotOnOrAfter Condition Element value.
[ { "docid": "be55b91b717abfb77757030fc2a7359d", "score": "0.67555165", "text": "def not_on_or_after\n @not_on_or_after ||= parse_time(conditions, \"NotOnOrAfter\")\n end", "title": "" } ]
[ { "docid": "184c0173bd531a1c7fd0c9af81ec20df", "score": "0.6411609", "text": "def not_after\n return @not_after\n end", "title": "" }, { "docid": "453817aa60838e770ad3d4d535cb5fb9", "score": "0.63126975", "text": "def not_after=(value)\n @not_after = value\n end", "title": "" }, { "docid": "5e497492356cfd118a30518d98c8a605", "score": "0.5535251", "text": "def condition\n node_parts[0]\n end", "title": "" }, { "docid": "95ac1de55a695b324a09baeb6b8d6def", "score": "0.5278933", "text": "def actual_condition\n return apparent if apparent == AFFLUENCE\n actual = apparent\n self.class.custom_conditions.each do |item|\n if send(item.message)\n actual = item.condition\n break\n end\n end\n\n actual\n end", "title": "" }, { "docid": "4308a8e5747dfc18ada2a2d1c20e8b60", "score": "0.52395105", "text": "def get_condition\n @condition\n end", "title": "" }, { "docid": "93c3ce8f7435ffb4a0ed092a80f2ffec", "score": "0.5115648", "text": "def value_from_element(element)\n element.attributes[\"value\"].try(:value) || \"on\"\n end", "title": "" }, { "docid": "98b5736483519fcd47ec9eb6c2576e64", "score": "0.5102752", "text": "def not_before\n @not_before ||= parse_time(conditions, \"NotBefore\")\n end", "title": "" }, { "docid": "98b5736483519fcd47ec9eb6c2576e64", "score": "0.5102752", "text": "def not_before\n @not_before ||= parse_time(conditions, \"NotBefore\")\n end", "title": "" }, { "docid": "aaded800b3c2029b71f8b285649721d2", "score": "0.5065269", "text": "def condition_with_formatting\n Constants::CONDITION[self.condition_id - 1][0]\n end", "title": "" }, { "docid": "e9e9f8d0c39a6a8abb33f10b45cacd9d", "score": "0.5036727", "text": "def final_condition\n if before_or_after == :after\n <<~SQL\n OR (#{table_condition(order_list.first, nil, 'is_null').to_sql})\n SQL\n end\n end", "title": "" }, { "docid": "d9b79ade1787918dc703ba227fc7ed0d", "score": "0.50182533", "text": "def to_s\n if @expression.is_a? Nagios::MkLiveStatus::Wait::Negate\n return @expression.get_expression.to_s\n else\n negate_arr = []\n negate_arr.push @expression.to_s\n negate_arr.push \"WaitConditionNegate: \"\n return negate_arr.join(\"\\n\")\n end\n end", "title": "" }, { "docid": "b6a06ab130fff53eeeab86edd0254a20", "score": "0.4979758", "text": "def not_after\n time_str = @doc.xpath('//certificate/not-valid-after').first.content\n Time.parse(time_str)\n end", "title": "" }, { "docid": "c9860b05d97c1a7c9abc29177de9660a", "score": "0.49615985", "text": "def condition\n @condition\n end", "title": "" }, { "docid": "f7d6974afb4fc64f6899e1cfe82eaff2", "score": "0.49326822", "text": "def condition_not\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 198 )\n return_value = ConditionNotReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n condition_not_start_index = @input.index\n\n root_0 = nil\n string_literal1070 = nil\n condition_expr1071 = nil\n condition_expr1072 = nil\n\n tree_for_string_literal1070 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n # at line 1036:2: ( 'NOT' condition_expr | condition_expr )\n alt_280 = 2\n look_280_0 = @input.peek( 1 )\n\n if ( look_280_0 == T__57 )\n alt_280 = 1\n elsif ( look_280_0 == LPAREN || look_280_0.between?( PLUS, QUOTED_STRING ) || look_280_0.between?( ID, DOUBLEQUOTED_STRING ) || look_280_0 == T__58 || look_280_0 == T__100 || look_280_0.between?( T__110, T__111 ) || look_280_0.between?( T__116, T__117 ) || look_280_0.between?( T__140, T__142 ) || look_280_0 == T__144 || look_280_0 == T__146 )\n alt_280 = 2\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 280, 0 )\n end\n case alt_280\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1036:4: 'NOT' condition_expr\n string_literal1070 = match( T__57, TOKENS_FOLLOWING_T__57_IN_condition_not_6494 )\n if @state.backtracking == 0\n\n tree_for_string_literal1070 = @adaptor.create_with_payload( string_literal1070 )\n @adaptor.add_child( root_0, tree_for_string_literal1070 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_condition_expr_IN_condition_not_6496 )\n condition_expr1071 = condition_expr\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_expr1071.tree )\n end\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1037:4: condition_expr\n @state.following.push( TOKENS_FOLLOWING_condition_expr_IN_condition_not_6501 )\n condition_expr1072 = condition_expr\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, condition_expr1072.tree )\n end\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 198 )\n memoize( __method__, condition_not_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end", "title": "" }, { "docid": "8ba0ed6512dc85a92171022f00280f3e", "score": "0.48950553", "text": "def value_condition\n value.present?\n end", "title": "" }, { "docid": "640a7530fc0e65607ad2f7e03f0dfddc", "score": "0.48762435", "text": "def ne(value)\n set_operator_and_value(:ne, value)\n end", "title": "" }, { "docid": "71ae56f3e8d0aa69fe9434f5d28774ba", "score": "0.48224396", "text": "def get_condition_string\n @value = @condition_hash[@condition]\n end", "title": "" }, { "docid": "d74af8a6ecf0cd82591b0b1bad75cc74", "score": "0.48151174", "text": "def condition\n if :if == self.type\n self.children[0]\n else\n raise Synvert::Core::MethodNotSupported.new \"condition is not handled for #{self.debug_info}\"\n end\n end", "title": "" }, { "docid": "12e0c0a0f8ecfdeafdaf6dbad67e43f3", "score": "0.48096532", "text": "def operator_string\n \"not\"\n end", "title": "" }, { "docid": "81e597f7bddd305eca4501f4b38af56a", "score": "0.4799526", "text": "def final_condition\n if before_or_after == :before\n <<~SQL\n OR (#{table_condition(order_list.first, nil, 'is_not_null').to_sql})\n SQL\n end\n end", "title": "" }, { "docid": "04ecd7ae6bd01f124a63cf53358277f8", "score": "0.47833422", "text": "def condition_name\n self.class.condition_name\n end", "title": "" }, { "docid": "18763280a9e5ef1c604070ae58b13a40", "score": "0.47643173", "text": "def condition\n return nil unless properties.has_key?('Con')\n properties['Con'].to_f\n end", "title": "" }, { "docid": "c5998cff73386b95d61ea53738cf7d0f", "score": "0.47481626", "text": "def condition\n @hash[\"condition\"]\n end", "title": "" }, { "docid": "c4290263cdf15f54d4d27ed8a2baacbe", "score": "0.47346064", "text": "def unless_condition\n @options[:unless_condition]\n end", "title": "" }, { "docid": "891ff219a2fbb50ba94a72b915effb1f", "score": "0.47309557", "text": "def condition\n\t\t\t@condition\n\t\tend", "title": "" }, { "docid": "f84c3d049ffa9c1698a33ec2e3f4dfe5", "score": "0.47187042", "text": "def not_eq(value)\n SqlCondition.new(column: to_s, comparison: '<>', value: value)\n end", "title": "" }, { "docid": "2a99c883ea5994e7236af90775a6e83a", "score": "0.4698226", "text": "def property_element_unless(condition, options={}, &proc)\n property_element(options, &proc) unless condition\n end", "title": "" }, { "docid": "1c2cc123ebecd6fedbdcf8b260dd648f", "score": "0.46727937", "text": "def conditions\n get_data_elements('condition')\n end", "title": "" }, { "docid": "8f16f22e15c3a84b07d789bb445b2aad", "score": "0.46673608", "text": "def condition_text\n is_condition ? '已知条件共性' : nil\n end", "title": "" }, { "docid": "eb34ebd639068756d38380f8ec096507", "score": "0.4656756", "text": "def not_before\n return @not_before\n end", "title": "" }, { "docid": "8ee9a3c0eda9ed897f59d4d161b81998", "score": "0.46450064", "text": "def condition\n @condition ||=\n Rails.configuration.try(:base_product_condition) || @product.property('condition') || 'new'\n raise SchemaError.new(\"condition\", @product) unless @condition.present?\n @condition\n end", "title": "" }, { "docid": "2b835a7d65caed2d298203c066698caa", "score": "0.4639155", "text": "def condition\n if :if == self.type\n self.children[0]\n else\n raise Synvert::MethodNotSupported.new \"condition is not handled for #{self.inspect}\"\n end\n end", "title": "" }, { "docid": "9ec3aa87330669812c5794ee4cc6a291", "score": "0.46229845", "text": "def parse_not_expression\n parse_not\n expression = parse_boolean_expression\n AST::Not.new(expression)\n end", "title": "" }, { "docid": "89703d5e9e0aff5174ab12484aa9ac78", "score": "0.4593922", "text": "def not_equal_to value\n @items.with_filter(attribute, \"NE\", value)\n end", "title": "" }, { "docid": "db04e901e0e7a7b07d6e2f13df980303", "score": "0.45737", "text": "def comparison_value\n return @comparison_value\n end", "title": "" }, { "docid": "db04e901e0e7a7b07d6e2f13df980303", "score": "0.45737", "text": "def comparison_value\n return @comparison_value\n end", "title": "" }, { "docid": "57ae39ee501d3391a79bc101a453e68a", "score": "0.4481448", "text": "def to_s\n return while_string(@condition)\n end", "title": "" }, { "docid": "9ed72aa0a39592e46956aca8550632a5", "score": "0.44751814", "text": "def value\n @value ||= begin\n extracted_value = @values.detect(&:precondition?)\n\n if extracted_value.nil?\n raise SerializerError,\n \"unknown attribute '#{@values[0].extraction_key}'\"\n end\n\n extracted_value.value\n end\n end", "title": "" }, { "docid": "5d032a8d795dd1959e600c3626975704", "score": "0.44562325", "text": "def not_operator\n case @operator\n when :le\n :gt\n when :gt\n :le\n when :lt\n :ge\n when :eq\n :ne\n else\n raise \"no implemented #{@operator}\"\n end\n end", "title": "" }, { "docid": "a7fffb3bd7fb9cf4aa6a04684351f85d", "score": "0.44487533", "text": "def notification\n return @children['notification'][:value]\n end", "title": "" }, { "docid": "b9a0f4064624aadc8f22fd08f122f259", "score": "0.44333005", "text": "def visit_Squeel_Nodes_Not(o, parent)\n Arel::Nodes::Not.new(visit(o.expr, parent))\n end", "title": "" }, { "docid": "d955f8b072d44ddeabfc858014adcc80", "score": "0.44301847", "text": "def not_is ( cond )\n self.not( cond )\n end", "title": "" }, { "docid": "a3707f8d2b4671a085e09f68de3957d7", "score": "0.4429433", "text": "def visit_Arel_Nodes_Not o\n case o.expr\n when Arel::Nodes::Between\n c = o.expr\n l, r = visit(c.left), Range.new(c.right.children.first, c.right.children.last)\n # FIXME: 'not_in?' does not actually exist\n ProcWithSourceForCondition.new(\"#{l}.not_in? #{r.inspect}\") { |o| !o.send(l).in?(r) }\n else\n raise NotImplementedError, 'general Arel::Nodes::Not not implemented'\n end\n end", "title": "" }, { "docid": "7bc2f8dc16e4ccbc216d1a6b8ead8b69", "score": "0.4405909", "text": "def condition_between\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 214 )\n return_value = ConditionBetweenReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n condition_between_start_index = @input.index\n\n root_0 = nil\n string_literal1199 = nil\n string_literal1200 = nil\n string_literal1202 = nil\n sql_expression1198 = nil\n sql_expression1201 = nil\n sql_expression1203 = nil\n\n tree_for_string_literal1199 = nil\n tree_for_string_literal1200 = nil\n tree_for_string_literal1202 = nil\n\n success = false # flag used for memoization\n\n begin\n # rule memoization\n if @state.backtracking > 0 and already_parsed_rule?( __method__ )\n success = true\n return return_value\n end\n root_0 = @adaptor.create_flat_list\n\n\n # at line 1105:4: sql_expression ( 'NOT' )? 'BETWEEN' sql_expression 'AND' sql_expression\n @state.following.push( TOKENS_FOLLOWING_sql_expression_IN_condition_between_7169 )\n sql_expression1198 = sql_expression\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, sql_expression1198.tree )\n end\n # at line 1105:19: ( 'NOT' )?\n alt_314 = 2\n look_314_0 = @input.peek( 1 )\n\n if ( look_314_0 == T__57 )\n alt_314 = 1\n end\n case alt_314\n when 1\n # at line 1105:21: 'NOT'\n string_literal1199 = match( T__57, TOKENS_FOLLOWING_T__57_IN_condition_between_7173 )\n if @state.backtracking == 0\n\n tree_for_string_literal1199 = @adaptor.create_with_payload( string_literal1199 )\n @adaptor.add_child( root_0, tree_for_string_literal1199 )\n\n end\n\n end\n string_literal1200 = match( T__139, TOKENS_FOLLOWING_T__139_IN_condition_between_7178 )\n if @state.backtracking == 0\n\n tree_for_string_literal1200 = @adaptor.create_with_payload( string_literal1200 )\n @adaptor.add_child( root_0, tree_for_string_literal1200 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_sql_expression_IN_condition_between_7180 )\n sql_expression1201 = sql_expression\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, sql_expression1201.tree )\n end\n string_literal1202 = match( T__138, TOKENS_FOLLOWING_T__138_IN_condition_between_7182 )\n if @state.backtracking == 0\n\n tree_for_string_literal1202 = @adaptor.create_with_payload( string_literal1202 )\n @adaptor.add_child( root_0, tree_for_string_literal1202 )\n\n end\n @state.following.push( TOKENS_FOLLOWING_sql_expression_IN_condition_between_7184 )\n sql_expression1203 = sql_expression\n @state.following.pop\n if @state.backtracking == 0\n @adaptor.add_child( root_0, sql_expression1203.tree )\n end\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n if @state.backtracking == 0\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n end\n success = true\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 214 )\n memoize( __method__, condition_between_start_index, success ) if @state.backtracking > 0\n\n end\n \n return return_value\n end", "title": "" }, { "docid": "eb832a19da2f46c1f963a77945e10fc7", "score": "0.4405536", "text": "def ne(criterion)\n if criterion.nil?\n raise Errors::CriteriaArgumentRequired, :ne\n end\n\n and_with_operator(criterion, \"$ne\")\n end", "title": "" }, { "docid": "c473e3b393685cd9f0cd27028f9e27e0", "score": "0.44032747", "text": "def value\n not @exprs.map{|e| e.value === false}.inject(:|)\n end", "title": "" }, { "docid": "cc62434c47d9f0da354470015035f712", "score": "0.44011885", "text": "def not\n Nodes::Not.new self\n end", "title": "" }, { "docid": "cc62434c47d9f0da354470015035f712", "score": "0.44011885", "text": "def not\n Nodes::Not.new self\n end", "title": "" }, { "docid": "c9561fa4c25e1518fb1b875a3f89070e", "score": "0.4397314", "text": "def default_condition_key\n condition_options.first.last\n end", "title": "" }, { "docid": "28378504da8024a9fe3b3116f298f2a0", "score": "0.4378257", "text": "def value_condition\n value.present? && value > 0.01\n end", "title": "" }, { "docid": "a7beb22858e9b691165e8a105af6a0c9", "score": "0.43702528", "text": "def gt(value)\n SqlCondition.new(column: to_s, comparison: '>', value: value)\n end", "title": "" }, { "docid": "4513bf325816cb94d8c78e40162bf7d6", "score": "0.43660837", "text": "def final_value\n @values.find { |v| v.final? }.value\n end", "title": "" }, { "docid": "7731e8bafef6729a392de3f959e0ff11", "score": "0.4360271", "text": "def raw_amount_off\n amount_off = @invoice[:discount][:coupon][:amount_off]\n\n amount_off || 0\n end", "title": "" }, { "docid": "1e166c17951d490f8959a8999213e45b", "score": "0.4352875", "text": "def not_before=(value)\n @not_before = value\n end", "title": "" }, { "docid": "d6beaa8c34e5594d7d937a97eb6433c2", "score": "0.43498972", "text": "def ne(attribute, value)\n new(:ne, attribute, value)\n end", "title": "" }, { "docid": "84d0d4348200a990d5f01f951d58ad21", "score": "0.4330287", "text": "def condition_string(starts_at_attr, ends_at_attr)\n except_option = Array(options[:exclude_edges]).map(&:to_s)\n starts_at_sign = except_option.include?(starts_at_attr.split(\".\").last) ? \"<\" : \"<=\" \n ends_at_sign = except_option.include?(ends_at_attr.split(\".\").last) ? \">\" : \">=\"\n \"#{ends_at_attr} #{ends_at_sign} :starts_at_value AND #{starts_at_attr} #{starts_at_sign} :ends_at_value\"\n end", "title": "" }, { "docid": "65cbaa8efd10f3089a8d10ff6f390851", "score": "0.43294895", "text": "def false_condition\n using_unextended_sqlite? ? 0 : \"false\"\n end", "title": "" }, { "docid": "6d3605939ba8a6323a427bb65c51f6f3", "score": "0.43293864", "text": "def process_not(exp)\n Operator::Logical::Not.new(process(exp.shift))\n end", "title": "" }, { "docid": "5f3caf103e5e50829f806d0baed3c62c", "score": "0.43288016", "text": "def last\n @tail.prev_node.value\n end", "title": "" }, { "docid": "65bd03d405755f2a063a2d2b44de3735", "score": "0.43275085", "text": "def condition_type()\n return \"direct\"\n #return \"indirect\"\n end", "title": "" }, { "docid": "b038eb6f63f5ccd714015f35bb102624", "score": "0.43252018", "text": "def get_value_outflow\n value ? value : 'N/A'\n end", "title": "" }, { "docid": "610553218db1370fe657561c0cc4d0af", "score": "0.4313605", "text": "def xp_not(expr)\n return \"not(#{expr})\"\n end", "title": "" }, { "docid": "b968d650a4982cdbcf7804cff4d1b9d2", "score": "0.43004405", "text": "def is_not_equal(value)\n value.nil? ? where('IS NOT ?', value) : where('<> ?', value)\n end", "title": "" }, { "docid": "8c7c60c7211b39396b3ee435bbac73d2", "score": "0.42980954", "text": "def nagmk_wait_condition(name, comparator, value)\n Nagios::MkLiveStatus::Wait::Attr.new(name, comparator, value)\n end", "title": "" }, { "docid": "850f0c3053e05164cccf073c86b2f73f", "score": "0.4283461", "text": "def compose_not_ends_with_node(node, value)\n compose_ends_with_node(node, value).not\n end", "title": "" }, { "docid": "c434ca0627cbda9b68cd92b7230e7a2f", "score": "0.427536", "text": "def arel_not(value)\n named_function(:not, value)\n end", "title": "" }, { "docid": "396410902bf3410212bee858dbcbdd10", "score": "0.42753252", "text": "def operator_c_string\n \"!=\"\n end", "title": "" }, { "docid": "396410902bf3410212bee858dbcbdd10", "score": "0.42753252", "text": "def operator_c_string\n \"!=\"\n end", "title": "" }, { "docid": "2aeaaa04b5d6b09341352c384dccb6d8", "score": "0.4271814", "text": "def until_time\n @until\n end", "title": "" }, { "docid": "013a4e5eea38ed6d615a8a2d452abcec", "score": "0.42690817", "text": "def process_not_operator_expression(expression)\n @expression.left = process_expression_item(expression[0])\n @expression.operator = 'NOT'\n end", "title": "" }, { "docid": "d9309ea65f101a7fc09e232e06fd5cee", "score": "0.42671242", "text": "def handling_reminder_after\n if handling_duration > self.class.handling_period_reminder_abbrev_threshold\n handling_duration - self.class.handling_period_full_reminder_window\n elsif handling_duration > self.class.handling_period_reminder_none_threshold\n handling_duration - self.class.handling_period_abbrev_reminder_window\n else\n nil\n end\n end", "title": "" }, { "docid": "7a6d991a1f5850ecd683fdb7d5e256d5", "score": "0.4266185", "text": "def to_s\n \"(NOT #{child.to_s})\"\n end", "title": "" }, { "docid": "f178fc0d232f1f0852c3f4c1f6cb78c7", "score": "0.42622852", "text": "def value_condition\n value.present? && value < 0.01\n end", "title": "" }, { "docid": "3959fc2ffe683151c59133b622548027", "score": "0.42621765", "text": "def value\n if @has_value\n return @value\n else\n @mutex.synchronize {\n @condvar.wait(@mutex, @timeout)\n return @value\n }\n end\n end", "title": "" }, { "docid": "1193ef3034572d8a94fb81d489798314", "score": "0.42580324", "text": "def get_out_val\n self.attrs[:value]\n end", "title": "" }, { "docid": "1193ef3034572d8a94fb81d489798314", "score": "0.42580324", "text": "def get_out_val\n self.attrs[:value]\n end", "title": "" }, { "docid": "9d630f29bba9aec38a9b22454989dc2e", "score": "0.42457488", "text": "def unless(condition)\n @unless_conditions[@states.length - 1] = condition\n self\n end", "title": "" }, { "docid": "52e05219f53b5f0347ed6071a3e2b78a", "score": "0.4237983", "text": "def value\n not @exprs.map{|e| e.value === false}.inject(:&)\n end", "title": "" }, { "docid": "982765453810cc9394cb1fa81de21a82", "score": "0.42360136", "text": "def false_node\n if :if == node_type\n self[3]\n end\n end", "title": "" }, { "docid": "d9568159d69ece6eeaa5691d98af9763", "score": "0.4232808", "text": "def until_time\n metadata.until_time if metadata\n end", "title": "" }, { "docid": "ca198cb0074495bb7e0149eeb1d92164", "score": "0.42302132", "text": "def pull_condition\n condition\n end", "title": "" }, { "docid": "f188ce0bd0c75b786bd64b82c29d3662", "score": "0.42293698", "text": "def sql_is_or_equal(value)\n value.nil? ? \"IS\" : \"=\"\n end", "title": "" }, { "docid": "b2dae56a0d674b12bbbdc33a5291d0e5", "score": "0.42284524", "text": "def retry_value\n v = @after.presence\n v.is_a?(Time) ? v.gmtime.strftime('%a, %d %b %Y %H:%M:%S GMT') : v&.to_s\n end", "title": "" }, { "docid": "c5222dce6fd4933102adc96896ec96f5", "score": "0.42281544", "text": "def value_condition\n value.present? && value < 110\n end", "title": "" }, { "docid": "b5bf6fe42eb685d6dcd3ce43c2d52122", "score": "0.42269507", "text": "def condition_scope\n promo_config[:condition_scope]\n end", "title": "" }, { "docid": "e4def9ea5783c2767081868b481a3004", "score": "0.42148736", "text": "def skip_until(cond)\n new_rule(:skip_until, nil, cond)\n end", "title": "" }, { "docid": "98e006c5d884a3d5f0594a56f7690327", "score": "0.42141816", "text": "def conditions\n conditions = @doc.find_first('//saml2:Conditions')\n audience = conditions.find_first('.//saml2:Audience')\n {\n :after => Time.parse(conditions['NotBefore']),\n :before => Time.parse(conditions['NotOnOrAfter']),\n :audience => audience.content\n }\n end", "title": "" }, { "docid": "85acaa94b64f3f91bc1756ce23e5c34c", "score": "0.4211681", "text": "def will_save_wait_until\n attributes.fetch(:willSaveWaitUntil)\n end", "title": "" }, { "docid": "85acaa94b64f3f91bc1756ce23e5c34c", "score": "0.4211681", "text": "def will_save_wait_until\n attributes.fetch(:willSaveWaitUntil)\n end", "title": "" }, { "docid": "806859d435f5d6847dff4b39867739b8", "score": "0.41978222", "text": "def not_before_time\n Time.now.to_i - configuration.not_before_time\n end", "title": "" }, { "docid": "ca4d093e9626ac7a4c9e1f871596f83e", "score": "0.41953516", "text": "def bxn\n (enabled? && right?) ? xn - 1 : xn\n end", "title": "" }, { "docid": "ca4d093e9626ac7a4c9e1f871596f83e", "score": "0.41953516", "text": "def bxn\n (enabled? && right?) ? xn - 1 : xn\n end", "title": "" }, { "docid": "7add4b9551575d3819c96f68ec489fdf", "score": "0.41941124", "text": "def expected\n @expected ||= get_meta_attribute('expected')\n end", "title": "" }, { "docid": "1a737c1eec36c8a0f8589920758fad69", "score": "0.41933793", "text": "def compose_not_ends_with_node(node, value)\n compose_ends_with_node(node, value).not\n end", "title": "" }, { "docid": "c92191f5fff56b1f29feb5b01511ae71", "score": "0.4186495", "text": "def delay_node\n xpath('//xmlns:delay',{'xmlns' => EM::Xmpp::Namespaces::Delay}).first\n end", "title": "" }, { "docid": "8cc8381841c56b531110691ee6046379", "score": "0.4184563", "text": "def value\n @xml_element.attributes['value']\n end", "title": "" }, { "docid": "b5aea959cb4de8908039cfdc1607b2f4", "score": "0.41840526", "text": "def closed_at\n read_attribute(:closed_at) || nil\n end", "title": "" }, { "docid": "a617430ee36b61935c147f7cc1c87050", "score": "0.4182721", "text": "def greater_than_or_equal(attr, value)\n @conditions << Conditions::GreaterThanOrEqual.new(attr, value)\n end", "title": "" }, { "docid": "9ff5962c5797ecf1e60c3805839c641d", "score": "0.41717345", "text": "def value_after(val)\n if i = index(val) and i < length - 1\n self[i+1]\n else\n nil\n end\n end", "title": "" } ]
649f40fdb8357a4e343d887ff74e2f11
Complete the pageCount function below.
[ { "docid": "97b09dabbc360be67ae8a3e3432f83c6", "score": "0.0", "text": "def pageCount(total_pages, goal_page)\n #\n # Write your code here.\n #\n half_of_the_book = (total_pages / 2).to_i\n total_swaps = 0\n if goal_page <= half_of_the_book\n i = 2\n while i <= goal_page\n total_swaps += 1 if i % 2 == 0\n i += 1\n end\n else\n i = total_pages - 1\n while i >= goal_page\n total_swaps += 1 unless i % 2 == 0\n i -= 1\n end\n end\n total_swaps\nend", "title": "" } ]
[ { "docid": "aba10d6eb738add18ce94f464b9b6e40", "score": "0.72508997", "text": "def count_pages\n page_iterator.count.to_i\n end", "title": "" }, { "docid": "4d1e78d89a260065a4f2da41bb5add00", "score": "0.7175977", "text": "def page_count ; @pager.page_count ; end", "title": "" }, { "docid": "2a3472565166a70b03a34b9829daec82", "score": "0.7021533", "text": "def page_count\r\n @pages_collection.count\r\n end", "title": "" }, { "docid": "70ca8f1d2cdb59764cc32d394d1b5791", "score": "0.69921184", "text": "def count\n pagination.total_count\n end", "title": "" }, { "docid": "5ab561e4e3b007377c8ea00d6f88c5d1", "score": "0.69899386", "text": "def page_count\n total_pages\n end", "title": "" }, { "docid": "25bdaceda48119249ca66b81d37dbf42", "score": "0.69816434", "text": "def count_pages_read\n @page_count_this_year = @books.finished_this_year_and_has_pages.sum('number_of_pages')\n @page_count_overall = @books.finished_and_has_pages.sum('number_of_pages')\n end", "title": "" }, { "docid": "6b465378bc3f8871e4a5c1fa3b38f530", "score": "0.6951367", "text": "def count_full_pages\n\t\tcount_items / items_per_page\n\tend", "title": "" }, { "docid": "502b4c0ec69538dadbecb6f3e06900c5", "score": "0.694455", "text": "def page_count\r\n @total_pages\r\n end", "title": "" }, { "docid": "52187b627b1f2d2411fdb96377f50a1b", "score": "0.690662", "text": "def page_count\n @page_count\n end", "title": "" }, { "docid": "322a75b4454f2c0ac4ca8297d91d3c52", "score": "0.68746316", "text": "def number_of_pages\n self[:count]\n end", "title": "" }, { "docid": "50741af3fcfa1139660fa80854e498fa", "score": "0.687139", "text": "def count\n\t\t\t@pagination['count']\n\t\tend", "title": "" }, { "docid": "318454f41483843e3a9773bff6a9ad26", "score": "0.6832677", "text": "def page_count\n content_pages.count + 1\n end", "title": "" }, { "docid": "67425976dbd45bc551291ed4849d51cb", "score": "0.68274224", "text": "def page_count\n @page_count\n end", "title": "" }, { "docid": "3760aecf106236d72dc56e44c2a4eab3", "score": "0.6815589", "text": "def page_count\n @pages.length\n end", "title": "" }, { "docid": "3760aecf106236d72dc56e44c2a4eab3", "score": "0.6815589", "text": "def page_count\n @pages.length\n end", "title": "" }, { "docid": "58cbde26a62ee9eb3e993c6df6b4379e", "score": "0.6812675", "text": "def page_count\n @collection_of_pages.length\n end", "title": "" }, { "docid": "bc0a5e7db2b0bc17b081bebc873fdc6d", "score": "0.6802603", "text": "def count_pages\n\t\tfull_pages = count_full_pages\n\t\tif full_pages * items_per_page < count_items\n\t\t\treturn full_pages + 1\n\t\telse\n\t\t\treturn full_pages\n\t\tend\n\tend", "title": "" }, { "docid": "558aeb10ad83feebcdbb568cbb880187", "score": "0.67697626", "text": "def page_count\n return @page_count\n end", "title": "" }, { "docid": "6b4c82f676a154b5b6d82890459bc09b", "score": "0.67345804", "text": "def pages_count\n instance_read(:pages_count)\n end", "title": "" }, { "docid": "48ea5e7794026aa8e0b76d7ae2d6f1c1", "score": "0.67139256", "text": "def count\n return @page_count if @page_count\n base_count = page_data.count.fdiv(limit).ceil\n # there cannot be less than 1 page\n @page_count = base_count < 1 ? 1 : base_count\n end", "title": "" }, { "docid": "52bb687de6df7f782156a361157f04b7", "score": "0.67091507", "text": "def page_count=(value)\n @page_count = value\n end", "title": "" }, { "docid": "9e70f6bf7dcb8c38a76ea6dda838192e", "score": "0.66912264", "text": "def page_count\n count = @query_result_count / @results_per_page\n count += 1 if (@query_result_count % @results_per_page) > 0\n return count\n end", "title": "" }, { "docid": "2444eef8af72ef13557b2857dce0e211", "score": "0.66812086", "text": "def fetch_page_count\n page_count_file_path = \"#{@job.id}/page_count/#{@job.id}.txt\"\n puts \"Looking for file: #{page_count_file_path}\"\n page_count_data = DfileApi.download_file(source_file: \"PACKAGING:/#{page_count_file_path}\").read\n @page_count = page_count_data.to_i\n if @page_count == 0\n error = {}\n error[:code] = \"PAGE_COUNT_ERROR\"\n error[:msg] = \"Page count is 0\"\n @errors << error\n end\n puts \"Page count: #{@page_count}\"\n end", "title": "" }, { "docid": "e2e1cdc020a5502d99454c4cbd753044", "score": "0.6678062", "text": "def load_adverts_pages_count\n\n puts ''\n puts \"getting pages count..\"\n\n # get page data as JSON\n jsonData = JSON.parse open(getSearchUrl).read()\n puts 'done'\n\n (jsonData['result']['search_result']['count'] / jsonData['result']['additional']['search_params']['all']['countpage']).ceil\n end", "title": "" }, { "docid": "87e12b797d6448bf712f5a60ab774d4f", "score": "0.66737264", "text": "def page_count\n if @count\n (@count.to_f / @q[:paging][:per_page]).ceil\n end\n end", "title": "" }, { "docid": "e7050701877f58a8439810b2a173bcdc", "score": "0.6658395", "text": "def count_pages\n if @limit > @count\n return 1\n end\n if @count % @limit != 0\n return @count / @limit + 1\n else\n return @count/@limit\n end\n end", "title": "" }, { "docid": "e7050701877f58a8439810b2a173bcdc", "score": "0.6658395", "text": "def count_pages\n if @limit > @count\n return 1\n end\n if @count % @limit != 0\n return @count / @limit + 1\n else\n return @count/@limit\n end\n end", "title": "" }, { "docid": "a0fc97e69e90e7a75e11f3c1a051df31", "score": "0.6652947", "text": "def page_count\n @collection.size\n end", "title": "" }, { "docid": "b3ea59bc1d4586c409463c3456f25cc4", "score": "0.6648444", "text": "def page_count\n pagination.page_count\n end", "title": "" }, { "docid": "050307d8d5e6fe00eaf28225653096d6", "score": "0.6647857", "text": "def total_pages\n (self.total_count / self.limit) + 1\n end", "title": "" }, { "docid": "f2135aba9917303f99927b05bed6884d", "score": "0.6631273", "text": "def total_pages\n fail NotImplementedError\n end", "title": "" }, { "docid": "d672098b0a6d69b68dd38e434ed8a169", "score": "0.6628807", "text": "def page_count\n (self.item_count.to_f / @ipp ).ceil\n end", "title": "" }, { "docid": "b66bf8f7abd45a72a897445a6f209dad", "score": "0.6625121", "text": "def list_view_page_count\n if go_to_last_page_link?\n wait_for_update_and_click go_to_last_page_link_element\n sleep 1\n wait_until(Utils.medium_wait) { go_to_page_link_elements.any? }\n count = go_to_page_link_elements.last.text.to_i\n go_to_first_page\n count\n elsif go_to_page_link_elements.any?\n go_to_page_link_elements.length\n else\n 1\n end\n end", "title": "" }, { "docid": "515eec491f19c5ecd32821be2dce6ad7", "score": "0.65878916", "text": "def total_pages\n (self.total_count / self.limit) + 1\n end", "title": "" }, { "docid": "6f26f5d73bdb9c98fb554726bbe369e5", "score": "0.65745586", "text": "def show_total_pages\r\n pages = show_total_hits / show_results_per_page\r\n return pages + 1\r\n end", "title": "" }, { "docid": "d379f004efb47be7bea6c04a5840e8a6", "score": "0.6570729", "text": "def page_item_count(page_index)\n return -1 if page_index > @pages.length - 1 \n @pages[page_index].length\n end", "title": "" }, { "docid": "5ee64544e2f350a0b243d2397109b125", "score": "0.6569769", "text": "def page_count\n @chunked_collection.size\n end", "title": "" }, { "docid": "b185b7808e633474d4b9fabd3054868f", "score": "0.65632164", "text": "def page_count=(num)\n @page_count = num\n end", "title": "" }, { "docid": "b98bee816a551cb47b5822980de536ce", "score": "0.6534071", "text": "def page_count\n @opts[:page_count]\n end", "title": "" }, { "docid": "065f3cc0b4fb2e015b0840c29d2a5174", "score": "0.65242946", "text": "def number_of_pages\n (@count / @per_page).to_i + (@count % @per_page > 0 ? 1 : 0)\n end", "title": "" }, { "docid": "065f3cc0b4fb2e015b0840c29d2a5174", "score": "0.65242946", "text": "def number_of_pages\n (@count / @per_page).to_i + (@count % @per_page > 0 ? 1 : 0)\n end", "title": "" }, { "docid": "5f79371454ed6ff26f7ceb8141bf645d", "score": "0.6507769", "text": "def getPageCount\r\n\t\t urlPage = $productURI + '/pdf/' + @name + '/pages'\r\n\t\t\tsignedURL = Common::Utils.sign(urlPage)\r\n\t\t\tcount = Common::Utils.getFieldCount(signedURL,'/SaaSposeResponse/Pages/Page')\r\n\t\t\treturn count \r\n end", "title": "" }, { "docid": "74384af06fcf03d6b0328b7126d466e2", "score": "0.64911646", "text": "def number_of_pages\n (@count / @per_page).to_i + (@count % @per_page > 0 ? 1 : 0)\n end", "title": "" }, { "docid": "982e9ef7679418c53a7e8675b1301c09", "score": "0.6490374", "text": "def page_item_count(page_indexa)\n indexes = (0..page_count).to_a\n \n end", "title": "" }, { "docid": "ac834cb4245f1e4cadde7e9670e9b38f", "score": "0.6484073", "text": "def page_count\n return 1 if @count < @per_page\n return @count / @per_page if @count % @per_page == 0\n return (@count / @per_page )+1 if @count % @per_page > 0\n end", "title": "" }, { "docid": "3cac00e671e5694ad34d9ad5e5186de8", "score": "0.64681256", "text": "def num_pages\n (count.to_f / options[:limit]).ceil\n end", "title": "" }, { "docid": "4034243c7413bf5bfd3b22632987196e", "score": "0.6463531", "text": "def page_item_count(page_index)\n return -1 unless @pages[page_index]\n @pages[page_index].length\n end", "title": "" }, { "docid": "222731cee3a34c6643caeabdad2c67b3", "score": "0.64485997", "text": "def num_pages\n\t\t\t\t(num_results.to_f / batch_size).ceil\n\t\t\tend", "title": "" }, { "docid": "07cd9c6aef4ed72e50cf71cc13ed51f8", "score": "0.64365566", "text": "def page_count\n (count.to_f / @entries_per_page).ceil\n end", "title": "" }, { "docid": "e249c08bbf9f08b7dd47ac46b87d8c10", "score": "0.64355564", "text": "def page_item_count(page_index)\n return -1 if @chunked_collection[page_index].nil?\n @chunked_collection[page_index].size\n end", "title": "" }, { "docid": "17d26a7836a7265e03aaa7e79d6a1d7e", "score": "0.64347184", "text": "def page_count\n page_count ||= (item_count.to_f / @per_page.to_f).ceil\n end", "title": "" }, { "docid": "6a310a4c8afce08577a27a5b7183214b", "score": "0.6418623", "text": "def page_count\n (item_count.to_f / @page_size).ceil\n end", "title": "" }, { "docid": "e81241b30d09c2b062facd32ce8278d6", "score": "0.64149016", "text": "def pages\n num_results_requested < result_count ? (result_count.to_f / num_results_requested).ceil : 1\n end", "title": "" }, { "docid": "147994d2c466aa945ffba9719df18e33", "score": "0.64115316", "text": "def page_count\n total_pages = 0\n if table_bottom.empty?\n total_pages = 1\n else\n table_bottom.detect do |row|\n cell = row.all('tr')\n cell.each do |t|\n if t.text.match '1 of'\n row_text = t.text.split(/[\\s]/)\n total_pages = row_text[3].strip\n break\n else\n puts 'Have not found the pages yet!'\n end\n end\n end\n end\n total_pages.to_i\n end", "title": "" }, { "docid": "631778e21e130ed79953babb8a16d6b3", "score": "0.6405489", "text": "def page_count\n @collection.each_slice(@items_per_page).to_a.length\n end", "title": "" }, { "docid": "a474057d668a4153c9935eafd87a284f", "score": "0.6403132", "text": "def try_to_break_page_count\n get_page_orders(150) \nend", "title": "" }, { "docid": "2b9eeb42c2e054e1b225e1f8fc9c111f", "score": "0.63871235", "text": "def pages\n page_count = 0\n\n # If the document is not rendered yet\n if @pdf.page_count == 0\n sandbox do\n render\n page_count = @pdf.page_count\n end\n else\n page_count = @pdf.page_count\n end\n\n return page_count\n end", "title": "" }, { "docid": "5d6ef0722f0e559c84fa2e8925bdbaed", "score": "0.63637966", "text": "def page_item_count(page_index)\n i = collection[page_index * items_per_page...page_index * items_per_page + items_per_page]\n i ? i.size : -1\n end", "title": "" }, { "docid": "1e6a98bbf0753db3ae5985524c7ceb57", "score": "0.63605595", "text": "def total_pages\n @total_pages ||= full_response[\"TotalPages\"]&&full_response[\"TotalPages\"].to_i\n end", "title": "" }, { "docid": "4045fb30c70b8506afb684f232c69aea", "score": "0.6350553", "text": "def number_of_pages\n (@count / @per_page).to_i + ((@count % @per_page).positive? ? 1 : 0)\n end", "title": "" }, { "docid": "ba9c02db9726fe42d58652b85c94db73", "score": "0.6347921", "text": "def page_count\n return 1 if @item_count.zero?\n (@item_count / @items_per_page.to_f).ceil\n end", "title": "" }, { "docid": "1e942a9d1cfacaf3af228f0b7cedac9b", "score": "0.634604", "text": "def page_item_count(page_index)\n page = @collection_of_pages[page_index]\n page.nil? ? -1 : page.length\n end", "title": "" }, { "docid": "f4440c5ff7d221a1f73cfc9a52703e97", "score": "0.63418454", "text": "def getNumPages()\n return @numpages\n end", "title": "" }, { "docid": "4ea20454208d24fcda93d5206c02ed1f", "score": "0.63390696", "text": "def page_item_count(page_index)\n index = @collection[page_index * items_per_page...page_index * items_per_page + items_per_page]\n index ? index.size : -1\n end", "title": "" }, { "docid": "780fee29f60562e5be043e8d64bc1917", "score": "0.6333722", "text": "def page_count\n result = item_count / @items_per_page\n result += 1 unless (item_count % @items_per_page).eql? 0\n result\n end", "title": "" }, { "docid": "ce2226a8c3350627e53481702d69627d", "score": "0.633147", "text": "def member_page_count\n @member_page_count ||= member_page_count!\n end", "title": "" }, { "docid": "86945c51b3e0d268e6ec81489c0cb99a", "score": "0.6325444", "text": "def total_pages\n total_pages_in(@leaderboard_name)\n end", "title": "" }, { "docid": "e52900d2b7481d11317cfe3a075fe70b", "score": "0.63121855", "text": "def page_count\n (@collection.length.to_f / @items_per_page).ceil\n end", "title": "" }, { "docid": "26120d91a7956169fd3bb4d356414007", "score": "0.6309179", "text": "def page_count\n @layout.pages.length\n end", "title": "" }, { "docid": "9dbe00888bb4f83bcf463b141ba73d4e", "score": "0.6308808", "text": "def page_count\n (item_count.to_f / @items_per_page).ceil\n end", "title": "" }, { "docid": "987535b18d394f34cd2341da9f60c5e5", "score": "0.6308227", "text": "def page_count\n (item_count.to_f / items_per_page).ceil\n end", "title": "" }, { "docid": "344bbd98e6ec3845205d87263420274a", "score": "0.63030255", "text": "def pages\n num = @req_opts[\"num\"]\n self.count && num ? (self.count.to_f/num.to_i).ceil : 1\n end", "title": "" }, { "docid": "3ab617eb08288687ac3b811a56009d89", "score": "0.6293623", "text": "def page_count\n @collection.length.fdiv(@items_per_page).ceil\n end", "title": "" }, { "docid": "f5982f484037de82e34c70e1b45b57af", "score": "0.62724906", "text": "def springboard_page_count(import_client)\n import_client.query(per_page: PER_PAGE).get.body.pages\n end", "title": "" }, { "docid": "f77a88ec0f6a9b9069ebf8bd87bfac89", "score": "0.62611043", "text": "def total_pages\n collection.total_pages\n end", "title": "" }, { "docid": "56cc33c709417e501bdd90c5f497e2bc", "score": "0.6254595", "text": "def calculate_pagination\n @paged_results = @ary.paginate(per_page: @per_page)\n @size = @paged_results.total_entries\n @pages = @paged_results.total_pages\n end", "title": "" }, { "docid": "0c4db41796fffbf75c0823a905144bba", "score": "0.6253658", "text": "def page_item_count(page_index)\n values = @ary[page_index*@ipp, @ipp]\n values ? values.count : -1\n end", "title": "" }, { "docid": "0c79b86e916b43fce06d0cd74f6a0c69", "score": "0.6250533", "text": "def page_count\n number_of_pages = (item_count.fdiv(@items_per_page)).ceil\n end", "title": "" }, { "docid": "d9297838083f91892d45b6c3e77da687", "score": "0.62497085", "text": "def end_paginate! results\n # set the link headers\n link = \"\"\n link += \"<#{@next_page}>; rel=\\\"next\\\"\" unless results.empty? or results.count < @limit\n headers['X-Next-Page'] = @next_page unless results.empty? or results.count < @limit\n if not results.empty? and @page > 1\n link += \", \"\n end\n link += \"<#{@prev_page}>; rel=\\\"prev\\\"\" unless @page == 1\n headers['X-Prev-Page'] = @prev_page unless @page == 1\n headers['Link'] = link\n headers['X-Total-Count'] = @count.to_s\n end", "title": "" }, { "docid": "d9297838083f91892d45b6c3e77da687", "score": "0.62497085", "text": "def end_paginate! results\n # set the link headers\n link = \"\"\n link += \"<#{@next_page}>; rel=\\\"next\\\"\" unless results.empty? or results.count < @limit\n headers['X-Next-Page'] = @next_page unless results.empty? or results.count < @limit\n if not results.empty? and @page > 1\n link += \", \"\n end\n link += \"<#{@prev_page}>; rel=\\\"prev\\\"\" unless @page == 1\n headers['X-Prev-Page'] = @prev_page unless @page == 1\n headers['Link'] = link\n headers['X-Total-Count'] = @count.to_s\n end", "title": "" }, { "docid": "71d2d9f7d07f89d6376437b6424b4b8b", "score": "0.6248115", "text": "def page_count\n (item_count.to_f / items_per_page).ceil\n end", "title": "" }, { "docid": "ae4bad6e963b84e28bf8225eeffb85ef", "score": "0.62444663", "text": "def index_pagination_count(pages)\n 8 * pages\n end", "title": "" }, { "docid": "83d9b04a6ee72dc7c1cc65c27639c921", "score": "0.62380594", "text": "def page_count\n (@collection.count / @items_per_page.to_f).ceil\n end", "title": "" }, { "docid": "817e5496eb5380b4111b8607ec9866d8", "score": "0.62340635", "text": "def end_paginate! results\n # set the link headers\n link = \"\"\n link += \"<#{@next_page}>; rel=\\\"next\\\"\" unless results.empty? or results.count < @limit\n headers['X-Next-Page'] = @next_page unless results.empty? or results.count < @limit\n if not results.empty? and @page > 1\n link += \", \"\n end\n link += \"<#{@prev_page}>; rel=\\\"prev\\\"\" unless @page == 1\n headers['X-Prev-Page'] = @prev_page unless @page == 1\n headers['Link'] = link\n headers['X-Total-Count'] = @collection.count.to_s\n end", "title": "" }, { "docid": "23ff89d05be9a6c6e960f0596d7114ed", "score": "0.62328434", "text": "def find_pages_count(doc)\n elements = doc.search('td[@colspan] a[@href^=\"http://wallpapers-diq.com/wp/\"]:not([@rel])')\n assert(elements.size > 0, \"Unable to find pages count\")\n \n elements.last.inner_text.to_i\n \n # TODO: remove\n 1\n end", "title": "" }, { "docid": "85ecffac603859f3da763dbd9562f5de", "score": "0.62180537", "text": "def pages(item)\n count = item.get_properties.get('Page Count')\n return count unless count.nil?\n\n 1\n end", "title": "" }, { "docid": "3435c070a53c02b159e7f321efee5321", "score": "0.62131196", "text": "def page_count\n @dataset.page_count\n end", "title": "" }, { "docid": "a3cb81a1cc95f0a8970d3a3ab98aec5f", "score": "0.6212487", "text": "def calculate_page_count\n @page_count = count.to_i / limit.to_i\n @page_count.ceil\n end", "title": "" }, { "docid": "bbf09da229ba26bca3ff0d38dc0b72ca", "score": "0.62124", "text": "def num_pages\n (total.to_f / @query.per_page).ceil\n end", "title": "" }, { "docid": "7247cf46b206fbda2fa86b10a91099ed", "score": "0.6210368", "text": "def page_count=(num)\n @page_count = num\nend", "title": "" }, { "docid": "7247cf46b206fbda2fa86b10a91099ed", "score": "0.6210368", "text": "def page_count=(num)\n @page_count = num\nend", "title": "" }, { "docid": "08a11ab254f93711d5bdc86f07993fb9", "score": "0.6208679", "text": "def page_count\n @page_count ||= (empty? or page_size == 0) ? 1 : (q, r = size.divmod(page_size); r == 0 ? q : q + 1)\n end", "title": "" }, { "docid": "8c01fd8de053971ba4e41f0983b86de2", "score": "0.6207412", "text": "def page_count\n (item_count.to_f / items_per_page.to_f).ceil\n end", "title": "" }, { "docid": "2c1656dd7d6ec30daf01f5ed55f92057", "score": "0.6206708", "text": "def page_count\n return (@elements.length.to_f / @size.to_f).ceil # ceil rounds up\n end", "title": "" }, { "docid": "09fc5616a4a1d1f68e7ead8bc8940fe8", "score": "0.62060094", "text": "def page_item_count(page_index)\n index = collection[page_index * items_per_page...page_index * items_per_page + items_per_page]\n index ? index.size : - 1\n end", "title": "" }, { "docid": "143c6183e29a7e3c88ebcb931eeb35e8", "score": "0.62035275", "text": "def page_size\r\n end", "title": "" }, { "docid": "93c378bce256b4ffb7d6e544ee6ed152", "score": "0.6202808", "text": "def page_item_count(page_index)\r\n if !!@pages_collection[page_index]\r\n @pages_collection[page_index].count\r\n else\r\n -1\r\n end\r\n end", "title": "" }, { "docid": "892ff6b5d720f71acc3d6478af435b05", "score": "0.6201202", "text": "def get_page_count\n\t\t url_page = $productURI + '/pdf/' + @name + '/pages'\n\t\t\tsigned_url = Common::Utils.sign(url_page)\n\t\t\tcount = Common::Utils.getFieldCount(signed_url,'/SaaSposeResponse/Pages/Page')\n\t\t\treturn count \n end", "title": "" }, { "docid": "06875754833d02567ddee4c8ba15b811", "score": "0.61996216", "text": "def page_item_count(page_index)\n return -1 if page_count <= page_index\n\n @collection.each_slice(@items_per_page).to_a[page_index].length\n end", "title": "" }, { "docid": "94786671da21085b786bd784b7fc554c", "score": "0.6198517", "text": "def page_item_count(page_index)\n page = @layout.pages[page_index]\n return -1 unless page && page_index >= 0\n page.items.length\n end", "title": "" }, { "docid": "987f4cc305fa4fe7578486bce9617885", "score": "0.61962974", "text": "def total_pages\n total_pages = Number.total / Number.per_page\n if (Number.total % Number.per_page) > 0\n total_pages += 1\n end\n total_pages\n end", "title": "" } ]
838a4d4674d9e851a6ce5a11a244dcbe
Update info on one organization
[ { "docid": "3f94e878d8bda82efec8d74a0d152acb", "score": "0.0", "text": "def organization_id_put(id, opts = {})\n organization_id_put_with_http_info(id, opts)\n nil\n end", "title": "" } ]
[ { "docid": "9112e583c896ad6881286b8b67546aa0", "score": "0.77424484", "text": "def update\n\n #@organization = Organization.update(organization_params)\n #@project.something_special!\n update!\n end", "title": "" }, { "docid": "bd230d60c3aebe873863c8feb0e4c0bd", "score": "0.76146144", "text": "def update\n @organization = Organization.find(params[:id])\n @organization.update_attributes(params[:organization])\n \n respond_with(@organization, :location => admin_organizations_path)\n end", "title": "" }, { "docid": "b046591cc451759a68e3a7e3073beb27", "score": "0.75457805", "text": "def update\n if @organization.update(organization_params)\n render_json_object(@organization)\n else\n implement_status(\"create\",\"error\")\n end\n end", "title": "" }, { "docid": "ffb4523035f4db7609e4bb1f8d7a50ad", "score": "0.75354356", "text": "def update\n\t\t@organization = Organization.find(params[:id])\n\n\t\t@organization.modified_by = 1\n\n\t\tif @organization.update_attributes(params[:organization])\n\t\t\t\tflash[:notice] = 'Organizaiton Updated Sucessfully.'\n\t\t\t\tredirect_to :action => 'show', :id => @organization\n\t\telse\n\t\t\t\trender :action => 'edit'\n\t\tend\n\tend", "title": "" }, { "docid": "3310a6600886b05f26255cc1df18bc20", "score": "0.7507172", "text": "def update\n @breadcrumb = 'update'\n @organization = Organization.find(params[:id])\n @organization.updated_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization,\n notice: (crud_notice('updated', @organization) + \"#{undo_link(@organization)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4f51ac1f60d95b6a35bd39cf958bf01d", "score": "0.74914044", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n flash[:notice] = 'Organization was successfully updated.'\n format.html { redirect_to orgadmin_organization_url(@organization) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d298fe1f25a64b7add436cb9484718f", "score": "0.7466468", "text": "def update\n if @current_organization.update(organization_params)\n render json: @current_organization, serializer: OrganizationSerializer\n else\n render json: @current_organization.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f3da8df04560e8359cfe0cb3e6071640", "score": "0.74542487", "text": "def update\n respond_to do |format|\n if @org.update(org_params)\n format.html { redirect_to [:admin, @org], notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: [:admin, @org] }\n else\n format.html { render :edit }\n format.json { render json: @org.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0eaeebeac0ba1319f7e6a72f26261626", "score": "0.7447808", "text": "def update\n @organization = Organization.find_by_id(current_user.organization_id)\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to dashboard_path, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac3c23a7c48e3b7f7208c8fbfb8a878c", "score": "0.7441372", "text": "def update\n @admin_organization = Admin::Organization.find(params[:id])\n\n respond_to do |format|\n if @admin_organization.update_attributes(params[:admin_organization])\n format.html { redirect_to admin_organizations_url, notice: 'Organização atualizada com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a43604cee0fc3849df8f2cfd4141fac", "score": "0.74343127", "text": "def update\n @organization = Organization.find(params[:id])\n\n @organization.assign_attributes(params[:organization])\n\n add_missing_translation_content(@organization.organization_translations)\n\n respond_to do |format|\n if @organization.save\n format.html { redirect_to admin_organizations_path, notice: t('app.msgs.success_updated', :obj => t('activerecord.models.organization')) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "298db0bb4ccd8e1d9c9f2cc9f910ad32", "score": "0.74033403", "text": "def update\n flash[:notice] = 'The organization was successfully updated.' if organization.update_attributes(params[:organization])\n respond_with(organization)\n end", "title": "" }, { "docid": "064d7e002f4db5e9e4881d0ce37efb09", "score": "0.740196", "text": "def update(organization_name, body)\n @client.organization.update(organization_name, body)\n end", "title": "" }, { "docid": "57c0dc8a6feb7795c1d6a66c79cdfecd", "score": "0.7383883", "text": "def update\n @organization.update(organization_params)\n respond_with(@organization)\n end", "title": "" }, { "docid": "7e349a733f12f853e6d9f36b7ca31a96", "score": "0.7366047", "text": "def update\n @organization = Organization.find(params[:id])\n \n if @organization.update(organization_params)\n redirect_to @organization\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "9ffbb2a46d5b3ce00e9edd0e38ca5fbb", "score": "0.733807", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization]).put\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f6bad825433977b97a36840d97bdaf71", "score": "0.73185766", "text": "def update\n @organization = Organization.find(params[:id])\n if @organization.update_attributes(organization_params)\n flash[:success] = \"Profile updated\"\n redirect_to @organization\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "8563bf2f705150744b8c62baee68dbdc", "score": "0.7312809", "text": "def update\n @organization = Organization.find(params[:id])\n @card_info = CardInfo.new(params[:card_info])\n unless @card_info.missing?\n @card_info.organization_id = @organization.id\n begin\n @card_info.save!\n rescue Exception => e\n failure \"#{e.message}\"\n end\n end\n if @organization.update_attributes(params[:organization])\n flash[:notice] = 'Organization was successfully updated.'\n else\n failure 'Uanble to update Organization.'\n end\n unless @fail\n redirect_to organization_url(@organization)\n else\n @administrators = Administrator.find(:all, :order => \"last_name\")\n @creditworth = Creditworth.find(:all, :order => 'sort_order')\n @integrity = Integrity.find(:all, :order => 'sort_order')\n @timeliness = Timeliness.find(:all, :order => 'sort_order')\n flash[:error] = @err_msg\n render :action => \"edit\"\n end\n end", "title": "" }, { "docid": "781d3b77d93afa54b15114eb0702933b", "score": "0.73113406", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "781d3b77d93afa54b15114eb0702933b", "score": "0.73113406", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6616bef843b1b15ce74789929ca79e31", "score": "0.7296769", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6616bef843b1b15ce74789929ca79e31", "score": "0.7296769", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6616bef843b1b15ce74789929ca79e31", "score": "0.7296769", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6616bef843b1b15ce74789929ca79e31", "score": "0.7296769", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bfb87b934c2e9989583dc2d08e46bb8a", "score": "0.7290303", "text": "def update\n @organization = User::Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n flash[:notice] = 'User::Organization was successfully updated.'\n format.html { redirect_to(@organization) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c645baac3bf1a50a65c7e79f6294f19", "score": "0.7289522", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to(organizations_url, :notice => Russian.t(:organization) + ' ' + Russian.t(:was_updated_success)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "39e74b257350648abddbc8da4a58887a", "score": "0.7286819", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to organizations_path, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a994edb5f54b29f4fe4bb96d57a26a80", "score": "0.7284598", "text": "def update\n raise Request::NoRequiredFields if params[:org][:name].blank? || params[:org][:town_id].blank? || params[:org][:street_id].blank? || params[:org][:house].blank?\n Org.check(params[:org])\n Request.add( params[:id], current_user, \"org\", \"edit\", { :original_record_id => params[:id], :edit_record => params[:org] } )\n respond_success \"Спасибо, Ваш запрос отправлен\", requests_path\n rescue ActiveRecord::RecordInvalid, ActiveRecord::RecordNotSaved => e\n respond_error\n rescue Org::RecordExist, Request::NoRequiredFields => e\n respond_error e.message\n end", "title": "" }, { "docid": "76d4438b16071032940c46d4d731f280", "score": "0.7278071", "text": "def update\n return if !@write_access\n @organization.updated_by = @current_user.username unless @current_user.nil?\n if isAssociatedOrgUpdate\n saveAndRenderAssociatedOrgs\n elsif @organization.source_context_id == @ctrpId || @organization.source_context_id == @ctepId\n saveAndRenderUpdatedOrg\n end\n end", "title": "" }, { "docid": "257d075a6cf47dd0d4e563e22083d9da", "score": "0.7270601", "text": "def update\n @organization = Organization.find(params[:id])\n params[:organization][:admin_email_to_add] = params[:organization_admin_email_to_add] if params[:organization]\n unless current_user.try(:can_edit?,@organization)\n flash[:notice] = \"You don't have permission\"\n redirect_to organization_path(params[:id]) and return false\n end\n respond_to do |format|\n if @organization.update_attributes_with_admin(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "630888e46efaba3eb22486ad4ea317df", "score": "0.7263669", "text": "def update\n if @org.update(org_params)\n render :show, status: :ok, location: @org\n else\n render json: @org.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "b7162c44c5ab06c6456de6f686723b5a", "score": "0.72626597", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to(@organization, :notice => 'Organization was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4fcec248357c464da8669728754c4bd", "score": "0.7257818", "text": "def update(attrs, user = @@default_user)\n attrs = { id: @id }.merge(attrs)\n @attributes = send_request(\"organizations/#{attrs[:id]}\", :put) do |req|\n req.body = {\n organization: attrs.except(:id),\n auth_token: user.auth_token\n }\n end\n end", "title": "" }, { "docid": "1b2e364a0262296fb3fccef8dd209fac", "score": "0.7242557", "text": "def update\n @organization = Organization.find(params[:id])\n \n if (user_signed_in? && current_user.admin?) || (!current_organization_account.nil? && @organization.id == current_organization_account.organization_id)\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n if @organization.url[0..3] != \"http\"\n @organization.url = \"http://\"+@organization.url\n @organization.save!\n end\n format.html { redirect_to @organization }\n format.json { respond_with_bip(@organization) }\n else\n format.html { render :action => \"show\" }\n format.json { respond_with_bip(@organization) } \n end\n end\n else\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "2aa1bed34c9a400b0841b811e2ce2806", "score": "0.72107613", "text": "def update\n respond_to do |format|\n if @organization.update(orgadmin_params)\n puts params[:name]\n puts @organization.name\n puts orgadmin_params\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "84d6861f9442a137fb9b3239d52ac848", "score": "0.7210403", "text": "def ic_update_from_organization\n organization = params[:org]\n if organization != '0'\n @organization = Organization.find(organization)\n @stores = @organization.blank? ? stores_dropdown : @organization.stores.order(:name)\n @families = @organization.blank? ? families_dropdown : @organization.product_families.order(:family_code)\n @products = @organization.blank? ? products_dropdown : @organization.products.order(:product_code)\n else\n @stores = stores_dropdown\n @families = families_dropdown\n @products = products_dropdown\n end\n # Products array\n @products_dropdown = products_array(@products)\n # Setup JSON\n @json_data = { \"store\" => @stores, \"product\" => @products_dropdown }\n render json: @json_data\n end", "title": "" }, { "docid": "6c62a25d4410eabeef3860af7f5d36da", "score": "0.7206486", "text": "def update\n if @organization\n if @organization.update(organization_params)\n save_innovations\n render json: @organization.to_json(:include => :innovations)\n else\n render json: @organization.errors, status: :unprocessable_entity\n end\n else\n render json: { error: \"No organization with id: #{params[:id]}\"}, status: 400\n end\n end", "title": "" }, { "docid": "13f3ef25a4eccc13fd1541eb3b0ae182", "score": "0.7190451", "text": "def update\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a78951412ca4a227c0f7ae8f86c16a16", "score": "0.71690714", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to root_path, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.71488625", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eeb08bfa621d1c870b3c020ff224a398", "score": "0.7143408", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to organizations_url, notice: '机构信息已成功修改.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9fee005da98b46cc4e753fba0223ed56", "score": "0.71396697", "text": "def update\n @organisation.update_attributes(organisation_params)\n end", "title": "" }, { "docid": "8f856448aa8e15b3d5f20c4c9ac2f0d7", "score": "0.71396476", "text": "def update\n respond_to do |format|\n if organization_params.present? && @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3fdf2d78602aa34f5ef313df0b98ff59", "score": "0.71387166", "text": "def update\n @org = Org.find(params[:id])\n\n if @org.update_attributes(params[:org])\n flash[:success] = 'Org was successfully created.'\n redirect_to @org \n else\n render action: \"edit\"\n end\n end", "title": "" }, { "docid": "7aae0d5f5a1d12fbb813de2f5554522a", "score": "0.7138092", "text": "def update\n respond_to do |format|\n if @organization.update(org_params)\n format.html { redirect_to @organization }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: {errors: @organization.errors.full_messages}, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "575056ccda2d6337b2c4b9b8372a1949", "score": "0.7136236", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: \"Organization was successfully updated.\" }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "12840f57f1a8fc0d54ea419abc5ed92d", "score": "0.71295476", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: \"Organization #{@organization.name} was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6caff4189c59eff580d09f5b23414efc", "score": "0.712646", "text": "def update\n @organization = Organization.find(params[:id])\n @organization.update_attributes(params[:organization])\n respond_to do |format|\n if @organization.save\n format.html { redirect_to @organization, notice: 'Organization was successfully updated..' }\n format.json { respond_with_bip(@organization) }\n else\n format.html { render action: \"new\" }\n format.json { respond_with_bip(@organization) }\n end\n end\n end", "title": "" }, { "docid": "97ea82b3f06a744e01642cf9fdee1d41", "score": "0.7120246", "text": "def update_organization_membership(org, options = T.unsafe(nil)); end", "title": "" }, { "docid": "dd6ddb9156acbb59199d2af00efe9b23", "score": "0.71176344", "text": "def update\n @hDisplay = true\n @orgUser = true\n @org_id = params[:id]\n @Neworganization = Organization.find(params[:id])\n @userC = session[:user]\n @organization = Organization.find(params[:id])\n allorganizations = Organization.find(:all)\n @organizations = Hash.new\n \n \n @partner_id = Partner.find_by_sql [\"SELECT * FROM partners where organization_id = ?\",@id]\n @partnerNames = []\n for currentPartner in @partner_id\n partnerID = currentPartner.partner_org_id \n @partnerOrganization = Organization.find(partnerID)\n @partnerNames.push @partnerOrganization.name\n end\n \n for organization in allorganizations do\n if(organization.visible== true)\n @organizations.merge!({organization.name => organization.id})\n end\n end\n users = []\n users = User.find_by_sql [\"SELECT * FROM users where affiliateOrg =?\",@Neworganization.name];\n if @Neworganization.update_attributes(params[:organization])\n flash[:notice] = 'Organization was successfully updated.'\n for user in users\n user.update_attribute(:affiliateOrg,@Neworganization.name)\n end\n redirect_to(@Neworganization)\n else\n render :action => \"edit\" \n \n end\n \n end", "title": "" }, { "docid": "6830229db1678450707969491a14cc34", "score": "0.7117523", "text": "def update\n user = User.find_by_id(params[:id])\n UserOrganizationClaimer.new(self, user, current_user).call(params[:organization_id])\n end", "title": "" }, { "docid": "d9adfa3f9fdada73e2cf7a461d93ae66", "score": "0.7114959", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(organization_params)\n flash[:notice] = ts('edit.successful', :what => Organization.model_name.human.capitalize)\n format.html { redirect_to organization_url(@organization) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "1e77ba5383db91de1bf766bf590ad46d", "score": "0.7109722", "text": "def update\n @organization = Irm::Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:irm_organization])\n format.html { redirect_to({:action=>\"index\"},:notice => (t :successfully_updated)) }\n format.xml { head :ok }\n else\n @error = @organization\n format.html { render \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9bb6d00d62bbe7a5837240e110f65b79", "score": "0.7100783", "text": "def update\n @org_detail = OrgDetail.find(params[:id])\n\n respond_to do |format|\n if @org_detail.update_attributes(params[:org_detail])\n format.html { redirect_to @org_detail, notice: 'Org detail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @org_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "602ed86f3be1eaef4608d24cc4c7f868", "score": "0.7099356", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: \"Organization was successfully updated.\" }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea13b943bea972c195b8e76af85453b3", "score": "0.7092322", "text": "def update\n if @organization.update_attributes(organization_params)\n flash[:success] = 'Organization Successfully Updated!'\n redirect_to controller: 'organizations', action: 'show', id: @organization.id\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "dfe3bcf2af161c7f799558f6712f0503", "score": "0.7076025", "text": "def update\n\t\trespond_to do |format|\n\t\t\tif @organization.update(organization_params)\n\t\t\t\tflash[:success] = \"Organization was successfully updated\" \n\t\t\t\tformat.html { redirect_to @organization}\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'edit' }\n\t\t\t\tformat.json { render json: @organization.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "0d55bf11ab8e4a45a8f55db9b814850f", "score": "0.7068622", "text": "def update\n @organization_extra = OrganizationExtra.find(params[:id])\n\n respond_to do |format|\n if @organization_extra.update_attributes(params[:organization_extra])\n format.html { redirect_to @organization_extra, :notice => 'Organization extra was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @organization_extra.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85fe619bc26a2407224a83ee3da34c88", "score": "0.7067417", "text": "def update\n respond_to do |format|\n if @organization.update_attributes(organization_params)\n format.html { redirect_to organization_path(@organization), notice: 'Organization was successfully updated.'}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "089cfb3387a1d7504409feb6fd6fac0e", "score": "0.70595044", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c3302f9bc6381d0a8f4750c5298b9a1", "score": "0.7058651", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to :back, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5879d7a30258c5d9564d5f88e06ff80", "score": "0.7051305", "text": "def update_aliquot_owner\n\t\tself.aliquot.update_column(:owner_id, self.to_organization.id)\n\tend", "title": "" }, { "docid": "54e6f97875284b90e2d02b51498763b2", "score": "0.70498025", "text": "def update\n respond_to do |format|\n if @org.update(org_params)\n format.html { redirect_to @org, notice: 'Org was successfully updated.' }\n format.json { render :show, status: :ok, location: @org }\n else\n format.html { render :edit }\n format.json { render json: @org.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "783845ff89d6658afae9d9c5fe3a3a29", "score": "0.7048262", "text": "def update\n if @organization.update(organization_params)\n render json: @organization.as_json\n else\n render json: {\n errors: Stitches::Errors.from_active_record_object(@organization)\n }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "312041471db5b4413e509b07a43243fd", "score": "0.7044223", "text": "def update_org_id\n Milestone.all.each do | m |\n m.update_attributes(:organization_id => m.time_unit.organization_id)\n end\n\n render status: :ok,\n json: {\n info: \"Updated all milestones\"\n }\n end", "title": "" }, { "docid": "c3d28e18b0aa5728d104942b895222b6", "score": "0.7043618", "text": "def update\n @user_organization = UserOrganization.find(params[:id])\n\n if @user_organization.update(user_organization_params)\n head :no_content\n else\n render json: @user_organization.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3ca8a6cba709d1adde5f159231a22b4c", "score": "0.7032866", "text": "def update_org(org_name, change)\n if org_name == \"Dumbledore's Army\"\n self.update(dumbledores_army: change)\n elsif org_name == \"Order of the Phoenix\"\n self.update(order_of_the_phoenix: change)\n else\n puts \"Sorry, you didn't enter a valid org id\"\n end\n end", "title": "" }, { "docid": "2fe9850fdea2eafc47ccf8f4cb63788a", "score": "0.7023891", "text": "def update\n @org = Org.find(params[:id])\n\n respond_to do |format|\n if @org.update_attributes(params[:org])\n format.html { redirect_to @org, notice: 'Org was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @org.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "662a690f115a4098804066fac3727e26", "score": "0.7013542", "text": "def update\n flash[:success] = 'Your organization has been updated.' if @organization.update(organization_params)\n respond_with @organization\n end", "title": "" }, { "docid": "0c90050dffab98428c139bfcdb8d601f", "score": "0.6999991", "text": "def update\n\n # @person = @organization.people.find( params[:id])\n\n respond_to do |format|\n if @person.update( person_params )\n format.html { redirect_to [@organization, @person], notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8cdf4f1020179e3105a4a5a70ca94ac", "score": "0.6990008", "text": "def update_organization_from_company\n organization_id = 0;\n \n if params[:box] != '0'\n company = Company.find(params[:box])\n if !company.nil?\n organization_id = company.organization_id\n end\n end\n\n @json_data = { \"organization_id\" => organization_id }\n\n respond_to do |format|\n format.html # update_company_organization_from_office.html.erb does not exist! JSON only\n format.json { render json: @json_data }\n end\n end", "title": "" }, { "docid": "d4278955ce70b54ff5f7f7c8e1afa774", "score": "0.69852155", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to admin_organizations_path(:locale => I18n.locale)}\n\t format.json { head :no_content }\n else\n format.html { redirect_to admin_organization_path(@organization,locale: I18n.locale), notice: @organization.errors.full_messages }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da6a2e29d6b95af703b23210ecc1fce7", "score": "0.69776106", "text": "def update\n respond_to do |format|\n if @org.update(org_params)\n format.html { redirect_to @org, notice: t('.update_ok', item: @org.abbreviation) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @org.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd3b6e72630518cd675e6e417c2a0b35", "score": "0.6973868", "text": "def update_aliquot_owner\n\t\tself.aliquot.update_attribute(:owner, self.to_organization)\n\tend", "title": "" }, { "docid": "be85febea42c7b81af03eae39b2e2bea", "score": "0.6972863", "text": "def update\n @organization = Organization.find(params[:organization_id])\n @cao = Cao.find(params[:id])\n respond_to do |format|\n if @cao.update_attributes(params[:cao])\n flash[:notice] = VALIDATION_MESSAGE[\"COA\"][\"UPDATE\"]\n format.html { redirect_to admin_organization_cao_path(@organization.id, @cao.id)}\n else\n flash[:error] = @cao.errors.full_messages.join(\", \")\n format.html { render :action => \"edit\",:id => @organization.id }\n end\n end\n end", "title": "" }, { "docid": "4ac21ffe5924034fe59f6d4e28f7fb20", "score": "0.69707507", "text": "def update\n respond_to do |format|\n if @org.update(org_params)\n format.html { redirect_to :back, flash: { success: 'Org was successfully updated.'} }\n format.json { render :show, status: :ok, location: @org }\n else\n format.html { render :edit }\n format.json { render json: @org.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9625798be3fc25129cb8c821b1ad819d", "score": "0.6961507", "text": "def update\n respond_to do |format|\n if @organization_detail.update(organization_detail_params)\n format.html { redirect_to @organization_detail, notice: 'Organization detail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @organization_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87f68c40c2d06e2c223c9e52629919fb", "score": "0.6960865", "text": "def update\n unless @org.update(org_params) && set_location\n render json: @org.errors, status: :unprocessable_entity\n return\n end\n render json: @org\n end", "title": "" }, { "docid": "7d69c72a5312f08331c3383051ab2e17", "score": "0.69596595", "text": "def update\n authorize @organization\n respond_to do |format|\n if @organization.update(organization_params)\n flash[:success] = t('flashes.update', model: Organization.model_name.human)\n format.html { redirect_to @organization}\n format.json { render :show, status: :ok, location: @organization }\n protocol_action(\"редактирование организации #{@organization.name}\")\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98e1b9d4b2c38fe4e7c1a440d35f5652", "score": "0.6954389", "text": "def set_organization\n @organization = Organization.find(params[:name])\n end", "title": "" }, { "docid": "64af0731ab1201a86ea64939f90346cf", "score": "0.69506574", "text": "def update\n @org = Org.find(params[:id])\n\n respond_to do |format|\n if @org.update_attributes(params[:org])\n format.html { redirect_to(@org, :notice => 'Org was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @org.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "350895f8e5cf1d22c6fab188dd6965d3", "score": "0.69392604", "text": "def update\n @organization = Organization.find(params[:id])\n \n if params[:organization_type] == \"School\"\n if @organization.class == Organization\n @organization.update_attribute(:type, \"School\")\n @organization.reload\n else\n params[:organization] = params[:school]\n end\n end\n \n if params[:organization_type] == \"Organization\" && @organization.class == School\n params[:organization] = params[:school]\n @organization.update_attribute(:type, \"Organization\")\n @organization = Organization.find(params[:id])\n end\n \n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n flash[:notice] = 'Organization was successfully updated.'\n format.html { redirect_to(redirect_to_path || admin_organization_path(@organization)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1282ccae06af502827430028a9f5ae95", "score": "0.6929407", "text": "def update\n @organization.social_link = @social_link\n @organization.feature = @feature\n @organization.organization_theme = @organization_theme\n render json: @organization.errors unless @organization.update(filtered_org_params)\n end", "title": "" }, { "docid": "0ad993161d55f1ad909fbc1f01d513b4", "score": "0.6923126", "text": "def update\n @user_org = UserOrg.find(params[:id])\n\n if @user_org.update(user_org_params)\n head :no_content\n else\n render json: @user_org.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "72d96469dce271fc9def56e41d88a400", "score": "0.6920079", "text": "def set_orgadmin\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "3a6ac4ba967d3d451671b68b4628a24f", "score": "0.68987757", "text": "def update\n old_ids = @organization.member_ids.dup\n respond_to do |format|\n if @organization.update(organization_params)\n new_ids = Organization.find(@organization.id).member_ids\n changed_ids = (old_ids-new_ids) + (new_ids-old_ids)\n @organization.accessible_oauth_apps.each do |app|\n UpdateAppAccessorsJob.perform_later(app.id, changed_ids)\n end\n format.html { redirect_to settings_organizations_path, notice: \"Organization was successfully updated.\" }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f6fd99c1f034f72114e60f3c3d19c8e", "score": "0.6884812", "text": "def update\n @head_organization = HeadOrganization.find(params[:id])\n\n respond_to do |format|\n if @head_organization.update_attributes(params[:head_organization])\n format.html { redirect_to @head_organization, notice: 'Head organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @head_organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a165357ad6b2819d5e980d6169ff296", "score": "0.6859101", "text": "def set_organization\n @organization = Organization.find(params[:organization_id])\n end", "title": "" }, { "docid": "6a165357ad6b2819d5e980d6169ff296", "score": "0.6859101", "text": "def set_organization\n @organization = Organization.find(params[:organization_id])\n end", "title": "" } ]